Re: sqlobject performance problems (really)

2005-09-27 Thread qvx
qvx wrote: > "autocommit off" attempt: > > connection_string = 'sqlite:/' + db_filename +'?autoCommit=0' > > "no select" attempt: > > t1 = T1(id=t1id, col1=r.col1, ...) I changed : conn_string = 'sqlite:/' + db_datoteka +'?autoCommit=0' conn = connectionForURI(conn_string) SQL

Re: Overhead of individual python apps

2005-09-27 Thread Fredrik Lundh
Paul Rubin wrote: >> Several apps using 4Mb each shouldn't be very much memory (maybe >> 20Mb at most). You didn't say how much memory was in your machine, >> but 256Mb of memory will cost you no more than $50. Not really >> worth a lot of effort. > > That is bogus reasoning. not if you're a pr

Re: subprocess problem

2005-09-27 Thread Uri Nix
Hi, I had a similar problem recently, and found that using pipes with os.popen* helped in my case. You can check the thread at: http://mail.python.org/pipermail/python-list/2005-September/300744.html. Cheers, Uri Do Re Mi chel La Si Do wrote: > Hi! > > This script (under Win-XP + P-2.4.1) : >

Re: Silly function call lookup stuff?

2005-09-27 Thread Fredrik Lundh
Lucas Lemmens wrote: >>> This way any function would only need to be looked up once. >> >> you haven't really thought this over, have you? > > You haven't really answered my questions have you? no, because you proposed a major change to the Python semantics, without spending any effort whatsoever

Python in The Economist

2005-09-27 Thread Frank Millman
FYI http://www.economist.com/science/displayStory.cfm?Story_id=4368122&CFID=65783500&CFTOKEN=ed98f5-9eb5adc6-80da-4e08-a843-746292fe83b8 Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

subprocess problem

2005-09-27 Thread Do Re Mi chel La Si Do
Hi! This script (under Win-XP + P-2.4.1) : import subprocess p1=subprocess.Popen(r'cmd /cdir *.* /S /W /B', stdout=subprocess.PIPE) chaineretour=p1.stdout.read() run OK if called from DOS-console. But, from another Python's script (by COM + exec) give me an error. Here, the traceb

Re: PEP 350: Codetags

2005-09-27 Thread Bengt Richter
On Tue, 27 Sep 2005 18:53:03 +0100, Tom Anderson <[EMAIL PROTECTED]> wrote: >On Tue, 27 Sep 2005, Bengt Richter wrote: > >> 5) Sometimes time of day can be handy, so maybe <2005-09-26 12:34:56> >> could be recognized? > >ISO 8601 suggests writing date-and-times like 2005-09-26T12:34:56 - using >

Re: Overhead of individual python apps

2005-09-27 Thread ncf
First, please don't get so upset at people's replies (if you weren't upset, that's how it was coming across, so my apologies). No matter what newsgroup/forum you go to, there's always someone who's going to suggest something like that. Anyways, I'm fairly certain there are some minimalistic Python

Re: zlib decode fails with -5

2005-09-27 Thread ncf
I don't mean this harshly, but have you tried recompressing the data to see if you may have had a bad data set? If it still fails, then I'm really not sure why/how zlib decides that there isn't enough room in the output buffer. "Z_BUF_ERROR if there was not enough room in the output buffer" Sorry

Re: Python 2.4 under WinXP, free VC71 toolkit and VC6 libraries

2005-09-27 Thread Peter Hansen
Berthold Höllmann wrote: > As I understand it, ctypes is not really a solution. The code is about > data handling and FE analysis. It has not GUI component. I'm not sure > how well ctypes works with Numeric arrays, but I'm sure ctypes does > not work on Linux and Solaris, but my code has to. Neith

Re: __call__ in module?

2005-09-27 Thread ncf
Thanks for this information. It'd really be interesting to see how well this works for the code I wish to apply it to. Thanks again and have a GREAT day. -Wes -- http://mail.python.org/mailman/listinfo/python-list

Re: __call__ in module?

2005-09-27 Thread ncf
My thanks to you and Fredrik Lundh for the quality replies. however much so, I appreciate your moreso descriptive reply. I probably should've been a little more specific in my original query, and have stated that I *did* try it before I posted here asking for help. I was just hoping somebody would

Re: __call__ in module?

