Re: Just Getting Started with Python on MS XP Pro

2007-01-05 Thread Grant Edwards
On 2007-01-06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > The only real XP drawback is that Python is not bundled on > Windows, while it is included with OS X and most (all?) Linux > distros. While it's true that Microsoft doesn't bundle Python with Windows, a _lot_ of XP computers do come wi

Re: Just Getting Started with Python on MS XP Pro

2007-01-05 Thread DouhetSukd
Wise choice + welcome to the club. Though Python is open source and well appreciated on Linux, I think you will find that most people in this newsgroup will be fairly courteous about _your_ choice of platform. Some will not know about the weird process forking stuff on windows and helpfully sugge

Re: Memoization in Python

2007-01-05 Thread Alec Mihailovs
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote > > Nice. There is already a memoize decorator in the Python wiki: > http://wiki.python.org/moin/PythonDecoratorLibrary, you can get some ideas > from there. Using the functools module (2.5) or the decorator module by M. > Simoniato (http://www.phyas

Re: I will be proposing this PEP

2007-01-05 Thread Terry Reedy
"Collin Stocks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Attached is a PEP which I will be proposing soon. If you have any questions, | comments, or suggestions, please email them to me with the subject "Adding | Built-in Class Attributes PEP" I believe that properties wer

Re: What is proper way to require a method to be overridden?

2007-01-05 Thread [EMAIL PROTECTED]
Patrick Down wrote: > jeremito wrote: > > I am writing a class that is intended to be subclassed. What is the > > proper way to indicate that a sub class must override a method? > > > > Thanks, > > Jeremy > > Decorators to the rescue? > > def must_override(f): > def t(*args): > raise N

Re: attribute decorators

2007-01-05 Thread Gert Cuykens
sorry for repost i just found out the news group comp.lang.python is the same as python-list@python.org :) On 5 Jan 2007 20:34:54 -0800, gert <[EMAIL PROTECTED]> wrote: > Would it not be nice if you could assign decorators to attributes too ? > for example > > class C: > @staticattribute > dat

Re: Learning to program in Python

2007-01-05 Thread Paul Watson
jbchua wrote: > Hello everybody. > > I am an Electrical Engineering major and have dabbled in several > languages such as Python, C, and Java in my spare time because of my > interest in programming. However, I have not done any practical > programming because I have no idea where to get started.

Pausing for Python Interpreter error messages...

2007-01-05 Thread redefined . horizons
I've written a few classes that I have been testing in IDLE. However, every time I make a change to the classes based on the testing I have to walk through all he steps of preparing the classes for testing again. So I wrote a script that does all the set-up work for me. The only problem is when I

attribute decorators

2007-01-05 Thread gert
Would it not be nice if you could assign decorators to attributes too ? for example class C: @staticattribute data='hello' or class C: @privateattribute data='hello' -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding a directory to the Python System Path - Edit the registry?

2007-01-05 Thread redefined . horizons
Thanks Martin. I'll take a look at the documentation you pointed out. Scott Martin P. Hellwig wrote: > [EMAIL PROTECTED] wrote: > > I have been trying to find a way to add a directory to Python's sytem > > path on my MS Windows XP computer. I did some searching online, but the > > only solution

Re: Newbie XML SAX Parsing: How do I ignore an invalid token?

2007-01-05 Thread scott
My original posting has a funky line break character (it appears as an ascii square) that blows up my program, but it may or may not show up when you view my message. I was afraid to use element tree, since my xml files can be very long, and I was concerned about using memory structures to hold al

Re: File Closing Problem in 2.3 and 2.4, Not in 2.5

2007-01-05 Thread Martin v. Löwis
Carroll, Barry schrieb: > What I want to know is: > > * has anyone else encountered a problem like this, * how was the > problem corrected, * can the fix be retro-fitted to 2.5 and 2.4? >From your description, I suspect an error in your code. Your description indicates that you don't expect to ha

