Re: shelve: writing out updates?!

2005-07-31 Thread Paul Rubin
[EMAIL PROTECTED] (phil hunt) writes: > >No. Call the .sync() method. Unfortunately, the shelve module is not > >well-documented. > > Obviously it's good when stuff is well documented. > > I wonder if the barrier to good documentation is set too high? > If i wanted to add some documentation her

Re: shelve: writing out updates?!

2005-07-31 Thread Paul Rubin
[EMAIL PROTECTED] (phil hunt) writes: > What is ACID? Basically it means full-blown a transactional database that handles concurrent updates correctly. See: http://en.wikipedia.org/wiki/ACID > Wierd. I'd expect something like an s.flush() function. Thanks to Robert Kern for pointing out that

Re: Wheel-reinvention with Python

2005-07-31 Thread Paul Rubin
[EMAIL PROTECTED] (phil hunt) writes: > What you say Pythonic, what do you mean? And how do you rate > Tkinter, PyGtk, PyQt/PyKDE, wxWindows for "Pythonicness"? Tkinter is not very Pythonic because it's sort of a Frankenstein hybrid of Python and Tcl, but at least it's there and it more or less

Re: How to convert a string like '777' to an octal integer like 0777?

2005-07-31 Thread KB
Thanks, John. But my point is how to keep the leading zero in 0777, in order to be used in os.chmod('myfile', 0777)? -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP on path module for standard library

2005-07-31 Thread Andrew Dalke
Peter Hansen wrote: > A scattered assortment of module-level global function names, and > builtins such as open(), make it extraordinarily difficult to do > effective and efficient automated testing with "mock" objects. I have been able to do this by inserting my own module-scope function that i

Thaughts from an (almost) Lurker.

2005-07-31 Thread Paddy
Sometimes when reading c.l.p. I mentally stand off from what I have been reading and get an odd feeling that 'WE ARE BEING TESTED'. That someone else is purposefully posting a near repetitive post, or obvious flame bait etc - not for the usual reasons, but to track the dynamics af the replies. Rat

Re[2]: 2-player game, client and server at localhost

2005-07-31 Thread Michael Rybak
Thank you very much for your response, and may I point out some details: >> It works synchronously, but somehow, when I play in client window, >> both client and server have 17 fps, while when playing in server >> window, server has 44 fps while client has 5, and due to forced >>

Re: Dabo in 30 seconds?

2005-07-31 Thread Paul Rubin
Ed Leafe <[EMAIL PROTECTED]> writes: > > I am going to go ahead and throw out Dabo with all of the others that claim > > quick development of an application. You try them and then you get bugs, > > bugs, bugs. Or they don't compile without 16000 dependencies. Forget it. My > > advice is to choose s

Re: How to convert a string like '777' to an octal integer like 0777?

2005-07-31 Thread Robert Kern
KB wrote: > Thanks, John. > > But my point is how to keep the leading zero in 0777, > in order to be used in os.chmod('myfile', 0777)? I don't understand. The leading zero only exists in a particular string representation. os.chmod() needs an integer, not a string. 0777 == 511. os.chmod('myfile

Re: [path-PEP] Path inherits from basestring again

