Re: Python cleanup on exit

2006-03-10 Thread Fredrik Lundh
Jacob Kroon wrote: > I'm working on a library written in C using GObject, which i > provide python bindings for using pygtk. When I checked the > library for memory leaks using valgrind, I noticed that none > of the objects I created in the script (that is they are global in > the script) were del

Re: File Permissions

2006-03-10 Thread Fredrik Lundh
"VJ" wrote: > I need to get the user permission of a file using python. I was trying > the following code which i found on google grups > > st = os.stat(myfile) > mode = st[stat.ST_MODE] > if mode & stat.ST_IREAD: > print "readable" > if mode & stat.ST_IWRITE: > print

Re: Cheese Shop: some history for the new-comers

2006-03-10 Thread Sybren Stuvel
richard enlightened us with: > Rejoice! No more confusing conversations with PyPy developers! Thanks for sharing that. I always wondered where the name came from :) Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we

Re: API/C memory mananegemnt problem

2006-03-10 Thread plahey
Sorry for responding to my own post. I think I understand the original statement now. What you are really saying is that there is a pool of Python float objects (which can, at different times, wrap different values) which can grow but never decrease in size. So the memory held by this pool is di

Re: Pythong CGI scrips on Windows Server 2003

2006-03-10 Thread Tim Roberts
Hugh Beyer <[EMAIL PROTECTED]> wrote: > >We are moving to a new server running Windows Server 2003 from existing >servers runing Windows Server 2002 and IIS is giving us fits. Do you mean Windows 2000 Server? My experience with IIS has been universally bad. In each and every case, I found it mu

Re: put multiple condition in if statement

2006-03-10 Thread Steven D'Aprano
On Fri, 10 Mar 2006 21:47:33 -0800, Alex Martelli wrote: > <[EMAIL PROTECTED]> wrote: > >> Hi, >> >> How can I put multiple condition in if statement? >> >> I try this, but I can't get that to work. >> >> if ( (str != " ") && (str != "") ): > > Why would you WANT to conjoin two instances of t

Re: API/C memory mananegemnt problem

2006-03-10 Thread plahey
I have not looked into C programming and Python so I probably don't understand the issues here but the above statement sounds very troubling. Does this mean that any integer or float created anywhere at anytime in a (pure) python program will be stored away for all time (as long as the program is

Re: put multiple condition in if statement

2006-03-10 Thread Steven D'Aprano
On Fri, 10 Mar 2006 21:12:57 -0800, Allerdyce.John wrote: > Hi, > > How can I put multiple condition in if statement? > > I try this, but I can't get that to work. > > if ( (str != " ") && (str != "") ): >>> if ( (str != " ") && (str != "") ): File "", line 1 if ( (str != " ") && (str !

Re: Python and C

2006-03-10 Thread Terry Reedy
"P Boy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Has anyone yet written a program to grab C struct declaration from the >> .h >> to produce code like >> >> # Overlay configuration >> class OverlayStoreConfig(ctypes.Structure): >> _fields_ = [('FormatVersion', ctypes.c

python search path on the command prompt in windows

2006-03-10 Thread John Salerno
Is there a way for me to somehow specify that I want Python to search all subdirectories of a particular directory when I'm running or testing files from the command prompt? For example, I have a folder in my C:\Python24 folder called myscripts\. At first I saved my scripts in there, since ther

Cheese Shop: some history for the new-comers

2006-03-10 Thread richard
So I wrote PyPI back a couple of years ago. It was just a simple cgi script and some distutils code. I needed to call it *something* and "Python Package Index" seemed like a fairly obvious name. Unfortunately, it's also quite a mouthful. A friend suggested "PyPI" as a good shorter name. He also ind

Re: Speed of data structures in python

2006-03-10 Thread Steven D'Aprano
On Fri, 10 Mar 2006 21:06:27 -0600, Terry Hancock wrote: > On Sat, 11 Mar 2006 13:12:30 +1100 > "Steven D'Aprano" <[EMAIL PROTECTED]> wrote: >> On Fri, 10 Mar 2006 23:24:46 +1100, Dave wrote: >> > Hi. I am learning PyOpenGL and I am working with a >> > largish fixed scene composed of several tho

