15,181 Topics
| |
I downloaded Python 3.2.3 from the python.org web site. However, when I click to launch the python command line the initial message from windows is as follows: "Please waite while windows configures python 3.2.3. Using this link Python 3.2.3 Windows x86 MSI Installer (Windows binary -- does not include source) … | |
I am new to python. How to instantiate object from parsing a file? I got a error. File "/home/Bunny.py", line 23, in main mapgrid[i].append(Spot(myLine[j] == 'B')) TypeError: 'module' object is not callable The first line of input is the number of simulations. The next line isthe number of minutes for … | |
Just a quick question, why does the first findall print out hello but the second just gives me brackets with nothing in them. I want it to show me everything that matched. Which in this case should be everything. k = "hello there how are you" print re.findall(r'hello',k) print re.findall(r'\w+',k) | |
def main(): celsius = float(input("What is the Celsius temperature? ") fahrenheit = (9/5) * celsius + 32 print ("The temperature is ", fahrenheit, " degrees Fahrenheit.") main() error output: Syntax Error:(line 8) fahrenheit = (9/5) * celsius + 32 This makes perfect sense to me. How can i fix this … | |
Hello all, first time poster here. I've tried searching for a thread which deals with my current problem both here and in Google, but few people seem to need help with PyFluidSynth as compared to Jack, so I am starting a new thread. If anyone knows of another thread where … | |
this is my first attempt to implement OOP. IS this class ok?(in terms of structure) AND another Question: there are some folders in message application in Symbian phones and sometimes there are up to 1000 messages in each folders. I do itterate over all messages for gathering their info about … | |
This snippet allows one to implement an equivalent of a `__getattr__()` function in a python module. The module can then define its own way to lazily import abitrary symbols. For example the module can contain infinitely many names or load values from other modules on demand. There are many implementations … | |
Well, I'm making a tic-tac-toe game in Python **2.7**, and I need a code snippet to "make" the AI want to get a Tic-Tac-Toe, and make the game end if there's a **draw**. What can I do? This is the code as it is: # Python Tic Tac Toe import … | |
hi i've recently been learning about python on cssciencecircles.com. After a while i decided to download it so i can save some of my programmes. When i make a programme in the IDLE shell and save it, even the most simple instructions, eg. print('hello world') , when i try to … | |
Having a hard time getting this to work. options = [ 'option 1', 'option 2', 'option 3' ] for x in range(len(options)): Opt = str(x + 1) print('(' + Opt + ')', options[x]) while True: try: playerOpt = int(input('input ')) check = 'fail' for x in range(len(options)): Opt = x … | |
Hi, I am writing some code for android using python. I want to control the visibility of bluetooth ( i.e on or off of the bluetooth visibility) using some python script. Can you please help me ? | |
Hi! I have a beginners problem I really need some help with. First of all, here is my current program: def texten(): filehandle=open ( 'savetonight.txt', 'r' ) text=filehandle.read() return text def smabokstavertext(): texten() print text.lower() I basically want my function smabokstavertext() to call the first function texten() and then print … | |
hi guys .. Im here again ! I dont know how to explain this .. Here's my example : [url]http://desmond.imageshack.us/Himg228/scaled.php?server=228&filename=screenshotzjj.jpg&res=landing[/url] i want to know how to make a code like my example .. An icons and a cursor ! Im using s60v2 os8.1 .. Thanks ! | |
Hello everyone .. Im new in python and i have a question ! How to compile myfile.py to myfile.pyo ? Can you give me an example script coz i dont know were to put python -0 to compile it into pyo ! Thanks a lot .. | |
it is possible to start a python apps when you start your phone ? Im using s60v2 N70-1 .. Is there a python code autostart for my phone ? Please help .. | |
Can anyone HELP me for my problem .. Im a newbie in python ! I want to create a script to rename files in a dir. that dir has 400 files .png .. startswith 001.png , 002.png to 400.png ! I want to rename them startswith 000.png to 399.png .. … | |
movies = ["The Holy Grail", 1975, "Terry Jones & Terry Gilliam", 91, ["Graham Chapman", ["Michael Palin", "John Cleese", "Terry Gilliam", "Eric Idle", "Terry Jones"]]] print(movies[4][1][3]) In the above code, how does [4][1][3] result in "Eric Idle"? It looks to me like the 4 selects Eric Idle becaue it's the 4th … | |
I'm trying to figure out how to use '%s'. I looked it up in the python docs but it never actually shows how to use it. This is the line I'm working on right now just to figure it out. It is the first one of different variations where the … | |
I've playing with pygame a little and reading about it and i tried to make a simple rock paper scrissors game. I can't seem to get fullscreen working. Everything i've tried or read didnt work. Can u please help me? thanks | |
hello! I'd like to rank a numpy array without getting the number positions changed. I was able to do it using the numpy function below but it keeps ranking the 'NaN' values as well, how can I get it to ignore them and just rank the real number values instead. … | |
I'm trying to do something simple like get calc.exe to start minimized, but it's not happening. import subprocess import win32gui import win32con info = subprocess.STARTUPINFO() info.dwFlags |= subprocess.STARTF_USESHOWWINDOW info.wShowWindow = win32con.SW_SHOWMINIMIZED x = subprocess.Popen("calc.exe", startupinfo = info) It pops up the same as always, no matter what I provide for … | |
I've got an application that I call several times in a for loop using subprocess.call. Every time I call it, it starts minimized. I want it to be in a restored window. So what I've tried to do is get a handle on the window using win32gui.FindWindow. But in my … | |
Ok Guys, got a question on a nested list and how to return the values from it. Writing a scout script for a game I play. The return is this: [[278,278,-1,[25076,u'name',3,6,u'',0,0,1,[0,0,None,5]]]] [[278,279,-1,[25076,u'name',3,6,u'',0,0,1,[0,0,None,5]]]] I'm wanting to place the coordinates i.e. 278 and 279 along with the 3rd value in this case … | |
data = open('sketch.txt') for each_line in data: try: (role, line_spoken) = each_line.split(':', 1) print(role, end='') print(' said: ', end='') print(line_spoken, end='') except: pass data.close() I'M gettin the following error when I run this code but it looks exactly like what I'M seeing in my Head First book. File "sketch.py", line … | |
I'M trying to find the python3 file that would be the counterpart to the python3.exe in Windows. I want to point Geany to pyton3 rather that 2.7 which it's pointing to now. I don't even know if I found the right directory or not but I've attached a screenshot from … | |
I have a small Python program that should react to pushing the up button by running an appropriate method. But instead of doing this, it gives me a confusing error... from tkinter import * class App: def __init__(self, master): self.left = 0 self.right = 0 widget = Label(master, text='Hello bind … | |
I've been strugglin with this all day. I'm trying to use python to walk through a registry key and delete all the values it finds. I've succeeded in getting it to find all the nested values, but as soon as I try to delete one, I'm met with "WindowsError: [Error … | |
how would you add a scroll bar to this code [CODE] import site # for exemaker import tkMessageBox from Tkinter import * import os, sys TITLE = "Pydit" class RoomEditor(Text, object): def __init__(self, master, **options): Text.__init__(self, master, **options) self.config( borderwidth=0, #font="{Lucida Sans Typewriter} 14", #font="{OCR A Std} 14", font="{Terminal} 14", … | |
My name is Danielle Jacob and I am a Masters (through) Research student at Bangor University, North Wales. *[email removed]* I have been using Python now for about 3 months (but only once a fortnight for a few hours at a time...so I am still very new) My supervisor extracted … |
The End.