2005-09-27 Thread ncf
My thanks to you and Fredrik Lundh for the quality replies. however much so, I appreciate your moreso descriptive reply. I probably should've been a little more specific in my original query, and have stated that I *did* try it before I posted here asking for help. I was just hoping somebody would

Re: sorting tuples...

2005-09-27 Thread Dan Sommers
On 27 Sep 2005 19:01:38 -0700, [EMAIL PROTECTED] wrote: > with the binary stuff out of the way, what i have is this string data: > 20050922 # date line > mike > mike's message... > 20040825 # date line > jeremy > jeremy's message... > ... > what i want to do is to use the date line as the first

Re: sorting tuples...

2005-09-27 Thread nidhog
Magnus Lycka wrote: > Why? It seems you are trying to use a string as some kind of container, > and Python has those in the box. Just use a list of tuples, rather than > a list of strings. That will work fine for .sort(), and it's much more > convenient to access your data. Using the typical tool

Re: Silly function call lookup stuff?

2005-09-27 Thread Dan Sommers
On Wed, 28 Sep 2005 00:38:23 +0200, Lucas Lemmens <[EMAIL PROTECTED]> wrote: > On Tue, 27 Sep 2005 13:56:53 -0700, Michael Spencer wrote: >> Lucas Lemmens wrote: >>> Why isn't the result of the first function-lookup cached so that >>> following function calls don't need to do the function-lookup

Re: Perl's documentation come of age

2005-09-27 Thread Mike
"Mike" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Looks like I'm having a bad week w/these URLs, because now I'm not able to > access http://lists.ironpython.com/listinfo.cgi/users-ironpython.com . > I was hoping to get at the archives to see if I can glean more info before >

Re: Human readable number formatting

2005-09-27 Thread J Correia
"Alex Willmer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > When reporting file sizes to the user, it's nice to print '16.1 MB', > rather than '16123270 B'. This is the behaviour the command 'df -h' > implements. There's no python function that I could find to perform this > format

Re: Perl's documentation come of age

2005-09-27 Thread Mike
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Mike wrote: >> "Steve Holden" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> >>>Jim Hugunin's keynote speech at this year's PyCon was accompanied by a >>>projection if his interactive interpreter ses

Re: Overhead of individual python apps

2005-09-27 Thread Paul Rubin
Larry Bates <[EMAIL PROTECTED]> writes: > Several apps using 4Mb each shouldn't be very much memory (maybe > 20Mb at most). You didn't say how much memory was in your machine, > but 256Mb of memory will cost you no more than $50. Not really > worth a lot of effort. That is bogus reasoning. I ca

Re: PEP 350: Codetags

2005-09-27 Thread Paul Rubin
Terry Hancock <[EMAIL PROTECTED]> writes: > But that's precisely why it would be valuable to have a PEP -- a > central catalog of such conventions makes it possible for checking > software to be consistent. If PyChecker were going to check for such > things, it would do so only because a standard

Re: Human readable number formatting

2005-09-27 Thread Erik Max Francis
Alex Willmer wrote: > When reporting file sizes to the user, it's nice to print '16.1 MB', > rather than '16123270 B'. This is the behaviour the command 'df -h' > implements. There's no python function that I could find to perform this > formatting , so I've taken a stab at it: BOTEC at

Re: Human readable number formatting

2005-09-27 Thread Mike Meyer
Alex Willmer <[EMAIL PROTECTED]> writes: > When reporting file sizes to the user, it's nice to print '16.1 MB', > rather than '16123270 B'. This is the behaviour the command 'df -h' > implements. There's no python function that I could find to perform this > formatting , so I've taken a stab at it

Re: What tools are used to write and generate Python Library documentation.

2005-09-27 Thread Robert Kern
Terry Hancock wrote: > On Monday 26 September 2005 10:24 pm, Kenneth McDonald wrote: > >>I have a module I'd like to document using the same style... > > Google for "epydoc", "pydoc", and "happydoc". > > You've already received a comment about markup standards, > although you will find more info

Re: Human readable number formatting

2005-09-27 Thread jepler
Compared to your program, I think the key to mine is to divide by "limit" before taking the log. In this way, things below the "limit" go to the next lower integer. I think that instead of having 'step' and 'base', there should be a single value which would be 1000 or 1024. import math def Mak