Re: put multiple condition in if statement

2006-03-10 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > Hi, > > How can I put multiple condition in if statement? > > I try this, but I can't get that to work. > > if ( (str != " ") && (str != "") ): Why would you WANT to conjoin two instances of the SAME check...?! Anyway, use 'and' -- there's no such thing as '&&' in

put multiple condition in if statement

2006-03-10 Thread Allerdyce . John
Hi, How can I put multiple condition in if statement? I try this, but I can't get that to work. if ( (str != " ") && (str != "") ): Any help is appreciated. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

The Python multiple IDE Collaboration calls for coders

2006-03-10 Thread SPE - Stani's Python Editor
p://pyxides.stani.be/wiki/StartingEmail - developers reaction: http://pyxides.stani.be/wiki/AuthorsOfIDEsTools - poll: http://pyxides.stani.be/polls/20060310-firstfocus/PlonePopoll_results2 Stani PS IDLE is the only one which didn't answer my invitation yet, but we'd love them to be in the tea

Re: creating an executable?

2006-03-10 Thread John Salerno
Larry Bates wrote: > John Salerno wrote: >> Well, now that I can time my laundry, I need to make it runnable. I >> tried looking for info on the freeze module in the help file, but it >> didn't seem to come up with much. According to the Python wiki, freeze >> is for making executables for Unix. >>

Re: API/C memory mananegemnt problem

2006-03-10 Thread Tim Peters
[EMAIL PROTECTED] > Hi everybody, > I have a problem with Python/C API and memory management. > > I'm using > Python 2.3.5 (#1, Jan 4 2006, 16:44:27) > [GCC 4.0.2 20050901 (prerelease) (SUSE Linux)] on linux2 > > In my C-module I have a loop like this: > ***

Re: capturing stdout from lynx..

2006-03-10 Thread Enigma Curry
Does this do what you want? import os filename = "test.html" cmd = os.popen("lynx -dump %s" % filename) output = cmd.read() cmd.close() print output -- http://mail.python.org/mailman/listinfo/python-list

Re: How To Request Delivery Receipts On Emails

2006-03-10 Thread Gregory Piñero
Thanks for the help, guys. This project was put on hold so I wasn't able to try out any of the advice yet. I'll let you know when I do. -Greg On 3/8/06, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Wed, 8 Mar 2006 12:52:04 -0500, "Gregory Piñero" > <[EMAIL PROTECTED]> declaimed the follow

Re: beautiful soup library question

2006-03-10 Thread Enigma Curry
Here's how I print each line after the 's: import BeautifulSoup as Soup page=open("test.html").read() soup=Soup.BeautifulSoup(page) for br in soup.fetch('br'): print br.next -- http://mail.python.org/mailman/listinfo/python-list

capturing stdout from lynx..

2006-03-10 Thread [EMAIL PROTECTED]
i have a huge database that contains large amounts of html that i need to translate to ascii.. i have tried using html2text.py: http://www.aaronsw.com/2002/html2text/ but i could not figure out how to import it and use it as a library without getting errors everywhere.. so i decided to try usin

Re: Python and C

2006-03-10 Thread P Boy
> Has anyone yet written a program to grab C struct declaration from the .h > to produce code like > > # Overlay configuration > class OverlayStoreConfig(ctypes.Structure): > _fields_ = [('FormatVersion', ctypes.c_ulong), > ('VolumeSize', ctypes.c_longlong), >

Re: Performance impact of using decorators

2006-03-10 Thread Alex Martelli
vinjvinj <[EMAIL PROTECTED]> wrote: > >>what exactly made you think that Python would be able to run your > >>code *without* calling your function ? > > I was hoping that when the compiler finds decorators with wrapers that > have the same signature it can some how "magically" combine them into >

Re: Performance impact of using decorators

2006-03-10 Thread Alex Martelli
Diez B. Roggisch <[EMAIL PROTECTED]> wrote: ... > begin() > try: > pass > commit() > finally: > if not comitted(): > rollback() Feels like a natural for 2.5's 'with' statement -- as has been the case for 2.3 and 2.4, 2.5 won't have many language-level changes, but what little there IS

Re: Why property works only for objects?

