15,181 Topics

Member Avatar for
Member Avatar for Noliving

When eval an equation does it follow the PEMDAS rules? For example: 2.0-1.0-3.0*6.0+5.0*4.0 when evaluated equals 3.0 when evaluated by python. To me that doesn't seem correct, I get a much larger number than 3.0 When I evaluate in python eval("6/2*3") it should equal 1 but in python it equals …

Member Avatar for Tech B
1
201
Member Avatar for leviaeon

Hello guys, I am implementing this code that will transfer a string from mobile to a bluetooth device. I have already done the extraction of sms from the inbox and then save it as a text file by the way I am using nokia 6600 as a test phone. Then …

0
55
Member Avatar for jonymanolo

I need run a c++ method from my python program but the c++ method need a few parameters what need for call that method in my python code with the paramethers

Member Avatar for vegaseat
0
300
Member Avatar for SoulMazer

Hi, I'm writing a media player with wxPython and I seem to be having a bit of trouble. In my script, I create a wx.media.MediaCtrl widget; this line of code causes the trouble. On my Linux machine (running wxPython 2.8), this line of code causes no trouble at all. However, …

Member Avatar for vegaseat
0
229
Member Avatar for ygarin

Hi everyone! I wrote a Python 2.5 application, with GUI from Tkinter module. To make it short, the user has to load a file and can start to work on it. I made it Windows executable with py2exe, and installable with Inno, with a file association setting. So now, if …

Member Avatar for Gribouillis
0
405
Member Avatar for Hummdis

I'm using Python and the Python CGI module to do some web development for a system's administrative access page. The problem I have is that the current features allow you to reboot the system, power off the system and stop/start/restart system services. The system is very limited in what's running …

Member Avatar for Hummdis
0
369
Member Avatar for kjock002

i'm writing a program that reads the lines of a file. each line has a name and and number separated by one space. i want to split the string but i only want the number because i'm using it in calculations. i've skimmed through the python docs and i'm still …

Member Avatar for TrustyTony
-3
230
Member Avatar for adam321

[CODE][/CODE] def Given(rn): Given_lengths = [0] * 1000000 def rn2(n): if not Given_lengths[n]: Given_lengths[n] = rn(n) return memoized_lengths[n] return rn2 def cycle_length(n): if n == 1: return 1 if n % 2: return cycle_length(n * 3 + 1) + 1 return cycle_length(n / 2) + 1 def problem(i,j): for x …

Member Avatar for jcao219
0
172
Member Avatar for prashanth s j

Hi all, I tried running the following code. [code] #! /usr/local/bin/python import threading import time print "Press any key to start timer!" input() threadBreak = False def TimeProcess(): while not threadBreak: print "How are you?" print (time.time() - startTime) startTime = time.time() threading.Thread(target = TimeProcess).start() input() threadBreak = True input …

Member Avatar for woooee
0
112
Member Avatar for srk619

im looking for a python mud game example which i could see the coding and make my own mud, the thing is that im very new to mud if i was able to see an example of a game working then i would be able to understand what coding classes …

Member Avatar for ultimatebuster
0
782
Member Avatar for spacemandan

For my CS1 class we have to write a simple battleship game. I'm having trouble even knowing where to begin. After I get a basic skeleton of functions and classes I think I will know where to begin. We have to use the Zelle graphics.py module ANY help would be …

Member Avatar for ultimatebuster
0
87
Member Avatar for ShadyTyrant

Well I have reflected on why my first proposal for a open source project failed. We had no base to build on, and there was to much administrivia that made us loose interest in the project. Since then I have come up with a new project idea. I started simple …

0
99
Member Avatar for jcao219

I personally prefer the 3 syntax over 2, but I notice most of the code snippets in this forum are for Python 2. Is it because we are still in a steady transition from 2 to 3, or is it something else?

Member Avatar for hondros
0
205
Member Avatar for basti!

Hey, can somebody help me. I have to do a programm from school. I a complete newbie in python. Can somebody tell me why my programm doesn't work and what i can do. thanks here it is: [CODE]import matplotlib import numpy import pylab lam = pylab.linspace(0.1,100,1000)*10**-6 pylab.xlabel('Wellenlaenge (mM)') pylab.ylabel('Temperatur (T)') …

Member Avatar for woooee
-3
176
Member Avatar for Soren Werk

I'm getting started with Django on Windows. And the tutorial [URL="http://docs.djangoproject.com/en/dev/intro/tutorial01/"]http://docs.djangoproject.com/en/dev/intro/tutorial01/[/URL] has me running "python manage.py <command>" from a command promt all the time. But I'm wondering: Couldn't I run the manage.py commands from PythonWin or IDLE?

Member Avatar for TrustyTony
0
113
Member Avatar for ITgirl2010