Re: Overhead of individual python apps

2005-09-27 Thread Larry Bates
Several apps using 4Mb each shouldn't be very much memory (maybe 20Mb at most). You didn't say how much memory was in your machine, but 256Mb of memory will cost you no more than $50. Not really worth a lot of effort. -Larry Qopit wrote: > I'm setting up a system that consists of several small

Re: __call__ in module?

2005-09-27 Thread Leif K-Brooks
ncf wrote: > I have a feeling that this is highly unlikely, but does anyone in here > know if it's possible to directly call a module, or will I have to wrap > it up in a class? You could use trickery with sys.modules to automatically wrap it in a class: import sys from types import ModuleType c

Re: __call__ in module?

2005-09-27 Thread Steven D'Aprano
On Tue, 27 Sep 2005 14:19:13 -0700, ncf wrote: > I have a feeling that this is highly unlikely, but does anyone in here > know if it's possible to directly call a module, or will I have to wrap > it up in a class? Why not try it yourself? Write a quick module like this: """Call a module""" def

Re: Getting a number out of a string

2005-09-27 Thread Steven D'Aprano
On Tue, 27 Sep 2005 20:28:53 +, Claudio Grondi wrote: > what about: lst = [digit for digit in '06897'] lst > ['0', '6', '8', '9', '7'] No need to use a list comprehension when this works just as well: py> list('06897') ['0', '6', '8', '9', '7'] -- Steven. -- http://mail.python.

Human readable number formatting

2005-09-27 Thread Alex Willmer
When reporting file sizes to the user, it's nice to print '16.1 MB', rather than '16123270 B'. This is the behaviour the command 'df -h' implements. There's no python function that I could find to perform this formatting , so I've taken a stab at it: import math def human_readable(n, suffix='B', p

Re: Spoiler to Python Challenge (help!!!)

2005-09-27 Thread Terry Hancock
On Tuesday 27 September 2005 08:32 am, Ian Vincent wrote: > I have a webpage with a BZ2 compressed text embedded in it looking like: > > 'BZh91AY&SYA\xaf\x82\r\x00\x00\x01\x01\x80\x02\xc0\x02\x00 \x00!\x9ah3M > \x07<]\xc9\x14\xe1BA\x06\xbe\x084' > > Now, if I simply copy and paste this into Pytho

Re: PEP 350: Codetags

2005-09-27 Thread Terry Hancock
On Tuesday 27 September 2005 03:07 am, Paul Rubin wrote: > [EMAIL PROTECTED] (Bengt Richter) writes: > > 2) In general, I think it might be good to meet Paul Rubin half way > > re convention vs syntax, but I don't think code tagging should be > > part of the language syntax per se. (-*- cookies -*-

Re: What tools are used to write and generate Python Library documentation.

2005-09-27 Thread Terry Hancock
On Monday 26 September 2005 10:24 pm, Kenneth McDonald wrote: > I have a module I'd like to document using the same style... Google for "epydoc", "pydoc", and "happydoc". You've already received a comment about markup standards, although you will find more information at the web pages for the abo

Re: PEP 350: Codetags

2005-09-27 Thread Terry Hancock
On Monday 26 September 2005 05:35 pm, Micah Elliott wrote: > Please read/comment/vote. This circulated as a pre-PEP proposal > submitted to c.l.py on August 10, but has changed quite a bit since > then. I'm reposting this since it is now "Open (under consideration)" > at

Re: PEP 350: Codetags

