15,181 Topics
| |
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 … | |
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 … | |
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 | |
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, … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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? | |
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)') … | |
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? | |
[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: … | |
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 | |
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, … | |
''' 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" % … | |
Hi, could you tell me where I can find some information about regex engine optimizations used by Python regex engine? | |
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 … | |
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 … | |
[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 … | |
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. | |
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 … | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.