Re: socket setdefaulttimeout

2005-08-12 Thread Bryan Olson
Sheila King wrote: > Bryan Olson wrote: [...] >>Under some older threading systems, any system call would block every >>thread in the process, and gethostbyname was notorious for holding things >>up. Some systems offer an asynchronous gethostbyname, but that doesn't >>help users of Python's l

Re: Catching stderr output from graphical apps

2005-08-12 Thread Robert Kern
Christopher Subich wrote: > Bryan Olson wrote: > >>Thanks. >> >>Yeah, guess I was naive to test on Windows and expect that kind >>of process stuff to be portable. I'll be away from Linux for a >>week or so, so this will take me a while. >> >>Further bulletins as events warrant. > > If you can get

Re: win32com: use not possible as normal user

2005-08-12 Thread Tim Roberts
Sibylle Koczian <[EMAIL PROTECTED]> wrote: > >I've installed Python 2.4 and the win32 extensions, using administrator >rights, under Windows XP in "C:\Programme". As this is a directory >without spaces I didn't expect any problems. But now I can't _use_ >win32com as a normal user, because normal

Re: len(sys.argv) in (3,4)

2005-08-12 Thread Tim Roberts
Daniel Schüle <[EMAIL PROTECTED]> wrote: > >I just tried the same code at home and it worked fine >it has to do with windows .. some settings or whatever >(python 2.4.1 installed on both) > >maybe someone have experienced the same problem >and had more luck in solving the puzzle It's an installati

Re: socket setdefaulttimeout

2005-08-12 Thread Sheila King
On 08/12/2005 22:37:22 Bryan Olson <[EMAIL PROTECTED]> wrote: > Sheila King wrote: >> I'm doing DNS lookups [...] it is important to make sure that the socket >> doesn't just hang there waiting for a response. >> After a recent system upgrade to Python 2.4.1 (from 2.2.2) I thought I >> could tak

Re: socket setdefaulttimeout

2005-08-12 Thread Bryan Olson
Sheila King wrote: > I'm doing DNS lookups [...] it is important to make sure > that the socket doesn't just hang there waiting for a response. > > After a recent system upgrade to Python 2.4.1 (from 2.2.2) I thought I > could take advantage of the setdefaulttimeout in the socket module, to >

Re: socket setdefaulttimeout

