473,796 Members | 2,661 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python Forum

Python programming language - Ask questions about python interpreter, control flow, data structures, modules errors, classes, standard library, gui, databases, unit testing, object oriented, structured programming and more.
3
1,846
thread by: Matthew | last post Jul 18 '05 by: Matthew
I am have written a medium sized program and everything works fine except for one piece. At a certain point in the program I want to do a simple user confirmation, eg Are you sure ? y/n. The problem that I am having is that after the user enters an answer and presses enter, the program executes the rest of the code regardless of what the user...
0
1,117
thread by: c42 | last post Jul 18 '05 by: c42
I'm writing a script that needs a message not to touch the screen while it runs. (Windows NT/2K/XP) I tried win32api.messagebox, but this stops the program until someone clicks on OK. (A response (ie. "OK") is not required.) Any suggestions? Thanks!
1
1,552
thread by: Claus Hemdrup | last post Jul 18 '05 by: Claus Hemdrup
How do I read the B-channel?
0
1,514
thread by: Dean N. Williams | last post Jul 18 '05 by: Dean N. Williams
Dear Python Help, I am trying to install Python with Tkinter on my Mac OS X PowerBook G4 platform, but having some difficulties apparently with missing directories and files. I can build Python without Tkinter okay, but when I try to build with Tkinter it doesn't seem to build the appropriate directories or files. For example, in version...
0
2,770
thread by: peter leonard | last post Jul 18 '05 by: peter leonard
Hi, This is a basic question but I can't figure out what is wron - even after reading the documentation. I have a script that normalizes strings. One of the steps is to convert all fractions too the tag 'fraction'. For example : import re line = "This is the first ratio, 170/37, and this is the second 170/37 " def normalise(text):
0
1,517
thread by: Raymond Hettinger | last post Jul 18 '05 by: Raymond Hettinger
QOTW: "Python seems to encourage and reward incremental effort, and it leads one to explore extensions and improvements to programs because the language makes it relatively easy to see how to do the extensions." -- Ron Stephens "When writing programs in Python, write Python programs" -- Jeff Epler's advice to those forcing themselves to...
2
5,393
thread by: Koen Van Herck | last post Jul 18 '05 by: Koen Van Herck
For debugging/logging purposes, I have a function def Log(msg): print '%s.%s: %s' % (cls, method, msg) I call this function from a class method, and I would like to retrieve the name of the caller method and its class. I already came up with method = sys._getframe(1).f_code.co_name cls = sys._getframe(1).f_locals.__class__
8
3,022
thread by: Peter Abel | last post Jul 18 '05 by: Eric Brunel
Hi all, I'm working under W2k with Python 2.2.2 (#37, Oct 14 2002, 17:02:34) on win32 I have a file *test_data.txt* with the following content: 0123456789 0123456789 abcdefghi ABCDEFGHIJKLMNOPQ
1
1,422
thread by: Indigo Moon Man | last post Jul 18 '05 by: RobE
I'm a complete newbie to Python and have been working the tutorials for only about 4 days (I'm doing 'How to Think Like a Computer Scientist' right now) but I already love this language. It's much easier for me to learn so far than others I have tried, with the possible exception of BASIC. Anyway, I've picked up a lot of good hints from...
1
2,457
thread by: Fazer | last post Jul 18 '05 by: Andrew Bennetts
Hello, I am very interested in fooling around with Twisted Matrix's HTTP Web Server. I was thinking if .rpy scripts would run much faster than traditional CGI scripts? After looking how asynchronous Twisted's framework really is, I have been interested in it. Thanks,
1
1,720
thread by: Roy Smith | last post Jul 18 '05 by: Peter Hansen
What is supposed to happen when an exception is raised and not caught in a thread? The Reference Manual (section 4.2) states "When an exception is not handled at all, the interpreter terminates execution of the program, or returns to its interactive main loop", but it looks like what really happens is the thread is terminated, not the whole...
4
2,532
thread by: Timo Virkkala | last post Jul 18 '05 by: David M. Cooke
I'm creating a system with Python CGIs, that connect to a database. I'm wondering about input validation. Of course I will check the length of the passed parameters, to (hopefully) prevent any DOS attacks. What else do I need to check? Do I need to remove any SQL from the inputs? Anything else I might have overlooked? -- Timo Virkkala |...
11
3,812
thread by: Kasper B. Graversen | last post Jul 18 '05 by: David Eppstein
Having played with Smalltalk for the past month, I'm getting used to passing code as arguments to methods... how easy is it to do this in python? I haven't seen any recent postings on this subject here... \kasper
1
1,347
thread by: Martin | last post Jul 18 '05 by: Irmen de Jong
hi, I need to find a way to check in a XML document if a certain user exist, if not i want to add it in the document. I am able to add it in the xml doc, but I cant make sure he doesnt exist thanks Martin
2
5,091
thread by: Øystein Johansen | last post Jul 18 '05 by: Matthew Wilson
Hi, (This question may be stupid, but I just can't find the answer...) How can I make the browser downlaod a cgi script from /cgi-bin/. Obviously I can't make a link to it with <a=href="/cgi-bin/script.cgi>, since tha script will be executed then. I see how Lutz in PP2E prints the script on the screen, but I want the user to get the...
3
19,074
thread by: David Eppstein | last post Jul 18 '05 by: David Eppstein
Why doesn't this work? >>> import math >>> math.exp(1j*math.pi) Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: can't convert complex to float; use e.g. abs(z) The expected answer, of course, is -1.
0
1,392
thread by: anthony polis | last post Jul 18 '05 by: anthony polis
Hello, I'm new to Python. Is it possible to create a NEW file in Python? I read the tutorial on file input in the documentation but it only explains how to work with existing files. Can someone point me in the right direction? Thanks, Anthony _________________________________________________________________
1
1,478
thread by: Jim Hefferon | last post Jul 18 '05 by: Mox
Hello, I want to try psycopg, the module for Postgres access. I'm having trouble reaching the site for four or five days now. For example, the link on the Python web site's DB Modules page http://initd.org/Software/psycopg times out, as do some other links that Google gives me. Am I looking in the wrong place, or is it just that the...
1
1,684
thread by: Tinmean K.H.Liu | last post Jul 18 '05 by: Anand Pillai
Hi! I install wxPython under WinXP when I want to use some simple sample, there is an error message: File "C:\Python22\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",line 301, in RunScript exec codeObject in __main__.__dict__ File "C:\Documents and Settings\Tinmean\temp_desktop\python_0921\wx1.py", line 3, in ? from frame...
3
5,933
thread by: Gary Richardson | last post Jul 18 '05 by: Michael Peuser
I would like to define a new cursor for use on a Canvas (other than one of those listed in Appendix F of "Python and Tkinter Programming"). A search on Google turned up one bit of code that seemed promising. A slightly simplified version is shown below. This code attempts to eliminate the cursor by defining an invisible one, which is not what...
0
1,093
thread by: Aahz | last post Jul 18 '05 by: Aahz
The DNS problems with starship.python.net appear to be fixed. -- Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/ "It is easier to optimize correct code than to correct optimized code." --Bill Harlan
1
1,786
thread by: Markus von Ehr | last post Jul 18 '05 by: Camilo Olarte
Hi, is it possible to enable/disable a menubutton? My code is like this: menuBar = Pmw.MenuBar(root, hull_relief = 'ridge', hull_borderwidth = 1) menuBar.pack(side=TOP, fill = 'x') menuBar.addmenu('Help', 'help')
1
2,616
thread by: Gregor Lingl | last post Jul 18 '05 by: Michael Peuser
Hi all, The Tkinter PhotoImage Widget can be set to "transparent" with the method blank(). Moreover the color of single pixels or definite regions can be set with method put. I'd like to set single pixels (or some rectangular regions) to "transparent". Can I use put to
3
41,344
thread by: Fernando Armenta | last post Jul 18 '05 by: JZ
How you cut off the ^M at the end of a line? rstrip is not working. string.rstrip(build_number) thanks,
3
2,079
thread by: Gordon Airport | last post Jul 18 '05 by: Fredrik Lundh
None of the online references that I'm using or can find tell you if this can be done. It's standard practice in GUI's to have the handle of a scrollbar sized to be the proportion of total ammount of viewable data to the ammount you can see in the current view region. (I think that explains it, you know what I mean.) I have a scrollbar...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.