2006-03-10 Thread Alex Martelli
Michal Kwiatkowski <[EMAIL PROTECTED]> wrote: ... > I'm trying to understand attributes lookups made by Python, having > properties and special methods in mind. So far I've come up with kind of > reasoning I've coded below. I would appreciate any comments and > suggestions. First, let's forget

Re: Why property works only for objects?

2006-03-10 Thread Alex Martelli
Michal Kwiatkowski <[EMAIL PROTECTED]> wrote: ... > Let me understand it clearly. If I change __class__ of an object, > existing attributes (so methods as well) of an object are still > accessible the same way and don't change its values. Only resolution of > attributes/methods not found in obje

Re: Python and C

2006-03-10 Thread Alex Martelli
David Boddie <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > <[EMAIL PROTECTED]> wrote: > > > C is the lowest, most fundamental level of extension, but there are many > > other alternatives -- SWIG to wrap existing libraries, Boost or SCXX or > > SIP to wrap specifically C++ with very diffe

Re: Bidirectional communication over unix socket (named pipe)

2006-03-10 Thread J Rice
Thank you, that answers my question! And it works fine with stream, so I can do what I want as well. -- http://mail.python.org/mailman/listinfo/python-list

Re: Speed of data structures in python

2006-03-10 Thread Terry Hancock
On Sat, 11 Mar 2006 13:12:30 +1100 "Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > On Fri, 10 Mar 2006 23:24:46 +1100, Dave wrote: > > Hi. I am learning PyOpenGL and I am working with a > > largish fixed scene composed of several thousand > > GLtriangles. I plan to store the coords and normals i

Re: Cheese Shop -> BSOL?

2006-03-10 Thread Tim Churches
Tim Churches wrote: > Would it be possible to rename "Cheese Shop" as "Bright Side of Life"? > > That's a cheery, upbeat name, there are overtones of commerce or filthy > lucre, I meant "no overtones", mea culpa. Tim C -- http://mail.python.org/mailman/listinfo/python-list

Cheese Shop -> BSOL?

