pyMpCCI v0.1

2005-06-22 Thread Marc Poinot
--- pyMpCCI v0.1 This package is a Python wrapper for MpCCI code-coupling product (see http://www.scai.fraunhofer.de/mpcci.html) MpCCI is a code-coupling system built on top of MPI. It insures data translation between

Re: *Python* Power Tools

2005-06-22 Thread Terry Hancock
On Tuesday 21 June 2005 06:53 pm, John Machin wrote: Micah wrote: Anyone know if there is any organized effort underway to implement the Python equivalent of Perl Power Tools http://ppt.perl.org/? If not, would starting this be a waste of effort since: +1 WOFTAM-of-the-year [...] Or

Re: tree functions daily exercise: Table

2005-06-22 Thread gene tani
Dear Mr. Jones: Our team of 3,972 expert testers judged the output of your troll-spewing neural net virtually indistinguishable from the original. Given this, I am please to announce that our firm is willing to discuss arrangements for an exclusive license that you would likely find financially

Re: getting an object name

2005-06-22 Thread Irmen de Jong
David Bear wrote: Let's say I have a list called, alist. If I pass alist to a function, how can I get the name of it? alist = range(10) def afunction(list): listName = list.__name__ (fails for a list object) You don't, see the other reply. You didn't say why you think you need

Re: getting an object name

2005-06-22 Thread Simon Brunning
On 6/22/05, David Bear [EMAIL PROTECTED] wrote: Let's say I have a list called, alist. If I pass alist to a function, how can I get the name of it? The effbot put it beautifully: The same way as you get the name of that cat you found on your porch: the cat (object) itself cannot tell you its

Re: Using code objects?

2005-06-22 Thread Fredrik Lundh
Chinook wrote: When I create the code objects though, it seems a couple different ways work and I'm wondering which is better and why (or is there a more correct technique in this situation)? from where are you getting the source code for those code objects? from the example below, it sure

Re: utf8 and ftplib

2005-06-22 Thread Fredrik Lundh
Fredrik Lundh wrote: character references refer to code points in the Unicode code space, so you just convert the bytes you get after converting to UTF-8. so you cannot just, of course. /F -- http://mail.python.org/mailman/listinfo/python-list

C++ ActiveX python javascript communication trouble.

2005-06-22 Thread whimsica
I'm investingating a c++ api, Panda3d.com, that has a python binding. I want to convert this api into an ACtiveX control so it will run on the web. When I do so I want to use Microsoft Script Control to call api routines from Javascript in the browser. Let's say I write up a game in python with

C++ ActiveX python javascript communication trouble.

2005-06-22 Thread whimsica
I'm investingating a c++ api, Panda3d.com, that has a python binding. I want to convert this api into an ACtiveX control so it will run on the web. When I do so I want to use Microsoft Script Control to call api routines from Javascript in the browser. Let's say I write up a game in python with

Reading registry export files

2005-06-22 Thread George
Hi, I have exported some registry-keys using Regedit to a number of .reg-files. I can open these files using any text editor. Now I wanted to write a simple Python script to concatenate all these files to one output file. (Please note that I'm a newbie). However, if I do something like:

Re: tree functions daily exercise: Table

2005-06-22 Thread Duncan Booth
Xah Lee wrote: oops, another error. The example should be: Table(f,[1,2,1],[2,6,2]) returns [[f(1,2),f(1,4),f(1,6)],[f(2,2),f(2,4),f(2,6)]] Wouldn't it be more sensible just to take the iterators directly as arguments, so for this example you would do: Table(f, range(1,3),

Re: Running WMI within a Windows service

2005-06-22 Thread cameron . mccloud
Tim, Changing the path didn't do anything, but changing the name of the module to my_wmi did the trick. Thanks very much, Cam. Tim Golden wrote: [EMAIL PROTECTED] | Hi, | | When trying to import the WMI module in a Python Windows | Service, I get | the following: | | dynamic module

Re: *Python* Power Tools

2005-06-22 Thread Daniel Dittmar
Micah wrote: Anyone know if there is any organized effort underway to implement the Python equivalent of Perl Power Tools http://ppt.perl.org/? If not, would starting this be a waste of effort since: - it's already being done in Perl? - cygwin thrives? - UNIX is already pervasive :-) ?

Re: tree functions daily exercise: Table

2005-06-22 Thread Duncan Booth
Duncan Booth wrote: Ok, so, if I understand you, the definition of Table is just: def Table(f, *lists): return Outer(f, *[range(start,end+1,step) for (start,end,step) in lists]) Is that about right? And lest you think I left a bit too much as an exercise for the reader:

RE: Running WMI within a Windows service

2005-06-22 Thread Tim Golden
[EMAIL PROTECTED] | [.. re problems running WMI in a service ...] | Changing the path didn't do anything, but changing the name of the | module to my_wmi did the trick. | | Thanks very much, | | Cam. | Thanks for the feedback; I'll try to find the time to experiment a bit but I know I've

Re: Loop until condition is true

2005-06-22 Thread Ville Vainio
Stelios == Stelios Xanthakis [EMAIL PROTECTED] writes: Stelios Anyway, if you can't wait for 2.5 either use 'while 1:', Stelios or pyc[1] ... and I can't see why people don't want to use 'while 1:' in the first place, given that everyone can identify the idiom immediately. It's 4

Re: Embedding Python - Deleting a class instance

2005-06-22 Thread Andreas Kostyrka
On Tue, Jun 21, 2005 at 12:06:47PM +, Bue Krogh Vedel-Larsen wrote: How do I delete a class instance created using PyInstance_New? I've tried calling Py_CLEAR on the instance, but __del__ isn't called. I've also tried calling PyObject_Del, but this gives an access violation in

Re: asynchronous comunication, wxPython and threads.

2005-06-22 Thread Zunbeltz Izaola
On Tue, 21 Jun 2005 11:07:35 -0400, Peter Hansen wrote: Please clarify: what does this mean? Sending a socket is not a usual way to describe TCP communications. Do you mean your program _opens_ a socket (like a phone connection) and _sends_ some data, then waits for data to be received

Re: *Python* Power Tools

2005-06-22 Thread Ville Vainio
John == John Machin [EMAIL PROTECTED] writes: John For windows users, apart from cygwin, there are a couple of John sources of binaries for *x command-line utilities (unxutils, John gnuwin32). unxutils is my personal favourite - cygwin is way too much an environment, and gets broken

Re: need to strip stuff off email

2005-06-22 Thread Tim Williams
nephish [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hey there, i have a script that retrieves my email, but i need it to be able to strip all the stuff off except the body (the message itself) so i can later write it to a text file. anyone know how to accomplish this?

suggestions invited

2005-06-22 Thread Aditi
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 please tell me how

Re: Want to learn a language - is Python right?

2005-06-22 Thread Aziz McTang
Hi Everyone, Thanks for all the helpful advice. Downloaded 2.4.1 and already have an inkling of some of the things it can do. Time to start learning! ATB Aziz -- http://mail.python.org/mailman/listinfo/python-list

Re: Loop until condition is true

2005-06-22 Thread Steven D'Aprano
On Wed, 22 Jun 2005 09:54:44 +0200, Fredrik Lundh wrote: [CENSORED] I keep for myself how stupid I found your post. so let's see if everyone who understands how embarrassingly stupid your post is will keep that to themselves... Damn, did I fail some test? wink -- Steven. --

Urgent: Embedding Python question please

2005-06-22 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

Re: Installing MySQL-Python

2005-06-22 Thread kai festersen
Cathy Hui wrote: Do u know why do i get the following message error: command 'gcc' failed with exit status 1 yes: error: command 'gcc' failed with exit status 1 means: there's no compiler gcc ... kai when trying to build the MySql-Python (1.2.0) on my Solaris 8 system? (with mysql 4.0.21

Re: need to strip stuff off email

2005-06-22 Thread Tim Williams
- Original Message - From: Tim Williams [EMAIL PROTECTED] To: python-list@python.org Sent: Wednesday, June 22, 2005 10:48 AM Subject: Re: need to strip stuff off email nephish [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hey there, i have a script that retrieves

importing a package

2005-06-22 Thread flupke
Hi, I developed a package with a structure like this src/ tesfile.py dir1/ __init__.py file1.py dir2/ __init__.py file2.py The testfile is meant to try the code out that is specified in file1.py and file2.py Now i have another project where i want to

Re: suggestions invited

2005-06-22 Thread Konstantin Veretennicov
On 22 Jun 2005 02:47:06 -0700, Aditi [EMAIL PROTECTED] wrote: i have to make a system used by the IT department of a company which contains 31 applications and their details which are being used in a company ...the details are... Application sub application catagoryplatform

Re: Getting/Saving email attachments w/ poplib and email modules

2005-06-22 Thread Tim Williams
- Original Message - From: [EMAIL PROTECTED] Here's what I'm trying to do: I need to connect to a pop3 server, download all messages, and copy all of the attachments into a specific directory. The actual email message ## import email import poplib mimes =

Re: Compiling C++ extensions with distutils on Cygwin

2005-06-22 Thread George Sakkis
George Sakkis wrote: I'm trying to build a C++ extension on Cygwin, but it fails because distutils invokes gcc instead of g++. Looking into distutils internals, it turns out that compilation is assumed to be independent of the target language, while linking is not (CCompiler.compile() doesn't

Re: getting an object name

2005-06-22 Thread TZOTZIOY
On Wed, 22 Jun 2005 09:00:23 +0100, rumours say that Simon Brunning [EMAIL PROTECTED] might have written: Let's say I have a list called, alist. If I pass alist to a function, how can I get the name of it? The effbot put it beautifully: And IMO it should be in the FAQ:

Re: A World Beyond Capitalism 2005, An Annual International Multiracial Alliance Building Peace Conference Is Accepting Proposals...

2005-06-22 Thread Drazen Gemic
Take your political propaganda somewhere else. DG -- http://mail.python.org/mailman/listinfo/python-list

Re: python create WMI instances

2005-06-22 Thread future_retro
Create isn't a method of Win32_Printer so I couldn't get that to work. .Create is a method of Win32_Process which (wait for it..) creates a new process. Unfortunatly there is no method to add a printer. the method .AddPrinterConnection will allow me to add a connection to an existing print share

Re: Getting/Saving email attachments w/ poplib and email modules

2005-06-22 Thread Mike Meyer
[EMAIL PROTECTED] writes: Hello All, Here's what I'm trying to do: I need to connect to a pop3 server, download all messages, and copy all of the attachments into a specific directory. The actual email message is unimportant. Now, I've found plenty of examples that strip the

ANN: python-ldap-2.0.8

2005-06-22 Thread Michael Ströder
Find a new release of python-ldap: http://python-ldap.sourceforge.net/ python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related stuff (e.g.

Re: Loop until condition is true

2005-06-22 Thread Greg Lindstrom
A bit off topic, but what does the expression Don't try to teach your grandfather how to suck eggs. mean? I've never heard it before and am curious to the story behind it. Thanks, --greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading registry export files

2005-06-22 Thread [EMAIL PROTECTED]
It works fine for me on NT. I think it has nothing to do with Python but with the way the file is created - what windows version are you on? Also note the possibility the '/' - I prefer a noatation like below to avoid ambiguity. Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit

Re: Loop until condition is true

2005-06-22 Thread Tim Williams
- Original Message - From: Greg Lindstrom [EMAIL PROTECTED] A bit off topic, but what does the expression Don't try to teach your grandfather how to suck eggs. mean? I've never heard it before and am curious to the story behind it. A relatively well know phrase, however as quoted

Re: A World Beyond Capitalism 2005, An Annual International Multiracial Alliance Building Peace Conference Is Accepting Proposals...

2005-06-22 Thread Peter Hansen
Jack Diederich wrote: The '.info' domain also defeats the linux 'whois' command to dig for registrar info. Maybe so, but it's always pretty easy to Google for whois plus the domain to find a way of doing it via the web, in this case with http://www.afilias.info/cgi-bin/whois.cgi . (It's

Python API to manipulate CAB files.

2005-06-22 Thread Isaac Rodriguez
Does anyone know of a Python API to manipulate CAB files? Thanks, -- Isaac Rodriguez SWE Autodesk. There are 10 types of people. Those who undertand binary, and those who don't -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading registry export files

2005-06-22 Thread Thorsten Kampe
* [EMAIL PROTECTED] (2005-06-22 13:59 +0100) It works fine for me on NT. I think it has nothing to do with Python but with the way the file is created - what windows version are you on? Windows uses UTF-16 since Windows 2000. Regedit offers the possibility to export in the old Win9x/NT4 format.

Re: C++ ActiveX python javascript communication trouble.

2005-06-22 Thread BigBrian
I'm investingating a c++ api, Panda3d.com, that has a python binding. I want to convert this api into an ACtiveX control so it will run on the web. When I do so I want to use Microsoft Script Control to call api routines from Javascript in the browser. Let's say I write up a game in python

Re: sudoku dictionary attack

2005-06-22 Thread Nigel Greenwood
Nick Atty wrote: On-line canal route planner: http://www.canalplan.org.uk So the Travelling Salesman goes by narrow boat these days, does he? Nigel -- ScriptMaster language resources (Chinese/Modern Classical Greek/IPA/Persian/Russian/Turkish): http://www.elgin.free-online.co.uk --

Database recommendations for Windows app

2005-06-22 Thread Will McGugan
Hi, I'd like to write a windows app that accesses a locally stored database. There are a number of tables, the largest of which has 455,905 records. Can anyone recommend a database that runs on Windows, is fast / efficient and can be shipped without restrictions or extra downloads? I have

Re: getting an object name

2005-06-22 Thread Ron Adam
David Bear wrote: Let's say I have a list called, alist. If I pass alist to a function, how can I get the name of it? alist = range(10) def afunction(list): listName = list.__name__ (fails for a list object) Using an object's name as data isn't a good idea because it will

[no subject]

2005-06-22 Thread Doug Ly
Is there a good IDE for Python? I have heard that Eclipse has a plugin for Jython only. Thanks --Doug -- http://mail.python.org/mailman/listinfo/python-list

Re: Loop until condition is true

2005-06-22 Thread Magnus Lycka
Remi Villatel wrote: Erm... You totally missed the point. I wrote it this way because, first, it's perfectly valid Python code and, second and most important, it's also a valid english sentence. Remi, I think you have failed to understand what Fredrik was telling you. I can understand that,

Re: asynchronous comunication, wxPython and threads.

2005-06-22 Thread Zunbeltz Izaola
On Wed, 22 Jun 2005 09:28:31 -0400, Peter Hansen wrote: Almost certainly it is. It would be simplest to set up a worker thread once, when the GUI thread begins, and simply send requests to it via a Queue. It can create the socket, connect to the server, communicate, close it down, and

Re: Database recommendations for Windows app

2005-06-22 Thread Thomas Bartkus
Will McGugan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I'd like to write a windows app that accesses a locally stored database. There are a number of tables, the largest of which has 455,905 records. Can anyone recommend a database that runs on Windows, is fast /

Re: importing a package

2005-06-22 Thread flupke
Damjan wrote: I developed a package with a structure like this src/ tesfile.py dir1/ __init__.py file1.py dir2/ __init__.py file2.py Importing dir2/file2 from dir1/file1.py works here, because when yuo started the testfile script the src/ directory

Re: Database recommendations for Windows app

2005-06-22 Thread Gregory Piñero
I always figured a problem with using MySQL was distribution. Would you have to tell your users to install MySQL and then to leave the service running? I've never found an easy way to embed MySQL into a python app, and even if you could, would you then have to pay for it? -Greg On 6/22/05,

Re: python create WMI instances

2005-06-22 Thread future_retro
Win32_Printer doesn't work with the Create method and AddPrinterConnection only lets me add a connection to a share. I'll try and work out how to set the printer object properties in the format suggested; oPrinter.Properties_ (DriverName).Value = strDriver Cheers, MW. --

RE: python create WMI instances

2005-06-22 Thread Tim Golden
[EMAIL PROTECTED] | Win32_Printer doesn't work with the Create method and | AddPrinterConnection only lets me add a connection to a share. I'll | try and work out how to set the printer object properties in | the format | suggested; | | oPrinter.Properties_ (DriverName).Value = strDriver | |

Re: Database recommendations for Windows app

2005-06-22 Thread Dan
Take a look at Firebird. It can be run in embedded mode. It might be overkill for your needs though... On 6/22/2005 10:37 AM, Gregory Piñero wrote: I always figured a problem with using MySQL was distribution. Would you have to tell your users to install MySQL and then to leave the service

Re: Database recommendations for Windows app

2005-06-22 Thread Dave Cook
On 2005-06-22, Will McGugan [EMAIL PROTECTED] wrote: I'd like to write a windows app that accesses a locally stored database. There are a number of tables, the largest of which has 455,905 records. Can anyone recommend a database that runs on Windows, is fast / efficient and can be shipped

PEP ? os.listdir enhancement

2005-06-22 Thread 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. I propose to add an 'abs' keyword which would make os.listdir return the absolute path of files instead of a

Re: Loop until condition is true

2005-06-22 Thread Michael Hoffman
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 perfectly valid Python code and, second and most important, it's also a valid

Looking for a web-based messaging system

2005-06-22 Thread Mike Meyer
One of my clients has a need for a web-based messaging system. Something python-based is preferred, as that's where our expertise is, but web frameworks built in Python are perfectly acceptable. If you know of something really good that isn't in Python, I wouldn't mind hearing about it - but I do

Re: Database recommendations for Windows app

2005-06-22 Thread Magnus Lycka
Will McGugan wrote: Hi, I'd like to write a windows app that accesses a locally stored database. There are a number of tables, the largest of which has 455,905 records. Can anyone recommend a database that runs on Windows, is fast / efficient and can be shipped without restrictions or

Re: Database recommendations for Windows app

2005-06-22 Thread Magnus Lycka
Thomas Bartkus wrote: If you are writing strictly for the MS Windows platform And If the database is running single user with a locally stored database on a Windows workstation. Then The MS Access file based (.mdb) system is hard to argue with. I disagree. What does .mdb/jet without

Dr. Dobb's Python-URL! - weekly Python news and links (Jun 22)

2005-06-22 Thread Simon Brunning
QOTW: Python is more concerned with making it easy to write good programs than difficult to write bad ones. - Steve Holden Scientists build so that they can learn. Programmers and engineers learn so that they can build. - Magnus Lycka It happens that old Java programmers make one module per

Dr. Dobb's Python-URL! - weekly Python news and links (Jun 22)

2005-06-22 Thread Simon Brunning
QOTW: Python is more concerned with making it easy to write good programs than difficult to write bad ones. - Steve Holden Scientists build so that they can learn. Programmers and engineers learn so that they can build. - Magnus Lycka It happens that old Java programmers make one module per

Re: Python API to manipulate CAB files.

2005-06-22 Thread Peter Maas
Isaac Rodriguez schrieb: Does anyone know of a Python API to manipulate CAB files? If there is a Windows API you can probybly call it from Python using Mark Hammond's Win32 extensions. -- --- Peter Maas, M+R Infosysteme, D-52070

Re: PEP ? os.listdir enhancement

2005-06-22 Thread Jeff Epler
Why not just define the function yourself? Not every 3-line function needs to be built in. def listdir_joined(path): return [os.path.join(path, entry) for entry in os.listdir(path)] dirs = [x for x in listdir_joined(path) if os.path.isdir(x)] path_size = [(x, getsize(x)) for x in

Re: a comprehensive Tkinter document?

2005-06-22 Thread William Gill
Kent Johnson wrote: William Gill wrote: I know a major problem I am having is that I am finding lots of Tkinter information in 'fragments' of various , sometimes conflicting vintages. For example the python reference I was using didn't show the '%%' as an escape sequence, I posted

Re: Database recommendations for Windows app

2005-06-22 Thread Thomas Bartkus
Will McGugan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I'd like to write a windows app that accesses a locally stored database. There are a number of tables, the largest of which has 455,905 records. Can anyone recommend a database that runs on Windows, is fast /

Re: Loop until condition is true

2005-06-22 Thread Jeff Epler
def until(pred): yield None while True: if pred(): break yield None def example(): i = 0 for _ in until(lambda: x==0): x = 10 - i i += 1 print x, i example() pgpeP7iW6mcQm.pgp Description: PGP signature --

Re: Database recommendations for Windows app

2005-06-22 Thread Dan
On 6/22/2005 11:38 AM, Thomas Bartkus wrote: Will McGugan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I'd like to write a windows app that accesses a locally stored database. There are a number of tables, the largest of which has 455,905 records. Can anyone recommend a

Re: PEP ? os.listdir enhancement

2005-06-22 Thread Peter Hansen
Riccardo Galli wrote: 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. ### e.g. 1 part 1 - getting a list of directories ### dirs=[] for i in

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

2005-06-22 Thread Grant Edwards
On 2005-06-22, Scott David Daniels [EMAIL PROTECTED] wrote: I finally figured out why one of my apps sometimes fails under Win32 when it always works fine under Linux: Under Win32, the pickle module only works with a subset of floating point values. In particular the if you try to dump/load

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

2005-06-22 Thread scott
hi people, can someone tell me, how to use a class like that* (or simulate more than 1 constructor) : #-- class myPointClass: def __init__(self, x=0, y=0): self.x = x self.y = y def __init__(self, x=0, y=0, z=0): self.__init__(self, x, y) self.z = z #-- tia people

RE: Database recommendations for Windows app

2005-06-22 Thread Hughes, Chad O
Firebird is cross platform (you would need the classic server version) look at the following post: http://mail.python.org/pipermail/python-list/2005-June/286366.html Chad -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Will McGugan Sent: Wednesday, June

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

2005-06-22 Thread Steve
Hi Scott, can someone tell me, how to use a class like that* (or simulate more than 1 constructor) : One approach could be: class myPointClass: def __init__(self, **args): for k, v in args.items(): setattr(self, k, v) *this is not homework Just to be safe, I'll leave

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

2005-06-22 Thread Michael Hoffman
scott wrote: can someone tell me, how to use a class like that* (or simulate more than 1 constructor) : #-- class myPointClass: def __init__(self, x=0, y=0): self.x = x self.y = y def __init__(self, x=0, y=0, z=0): self.__init__(self, x, y) self.z = z #-- Well for

Re: Database recommendations for Windows app

2005-06-22 Thread Thomas Bartkus
Dan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 6/22/2005 11:38 AM, Thomas Bartkus wrote: Will McGugan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] And then XP Autoupdate executes, some of those Access/MSDE libraries are updated, and you app is broken.

Re: PEP ? os.listdir enhancement

2005-06-22 Thread Michael Hoffman
Peter Hansen wrote: Using Jason Orendorff's path module, all this code basically collapses down to this beauty (with your variable path renamed to myPath to avoid a name collision): This has to be the non-stdlib library I use the most. It's a great module. -- Michael Hoffman --

Re: JEP and JPype in a single process

2005-06-22 Thread Steve Menard
Steve Menard wrote: skn wrote: Hello, I have written a very simple java class file, which invokes a Python script using JEP. Code snippet:- --- Jep jep = new Jep(false); jep.runScript(C:\\temp\\testscript.py); jep.close(); Now inside this Python script I want to

MySQLdb reconnect

2005-06-22 Thread Damjan
Does MySQLdb automatically reconnect if the connection to the database is broken? I'm asking this since I have a longrunning Python precess that is connected to Mysql-4.1.11, and I execute set names utf8 when I connect to it. But after running a day the results from the python program were

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

2005-06-22 Thread Paul McGuire
This recipe that I submitted to the Python Cookbook (http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/223611) describes a technique for doing this. I use the example of creating Color objects for plotting to a bitmap, using either R,G,andB values, or a single integer representing the RGB

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

2005-06-22 Thread Rocco Moretti
scott wrote: hi people, can someone tell me, how to use a class like that* (or simulate more than 1 constructor) : #-- class myPointClass: def __init__(self, x=0, y=0): self.x = x self.y = y def __init__(self, x=0, y=0, z=0): self.__init__(self, x, y) self.z = z

timedelta comparision with gmtime()

2005-06-22 Thread Florian Lindner
Hello, I want to know if a certain duration is over. I try it like this with timedelta objects: d = datetime.timedelta(minutes = 2) t = time.gmtime() print (t + d time.gmtime()) gives: TypeError: unsupported operand type(s) for +: 'datetime.timedelta' and 'time.struct_time' How to do that

Re: Loop until condition is true

2005-06-22 Thread Scott David Daniels
Magnus Lycka wrote: In some cases, == and is happens to give the same result. a = 1 b = 1 a == b 1 a is b 1 But often not. c = 123456789 d = 123456789 c == d 1 c is d 0 ... First of all, a lot of Python values except 1 (a.k.a. True) are logically true in a

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

2005-06-22 Thread Scott David Daniels
Grant Edwards wrote: On 2005-06-22, Scott David Daniels [EMAIL PROTECTED] wrote: ...Under Win32, the pickle module only works with a subset of floating point values. In particular ... infinity or nan ... There is no completely portable way to do this. Python deals with all sorts of problems

Re: Database recommendations for Windows app

2005-06-22 Thread Magnus Lycka
Gregory Piñero wrote: I always figured a problem with using MySQL was distribution. Would you have to tell your users to install MySQL and then to leave the service running? I've never found an easy way to embed MySQL into a python app, and even if you could, would you then have to pay for

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

2005-06-22 Thread Grant Edwards
On 2005-06-22, Scott David Daniels [EMAIL PROTECTED] wrote: Fixing it is really quite trivial. It takes less than a dozen lines of code. Just catch the exception and handle it. Since you know it is quite trivial, and I don't, why not submit a patch resolving this issue. Be sure to include

Re: Database recommendations for Windows app

2005-06-22 Thread Cameron Laird
In article [EMAIL PROTECTED], Dan [EMAIL PROTECTED] wrote: . . . You wouldn't have to distribute the (rather expensive) Access application since this is little more than a front for the underlying DAO/ADO database

Re: importing a package

2005-06-22 Thread Damjan
Indeed, when i do this, then it works import sys sys.path.append('package') However, why is it that package isn't added automatically to the pad? When you execute a python program the directory where the program is is automatically added to sys.path. No other directory is added to the

Re: Database recommendations for Windows app

2005-06-22 Thread Dave Cook
On 2005-06-22, Cameron Laird [EMAIL PROTECTED] wrote: Are you saying that Python-based applications are particularly vulnerable in this all-too-common scenario? If so, I'm not getting it; why is the architecture described more fragile than more traditional Windows-oriented development

Re: timedelta comparision with gmtime()

2005-06-22 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED]:~ $ python Use now() from datetime class of datetime module instead of time module. Python 2.4.1 (#2, Mar 30 2005, 21:51:10) [GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2 Type help, copyright, credits or license for more information. py import datetime py t =

Package organization

2005-06-22 Thread Thomas Lotze
Hi, I've two questions concerning organizing and naming things when writing a Python package. - Naming of classes: I'm writing a library that reads PDF files. I have a data structure that represents the large-scale structure of a PDF file (header, trailer, incremental updates etc), and I'll

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

2005-06-22 Thread [EMAIL PROTECTED]
You also could use a list to represent your data, then you get more dimensions supported, e.g: import math class Point: def __init__(self, *args): self.points = list(args) def dist(x, y): if len(x.points) != len(y.points): raise

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

2005-06-22 Thread Scott David Daniels
Grant Edwards wrote: I'm working on it. I should have said it's trivial if you have access to the platforms to be supported. I've tested a fix that supports pickle streams generated under Win32 and glibc. That's using the native string representation of a NaN or Inf. Several issues: (1) The

debugging - converting PyObject back to a variable name

2005-06-22 Thread adamc
hi, I'm currently debugging a crash occurring in the Python interpreter. I've got a Dictionary object in the form of a (PyObject *) I can cast it to (dictobject *) in the debugger watch window, and I can also use PyString_AsString(PyObject_Repr()) to get the debugger to print out a string

create a pdf file

2005-06-22 Thread Alberto Vera
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? Regards -- http://mail.python.org/mailman/listinfo/python-list

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

2005-06-22 Thread Terry Reedy
Grant Edwards [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm working on it. I should have said it's trivial if you have access to the platforms to be supported. I've tested a fix that supports pickle streams generated under Win32 and glibc. That's using the native string

Re: create a pdf file

2005-06-22 Thread Dan
On 6/22/2005 1:58 PM, 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? Regards See http://www.reportlab.org/rl_toolkit.html -- http://mail.python.org/mailman/listinfo/python-list

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

2005-06-22 Thread F. Petitjean
Le 22 Jun 2005 11:44:09 -0700, [EMAIL PROTECTED] a écrit : You also could use a list to represent your data, then you get more dimensions supported, e.g: import math class Point: def __init__(self, *args): self.points = list(args) def dist(x, y): if len(x.points)

Re: Package organization

2005-06-22 Thread F. Petitjean
Le Wed, 22 Jun 2005 20:42:24 +0200, Thomas Lotze a écrit : Hi, I've two questions concerning organizing and naming things when writing a Python package. Assume I have a package called PDF. Should the classes then be called simply File and Objects, as it is clear what they do as they are

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

2005-06-22 Thread Grant Edwards
On 2005-06-22, Scott David Daniels [EMAIL PROTECTED] wrote: I'm working on it. I should have said it's trivial if you have access to the platforms to be supported. I've tested a fix that supports pickle streams generated under Win32 and glibc. That's using the native string representation

Re: oddness in shelve module

2005-06-22 Thread John Machin
Michael P. Soulier wrote: On 22/06/05 John Machin said: AFAICT, wrong it. The item assignment which is alleged not to be supported is of this form: an_object[some_key] = a_value I.e. self.db is the suspect, not sample Ah. Let me test that it is in fact being created properly then. I

  1   2   >