Re: Python API to manipulate CAB files.

2005-06-23 Thread Thomas Heller
Konstantin Veretennicov <[EMAIL PROTECTED]> writes: > On 6/22/05, Peter Maas <[EMAIL PROTECTED]> wrote: >> Isaac Rodriguez schrieb: >> > Does anyone know of a Python API to manipulate CAB files? > > I guess you'll have to interface with setupapi.dll > (SetupIterateCabinet) via ctypes, or with Micr

Re: Loop until condition is true

2005-06-23 Thread Michael Hoffman
Stelios Xanthakis wrote: > Magnus Lycka wrote: > >> Right. Silly me. Maybe in some future Python version, True and False >> will be constants, like None is since Python 2.4. > > Actually, there is support in marshal to write True and False objects so > I don't understand why this isn't in 2.4 Be

Re: Database recommendations for Windows app

2005-06-23 Thread Joel Rosdahl
Dave Cook <[EMAIL PROTECTED]> writes: > On 2005-06-22, Will McGugan <[EMAIL PROTECTED]> wrote: > > [...] >> Can anyone recommend a database that runs on Windows, is fast / >> efficient and can be shipped without restrictions or extra >> downloads? > > http://pysqlite.org Or APSW

Re: Does a function like isset() exist in Python?

2005-06-23 Thread Fredrik Lundh
George Sakkis wrote: > There are no unitialized variables in python; if you try to access an > undefined name, a NameError exception is raised: > > try: > print "foo is", foo > except NameError: > print "foo is undefined" note the order of evaluation: >>> try: ... print "foo

Where is Word - COM solution

2005-06-23 Thread Guy Lateur
Hi all, This goes back to my previous post called "Where is Word". In short, I wanted to make a temporary file (directory listing), open it in Word to let the user edit, layout and print it, and then delete the temp file afterwards. I almost got it to work without using COM, but there was a pr

Re: Database recommendations for Windows app

2005-06-23 Thread Magnus Lycka
Cameron Laird wrote: > OK, I'm with you part of the way. Typical "Access" developers > are *always* involved with DLL hell, right? You're surely not > saying that Python worsens that frustration, are you? I think Dan was commenting on flaws in Microsoft's products, not in Python. As I understan

Re: create a pdf file

2005-06-23 Thread Magnus Lycka
Alberto Vera wrote: > Hello: > > I found a script that convert a file to PDF format , but it was made in PHP > > Do you know any script using Python? What do you mean by "convert a file to PDF format"? The solution obviously depends on what the file you start with looks like. If you want to crea

Re: os.system(cmd) isn't working

2005-06-23 Thread F. Petitjean
Le Thu, 23 Jun 2005 01:19:11 -0500, Paul Watson a écrit : > "Gregory Piñero" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > Hi guys, > > I'm trying to run this statement: > > os.system(r'"C:\Program Files\Mozilla Firefox\firefox.exe"' + ' > "www.blendedtechnologies.com"') > > The

Re: Optimize a cache

2005-06-23 Thread Tim Williams
- Original Message - From: "Florian Lindner" <[EMAIL PROTECTED]> > Hello, > I am building a object cache in python, The cache has a maximum size and the > items have expiration dates. > At the moment I'm doing like that: > What possible you see to optimize this lookup? Or anything else

Re: PEP ? os.listdir enhancement

2005-06-23 Thread Riccardo Galli
On Wed, 22 Jun 2005 11:27:06 -0500, Jeff Epler wrote: > Why not just define the function yourself? Not every 3-line function > needs to be built in. Of course I can code such a function, and I agree with the second sentence, but I think that obtaining absolutes path is a task so commonly needed

Re: PEP ? os.listdir enhancement

2005-06-23 Thread Andreas Kostyrka
What's wrong with (os.path.join(d, x) for x in os.listdir(d)) It's short, and easier to understand then some obscure option ;) Andreas On Thu, Jun 23, 2005 at 11:05:57AM +0200, Riccardo Galli wrote: > On Wed, 22 Jun 2005 11:27:06 -0500, Jeff Epler wrote: > > > Why not just define the function

pydoc - suppressing builtins?

2005-06-23 Thread contact
Is it possible to persuade pydoc not to include documentation for methods inherited from built-in classes? I have several classes that inherit from dict, and don't really need documentation thousands of lines long that consists mostly of dict's methods repeated multiple times. I'm sure I could qit

Re: Avoiding deadlocks in concurrent programming