2005-07-31 Thread Reinhold Birkenfeld
phil hunt wrote: > On Sat, 30 Jul 2005 19:01:49 +0200, Reinhold Birkenfeld <[EMAIL PROTECTED]> > wrote: >>phil hunt wrote: >> >>> def normalizePath(p, *pathParts): >>>""" Normalize a file path, by expanding the user name and getting >>>the absolute path.. >>>@param p [string] = a path

Re: Thaughts from an (almost) Lurker.

2005-07-31 Thread Robert Kern
Paddy wrote: > Sometimes when reading c.l.p. I mentally stand off from what I have > been reading and get an odd feeling that 'WE ARE BEING TESTED'. That > someone else is purposefully posting a near repetitive post, or obvious > flame bait etc - not for the usual reasons, but to track the dynamic

Re: Dabo in 30 seconds?

2005-07-31 Thread Robert Kern
Paul Rubin wrote: > E.g., on > Linux, to use wxPython, you need wxWidgets, which needs GTK 1.5, which > has been obsolete for years, Nope. It's on GTK2 now. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Ri

Re: Wheel-reinvention with Python

2005-07-31 Thread Torsten Bronger
Hallöchen! Cliff Wells <[EMAIL PROTECTED]> writes: > [...] > > The least headache for end users comes from properly packaging your > application. End users shouldn't need to worry about installing third > party packages (or even Python for that matter). Tools such as py2exe > and Inno installer

Re: Dabo in 30 seconds?

2005-07-31 Thread Paul Rubin
Cliff Wells <[EMAIL PROTECTED]> writes: > Then why are you using Python at all? Shouldn't you be in the "safe > home" of Java or Visual Basic, where "standards" are all you have? I don't know about VB but Java does a much better job of supporting standards than Python does. Python's advantage is

Re: Dabo in 30 seconds?

2005-07-31 Thread Paul Rubin
Robert Kern <[EMAIL PROTECTED]> writes: > > Linux, to use wxPython, you need wxWidgets, which needs GTK 1.5, which > > has been obsolete for years, > > Nope. It's on GTK2 now. Oh, that's recent then. I might try it again in this case. It's still an enormous piece of code. I can't understand wh

Re: How to convert a string like '777' to an octal integer like 0777?

2005-07-31 Thread KB
> The leading zero only exists in a particular string > representation. os.chmod() needs an integer, not a string. 0777 == 511. Thanks, Robert. What you said is exactly what I did not understand clearly, because I am just a beginner in Python programming. KB -- http://mail.python.org/mailman/l

Re: Wheel-reinvention with Python

2005-07-31 Thread Paul Rubin
Torsten Bronger <[EMAIL PROTECTED]> writes: > Does py2exe work for all GUI libraries? No, it's Windows-only. -- http://mail.python.org/mailman/listinfo/python-list

Re: Wheel-reinvention with Python

2005-07-31 Thread Paul Rubin
Cliff Wells <[EMAIL PROTECTED]> writes: > application. End users shouldn't need to worry about installing third > party packages (or even Python for that matter). Tools such as py2exe > and Inno installer make this pretty simple on Windows, and py2app on > OS/X accomplishes the same. It should b

namespaces

2005-07-31 Thread Paolino
While it's not so bad we can bind names in the module namespace, (ex writing scripts ?) ,writing modules is someway bound to not polluting that namespace (really IMO). For non-functions we can use 'class' : class ns: foo='something' but writing a function there triggers the binding to 'sel

Changing interpreter's deafult output/error streams

2005-07-31 Thread Ira
Hi, Using an embedded interpreter, how do I change it's default output streams (specifically the one used by PyErr_Print() which I'm guessing is the default error stream)? Cheers, Ira -- http://mail.python.org/mailman/listinfo/python-list

Re: namespaces

2005-07-31 Thread Robert Kern
Paolino wrote: > While it's not so bad we can bind names in the module namespace, (ex > writing scripts ?) ,writing modules is someway bound to not polluting > that namespace (really IMO). I'm afraid that I can't parse that sentence. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell wh

Re: Wheel-reinvention with Python

2005-07-31 Thread phil hunt
On 31 Jul 2005 00:23:38 -0700, Paul Rubin wrote: >[EMAIL PROTECTED] (phil hunt) writes: >> What you say Pythonic, what do you mean? And how do you rate >> Tkinter, PyGtk, PyQt/PyKDE, wxWindows for "Pythonicness"? > >Tkinter is not very Pythonic because it's sort of a Fr

Re: Wheel-reinvention with Python

2005-07-31 Thread phil hunt
On Sun, 31 Jul 2005 08:22:23 +0200, Torsten Bronger <[EMAIL PROTECTED]> wrote: >> >> What you say Pythonic, what do you mean? And how do you rate >> Tkinter, PyGtk, PyQt/PyKDE, wxWindows for "Pythonicness"? > >I don't like to set arguments to -1 or NULL, but to None. Fair enough >I'd like >to

Re: Wheel-reinvention with Python

2005-07-31 Thread Robert Kern
phil hunt wrote: > OK, hows this for an idea: > > 1. create a new API, loosely based on the Tkinter API, but more > Pythonic > > 2. implement Tk using this API (probably won't be difficult because > we can use Tkinter as a base) > > 3. Implement bindings to Gtk and Qt/KDE using this API. Lik

Re: Wheel-reinvention with Python

2005-07-31 Thread Torsten Bronger
Hallöchen! Paul Rubin writes: > Torsten Bronger <[EMAIL PROTECTED]> writes: > >> Does py2exe work for all GUI libraries? > > No, it's Windows-only. However, OS'es and GUI libraries are different axes in the space of possibilities. Tschö, Torsten. -- Torsten Bronger,

Re: namespaces

2005-07-31 Thread Paolino
Robert Kern wrote: > Paolino wrote: > >>While it's not so bad we can bind names in the module namespace, (ex >>writing scripts ?) ,writing modules is someway bound to not polluting >>that namespace (really IMO). > > > I'm afraid that I can't parse that sentence. I show you a piece of code I

Re: namespaces

2005-07-31 Thread deelan
Paolino wrote: (...) > What I'm needing as a global (in globals() or at the module level or in > the module namespace) is 'translate'.The rest of bindings (all,badcars > and table) is something which is 'polluting' the module namespace. try this: ## yourmodule.py ## def _setup_table(): impo

Re: namespaces

2005-07-31 Thread deelan
deelan wrote: (...) > # optional, get rid of _setup_table symbol > del _setup_table() damn copy and paste :) of course i meant: del _setup_table -- deelan, #1 fan of adriana lima! -- http://mail.python.org/mailman/listinfo/python-list

Re: Escaping certain characters

2005-07-31 Thread Jan Danielsson
Jan Danielsson wrote: >>In [3]: s.encode('string_escape') >>Out[3]: 'Hello\\nWorld!' >> >>In [4]: Out[3].decode('string_escape') >>Out[4]: 'Hello\nWorld!' >> >>Not *quite* what you asked for, but it ought to be close enough. > > That'll do just fine. Many thanks! Hmm... On second thought, I need

Re: Escaping certain characters

2005-07-31 Thread Robert Kern
Jan Danielsson wrote: > Jan Danielsson wrote: > >>>In [3]: s.encode('string_escape') >>>Out[3]: 'Hello\\nWorld!' >>> >>>In [4]: Out[3].decode('string_escape') >>>Out[4]: 'Hello\nWorld!' >>> >>>Not *quite* what you asked for, but it ought to be close enough. >> >>That'll do just fine. Many thanks!

Re: How to convert a string like '777' to an octal integer like 0777?

2005-07-31 Thread Steven D'Aprano
On Sun, 31 Jul 2005 00:24:08 -0700, KB wrote: > Thanks, John. > > But my point is how to keep the leading zero in 0777, > in order to be used in os.chmod('myfile', 0777)? os.chmod('myfile', 0777) Python will recognise integers written in octal if you leave a leading zero, and in hex if you use

Re: namespaces

2005-07-31 Thread Steven D'Aprano
On Sun, 31 Jul 2005 12:44:46 +0200, Paolino wrote: > I show you a piece of code I need to define a function: > > import string > all=string.maketrans('','') > badcars=all.translate(all,string.letters+string.digits) > table=string.maketrans(badcars,'_'*len(badcars)) > def translate(text): >ret

Google maps on your mobile phone with python for series60

2005-07-31 Thread korakot
I have written some simple prototype to display google maps data on mobile phone (Nokia Series 60). http://discussion.forum.nokia.com/forum/showthread.php?threadid=63694 Now it can scroll, zoom in, zoom out and toggle between map and sattelite mode. The current code is 100 lines (exactly). You ma

Re: python SMTP server

2005-07-31 Thread Benjamin Niemann
Fernando M. wrote: > Hi, > i made a test with smtplib module a few days ago, for sending mails, > and i was wondering if there's another module for running an SMTP > server, so i could make a standalone script for sending mails without > using an external SMTP server. > I've been searching but i'm

Re: namespaces

2005-07-31 Thread Rob Williscroft
deelan wrote in news:[EMAIL PROTECTED] in comp.lang.python: > Paolino wrote: > (...) >> What I'm needing as a global (in globals() or at the module level or >> in the module namespace) is 'translate'.The rest of bindings >> (all,badcars and table) is something which is 'polluting' the module >> n

Re: namespaces

2005-07-31 Thread Paul Rubin
Paolino <[EMAIL PROTECTED]> writes: > What I'm needing as a global (in globals() or at the module level or > in the module namespace) is 'translate'.The rest of bindings > (all,badcars and table) is something which is 'polluting' the module > namespace. do you want __all__ = ['translate'] ? --

Re: Wheel-reinvention with Python

2005-07-31 Thread Paul Rubin
Torsten Bronger <[EMAIL PROTECTED]> writes: > >> Does py2exe work for all GUI libraries? > > No, it's Windows-only. > However, OS'es and GUI libraries are different axes in the space of > possibilities. I'm not sure what you mean. Whatever GUI library the Mac uses, py2exe doesn't work with it, si

Re: Wheel-reinvention with Python

2005-07-31 Thread Torsten Bronger
Hallöchen! Paul Rubin writes: > Torsten Bronger <[EMAIL PROTECTED]> writes: > Does py2exe work for all GUI libraries? >>> >>> No, it's Windows-only. >> >> However, OS'es and GUI libraries are different axes in the space >> of possibilities. > > I'm not sure what yo

Re: Passing a log handle to a module? Help needed with logging module and

2005-07-31 Thread Michael Hoffman
rh0dium wrote: > But I can't figure out how to pass the [EMAIL PROTECTED] logging handle to the > called module - I'm sorry, but what have you tried? It seems like it should be a simple matter of calling module.main(log). > much less change the getLogger name to "module". Why do you want to

Re: Wheel-reinvention with Python

2005-07-31 Thread Paul Rubin
Torsten Bronger <[EMAIL PROTECTED]> writes: > Does py2exe work for all GUI libraries? > >>> No, it's Windows-only. > I didn't ask "does it work with OSX" but "does it work with wxPython > or PyQt". py2exe only creates Windows files, that's right, but why > is this important here? You asked w

Re: Wheel-reinvention with Python

2005-07-31 Thread Ed Leafe
On Sunday 31 July 2005 01:02, phil hunt wrote: > You mightn't have, but I suspect more Python programers who've > written GUI apps have used Tkinter than any of the other APIs. > > Not that I'm a particular fan of it, it's just I like > standardisation, because then you get network effects. At P

Re: Wheel-reinvention with Python

2005-07-31 Thread Jorge Godoy
Mike Meyer wrote: [ Having GUI stuff included on a standard installation of Python ] > However, you can get compilers for both that come bundled with a good > GUI library. Could it be that that's what you really want - someone to > distribute Python bundled with an enterprise-class GUI library an

Re: namespaces

2005-07-31 Thread Paolino
Steven D'Aprano wrote: > def translate(text): > import string > all=string.maketrans('','') > badcars=all.translate(all,string.letters+string.digits) > table=string.maketrans(badcars,'_'*len(badcars)) > return text.translate(table) > > No pollution. And no efficience.Recalcul

Newb: Telnet 'cooked data','EOF' queries.

2005-07-31 Thread glen
While experimenting with telnetlib, Ive come across a couple of 'features' that confuse me a little (lot!). Could someone explain what "cooked data" is. Also when trying read_all() the program seems to lock up, which I assume is because it is waiting for an EOF, but 'when' is an EOF received. Gle

Re: namespaces

2005-07-31 Thread Rob Williscroft
Paolino wrote in news:mailman.2453.1122812091.10512.python- [EMAIL PROTECTED] in comp.lang.python: > Rob Williscroft wrote: > > > After 3 or 4 iterations I refactored you code to this: > > > > def translate( text ) > > import string > > all=string.maketrans('','') > > badcars=all.tran

Re: keylogger in Python

2005-07-31 Thread Michael Hoffman
Jay wrote: > yo, thanks for the great input. And the only reason i want to create a > python based keylogger is because there is none. Just a fun project... > But im gonna do some more research on the keyboard drivers and stuff > like that and to learn how to attach my python porgrams into the > su

Re: Newb: Telnet 'cooked data','EOF' queries.

2005-07-31 Thread Jeff Epler
On Sun, Jul 31, 2005 at 01:30:43PM +0100, glen wrote: > Could someone explain what "cooked data" is. The telnet protocol contains special sequences which are interpreted by the telnet client or server program. These are discussed in the telnet RFC, which is RFC854 according to the telnetlib docst

Re: keylogger in Python

2005-07-31 Thread simonwittber
Michael Hoffman wrote: > I think this is going to be much harder than you think, and I imagine > this will only end in frustration for you. You will not be able to do it > well with just Python. I would recommend a different fun project. Actually, it's pretty easy, using the pyHook and Python win

Re: Wheel-reinvention with Python

2005-07-31 Thread Terry Hancock
On Saturday 30 July 2005 01:54 am, Torsten Bronger wrote: > Calvin Spealman <[EMAIL PROTECTED]> writes: > > > The choice is GUI toolkits is largely seperate from > > Python. Consider that they are just bindings to libraries that are > > developed completely seperate of the language. GUI is should

Re: keylogger in Python

2005-07-31 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > Actually, it's pretty easy, using the pyHook and Python win32 modules. Well, I'll be. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: namespaces

2005-07-31 Thread Steven D'Aprano
On Sun, 31 Jul 2005 15:09:48 +0200, Paolino wrote: > Steven D'Aprano wrote: > >> def translate(text): >> import string >> all=string.maketrans('','') >> badcars=all.translate(all,string.letters+string.digits) >> table=string.maketrans(badcars,'_'*len(badcars)) >> return text.t

Re: Wheel-reinvention with Python

2005-07-31 Thread Torsten Bronger
Hallöchen! Terry Hancock <[EMAIL PROTECTED]> writes: > On Saturday 30 July 2005 01:54 am, Torsten Bronger wrote: > >> Calvin Spealman <[EMAIL PROTECTED]> writes: >> >>> The choice is GUI toolkits is largely seperate from >>> Python. Consider that they are just bindings to libraries that >>> are

Re: keylogger in Python

2005-07-31 Thread François Pinard
[Michael Hoffman] > Jay wrote: > > yo, thanks for the great input. And the only reason i want to > > create a python based keylogger is because there is none. Just a > > fun project... But im gonna do some more research on the keyboard > > drivers and stuff like that and to learn how to attach m

Re: Wheel-reinvention with Python

2005-07-31 Thread Ed Leafe
On Sunday 31 July 2005 10:32, Torsten Bronger wrote: > > I know I'm diving into this conversation late, and I haven't read > > the whole thread, but has someone yet mentioned the "anygui" > > project?  This has stalled, but it was IMHO a good idea. > > > I don't know exactly why this project died

Re: Trimming X/HTML files

2005-07-31 Thread Thomas SMETS
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The regular expression remove script out of an HTML/XHTML file is simple enough but raises a major performance issue The following regular expression : r'()' takes ages to complete in python on simple HTML file more than 3 minutes of CPU

Re: keylogger in Python

2005-07-31 Thread Michael Hoffman
François Pinard wrote: > Surely on Linux, logging keys under X-Windows or under virtual terminals > are quite different matters. Let me share a related experience for > virtual terminals. I once had to rush the port on Linux a few QNX > applications, written in C, which were using the QNX term l

Enumerate registered codecs

2005-07-31 Thread Paul Watson
I see the list of standard encodings in Python 2.4.1 documentation section 4.9.2. Is there a method to enumerate the registered codecs at runtime? -- http://mail.python.org/mailman/listinfo/python-list

getting an empty tuple

2005-07-31 Thread nephish
Hey there, i have a simple database query that returns as a tuple the number of rows that the query selected. kinda like this >>> cursor.execute('select value from table where autoinc > 234') >>> x = cursor.fetchall() >>> print x >>> 21L ok, means 21 rows met the criteria of the query. but if th

Re: getting an empty tuple

2005-07-31 Thread Peter Decker
On 31 Jul 2005 08:40:26 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > how do i encorporate that into an equation ? > i have tried all kinds of stuff > > if x == 0L > if x(0) == None > if x == None > > anyway, what shoud i do to test if the result is empty? Just like any other test: if

Re: Thaughts from an (almost) Lurker.

2005-07-31 Thread Christopher Subich
Robert Kern wrote: > My experience with USENET suggests that there is always a steady stream > of newbies, trolls, and otherwise clueless people. In the absence of > real evidence (like traceable headers), I don't think there's a reason > to suspect that there's someone performing psychological

Re: keylogger in Python

2005-07-31 Thread François Pinard
[Michael Hoffman] > You think this is a suitable beginner project? One surely learns a lot! :-) > And for that matter, it doesn't sound like you were doing keylogging, as > it is usually understood to mean globally logging keypresses, no matter > the application being presented to the user. O

Re: Wheel-reinvention with Python

2005-07-31 Thread Paul Rubin
Ed Leafe <[EMAIL PROTECTED]> writes: > But since UIs are incredibly complex beasts, we've > chosen to tackle one at a time, and after looking at them all and considering > different issues, we chose wxPython as the best toolkit for creating > platform-independent apps. How on earth did you deci

Re: Wheel-reinvention with Python

2005-07-31 Thread Torsten Bronger
Hallöchen! Paul Rubin writes: > Ed Leafe <[EMAIL PROTECTED]> writes: > >> But since UIs are incredibly complex beasts, we've chosen to >> tackle one at a time, and after looking at them all and >> considering different issues, we chose wxPython as the best >> toolkit fo

Re: namespaces

2005-07-31 Thread George Sakkis
Paolino wrote: > Steven D'Aprano wrote: > > > def translate(text): > > import string > > all=string.maketrans('','') > > badcars=all.translate(all,string.letters+string.digits) > > table=string.maketrans(badcars,'_'*len(badcars)) > > return text.translate(table) > > > > No pollu

Re: Thaughts from an (almost) Lurker.

2005-07-31 Thread Peter Hansen
Paddy wrote: > Sometimes when reading c.l.p. I mentally stand off from what I have > been reading and get an odd feeling that 'WE ARE BEING TESTED'. That > someone else is purposefully posting a near repetitive post, or obvious > flame bait etc - not for the usual reasons, but to track the dynamic

Re: Wheel-reinvention with Python

2005-07-31 Thread Andrea Griffini
On Sun, 31 Jul 2005 02:23:39 -0700, Robert Kern <[EMAIL PROTECTED]> wrote: >Like PyGUI, more or less? > >http://www.cosc.canterbury.ac.nz/~greg/python_gui/ We ended up using (py)Qt, and it's a nice library but to my eyes is a lot un-pythonic. In many cases there are convoluted solutions that seem

Re: getting an empty tuple

2005-07-31 Thread Steven D'Aprano
On Sun, 31 Jul 2005 08:40:26 -0700, nephish wrote: > Hey there, > i have a simple database query that returns as a tuple the number of > rows that the query selected. > kinda like this > cursor.execute('select value from table where autoinc > 234') x = cursor.fetchall() print x >

Re: namespaces

2005-07-31 Thread Rob Williscroft
Steven D'Aprano wrote in news:[EMAIL PROTECTED] in comp.lang.python: > Quoting Rob Williscroft: > >> > def translate( text ) >> > import string all=string.maketrans('','') >> > badcars=all.translate(all,string.letters+string.digits) >> > TABLE = string.maketrans(badcars,'_'*l

Re: Wheel-reinvention with Python

2005-07-31 Thread Kay Schluehr
Ed Leafe wrote: > On Sunday 31 July 2005 01:02, phil hunt wrote: > > > You mightn't have, but I suspect more Python programers who've > > written GUI apps have used Tkinter than any of the other APIs. > > > > Not that I'm a particular fan of it, it's just I like > > standardisation, because then y

Re: string methods

2005-07-31 Thread Martin v. Löwis
anthonyberet wrote: > For example if I wanted to replace the 4th character in 'foobar' (the > b)with the contents of another string, newchar, what would be the > easiest way? Depends on how your input is specified. If you know it is the b you want to replace, you write >>> text="foobar" >>> t

Re: c/c++ extensions and help()

2005-07-31 Thread Philip Austin
Robert Kern <[EMAIL PROTECTED]> writes: > Lenny G. wrote: >> Is there a way to make a c/c++ extension have a useful method >> signature? Right now, help(myCFunc) shows up like: >> myCFunc(...) >> description of myCFunc >> I'd like to be able to see: >> myCFunc(myArg1, myArg2) >> description o

__autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-31 Thread falcon
Hello python-list, As I Understood, semantic may be next: def qwerty(a,a.i,b,b.i,f.j): pass Would work like: def qwerty(anonymous1,anonymous2,anonymous3,anonymous4,anonymous5): (a,a.i,b,b.i,f.j)=(anonymous1,anonymous2,anonymous3,anonymous4,anonymous5) del anonymous1

Re: shelve: writing out updates?!

2005-07-31 Thread Michael Hoffman
phil hunt wrote: > But, what if the Python documentation was on a Wiki? Then it would > be easy to update! Of course, we would have to guard against false > or malicious updates, but Wikipedia manage that OK. The > Documentation Wiki could then be used as a basis for the "official" > documenta

Re: Thaughts from an (almost) Lurker.

2005-07-31 Thread Paddy
L.OL :-) -- http://mail.python.org/mailman/listinfo/python-list

Your IP Address

2005-07-31 Thread Your IP address
Your IP address http://www.ipimne.com";>Your IP address www.ipimne.com -- http://mail.python.org/mailman/

Re: namespaces

2005-07-31 Thread Paolino
>>Steven D'Aprano wrote: > Why not? Is it too slow? Too many lines of code? Uses too much memory? > What exactly is the problem? I would like to see your profile tests that > show why this is not acceptable. > Are you sure that this solution is less efficient than creating a class? A > class has

Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 10:01 +0200, Torsten Bronger wrote: > Hallöchen! > > Cliff Wells <[EMAIL PROTECTED]> writes: > > > [...] > > > > The least headache for end users comes from properly packaging your > > application. End users shouldn't need to worry about installing third > > party packages

Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 04:23 -0700, Paul Rubin wrote: > Torsten Bronger <[EMAIL PROTECTED]> writes: > > >> Does py2exe work for all GUI libraries? > > > No, it's Windows-only. > > However, OS'es and GUI libraries are different axes in the space of > > possibilities. > > I'm not sure what you mean.

Re: shelve: writing out updates?!

2005-07-31 Thread Michael Hudson
Robert Kern <[EMAIL PROTECTED]> writes: >> The Documentation Wiki could then be used as a basis for the >> "official" documentation that comes with each new release. >> Does this idea make some sense? Or are there hidden pitfalls? > > Yes! Someone actually has to do it! I think someone is working

Re: Asking the user a question and giving him a default answer he can edit

2005-07-31 Thread Michael Hudson
"levander" <[EMAIL PROTECTED]> writes: > Basically, I've got a bunch of questions to ask a user, the vast > majority of which, the answer will only vary by the last few > characters. What I'd like to do is every time the user is asked a > question, give him the default answer as just whatever he a

Re: getting an empty tuple

2005-07-31 Thread nephish
ok, this is what works: if x == (): sorry about the bad info. and what i ment to put was x[0] not x(0) thanks for the tips its all good now shawn Steven D'Aprano wrote: > On Sun, 31 Jul 2005 08:40:26 -0700, nephish wrote: > > > Hey there, > > i have a simple database query that returns as a t

Re: namespaces

2005-07-31 Thread Paolino
George Sakkis wrote: > Then write a closure. You get both encapsulation and efficience, and as > a bonus, customization of the translating function: > > import string > > def translateFactory(validChars=string.letters+string.digits, > replaceChar='_'): > all=string.maket

Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 01:08 -0700, Paul Rubin wrote: > Cliff Wells <[EMAIL PROTECTED]> writes: > > application. End users shouldn't need to worry about installing third > > party packages (or even Python for that matter). Tools such as py2exe > > and Inno installer make this pretty simple on Wind

Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 00:23 -0700, Paul Rubin wrote: > [EMAIL PROTECTED] (phil hunt) writes: > > What you say Pythonic, what do you mean? And how do you rate > > Tkinter, PyGtk, PyQt/PyKDE, wxWindows for "Pythonicness"? > > Tkinter is not very Pythonic because it's sort of a Frankenstein > hybri

Re: Changing interpreter's deafult output/error streams

2005-07-31 Thread Michael Hudson
"Ira" <[EMAIL PROTECTED]> writes: > Using an embedded interpreter, how do I change it's default output > streams (specifically the one used by PyErr_Print() which I'm > guessing is the default error stream)? It looks as though it writes to stderr unconditionally. But most of the reasons for ende

Re: Wheel-reinvention with Python

2005-07-31 Thread Mike Meyer
Torsten Bronger <[EMAIL PROTECTED]> writes: > Hallöchen! > Mike Meyer <[EMAIL PROTECTED]> writes: >> Torsten Bronger <[EMAIL PROTECTED]> writes: >>> Calvin Spealman <[EMAIL PROTECTED]> writes: The choice is GUI toolkits is largely seperate from Python. Consider that they are just binding

Re: Wheel-reinvention with Python

2005-07-31 Thread Mike Meyer
Cliff Wells <[EMAIL PROTECTED]> writes: > On Sun, 2005-07-31 at 00:59 -0400, Mike Meyer wrote: > >> I don't particularly like Tkinter, but it seems to me that it's pretty >> much won. It seems to be installed on every desktop platform along >> with Python. That means that if I want to distribute G

How override ALL function calls? (Is there a "function call function"?)

2005-07-31 Thread [EMAIL PROTECTED]
I'm trying run a homegrown profiler on some Python code. Rather than apply profiler wrapper to ALL functions by hand Is there a low level Python function I can override to modify how ALL functions are called? Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 10:07 -0700, Kay Schluehr wrote: > Some other people already abandoned Python not for the worst reasons: > > http://www.kevin-walzer.com/pivot/entry.php?id=69 Being a developer requires not only a bit of brains, but quite a bit of tenacity as well. Apparently Kevin lacks t

Re: Wheel-reinvention with Python

2005-07-31 Thread Mike Meyer
Jorge Godoy <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > > [ Having GUI stuff included on a standard installation of Python ] > >> However, you can get compilers for both that come bundled with a good >> GUI library. Could it be that that's what you really want - someone to >> distribute Pyth

Re: Wheel-reinvention with Python

2005-07-31 Thread Mike Meyer
Paul Rubin writes: > The others are non-Pythonic because they're not included in the > standard distro and therefore the Pythonic "use the included > batteries" tenet says to use Tkinter despite its flaws. When did "use the included batteries" become pythonic? "import t

Re: How override ALL function calls? (Is there a "function call function"?)

2005-07-31 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > I'm trying run a homegrown profiler on some Python code. > > Rather than apply profiler wrapper to ALL functions by hand > > Is there a low level Python function I can override to modify > > how ALL functions are called? Yes, please take a look at sys.setprofile()

Re: multiple inheritance super()

2005-07-31 Thread Mike Meyer
"Michele Simionato" <[EMAIL PROTECTED]> writes: > Mike Meyer: >> I think you're replying to me, but you didn't include any indication >> so I can't be sure. > > Oops, sorry, yes, I was replying to you. > >> These two are cases of what I was talking about when I referred to the >> Church-Turing thes

Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 14:58 -0400, Mike Meyer wrote: > And what do I use to bundle my application for Unix? Most of the > things I build get installed on Unix servers. You install GUI apps on Unix *servers*? Regardless, when you say "Unix", what do you mean? You may as well say "OS" as this te

Re: python SMTP server

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 13:14 +0200, Benjamin Niemann wrote: > But you should be aware of the fact that (if you send mail from a dialup > machine without going through a relay server) your mails will quickly be > marked as spam - I hope you do not intend to send spam... Yah, Postfix on my servers u

Re: A replacement for lambda

2005-07-31 Thread Bengt Richter
On Sun, 31 Jul 2005 00:30:36 -0400, Mike Meyer <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] (Bengt Richter) writes: > >> On Fri, 29 Jul 2005 18:07:31 -0400, Mike Meyer <[EMAIL PROTECTED]> wrote: >>>I know, lambda bashing (and defending) in the group is one of the most >>>popular ways to avoid wri

Re: Wheel-reinvention with Python

2005-07-31 Thread Kay Schluehr
Cliff Wells wrote: > > My objection with wrappers around wrappers around wrappers is that I > > have no hope ever watching the ground. If some error occurs, which > > layer has to be addressed? Which developing group is reponsible? My own > > or that of team A, team B, team C ... ? The baroque con

Re: keylogger in Python

2005-07-31 Thread Michael Hoffman
[Michael Hoffman] >>You think this is a suitable beginner project? [Francois Pinard] > One surely learns a lot! :-) I can agree with that! -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: namespaces

2005-07-31 Thread Kay Schluehr
Paolino wrote: > The second point also shows my perplexities about functions namespace: > > def function(): >function.foo='something' > > a=function.foo > > Traceback (most recent call last): >File "", line 1, in ? > AttributeError: 'function' object has no attribute 'foo' > > How should I

Re: Dabo in 30 seconds?

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 00:32 -0700, Paul Rubin wrote: > Those issues about the 1600 dependencies don't apply nearly as much to > pure Python modules (e.g. Twisted) as they do to extension modules > that require the presence of further stuff on the system. E.g., on > Linux, to use wxPython, you nee

  1   2   >