2006-03-10 Thread Tim Churches
Would it be possible to rename "Cheese Shop" as "Bright Side of Life"? That's a cheery, upbeat name, there are overtones of commerce or filthy lucre, it is a clear reference to one of the Monty Python crew's greatest works, it can be easily abbreviated to BSOL (to avoid confusion with BSL for bloo

Re: Speed of data structures in python

2006-03-10 Thread Steven D'Aprano
On Fri, 10 Mar 2006 23:24:46 +1100, Dave wrote: > > Hi. I am learning PyOpenGL and I am working with a largish fixed scene > composed of several thousand GLtriangles. I plan to store the coords and > normals in a NumPy array. > > Is this the fastest solution in python? would i be significant

Re: Silly import question (__file__ attribute)

2006-03-10 Thread Steven D'Aprano
On Thu, 09 Mar 2006 17:25:20 -0500, Jack Diederich wrote: > It is a built-in module so it doesn't have a .so (dll) or .py file > to mention. Wouldn't it make sense for module.__file__ to be set to None rather than completely missing in this case? -- Steven. -- http://mail.python.org/mailman/

Re: why use special config formats?

2006-03-10 Thread Steven D'Aprano
On Fri, 10 Mar 2006 09:08:36 -0800, tomerfiliba wrote: > you can easily crash your web server (or make it non functional) if you > pass an invalid port or host, or make it act weird by changing the > timeouts or paths... so yeah, if the admin writes a config script that > does os.system("rm -rf /"

Re: Why property works only for objects?

2006-03-10 Thread Michal Kwiatkowski
Bruno Desthuilliers napisał(a): >> Let me understand it clearly. If I change __class__ of an object, >> existing attributes (so methods as well) of an object are still >> accessible the same way and don't change its values. Only resolution of >> attributes/methods not found in object is changed, as

Re: why no block comments in Python?

2006-03-10 Thread Terry Hancock
On Sat, 11 Mar 2006 10:23:56 +1100 "Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > On Thu, 09 Mar 2006 18:02:27 -0600, Terry Hancock wrote: > > > On 9 Mar 2006 07:21:00 -0800 > > "msoulier" <[EMAIL PROTECTED]> wrote: > >> > (and if you don't, you can quickly comment out > >regions > > by putting t

Re: pyc file usage in a multi OS environment ( newbe question)

2006-03-10 Thread HajoEhlers
Thanks for clearifing the issue. Hajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Steven D'Aprano
On Fri, 10 Mar 2006 11:33:56 -0500, Terry Reedy wrote: > Actually, I consider the unique calling pattern for x/range to be something > of a wart. Learning this inconsistency was at least a minor problem. It > is a rather extreme example of typing laziness beats purity. Amazing. I consider it

Re: why use special config formats?

2006-03-10 Thread Steven D'Aprano
On Fri, 10 Mar 2006 06:48:03 -0800, tomerfiliba wrote: > hey > > i've been seeing lots of config-file-readers for python. be it > ConfigObj (http://www.voidspace.org.uk/python/configobj.html) or the > like. seems like a trend to me. > i came to this conclusion a long time ago: YOU DON'T NEED CONF

Re: generators shared among threads

2006-03-10 Thread Bryan Olson
[EMAIL PROTECTED] wrote: > You'll get the same result without the lock. I'm not sure what this > indicates. It may show that the contention on the lock and the race > condition on i aren't always problems. It may show that generators, at > least in CPython 2.4, provide thread safety for free. I

Re: Python Evangelism

2006-03-10 Thread Michael Tobis
The name isn't changing, so it's a "make lemonade" situation. What's the best use we can make of the name; how do we make it stick in people's minds positively? How do we make a positive image out of it? Shy tadpoles, by the way, ( http://python.org/images/python-logo.gif ) isn't it. mt -- ht

Re: AES encryption

2006-03-10 Thread Bryan Olson
I wrote: > Tuvas wrote: > [...] > >> I've tested my function with a thousand random texts, it >> seems to return the same result as received every time. > > > Unfortunately, the results seem incorrect, self-consistent > as they may be. The following will call your code, and > check the results a

Re: creating variable in root namespace from module

2006-03-10 Thread MakaMaka
Ok, but it seems to be working exactly as I need it to right now under win32. I'll try it on linux. Can you suggest an alternative method? Or suggest when this won't work? Thanks, -Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: How to best update remote compressed, encrypted archives incrementally?

2006-03-10 Thread Steven D'Aprano
On Fri, 10 Mar 2006 15:13:07 +0100, robert wrote: > Hello, > > I want to put (incrementally) changed/new files from a big file tree > "directly,compressed and password-only-encrypted" to a remote backup > server incrementally via FTP,SFTP or DAV At best within a closed > algorithm inside

Re: import and shared global variables

2006-03-10 Thread Diez B. Roggisch
> has to be imported by others. Would a module global.py (defining glob > and imported by whoever needs it) be more pythonic? I'd say yes. > (I didn't want to do > that because I really want to resist the temptation of introducing > glob1, glob2, glob3...) I miss seeing what that has to do w

Re: Performance impact of using decorators

2006-03-10 Thread Diez B. Roggisch
vinjvinj schrieb: >>> That sounds like something for the templating engine, and _certainly_ not >>> for a decorator that otherwise deals with transactions. > > The actual code for the page layout is in a preppy template. But the > calls to the template engine are made in the > startTransactrionAnd

Re: lighter weight options to Python's logging package?

2006-03-10 Thread Diez B. Roggisch
> We've done a bit already. I will see if there's more we can do. Our use of > the package is actually very simple. All we do are log basic messages. Our > Formatter instance includes the time, level and message. That's it. We > have no need for displaying exception info, don't do threads, do

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Steven D'Aprano
On Fri, 10 Mar 2006 12:06:57 +0300, Dmitry Anikin wrote: > I mean, it's very convenient when default parameters > can be in any position, like > def a_func(x = 2, y = 1, z): > ... > (that defaults must go last is really a C++ quirk which > is needed for overload resolution, isn't it?) I'm con

Re: counting number of (overlapping) occurances

2006-03-10 Thread Steven D'Aprano
On Thu, 09 Mar 2006 22:01:17 -0800, John wrote: > Thanks a lot, > > This works but is a bit slow, I guess I'll have to live with it. > Any chance this could be sped up in python? I don't know. What is it? You should always quote enough of the previous poster's message to give context. Messages

Re: Best way to have a for-loop index?

2006-03-10 Thread Steven D'Aprano
On Thu, 09 Mar 2006 20:22:34 -0500, Roy Smith wrote: >> My question is, is there a better, cleaner, or easier way to get at the >> element in a list AND the index of a loop than this? >> >> TIA, >> Andrew > > The real question is *why* do you want the index? > > If you're trying to iterate thro

Re: why use special config formats?

2006-03-10 Thread Fuzzyman
[EMAIL PROTECTED] wrote: > if you are really so scared of letting others exploit your config > scripts, then use the second, pickled fashion. that way you can store > the file at $HOME/blah-config.pkl, and everybody's happy. > > still, my point is we dont need special config mechanisms, since the

Mutable complex numbers [was Re: output formatting for classes]

2006-03-10 Thread Steven D'Aprano
On Fri, 10 Mar 2006 02:19:10 +0100, Schüle Daniel wrote: > yeah, i miss some things in complex implementation > for example c=complex() > c.abs = 2**0.5 > c.angle = pi/2 > > should result in 1+1j :) Smiley noted, but consider: c = complex() => what is the value of c here? c.abs = 2**0.5 => wha

