14,951 Topics

Member Avatar for
Member Avatar for ejohnson

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) …

Member Avatar for vegaseat
0
493
Member Avatar for Amy_3

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 …

Member Avatar for Xantipius
0
277
Member Avatar for rmbrown09

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)

Member Avatar for rmbrown09
0
58
Member Avatar for littleEuler

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 …

Member Avatar for hughesadam_87
0
108
Member Avatar for mandroid

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 …

0
120
Member Avatar for M.S.

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 …

Member Avatar for M.S.
0
170
Member Avatar for Gribouillis

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 …

Member Avatar for Gribouillis
1
476
Member Avatar for bryceburry

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 …

Member Avatar for TrustyTony
0
431
Member Avatar for dboxall1234

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 …

Member Avatar for dboxall1234
0
732
Member Avatar for rbsmith333

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 …

Member Avatar for rbsmith333
0
182
Member Avatar for supravat

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 ?

Member Avatar for M.S.
0
289
Member Avatar for jim.lindberg1

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 …

Member Avatar for hughesadam_87
0
135
Member Avatar for crishein14

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 !

Member Avatar for M.S.
0
103
Member Avatar for crishein14

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 ..

Member Avatar for M.S.
0
3K
Member Avatar for crishein14

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 ..

Member Avatar for M.S.
0
168
Member Avatar for crishein14

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 .. …

Member Avatar for M.S.
0
165
Member Avatar for lewashby

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 …

Member Avatar for ~s.o.s~
0
140
Member Avatar for rbsmith333

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 …

Member Avatar for rbsmith333
0
1K
Member Avatar for TheSkunkMan

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

Member Avatar for alexpinho98
0
3K
Member Avatar for yindra.puentes

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. …

Member Avatar for TrustyTony
0
382
Member Avatar for oscargrower11

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 …

Member Avatar for TrustyTony
0
337
Member Avatar for oscargrower11

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 …

0
108
Member Avatar for toyotajon93

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 …

Member Avatar for vegaseat
0
193
Member Avatar for lewashby
Member Avatar for lewashby

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 …

Member Avatar for lewashby
0
193
Member Avatar for Kert

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 …

Member Avatar for ZZucker
0
339
Member Avatar for oscargrower11

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 …

Member Avatar for oscargrower11
0
1K
Member Avatar for natehome

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", …

Member Avatar for vegaseat
0
409
Member Avatar for danifj

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 …

Member Avatar for Xantipius
0
147
Member Avatar for ruby.ghata

Hi!! :) Can someone help me to write a code that with sort through a list of strings which are peoples names without using the python sort function. So the rules are : We start with an initial pile containing only the first name in the list. Go through all …

Member Avatar for TrustyTony
-1
181

The End.