2005-09-27 Thread Terry Hancock
On Monday 26 September 2005 10:25 pm, Paul Rubin wrote: > > I really doubt you'll find much agreement for this (the compiler > > should enforce it) position. The 'fewer conventions are better' > > position might enjoy more support, but doesn't strike me as > > particularly Pythonic (e.g. compare w

Re: Overhead of individual python apps

2005-09-27 Thread Mike Meyer
"Qopit" <[EMAIL PROTECTED]> writes: > When running in Windows, launching each application generates a > process, and each of those processes ends up taking up > 4MB of system > memory. This memory usage is as reported by the Windows Task manager > for the python.exe image name. The first step is

Re: __call__ in module?

2005-09-27 Thread Qopit
Nope - you can't even force it by binding a __call__ method to the module. For future reference, you can check to see what things *are* callable with the built-in function 'callable'. eg (with sys instead of MyApp): >>> import sys >>> callable(sys) False Also - a thing you can do to sort of do

Re: [Python-Dev] PEP 350: Codetags

2005-09-27 Thread Michael
At 03:35 PM 9/26/2005 -0700, Micah Elliott wrote: > Please read/comment/vote. This circulated as a pre-PEP proposal >submitted to c.l.py on August 10, but has changed quite a bit since >then. I'm reposting this since it is now "Open (under consideration)" >at

Re: Silly function call lookup stuff?

2005-09-27 Thread Lucas Lemmens
On Tue, 27 Sep 2005 13:56:53 -0700, Michael Spencer wrote: > Lucas Lemmens wrote: >> Dear pythonians, >> >> I've been reading/thinking about the famous function call speedup trick >> where you use a function in the local context to represent a "remoter" >> function to speed up the 'function looku

Re: Silly function call lookup stuff?

2005-09-27 Thread Lucas Lemmens
On Tue, 27 Sep 2005 22:41:22 +0200, Fredrik Lundh wrote: > Lucas Lemmens wrote: > >> Why isn't the result of the first function-lookup cached so that >> following function calls don't need to do the function-lookup at all? >> >> And if the context changes (an import-statement say) reset the cache

Overhead of individual python apps

2005-09-27 Thread Qopit
I'm setting up a system that consists of several small python applications that all communicate amongst each other on the same pc. When running in Windows, launching each application generates a process, and each of those processes ends up taking up > 4MB of system memory. This memory usage is as

Re: What tools are used to write and generate Python Librarydocumentation.

2005-09-27 Thread Robert Kern
Brett Hoerner wrote: > You get to spend all day in ipython? > > Can I have your job? Well, I use the terms "work" and "day" rather loosely. I'm a graduate student in geophysics. Somehow it rarely happens during daylight hours and quite possibly wouldn't be called working by an outside observer.

Re: What tools are used to write and generate PythonLibrarydocumentation.

2005-09-27 Thread Fredrik Lundh
Robert Kern wrote: > The one thing I dislike about PythonDoc is that it puts everything into > comments and thus docstrings are usually neglected. teaser: >>> from elementtree import ElementTree >>> help(ElementTree) Help on module ElementTree: NAME ElementTree DESCRIPTION # ElementTre

Re: __call__ in module?

2005-09-27 Thread Fredrik Lundh
"ncf" wrote. >I have a feeling that this is highly unlikely, but does anyone in here > know if it's possible to directly call a module no. -- http://mail.python.org/mailman/listinfo/python-list

Re: What tools are used to write and generate Python Library documentation.

2005-09-27 Thread Michael Ekstrand
On Sep 27, 2005, at 12:45 PM, Kenneth McDonald wrote: > It's too bad that there is no equivalent of d'oxygen for Python. That > is a _nice_ program. I've been using epydoc (http://epydoc.sourceforge.net) for a while now, and it's really nice. The output is very much in the style of Javadoc. Its

Re: What tools are used to write and generate Python Librarydocumentation.

2005-09-27 Thread Brett Hoerner
You get to spend all day in ipython? Can I have your job? -- http://mail.python.org/mailman/listinfo/python-list

__call__ in module?

2005-09-27 Thread ncf
I have a feeling that this is highly unlikely, but does anyone in here know if it's possible to directly call a module, or will I have to wrap it up in a class? i.e., import MyMod MyMod.whatever = "Hi?" MyMod("meow mix") Thanks in advance -Wes -- http://mail.python.org/mailman/listinfo/python-

Re: Silly function call lookup stuff?

2005-09-27 Thread Michael Spencer
Lucas Lemmens wrote: > Dear pythonians, > > I've been reading/thinking about the famous function call speedup > trick where you use a function in the local context to represent > a "remoter" function to speed up the 'function lookup'. > > "This is especially usefull in a loop where you call the

Re: Silly function call lookup stuff?

2005-09-27 Thread Fredrik Lundh
Lucas Lemmens wrote: > Why isn't the result of the first function-lookup cached so that following > function calls don't need to do the function-lookup at all? > > And if the context changes (an import-statement say) reset the > cached 'function-lookups'. import isn't the only way for the "contex

Silly function call lookup stuff?

2005-09-27 Thread Lucas Lemmens
Dear pythonians, I've been reading/thinking about the famous function call speedup trick where you use a function in the local context to represent a "remoter" function to speed up the 'function lookup'. "This is especially usefull in a loop where you call the function a zillion time" they say

Re: What tools are used to write and generate Python Librarydocumentation.

2005-09-27 Thread Robert Kern
Fredrik Lundh wrote: > Kenneth McDonald wrote: > >>More seriously, there is a major problem with docstrings in that they >>can only document something that has a docstring; classes, functions, >>methods, and modules. But what if I have constants that are >>important? The only place to document the

Re: memoru usage of process

2005-09-27 Thread MrJean1
On Linux, this may work for you /Jean Brouwers Jacek Poplawski wrote: > I need to know how much memory uses child process (after > subprocess.Popen), so I want function: > > get_memory_usage(pid) > > I found two ways: > > - cal

Re: Python 2.4 under WinXP, free VC71 toolkit and VC6 libraries

2005-09-27 Thread Benji York
Berthold Höllmann wrote: > I'm sure ctypes doesnot work on Linux and Solaris, but my code has > to. I've used ctypes to great effect on Linux. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I set the size of a window with tkinter?

2005-09-27 Thread James Stroud
You may want to read this scrollbar page: http://effbot.org/zone/tkinter-scrollbar-patterns.htm On Tuesday 27 September 2005 12:31, Tor Erik S�nvisen wrote: > Hi > > I create a canvas that is to big for the default window-size, so it gets > cut to fit... > How can I increase the window-size to ma

sqlobject performance problems (really)

2005-09-27 Thread qvx
I'm writing a small project and I decided to try pysqlite. The database consists of one master table with five columns and two detail tables with one and two columns each (not counting foreign key columns). The program scans an input file and inserts data into those three tables. First I used pysq

Re: How can I set the size of a window with tkinter?

2005-09-27 Thread Fredrik Lundh
Tor Erik Sønvisen wrote: > I create a canvas that is to big for the default window-size, so it gets cut > to fit... what default window size? what geometry management approach are you using? (if you're using pack or grid, your toplevel window should adapt itself to the canvas size, unless you'

Re: Problem SQL ADO

2005-09-27 Thread infidel
> "SELECT > VA_MK_YEAR,VA_MK_DESCRIP,VO_VIN_NO,VO_MODEL,VO_BODY,VO_DESCRIPTION" + \ > "FROM D014800 LEFT OUTER JOIN D014900 ON (VA_MK_NUMBER_VER = > VO_MAKE_NO) AND (VA_MK_YEAR = VO_YEAR)" + \ > "WHERE (((VA_MK_YEAR)=?) AND ((VA_MK_DESCRIP)=?) AND > ((VO_MODEL)=?))" Doesn't look like you h

How can I set the size of a window with tkinter?

2005-09-27 Thread Tor Erik Sønvisen
Hi I create a canvas that is to big for the default window-size, so it gets cut to fit... How can I increase the window-size to make sure the canvas fits? regards tores -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.4 under WinXP, free VC71 toolkit and VC6 libraries

2005-09-27 Thread Berthold Höllmann
"F. Petitjean" <[EMAIL PROTECTED]> writes: > Le Tue, 27 Sep 2005 17:48:47 +0200, Berthold Höllmann a écrit : >> I have wrapped some inhouse libraries for Python. > How ? Directly coding C code ? Depends :-) f2py, directly coding C, SWIG. >> The development team >> uses VC6 and DF6.1 for developm

Re: Getting a number out of a string

2005-09-27 Thread ssmith579
Thanks all! This is just what I needed. -- http://mail.python.org/mailman/listinfo/python-list

Re: What tools are used to write and generate Python Librarydocumentation.

2005-09-27 Thread Fredrik Lundh
Kenneth McDonald wrote: > More seriously, there is a major problem with docstrings in that they > can only document something that has a docstring; classes, functions, > methods, and modules. But what if I have constants that are > important? The only place to document them is in the module > docs

zlib decode fails with -5

2005-09-27 Thread Paul Watson
Traceback (most recent call last): File "", line 20, in ? File "c:\Python24\lib\encodings\zlib_codec.py", line 43, in zlib_decode output = zlib.decompress(input) zlib.error: Error -5 while decompressing data The -5 error appears to be a Z_BUF_ERROR from looking at the manual at http://www.zlib.ne

Re: WindowsError: stack overflow

2005-09-27 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I can get through about 1750 pages of 5000 before I get a WindowsError: > stack overflow exception. Any ideas how I can keep the program chugging > along? A typical source of stack overflow is recursion. Without seeing the code or a

Re: Spoiler to Python Challenge (help!!!)

2005-09-27 Thread Terry Reedy
"Ian Vincent" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > line = line[20:] > line = line[:-1] please, line = line[20:-1], etc, is easier to read and understand ;-) tjr -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] PEP 350: Codetags

