Re: Would there be support for a more general cmp/__cmp__

2005-10-21 Thread Antoon Pardon
Op 2005-10-20, Steve Holden schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> > Ergo: use rich comparisons. rich comparosons can only solve the problem partly. Python does have the cmp function and that can give totaly inconsistent results even when the order defined by the rich comparison

Re: Set an environment variable

2005-10-21 Thread Christian
> > The closest thing you can do is that: > > -myScript.py-- > print 'export MY_VARIABLE=value' > -- > > -myScript.sh-- > python myScript.py > /tmp/chgvars.sh > . /tmp/chgvars.

Re: Set an environment variable

2005-10-21 Thread Erik Max Francis
Christian wrote: > Can I write a .py script that calls a .sh script that executes the > export command and then calls another .py script (and how would the > first .py script look)? No, the shell script that the Python program would invoke would be a different process and so commands executed

Re: sort problem

2005-10-21 Thread Michele Petrazzo
Kent Johnson wrote: > or learn about decorate-sort-undecorate: > > lst = [ ...whatever ] lst = [ x[3], i, x for i, x in enumerate(lst) ] > I think that here the code must be changed (for the future): lst = [ (x[3], i, x) for i, x in enumerate(lst) ] > lst.sort() lst = [ x for _, _, x in lst ]

Re: classmethods, class variables and subclassing

2005-10-21 Thread Steve Holden
Andrew Jaffe wrote: >>Andrew Jaffe wrote: >> >> >>>Hi, >>> >>>I have a class with various class-level variables which are used to >>>store global state information for all instances of a class. These are >>>set by a classmethod as in the following >>> >>>class sup(object): >>> cvar1 = None >>

Re: Set an environment variable

2005-10-21 Thread Christian
Erik Max Francis wrote: > Christian wrote: > >> Can I write a .py script that calls a .sh script that executes the >> export command and then calls another .py script (and how would the >> first .py script look)? > > No, the shell script that the Python program would invoke would be a > differ

Re: classmethods, class variables and subclassing

2005-10-21 Thread Steve Holden
Andrew Jaffe wrote: >>Andrew Jaffe wrote: [...] > > The problem is that I actually do want to call these methods on the > class itself, before I've made any instances. > Except you could use staticmethods with an explicit class argument ... regards Steve -- Steve Holden +44 150 684 725

python and outlook

2005-10-21 Thread dt
Hi everyone, Are there any links or sites on how to read outlook mail boxes or address book? -- http://mail.python.org/mailman/listinfo/python-list

Re: Set an environment variable

2005-10-21 Thread Sybren Stuvel
Mike Meyer enlightened us with: > It's simpler to use eval and command substitution: > > eval $(python myScript.py) This looks like the best solution to me. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just tak

Re: Set an environment variable

2005-10-21 Thread Steve Holden
Christian wrote: >>The closest thing you can do is that: >> >>-myScript.py-- >>print 'export MY_VARIABLE=value' >>-- >> >>-myScript.sh-- >>python myScript.py > /tmp/chgvars.sh >>.

Re: override a property

2005-10-21 Thread Robin Becker
Kay Schluehr wrote: > Robin Becker wrote: > > >>I thought that methods were always overridable. >>In this case the lookup on the >>class changes the behaviour of the one and only property. > > > How can something be made overridable that is actually overridable? I > didn't know how to better ex

Re: Python vs Ruby

2005-10-21 Thread Michele Simionato
Tom Anderson: >> I have no idea what Scheme is, but I'll cettainly look it up as soon as >> I'm done writing this. > You won't like it. Give yourself another 5-10 years, and you might start > to find it strangely intriguing. +1 ;-) Michele Simionato -- http://mail.python.org/mailman/li

Re: Set an environment variable

2005-10-21 Thread Chris F.A. Johnson
On 2005-10-21, Christian wrote: > Erik Max Francis wrote: >> Christian wrote: >> >>> Can I write a .py script that calls a .sh script that executes the >>> export command and then calls another .py script (and how would the >>> first .py script look)? >> >> No, the shell script that the Python

Re: Searching for txt file and importing to ms access

