Re: Dabo in 30 seconds?

2005-07-31 Thread Cliff Wells
On Sat, 2005-07-30 at 20:29 -0700, James Stroud wrote: 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

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

2005-07-31 Thread phil hunt
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 to a file or directory @param

Re: Wheel-reinvention with Python

2005-07-31 Thread phil hunt
On Sat, 30 Jul 2005 16:51:13 +0200, Torsten Bronger [EMAIL PROTECTED] wrote: Hallöchen! [EMAIL PROTECTED] (phil hunt) writes: [...] How about sometihing with the same API as Tkinter (so no need to relearn), but which looks prettier? Would that fix your gripes? I haven't learned Tkinter.

Re: shelve: writing out updates?!

2005-07-31 Thread phil hunt
On 30 Jul 2005 17:48:39 -0700, Paul Rubin http://[EMAIL PROTECTED] wrote: Shelve uses dbm and pickle to make a persistent object store. The db in dbm stands for database and while I didn't expect full ACID capability, What is ACID? I'd have thought there'd be at least some minimum gesture

Re: shelve: writing out updates?!

2005-07-31 Thread phil hunt
On Sat, 30 Jul 2005 17:57:17 -0700, Robert Kern [EMAIL PROTECTED] wrote: Paul Rubin wrote: Shelve uses dbm and pickle to make a persistent object store. The db in dbm stands for database and while I didn't expect full ACID capability, I'd have thought there'd be at least some minimum gesture

Re: Wheel-reinvention with Python

2005-07-31 Thread Torsten Bronger
Hallöchen! [EMAIL PROTECTED] (phil hunt) writes: On Sat, 30 Jul 2005 16:51:13 +0200, Torsten Bronger [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] (phil hunt) writes: [...] How about sometihing with the same API as Tkinter (so no need to relearn), but which looks prettier? Would that fix

Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
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 GUI apps, I'm going to cause the least headache

Re: The state of OO wrappers on top of wxPython (was Re: Wheel-reinvention with Python)

2005-07-31 Thread Cliff Wells
On Sat, 2005-07-30 at 16:52 -0700, Bugs wrote: Cliff Wells wrote: But how stable is GTK on systems such as Windows and OS/X? That has been what has kept me from using it. Most GTK apps I've used on Windows (including the venerable GIMP) are nowhere near as stable as their Linux

Re: shelve: writing out updates?!

2005-07-31 Thread Robert Kern
phil hunt wrote: 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 here, I'd have to download the current source for the latest Python documentation, download, install and learn the

Error

2005-07-31 Thread steve
The message cannot be represented in 7-bit ASCII encoding and has been sent as a binary attachment. -- Virus Warning Message (on cse.iitkgp.ernet.in) file.bat is removed from here because it contains a virus. ---

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

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

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.

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 something,

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 to a file or

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 dynamics

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

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 make

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 in

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 why it

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 be

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

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 where

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 have

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. Like PyGUI,

Re: Wheel-reinvention with Python

2005-07-31 Thread Torsten Bronger
Hallöchen! Paul Rubin http://[EMAIL PROTECTED] 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 need to

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(): import

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://www.deelan.com/ -- 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 to escape more

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! Hmm... On second

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 a

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): return

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

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 not

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

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, since

Re: Wheel-reinvention with Python

2005-07-31 Thread Torsten Bronger
Hallöchen! Paul Rubin http://[EMAIL PROTECTED] 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 you mean. I didn't ask

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 do

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 whether it works

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 PyCon

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 and

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

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

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('','')

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

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

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 win32

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 be

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

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 developed

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 my python

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, but I'd

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'(script(\s*\S+\s*)+/script)' takes ages to complete in python on simple HTML file

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

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 there are none

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 not x:

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

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 decide

Re: Wheel-reinvention with Python

2005-07-31 Thread Torsten Bronger
Hallöchen! Paul Rubin http://[EMAIL PROTECTED] 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 for creating

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 pollution. And no

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 dynamics

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 to

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 21L 21L is not a

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,'_'*len(badcars))

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 you get

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 text =

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 of myCFunc Is

__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 documentation

Your IP Address

2005-07-31 Thread Your IP address
html head titleYour IP address/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 style type=text/css !-- body { background-color: ##BBE1DF; } .style1 { font-size: 36px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; }

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 all

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 (or even Python

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

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 on this as

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 answered

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 tuple

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='_'):

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 Windows, and

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 hybrid of

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 ended up

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 bindings to libraries that

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 GUI apps,

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 the

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 Python bundled

Re: Wheel-reinvention with Python

2005-07-31 Thread Mike Meyer
Paul Rubin http://[EMAIL PROTECTED] 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 this says

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 thesis. Well, let

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 term

  1   2   >