Re: (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-05 Thread Steven Bethard
Stef Mientki wrote: > Not sure I wrote the subject line correct, > but the examples might explain if not clear [snip] > class pin2: > def __init__ (self, naam): > self.Name = naam > > aap2 = pin2('aap2') # seems completely redundant to me. > print aap2.Name You can use class statements

Re: Dividing integers...Convert to float first?

2007-01-05 Thread Dan Bishop
On Jan 5, 11:47 am, Thomas Ploch <[EMAIL PROTECTED]> wrote: > Jonathan Smith schrieb: > > > Thomas Ploch wrote: > >> [EMAIL PROTECTED] schrieb: > >>> I'm still pretty new to Python. I'm writing a function that accepts > >>> thre integers as arguments. I need to divide the first integer by te > >>>

Re: Dividing integers...Convert to float first?

2007-01-05 Thread Beliavsky
Thomas Ploch wrote: > Jonathan Smith schrieb: > > Thomas Ploch wrote: > >> [EMAIL PROTECTED] schrieb: > >>> I'm still pretty new to Python. I'm writing a function that accepts > >>> thre integers as arguments. I need to divide the first integer by te > >>> second integer, and get a float as a resu

File Closing Problem in 2.3 and 2.4, Not in 2.5

2007-01-05 Thread Carroll, Barry
Greetings: Please forgive me if this is the wrong place for this post. I couldn't find a more acceptable forum. If there is one, please point me in the right direction. I am part of a small team writing a table-driven automated testing framework for embedded software. The tables, which co

Re: (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-05 Thread Carl Banks
Martin Miller wrote: > ### non-redundant example ### > import sys > > class Pin: > def __init__(self, name, namespace=None): > self.name = name > if namespace == None: > # default to caller's globals > namespace = sys._getframe(1).f_globals > nam

RE: What is proper way to require a method to be overridden?

2007-01-05 Thread Carroll, Barry
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Fuzzyman > Sent: Friday, January 05, 2007 4:05 PM > To: python-list@python.org > Subject: Re: What is proper way to require a method to be overridden? > > > Carl Banks wrote: > > jeremito wrote

Re: What is proper way to require a method to be overridden?

2007-01-05 Thread Carl Banks
Fuzzyman wrote: > Carl Banks wrote: > > jeremito wrote: > > > I am writing a class that is intended to be subclassed. What is the > > > proper way to indicate that a sub class must override a method? > > > > You can't (easily). > > > > Well... > > How about not defining it on the base class, but

Re: How to get file name on a remote server with ftplib?

2007-01-05 Thread Stefan Schwarzer
On 2007-01-05 16:10, [EMAIL PROTECTED] wrote: > alex wrote: >> My script is trying to get a file from a remote server, every day it >> ftps from a directory. My code works perfect if I know the name of the >> file in the remote directory. >> >> ftp.retrbinary('RETR ' + filename, handleDownload) >>

Re: PyType_IsSubtype ()

2007-01-05 Thread Robert Kern
Sheldon wrote: > I ran the program in GDB and it crashed giving the following backtrace: > > #0 0x4008376e in PyType_IsSubtype () from /usr/lib/libpython2.3.so.1.0 > #1 0x4047730c in ?? () from > /usr/lib/python2.3/site-packages/Numeric/_numpy.so > #2 0x00f2 in ?? () > #3 0x08d9dd34 in ??

Re: PyType_IsSubtype ()

2007-01-05 Thread Martin v. Löwis
Sheldon schrieb: > I ran the program in GDB and it crashed giving the following backtrace: > > #0 0x4008376e in PyType_IsSubtype () from /usr/lib/libpython2.3.so.1.0 > #1 0x4047730c in ?? () from > /usr/lib/python2.3/site-packages/Numeric/_numpy.so > > Can you make head or tail of this? Not ye

Doing date/time + TZ math in python

2007-01-05 Thread Joshua J. Kugler
I've read docs (datetime, time, pytz, mx.DateTime), googled, and experimented. I still don't know how to accomplish what I want to accomplish. I'm loading up a bunch of date/time data that I then need to do math on to compare it to the current date/time. I can get the current time easily enough:

Re: (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-05 Thread Martin Miller
Stef Mientki wrote: > Not sure I wrote the subject line correct, > but the examples might explain if not clear > > > *** first attempt *** > class pin: >def __init__ (self): > self.Name = 'Unknown Pin' > > aap = pin() # create an instance > aap.Name = 'aap'# set it's n

Re: What is proper way to require a method to be overridden?

2007-01-05 Thread Fuzzyman
Carl Banks wrote: > jeremito wrote: > > I am writing a class that is intended to be subclassed. What is the > > proper way to indicate that a sub class must override a method? > > You can't (easily). > Well... How about not defining it on the base class, but check in the constructor that the at

Re: What is proper way to require a method to be overridden?

2007-01-05 Thread Patrick Down
jeremito wrote: > I am writing a class that is intended to be subclassed. What is the > proper way to indicate that a sub class must override a method? > > Thanks, > Jeremy Decorators to the rescue? def must_override(f): def t(*args): raise NotImplementedError("You must override " +

Re: Encoding / decoding strings

2007-01-05 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Basically, what I am trying to do is display all comments by a > specified user on the website. As the only thing which has =always= > been used to identify users which never changes is their e-mail > addresses, this is the only thing which I can us

I will be proposing this PEP

2007-01-05 Thread Collin Stocks
Attached is a PEP which I will be proposing soon. If you have any questions, comments, or suggestions, please email them to me with the subject "Adding Built-in Class Attributes PEP" PEP: XXX Title: Adding Built-in Class Attributes Version: $Revision$ Last-Modified: $Date$ Author: Collin Stocks S

Re: Newbie XML SAX Parsing: How do I ignore an invalid token?

2007-01-05 Thread Chris Lambacher
What exactly is invalid about the XML fragment you provided? It seems to parse correctly with ElementTree: >>> from xml.etree import ElementTree as ET >>> e = ET.fromstring(""" ... ... ... Tampa ... A great city ^^ and place to live ... ... ... Clearwater ... Beautiful be

Re: A python library to convert RTF into PDF ?

2007-01-05 Thread Tom Plunket
[EMAIL PROTECTED] wrote: > First, pdflatex is too slow. Second, my templates are M$-Word doc > files, and they cannot be easily converted to tex. I have tried to > convert them to tex using OpenOffice, but the result is ugly as hell. Ok, have you tried using the PDF printers (I've used PDFfactory

Re: Dividing integers...Convert to float first?

2007-01-05 Thread Paul McGuire
"Simon Brunning" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 1/5/07, Grant Edwards <[EMAIL PROTECTED]> wrote: >>>>> from __future__ import LotteryNumbers >> File "", line 1 >>SyntaxError: future feature LotteryNumbers is not defined >> >> Damn. >> >> I guess it's

Re: program deployment

2007-01-05 Thread king kikapu
> Of course you do not distribute .cs (or .vb) files when deploying your > application, but decompilers for .NET are plenty. Same for Java. Yes, but in .Net we have some strong dotfuscators that makes reverse engineer really difficult. In any way, it is not so easy to get to the source as .py fi

Newbie XML SAX Parsing: How do I ignore an invalid token?

2007-01-05 Thread scott
I've got an XML feed from a vendor that is not well-formed, and having them change it is not an option. I'm trying to figure out how to create an error-handler that will ignore the invalid token and continue on. The file is large, so I'd prefer not to put it all in memory or save it off and strip

Re: Learning to program in Python

2007-01-05 Thread Adam
jbchua wrote: > Hello everybody. > > I am an Electrical Engineering major and have dabbled in several > languages such as Python, C, and Java in my spare time because of my > interest in programming. However, I have not done any practical > programming because I have no idea where to get started.

Re: Problem Running Working Code on Mac

2007-01-05 Thread goodepic
I got pgdb installed right, so I've got no more warnings. Otherwise the output is exactly the same as quoted above!! -- http://mail.python.org/mailman/listinfo/python-list

Re: (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-05 Thread Carl Banks
Stef Mientki wrote: > Not sure I wrote the subject line correct, > but the examples might explain if not clear > > > *** first attempt *** > class pin: >def __init__ (self): > self.Name = 'Unknown Pin' > > aap = pin() # create an instance > aap.Name = 'aap'# set it's

Re: find a .py path

2007-01-05 Thread laurent rahuel
Hi, What about : import os.path print os.path.abspath(__file__) hg a écrit : > Hi, > > Is there an easy way for a script being executed (from anywhere) to know > where is is ... something in os.path ? > > Thanks, > > hg > -- http://mail.python.org/mailman/listinfo/python-list

Re: PyGreSQL Install

2007-01-05 Thread goodepic
Awesome! I forgot that when I did switched to root I lost my PATH, where I'd put usr/local/bin ahead of /usr/bin, so "python" went to 2.5 instead of 2.3. Using python2.5 worked perfectly. Thanks!! -- http://mail.python.org/mailman/listinfo/python-list

Re: importing / loading a module / class dynamically

2007-01-05 Thread laurent rahuel
Hi, Using exec or eval ISN'T what should be done ever. When you have troubles importing you should : - Add some repository to your sys.path and/or - Use the buildin import method and/or - Use Mr Eby's Importing module (http://python.org/pypi/Importing) Regards, Laurent hg a écrit : > Hi, > >

Re: Learning to program in Python

2007-01-05 Thread Jussi Salmela
Demel, Jeff kirjoitti: > If I were you, I'd think up a project and just build it. The best way > to really learn is to do, at least for me. If you run into problems, > then you can come back and ask the group here. Believe me, I've asked > some very basic questions, and everyone's been very frie

Re: PyGreSQL Install

2007-01-05 Thread Thomas Ploch
goodepic schrieb: > I successfully installed postgresql and pygresql from source on my > MacBook 2ghz Intel core duo running os x 10.4.8. However, pygresql > installed under the defualt python 2.3 installation, while I've been > upgrading and working in 2.5, and have invested too much time to go >

Re: (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-05 Thread Jorge Vargas
On 1/5/07, Stef Mientki <[EMAIL PROTECTED]> wrote: if I undestand correctly this is what you want >>> class pin3: ... def __init__(self,name): ... self.Name = name ... def __str__(self): ... return self.Name ... >>> pin3() Traceback (most recent call last): File

Re: MySQLdb windows binaries for Python 2.5?? Yes, but from a World of Warcraft guild.

2007-01-05 Thread Jorge Vargas
On 1/5/07, Chris Mellon <[EMAIL PROTECTED]> wrote: > I guess this is your opportunity, as someone who thinks that MySQL > support for Python is important, to assist in maintaining and updating > those wrappers, right? believe me I have tried and in this particular case it's very complicated the ma

Re: MySQLdb windows binaries for Python 2.5?? Yes, but from a World of Warcraft guild.

2007-01-05 Thread Jorge Vargas
On 14 Dec 2006 16:59:15 -0800, Fuzzyman <[EMAIL PROTECTED]> wrote: > > johnf wrote: > > >> > > >> If you search the Help Forum of the MySQLdb project on SourceForge, you > > >> will find a couple of people who have successfully built MySQLdb on > > >> Windows for 2.5, and are willing to share their

Re: strange for loop construct

2007-01-05 Thread Mark Elston
* Gabriel Genellina wrote (on 1/5/2007 12:49 PM): > At Friday 5/1/2007 17:39, [EMAIL PROTECTED] wrote: > >> wordfreq = [wordlist.count(p) for p in wordlist] >> >> I would expect >> >> for p in wordlist: >> wordfreq.append(wordlist.count(p)) >> >> >> I didn't know you could have an expression i

Re: Problem Running Working Code on Mac

2007-01-05 Thread goodepic
I got rid of all the warnings but the pgdb one. I got postgresql and pygresql installed, but the pgdb installed on the base python install of python 2.3, and isn't found by my updated python 2.5 install, into which I've successfully installed the other modules I needed. Anyway, getting mysql and

PyGreSQL Install

2007-01-05 Thread goodepic
I successfully installed postgresql and pygresql from source on my MacBook 2ghz Intel core duo running os x 10.4.8. However, pygresql installed under the defualt python 2.3 installation, while I've been upgrading and working in 2.5, and have invested too much time to go back to 2.3. I definitely

RE: Learning to program in Python

2007-01-05 Thread Demel, Jeff
If I were you, I'd think up a project and just build it. The best way to really learn is to do, at least for me. If you run into problems, then you can come back and ask the group here. Believe me, I've asked some very basic questions, and everyone's been very friendly and helpful. As an EE maj

Re: (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-05 Thread Fuzzyman
Stef Mientki wrote: > Not sure I wrote the subject line correct, > but the examples might explain if not clear > > > *** first attempt *** > class pin: >def __init__ (self): > self.Name = 'Unknown Pin' > > aap = pin() # create an instance > aap.Name = 'aap'# set it's

PDF rendering toolkit?

2007-01-05 Thread Jorge Vargas
Hi I'm looking for a tool to take an actual .pdf file and display it in a window (I'm using wxwidgets at the moment) I have found several project but none seem to do what I need. http://sourceforge.net/projects/pdfplayground seems like a nice toolkit to edit pdf files with python code, but nothi

Re: strange for loop construct

2007-01-05 Thread Gabriel Genellina
At Friday 5/1/2007 17:39, [EMAIL PROTECTED] wrote: wordfreq = [wordlist.count(p) for p in wordlist] I would expect for p in wordlist: wordfreq.append(wordlist.count(p)) I didn't know you could have an expression in the same line. That's known as a "list comprehension" and is roughly eq

Re: where is Microsoft Speech Object Library 5.1 option inPythonWin 2.5?

2007-01-05 Thread Jussi Salmela
Siggi kirjoitti: > Gabriel Genellina wrote: > >> After you download and install version 5.1, it should appear on the list. > > It should, but it does not! Shutting down and starting the WinXP Home system > anew did not help. > The SDK 5.1 installation went smoothly, however. What can I do to fin

Re: Learning to program in Python

2007-01-05 Thread jbchua
John Henry wrote: > jbchua wrote: > > Hello everybody. > > > > I am an Electrical Engineering major and have dabbled in several > > languages such as Python, C, and Java in my spare time because of my > > interest in programming. However, I have not done any practical > > programming because I have

Re: Learning to program in Python

2007-01-05 Thread Bill Scherer
jbchua wrote: >Hello everybody. > >I am an Electrical Engineering major and have dabbled in several >languages such as Python, C, and Java in my spare time because of my >interest in programming. However, I have not done any practical >programming because I have no idea where to get started. I tau

strange for loop construct

2007-01-05 Thread Sardaukary
I was googling for an example of the classic word frequency program in Python as I'm just learning the language, and wanted to see how other people implemented it. I found this blog post http://digitalhistory.uwo.ca/dhh/index.php/2006/08/20/easy-pieces-in-python-word-frequencies/ (with a much more

Re: Learning to program in Python

2007-01-05 Thread John Henry
jbchua wrote: > Hello everybody. > > I am an Electrical Engineering major and have dabbled in several > languages such as Python, C, and Java in my spare time because of my > interest in programming. However, I have not done any practical > programming because I have no idea where to get started.

Learning to program in Python

2007-01-05 Thread jbchua
Hello everybody. I am an Electrical Engineering major and have dabbled in several languages such as Python, C, and Java in my spare time because of my interest in programming. However, I have not done any practical programming because I have no idea where to get started. I taught myself these lang

Re: MySQLdb windows binaries for Python 2.5?? Yes, but from a World of Warcraft guild.

2007-01-05 Thread Chris Mellon
On 1/5/07, John Nagle <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Anyone have a binary they want to share? > > > > /Martin > > > Somebody has an untested one. See > > http://sourceforge.net/forum/forum.php?thread_id=1571110&forum_id=70461 > > You have to ask for a copy; they don't wa

Re: MySQLdb windows binaries for Python 2.5?? Yes, but from a World of Warcraft guild.

2007-01-05 Thread John Nagle
[EMAIL PROTECTED] wrote: > Anyone have a binary they want to share? > > /Martin > Somebody has an untested one. See http://sourceforge.net/forum/forum.php?thread_id=1571110&forum_id=70461 You have to ask for a copy; they don't want to distribute it and be blamed for problems. There hasn't bee

Re: (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-05 Thread Laszlo Nagy
Stef Mientki wrote: > Not sure I wrote the subject line correct, > but the examples might explain if not clear > > > *** first attempt *** > class pin: >def __init__ (self): > self.Name = 'Unknown Pin' > > aap = pin() # create an instance > aap.Name = 'aap'# set it's n

(newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-05 Thread Stef Mientki
Not sure I wrote the subject line correct, but the examples might explain if not clear *** first attempt *** class pin: def __init__ (self): self.Name = 'Unknown Pin' aap = pin() # create an instance aap.Name = 'aap'# set it's name print aap.Name # print it'

Piskworky - "five-in-row" over jabber network

2007-01-05 Thread Richard Szlachta
Readers of python mailing list of all ages and systems, I'd like to introduce you program called ' Piskworky '. It is written in python, uses tkinter gui and is made for playing game known as five-in-row. Game is pure multiplayer (two-player exactly ;) and it does it's synchronization via jabber n

Re: program deployment

2007-01-05 Thread Stephen Eilert
king kikapu wrote: > Ok, i got the point...Things are a little bit different on the other > way of the fence (Microsoft way...) and so many of Python's elements > are a little (at least) strange at first... > > But hey, thank you all! Not really! Of course you do not distribute .cs (or .vb) file

Re: What is proper way to require a method to be overridden?

2007-01-05 Thread Mark Elston
* Paddy wrote (on 1/4/2007 10:20 PM): > belinda thom wrote: > >> On Jan 4, 2007, at 9:28 PM, Carl Banks wrote: >> >>> jeremito wrote: I am writing a class that is intended to be subclassed. What is the proper way to indicate that a sub class must override a method? >>> You can't (easily

Re: where is Microsoft Speech Object Library 5.1 option inPythonWin 2.5?

2007-01-05 Thread Siggi
Gabriel Genellina wrote: > After you download and install version 5.1, it should appear on the list. It should, but it does not! Shutting down and starting the WinXP Home system anew did not help. The SDK 5.1 installation went smoothly, however. What can I do to find out what is wrong? siggi "

Re: When argparse will be in the python standard installation

2007-01-05 Thread Steven Bethard
[Thanks for looking through all these Martin!] Martin v. Löwis wrote: > Steven Bethard schrieb: >> * alias ArgumentParser to OptionParser >> * alias add_argument to add_option >> * alias Values to Namespace >> * alias OptionError and OptionValueError to ArgumentError >> * alias add_help= keyword a

Re: Undefined symbol __pure_virtual when importing MySQLdb

2007-01-05 Thread hg
[EMAIL PROTECTED] wrote: > I downloaded MySQL-python-1.2.1 from SourceForge and installed it on a > Mandrake system (Mandrake Linux 9.2 3.3.1-2mdk on linux2). > > The installation was successful. The gcc version is 3.3. > > My Python version is 2.4.2. When I import MySQLdb, I get an error > wh

Re: Encoding / decoding strings

2007-01-05 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Basically, what I am trying to do is display all comments by a > specified user on the website. As the only thing which has =always= > been used to identify users which never changes is their e-mail > addresses, this is the only thing which I can

Re: Dividing integers...Convert to float first?

2007-01-05 Thread Simon Brunning
On 1/5/07, Grant Edwards <[EMAIL PROTECTED]> wrote: >>>> from __future__ import LotteryNumbers > File "", line 1 >SyntaxError: future feature LotteryNumbers is not defined > > Damn. > > I guess it's back to work then. Remember the PEP 8 module name standards. >>> from __future__ impo

Re: wxWindows off-screen?

2007-01-05 Thread Michele Petrazzo
Ivan Voras wrote: > Is it possible to draw a widget or a window in an off-screen buffer? (Assuming that you are on linux.) wxWigets (wxWindows is the old name) or better, since if you are on a python ng, wxPython :), can't be used if you are on a not-X machine: michele:~$ env | grep DIS DISPLAY=

Re: Dividing integers...Convert to float first?

2007-01-05 Thread Thomas Ploch
Grant Edwards schrieb: > On 2007-01-05, Jonathan Smith <[EMAIL PROTECTED]> wrote: > > from __future__ import division > 1/2 >> 0.5 > >$ python >Python 2.4.3 (#1, Dec 10 2006, 22:09:09) >[GCC 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)] on linux2 >Type "help", "copyr

Re: Adding a directory to the Python System Path - Edit the registry?

2007-01-05 Thread Martin P. Hellwig
[EMAIL PROTECTED] wrote: > I have been trying to find a way to add a directory to Python's sytem > path on my MS Windows XP computer. I did some searching online, but the > only solution I found involved editing the MS Windows Registry. That > seemed a little to hard core. Is there another easier w

Re: Dividing integers...Convert to float first?

2007-01-05 Thread Thomas Ploch
Jonathan Smith schrieb: > Thomas Ploch wrote: >> [EMAIL PROTECTED] schrieb: >>> I'm still pretty new to Python. I'm writing a function that accepts >>> thre integers as arguments. I need to divide the first integer by te >>> second integer, and get a float as a result. I don't want the caller of >>

Re: MySQLdb windows binaries for Python 2.5?? Yes, but from a World of Warcraft guild.

2007-01-05 Thread [EMAIL PROTECTED]
Anyone have a binary they want to share? /Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Dividing integers...Convert to float first?

2007-01-05 Thread Grant Edwards
On 2007-01-05, Jonathan Smith <[EMAIL PROTECTED]> wrote: > >>> from __future__ import division > >>> 1/2 > 0.5 $ python Python 2.4.3 (#1, Dec 10 2006, 22:09:09) [GCC 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)] on linux2 Type "help", "copyright", "credits" or "license" for more

Re: Encoding / decoding strings

2007-01-05 Thread [EMAIL PROTECTED]
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] wrote: > > > Basically, I want to encode an email address so that it looks something > > like 8d2e23c0a835598510c88a758c6b215a - this way the user does not know > > the email address they are looking at. They are public-

Re: Dividing integers...Convert to float first?

2007-01-05 Thread Jonathan Smith
Thomas Ploch wrote: > [EMAIL PROTECTED] schrieb: >> I'm still pretty new to Python. I'm writing a function that accepts >> thre integers as arguments. I need to divide the first integer by te >> second integer, and get a float as a result. I don't want the caller of >> the function to have to pass

Re: Dividing integers...Convert to float first?

2007-01-05 Thread Thomas Ploch
[EMAIL PROTECTED] schrieb: > I'm still pretty new to Python. I'm writing a function that accepts > thre integers as arguments. I need to divide the first integer by te > second integer, and get a float as a result. I don't want the caller of > the function to have to pass floats instead of integers

Re: program deployment

2007-01-05 Thread Laszlo Nagy
> hehehe, but what I am thinking: Is it somehow possible to _really_ hide > the source from being viewed by other persons when using python? Not > that I want to do that ( I am an Open Source friend ), but that might > get others that rely on that (commercial) to use python for more > projects as

Adding a directory to the Python System Path - Edit the registry?

2007-01-05 Thread redefined . horizons
I have been trying to find a way to add a directory to Python's sytem path on my MS Windows XP computer. I did some searching online, but the only solution I found involved editing the MS Windows Registry. That seemed a little to hard core. Is there another easier way to do this? Thanks, Scott Hu

Dividing integers...Convert to float first?

2007-01-05 Thread redefined . horizons
I'm still pretty new to Python. I'm writing a function that accepts thre integers as arguments. I need to divide the first integer by te second integer, and get a float as a result. I don't want the caller of the function to have to pass floats instead of integers. How do I convert the arguments pa

Re: importing / loading a module / class dynamically

2007-01-05 Thread hg
Laszlo Nagy wrote: > >> Thanks, >> >> What I am doing is adding plugin support to PyCrust ... so I'm looking >> for a mechanism where anyone can develop a plugin and have it loaded by >> pycrust. >> >> the .py was a typo >> >> >> why the "...Have at least an empty plugin/name1/__init__.py file...

Re: importing / loading a module / class dynamically

2007-01-05 Thread Laszlo Nagy
> Thanks, > > What I am doing is adding plugin support to PyCrust ... so I'm looking for a > mechanism where anyone can develop a plugin and have it loaded by pycrust. > > the .py was a typo > > > why the "...Have at least an empty plugin/name1/__init__.py file..." ? > When you do import plug

Re: Just Getting Started with Python on MS XP Pro

2007-01-05 Thread Laszlo Nagy
W. Watson wrote: > What do I download to use Python with MX XP Pro on an ASUS 4 year old > motherboard? I would guess a good book source for starters would be the > O'Reilly book. > You mean Microsoft XP Pro? For a beginner, the motherboard does not really matter. First of all, you should do

Re: importing / loading a module / class dynamically

2007-01-05 Thread hg
Laszlo Nagy wrote: > >> .../.../../plugin/name1/name1.py >> >> .../.../../plugin/namen/namen.py >> >> >> I block at the beginning and tried this (test.py is a real file) >> > s = 'test.py' > eval ('import ' + s) > > import test.py # This is invalid > import test # Th

Re: importing / loading a module / class dynamically

2007-01-05 Thread Laszlo Nagy
hg írta: > hg wrote: > > >> Hi, >> >> I have the following problem. >> >> I find in a directory hierarchy some files following a certain sets of >> rules: >> >> .../.../../plugin/name1/name1.py >> >> .../.../../plugin/namen/namen.py >> >> each file will in turn have a class with the same na

Just Getting Started with Python on MS XP Pro

2007-01-05 Thread W. Watson
What do I download to use Python with MX XP Pro on an ASUS 4 year old motherboard? I would guess a good book source for starters would be the O'Reilly book. Wayne T. Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)

Re: importing / loading a module / class dynamically

2007-01-05 Thread hg
hg wrote: > Hi, > > I have the following problem. > > I find in a directory hierarchy some files following a certain sets of > rules: > > .../.../../plugin/name1/name1.py > > .../.../../plugin/namen/namen.py > > each file will in turn have a class with the same name as the filename > (min

Re: where is Microsoft Speech Object Library 5.1 option in PythonWin 2.5?

2007-01-05 Thread Gabriel Genellina
At Friday 5/1/2007 11:24, siggi wrote: However, in my Python 2.5/PythonWin 2.5 installation I find as only option "Microsoft Speech Object Library 5.0" to select. This list shows all the COM objects currently registered in Windows, does not depend on Pythonwin. Unfortunately, 5.1 is the lo

Re: importing / loading a module / class dynamically

2007-01-05 Thread Laszlo Nagy
> .../.../../plugin/name1/name1.py > > .../.../../plugin/namen/namen.py > > > I block at the beginning and tried this (test.py is a real file) > s = 'test.py' eval ('import ' + s) import test.py # This is invalid import test # This MAY be valid import name1.name1 #

Re: find a .py path

2007-01-05 Thread Laszlo Nagy
hg írta: > hg wrote: > > >> Hi, >> >> Is there an easy way for a script being executed (from anywhere) to know >> where is is ... something in os.path ? >> >> Thanks, >> >> hg >> > > oops: os.path.abspath(sys.argv[0]) > Be aware with this. It is different when you do /usr/bin/python pr

Re: find a .py path

2007-01-05 Thread hg
Laszlo Nagy wrote: > hg i'rta: >> Hi, >> >> Is there an easy way for a script being executed (from anywhere) to know >> where is is ... something in os.path ? >> > __file__ > > You can also use os.argv[0] but that is not the same... > > Laszlo Thanks -- http://mail.python.org/mailman/listin

importing / loading a module / class dynamically

2007-01-05 Thread hg
Hi, I have the following problem. I find in a directory hierarchy some files following a certain sets of rules: .../.../../plugin/name1/name1.py .../.../../plugin/namen/namen.py each file will in turn have a class with the same name as the filename (minus .py) I fetch those names in a li

Re: Undefined symbol __pure_virtual when importing MySQLdb

2007-01-05 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Fredrik Lundh wrote: > > [EMAIL PROTECTED] wrote: > > > > > I have googled hard, and did see someone asking the same question, but > > > haven't found a good solution to this problem. Could anyone give me a > > > hint? Thanks a lot! > > > > googling for "undefined symbo

Re: find a .py path

2007-01-05 Thread Laszlo Nagy
hg i'rta: > Hi, > > Is there an easy way for a script being executed (from anywhere) to know > where is is ... something in os.path ? > __file__ You can also use os.argv[0] but that is not the same... Laszlo -- http://mail.python.org/mailman/listinfo/python-list

Re: find a .py path

2007-01-05 Thread hg
hg wrote: > Hi, > > Is there an easy way for a script being executed (from anywhere) to know > where is is ... something in os.path ? > > Thanks, > > hg oops: os.path.abspath(sys.argv[0]) hg -- http://mail.python.org/mailman/listinfo/python-list

Re: elementtree.SimpleXMLWriter and xmlcharrefreplace

2007-01-05 Thread [EMAIL PROTECTED]
My current version of SimpeXMLWriter is: $Id: SimpleXMLWriter.py 1862 2004-06-18 07:31:02Z Fredrik $ I'm testing this on in python2.3.5 and python2.4.3. [EMAIL PROTECTED] wrote: > I'll try to explain my problem with code. > The problem is the output > > msg = u"Södertälje & Borås" # latin1 unicode

find a .py path

2007-01-05 Thread hg
Hi, Is there an easy way for a script being executed (from anywhere) to know where is is ... something in os.path ? Thanks, hg -- http://mail.python.org/mailman/listinfo/python-list

Re: program deployment

2007-01-05 Thread king kikapu
Ok, i got the point...Things are a little bit different on the other way of the fence (Microsoft way...) and so many of Python's elements are a little (at least) strange at first... But hey, thank you all! -- http://mail.python.org/mailman/listinfo/python-list

Re: program deployment

2007-01-05 Thread Michele Simionato
king kikapu wrote: > > > Are they embarassed by their code? > > hehehe...no, just worried about stealing their ideas... I believe that shipping just the bytecode is a pretty effective way to stop 99% of programmers from reading your code. Yes, in theory they could decompile it, but in practice, pr

  1   2   >