Re: Why property works only for objects?

2006-03-10 Thread Bruno Desthuilliers
Michal Kwiatkowski a écrit : > Alex Martelli napisał(a): > >>Wrong! Of _course_ it's an option -- why do you think it matters at all >>whether you're the creator of this object?! > (snip) >> >>def insert_property(obj, name, getter, setter): >>class sub(obj.__class__): pass >>setattr(sub

Re: Why property works only for objects?

2006-03-10 Thread Bruno Desthuilliers
Michal Kwiatkowski a écrit : > Steven Bethard napisał(a): > >>>Is there any method of making descriptors on per-object basis? >> >>I'm still not convinced that you actually want to, but you can write >>your own descriptor to dispatch to the instance object (instead of the >>type): > > > Ok, this

Re: beautiful soup library question

2006-03-10 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: > I'm trying to extract some information from an html file using > beautiful soup. The strings I want get are after br tags, eg: > > > this info > more info > and more info > > > I can navigate to the first br tag using find_next_sibling, but how do > I ge

Re: lighter weight options to Python's logging package?

2006-03-10 Thread skip
Trent> Do you have any profile information for where in the logging Trent> package the time is being spent? Looking back at a recent run from a few days ago Formatter.formatTime() seems to be a current problem. We create our own LogRecord subclass. Because that was such a heavyweight op

Re: Python and C

2006-03-10 Thread Terry Reedy
"P Boy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have recently found another approach by using ctypes (http://starship.python.net/crew/theller/ctypes/). Ctypes is now a 2.5 standard lib module and in being tested as such on multiple systems. > I have a library from Micro

beautiful soup library question

2006-03-10 Thread meyerkp
Hi all, I'm trying to extract some information from an html file using beautiful soup. The strings I want get are after br tags, eg: this info more info and more info I can navigate to the first br tag using find_next_sibling, but how do I get the string after the br's? br.content

Re: why no block comments in Python?

2006-03-10 Thread Steven D'Aprano
On Thu, 09 Mar 2006 18:02:27 -0600, Terry Hancock wrote: > On 9 Mar 2006 07:21:00 -0800 > "msoulier" <[EMAIL PROTECTED]> wrote: >> > (and if you don't, you can quickly comment out regions >> > by putting them inside a triple-quoted string.) >> >> Although that will use up memory, as opposed to a

Re: Python Evangelism

2006-03-10 Thread Terry Reedy
"Tim Parkin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Well, why don't we promote it as PyPI (Python Package Index)? The url >> _is_ python.org/pypi, and I'm pretty sure I read somewhere that PyPI >> was the intended name... If the community then decides on some >> standardiz

Re: lighter weight options to Python's logging package?

2006-03-10 Thread Trent Mick
[EMAIL PROTECTED] wrote] > We use the standard logging package and frequently bump into performance > issues with it (we log a lot of information). When that happens, we then go > through our code and dump a bunch of logging calls we think we can live > without. This invariably causes problems be

Lib/test/test_mimetools.py

2006-03-10 Thread matt
Hi, in the file Lib/test/test_mimetools.py on line 30 the call to mimetools.choose_boundary() fails if the machine that the tests are running on does not have a hostname that maps to an IP address. I would have thought that the test should be 'skipped' rather than fail? I don't know if this ha

lighter weight options to Python's logging package?

2006-03-10 Thread skip
We use the standard logging package and frequently bump into performance issues with it (we log a lot of information). When that happens, we then go through our code and dump a bunch of logging calls we think we can live without. This invariably causes problems because we get overzealous and del

Re: Which GUI toolkit is THE best?

2006-03-10 Thread Alan Franzoni
invitro81 on comp.lang.python said: > again to make a choice is difficult; is there also some guy liking pyqt > is it worse or should it be avoided because of the licencing policy for > qt (which I also like..)? > > * Which one is the most fun to program with? > * Which one is the

Re: Why python doesn't use syntax like function(,,x) for default parameters?

2006-03-10 Thread Michal Kwiatkowski
Dmitry Anikin napisał(a): > Some example (from real life). > def ChooseItems(StartDate, EndDate, Filter): > #function returns a set of some items in chronological order > #from required interval possibly using filter > > ChooseItems() #get everything > ChooseItems('01.01.2000', ,SomeFilter) #get e

Re: image letter recognition

2006-03-10 Thread Michael
>> Is there an existing package for python that will perform simple letter >> recognition from image files? I'm specifically looking for a way to >> read from a png file, but that can be changed. >> > "simple letter recognition from image file" now there's an oxymoron. > > I've successfully

Which GUI toolkit is THE best?

2006-03-10 Thread dimitri pater
Hi,in stead of going for the "traditional" GUIS like wxPython, PyGtk and the like, you could consider using a browser based GUI. Try CherryPy for instance.  See also here: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/442481regards,Dimitri On 3/10/06, invitro81 < [EMAIL PROTECTED]> wro

Re: MS Access db (mdb): viewing table attributes

2006-03-10 Thread BartlebyScrivener
Gau, This prints the names of the columns in my database. # Modification of # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/389535 # Instructions for customizing are at: # http://www.egenix.com/files/python/mxODBC.html import mx.ODBC.Windows as odbc driv='DRIVER={Microsoft Access Driv

Re: Python and C

2006-03-10 Thread P Boy
I have written some C extension before but it was pretty tedious. I have recently found another approach by using ctypes (http://starship.python.net/crew/theller/ctypes/). Which you develop your C module in dynamic library (DLL in Windows world), the from Python, you can call the C functions in the

Re: XML international characters

2006-03-10 Thread Martin v. Löwis
Andreas R. wrote: > When parsing XML documents containing international characters, such as > the Norwegian characters Æ, Ø, Å, I get an exception in Python's SAX > module. What is the correct way to parse such characters in Python? I've > searched for methods to somehow escape the characters, with

XML international characters

2006-03-10 Thread Andreas R.
Hello, When parsing XML documents containing international characters, such as the Norwegian characters Æ, Ø, Å, I get an exception in Python's SAX module. What is the correct way to parse such characters in Python? I've searched for methods to somehow escape the characters, without any luck s

Re: Python and C

2006-03-10 Thread P Boy
I have written some C extension before but it was pretty tedious. I have recently found another approach by using ctypes (http://starship.python.net/crew/theller/ctypes/). Which you develop your C module in dynamic library (DLL in Windows world), the from Python, you can call the C functions in the

Re: image letter recognition

2006-03-10 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Is there an existing package for python that will perform simple letter > recognition from image files? I'm specifically looking for a way to > read from a png file, but that can be changed. > "simple letter recognition from image file" now there's an oxymoron. I've su

Re: MS Access db (mdb): viewing table attributes

2006-03-10 Thread Larry Bates
[EMAIL PROTECTED] wrote: > I have an Access 2003 database, protected by a workgroup, that I am > trying to view through python. Currently, I'm attempting dao with the > win32 package, and I'm able to view all of the table names, but I don't > know how to view the attributes of the tables. > > My

Re: creating variable in root namespace from module

2006-03-10 Thread Duncan Booth
MakaMaka wrote: > Ok, I figured it out. Thanks for your help guys. If anybody else is > searching this group looking for the answer, you want the > sys._getframe() function. > > sys._getframe(1).f_locals['a'] = 1 > > if you put the above in a function in a module, it creates a variable > 'a' i

Re: epydoc help (putting XML in docstrings)

2006-03-10 Thread [EMAIL PROTECTED]
Doh. That was too easy. Thanks! jw -- http://mail.python.org/mailman/listinfo/python-list

Setting permissions/ownership/destination in distutils?

2006-03-10 Thread [EMAIL PROTECTED]
Is there a recommended way to specify the permissions and ownership of scripts installed from distutils? Also, I'm currently just using this config in setup.cfg to control where the scripts go: [install] install-scripts = /opt/mcad/bin But it would be very helpful if I could install some of the

Re: epydoc help (putting XML in docstrings)

2006-03-10 Thread Jean-Paul Calderone
On 10 Mar 2006 12:49:29 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >Hi everyone! I'm documenting some functions that return XML strings. >I'd like to have `sample' xml show up in my epydoc generated >documentation. However, epydoc does not like the indentation of the >XML and gives me

Re: MS Access db (mdb): viewing table attributes

2006-03-10 Thread BartlebyScrivener
>> How can I get the names of the columns for each table?? SELECT * FROM mytable -- http://mail.python.org/mailman/listinfo/python-list

Re: epydoc help (putting XML in docstrings)

2006-03-10 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hi everyone! I'm documenting some functions that return XML strings. > I'd like to have `sample' xml show up in my epydoc generated > documentation. However, epydoc does not like the indentation of the > XML and gives me this error -> > > L28: Error: Improper paragraph

Re: why use special config formats?

2006-03-10 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: > i dont know about your experience with config files, but there > thousands of formats. All the config files I needed were either very easy to learn, or well documented in comments. > on the python side -- just in this conversation, we mentioned > ConfigObj

Re: MS Access db (mdb): viewing table attributes

2006-03-10 Thread gau . tai
For more reference, I got my information to start this from: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52267 When I try to run that code, it gives me this: File "C:\Python24\Lib\site-packages\win32com\client\util.py", line 83, in next return _get_good_object_(self._iter_.next()

Re: Simple questions on use of objects (probably faq)

2006-03-10 Thread Brian Elmegaard
bruno at modulix <[EMAIL PROTECTED]> writes: > I should just take some time and learn to read !-) Then I am better of than you. I just had to learn the syntax of a language :-) -- Brian (remove the sport for mail) http://www.et.web.mek.dtu.dk/Staff/be/be.html http://www.rugbyklubben-speed.dk --

Re: Python Evangelism

2006-03-10 Thread Tim Churches
Benny wrote: > Paul Boddie wrote: > >> Bizarre names may be cute (to some people) but they don't lend >> themselves to guessing or searching. Consequently, people who want >> answers yesterday aren't likely to be amused to eventually discover >> that the name of the resource they've been looking f

Re: read/ edit line from stdin

2006-03-10 Thread Clemens Hepper
It's a bit more complicated. The field has a default and a preassigned Value. The default is p.e. 'localhost' and the value is 'www.gentoo.org'. Then localhost is chosen if the value is erased to ''. But i want to make it easy to keep the preassigned value! So if nothing is typed 'www.gentoo.org'

Re: MS Access db (mdb): viewing table attributes

2006-03-10 Thread gau . tai
BartlebyScrivener: Maybe you're right, and I'll try posting to another group. However, I have found resources for doing this using the same data structure: "TableDefs" which is in VB and python. I see how they are doing it in VB, but I don't know how this works in python. I was hoping someone c

epydoc help (putting XML in docstrings)

2006-03-10 Thread [EMAIL PROTECTED]
Hi everyone! I'm documenting some functions that return XML strings. I'd like to have `sample' xml show up in my epydoc generated documentation. However, epydoc does not like the indentation of the XML and gives me this error -> L28: Error: Improper paragraph indentation. Here is a simple funct

Re: MS Access db (mdb): viewing table attributes

2006-03-10 Thread gau . tai
That would be fine for me to switch to mxodbc, I've used it before and it worked fine. But if I switch, do you know how I can get the column names from the table? Maybe I'm not being clear with my question here. I'm going to try again here's a table (it's in access): === tablename = mytabl

Re: MS Access db (mdb): viewing table attributes

2006-03-10 Thread BartlebyScrivener
>> I was hoping that your code would >> return the column names for me, but it was expecting me to list the >> columns to use. I want to know how to retrieve that list of columns >> through python. I think once you establish connection to the database using Python and mxODBC, then your question

Re: read/ edit line from stdin

2006-03-10 Thread James Stroud
Clemens Hepper wrote: > Hello, > for my project confux (http://confux.sourceforge.net) I want to read > a line from stdin. > But I don't want the user to type a new line. I want so display a > value which the user can edit. > > For example I want to ask the user for a hostname and I print > "local

Re: MS Access db (mdb): viewing table attributes

2006-03-10 Thread BartlebyScrivener
Gau, I'm a beginner and had fits connecting to my Access 2003 DB of quotations. The best advice that finally worked for me was to use mxODBC. In fact, you might just search this forum for Access and mxODBC. I can't customize to fit your situation, but here is the connection part of a script I use

Re: time series calculation in list comprehension?

2006-03-10 Thread Lonnie Princehouse
Well, you could iterate over an index into the list: from __future__ import division def moving_average(sequence, n): return [sum(sequence[i:i+n])/n for i in xrange(len(sequence)-n+1)] Of course, that's hardly efficient. You really want to use the value calculated for the i_th term in

Re: Python cleanup on exit

2006-03-10 Thread Steve Juranich
Jacob Kroon wrote: > Is there another way to make python delete objects which were > created in the global scope upon exit ? Check out the `atexit' module. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Dmitry Anikin
Some example (from real life). def ChooseItems(StartDate, EndDate, Filter): #function returns a set of some items in chronological order #from required interval possibly using filter ChooseItems() #get everything ChooseItems('01.01.2000', ,SomeFilter) #get everything after a date using filter Choo

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Dmitry Anikin
Some example (from real life). def ChooseItems(StartDate, EndDate, Filter): #function returns a set of some items in chronological order #from required interval possibly using filter ChooseItems() #get everything ChooseItems('01.01.2000', ,SomeFilter) #get everything after a date using filter Choo

read/ edit line from stdin

2006-03-10 Thread Clemens Hepper
Hello, for my project confux (http://confux.sourceforge.net) I want to read a line from stdin. But I don't want the user to type a new line. I want so display a value which the user can edit. For example I want to ask the user for a hostname and I print "localhost", the user modified it to "locals

Re: Python Evangelism

2006-03-10 Thread Tim Parkin
Andrew Gwozdziewycz wrote: > > To emphasize the point as a newbie: I know what CPAN is. I would go to > >>the Vaults of Parnassus for Python stuff. But Cheese Shop? >> > > > Well, why don't we promote it as PyPI (Python Package Index)? The url > _is_ python.org/pypi, and I'm pretty sure I read

McMillan installer on solaris - complains about missing .pkg file

2006-03-10 Thread mrstephengross
I'm trying to get the mcmillan installer utility to generate a standalone executable for me. I've gotten to work--almost!--but still have one problem. After running Installer's Build.py on my script/spec, it appears to work. I go into the directory generating by Build.py and run my program. It work

Re: Use python to process XML file

2006-03-10 Thread [EMAIL PROTECTED]
I have a little py module that implements the Composite pattern to represent xml file contents. My class is called ExtensionRegistry because that's what I use it for, you could rename it to whatever you wanted. After parsing, this allows me to access my xml file contents like this: xmlFile = Exten

Re: Python Evangelism

2006-03-10 Thread Andrew Gwozdziewycz
> To emphasize the point as a newbie: I know what CPAN is. I would go to > the Vaults of Parnassus for Python stuff. But Cheese Shop? > Well, why don't we promote it as PyPI (Python Package Index)? The url _is_ python.org/pypi, and I'm pretty sure I read somewhere that PyPI was the intended name.

  1   2   3   >