2005-06-23 Thread Konstantin Veretennicov
On 22 Jun 2005 17:50:49 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > Even on a multiprocessor > system, CPython (because of the GIL) doesn't allow true parallel > threads, ... . Please excuse my ignorance, do you mean that python threads are always scheduled to run on the same sing

Re: PEP ? os.listdir enhancement

2005-06-23 Thread Konstantin Veretennicov
On 6/22/05, Riccardo Galli <[EMAIL PROTECTED]> wrote: > I propose to add an 'abs' keyword which would make os.listdir return the > absolute path of files instead of a relative path. What about os.listdir(dir='relative/path', abs=True)? Should listdir call abspath on results? Should we add another

Re: Loop until condition is true

2005-06-23 Thread Antoon Pardon
Op 2005-06-22, Michael Hoffman schreef <[EMAIL PROTECTED]>: > Remi Villatel wrote: >> Fredrik Lundh wrote: >>> checking if a logical expression is true by comparing it to True is bad >>> style, and comparing values using "is" is also bad style. >> >> I wrote it this way because, first, it's perfec

List of all installed applications (XP)?

2005-06-23 Thread Guy Lateur
Hi all, I'm trying to generate a (exhaustive) list of all the applications that are installed on a user's machine. I've written some code that reads the registry ('App Paths'): appKey = win32api.RegOpenKeyEx(win32con.HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths', 0

Re: Does a function like isset() exist in Python?

2005-06-23 Thread Steven D'Aprano
On Wed, 22 Jun 2005 23:09:57 -0400, Patrick Fitzsimmons wrote: > Hi, > > I'm sure I should know this, but I can't find it in the manual. > > Is there a function in Python like the function in PHP isset()? It > should take a variable name and return True or False depending on > whether the varia

Re: pickle broken: can't handle NaN or Infinity under win32

2005-06-23 Thread Steven D'Aprano
On Thu, 23 Jun 2005 00:11:20 -0400, Tim Peters wrote: > Well, I try, Ivan. But lest the point be missed , 754 doesn't > _want_ +0 and -0 to act differently in "almost any" way. The only > good rationale I've seen for why it makes the distinction at all is in > Kahan's paper "Branch Cuts for Comp

RE: List of all installed applications (XP)?

2005-06-23 Thread Tim Golden
[Guy Lateur] | I'm trying to generate a (exhaustive) list of all the | applications that are | installed on a user's machine. I've written some code that reads the | registry ('App Paths'): [.. snip code ..] | Can I be sure it lists *all* the applications? What -- from your point of view -- i

Re: PEP ? os.listdir enhancement

2005-06-23 Thread Riccardo Galli
On Thu, 23 Jun 2005 11:34:02 +0200, Andreas Kostyrka wrote: > What's wrong with > > (os.path.join(d, x) for x in os.listdir(d)) > > It's short, and easier to understand then some obscure option ;) > > Andreas how does it help in using list comprehension, as the ones in the first post? -- Ri

Re: PEP ? os.listdir enhancement