2005-09-27 Thread Josiah Carlson
"Phillip J. Eby" <[EMAIL PROTECTED]> wrote: > At 03:35 PM 9/26/2005 -0700, Micah Elliott wrote: > >Please read/comment/vote. This circulated as a pre-PEP proposal > >submitted to c.l.py on August 10, but has changed quite a bit since > >then. I'm reposting this since it is now "Open (under consi

Re: Getting a number out of a string

2005-09-27 Thread Will McGugan
Claudio Grondi wrote: > what about: > lst = [digit for digit in '06897'] lst > > ['0', '6', '8', '9', '7'] Or.. >>> list('06897') ['0', '6', '8', '9', '7'] Will McGugan -- http://www.willmcgugan.com "".join({'*':'@','^':'.'}.get(c,0) or chr(97+(ord(c)-84)%26) for c in "jvyy*jvyyzpth

Re: Getting a number out of a string

2005-09-27 Thread Claudio Grondi
what about: >>> lst = [digit for digit in '06897'] >>> lst ['0', '6', '8', '9', '7'] Claudio <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > I'm trying to extract single digit number from a string. > > t[1] = '06897' > > I want to get the 7, 9,8 & 6 seperated out to use but ca

Re: Getting a number out of a string

2005-09-27 Thread jepler
You can index into a string: >>> s = '06897' >>> s[2] '8' You can also turn each character into an integer, in various ways: >>> [int(c) for c in s] [0, 6, 8, 9, 7] >>> map(int, s) [0, 6, 8, 9, 7] Jeff pgpDMq5e3RucB.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/pyth