[code=syntax] #calculate the amout of tax due to the tax given income def calTax( income ): tax = 0 if income <25000: tax = income * 0.25 elif income > 25000 and income < 50000: tax = 25000 * 0.25 + (income - 25000) * 0.33 elif income > 50000: …

Member Avatar for JasonHippy
0
1K
Member Avatar for gunbuster363

The methods is so complicated. I want to check the execution time of each statement so that I can modify that part in order to increase speed. Thanks in advance, Raymond

Member Avatar for hondros
0
94
Member Avatar for richardtreier

Maybe you know the mmotps GunZ([URL="http://trinityent.org"]http://trinityent.org/home[/URL]). i have already written a few macros for it (so a program, which clicks and presses the keys for you ingame) with the program actool([URL="http://www.actool.net/"]http://www.actool.net/[/URL]). But i am tired of using this pascal-like programming language... [B]So is there a possibility to get a macro, …

Member Avatar for richardtreier
0
218
Member Avatar for ITgirl2010

''' Calculate the BMI of a person given their height and weight ''' def calcBMI( h, w ): BMI = w / h**2 return BMI def main(): height = float(raw_input("Enter height in metres: ")) weight = float(raw_input("Enter weight in kilos: ")) BMI = calcBMI(height, weight) print "BMI = %0.1f" % …

Member Avatar for ITgirl2010
0
213
Member Avatar for paquerettee

Hi, could you tell me where I can find some information about regex engine optimizations used by Python regex engine?

0
22
Member Avatar for sob_andizzle

i have to write a code that tells the user to enter the amount of minutes they were allowed to use, it has to be between 200 and 800 if it exceeds or goes below then it should print "please enter minutes between 200 and 800" the problem is: if …

Member Avatar for jice
0
142
Member Avatar for kur3k

Hello My english is not good, so pleas - understat me ;-) I have two question about python ;) 1. I'm from poland, in poland letter a == Ä…, z == ź itp. Can i remove polsich letter? example in input - jacek bÄ…k in output - jacek bak I …

Member Avatar for jice
0
667
Member Avatar for Purnima12

[CODE] while True: try: wd = int(input('How wide would you like your letter to be? (5 - 20)' + ': ')) break except ValueError: print ("Oops! That was no valid number. Try again...")[/CODE] If the user inserts a number that is not 5 - 20, I want the program to …

Member Avatar for TrustyTony
0
540
Member Avatar for jozz3

How would you define a recursive function that asks the user for a string and prints it from the outside in. For example, 123456 would print as 162534. Any help would be appreciated.

Member Avatar for jozz3
0
570
Member Avatar for sob_andizzle

please please please help me this is my last program i have to write and i am having difficulty, this could mean a pass or fail. Thank you for your patience and help. I need a very simple code that asks the user, #input the minutes that are allowed how …

Member Avatar for sob_andizzle
0
102
Member Avatar for ihatehippies

[CODE=python]>>> import wx >>> wx.NullBitmap.SubBitmap Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> wx.NullBitmap.SubBitmap File "C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\_gdi.py", line 659, in GetSubBitmap return _gdi_.Bitmap_GetSubBitmap(*args, **kwargs) TypeError: Bitmap_GetSubBitmap() takes exactly 2 arguments (1 given)[/CODE] I didn't call it, I just tried to reference it. happens with all these methods wx.DefaultDateTime.Day …

Member Avatar for ihatehippies
0
222
Member Avatar for ITgirl2010

Ive started with this program def calcFinal(): while True: try: asg1Mark = int(raw_input("Enter Asg1 mark: ")) asg2Mark = int(raw_input("Enter Asg2 mark: ")) examMark = int(raw_input("Enter Exam mark: ")) final = asg1Mark + asg2Mark + examMark return final except ValueError: print 'Please enter only numbers' def mark_check(finalMark): print "Final mark is …

Member Avatar for woooee
0
112
Member Avatar for Stev0

Several weeks ago, I wrote a simple web crawler that was designed to simply retrieve robots.txt from a range of IP addresses. It was entirely CLI based, and I had it working perfectly. As my python experience has increased, I decided to start learning about GUI based programming, and decided …

Member Avatar for Stev0
0
162
Member Avatar for Hoban

First off this is for a homework assignment and I am new to python. I have attempted to tweak an example of how to make a table from another post on this forum but with no luck. Here are my problems: 1) my range is small (0, 1, 0.1) This …

Member Avatar for vegaseat
0
113
Member Avatar for goodwin912

I've got a little app to resize and watermark images. At the moment it only does one at a time but I would like to get it to do a full folder of images in one go. I have done this previously in VB using loops but im new to …

Member Avatar for Tech B
0
229

The End.