Re: Anything available that can read Microsoft .MDB files from Python?

2007-03-20 Thread Diez B. Roggisch
> >What MDBtools did you install? The RPM, a checkout from CVS, > or the downloadable distribution? They're all different. The one that comes with ubuntu edgy. Just apt-get install mdbtools or something, that's it. I don't want to start a distro war here - but I always found the RPM-b

Re: When is List Comprehension inappropriate?

2007-03-20 Thread bearophileHUGS
BJörn Lindqvist: > While they > may be faster, Psyco is great here. Also, if you have lots of 2d-loops > like "for x in something: for y in something:", then it could be more > beautiful to separate the iteration from the task: > > def iterimage(im, width, height, step = 1): > for y in range(0,

Re: Anything available that can read Microsoft .MDB files from Python?

2007-03-20 Thread Shane Geiger
Try installing it from source. Perhaps getting a newer verion is all you would need. If at that point you find there is a bug, report it. Diez B. Roggisch wrote: What MDBtools did you install? The RPM, a checkout from CVS, or the downloadable distribution? They're all different.

Re: Anything available that can read Microsoft .MDB files from Python?

2007-03-20 Thread Duncan Booth
"Terry Reedy" <[EMAIL PROTECTED]> wrote: > ><[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >| I've read .MDB files using ODBC. I don't know how big your files are, >| but I had a file with almost 3000 rows and I was able to fetch it in >| 1-2 seconds. If you want to give it whirl,

python & java

2007-03-20 Thread sandeep patil
hi i am fresher i python can any bady tell me who i will use python in web technologies in java base application. what it roll sandeep patil -- http://mail.python.org/mailman/listinfo/python-list

Re: any ways to judge whether an object is initilized or not in a class

2007-03-20 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : > On Mon, 19 Mar 2007 19:48:37 +1100, Ben Finney wrote: > >> It's also best to inherit every class from another class, leading to a >> single hierarchy for all classes and types. 'object' is the one to >> choose if you don't want the behaviour of any other class. > > Wha

Re: python & java

2007-03-20 Thread rishi pathak
See www.*jython*.org On 20 Mar 2007 02:23:07 -0700, sandeep patil <[EMAIL PROTECTED]> wrote: hi i am fresher i python can any bady tell me who i will use python in web technologies in java base application. what it roll sandeep patil -- http://mail.python.org/mailman/listinfo/python-list

Re: XML based programming language

2007-03-20 Thread stefaan
> Don't you think the lex/yacc combo is complex even in anything in > real-life? If real-life means: C++, then yes, it is impossible :) If real-life means: some domain specific language, then it is ok. >The "XML tree simplification implementations" (as Elementtree > can be considered) has other co

Re: Re: python & java

2007-03-20 Thread rishi pathak
Jython is written in pure java. You can use java classes inside python and also can use python classes inside java You can write applets too in python using jython. It converts your python code in java code. On 20 Mar 2007 10:06:00 -, sandeep patil <[EMAIL PROTECTED]> wrote: what diff be

Re: Create TarFile using string buffers

2007-03-20 Thread Gabriel Genellina
En Mon, 19 Mar 2007 21:55:30 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > Thanks. It almost works. The problem is I don't know the size of the > file until it has finished streaming. It looks like the tar file > format need the file size written at the beginning :( Yes, maybe becaus

Re: When is List Comprehension inappropriate?

2007-03-20 Thread Steve Holden
Alex Martelli wrote: > BJörn Lindqvist <[EMAIL PROTECTED]> wrote: >... >> even2 = [(pos, col) for pos, col in iterimage(im, width, height, 2)] > > list(iterimage(etc etc)) > > is surely a better way to express identical semantics. More generally, > [x for x in whatever] (whether x is a singl

Re: XML based programming language

2007-03-20 Thread Diez B. Roggisch
stefaan wrote: >> All of these are grammar-specifications that allow you to define the >> structure of your XML-documents with more constraints. > > Ok, I should have foreseen the schema checker answer...my point really > is that > yacc can do even more than just checking the conformance to a gra

Re: python & java

2007-03-20 Thread Diez B. Roggisch
sandeep patil wrote: > hi > > i am fresher i python can any bady tell me who i will use python in > web technologies in java base application. > what it roll No idea where who rolls to whom, but you should check out jython: http://www.jython.org/ Diez -- http://mail.python.org/mailman/listinf

Re: Load three different modules which have the same name

2007-03-20 Thread abcd
> Blerch! Why not just call the modules by the right names in the first > place? Then each will have its own sys.modules entry for a start ... > > regards > Steve what do i need to do? also, is there a way I can load each one as I have but each one have its own unique entry in sys.modules? For

Re: Load three different modules which have the same name

2007-03-20 Thread Gabriel Genellina
En Tue, 20 Mar 2007 07:40:53 -0300, abcd <[EMAIL PROTECTED]> escribió: >> Blerch! Why not just call the modules by the right names in the first >> place? Then each will have its own sys.modules entry for a start ... > > what do i need to do? also, is there a way I can load each one as I > have bu

Re: Displaying EPS in a GUI

2007-03-20 Thread Piet van Oostrum
> [EMAIL PROTECTED] (V) wrote: >V> Does anybody know of a good way to display Encapsulated Postscript >V> images in a GUI? I'm currently using wx, but would be perfectly >V> willing to switch to another binding to keep the program from becoming >V> hackish. You need e Postscript interpreter,

Re: Load three different modules which have the same name

2007-03-20 Thread Steve Holden
abcd wrote: >> Blerch! Why not just call the modules by the right names in the first >> place? Then each will have its own sys.modules entry for a start ... >> >> regards >> Steve > > what do i need to do? also, is there a way I can load each one as I > have but each one have its own unique ent

Re: Load three different modules which have the same name

2007-03-20 Thread Ben Finney
"abcd" <[EMAIL PROTECTED]> writes: > nevermind this took care of it: > > import sys > > def tryAllThree(): > a = "c:\\alpha" > b = "c:\\beta" > g = "c:\\gamma" > > sys.path.append(a) > import Person > alpha = Person.Person() To avoid this confusion, follow PEP 8 http://www

Re: List to string

2007-03-20 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : > On Mon, 19 Mar 2007 13:11:09 +0100, Bruno Desthuilliers wrote: > >> There's no "cast" in Python. It would make no sens in a dynamically >> typed language, where type informations belong to the LHS of a binding, >> not the RHS. > > Surely you have left and right mixed

Re: Pycron for windows - please help

2007-03-20 Thread Al
heh... didn't think about that... thanks. -- http://mail.python.org/mailman/listinfo/python-list

Bullet proof passing numeric values from NMEA data stream.

2007-03-20 Thread Doug Gray
Folks, I am looking for a fast but most importantly a bullet proof method to pass and NMEA data stream (GPS output) ascii numeric strings. The best I can offer is: def fint(a): try: return int(float(a)) except: return 0 The reason for this is the quality of the data from the huge variety of GPS

Re: any ways to judge whether an object is initilized or not in a class

2007-03-20 Thread Steven D'Aprano
On Tue, 20 Mar 2007 10:28:10 +0100, Bruno Desthuilliers wrote: [deploying weapons of mass snippage] >> Otherwise, the choice between old >> and new is not very important. > > Your opinion. Too bad you're missing some of the most powerful parts of > the language. Yes, it is my opinion, and it s

How to send

2007-03-20 Thread Admir Saric
Hi, i have created an application in pygtk. The application creates files with its own file type and extensions and saves them. I would like to extend the application to be able to send these files over WLAN. I would use the application in my Nokia 770 Internet tablet and send the files from on

Re: List to string

2007-03-20 Thread Steven D'Aprano
On Tue, 20 Mar 2007 13:01:36 +0100, Bruno Desthuilliers wrote: > Steven D'Aprano a écrit : >> On Mon, 19 Mar 2007 13:11:09 +0100, Bruno Desthuilliers wrote: >> >>> There's no "cast" in Python. It would make no sens in a dynamically >>> typed language, where type informations belong to the LHS of

Re: Load three different modules which have the same name

2007-03-20 Thread abcd
thanks for the help. -- http://mail.python.org/mailman/listinfo/python-list

Re: Eureka moments in Python

2007-03-20 Thread Doug Gray
On Tue, 13 Mar 2007 18:16:15 +1100, Steven D'Aprano wrote: > I'd be interested in hearing people's stories of Eureka moments in Python, > moments where you suddenly realise that some task which seemed like it > would be hard work was easy with Python. Mine was the discovery of the pybluez module.

Re: any ways to judge whether an object is initilized or not in a class

2007-03-20 Thread Steven D'Aprano
On Tue, 20 Mar 2007 10:28:10 +0100, Bruno Desthuilliers complained about classic classes: >> What's wrong with old-style classes? > > Almost everything. That's rather an exaggeration, don't you think? They have methods, and inheritance, and attributes, all the critical features of classes, and

Re: Bullet proof passing numeric values from NMEA data stream.

2007-03-20 Thread Steve Holden
Doug Gray wrote: > Folks, > I am looking for a fast but most importantly a bullet proof method to pass > and NMEA data stream (GPS output) ascii numeric strings. The best I can > offer is: > > def fint(a): > try: return int(float(a)) > except: return 0 > > The reason for this is the quality of

Re: Problem with sockets and python 2.5

2007-03-20 Thread Facundo Batista
Jose Alberto Reguero wrote: > 2: > server.py at x86_64 python 2.5 > client.py at i386 python 2.4 > Don't work What do you mean with "don't work"? They crash? Your machine hungs? Your house explodes? You'd be more specific in the error you get, and what behaviour you expect. Regards

How to copy a ClassObject?

2007-03-20 Thread Karlo Lozovina
Hi all, how would one make a copy of a class object? Let's say I have: class First: name = 'First' And then I write: tmp = First then 'tmp' becomes just a reference to First, so if I write tmp.name = "Tmp", there goes my First.name. So, how to make 'tmp' a copy of First, I tried using

Re: When is List Comprehension inappropriate?

2007-03-20 Thread Aahz
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: > >list(iterimage(etc etc)) > >is surely a better way to express identical semantics. More generally, >[x for x in whatever] (whether x is a single name or gets peculiarly >unpacked and repacked like here) is a good example o

Re: Still the __new__ hell ...

2007-03-20 Thread Aahz
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: >Steve Holden <[EMAIL PROTECTED]> wrote: >> >> basestring is a *type*. >> >> >>> basestring >> >> >> It's the base class of which both str and unicode are subclasses. > >I believe it used to be a tuple back in Python 2.2

How many connections can accept a 'binded' socket?

2007-03-20 Thread billiejoex
Hi, I'm writing a small asyncore-based server application serving a lot of clients. When I have to handle more than 1021 client simoultaneously the 'binded' socket object raises an error: [...] connections: 1018 connections: 1019 connections: 1020 connections: 1021 Traceback (most recent call last

Re: How many connections can accept a 'binded' socket?

2007-03-20 Thread Laurent Pointal
billiejoex a écrit : > Hi, > I'm writing a small asyncore-based server application serving a lot of > clients. When I have to handle more than 1021 client simoultaneously > the 'binded' socket object raises an error: > > [...] > connections: 1018 > connections: 1019 > connections: 1020 > connectio

Re: Bullet proof passing numeric values from NMEA data stream.

2007-03-20 Thread Steven D'Aprano
On Tue, 20 Mar 2007 12:09:29 +, Doug Gray wrote: > Folks, > I am looking for a fast but most importantly a bullet proof method to pass > and NMEA data stream (GPS output) ascii numeric strings. The best I can > offer is: > > def fint(a): > try: return int(float(a)) > except: return 0 Will

Re: How to copy a ClassObject?

2007-03-20 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Karlo Lozovina wrote: > how would one make a copy of a class object? Let's say I have: > class First: > name = 'First' > > And then I write: > tmp = First > > then 'tmp' becomes just a reference to First, so if I write > tmp.name = "Tmp", there goes my First.name

Re: How to copy a ClassObject?

2007-03-20 Thread Karlo Lozovina
Karlo Lozovina <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > how would one make a copy of a class object? Let's say I have: > class First: > name = 'First' > > And then I write: > tmp = First Silly me, posted a question without Googling first ;>. This seems to be the answer to

Re: Bullet proof passing numeric values from NMEA data stream.

2007-03-20 Thread Steven D'Aprano
On Wed, 21 Mar 2007 00:29:00 +1100, Steven D'Aprano wrote: > All your examples include spurious whitespace. If that is the only > problem, here's a simple fix: > > def despace(s): > """Remove whitespace from string s.""" > return Gah! Ignore that stub. I forgot to delete it :( While I

Re: Problem with sockets and python 2.5

2007-03-20 Thread Fabio FZero
On Mar 20, 10:05 am, Facundo Batista <[EMAIL PROTECTED]> wrote: > Jose Alberto Reguero wrote: > > 2: > >server.py at x86_64 python 2.5 > >client.py at i386 python 2.4 > > Don't work > > What do you mean with "don't work"? > > They crash? Your machine hungs? Your house explodes? Traceback (

help - Module needs access to another module

2007-03-20 Thread abcd
I have the following directory/file structure... c:\foo\utils.py c:\foo\bar\ok.py In ok.py I want to do something like... import utils utils.helpMeDoSomething() However, it seems that ok.py doesn't "know" about utils. Other than manually configuring sys.path what can I do? thanks -- htt

Re: Bullet proof passing numeric values from NMEA data stream.

2007-03-20 Thread Doug Gray
On Wed, 21 Mar 2007 00:29:00 +1100, Steven D'Aprano wrote: > On Tue, 20 Mar 2007 12:09:29 +, Doug Gray wrote: > >> Folks, >> I am looking for a fast but most importantly a bullet proof method to pass >> and NMEA data stream (GPS output) ascii numeric strings. The best I can >> offer is: >> >

Re: help - Module needs access to another module

2007-03-20 Thread Diez B. Roggisch
abcd wrote: > I have the following directory/file structure... > > c:\foo\utils.py > c:\foo\bar\ok.py > > In ok.py I want to do something like... > > import utils > utils.helpMeDoSomething() > > However, it seems that ok.py doesn't "know" about utils. Other than > manually configuring sys

Re: How to copy a ClassObject?

2007-03-20 Thread Peter Otten
Karlo Lozovina wrote: > Yes, I can do a: >   class tmp(First): >   pass > > but I'd rather make a copy than a subclass. > tmp = new.classobj('tmp', (First,), {}) That line creates a subclass just as the simpler approach you gave above. Peter -- http://mail.python.org/mailman/listinfo/py

Re: python QT or python-GTK

2007-03-20 Thread Christophe
Dennis Lee Bieber a écrit : > Not enough experience here... I do know I never liked applications > targeted to the "Gnome" look, preferring KDE... So... which toolkit did > those desktops favor? > > wxWidgets, as I recall, is supposed to attempt to look "native" on > each OS. Well, wx

Re: help - Module needs access to another module

2007-03-20 Thread abcd
On Mar 20, 9:58 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > After a bunch of questions of that kind, I suggest you take a step back, and > read this: > > http://docs.python.org/tut/node8.html got it, thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: help - Module needs access to another module

2007-03-20 Thread Carsten Haese
On Tue, 2007-03-20 at 06:46 -0700, abcd wrote: > I have the following directory/file structure... > > c:\foo\utils.py > c:\foo\bar\ok.py > > In ok.py I want to do something like... > > import utils > utils.helpMeDoSomething() > > However, it seems that ok.py doesn't "know" about utils. Oth

Re: How to copy a ClassObject?

2007-03-20 Thread Duncan Booth
Karlo Lozovina <[EMAIL PROTECTED]> wrote: > After this, tmp is a copy of First, and modifying tmp.name will not > affect First.name. As Peter said, it's not a copy, its a subclass. Modifying tmp.name would affect First.name (although in your example it is immutable so you cannot modify it). Als

Re: How to send

2007-03-20 Thread kyosohma
On Mar 20, 7:21 am, "Admir Saric" <[EMAIL PROTECTED]> wrote: > Hi, > > i have created an application in pygtk. The application creates files with > its own file type and extensions and saves them. I would like to extend the > application to be able to send these files over WLAN. I would use the > a

Re: Still the __new__ hell ...

2007-03-20 Thread Gabriel Genellina
En Tue, 20 Mar 2007 10:16:30 -0300, Aahz <[EMAIL PROTECTED]> escribió: > In article <[EMAIL PROTECTED]>, > Alex Martelli <[EMAIL PROTECTED]> wrote: >> Steve Holden <[EMAIL PROTECTED]> wrote: >>> >>> basestring is a *type*. >> >> I believe it used to be a tuple back in Python 2.2 (sorry, don't have

Subject line with smtplib.sendmail()

2007-03-20 Thread Boudreau, Emile
Hey, I'm trying to send mail from my server to my machine with test results. I can send the email no problem however, the email doesn't contain a "recipient list" or a "subject line". I was wondering how would I go about getting the information on the actual "To" and "Subject" lines so that

Re: Pycron for windows - please help

2007-03-20 Thread Shane Geiger
Here's something else you should consider: Look at the source code of pycron. I just downloaded it. Much to my surprise, this is implemented in about 115 lines of code. In particular, look at the run() function. You should try adding a try-except block around the system call to get a hint

Re: class objects, method objects, function objects

2007-03-20 Thread Fredrik Lundh
Dennis Lee Bieber wrote: > "it(the" -- argument list, not the object -- ") is unpacked again no, "it" refers to the bound method object, as 7stud would have realized if he'd read the entire paragraph. here's the relevant portion: /.../ a method object is created by packing (pointers to) the

Punit v 0.1 - Python CD ripper

2007-03-20 Thread Mark Bryan Yu
Here's the initial release of my personal open source project to create a Python CD ripper in Linux. Punit is a Audio CD ripper for Linux using cdparanoia, LAME and CDDB.py (http://cddb-py.sourceforge.net/) http://www.programmingmind.com/bryan/punit.html -- http://mail.python.org/mailman/listin

Re: Subject line with smtplib.sendmail()

2007-03-20 Thread Fredrik Lundh
Boudreau, Emile wrote: > I'm trying to send mail from my server to my machine with test > results. I can send the email no problem however, the email doesn't > contain a "recipient list" or a "subject line". I was wondering how > would I go about getting the information on the actual "To" and > "S

Re: When is List Comprehension inappropriate?

2007-03-20 Thread Alex Martelli
Aahz <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Alex Martelli <[EMAIL PROTECTED]> wrote: > > > >list(iterimage(etc etc)) > > > >is surely a better way to express identical semantics. More generally, > >[x for x in whatever] (whether x is a single name or gets peculiarly > >unp

Re: Still the __new__ hell ...

2007-03-20 Thread Alex Martelli
Aahz <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Alex Martelli <[EMAIL PROTECTED]> wrote: > >Steve Holden <[EMAIL PROTECTED]> wrote: > >> > >> basestring is a *type*. > >> > >> >>> basestring > >> > >> > >> It's the base class of which both str and unicode are subclasses.

Re: How many connections can accept a 'binded' socket?

2007-03-20 Thread Alex Martelli
Laurent Pointal <[EMAIL PROTECTED]> wrote: > billiejoex a écrit : > > Hi, > > I'm writing a small asyncore-based server application serving a lot of > > clients. When I have to handle more than 1021 client simoultaneously > > the 'binded' socket object raises an error: > > > > [...] > > connectio

Re: any ways to judge whether an object is initilized or not in a class

2007-03-20 Thread Alex Martelli
Steven D'Aprano <[EMAIL PROTECTED]> wrote: ... > There are plenty of reasons for preferring new style classes. If those > reasons hold for you, then of course you should use new style classes. > > But that's not the same thing as saying that you should use new style > classes *even when you don

Re: class objects, method objects, function objects

2007-03-20 Thread 7stud
Thanks Duncan and Dennis. -- http://mail.python.org/mailman/listinfo/python-list

os.wait() for Windows

2007-03-20 Thread Damien Byrne
Hello, I am new to python. I am using the os module to run a command in a bashshell. However I need this process to complete before continuing. Is there a command that will wait for this process to complete? I am using Windows XP and the os.wait() command only works for UNIX systems, and there

Re: Load three different modules which have the same name

2007-03-20 Thread Alex Martelli
Gabriel Genellina <[EMAIL PROTECTED]> wrote: ... > > example i could load Person from Person (in alpha) as, "Person_Alpha" > > or something like that in sys.modules? not sure how I might do that. > > Use the "as" clause when importing; it's almost the same phrase you wrote > above: > from alp

Re: difference between urllib2.urlopen and firefox view 'page source'?

2007-03-20 Thread kyosohma
On Mar 20, 1:56 am, Tina I <[EMAIL PROTECTED]> wrote: > cjl wrote: > > Hi. > > > I am trying to screen scrape some stock data from yahoo, so I am > > trying to use urllib2 to retrieve the html and beautiful soup for the > > parsing. > > > Maybe (most likely) I am doing something wrong, but when I u

Wanted: a python24 package for Python 2.3

2007-03-20 Thread Jonathan Fine
Hello My problem is that I want a Python 2.4 module on a server that is running Python 2.3. I definitely want to use the 2.4 module, and I don't want to require the server to move to Python 2.4. More exactly, I am using subprocess, which is new in Python 2.4. What I am writing is something like

Re: os.wait() for Windows

2007-03-20 Thread kyosohma
On Mar 20, 10:32 am, "Damien Byrne" <[EMAIL PROTECTED]> wrote: > Hello, > > I am new to python. I am using the os module to run a command in a > bashshell. However I need this process to complete before continuing. Is > there a command that will wait for this process to complete? I am using > Windo

Re: Wanted: a python24 package for Python 2.3

2007-03-20 Thread kyosohma
On Mar 20, 10:33 am, Jonathan Fine <[EMAIL PROTECTED]> wrote: > Hello > > My problem is that I want a Python 2.4 module on > a server that is running Python 2.3. I definitely > want to use the 2.4 module, and I don't want to > require the server to move to Python 2.4. > > More exactly, I am using

Re: Wanted: a python24 package for Python 2.3

2007-03-20 Thread Alex Martelli
Jonathan Fine <[EMAIL PROTECTED]> wrote: ... > In other words, I'm asking for a python24 package that > contains all (or most) of the modules that are new to > Python 2.4. For subprocess specifically, see . I don't think anybody's ever packaged up A

making objects with individual attributes!

2007-03-20 Thread Alejandro
I have created a class: class document: titre = '' haveWords = set() def __init__(self, string): self.titre = string # doc1 = document('doc1') doc2 = document('doc2') doc1.haveWords.add(1) doc2.haveWords.add(2) print doc1.haveWords # i get set([1, 2]) doc1 an

Re: Eureka moments in Python

2007-03-20 Thread Sion Arrowsmith
Sion Arrowsmith <[EMAIL PROTECTED]> wrote: >This is more a "batteries included" eureka moment than a Python one, >but writing a fetchmail substitute in 6 lines was an eye-opener. On Fri, Mar 16, 2007 at 01:23:14PM -0500, someone emailed: [This is a newsgroup/mailing list -- potentially useful inf

#!/usr/bin/env python > 2.4?

2007-03-20 Thread rh0dium
Hi Folks, OK I love the logging module. I use it everywhere. I was happily putting at the top of each of my scripts #!/usr/bin/env python2.4 import logging LOGLEVEL=logging.INFO # Set's up a basic logger logging.basicConfig(level=LOGLEVEL, format="%(asctime)s %(name)s % (levelna

Freezing Python Apps on Linux?

2007-03-20 Thread Greg Copeland
I seem to recall several different applications which can create standalone binaries for python on Linux. I know freeze.py and cx_Freeze.py exist. Are these still the preferred methods of creating a stand alone binary out of a python application on Linux? Greg -- http://mail.python.org/mailman

Re: making objects with individual attributes!

2007-03-20 Thread Gary Herron
Alejandro wrote: > I have created a class: > > class document: > > titre = '' > haveWords = set() > > def __init__(self, string): > > self.titre = string > > # > > doc1 = document('doc1') > doc2 = document('doc2') > > doc1.haveWords.add(1) > doc2.haveWords.add(2) > > > p

Re: making objects with individual attributes!

2007-03-20 Thread kyosohma
On Mar 20, 11:08 am, "Alejandro" <[EMAIL PROTECTED]> wrote: > I have created a class: > > class document: > > titre = '' > haveWords = set() > > def __init__(self, string): > > self.titre = string > > # > > doc1 = document('doc1') > doc2 = document('doc2') > > doc1.haveW

Re: making objects with individual attributes!

2007-03-20 Thread Diez B. Roggisch
Alejandro wrote: > I have created a class: > > class document: > > titre = '' > haveWords = set() > > def __init__(self, string): > > self.titre = string > > # > > doc1 = document('doc1') > doc2 = document('doc2') > > doc1.haveWords.add(1) > doc2.haveWords.add(2)

Re: Wanted: a python24 package for Python 2.3

2007-03-20 Thread Jonathan Fine
[EMAIL PROTECTED] wrote: > On Mar 20, 10:33 am, Jonathan Fine <[EMAIL PROTECTED]> wrote: >>My problem is that I want a Python 2.4 module on >>a server that is running Python 2.3. I definitely >>want to use the 2.4 module, and I don't want to >>require the server to move to Python 2.4. > You migh

Re: Wanted: a python24 package for Python 2.3

2007-03-20 Thread Gerald Klix
Hi, You can't import subproces from future, only syntactic and semantic changes that will become standard feature in future python version can be activated that way. You can copy the subprocess module from python 2.4 somewhere where it will be found from python 2.3. At least subporcess is impor

Re: How many connections can accept a 'binded' socket?

2007-03-20 Thread John Nagle
billiejoex wrote: > Hi, > I'm writing a small asyncore-based server application serving a lot of > clients. When I have to handle more than 1021 client simoultaneously > the 'binded' socket object raises an error: When you ask questions like this, please specify what operating system you're u

if __name__ == 'main':

2007-03-20 Thread gtb
Hi, I often see the following 'if' construct in python code. What does this idiom accomplish? What happens if this is not main? How did I get here if it is not main? Thanks, gtb == if __name__ == 'main': myQuest('myQuest').Run() -- http://mail.p

P: maticna graficka monitor

2007-03-20 Thread Gigs_
prodajem: maticnu sapphire am2rd580adv, pola god stara, pod garancijom -> 700kn graficku sapphire x1650 pro 256 mb pola god start pod garancijom -> 600kn monitor philips 190p6es brilliance (kostao 4.100), star 1.5 godinu garancija vrijedi jos 1.5 godinu -> 2000kn -- http://mail.python.org/mail

Re: P: maticna graficka monitor

2007-03-20 Thread Gigs_
Gigs_ wrote: > prodajem: > > maticnu sapphire am2rd580adv, pola god stara, pod garancijom -> 700kn > > graficku sapphire x1650 pro 256 mb pola god start pod garancijom -> 600kn > > monitor philips 190p6es brilliance (kostao 4.100), star 1.5 godinu > garancija vrijedi jos 1.5 godinu -> 2000kn

Re: Wanted: a python24 package for Python 2.3

2007-03-20 Thread Jonathan Fine
Alex Martelli wrote: > Jonathan Fine <[EMAIL PROTECTED]> wrote: >... > >>In other words, I'm asking for a python24 package that >>contains all (or most) of the modules that are new to >>Python 2.4. > > > For subprocess specifically, see > . Tha

Re: #!/usr/bin/env python > 2.4?

2007-03-20 Thread Steve Holden
rh0dium wrote: > Hi Folks, > > OK I love the logging module. I use it everywhere. I was happily > putting at the top of each of my scripts > > > #!/usr/bin/env python2.4 > [...] > > But now you guys continued to make this cool language and 2.5 came > out. Great now how do I put /

Re: if __name__ == 'main':

2007-03-20 Thread Facundo Batista
gtb wrote: > I often see the following 'if' construct in python code. What does > this idiom accomplish? What happens if this is not main? How did I get > here if it is not main? > ... > if __name__ == 'main': >myQuest('myQuest').Run() This idiom is for executing the code if you're running t

Re: if __name__ == 'main':

2007-03-20 Thread Grant Edwards
On 2007-03-20, gtb <[EMAIL PROTECTED]> wrote: > I often see the following 'if' construct in python code. What does > this idiom accomplish? It checks to see if the file is being run as the "main" program, and does something if that is so. > What happens if this is not main? Nothing. > How did

Re: any ways to judge whether an object is initilized or not in a class

2007-03-20 Thread Steven D'Aprano
On Tue, 20 Mar 2007 08:27:07 -0700, Alex Martelli wrote: > You should always use new-style classes in order to avoid having to stop > and make a decision each time you code a class -- having to stop and ask > yourself "do I need any of the many extra features of new-style classes > here, or will l

Re: if __name__ == 'main':

2007-03-20 Thread Patrick Down
On Mar 20, 11:49 am, "gtb" <[EMAIL PROTECTED]> wrote: > Hi, > > I often see the following 'if' construct in python code. What does > this idiom accomplish? What happens if this is not main? How did I get > here if it is not main? A quick example demonstrates the usage: C:\code>type temp.py prin

Yanqui bastards OPERATED 911 RACIST and HEINOUS CRIME Re: +++ Russia Watched 9/11 In REAL TIME on SATELLITE +++

2007-03-20 Thread thermate
Yank Bastards: What evidence do you have for the 19 hijackers ? What explanation do you have for thermate products ? What evidence do INCOMPETENT Graduates of the FBI Academy have for the suicide of building 7 ? Why were FBI rats running around to confiscate the evidence of missile hitting the

Re: an enumerate question

2007-03-20 Thread Paulo da Silva
[EMAIL PROTECTED] escreveu: > hi > say i want to enumerate lines of a file > eg > for n,l in enumerate(open("file")): > # print next line ie > > is there a way to print out the next line from current line using the > above?. > Or do i have to do a readlines() first to get it into a list eg >

Re: List to string

2007-03-20 Thread Josh Bloom
That's pretty funny :) On 3/20/07, Steven D'Aprano <[EMAIL PROTECTED]> wrote: On Tue, 20 Mar 2007 13:01:36 +0100, Bruno Desthuilliers wrote: > Steven D'Aprano a écrit : >> On Mon, 19 Mar 2007 13:11:09 +0100, Bruno Desthuilliers wrote: >> >>> There's no "cast" in Python. It would make no sens i

Exceptions when closing a file

2007-03-20 Thread Steven D'Aprano
Closing a file can (I believe) raise an exception. Is that documented anywhere? I've spent a lot of frustrating time trying to track this down, with no luck, which suggests that either my google-foo is weak or that it isn't documented. Is IOError the only exception it can raise? The only thing I h

Choosing new-style vs classic classes (was Re: any ways to judge whether an object is initilized or not in a class)

2007-03-20 Thread Aahz
In article <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Tue, 20 Mar 2007 08:27:07 -0700, Alex Martelli wrote: >> >> You should always use new-style classes in order to avoid having to stop >> and make a decision each time you code a class -- having to stop and ask >> yoursel

Re: difference between urllib2.urlopen and firefox view 'page source'?

2007-03-20 Thread John Nagle
Here's a useful online tool that might help you see what's happening: http://www.sitetruth.com/experimental/viewer.html We use this to help webmasters see what our web crawler is seeing. This reads a page, using Python and FancyURLOpener, with a USER-AGENT string of "SiteTruth.co

Re: Wanted: a python24 package for Python 2.3

2007-03-20 Thread Aahz
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: > >For subprocess specifically, see > . I don't think anybody's >ever packaged up ALL the new stuff as you require. Oh, good that web page came back. (When we were down to the wir

Re: Anything available that can read Microsoft .MDB files from Python?

2007-03-20 Thread John Nagle
Shane Geiger wrote: > Try installing it from source. Perhaps getting a newer verion is all > you would need. If at that point you find there is a bug, report it. I did. I finally got MDBtools to build by throwing out all the "configure" stuff and the makefiles, then writing some simple

RE: Subject line with smtplib.sendmail()

2007-03-20 Thread Boudreau, Emile
Thanks for the reply. When I use the instruction from that list this is the email I receive. I'm using Outlook. [EMAIL PROTECTED] To: -- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Hello! This Still DOESN't Work

Re: if __name__ == 'main':

2007-03-20 Thread gtb
On Mar 20, 12:13 pm, "Patrick Down" <[EMAIL PROTECTED]> wrote: > On Mar 20, 11:49 am, "gtb" <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I often see the following 'if' construct in python code. What does > > this idiom accomplish? What happens if this is not main? How did I get > > here if it is not

Re: Exceptions when closing a file

2007-03-20 Thread kyosohma
On Mar 20, 12:25 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Closing a file can (I believe) raise an exception. Is that documented > anywhere? I've spent a lot of frustrating time trying to track this down, > with no luck, which suggests that either my google-foo is weak or that it > isn't doc

Re: Exceptions when closing a file

2007-03-20 Thread Ross Ridge
Steven D'Aprano <[EMAIL PROTECTED]> wrote: >Closing a file can (I believe) raise an exception. Is that documented >anywhere? In a catch-all statement for file objects: "When a file operation fails for an I/O-related reason, the exception IOError is raised." The fact that close() is a file opera

Re: Subject line with smtplib.sendmail()

2007-03-20 Thread kyosohma
On Mar 20, 12:50 pm, "Boudreau, Emile" <[EMAIL PROTECTED]> wrote: > Thanks for the reply. When I use the instruction from that list this is > the email I receive. I'm using Outlook. > > [EMAIL PROTECTED] > To: > -- > From: [EMAIL PROTECTED] > To: [EMAIL P

RE: Subject line with smtplib.sendmail()

2007-03-20 Thread Boudreau, Emile
Sorry folks. Scrape the last one that I sent. I noticed that it sends the email perfectly if the code is not in any of my methods but the second I insert it into a method I get the ugly email that I described in my last email. Does anyone know how I can get this code in my method so that I have a

Re: #!/usr/bin/env python > 2.4?

2007-03-20 Thread rh0dium
> Python usually installs so the latest version gets linked as > /usr/bin/python. HTere's no need to bind your scripts to a particular > version. > > regards True - but that entirely depends on your path. Example: Redhat (RHEL3) ships with python2.3 in /usr/bin Adding an 2.5 version to /usr/loc

  1   2   >