Re: What tools are used to write and generate Python Library documentation.

2005-09-27 Thread Kenneth McDonald
Unfortunately, none of the documentation tools that use documentation strings are suitable for full, serious documentation. There are a number of reasons for this, and I'll touch on a few. The obvious one is that there is no standard format for docstrings, and this creates problems when tryi

Re: Documenting properties

2005-09-27 Thread Gerrit Holl
Paul McNett wrote: > > Whatever is preferred, what's the upside/downsides of the two beyond > > what I just explained? > > Nothing really, but something handy to keep in mind is that the string > literal ("""x""") can be used to block out huge sections of code during > testing, where you'd have to

Getting a number out of a string

2005-09-27 Thread ssmith579
I'm trying to extract single digit number from a string. t[1] = '06897' I want to get the 7, 9,8 & 6 seperated out to use but can't find a way to split out the single characters. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Documenting properties

2005-09-27 Thread Paul McNett
Lasse Vågsæther Karlsen wrote: > So, my question is, is there a way to get __doc__ support for > properties, in effect, use the """xxx""" syntax for documenting properties. Yes, the property() function accepts a doc argument, as in: property(fget, fset, fdel, doc) ex: MyProp = property(_get, _se

Re: number of python users

2005-09-27 Thread Brett Hoerner
RHEL isn't really "big" on Distrowatch because Distrowatch is geared more towards users. RHEL 4.1 is using Python 2.3.4 now, btw. -- http://mail.python.org/mailman/listinfo/python-list

Documenting properties

2005-09-27 Thread Lasse Vågsæther Karlsen
I notice that if I use this syntax: def classname: ... ## # closes the database connection and releases the resources. def close(self): ## # Returns a list of fields fields = property() then doing: help (classname) then the text is listed fo

Re: Carrying variables over from function to function

2005-09-27 Thread Magnus Lycka
Ivan Shevanski wrote: > Thanks for your quick responce Roy, thats exactly what I needed. =) No, it isn't! ;) It might seem like a good idea right now, but it's not a good choice in the long run. It's like peeing in bed: Initially it's both a relief and you get warm and cosy, but you'll end upp wi