2005-06-23 Thread Riccardo Galli
On Thu, 23 Jun 2005 12:56:08 +0300, Konstantin Veretennicov wrote: > On 6/22/05, Riccardo Galli <[EMAIL PROTECTED]> wrote: > >> I propose to add an 'abs' keyword which would make os.listdir return the >> absolute path of files instead of a relative path. > > What about os.listdir(dir='relative/p

Re: case/switch statement?

2005-06-23 Thread NickC
Andrew Durdin wrote: > In this case the dictionary is obviously a better and clearer choice. > I've generally found for other circumstances where I've used switch > statements that the code ends up more readable if it's reorganised so > that the switch statements are all of the form above, or are >

Re: Database recommendations for Windows app

2005-06-23 Thread Dave Cook
On 2005-06-23, Joel Rosdahl <[EMAIL PROTECTED]> wrote: > Or APSW . Interesting. I was hoping it would not have one pysqlite2 limitation: if you have an empty database, cursor.description always returns None, even if you have "pragma empty_result_callbacks=1"

Re: PEP ? os.listdir enhancement

2005-06-23 Thread Daniel Dittmar
Riccardo Galli wrote: > On Thu, 23 Jun 2005 12:56:08 +0300, Konstantin Veretennicov wrote: >>What about os.listdir(dir='relative/path', abs=True)? Should listdir call >>abspath on results? Should we add another keyword rel? Would it complicate >>listdir unnecessarily? > > keyword dir not exists (d

re:Single Application Instance Example

2005-06-23 Thread DeRRudi
Whit this mutex is it possible when an instance is running in background and you try to open a new instance. you cancel it and show the first? Greetz -- http://mail.python.org/mailman/listinfo/python-list

Re: List of all installed applications (XP)?

2005-06-23 Thread Guy Lateur
| What -- from your point of view -- is an "application"? Good question. Let me try to elaborate: I would like to know if people in our company (building techniques) are using non-licensed software (eg Photoshop, Office, AutoCad). So I guess by 'application' I mean commercial software packages

Re: PEP ? os.listdir enhancement

2005-06-23 Thread Peter Otten
Konstantin Veretennicov wrote: > On 6/22/05, Riccardo Galli <[EMAIL PROTECTED]> wrote: > >> I propose to add an 'abs' keyword which would make os.listdir return the >> absolute path of files instead of a relative path. > > What about os.listdir(dir='relative/path', abs=True)? Should listdir > ca

RE: List of all installed applications (XP)?

2005-06-23 Thread Tim Golden
[Guy Lateur] | | | [TJG] | | What -- from your point of view -- is an "application"? | | Good question. Let me try to elaborate: I would like to know | if people in | our company (building techniques) are using non-licensed software (eg | Photoshop, Office, AutoCad). So I guess by 'application

Re: os.system(cmd) isn't working

2005-06-23 Thread Michael P. Soulier
On 23/06/05 Tim Golden said: > This is only half an answer, but I personally find faffing > about with the double-quote / double-backslash stuff between > Python and Windows a pain in the neck, so where I can I avoid it. Indeed. I believe this is why Python has os.sep. Mike -- Michael P. Soul

RE: os.system(cmd) isn't working

2005-06-23 Thread Tim Golden
[Michael P. Soulier] | On 23/06/05 Tim Golden said: | | > This is only half an answer, but I personally find faffing | > about with the double-quote / double-backslash stuff between | > Python and Windows a pain in the neck, so where I can I avoid it. | | Indeed. I believe this is why Python has

Re: PEP ? os.listdir enhancement

2005-06-23 Thread Daniel Dittmar
Riccardo Galli wrote: > On Thu, 23 Jun 2005 11:34:02 +0200, Andreas Kostyrka wrote: > > >>What's wrong with >> >>(os.path.join(d, x) for x in os.listdir(d)) >> >>It's short, and easier to understand then some obscure option ;) >> >>Andreas > > > how does it help in using list comprehension, as

Re: Does a function like isset() exist in Python?

2005-06-23 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Patrick Fitzsimmons <[EMAIL PROTECTED]> wrote: > Hi, > > I'm sure I should know this, but I can't find it in the manual. > > Is there a function in Python like the function in PHP isset()? It > should take a variable name and return True or False depending on >

Re: python create WMI instances

2005-06-23 Thread future_retro
I've got as far as this. I don't get any errors but still no printer >>> import win32com.client >>> WBEM = >>> win32com.client.GetObject(r"winmgmts:{impersonationLevel=impersonate}!\\" + >>> "." + r"\root\cimv2") >>> printer = WBEM.Get("Win32_Printer").SpawnInstance_() >>> printer.Propertie

Re: case/switch statement?

2005-06-23 Thread Roy Smith
"NickC" <[EMAIL PROTECTED]> wrote: > The thing I love most about Python is the fact that callables can be > slung around at run-time, just like any other object. Yup. A while ago, I was doing a lot of file parsing with state machines. Each state was a function. The main loop of the state machi

Re:

2005-06-23 Thread Adriaan Renting
I'm using Eric3 and realy like it. http://www.die-offenbachs.de/detlev/eric3.html Adriaan Renting| Email: [EMAIL PROTECTED] ASTRON | Phone: +31 521 595 217 P.O. Box 2 | GSM: +31 6 24 25 17 28 NL-7990 AA Dwingeloo | FAX: +31 521 597 332 The Netherlands

User interfaces in console (dialog like)

2005-06-23 Thread Negroup
Hi all. I need to provide to my users a graphical interface to be used from os' command line. Initially I thought something equivalent to Unix dialog, and googling around I have found Python Dialog (http://pythondialog.sourceforge.net/). This would be the perfect solution for me if it could be cro

RE: python create WMI instances

2005-06-23 Thread Tim Golden
[EMAIL PROTECTED] | I've got as far as this. I don't get any errors but still no | printer | | >>> import win32com.client | >>> WBEM = | win32com.client.GetObject(r"winmgmts:{impersonationLevel=imper | sonate}!\\" + "." + r"\root\cimv2") | >>> printer = WBEM.Get("Win32_Printer").SpawnInstanc

Swig wrapping C++ Polymorphism

2005-06-23 Thread James Carroll
Hi, I asked this on the SWIG mailing list, but it's pretty dead over there... I'm trying to get Python to pass a subclass of a C++ object to another C++ object... I have three C++ classes, TiledImageSource ZoomifyReaderWx which ISA TiledImageSource TiffWriter which has a method which takes a

Re: PEP ? os.listdir enhancement

2005-06-23 Thread Riccardo Galli
On Thu, 23 Jun 2005 13:25:06 +0200, Daniel Dittmar wrote: > He probably meant that a 'join' option would be more natural than an 'abs' > option. After all, your examples use os.path.join to create a valid path > that can be used as the argument to other module os functions. Whether the > results a

Python 2.1 / 2.3: xreadlines not working with codecs.open

2005-06-23 Thread Eric Brunel
Hi all, I just found a problem in the xreadlines method/module when used with codecs.open: the codec specified in the open does not seem to be taken into account by xreadlines which also returns byte-strings instead of unicode strings. For example, if a file foo.txt contains some text encoded

Re: List of all installed applications (XP)?

2005-06-23 Thread Thomas Heller
"Guy Lateur" <[EMAIL PROTECTED]> writes: > | What -- from your point of view -- is an "application"? > > Good question. Let me try to elaborate: I would like to know if people in > our company (building techniques) are using non-licensed software (eg > Photoshop, Office, AutoCad). So I guess by

Re: Looking For Geodetic Python Software

2005-06-23 Thread Diez B. Roggisch
Tim Daneliuk wrote: > Casey Hawthorne wrote: >> >> Do your planes fly over the earth's surface or through the ground? > > > Why do you presume this has anything to do with airplanes? > That was supposed to be a funny remark regarding that your "straight-line-distance" makes no sense at all -

Re: Looking For Geodetic Python Software

2005-06-23 Thread Diez B. Roggisch
> For spherical earth, this is easy, just treat the 2 locations as > vectors whose origin is at the center of the earth and whose length is > the radius of the earth. Convert the lat-long to 3-D rectangular > coordinates and now the angle between the vectors is > arccos(x dotproduct y). The over

Re: Database recommendations for Windows app

2005-06-23 Thread Jussi Jumppanen
Dennis Lee Bieber wrote: > Firebird might be a contender... I recently completed a 5 user Java based Windows reporting system that used Firebird as the SQL server based database. I found Firebird performed very well and I would not hesitate to use it again. Jussi Jumppanen Author of: Zeus for

Re: Allowing only one instance of a script?

2005-06-23 Thread utabintarbo
... lock file? -- http://mail.python.org/mailman/listinfo/python-list

Re: Allowing only one instance of a script?

2005-06-23 Thread Grant Edwards
On 2005-06-23, Tim Golden <[EMAIL PROTECTED]> wrote: > [Ali] >| >| I have a script which I double-click to run. If i double-click it >| again, it will launch another instance of the script. >| >| Is there a way to allow only one instance of a script, so that if >| another instance of the script i

Re: Python internals and parser

2005-06-23 Thread harold fellermann
Hi, On 22.06.2005, at 23:18, Michael Barkholt wrote: > Is there any detailed documentation on the structure of Pythons > internals, > besides the source code itself? > > More specifically I am looking for information regarding the C parser, > since > I am looking into the viability of using it i

RE: Single Application Instance Example

2005-06-23 Thread Tim Golden
[DeRRudi] | | Whit this mutex is it possible when an instance is running in | background and you try to open a new instance. you cancel it and show | the first? | | Greetz All the Mutex is doing is providing a single token which only one instance of the app can hold at a time. Of itself, it doe

Re: how to use more than 1 __init__ constructor in a class ?

2005-06-23 Thread Rocco Moretti
Steven D'Aprano wrote: > On Wed, 22 Jun 2005 12:34:21 -0500, Rocco Moretti wrote: > > >>You could also turn __init__ into a dispatch fuction: >> >>#-- >>class myPointClass: >> def __init__(self, *args): >> if len(args) <= 2: >> self.__init_two(*args) >> if len(args) == 3: >>

Re: pydoc - suppressing builtins?

2005-06-23 Thread Skip Montanaro
Alan> Is it possible to persuade pydoc not to include documentation for Alan> methods inherited from built-in classes? Alan> I'm sure I could qite easily write something to post-process the Alan> HTML files; just wondering if there might be an easier way. If you're going to

Re: Database recommendations for Windows app

2005-06-23 Thread Thomas Bartkus
"Magnus Lycka" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Cameron Laird wrote: > > OK, I'm with you part of the way. Typical "Access" developers > > are *always* involved with DLL hell, right? You're surely not > > saying that Python worsens that frustration, are you? > > I th

Reraise exception with modified stack

2005-06-23 Thread Nicolas Fleury
Hi, I've made a small utility to re-raise an exception with the same stack as before with additional information in it. Since I want to keep the same exception type and that some types have very specific constructors (which take, for example, more than one parameter), the only safe way I have

Re: Database recommendations for Windows app

2005-06-23 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Dave Cook <[EMAIL PROTECTED]> wrote: >On 2005-06-23, Peter Hansen <[EMAIL PROTECTED]> wrote: . . . >>Type checking? SQLite currently supports >> neither. > >sqlite3 has a "strict affinity" m

newbie - modules for jython (under grinder 3) ?

2005-06-23 Thread bugbear
I'm just trying to use Grinder 3 to beat up my http-app. Grinder 3 comes with its own jython.jar. Some of the sample scripts: http://grinder.sourceforge.net/g3/script-gallery.html use import statements that don't work for me. Reading around, these are reference to modules. Do I need a "proper"

Re: Database recommendations for Windows app

2005-06-23 Thread Thomas Bartkus
"Magnus Lycka" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Cameron Laird wrote: > > OK, I'm with you part of the way. Typical "Access" developers > > are *always* involved with DLL hell, right? You're surely not > > saying that Python worsens that frustration, are you? > > I thi

Re: List of all installed applications (XP)?

2005-06-23 Thread Paul McGuire
Get Tim Golden's wmi module (http://tgolden.sc.sabren.com/python/wmi.html). I recently had to help my brother remove some spyware, and so I used some of the example that came with WMI to read through the registry to extract startup keys, services, etc. Even if your users aren't sophisticated enou

Re: Allowing only one instance of a script?

2005-06-23 Thread Thomas Guettler
Am Wed, 22 Jun 2005 23:49:21 -0700 schrieb Ali: > Hi, > > I have a script which I double-click to run. If i double-click it > again, it will launch another instance of the script. > > Is there a way to allow only one instance of a script, so that if > another instance of the script is launched,

Re: python create WMI instances

2005-06-23 Thread future_retro
Right I got it working. I had to put a printer port in aswell. I'll now look at a script to create printer ports. My goal is being able to query the printers on print server x and then recreate the printers (shares and ports) on print server y. Thanks, for all your help Tim, much appreciated. M

Re: os.system(cmd) isn't working

2005-06-23 Thread Tjarko de Jong
On Thu, 23 Jun 2005 00:02:55 -0400, Gregory Piñero <[EMAIL PROTECTED]> wrote: >Hi guys, > >I'm trying to run this statement: > >os.system(r'"C:\Program Files\Mozilla Firefox\firefox.exe"' + ' >"www.blendedtechnologies.com"') > >The goal is to have firefox open to that website. > >When I type r'"C:

Re: Loop until condition is true

2005-06-23 Thread Stelios Xanthakis
Michael Hoffman wrote: > Stelios Xanthakis wrote: > >> Magnus Lycka wrote: > > > > >>> Right. Silly me. Maybe in some future Python version, True and False >>> will be constants, like None is since Python 2.4. >> >> >> Actually, there is support in marshal to write True and False objects so >>

Re: PEP 304 - is anyone really interested?

2005-06-23 Thread Thomas Guettler
Am Wed, 22 Jun 2005 18:01:51 -0500 schrieb Skip Montanaro: > > I wrote PEP 304, "Controlling Generation of Bytecode Files": > > http://www.python.org/peps/pep-0304.html > ... Hi, I am interested in a small subset: I want to import a file without a '.pyc' being generated. Background: I

Re: PEP ? os.listdir enhancement

2005-06-23 Thread Thomas Guettler
Am Wed, 22 Jun 2005 17:57:14 +0200 schrieb Riccardo Galli: > Hi, > I noticed that when I use os.listdir I need to work with absolute paths > 90% of times. > While I can use a for cycle, I'd prefere to use a list comprehension, > but it becomes too long. Hi, I like it. But as you noticed, too, "

Re: newbie - modules for jython (under grinder 3) ?

2005-06-23 Thread Diez B. Roggisch
bugbear wrote: > I'm just trying to use Grinder 3 to beat > up my http-app. > > Grinder 3 comes with its own jython.jar. > > Some of the sample scripts: > http://grinder.sourceforge.net/g3/script-gallery.html > use import statements that don't work for me. > > Reading around, these are reference

Re: Allowing only one instance of a script?

2005-06-23 Thread Grant Edwards
On 2005-06-23, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Create a file which contains the PID (process ID) of > the current process in a directory. If the file > already exists, the file is running. That's how it's usually done. > If your script dies without removing the pid-file, you need to

Re: Database recommendations for Windows app

2005-06-23 Thread Magnus Lycka
Thomas Bartkus wrote: > "Magnus Lycka" <[EMAIL PROTECTED]> wrote in message > > The O.P. wanted a database for his > > Python app, and Thomas Bartkus suggested Access. > > Not exactly! Sorty, I meant Jet or whatever the backend is called these days. > I suggested the built in Microsoft DAO o

Re: Allowing only one instance of a script?

2005-06-23 Thread Grant Edwards
On 2005-06-23, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2005-06-23, Tim Golden <[EMAIL PROTECTED]> wrote: >> [Ali] >>| >>| I have a script which I double-click to run. If i double-click it >>| again, it will launch another instance of the script. >>| >>| Is there a way to allow only one inst

Re: python create WMI instances

2005-06-23 Thread future_retro
Heres a script for creating printer ports import win32com.client WBEM = win32com.client.GetObject(r"winmgmts:{impersonationLevel=impersonate}!\\" + "." + r"\root\cimv2") printer = WBEM.Get("Win32_Printer").SpawnInstance_() printer.Properties_('DeviceID').Value = 'myprinter' printer.Properties_('Dr

Re: PEP ? os.listdir enhancement

2005-06-23 Thread Ivan Van Laningham
Hi All-- Thomas Guettler wrote: > > I like it. But as you noticed, too, "join" would be better than "abs". > > Example: > > # mylistdir.py > import os > import sys > > def mylistdir(dir, join=False): > for file in os.listdir(dir): > yield os.path.join(dir, file) > > print list(myl

Re: PEP 304 - is anyone really interested?

2005-06-23 Thread Thomas Heller
Thomas Guettler <[EMAIL PROTECTED]> writes: > Am Wed, 22 Jun 2005 18:01:51 -0500 schrieb Skip Montanaro: > >> >> I wrote PEP 304, "Controlling Generation of Bytecode Files": >> >> http://www.python.org/peps/pep-0304.html >> > > ... > > Hi, > > I am interested in a small subset: I want to im

Re: how to use more than 1 __init__ constructor in a class ?

2005-06-23 Thread Singletoned
Rocco Moretti wrote: > Steven D'Aprano wrote: > > That's the joys of a mostly self-taught programming knowledge: you miss > > out on all the buzzwords. > > Being mostly self taught myself, I have a tendancy to use infrequently > encountered terms in related but technically inappropriate contexts,

Re: Loop until condition is true

2005-06-23 Thread Mike Meyer
Stelios Xanthakis <[EMAIL PROTECTED]> writes: > Michael Hoffman wrote: >> Stelios Xanthakis wrote: >> >>> Magnus Lycka wrote: >> > >> Right. Silly me. Maybe in some future Python version, True and False will be constants, like None is since Python 2.4. >>> >>> >>> Actually, there is sup

Re: Database recommendations for Windows app

2005-06-23 Thread Thomas Bartkus
"Magnus Lycka" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thomas Bartkus wrote: > > "Magnus Lycka" <[EMAIL PROTECTED]> wrote in message > > > The O.P. wanted a database for his > > > Python app, and Thomas Bartkus suggested Access. > > > > Not exactly! > > Sorty, I meant Jet

Re: Database recommendations for Windows app

2005-06-23 Thread Dan
On 6/22/2005 3:08 PM, Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, Dan <[EMAIL PROTECTED]> wrote: > >>On 6/22/2005 1:14 PM, Dave Cook wrote: >> >>>On 2005-06-22, Cameron Laird <[EMAIL PROTECTED]> wrote: >>> >>> >>> Are you saying that Python-based applications are particularly v

Re: Database recommendations for Windows app

2005-06-23 Thread Dan
On 6/22/2005 9:51 PM, Peter Hansen wrote: > Will McGugan wrote: > >> Thanks for the replies. I think I'm going to go with sqllite for now. > > > Your list didn't mention a few things that might be critical. > Referential integrity? Type checking? SQLite currently supports > neither. Just ma

Re: Loop until condition is true

2005-06-23 Thread Benji York
Mike Meyer wrote: > Making None a constant broke existing code (and I just saw old code > that assigned to None). Are True and False that much more common as > variable names than None? I would think so. I know that my pre-booleans-in-Python code routinely did something like "from booleans impor

Re: User interfaces in console (dialog like)

2005-06-23 Thread erinhouston
Do you only need to work on windows? if so you could use http://newcenturycomputers.net/projects/wconio.html to build your own gui. We used this for our inhouse ldap admin script. -- http://mail.python.org/mailman/listinfo/python-list

don't understand MRO

2005-06-23 Thread Uwe Mayer
Hi, I have a subclassed PyQt class: class Node(object): def move(self, x,y): pass class CRhomb(QCanvasPolygon, Node): pass $ python v2.4.1 >>> CRhomb.mro() [, , , , , , , ] >>> a = CRhomb() >>> a.move(1,2) This executes also Node.move(a, 1,2) Why? Because even QCanvasItem.move deleg

Re: pickle broken: can't handle NaN or Infinity under win32

2005-06-23 Thread Tim Peters
[Tim Peters'] >> Well, I try, Ivan. But lest the point be missed , 754 doesn't >> _want_ +0 and -0 to act differently in "almost any" way. The only >> good rationale I've seen for why it makes the distinction at all is in >> Kahan's paper "Branch Cuts for Complex >> Elementary Functions, or Much

Re: pickle broken: can't handle NaN or Infinity under win32

2005-06-23 Thread Ivan Van Laningham
Hi All-- Tim Peters wrote: > Fortran is so > eager to allow optimizations that failure due to numeric differences > in conformance tests rarely withstood challenge. +1 QOTW Metta, Ivan -- Ivan Van Laningham God N Locomotive Works http://www.andi-holmes

Re: how to use more than 1 __init__ constructor in a class ?

2005-06-23 Thread jean-marc
Singletoned wrote: > Rocco Moretti wrote: > > Steven D'Aprano wrote: > > > > That's the joys of a mostly self-taught programming knowledge: you miss > > > out on all the buzzwords. > > > > Being mostly self taught myself, I have a tendancy to use infrequently > > encountered terms in related but

Re: Using PAMIE to upload and download files...is it possible?

2005-06-23 Thread calfdog
If you go into the PAMIE users group and go to the files Section you will see modalPopupTest.py this will handles Uploads, pop-ups, alerts using PAMIE PAMIE will include this feature in the next release http://groups.yahoo.com/group/Pamie_UsersGroup/files/ RLM scrimp wrote: > Well, thanx to Eri

Urgent problem: Embedding Python questions....

2005-06-23 Thread adsheehan
Hi, I am embedding Python into a multi-threaded C++ application runnig on Solaris and need urgent clarification on the embedding architecture and its correct usage (as I am experience weird behaviors). Can anyone clarify: - if Python correctly supports multiple sub-interpreters (Py_NewInterp

Re: User interfaces in console (dialog like)

2005-06-23 Thread Riccardo Galli
On Thu, 23 Jun 2005 05:45:07 -0700, Negroup wrote: > Hi all. > > I need to provide to my users a graphical interface to be used from os' > command line. > Initially I thought something equivalent to Unix dialog, and googling > around I have found Python Dialog > (http://pythondialog.sourceforge.n

Re: Loop until condition is true

2005-06-23 Thread Michael Hoffman
Mike Meyer wrote: > Making None a constant broke existing code (and I just saw old code > that assigned to None). Are True and False that much more common as > variable names than None? Yes. In fact, I count at least 4 different modules in the Python 2.4 standard library that assign to True or F

Re: Loop until condition is true

2005-06-23 Thread Michael Hoffman
Antoon Pardon wrote: > Op 2005-06-22, Michael Hoffman schreef <[EMAIL PROTECTED]>: > >>Remi Villatel wrote: >> >>>Fredrik Lundh wrote: >>> checking if a logical expression is true by comparing it to True is bad style, and comparing values using "is" is also bad style. >>> >>>I wrote it thi

Re: Reraise exception with modified stack

2005-06-23 Thread Scott David Daniels
Nicolas Fleury wrote: > Hi, > I've made a small utility to re-raise an exception with the same stack > as before with additional information in it. Since I want to keep the > same exception type and that some types have very specific constructors > (which take, for example, more than one parame

pass an event up to parent widget

2005-06-23 Thread William Gill
I have a Tkinter (frame) widget that contains several other frame widgets, each containing entry widgets. In the parent frame I have a 'save' button that is initially disabled. As it is now, each widget has a hasChanged property that I can poll to see if updates to the source data need to be

Re: newbie - modules for jython (under grinder 3) ?

2005-06-23 Thread bugbear
Diez B. Roggisch wrote: > bugbear wrote: > >> I'm just trying to use Grinder 3 to beat >> up my http-app. >> >> Grinder 3 comes with its own jython.jar. >> >> Some of the sample scripts: >> http://grinder.sourceforge.net/g3/script-gallery.html >> use import statements that don't work for me. >> >>

Re: suggestions invited

2005-06-23 Thread gry
Aditi wrote: > hi all...i m a software engg. student completed my 2nd yr...i have been > asked to make a project during these summer vacations...and hereby i > would like to invite some ideas bout the design and implementation of > an APPLICATION MONITORING SYSTEMi have to start from scrach so

Re: PEP ? os.listdir enhancement

2005-06-23 Thread Riccardo Galli
On Thu, 23 Jun 2005 09:21:55 -0600, Ivan Van Laningham wrote: > Mmmm, how about: > > # mylistdir.py > import os, os.path > import sys > > def mylistdir(dir, join=False): > for file in os.listdir(dir): > if join: > yield join(dir, file) > else: > yield file >

Re: Avoiding deadlocks in concurrent programming

2005-06-23 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Konstantin Veretennicov <[EMAIL PROTECTED]> wrote: > On 22 Jun 2005 17:50:49 -0700, Paul Rubin > <"http://phr.cx"@nospam.invalid> wrote: > > > Even on a multiprocessor > > system, CPython (because of the GIL) doesn't allow true parallel > > threads, ... . > > Ple

Re: os.system(cmd) isn't working

2005-06-23 Thread drobinow
If firefox is not your default browser, os.system(r'"cd c:\Program Files\Mozilla Firefox & firefox "' + '"www.blendertechnologies.com"') works for me. -- http://mail.python.org/mailman/listinfo/python-list

Re: User interfaces in console (dialog like)

2005-06-23 Thread Jeremy Sanders
Negroup wrote: > Do you guys know an alternative that fits my needings without moving > from Python? Turbo Vision in dos used to be really good. There's a python binding to the free version here: http://tvision.sourceforge.net/ (I haven't tried it) -- Jeremy Sanders http://www.jeremysanders.n

Re: don't understand MRO

2005-06-23 Thread Terry Reedy
"Uwe Mayer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have a subclassed PyQt class: > > class Node(object): >def move(self, x,y): pass > > class CRhomb(QCanvasPolygon, Node): pass > > $ python > v2.4.1 CRhomb.mro() > [, , 'qtcanvas.QCanvasPolygonalItem'>, , 'q

Re: Database recommendations for Windows app

2005-06-23 Thread Peter Hansen
Dan wrote: > So in SQLLite, what happens of you try to store XYZ in an integer field? Without your having enabled any of the "affinity" options mentioned by Dave Cook, SQLite will happily store 'XYZ' in that column, and return it to you when you query that row. The types are either ignored, or

Re: Reraise exception with modified stack

2005-06-23 Thread Nicolas Fleury
Scott David Daniels wrote: > How about dropping reraise and changing: > reraise(...) > to: > addinfo(...) > raise It doesn't work, or at least it doesn't do what I want. I want to keep the same exception stack to be able to identify the original error. I would lik

connecting to an exsisting COM server

2005-06-23 Thread jelle
Hi, I'm using win32com.client.GetObject(Class='Rhino3.Application') to connect to an existing COM server. However when doing so: Traceback (most recent call last): File "", line 1, in ? File "C:\Python24\lib\site-packages\win32com\client\__init__.py", line 80, in GetActiveObject dispatch

Re: Loop until condition is true

2005-06-23 Thread Roy Smith
Michael Hoffman <[EMAIL PROTECTED]> wrote: > I count at least 4 different modules in the Python 2.4 standard > library that assign to True or False, mainly as a compatibility > measure for the days before they were built-ins. Hopefully, none of them as creative as http://thedailywtf.com/forums/36

Re: newbie - modules for jython (under grinder 3) ?

2005-06-23 Thread Diez B. Roggisch
OK - of course this means I'll have to tell Grinder to > use "my" Jython, not "its" Jython. > > Hopefully that's well documented :-) If they use 2.1 - which you should hope :) - teaching it shouldn't be much more as issuing -Dpython.home= as argument to the VM. Diez -- http://mail.python.o

Re: Allowing only one instance of a script?

2005-06-23 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Grant Edwards <[EMAIL PROTECTED]> wrote: . . . >You can also use a network port instead of a file. Binding a >socket to a port is an exclusive and atomic operation. An >advantage to the networ

  1   2   >