2005-10-21 Thread Mark Line
Once i have this working i was planing to kept all the txt files as logs, i'd have to give them a real name and stuff. But thanks for you help so far Mark "Mike Meyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Mark Line" <[EMAIL PROTECTED]> writes: >> I'm managed to get s

Re: get a copy of a string leaving original intact

2005-10-21 Thread Fredrik Lundh
"Bell, Kevin" wrote: > I'm having trouble with something that seems like it should be simple. > > I need to copy a file, say "abc-1.tif" to another directory, but if it's > in there already, I need to transfer it named "abc-2.tif" but I'm going > about it all wrong. > > Here's what doesn't work: (

Python extension module segmentation fault

2005-10-21 Thread Rolf Wester
Hi, I' trying to make an extension module that passes Numeric arrays. The wrapper function is (swig generated and modified by myself): static PyObject *_wrap_my_func(PyObject *self, PyObject *args) { PyObject * resultobj = 0 ; PyObject * obj0 = 0 ; PyArrayObject * mat = 0 ; s

Re: connect to https unpossible. Please help.

2005-10-21 Thread Mark Delon
Hi Tim, really than u very much! I think u have helped me! I will try, that what u said. I have found probably simplier solution. Is it so? ...but without success:-(. I want to download some URLs via python script. With some URLs I have success with some NOT. Why? I do following:

Re: Python vs Ruby

2005-10-21 Thread Harald Armin Massa
Casey, > I have heard, but have not been able to verify that if a program is > about > 10,000 lines in C++ > it is about > 5,000 lines in Java > and it is about > 3,000 lines in Python (Ruby to?) BTW: it is normally only 50 lines in Perl. Not that you could read it, though Harald -- http://ma

finding a number...

2005-10-21 Thread Enrique Palomo Jiménez
After ftp a file from mvs to windows, i find: is an offset, so up to 2GB, a commercial application drives crazy this is the result 2147450785| 2147466880| 2147483412| ÓÕÖZÖ²YÕXÕ| ÓÕÖZÖÔÓÔÕZ| ÓÕÖZÖÒ²YÖ0| could i know what's that? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Python extension module segmentation fault

2005-10-21 Thread Robert Kern
Rolf Wester wrote: > Hi, > > I' trying to make an extension module that passes Numeric arrays. The > wrapper function is (swig generated and modified by myself): > > static PyObject *_wrap_my_func(PyObject *self, PyObject *args) { > PyObject * resultobj = 0 ; > PyObject * obj0 = 0 ; >

RE: python and outlook

2005-10-21 Thread Tim Golden
[dt] > Are there any links or sites on how to read outlook mail boxes or address book? Easiest thing to probably to automate the Outlook COM object or a MAPI Session for CDO access. You can do this easily with the pywin32 extensions. http://pywin32.sf.net You can then use pretty much any publis

Should i pick up Numeric, Numarray or SciPy.core?

2005-10-21 Thread jelle
#No rant intended I'm not at all confused wether I should learn an one of the advanced array modules, I'm slightly confused over which I should pick up. I'm impressed with the efforts of SciPy and Scientific, but since I'm fairly new to programming & OO, choosing Numarray over Numeric hasnt been t

Re: Python vs Ruby

2005-10-21 Thread Torsten Bronger
Hallöchen! "Harald Armin Massa" <[EMAIL PROTECTED]> writes: > Casey, > >> I have heard, but have not been able to verify that if a program is >> about >> 10,000 lines in C++ >> it is about >> 5,000 lines in Java >> and it is about >> 3,000 lines in Python (Ruby to?) > > BTW: it is normally only

Request to mailing list Lesstif rejected

2005-10-21 Thread lesstif-admin
Your request to the Lesstif mailing list Posting of your message titled "hello" has been rejected by the list moderator. The moderator gave the following reason for rejecting your request: "Non-members are not allowed to post messages to this list." Any questions or comments should be dire

Re: Python extension module segmentation fault

2005-10-21 Thread Rolf Wester
Robert Kern wrote: > > > Did you call import_array() in init_mytest()? > No I didn't. Thank you very much for your help. Now it works. With kind regards Rolf Wester -- http://mail.python.org/mailman/listinfo/python-list

Re: Should i pick up Numeric, Numarray or SciPy.core?

2005-10-21 Thread Robert Kern
jelle wrote: > #No rant intended > > I'm not at all confused wether I should learn an one of the advanced > array modules, I'm slightly confused over which I should pick up. I'm > impressed with the efforts of SciPy and Scientific, but since I'm > fairly new to programming & OO, choosing Numarray

Re: A macro editor

2005-10-21 Thread bruno modulix
Tom Anderson wrote: > On Thu, 20 Oct 2005, Diez B. Roggisch wrote: > >> So - _I_ think the better user-experience comes froma well-working >> easy to use REPL to quickly give the scripts a try. > > > I'd agree with that. Which is better, a difficult language with lots of > fancy tools to help yo

do cc list from smtplib

2005-10-21 Thread eight02645999
hi i have email code: def email(HOST,FROM,TO,SUBJECT,BODY): import smtplib import string, sys body = string.join(( "From: %s" % FROM, "To: %s" % TO, "Subject: %s" % SUBJECT, "", BODY), "\r\n") print body server = smtplib.SMTP(HOST) server.sendmail(FR

Re: do cc list from smtplib

2005-10-21 Thread Tim Williams (gmail)
On 21 Oct 2005 02:34:40 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> > > def email(HOST,FROM,TO,CC,SUBJECT,BODY): > import smtplib > import string, sys > body = string.join(( > "From: %s" % FROM, > "To: %s" % TO, > "CC: %s % CC, > "Subject: %s" % SUBJECT, > "", >

Re: do cc list from smtplib

2005-10-21 Thread Steve Holden
Tim Williams (gmail) wrote: > On 21 Oct 2005 02:34:40 -0700, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> > >>def email(HOST,FROM,TO,CC,SUBJECT,BODY): >>import smtplib >>import string, sys > > >>body = string.join(( >>"From: %s" % FROM, >>"To: %s" % TO, >>"CC: %s % CC, >>"

Re: do cc list from smtplib

2005-10-21 Thread Tim Williams (gmail)
On 21/10/05, Steve Holden <[EMAIL PROTECTED]> wrote: > > Assuming that TO and CC are single addresses it would be saner to use: > :) Assuming that the envelope TOs (inc CCs) are the same as the Header-TOs and Header-CCs Actually, I think this would be safer ! > def email(HOST,FROM,TO,CC, RECI

Re: do cc list from smtplib

2005-10-21 Thread Bean
Tim Williams (gmail) wrote: > On 21 Oct 2005 02:34:40 -0700, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> > > > > def email(HOST,FROM,TO,CC,SUBJECT,BODY): > > import smtplib > > import string, sys > > > body = string.join(( > > "From: %s" % FROM, > > "To: %s" % TO, > > "CC: %s %

Re: How to get a raised exception from other thread

2005-10-21 Thread Peter Hansen
dcrespo wrote: > Ok, sorry about the above question. I solved it adding this to the main > thread: > > try: > SrvrTCP = module.ThreadedTCPServer(ip,port) > SrvrTCP.start() > except Exception, description: > MsgBox(self,"TCPServer > Error:\n\n"+str(description),title="TCPServer",style=w

Re: classmethods, class variables and subclassing

2005-10-21 Thread Andrew Jaffe
Steve Holden wrote: > Andrew Jaffe wrote: > >>The problem is that I actually do want to call these methods on the >>class itself, before I've made any instances. >> > Except you could use staticmethods with an explicit class argument ... Steve, Yep, that would work! Thanks. But it does seem li

Re: Python vs Ruby

2005-10-21 Thread Tom Anderson
On Thu, 20 Oct 2005, Mike Meyer wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > >> other than haskell and SQL, the others are more or less the same to me >> so getting familiar with them is not too difficult. > > There are actually lots of good "train your brain" type languages. > Mem

Re: Set an environment variable

2005-10-21 Thread Christian
Steve Holden wrote: > :: > one.py > :: > import os > os.environ['STEVE'] = "You are the man" > os.system("python two.py") > print "Ran one" > :: > two.py > :: > import os > print "STEVE is", os.environ['STEVE'] > print "Ran two" > [EMAIL PROTECTED] t

Re: classmethods, class variables and subclassing

2005-10-21 Thread Steve Holden
Andrew Jaffe wrote: > Steve Holden wrote: > >>Andrew Jaffe wrote: >> >> >>>The problem is that I actually do want to call these methods on the >>>class itself, before I've made any instances. >>> >> >>Except you could use staticmethods with an explicit class argument ... > > > Steve, > > Yep,

pushing python to multiple windows machines

2005-10-21 Thread [EMAIL PROTECTED]
I am working on a project that requires python to be installed on a large number of windows servers and was wondering if anyone has found a method to do this. I found the article from 2003, but nobody ever stated that they have found an option for this. http://groups.google.com/group/comp.lang.py

Re: Set an environment variable

2005-10-21 Thread Steve Holden
Christian wrote: > Steve Holden wrote: > > >>:: >>one.py >>:: >>import os >>os.environ['STEVE'] = "You are the man" >>os.system("python two.py") >>print "Ran one" >>:: >>two.py >>:: >>import os >>print "STEVE is", os.environ['STEVE'] >>print "Ran tw

Re: TK question

2005-10-21 Thread jepler
In the FileDialog module there are both LoadFileDialog and SaveFileDialog. Is the latter what you want? Jeff pgptzMbfYw5VI.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

RE: pushing python to multiple windows machines

2005-10-21 Thread Tim Golden
[EMAIL PROTECTED] > I am working on a project that requires python to be installed on a large > number of windows servers and was wondering if anyone has found a method > to do this. I found the article from 2003, but nobody ever stated that > they have found an option for this. I'm not quite

Re: Python vs Ruby

2005-10-21 Thread Alex Stapleton
On 21 Oct 2005, at 09:31, Harald Armin Massa wrote: > Casey, > > > >> I have heard, but have not been able to verify that if a program is >> about >> 10,000 lines in C++ >> it is about >> 5,000 lines in Java >> and it is about >> 3,000 lines in Python (Ruby to?) >> > > BTW: it is normally only 50

Re: Python vs Ruby

2005-10-21 Thread bruno modulix
Amol Vaidya wrote: > "Casey Hawthorne" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>What languages do you know already? >> >>What computer science concepts do you know? >> >>What computer programming concepts do you know? >> >> >>Have you heard of Scheme? >> >> >>Ruby is a bi

Embedded Python - Sharing memory among scripts, threads

2005-10-21 Thread adsheehan
Hi, I have a multi-threaded C++ software app that embeds Python. When multi-threading (native system threads) it is possible that multiple instances of a Python script are active. I have a requirement to 'share' some data values between these script instances (e.g. counters, file handles etc).

Re: ANN: Beginning Python (Practical Python 2.0)

2005-10-21 Thread Magnus Lie Hetland
In article <[EMAIL PROTECTED]>, Dennis Lee Bieber wrote: [snip] > > Must be printed on thinner paper... Both run around 600 pages, but > the older book is a third thicker... Heh. Yeah. The new book has more material, too (new chapters, among other things), so I guess the new layout also has an ef

Looking for client+server sample code (httplib and/or urlib)

2005-10-21 Thread Philippe C. Martin
Hi, Are there such samples/tutorial out there ? Regards, Philippe -- http://mail.python.org/mailman/listinfo/python-list

Re: Set an environment variable

2005-10-21 Thread Christian
Steve Holden wrote: > Time you answered your own questions by trying things at the interactive > interpreter prompt! > > regards > Steve Right again, Steve. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs Ruby

2005-10-21 Thread Michael Ekstrand
On Friday 21 October 2005 07:07, bruno modulix wrote: > >>Python is more like Java. > > > Err... Python is more like what Java would have been if Java was a > smart dynamic hi-level object oriented language !-) > +1. Python is easily applicable to most of the problem domain of Java, but solves

Re: ANN: Beginning Python (Practical Python 2.0)

2005-10-21 Thread Kent Johnson
Magnus Lie Hetland wrote: > I guess it has actually been out for a while -- I just haven't > received my copies yet... Anyways: My book, "Beginning Python: From > Novice to Professional" (Apress, 2005) is now out. Apress is offering a $10 rebate if you purchase the book before October 30. See for

Re: http/urlib pos/get question (newbie)

2005-10-21 Thread Philippe C. Martin
I have found what I needed ... in one of my books :E) regards, Philippe Philippe C. Martin wrote: > Hi, > (I am _very_ new to web programming) > > I am writing a client module (browser plugin) and server module (Python > CGI) that need to exchange information. > > I want the transaction to be

Re: Looking for client+server sample code (httplib and/or urlib)

2005-10-21 Thread Philippe C. Martin
I have found what I needed ... in one of my books :E) Philippe Philippe C. Martin wrote: > Hi, > > Are there such samples/tutorial out there ? > > Regards, > > Philippe -- http://mail.python.org/mailman/listinfo/python-list

Re: pushing python to multiple windows machines

2005-10-21 Thread [EMAIL PROTECTED]
hey tim - Thanks for you input. I'm looking at it from the Windows perspective of needing to push a python interpreter out to multiple machines. I'll check out Moveable Python as you suggested. thanks -shawn -- http://mail.python.org/mailman/listinfo/python-list

wanna stop by my homemade glory hole?

2005-10-21 Thread kevin
hi there where are u plz -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Beginning Python (Practical Python 2.0)

2005-10-21 Thread Jaime Wyant
Also, if any of you guys aren't listening to Ron's Python411 podcast, you're missing out on a quality podcast about Python. While not necessarily `hardcore python' material, Ron does touch on various things happening in the community along with discussion about nifty python packages / modules that

gnuplot stdout & python question

2005-10-21 Thread bwaha
I've posted this question to comp.graphics.apps.gnuplot too but given that this python group may also comprise a lot of gnuplot users, and is far more active, I've posted this question here too. My apologies to those who read this twice. I posted to cgag before I decided to post here with a more me

Re: pushing python to multiple windows machines

2005-10-21 Thread Larry Bates
Do you really need to install the interpreter or do you want to install a Python application to a bunch of servers? Using a combination of py2exe and InnoInstaller I push applications (and services, and COM objects) to lots of Windows servers just as normal setup.exe files which can be distributed

Re: Converting 2bit hex representation to integer ?

2005-10-21 Thread Peter Hansen
Madhusudan Singh wrote: > I just tried > > n=str(x) > print struct.unpack("b",n) > > I get (51,) > > What is the deal with the parenthesis > and the comma ? If you really don't know what the parentheses and comma mean in the above output, I would suggest that you need to go back a step and wa

Re: pushing python to multiple windows machines

2005-10-21 Thread Roger Upole
<[EMAIL PROTECTED]> wrote: >I am working on a project that requires python to be installed on a > large number of windows servers and was wondering if anyone has found a > method to do this. I found the article from 2003, but nobody ever > stated that they have found an option for this. > > http:/

Re: Python vs Ruby

2005-10-21 Thread Sion Arrowsmith
bruno modulix <[EMAIL PROTECTED]> wrote: >> "Casey Hawthorne" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >>>I have heard, but have not been able to verify that if a program is >>>about >>>10,000 lines in C++ >>>it is about >>>5,000 lines in Java >>>and it is about >>>3,000 lin

Re: classmethods, class variables and subclassing

2005-10-21 Thread Andrew Jaffe
Steve Holden wrote: > Andrew Jaffe wrote: >> Steve Holden wrote: >>> Andrew Jaffe wrote: >>> The problem is that I actually do want to call these methods on the class itself, before I've made any instances. >>> Except you could use staticmethods with an explicit class argument ... >

Re: finding a number...

2005-10-21 Thread Martin Blume
"Enrique Palomo Jiménez" > > After ftp a file from mvs to windows, i find: > is an offset, so up to 2GB, a commercial application > drives crazy > [...] > ??? I didn't understand your question, but 2 GB is popular limit for the maximal size of a file for some filesystems (e.g. ext2, FAT [???]). Ma

Re: Python vs Ruby

2005-10-21 Thread vdrab
You can tell everything is well in the world of dynamic languages when someone posts a question with nuclear flame war potential like "python vs. ruby" and after a while people go off singing hymns about the beauty of Scheme... I love this place. v. -- http://mail.python.org/mailman/listinfo/pyt

win32 process information, using win32 extension

2005-10-21 Thread Java and Swing
i need to get information about the processes running on a windows pc (98, 2k, xp) i can get the pid's using, win32process.EnumProcesses()...and I can get a handle on a process using an id..such as handle = win32api.OpenProcess(win32con.PROCESS_QUERY_INFORMATION, 0, pids[0]) ..but how can i get

Psycopg2 date problems: "Can't adapt"

2005-10-21 Thread Steve Holden
I'm trying to copy data from an Access database to PostgreSQL, as the latter now appears to work well in the Windows environment. However I'm having trouble with date columns. The PostgreSQL table receiving the data has the following definition: CREATE TABLE Lines ( LinID SERIAL PRIMARY KEY,

RE: win32 process information, using win32 extension

2005-10-21 Thread Tim Golden
[Java and Swing] > i need to get information about the processes > running on a windows pc (98, 2k, xp) > i can get the pid's using, win32process.EnumProcesses() > but how can i get the name of the process, path > to process, etc. You can probably do what you want with WMI. You'll have to make

Re: Psycopg2 date problems: "Can't adapt"

2005-10-21 Thread [EMAIL PROTECTED]
Is "None" a valid value for SQL ? Or should it be NULL ? May be it is because your input is NULL which is being converted to None in python but haven't been converted back to NULL on its way out. Steve Holden wrote: > I'm trying to copy data from an Access database to PostgreSQL, as the > latter n

Re: Accessing a dll from Python

2005-10-21 Thread Grant Edwards
On 2005-10-20, dcrespo <[EMAIL PROTECTED]> wrote: > Can someone give me lights on how can I deal with dlls from python? Use the ctypes module. > My main purpose is to get access to a Unitech PT600 Bar Code system. I > have the dll that works fine through Visual Basic. But I'm migrating to > Pyth

Re: Set an environment variable

2005-10-21 Thread Grant Edwards
On 2005-10-21, Christian <[EMAIL PROTECTED]> wrote: >> >> The closest thing you can do is that: >> >> -myScript.py-- >> print 'export MY_VARIABLE=value' >> -- >> >> -myScript.sh---

Re: python and outlook

2005-10-21 Thread skip
dt> Are there any links or sites on how to read outlook mail boxes or dt> address book? Check the Outlook plugin code in SpamBayes . Skip -- http://mail.python.org/mailman/listinfo/python-list

Compile C program -> .pyc file

2005-10-21 Thread Ernesto
Is there a way to compile a C program into a .pyc file that has the same behavior as the compiled C program? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing a dll from Python

2005-10-21 Thread Simon Brunning
On 21/10/05, Grant Edwards <[EMAIL PROTECTED]> wrote: > Sorry, I've no clue about anything VB-related unless it's > Victoria Bitter. +1 QOTW. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Execute C code through Python

2005-10-21 Thread Ernesto
Thanks. Can anyone provide an example of using *subprocess* to run helloWorld.C through the python interpreter. -- http://mail.python.org/mailman/listinfo/python-list

Re: classmethods, class variables and subclassing

2005-10-21 Thread Steve Holden
Andrew Jaffe wrote: > Steve Holden wrote: > >>Andrew Jaffe wrote: >> >>>Steve Holden wrote: >>> Andrew Jaffe wrote: >The problem is that I actually do want to call these methods on the >class itself, before I've made any instances. > Except you could use staticm

HELP! py2exe error - No module named decimal

2005-10-21 Thread Chris
I've just completed a project using the following (Windows XP, python 2.4.1, wxpython 2.6, and pymssql 0.7.3). The program runs great, but after I convert it to an exe (required for this project), it gives me the following error when I try to run it. Traceback (most recent call last): File "E

Re: Compile C program -> .pyc file

2005-10-21 Thread Steve Holden
Ernesto wrote: > Is there a way to compile a C program into a .pyc file that has the > same behavior as the compiled C program? > > Thanks! > Here's a start: http://codespeak.net/pipermail/pypy-dev/2003q1/000198.html regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holde

Re: Psycopg2 date problems: "Can't adapt"

2005-10-21 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Steve Holden wrote: > >>I'm trying to copy data from an Access database to PostgreSQL, as the >>latter now appears to work well in the Windows environment. However I'm >>having trouble with date columns. >> >>The PostgreSQL table receiving the data has the following defi

RE: get a copy of a string leaving original intact

2005-10-21 Thread Bell, Kevin
I ended up slicing my string into a new one, rather than trying to have a copy of the string to alter in one case, or leave intact in another case. Thanks for the pointer on concatenating paths! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fredrik L

Re: classmethods, class variables and subclassing

2005-10-21 Thread Steve Holden
Steve Holden wrote: [...] > > I think so. It's not normal adive, but it sounds like a metaclass might > be what you need here. > ^adive^advice^ spell-me-own-name-wrong-next-ly y'rs - evest -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb

Re: Execute C code through Python

2005-10-21 Thread Fredrik Lundh
"Ernesto" wrote: > Thanks. Can anyone provide an example of using *subprocess* to run > helloWorld.C through the python interpreter. compile helloWorld, and run: import subprocess subprocess.call("helloWorld") (any special reason why you couldn't figure this out yourself, given the exa

Re: Compile C program -> .pyc file

2005-10-21 Thread Fredrik Lundh
"Ernesto" wrote: > Is there a way to compile a C program into a .pyc file that has the > same behavior as the compiled C program? unless you find a C->Python compiler, no. PYC files contain Python bytecode, C compilers usually generate native code for a given machine platform. -- http://m

Re: Compile C program -> .pyc file

2005-10-21 Thread Ernesto
Fredrik Lundh wrote: > "Ernesto" wrote: > > > Is there a way to compile a C program into a .pyc file that has the > > same behavior as the compiled C program? > > unless you find a C->Python compiler, no. PYC files contain Python bytecode, > C compilers usually generate native code for a given ma

Re: Compile C program -> .pyc file

2005-10-21 Thread Fredrik Lundh
Steve Holden wrote: > Here's a start: > > http://codespeak.net/pipermail/pypy-dev/2003q1/000198.html if anyone could turn ideas that only exist in Christian's brain into working systems, the world would look a lot different. -- http://mail.python.org/mailman/listinfo/python-list

coloring a complex number

2005-10-21 Thread Arthur
Spending the morning avoiding responsibilities, and seeing what it would take to color some complex numbers. class color_complex(complex): def __init__(self,*args,**kws): complex.__init__(*args) self.color=kws.get('color', 'BLUE') >>> a=color_complex(1,

Re: Execute C code through Python

2005-10-21 Thread Grant Edwards
On 2005-10-21, Ernesto <[EMAIL PROTECTED]> wrote: > Thanks. Can anyone provide an example of using *subprocess* to run > helloWorld.C through the python interpreter. No. You can't run a .C file. You can run a .exe file (I'm guessing you're using Windows based on the question). -- Grant Edwa

Re: HELP! py2exe error - No module named decimal

2005-10-21 Thread Larry Bates
FYI there is a separate newsgroup for py2exe at gmane.comp.python.py2exe. You may want to post there also. Just as a suggestion, put an import decimal at the top of your program. It looks like _mssql might be doing dynamic imports in __load method which will "confuse" py2exe because it can't kno

findwindow by its class name

2005-10-21 Thread James Hu
Hi, For the simple code: from wxPython.wx import * class MyApp(wxApp): def OnInit(self): frame = wxFrame(NULL, -1, "Hello App") frame.Show(true) self.SetTopWindow(frame) return true app = MyApp(0) app.MainLoop() Is there any way to know this windows' class

Re: Compile C program -> .pyc file

2005-10-21 Thread Grant Edwards
On 2005-10-21, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > >> Is there a way to compile a C program into a .pyc file that >> has the same behavior as the compiled C program? > > unless you find a C->Python compiler, no. Or a C->Python-byte-code compiler. > PYC files contain Python bytecode, C comp

Re: Execute C code through Python

2005-10-21 Thread Micah Elliott
On Oct 21, Grant Edwards wrote: > I'm guessing you're using Windows based on the question. +1 QOTW. -- _ _ ___ |V|icah |- lliott http://micah.elliott.name [EMAIL PROTECTED] " " """ -- http://mail.python.org/mailman/listinfo/python-list

ANN: Veusz 0.8 released

2005-10-21 Thread Jeremy Sanders
Veusz 0.8 - Velvet Ember Under Sky Zenith - http://home.gna.org/veusz/ Veusz is Copyright (C) 2003-2005 Jeremy Sanders <[EMAIL PROTECTED]> Licenced under the GPL (version 2 or greater) Veusz is a scientific plotting package written in Python (currently 100% P

Re: Execute C code through Python

2005-10-21 Thread Grant Edwards
On 2005-10-21, Micah Elliott <[EMAIL PROTECTED]> wrote: > On Oct 21, Grant Edwards wrote: >> I'm guessing you're using Windows based on the question. > > +1 QOTW. Yow! That's two in one day, what do I win? -- Grant Edwards grante Yow! I'll take ROAST BEEF

Re: Execute C code through Python

2005-10-21 Thread Steve Holden
Grant Edwards wrote: > On 2005-10-21, Micah Elliott <[EMAIL PROTECTED]> wrote: > >>On Oct 21, Grant Edwards wrote: >> >>>I'm guessing you're using Windows based on the question. >> >>+1 QOTW. > > > Yow! That's two in one day, what do I win? > If my experience is anything to go by it just means

Re: DBM scalability

2005-10-21 Thread Paul Rubin
"George Sakkis" <[EMAIL PROTECTED]> writes: > I'm trying to create a dbm database with around 4.5 million entries > but the existing dbm modules (dbhash, gdbm) don't seem to cut > it. What happens is that the more entries are added, the more time > per new entry is required, so the complexity seems

Re: need some advice on x y plot

2005-10-21 Thread nephish
ok, i tried something similar to what you posted. a little simpler though. i am running a query on a database and making a list of time, value pairs kinda like this plot_points = ([time, value], [time, value], [time, value]) gnuplot complains that it needs a float for one of the values. i can plot

Binding a variable?

2005-10-21 Thread Paul Dale
Hi everyone, Is it possible to bind a list member or variable to a variable such that temp = 5 list = [ temp ] temp == 6 list would show list = [ 6 ] Thanks in advance? Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: pushing python to multiple windows machines

2005-10-21 Thread [EMAIL PROTECTED]
Thanks Roger & Larry. Both of your suggestions are very helpful! -shawn -- http://mail.python.org/mailman/listinfo/python-list

Re: findwindow by its class name

2005-10-21 Thread Steve Holden
James Hu wrote: > Hi, > > For the simple code: > > from wxPython.wx import * > > class MyApp(wxApp): > def OnInit(self): > frame = wxFrame(NULL, -1, "Hello App") > frame.Show(true) > self.SetTopWindow(frame) > return true > > app = MyApp(0) > app.MainLoop()

Help with language, dev tool selection

2005-10-21 Thread vasilijepetkovic
I have a problem that I have to solve programmatically and since HTML is pretty much the only code I have been exposed to I need an advice on how to develop the programmatic solution to the problem I have. In the nutshell, it'd be great if you can give me guidance in terms of: 1) What progra

Re: Set an environment variable

2005-10-21 Thread Mike Meyer
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2005-10-21, Christian <[EMAIL PROTECTED]> wrote: >>> >>> The closest thing you can do is that: >>> >>> -myScript.py-- >>> print 'export MY_VARIABLE=value' >>> -- >>>

Re: Binding a variable?

2005-10-21 Thread [EMAIL PROTECTED]
I think not. temp is a name, not a variable. I believe temp=5 means it points to an immutable object 5. temp=6 means now it points to another immutable object 6. list=[temp] would resolve to whatever object temp is pointed to at that moment. You can try temp=[1]. Paul Dale wrote: > Hi everyone, >

Re: Binding a variable?

2005-10-21 Thread Kent Johnson
Paul Dale wrote: > > Hi everyone, > > Is it possible to bind a list member or variable to a variable such that No, Python variables don't work that way. > > temp = 5 The name 'temp' is now bound to the integer 5. Think of temp as a pointer to an integer object with value 5. > > list = [ temp

  1   2   3   >