Re: Self reordering list in Python

2005-09-27 Thread ABO
Actually, after posting this I did some more work on the PQueue modules I had, implementing both bisect and heapq versions. It turns out the bisect version is heaps faster if you ever delete or re-set values in the queue. The problem is heapq is O(N) for finding a particular entry in the Queue, an

Re: [Python-Dev] PEP 350: Codetags

2005-09-27 Thread Bill Mill
On 9/27/05, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 03:35 PM 9/26/2005 -0700, Micah Elliott wrote: > >Please read/comment/vote. This circulated as a pre-PEP proposal > >submitted to c.l.py on August 10, but has changed quite a bit since > >then. I'm reposting this since it is now "Open (un

Re: PEP 350: Codetags

2005-09-27 Thread Tom Anderson
On Tue, 27 Sep 2005, Bengt Richter wrote: > 5) Sometimes time of day can be handy, so maybe <2005-09-26 12:34:56> > could be recognized? ISO 8601 suggests writing date-and-times like 2005-09-26T12:34:56 - using a T as the separator between date and time. I don't really like the look of it, but

Re: Python 2.4 under WinXP, free VC71 toolkit and VC6 libraries

2005-09-27 Thread F. Petitjean
Le Tue, 27 Sep 2005 17:48:47 +0200, Berthold Höllmann a écrit : > I have wrapped some inhouse libraries for Python. How ? Directly coding C code ? > The development team > uses VC6 and DF6.1 for development of these libraries under WinXP. DF6.1 is Digital FORTRAN 6.1 ? > I > would like to wrap the

Problem SQL ADO

2005-09-27 Thread len
Using Python on WinXP going against MS SQL 2000 server. Connection is fine and I have executed several queries successfully. The following SQL statement however gives me an error and I have tried it several different ways: "SELECT VA_MK_YEAR,VA_MK_DESCRIP,VO_VIN_NO,VO_MODEL,VO_BODY,VO_DESCRIPTIO

Re: Memory stats

2005-09-27 Thread Fredrik Lundh
Tarek Ziadé wrote: > > If you want a list of all objects (container or not), you have to > > compile a debug build of Python. > > I am amazed not to find an existing implementation for this. the debug build is an existing implementation, of course. -- http://mail.python.org/mailman/listinf

Re: Memory stats

2005-09-27 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, Tarek Ziadé <[EMAIL PROTECTED]> writes >I am trying to find a general memory profiler that can measure the >memory usage in Python program >and gather some stats about object usages, and things like that. Not a Python module, but Python Memory Validator may fit the

installing cx_Oracle on Unix/Solaris

2005-09-27 Thread Steve
I'm posting this message here, so that someone googling here will be able to find it. I was having problems installing cx_Oracle on Solaris. The build would fail with a message: > ld: fatal: file /apps/oracle/prod/9.2/lib/libclntsh.so: wrong ELF class: > ELFCLASS64 I found the solution on Grig

Re: What is "self"?

2005-09-27 Thread Michael Spencer
Ron Adam wrote: > What I've noticed is you can block the visibility of a class attribute, > which include methods, by inserting an object in the instance with the > same name. > [snip example of this behavior] Yes, that's true for "non-data descriptors" (see last two bullets below) Raymond Het

Re: [Python-Dev] PEP 350: Codetags

2005-09-27 Thread Phillip J. Eby
At 03:35 PM 9/26/2005 -0700, Micah Elliott wrote: >Please read/comment/vote. This circulated as a pre-PEP proposal >submitted to c.l.py on August 10, but has changed quite a bit since >then. I'm reposting this since it is now "Open (under consideration)" >at

Re: Telephony project

2005-09-27 Thread aaron
It will be much easier to use asterisk, there's a win32 version aterisk available but it does not support hardware phone, voip only. A clone FXO card only cost $15 on ebay. "Roger" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm new to Python and need to do a (low level, I thin

Re: A 'find' utility that continues through zipped directory structure?

2005-09-27 Thread B Mahoney
An effbot utility? I'll try that. Thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: number of python users

2005-09-27 Thread Fredrik Lundh
Bryan wrote: > just for fun, i looked at the top linux distros at distrowatch and looked at > what version of python the latest released version is shipping with out of > the box: > > 1. ubuntu hoary - python 2.4.1 > 2. mandriva 2005 - python 2.4 > 3. suse 9.3 - python 2.4 > 4. fedora core 4 - py

