| |
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...
|
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!
|
thread by: Claus Hemdrup |
last post Jul 18 '05 by: Claus Hemdrup
How do I read the B-channel?
|
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...
|
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):
|
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...
|
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__
|
| |
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
|
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...
|
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,
|
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...
|
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 |...
|
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
|
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
|
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...
|
| |
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.
|
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
_________________________________________________________________
|
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...
|
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...
|
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...
|
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
|
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')
|
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
|
| |
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,
|
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...
|