2005-08-12 Thread Sheila King
I do note that the setdefaulttimeout is accomplishing something in my full program. I am testing some error handling in the code at the moment, and am raising an exception to make the code go into the "except" blocks... The part that sends an error email notice bombed due to socket timeout. (well

Re: Why is this?

2005-08-12 Thread Terry Hancock
On Friday 12 August 2005 05:19 pm, Peter Mott wrote: > Duncan Booth wrote: > > So would you expect: > > > > random.seed(0) > > random.random() + random.random() > > > > and: > > > > random.seed(0) > > random.random() * 2 > > > > to be the same? The first call to random() in each

Re: Dictionary inheritance

2005-08-12 Thread Jordan Rastrick
Talin asked: > Also, on a completely different subject: Has there been much discussion > about extending the use of the 'is' keyword to do type comparisons a la > C# (e.g. "if x is list:") ? > > -- Talin No, is already has a specific, well defined meaning - object identity. IDLE 1.1 >>> a = [1,2

Re: Dictionary inheritance

2005-08-12 Thread Raymond Hettinger
[Talin] > I want to make a dictionary that acts like a class, in other words, > supports inheritance: If you attempt to find a key that isn't present, > it searches a "base" dictionary, which in turn searches its base, and so on. Perhaps the chainmap() recipe will meet your needs: http://aspn.

Re: "Compile time" checking?

2005-08-12 Thread Steve Jorgensen
Since Python does not use manifest typing, there's not much you can do about this, but typeless languages like this are great if you're using a process that finds the errors the compiler would otherwise find. I'm referring, of course, to Test Driven Development (TDD). If you do TDD, you won't mis

Re: UCALC equivalent

2005-08-12 Thread John Machin
Scott David Daniels wrote: > max wrote: > >> Larry Bates <[EMAIL PROTECTED]> wrote in >> news:[EMAIL PROTECTED]: >> >>> Python has built in eval function and doesn't require a library. >> >> >> Are you kidding? Read the original post a little more closely. The >> o.p. is looking for a library tha

socket setdefaulttimeout

2005-08-12 Thread Sheila King
I'm doing DNS lookups on common spam blacklists (such as SpamCop..and others) in an email filtering script. Sometimes, because the DNS server that is resolving the looksup can go down, it is important to make sure that the socket doesn't just hang there waiting for a response. After a recent syste

Re: problem extending tkSimpleDialog.Dialog

2005-08-12 Thread William Gill
Problem solved. I was not properly passing the master widget reference in my frame classes class MyWidget(Frame): def __init__(self, master, columns,rows, trace_write=None): Frame.__init__(self) # here's my mistake ... ... ... should have been: class MyWidget(F

Re: UCALC equivalent

2005-08-12 Thread William Park
Dark Cowherd <[EMAIL PROTECTED]> wrote: > http://www.ucalc.com/mathparser/index.html > > There is a great library called UCALC which allows you to set up an > expression and evaluate it > for e.g. you an define an expression by calling a function in UCALC > then call it with various values of x >

Re: Bug on Python2.3.4 [FreeBSD]?

2005-08-12 Thread Donn Cave
Quoth "Terry Reedy" <[EMAIL PROTECTED]>: | "Donn Cave" <[EMAIL PROTECTED]> wrote in message | news:[EMAIL PROTECTED] | > I don't think Python pretends to have any intentions here, | > it has to take what it gets from the C library fopen(3) | > function. BSD man pages generally say a+ positions th

Re: Jargons of Info Tech industry

2005-08-12 Thread CBFalconer
[EMAIL PROTECTED] wrote: > In comp.lang.perl.misc Xah Lee <[EMAIL PROTECTED]> wrote: > >> The other class of jargon stupidity is from computing practitioners, >> of which the Unix/Perl community is exemplary. For example, the name >> Unix & Perl themselves are good examples of buzzing jargons. Unix

Re: Psyco & Linux

2005-08-12 Thread Steve M
> c/codegen.h:19:3: #error "sorry -- I guess it won't work like that on 64-bits > machines" The first error output by gcc suggests the 64-bit OS might be the problem. But I don't actually know what that error means. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python IDE's

2005-08-12 Thread spe . stani . be
You might try out the next version of SPE 0.7.5.b which will ship with wxGlade for GUI Design and the Python Debugger of Nir Aides. Since 0.7.5.a it's also possible to customize your keyboard shortcuts. Stani http://pythonide.stani.be http://pythonide.stani.be/screenshots -- http://mail.python.

Re: UCALC equivalent

2005-08-12 Thread Dark Cowherd
thx, Well moving to Python from another language needs lots of chanegs inside your head. -- DarkCowherd -- http://mail.python.org/mailman/listinfo/python-list

Re: Running one Python program from another as a different user

2005-08-12 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > Thanks, that looks very promising... > Is there a solution for pre-Python v2.4? I have to have code that works > on 2.x, 0<=x<=4. Do I just use the os.popen instead? import os def run_as(username): pipe = os.popen("su %s" % username, 'w') pipe.write("w

Re: Running one Python program from another as a different user

2005-08-12 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Greetings- > This is on Linux... I have a daemon running as root and I want to > execute another Python program as another user (a regular user). I have > the name of the user and can use the 'pwd' and 'grp' modules to get > that user's user and gr

Re: Text/IDE Python Editor?

2005-08-12 Thread spe . stani . be
Next release of SPE will include the new debugger of Nir Aides to make it complete. Stani http://www.stani.be http://pythonide.stani.be http://pythonide.stani.be/screenshots -- http://mail.python.org/mailman/listinfo/python-list

Re: new python debugger

2005-08-12 Thread spe . stani . be
It will be integrated in the next release of SPE 0.7.5.b, as you can already see screenshots. For those who are impatient, check out the SVN. Stani http://pythonide.stani.be http://pythonide.stani.be/screenshots -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's Exception, and Capitalization

2005-08-12 Thread Ray
Steve M wrote: > You might find the Python Style Guide to be helpful: > > http://www.python.org/doc/essays/styleguide.html Nice! Thanks Steve. Ray -- http://mail.python.org/mailman/listinfo/python-list

Re: How do these Java concepts translate to Python?

2005-08-12 Thread Ray
gene tani wrote: > I think you'll like python. > > http://naeblis.cx/rtomayko/2004/12/15/the-static-method-thing > http://dirtsimple.org/2004/12/java-is-not-python-either.html > > (and python-is-not-java) Thanks gene, these are exactly the stuff I wanna know more about. Ray -- http://mail.pytho

Re: "Compile time" checking?

2005-08-12 Thread spe . stani . be
Hi, If you find something like that, please report it to the bug tracker of SPE with an easy example. Also mention that PyChecker is slow, I might have another look at it. Probably I need to update the version, as SPE ships with the 0.8.13 version. I don't think it's possible to get it already in

new PEP type: Process

2005-08-12 Thread David Goodger
Barry Warsaw and I, the PEP editors, have been discussing the need for a new PEP type lately. Martin von Löwis' PEP 347 was a prime example of a PEP that didn't fit into the existing Standards Track and Informational categories. We agreed upon a new "Process" PEP type. For more information, plea

Re: What are modules really for?

2005-08-12 Thread Mike Meyer
Magnus Lycka <[EMAIL PROTECTED]> writes: > Terry Reedy wrote: >> However, everything is an instance of a class or type. > Except whitespace, comments, operators and statements! > (Did I miss anything?) What makes you think operators qualify as exceptions? >>> type(operator.add) If you're talkin

Re: Why is this?

2005-08-12 Thread Mike Meyer
Peter Mott <[EMAIL PROTECTED]> writes: > If I use concatenation + instead of multiplication * then I get the > result that Jiri expected: > > >>> L = [[]] + [[]] > >>> L[1].append(1) > >>> L > [[], [1]] > > With * both elements are changed: > > >>> L = [[]] * 2 > >>> L[1].append(1) > >>> L >

Re: Writing a small battleship game server in Python

2005-08-12 Thread Paul Rubin
Michael Goettsche <[EMAIL PROTECTED]> writes: > Assuming the server accepts connections in an endless loop, how > would I handle communication without additional threads and create > new games in that loop? Could you give me pseudo-code for this? I've always done this kind of thing with the Socke

Re: Writing a small battleship game server in Python

2005-08-12 Thread Mike Meyer
Michael Goettsche <[EMAIL PROTECTED]> writes: > On Thursday 11 August 2005 18:34, Dan wrote: >> > The server should accept connections from new players and be able to >> > handle multiple games concurrently. >> >> Multiple threads would be the way to go for a real application. But if >> you want t

Re: Cheese shop (was Re: python2.4/site-packages)

2005-08-12 Thread Tim Churches
Michael Hoffman wrote: >Ben Finney wrote: > > > >>Conversely, PyPI is a dull name with no obvious pronunciation, thus >>difficult to remember; whereas Cheese Shop is a short phrase (that can >>be translated), is easy to remember and has easy analogies to its >>actual function. >> >> > >A pla

Re: How to quit a Windows GUI program gracefully with Python under Cygwin?

2005-08-12 Thread KB
Of course, I downloaded the source of 'SendKeys' and installed it under both Cygwin and Python Windows with $ python setup.py install although this did not help me. KB -- http://mail.python.org/mailman/listinfo/python-list

Re: Printing to printer

2005-08-12 Thread Mike Meyer
Kristian Zoerhoff <[EMAIL PROTECTED]> writes: > On 8/11/05, Steve M <[EMAIL PROTECTED]> wrote: >> Kristian Zoerhoff wrote: >> >> > On 8/11/05, Steve M <[EMAIL PROTECTED]> wrote: >> >> Hello, >> >> >> >>I'm having problems sending information from a python >> >> script to a printer. I was

Re: Running one Python program from another as a different user

2005-08-12 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > This is on Linux... I have a daemon running as root and I want to > execute another Python program as another user (a regular user). I have > the name of the user and can use the 'pwd' and 'grp' modules to get > that user's user and group ids. What

tuple assign variables

2005-08-12 Thread dimitri pater
Hello, selecting a record from a MySQL database results in a tuple like this: (('Evelyn', 'Dog', 'No'),) I want to assign every item of that tuple to a variable using this code (deep_list is taken from the Python Cookbook): def deep_list(x):     if type(x)!=type( () ):         return x     return

Re: Bug on Python2.3.4 [FreeBSD]?

2005-08-12 Thread Terry Reedy
"Donn Cave" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I don't think Python pretends to have any intentions here, > it has to take what it gets from the C library fopen(3) > function. BSD man pages generally say a+ positions the > stream at end of file (period.) They claim co

Re: UCALC equivalent

2005-08-12 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Max Erickson <[EMAIL PROTECTED]> wrote: . . . >> The python equivalent: >> >> exec "def area(length,width): return length*width" >> exec "def frac(x): return abs(abs(x) - int(abs(x)))

Re: Cheese shop (was Re: python2.4/site-packages)

2005-08-12 Thread Michael Hoffman
Ben Finney wrote: > Conversely, PyPI is a dull name with no obvious pronunciation, thus > difficult to remember; whereas Cheese Shop is a short phrase (that can > be translated), is easy to remember and has easy analogies to its > actual function. A place you visit where you can never find what y

Re: UCALC equivalent

2005-08-12 Thread Scott David Daniels
Max Erickson wrote: > Scott David Daniels <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > >>max wrote: >> From the web page referenced: >> ... >> cout << ucEval("abc(5)-abc(3,4)*(#b01101 shl 1)") >> << endl; >>The python equivalent: >> ... >> print eval("abc(5

Re: Python Challenge on BBC

2005-08-12 Thread Michael Hoffman
Python Challenge also got mentioned on MetaFilter. But as "Python Challange" [sic]. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Cheese shop (was Re: python2.4/site-packages)

2005-08-12 Thread Ben Finney
Erik Max Francis <[EMAIL PROTECTED]> wrote: > I came across the change a good while back in my Web referrals, not > having heard of it except passively. PyPI was a simple, clear, > unambiguous name; Cheese Shop is just a silly name for no purpose. Conversely, PyPI is a dull name with no obvious p

Re: Psyco & Linux

2005-08-12 Thread fausto_barbuto
"Jeremy Sanders" <[EMAIL PROTECTED]> wrote in message > Fausto Arinos Barbuto wrote: > > The specifics of my system are: > > > > Athlon AMD-64 3300+ > > SuSE 9.3 Professional (64-bit) > > Python 2.4 > > gcc/g++ 3.3.5 > Ummm... I thought psyco only supported 32 bit systems. I

Re: Lightweight Python distribute it in under 2MBs for Win32

2005-08-12 Thread fred.dixon
30meg for wx ? mine is under 3meg, compressed -- http://mail.python.org/mailman/listinfo/python-list

Re: UCALC equivalent

2005-08-12 Thread Max Erickson
Scott David Daniels <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > max wrote: >> Larry Bates <[EMAIL PROTECTED]> wrote in >> news:[EMAIL PROTECTED]: >>>Python has built in eval function and doesn't require a library. >> >> Are you kidding? Read the original post a little more closely. >

Re: Bug on Python2.3.4 [FreeBSD]?

2005-08-12 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Uwe Mayer <[EMAIL PROTECTED]> wrote: > Friday 12 August 2005 22:12 pm paolino wrote: > [...] > >f = open('test', 'a+') > >f.read() > >> > >> '' > >> > >> -> append mode does not read from file, *not ok* > >> > >> > > This is right IMO 'a' is appending s

Re: Running one Python program from another as a different user

2005-08-12 Thread [EMAIL PROTECTED]
Thanks, that looks very promising... Is there a solution for pre-Python v2.4? I have to have code that works on 2.x, 0<=x<=4. Do I just use the os.popen instead? -Don -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-08-12 Thread gene tani
the other canonical responses: - killfile killfile killfile - nothing to see here ... keep moving - don't cross-post your replies, don't rile the perl users. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is this?

2005-08-12 Thread gene tani
I think you got your answer. FWIW, questions like this i usually look 1st in the Cookbook (i.e. the Oreilly dead trees, 2nd edition). See Chap. 4 And: My gotcha list, http://www.ferg.org/projects/python_gotchas.html http://zephyrfalcon.org/labs/python_pitfalls.html http://zephyrfalcon.org/labs/

Re: Running one Python program from another as a different user

2005-08-12 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > Greetings- > This is on Linux... I have a daemon running as root and I want to > execute another Python program as another user (a regular user). I have > the name of the user and can use the 'pwd' and 'grp' modules to get > that user's user and group ids. What I don't un

Re: NEWB: General purpose list iteration?

2005-08-12 Thread Donald Newcomb
"Peter Otten" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > A non-recursive approach: > > def enumerate_ex(items): > stack = [(enumerate(items), items)] > while stack: > en, seq = stack[-1] > for index, item in en: > if isinstance(item, list): >

Running one Python program from another as a different user

2005-08-12 Thread [EMAIL PROTECTED]
Greetings- This is on Linux... I have a daemon running as root and I want to execute another Python program as another user (a regular user). I have the name of the user and can use the 'pwd' and 'grp' modules to get that user's user and group ids. What I don't understand is how to then go about la

Re: Pre-PEP Proposal: Codetags

2005-08-12 Thread Martin v. Löwis
Bengt Richter wrote: >>Both elements seem to be missing your document: it does not propose >>changes to the Python language; instead, it proposes a specific >>way of writing comments (ie. something that is not relevant to the >>Python interpreter or libraries, only to the Python developer). > > >

Re: Why is this?

2005-08-12 Thread Peter Mott
Duncan Booth wrote: > Peter Mott wrote: > > >>But it is still true that [[]] + [[]] is not the same as [[]] * 2. In my >>usage anyway this means that "S+S is the same as S*2" is false. Because >>there are Python expressions for which it is falsfied. >> >>The problem I have is pretty philosophic

Dr. Dobb's Python-URL! - weekly Python news and links (Aug 12)

2005-08-12 Thread Cameron Laird
QOTW: "... So I started profiling the code and the slowdown was actually taking place at places where I didn't expect it." -- Guyon Mor?e (and about twenty-three thousand others) "[A] suggestion from the world of 'agile development': stop making so many decisions and start writing some actual cod

pickle.load not working?

2005-08-12 Thread [EMAIL PROTECTED]
I have the following code for controlling access: -- #check login credentials... def cklogin(ipaddy, user, authcoded): try: print "Opening file:", user f = file(user,'r+') #load in the user from the file cusr = pickle.load(f) print "User Authc

Re: Printing to printer

2005-08-12 Thread Steve M
Kristian Zoerhoff wrote: > On 8/11/05, Steve M <[EMAIL PROTECTED]> wrote: >> Kristian Zoerhoff wrote: >> >> > On 8/11/05, Steve M <[EMAIL PROTECTED]> wrote: >> >> Hello, >> >> >> >>I'm having problems sending information from a python >> >> script to a printer. I was wondering if someone

Re: Printing to printer

2005-08-12 Thread Steve M
Larry Bates wrote: > I adapted some code from David Boddie into a Python class to write > directly to Linux print queues. I have used it in one project and > it worked just fine. I've attached a copy for your use. You are > free to use it as you wish, with no guarantees or warranties. > > Hope

Re: Why is this?

2005-08-12 Thread Duncan Booth
Peter Mott wrote: > But it is still true that [[]] + [[]] is not the same as [[]] * 2. In my > usage anyway this means that "S+S is the same as S*2" is false. Because > there are Python expressions for which it is falsfied. > > The problem I have is pretty philosophical I admit, but I don't thi

Re: Jargons of Info Tech industry

2005-08-12 Thread Matthias Buelow
[EMAIL PROTECTED] writes: >In comp.lang.perl.misc Xah Lee <[EMAIL PROTECTED]> wrote: >> The other class of jargon stupidity is from computing practitioners, of >> which the Unix/Perl community is exemplary. For example, the name Unix >> & Perl themselves are good examples of buzzing jargons. Unix

Re: Using globals with classes

2005-08-12 Thread Madhusudan Singh
Many thanks for an excellent solution to the problem and clearing up my mind about globals. In some sense, Python globals seem to be a little like the COMMON statement in the old Fortran 77 standard. -- http://mail.python.org/mailman/listinfo/python-list

Re: thread limit in python

2005-08-12 Thread Christopher Subich
[EMAIL PROTECTED] wrote: > i modified my C test program (included below) to explicitly set the > default thread stack size, and i'm still running into the same > problem. can you think of any other thing that would possibly be > limiting me? Hrm, you're on an A64, so that might very well mean you

Re: Catching stderr output from graphical apps

2005-08-12 Thread Christopher Subich
Bryan Olson wrote: > > Thanks. > > Yeah, guess I was naive to test on Windows and expect that kind > of process stuff to be portable. I'll be away from Linux for a > week or so, so this will take me a while. > > Further bulletins as events warrant. If you can get a cross-platform solution, plea

Re: How do these Java concepts translate to Python?

2005-08-12 Thread gene tani
I think you'll like python. http://naeblis.cx/rtomayko/2004/12/15/the-static-method-thing http://dirtsimple.org/2004/12/java-is-not-python-either.html (and python-is-not-java) -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-08-12 Thread axel
In comp.lang.perl.misc Xah Lee <[EMAIL PROTECTED]> wrote: > The other class of jargon stupidity is from computing practitioners, of > which the Unix/Perl community is exemplary. For example, the name Unix > & Perl themselves are good examples of buzzing jargons. Unix is > supposed to be opposed of

Re: Text/IDE Python Editor?

2005-08-12 Thread djanvk
THanks for the information and the review.. On Fri, 12 Aug 2005 16:57:04 GMT, Peter A. Schott <[EMAIL PROTECTED]> wrote: >Also, it depends on what you're trying to do. GUI, Web, Service-type apps, >etc. > >I have started using Stan's Python Editor (www.stani.be) because I like the >general feat

Re: Bug on Python2.3.4 [FreeBSD]?

2005-08-12 Thread Uwe Mayer
Friday 12 August 2005 22:12 pm David Bolen wrote: > Which version of FreeBSD are you running? I thought it might be a > dependency on needing to seek between reads and writes on a duplex > stream (which is ANSI), but FreeBSD doesn't require that, at least > back as far as a 4.7 system I have, and

Re: Bug on Python2.3.4 [FreeBSD]?

2005-08-12 Thread David Bolen
Uwe Mayer <[EMAIL PROTECTED]> writes: > AFAICT there seems to be a bug on FreeBSD's Python 2.3.4 open function. The > documentation states: > > > Modes 'r+', 'w+' and 'a+' open the file for updating (note that 'w+' > > truncates the file). Append 'b' to the mode to open the file in binary > > mod

Re: Jargons of Info Tech industry

2005-08-12 Thread Ulrich Hobelmann
jan V wrote: > Did you know that some deranged people take sexual pleasure out of starting > fires? Apparently some of the latest forest/bush fires in southern Europe > were even started by firemen (with their pants down?). I've only heard of people trying to extinguish fires with their pants dow

Re: Bug on Python2.3.4 [FreeBSD]?

2005-08-12 Thread Uwe Mayer
Friday 12 August 2005 22:12 pm paolino wrote: [...] >f = open('test', 'a+') >f.read() >> >> '' >> >> -> append mode does not read from file, *not ok* >> >> > This is right IMO 'a' is appending so seek(-1) True, thank you. f.tell() shows the file pointer is at EOF. On my Debian Linux (u

Re: Dictionary inheritance

2005-08-12 Thread Devan L
Talin wrote: > I want to make a dictionary that acts like a class, in other words, > supports inheritance: If you attempt to find a key that isn't present, > it searches a "base" dictionary, which in turn searches its base, and so on. > > Now, I realize its fairly trivial to code something like thi

Re: Permutation Generator

2005-08-12 Thread Paul Rubin
Talin <[EMAIL PROTECTED]> writes: > I'm sure I am not the first person to do this, but I wanted to share > this: a generator which returns all permutations of a list: > > def permute( lst ): > if len( lst ) == 1: > yield lst > else: > head = lst[:1] > for x in permu

Re: Jargons of Info Tech industry

2005-08-12 Thread joe
"Mike Schilling" <[EMAIL PROTECTED]> writes: > "Jürgen Exner" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Xah Lee wrote: > >> Jargons of Info Tech industry > >> > >> (A Love of Jargons) > >> > >> Xah Lee, 2002 Feb > >> > >> People in the computing field like to spur the use

Re: Permutation Generator

2005-08-12 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, Talin <[EMAIL PROTECTED]> wrote: > I'm sure I am not the first person to do this, but I wanted to share > this: a generator which returns all permutations of a list: > > def permute( lst ): > if len( lst ) == 1: > yield lst > else: > head

Dual mode for file/directory chooser

2005-08-12 Thread jasonjho
Does tkinter have a dialog chooser for supporting both file and directory selections? I can only seem to find ask* methods that provide function for each, and not both. Thanks, J -- http://mail.python.org/mailman/listinfo/python-list

Dictionary inheritance

2005-08-12 Thread Talin
I want to make a dictionary that acts like a class, in other words, supports inheritance: If you attempt to find a key that isn't present, it searches a "base" dictionary, which in turn searches its base, and so on. Now, I realize its fairly trivial to code something like this using UserDict, b

Permutation Generator

2005-08-12 Thread Talin
I'm sure I am not the first person to do this, but I wanted to share this: a generator which returns all permutations of a list: def permute( lst ): if len( lst ) == 1: yield lst else: head = lst[:1] for x in permute( lst[1:] ): yield head + x

Re: thread limit in python

2005-08-12 Thread Bryan Olson
Peter Hansen wrote: > Probably, but I haven't yet seen anyone ask the real important question. > What possible use could you have for more than 1000 *simultaneously > active* threads? There are very likely several alternative approaches > that will fit your use case and have better characteri

Re: UCALC equivalent

2005-08-12 Thread Scott David Daniels
max wrote: > Larry Bates <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: >>Python has built in eval function and doesn't require a library. > > Are you kidding? Read the original post a little more closely. The > o.p. is looking for a library that evaluates mathematical expressions > and

Re: Bug on Python2.3.4 [FreeBSD]?

2005-08-12 Thread paolino
Uwe Mayer wrote: > > > Hi, > > AFAICT there seems to be a bug on FreeBSD's Python 2.3.4 open function. The > documentation states: > > >>Modes 'r+', 'w+' and 'a+' open the file for updating (note that 'w+' >>truncates the file). Append 'b' to the mode to open the file in binary >>mode, on syst

Re: Catching stderr output from graphical apps

2005-08-12 Thread Bryan Olson
Thanks. Yeah, guess I was naive to test on Windows and expect that kind of process stuff to be portable. I'll be away from Linux for a week or so, so this will take me a while. Further bulletins as events warrant. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: problem extending tkSimpleDialog.Dialog

2005-08-12 Thread William Gill
I'm still hammering away, and have found that when I change: class testWidget(Frame): def __init__(self, master): Frame.__init__(self) self.createWidgets() def createWidgets(self): Label(self,text="testWidget").grid() to: def __init__(self, master):

Re: simpli int/str problem

2005-08-12 Thread Scott David Daniels
Paolino wrote: > sinan . wrote: > >> hi all, >> i have a string and int values in same dictionary like this >> dict = {'str_name': 'etc' , 'int_name' : 112 } Bad idea to call this "dict" -- that is a system-defined name for the dictionary type. I'll use "holder" below. >> the error occures when d

Bug on Python2.3.4 [FreeBSD]?

2005-08-12 Thread Uwe Mayer
Hi, AFAICT there seems to be a bug on FreeBSD's Python 2.3.4 open function. The documentation states: > Modes 'r+', 'w+' and 'a+' open the file for updating (note that 'w+' > truncates the file). Append 'b' to the mode to open the file in binary > mode, on systems that differentiate between bin

Re: UCALC equivalent

2005-08-12 Thread max
Larry Bates <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Python has built in eval function and doesn't require > a library. > > Larry Bates > Are you kidding? Read the original post a little more closely. The o.p. is looking for a library that evaluates mathematical expressions and

Re: How to build Python modules on windows?

2005-08-12 Thread Qiangning Hong
". <"@bag.python.org wrote: > Hi, > > how can I build python modules on windows? I tried to build numarray[0] > using Microsoft Visual C++ 2003 Toolkit, but got the following error: > > --- > error: Python was built with version 7.1 of Visual Studio, and > extensions need to be built with the s

Re: Using globals with classes

2005-08-12 Thread Scott David Daniels
Madhusudan Singh wrote: > I am using qwtplot to display a running plot : > > void Form3::runningplot(n,plottitle,xname,x,y1name,y1,y2name,y2) > { ^^ I presume this is just some untranslated stuff ^^ > if n==1 : > > plotkey1=self.runningqwtPlot.insertCurve(y1name,self.runningqwtPlot.xBottom,s

Re: Supressing argument renaming in the Qt Designer -> pyuic workflow

2005-08-12 Thread Phil Thompson
On Thursday 11 August 2005 6:36 pm, Madhusudan Singh wrote: > Hi > > Some of the functions I defined inside Qt Designer need to have some values > passed to them. > > For instance : > > Code : > > void Form3::runningplot(n,plottitle,xname,x,y1name,y1,y2name,y2) > > is translated by pyuic to > > Pyt

Re: __getattribute__ for class object

2005-08-12 Thread Steven Bethard
Dan wrote: > Depending on what you want to do, it might be better to use properties > instead: > > class Meta(type): > x = property(lambda klass: 'Called for '+str(klass)) > > class Foo(object): > __metaclass__=Meta Also worth noting that you can inline the metaclass if you don't n

Re: UCALC equivalent

2005-08-12 Thread Larry Bates
Python has built in eval function and doesn't require a library. Larry Bates Dark Cowherd wrote: > http://www.ucalc.com/mathparser/index.html > > There is a great library called UCALC which allows you to set up an > expression and evaluate it > for e.g. you an define an expression by calling a f

How to build Python modules on windows?

2005-08-12 Thread .
Hi, how can I build python modules on windows? I tried to build numarray[0] using Microsoft Visual C++ 2003 Toolkit, but got the following error: --- error: Python was built with version 7.1 of Visual Studio, and extensions need to be built with the same version of the compiler, but it isn't i

Re: How do these Java concepts translate to Python?

2005-08-12 Thread Steven Bethard
bruno modulix wrote: >>but technically >>speaking, there are no public, protected, or private things. > > Yes there are: > object.name is public > object._name is protected > object.__name is private The double-underscore name-mangling is almost never worth it. It's supposed to stop name collis

UCALC equivalent

2005-08-12 Thread Dark Cowherd
http://www.ucalc.com/mathparser/index.html There is a great library called UCALC which allows you to set up an expression and evaluate it for e.g. you an define an expression by calling a function in UCALC then call it with various values of x for e.g. see this page http://www.ucalc.com/mathparse

Re: need help with my append syntax

2005-08-12 Thread Qiangning Hong
Do not discuss off-list, maybe others will have better solutions to your question. And also please do not top-posting, it makes me difficult to trim the irrelevant text. yaffa wrote: > sorry addr is a variable. how to i append to that? I know addr is a variable (or better a name). But what obj

Re: need help with my append syntax

2005-08-12 Thread Michael Ekstrand
On 12 Aug 2005 09:31:08 -0700 "yaffa" <[EMAIL PROTECTED]> wrote: > addr = incident.findNextSibling('td') > addr.append('%s;') addr += ';' or addr2 = '%s;' % addr Strings, being immutable, do not support appending like lists do. Also, the %whatever specifiers are only in effect when used with t

Re: Python's Exception, and Capitalization

2005-08-12 Thread Steve M
You might find the Python Style Guide to be helpful: http://www.python.org/doc/essays/styleguide.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Text/IDE Python Editor?

2005-08-12 Thread Peter A.Schott
Also, it depends on what you're trying to do. GUI, Web, Service-type apps, etc. I have started using Stan's Python Editor (www.stani.be) because I like the general features it offers. It does require wxpython to run, though. I've also used Boa Constructor and DrPython - both pretty good environ

Re: thread limit in python

2005-08-12 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > and sorry to continue to post here. since this is occurring in both c > and python, i think there's no question i'm running into an os limit. Probably, but I haven't yet seen anyone ask the real important question. What possible use could you have for more than 1000

Re: need help with my append syntax

2005-08-12 Thread Qiangning Hong
yaffa wrote: > dear folks, > > i'm trying to append a semicolon to my addr string and am using the > syntax below. for some reason the added on of the ; doesn't work. > when i print it out later on it only shows the original value of addr. > > addr = incident.findNextSibling('td') > addr.append(

  1   2   >