Re: Dynamically adding and removing methods

2005-09-27 Thread Ron Adam
Steven D'Aprano wrote: > On Sun, 25 Sep 2005 14:52:56 +, Ron Adam wrote: > > >>Steven D'Aprano wrote: >> >> >> >>>Or you could put the method in the class and have all instances recognise >>>it: >>> >>>py> C.eggs = new.instancemethod(eggs, None, C) >>>py> C().eggs(3) >>>eggs * 3 >> >>Why not

Re: What is "self"?

2005-09-27 Thread Ron Adam
Diez B. Roggisch wrote: >> This still seems not quite right to me... Or more likely seems to be >> missing something still. >> >> (But it could be this migraine I've had the last couple of days >> preventing me from being able to concentrate on things with more than >> a few levels of complexit

Re: A 'find' utility that continues through zipped directory structure?

2005-09-27 Thread Fredrik Lundh
"B Mahoney" wrote: > Is there a Python 'find' -like utility that will continue the file > search through any zippped directory structure on the find path? something like this? # File: zipfind.py import fnmatch, os, sys, zipfile program, root, name = sys.argv for dirpath, dirnames, filenames in

Python 2.4 under WinXP, free VC71 toolkit and VC6 libraries

2005-09-27 Thread Berthold Höllmann
I have wrapped some inhouse libraries for Python. The development team uses VC6 and DF6.1 for development of these libraries under WinXP. I would like to wrap the libraries for Python and use the official Win Python from python.org. Now I get a segmentation fault in (access violation in NTDLL.DLL).

Re: Telephony project

2005-09-27 Thread Mike
I was able to do something like this in Python a while back. You'll need one of: (a) A telephone line dialer/monitor & DTMF I/O board that works through the serial port, and a phone audio tap that mixes the soundcard I/O to the phone (b) A TAPI-compliant modem that does everything you need (c) A

Re: Config parser module

2005-09-27 Thread qqcq6s59
wow, Thanks alex, this rocks really, [ i am new to OOP style in python] I am trying to implement it on similar lines, I`ll comeback if I encounter any trouble. thanks again -Jiro Paul McGuire wrote: > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Hi all > > I am a newbie and

Re: Memory stats

2005-09-27 Thread Tarek Ziadé
gene tani wrote: >linux: >http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286222 > > Yes thanks I have found this one, I need to try it out, but it does not provide a way to refcount, Another solution could be to use trace maybe I am going to try things out Regards -- http://mail.py

Re: Memory stats

2005-09-27 Thread Tarek Ziadé
Martin v. Löwis wrote: >Tarek Ziadé wrote: > > >>I am trying to find a general memory profiler that can measure the >>memory usage in Python program >>and gather some stats about object usages, and things like that. >> >> > >As Diez says, use gc: gc.getobjects() gives you all container objec

Re: Memory stats

2005-09-27 Thread gene tani
linux: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286222 Martin v. Löwis wrote: > Tarek Ziadé wrote: > > I am trying to find a general memory profiler that can measure the > > memory usage in Python program > > and gather some stats about object usages, and things like that. > > As Di

Re: Parametric Polymorphism

2005-09-27 Thread Jay Parlar
I haven't been following this whole thread, but it sounds like you want something like PJE's RuleDispatch package. There's a Developer Works article about it, put up very recently: http://www-128.ibm.com/developerworks/linux/library/l-cppeak2/?ca=dgr- lnxw02aScalingPEAK PJE (IIRC) based it of

WindowsError: stack overflow

2005-09-27 Thread hardieca
Hi, I'm developing a program that analyzes all the webpages on my webserver. I've created one class, Filewalker(), with a function that returns the paths of all ASP pages of interest as a list, which I then turn into a tuple. I then iterate over the tuple, passing each path to my Analyzer() clas

Re: Python batching on XP

2005-09-27 Thread Larry Bates
You should take a look at the subprocess module http://www.python.org/dev/doc/devel/lib/module-subprocess.html -Larry Bates [EMAIL PROTECTED] wrote: > Hi ! > > I want to write a program that backup some databases in the night. > > Pseudo like this: > > try: > if cmd('net stop dbservice'): >

  1   2   >