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

2007-03-19 Thread Tina I
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 use > urllib2.urlopen to fetch a page, and when I view 'page sour

Re: Real Time Embedded Systems Monitor in Python?

2007-03-19 Thread Hendrik van Rooyen
"frikk" <[EMAIL PROTECTED]> wrote: > > I am looking into a project for the company I work for. Essentially > it involves setting up a real time monitor / signal injector in > between a CPU board and a system controller. The system controller > sends signals (message packets) to the CPU board.

Re: Timeout to readline()/readlines()

2007-03-19 Thread Hendrik van Rooyen
"Horta" <[EMAIL PROTECTED]> wrote: > Sometimes, when I do an os.popen*(), the process executed by the > command hangs, and the script stops forever on the readline()/ > readlines() calls. I found that I can use select, but I'm thinking... > if, after a sellect() call returns, the stdout (for exam

Re: Still the __new__ hell ...

2007-03-19 Thread greg
Steve Holden wrote: > >>> basestring > You're right, I'm not sure what made me think it was a tuple. Maybe because people used to write isinstance(x, (str, unicode)) before basestring existed. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Still the __new__ hell ...

2007-03-19 Thread Alex Martelli
Steve Holden <[EMAIL PROTECTED]> wrote: > greg wrote: > > Paulo da Silva wrote: > >> As a relatively inexperient > >> in python, how could I know that a 'string' is an instance of > >> basestring? > > > >isinstance(x, basestring) > > > > This works because basestring is defined as the > > tu

Re: using regexp

2007-03-19 Thread attn . steven . kuo
On Mar 19, 10:33 pm, [EMAIL PROTECTED] wrote: > hi > how can i use regexp to group these digits into groups of 3? > > eg > line 123456789123456789 > > i have : > > pat = re.compile("line\s+(\d{3})" , re.M|re.DOTALL) > > but this only gives the first 3. I also tried > > "line\s+(\d{3})+" > but also

Re: When is List Comprehension inappropriate?

2007-03-19 Thread Alex Martelli
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 single name or gets peculiarly unpacked a

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

2007-03-19 Thread Steve Holden
Steven D'Aprano wrote: > 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. > > What's

Re: using regexp

2007-03-19 Thread s99999999s2003
On Mar 20, 1:57 pm, Shane Geiger <[EMAIL PROTECTED]> wrote: > import re > line = '123456789123456789' > print re.findall('([0-9]{3})', line) > > > > Shane Geiger wrote: > > You don't even need regex. > > > def > > split_seq(seq,size): > > ># this is sort of the inverse of > > flatten > > >#

Re: using regexp

2007-03-19 Thread Shane Geiger
import re line = '123456789123456789' print re.findall('([0-9]{3})', line) Shane Geiger wrote: You don't even need regex. def split_seq(seq,size): # this is sort of the inverse

Re: using regexp

2007-03-19 Thread Shane Geiger
You don't even need regex. def split_seq(seq,size): # this is sort of the inverse of flatten

using regexp

2007-03-19 Thread s99999999s2003
hi how can i use regexp to group these digits into groups of 3? eg line 123456789123456789 i have : pat = re.compile("line\s+(\d{3})" , re.M|re.DOTALL) but this only gives the first 3. I also tried "line\s+(\d{3})+" but also not working. I need output to be ['123' ,'456','789', '123','456','78

Re: Documentation for "str()" could use some adjustment - Unicode issue

2007-03-19 Thread Alex Martelli
John Nagle <[EMAIL PROTECTED]> wrote: ... > The real problem is the published books on Python: > > "Learning Python", by Lutz and Ascher: > "str(string) -- returns the string representation of any object." > > "Python in a Nutshell", by Martelli > Doesn't really address the issue,

Re: How to calculate a file of equations in python

2007-03-19 Thread Paul Rubin
"John" <[EMAIL PROTECTED]> writes: > I have a text file which contains math expression, like this > 134 > +234 > +234 Erm, is this a homework assignment? Basicaly you need to identify all the separate operands and operators and decide what to do with them. I'm guessing you don't have to worry abo

Re: How to calculate a file of equations in python

2007-03-19 Thread Michele Simionato
On Mar 20, 1:03 am, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Mar 19, 2007, at 11:48 PM, John wrote: > > > Hi, > > I have a text file which contains math expression, like this > > 134 > > +234 > > +234 > > > (i.e. an operation (e.g. '+) and then a number and then a new line). > > > Can you pl

Re: How to calculate a file of equations in python

2007-03-19 Thread Michael Bentley
On Mar 19, 2007, at 11:48 PM, John wrote: > Hi, > I have a text file which contains math expression, like this > 134 > +234 > +234 > > (i.e. an operation (e.g. '+) and then a number and then a new line). > > Can you please tell me what is the easiest way to calculate that file? > for example the

Re: an enumerate question

2007-03-19 Thread eight02645999
On Mar 20, 11:00 am, Steven Bethard <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > for n,l in enumerate(open("file")): > >print n,l # this prints current line > >print next line in this current iteration of the loop. > > Depends what you want to happen when you request "next". I

How to calculate a file of equations in python

2007-03-19 Thread John
Hi, I have a text file which contains math expression, like this 134 +234 +234 (i.e. an operation (e.g. '+) and then a number and then a new line). Can you please tell me what is the easiest way to calculate that file? for example the above example should be = 134 + 234 + 234 = 602. Thank you.

Re: Documentation for "str()" could use some adjustment - Unicode issue

2007-03-19 Thread Steven D'Aprano
On Mon, 19 Mar 2007 17:01:23 +, John Nagle wrote: >> Hi John, I'm not at all an expert around here but my understanding of >> the workflow is that bug reports should be submitted to the tracker at >> sourceforge. There is no guarantee that they will be noticed there but >> the chances there ar

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

2007-03-19 Thread Ben Finney
"Steven D'Aprano" <[EMAIL PROTECTED]> writes: > 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 an

Re: fifo queue

2007-03-19 Thread Tim Roberts
"drochom" <[EMAIL PROTECTED]> wrote: > >how would u improve this code? I would add at least one comment... -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: When is List Comprehension inappropriate?

2007-03-19 Thread Steven D'Aprano
On Mon, 19 Mar 2007 07:41:59 -0700, Ben wrote: > I have recently learned how list comprehension works and am finding it > extremely cool. I am worried, however, that I may be stuffing it into > places that it does not belong. Others have suggested reasons why you might or might not want to use l

Re: List to string

2007-03-19 Thread Steven D'Aprano
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 up? x = 1 x = None x = "spam" x = [

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

2007-03-19 Thread Steven D'Aprano
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. What's wrong with old-style classes? On

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

2007-03-19 Thread Steve Holden
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 use > urllib2.urlopen to fetch a page, and when I view 'page sour

Re: Passing arguments to a command line from a python script

2007-03-19 Thread Luis M. González
On Mar 19, 11:52 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > Luis M. González wrote: > > On Mar 19, 10:49 pm, "zacherates" <[EMAIL PROTECTED]> wrote: > >> This implies that `os.system("setuppy py2exe")` should do what you > >> want. > > > It works! > > Thank you, this is just what I wanted. > >

Re: Still the __new__ hell ...

2007-03-19 Thread Steve Holden
greg wrote: > Paulo da Silva wrote: >> As a relatively inexperient >> in python, how could I know that a 'string' is an instance of >> basestring? > >isinstance(x, basestring) > > This works because basestring is defined as the > tuple (str, unicode) and isinstance accepts a > tuple of types

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

2007-03-19 Thread zacherates
On Mar 19, 10:30 pm, "cjl" <[EMAIL PROTECTED]> 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 use > urllib2.urlopen to

Re: an enumerate question

2007-03-19 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > for n,l in enumerate(open("file")): >print n,l # this prints current line >print next line in this current iteration of the loop. Depends what you want to happen when you request "next". If you want to renumber the lines, you can call .next() on the iterator::

Re: an enumerate question

2007-03-19 Thread Paul Rubin
[EMAIL PROTECTED] writes: > for n,l in enumerate(open("file")): >print n,l # this prints current line >print next line in this current iteration of the loop. > hope you can understand now. I see. It just seemed a little weird. If the file contains first line second line third li

Re: Passing arguments to a command line from a python script

2007-03-19 Thread Steven Bethard
Luis M. González wrote: > On Mar 19, 10:49 pm, "zacherates" <[EMAIL PROTECTED]> wrote: >> This implies that `os.system("setuppy py2exe")` should do what you >> want. > > It works! > Thank you, this is just what I wanted. You'll get better error checking if instead you do:: >>> import subpro

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

2007-03-19 Thread cjl
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 use urllib2.urlopen to fetch a page, and when I view 'page source' of the exact same URL i

Re: an enumerate question

2007-03-19 Thread skip
eight> thanks for replying. sorry i make clear again. eight> say eight> for n,l in enumerate(open("file")): eight>print n,l # this prints current line eight>print next line in this current iteration of the loop. Off the top of my head, I'd try something like: clas

Re: an enumerate question

2007-03-19 Thread eight02645999
On Mar 20, 9:48 am, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > 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 >

Re: Passing arguments to a command line from a python script

2007-03-19 Thread Luis M. González
On Mar 19, 10:49 pm, "zacherates" <[EMAIL PROTECTED]> wrote: > On Mar 19, 9:42 pm, "Luis M. González" <[EMAIL PROTECTED]> wrote: > > > > > On Mar 19, 9:25 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > > wrote: > > > > En Mon, 19 Mar 2007 20:46:56 -0300, Luis M. González <[EMAIL PROTECTED]> > > > es

Re: Passing arguments to a command line from a python script

2007-03-19 Thread zacherates
On Mar 19, 9:42 pm, "Luis M. González" <[EMAIL PROTECTED]> wrote: > On Mar 19, 9:25 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > > > > En Mon, 19 Mar 2007 20:46:56 -0300, Luis M. González <[EMAIL PROTECTED]> > > escribió: > > > > What I want now is execute the script I just created. > >

Re: an enumerate question

2007-03-19 Thread Paul Rubin
[EMAIL PROTECTED] writes: > 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?. I don't understand what you're trying to do. You mean you're trying

Re: Passing arguments to a command line from a python script

2007-03-19 Thread Luis M. González
On Mar 19, 9:25 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 19 Mar 2007 20:46:56 -0300, Luis M. González <[EMAIL PROTECTED]> > escribió: > > > What I want now is execute the script I just created. > > As far as I know, the only way to execute the script is from a command > > line a

an enumerate question

2007-03-19 Thread eight02645999
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 d = open("file").readlines() for n, l in enumer

Re: Still the __new__ hell ...

2007-03-19 Thread greg
Paulo da Silva wrote: > As a relatively inexperient > in python, how could I know that a 'string' is an instance of > basestring? isinstance(x, basestring) This works because basestring is defined as the tuple (str, unicode) and isinstance accepts a tuple of types as well as just a single type

Re: XML based programming language

2007-03-19 Thread greg
Diez B. Roggisch wrote: > What you are after then is the usage of a validating parser, not just > well-formed XML-documents. > > I'm not sure where element-tree stands regarding this, but I think 4suite > offers DTD, W3C-Schema and Relax-NG support. So he's effectively written his own validating

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

2007-03-19 Thread greg
Gabriel Genellina wrote: > you may consider using a class > attribute as a default value: > > class Coffee: > > temp = 50 Be careful with that, though -- only use it for immutable values. Doing that with a mutable object, such as a list, will get you into trouble, since one object is being

Re: Documentation for "str()" could use some adjustment - Unicode issue

2007-03-19 Thread greg
John Nagle wrote: > and when we get to > Unicode-only strings, "str" will never raise a conversion exception. On *strings*, maybe, but objects can implement __str__ in arbitrary ways, so you can't say anything in general about what str() will do. -- Greg -- http://mail.python.org/mailman/listinf

Re: Create TarFile using string buffers

2007-03-19 Thread [EMAIL PROTECTED]
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 :( -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing arguments to a command line from a python script

2007-03-19 Thread Gabriel Genellina
En Mon, 19 Mar 2007 20:46:56 -0300, Luis M. González <[EMAIL PROTECTED]> escribió: > What I want now is execute the script I just created. > As far as I know, the only way to execute the script is from a command > line and typing "setup.py py2exe". A few ways: - os.system("commandline"). Simple

Passing arguments to a command line from a python script

2007-03-19 Thread Luis M. González
Please forgive me if what I'm asking is non sense... I created a little program to authomate the creation of the "setup.py" script for py2exe. It simply prompts for the main executable script name and then creates setup.py, as follows: # this is "makesetup.py" nombre = raw_input('File name?: ')

Re: struct.pack returns nothing [3]

2007-03-19 Thread Gabriel Genellina
En Mon, 19 Mar 2007 19:32:41 -0300, Andrés Martinelli <[EMAIL PROTECTED]> escribió: > I'm using the example of the site > http://docs.python.org/lib/module-struct.html : > > import struct > pack('hhl', 1, 2, 3) That code should raise a NameError. Either you are using *another* pack function,

Re: Python shell on mac os x

2007-03-19 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, Kevin Walzer <[EMAIL PROTECTED]> wrote: > 7stud wrote: > > On Mar 16, 2:53 am, [EMAIL PROTECTED] wrote: > >> or go tohttp://pythonmac.org/packages/ > >> and you have python 2.5 or python 2.4.4 with readline support > > > > The download instructions seem to steer

Re: struct.pack returns nothing [3]

2007-03-19 Thread skip
Andrés> I'm using the example of the site Andrés> http://docs.python.org/lib/module-struct.html : Andrés> import struct Andrés> pack('hhl', 1, 2, 3) Andrés> I should get: '\x00\x01\x00\x02\x00\x00\x00\x03' Andrés> I get an empty line, a '\n':

struct.pack returns nothing [3]

2007-03-19 Thread Andrés Martinelli
I'm using the example of the site http://docs.python.org/lib/module-struct.html : import struct pack('hhl', 1, 2, 3) I should get: >>> '\x00\x01\x00\x02\x00\x00\x00\x03' I get an empty line, a '\n': >>> >>> _ I know it should work. The code is OK. What could be wrong? Doesnt find the librar

Re: urgent - Matplolib with IDLE!

2007-03-19 Thread Ana Paula Leite
Hi, in site-packages/matplotlib/backends/backend_tkagg.py I commented out in the show function the line Tk.mainloop() In addition to the changes I mentioned in my first email, this has solved my problem! On 3/19/07, Rob Clewley <[EMAIL PROTECTED]> wrote: I have the same problem with

Re: SQLObject 0.8.1

2007-03-19 Thread Jorge Godoy
Larry Bates <[EMAIL PROTECTED]> writes: > WOW! Went from 0.7.4 to 0.8.1 in the span of only 23 minutes! There are two branches: 0.7 and 0.8. So, there were two releases. -- Jorge Godoy <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: coverage.py problem

2007-03-19 Thread skip
Orin> I have a problem in using coverage.py module in my project: You might want to contact Ned Batchelder, the author: http://nedbatchelder.com/code/modules/coverage.html Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: Pycron for windows - please help

2007-03-19 Thread Gabriel Genellina
En Mon, 19 Mar 2007 16:00:04 -0300, Al <[EMAIL PROTECTED]> escribió: > I looked in the pycron.log file, and I noticed that for the entires of > my new job, I see "rc=4" and the end of each line. All other jobs have > "rc=0" at the end of the line. I assume then, that rc=4 is a reference > to an er

Re: SQLObject 0.8.1

2007-03-19 Thread Larry Bates
Oleg Broytmann wrote: > Hello! > > I'm pleased to announce the 0.8.1 release of SQLObject. > > > What is SQLObject > = > > SQLObject is an object-relational mapper. Your database tables are described > as classes, and rows are instances of those classes. SQLObject is meant to

Re: coverage.py problem

2007-03-19 Thread Gabriel Genellina
En Mon, 19 Mar 2007 17:58:49 -0300, Orin <[EMAIL PROTECTED]> escribió: > Hi, > I have a problem in using coverage.py module in my project: > > ./cov -c > Traceback (most recent call last): > File "./cov", line 10, in ? > coverage.the_coverage.command_line(sys.argv[1:]) > File "/usr/lib/python2.4/

Re: screen size/resolution in win32 in python

2007-03-19 Thread Larry Bates
adri80386 wrote: > Hi: > > How I can get the current screen resolution settings (screen.width and > screen.heigth in pixels) in python. > > Thanks in advance > > Adrian > Please think about the fact that people sometimes now have 2 and even 3 monitors. Don't do anything with this that would s

Re: Create TarFile using string buffers

2007-03-19 Thread Gabriel Genellina
En Mon, 19 Mar 2007 16:06:39 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > I have a program that generates a number of files that will be > packaged into a tarball. Can I stream the content into TarFile without > first writing them out to the file system? All add(), addfile() and > ge

Re: Private data

2007-03-19 Thread Dustan
On Mar 19, 7:31 am, Bruno Desthuilliers wrote: > Dustan a écrit : > > > > > On Mar 19, 4:09 am, Bruno Desthuilliers > [EMAIL PROTECTED]> wrote: > >> Dustan a écrit : > > >>>http://dustangroups.googlepages.com/privateattributesinpython > >>> This is something that I just threw together this mornin

Re: Private data

2007-03-19 Thread Dustan
On Mar 19, 3:06 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Dustan a écrit : > > >http://dustangroups.googlepages.com/privateattributesinpython > > May I report a small typo ? Absolutely. I might even fix it. > """ > def interanalDataDecorator(func): > """ > > Talking about private

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

2007-03-19 Thread John Nagle
Steve Holden wrote: > Terry Reedy 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 i

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

2007-03-19 Thread John Nagle
[EMAIL PROTECTED] wrote: > On Mar 19, 2:45 pm, John Nagle <[EMAIL PROTECTED]> wrote: > >>Diez B. Roggisch wrote: >> >>>John Nagle schrieb: >> I'm looking for something that can read .MDB files, the format ... > I've read .MDB files using ODBC. I don't know how big your files are, > but I had

Re: Problem with sockets and python 2.5

2007-03-19 Thread Steve Holden
Jose Alberto Reguero wrote: > I had two programs, server.py and client.py(attached) > > 1: > server.py at i386 python 2.4 > client.py at x86_64 python 2.5 > Work > > 2: > server.py at x86_64 python 2.5 > client.py at i386 python 2.4 > Don't work > > Any ideas? Fix them?

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

2007-03-19 Thread Steve Holden
Terry Reedy 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, you just need to crea

Re: struct.pack returns nothing [2]

2007-03-19 Thread kyosohma
On Mar 19, 12:22 am, [EMAIL PROTECTED] wrote: > On Mon, Mar 19, 2007 at 02:12:39AM -0300, [EMAIL PROTECTED] wrote: > > If I build a strict with: > > Sorry, I meant script. > > > import struct > > print struck.pack ('i', 1) > > > it returns a '\n'. > > What's wrong with it??? > > :( > > -- > Andrés

Problem with sockets and python 2.5

2007-03-19 Thread Jose Alberto Reguero
I had two programs, server.py and client.py(attached) 1: server.py at i386 python 2.4 client.py at x86_64 python 2.5 Work 2: server.py at x86_64 python 2.5 client.py at i386 python 2.4 Don't work Any ideas? Thanks. Jose Alberto clinet.py Description: applicatio

Re: urgent - Matplolib with IDLE!

2007-03-19 Thread Rob Clewley
Dear Ana, I have the same problem with a similar setup (except Python 2.4.3) and have tried the same solutions (BTW those steps really did used to work on my machine using Python 2.3.5). In the short term you could either try IPython (a proper solution to this problem, which returns me to the prom

Re: Still the __new__ hell ...

2007-03-19 Thread Paulo da Silva
Bruno Desthuilliers escreveu: > Paulo da Silva a écrit : ... >> class MyDate(date): >> def __new__(cls,year,month=None,day=None): >> if type(year) is str: > > And what if it's a unicode string ? > The correct idiom here is: > if isinstance(year, basestring): > Than

Re: Load three different modules which have the same name

2007-03-19 Thread Steve Holden
abcd wrote: > 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() > > sys.path.remove(a) > sys.path.append(b) > reload(Pers

coverage.py problem

2007-03-19 Thread Orin
Hi, I have a problem in using coverage.py module in my project: ./cov -c Traceback (most recent call last): File "./cov", line 10, in ? coverage.the_coverage.command_line(sys.argv[1:]) File "/usr/lib/python2.4/site-packages/coverage.py", line 363, in command_lineself.collect() File "/usr/lib

Re: looking for a fastest parallel approach for quick executing of lotssmall routines

2007-03-19 Thread Terry Reedy
"dmitrey" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | hi all, | I'm looking for a way to execute a number (from 2 to thouzands, | usually small) of python functions as quikly as it's possible. | | There seems to be lots of solutions, for example mentioned at | http://www.cimec.o

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

2007-03-19 Thread Terry Reedy
<[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, you just need to create an | ODBC connection and

Re: class objects, method objects, function objects

2007-03-19 Thread Duncan Booth
"7stud" <[EMAIL PROTECTED]> wrote: > When the method object is called with an > argument list, > > x.g("GvR") ==> I think I'm both "referencing an instance attribute" > and calling the method object with an argument list > > it(the method object) is unpacked again, a new argument list is > const

Re: XML based programming language

2007-03-19 Thread Jarek Zgoda
stefaan napisał(a): > No schema checker can take this specification and simply output "22". > XSLT might be able to implement it, but it is complex for anything > real-life. Elementtree can immediately give me the concrete syntax > tree, > but any semantic actions have to be implemented during a >

Re: looking for a fastest parallel approach for quick executing of lots small routines

2007-03-19 Thread dmitrey
I forgot to add: first of all I need sinchronious parallel calculations, not asinchronious D. -- http://mail.python.org/mailman/listinfo/python-list

Re: PythonCard thoughts

2007-03-19 Thread John Henry
> > Do we know more things about the developing of this product, is it > active/dead or something ?? > I plan to use it to create something that will take a long time to > finish and i wouldn't want to find out that the product is a dead- > end... There is still "some" development work going on bu

looking for a fastest parallel approach for quick executing of lots small routines

2007-03-19 Thread dmitrey
hi all, I'm looking for a way to execute a number (from 2 to thouzands, usually small) of python functions as quikly as it's possible. There seems to be lots of solutions, for example mentioned at http://www.cimec.org.ar/python/ , but first of all it would be very nice if the module is included in

urgent - Matplolib with IDLE!

2007-03-19 Thread Ana Paula Leite
Dear all, I've just started using Matplotlib and I'm trying to make it work in IDLE. Other people have reported the same problem as I'll refer, but I've tried some solutions that I found in the web and I haven't succeded. Every time I produce a figure, I can't get the IDLE prompt active again af

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

2007-03-19 Thread kyosohma
On Mar 19, 2:45 pm, John Nagle <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch wrote: > > John Nagle schrieb: > > >> I'm looking for something that can read .MDB files, the format > >> Microsoft Access uses, from Python. I need to do this on > >> Linux, without using Microsoft tools. I just need

Re: Writing files

2007-03-19 Thread Jerry Hill
On 3/19/07, Adonis Vargas <[EMAIL PROTECTED]> wrote: > Actually, I re-ran this in a terminal and it worked perfectly. I was > using IDLE to write this code, kinda peculiar. Maybe something to do > with IDLE and CSV (or writing to files) with lines > ~1000. A socket > timing out maybe? It's because

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

2007-03-19 Thread John Nagle
Diez B. Roggisch wrote: > John Nagle schrieb: > >> I'm looking for something that can read .MDB files, the format >> Microsoft Access uses, from Python. I need to do this on >> Linux, without using Microsoft tools. I just need to read >> the files once, so I can load the tables into another da

Re: Writing files

2007-03-19 Thread Adonis Vargas
[EMAIL PROTECTED] wrote: >> >> -- code -- >> >> def _scan(self): >> outFile = file("mp3.dat", "wb") >> outCSV = csv.writer(outFile) >> output = list() >> for root, dirs, files in os.walk(self.directory): >> files = [x for x in files if x.endswi

Re: Create TarFile using string buffers

2007-03-19 Thread Lars Gustäbel
On Mon, Mar 19, 2007 at 12:06:39PM -0700, [EMAIL PROTECTED] wrote: > I have a program that generates a number of files that will be > packaged into a tarball. Can I stream the content into TarFile without > first writing them out to the file system? All add(), addfile() and > gettarinfo() seems to

Re: Documentation for "str()" could use some adjustment.

2007-03-19 Thread Terry Reedy
"John Nagle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | The Python documentation for "str" says | "str([object]) : | Return a string containing a nicely printable representation of an object." | | However, there's no mention of the fact that "str" of a Unicode string | wit

Re: Writing files

2007-03-19 Thread kyosohma
On Mar 19, 2:20 pm, Adonis Vargas <[EMAIL PROTECTED]> wrote: > I am writing a program that walks a directory full of mp3s reads their > ID3 data (using Mutagen), this part works perfectly. The problem is I > write these tags to a CSV file through the CSV module. But when I read > the file the file

Re: XML based programming language

2007-03-19 Thread stefaan
> 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 grammar. It also allows me t

Re: Private data

2007-03-19 Thread Bruno Desthuilliers
Dustan a écrit : > http://dustangroups.googlepages.com/privateattributesinpython > May I report a small typo ? """ def interanalDataDecorator(func): """ Talking about private attributes... !-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Using pxssh

2007-03-19 Thread Nick Craig-Wood
tereglow <[EMAIL PROTECTED]> wrote: > I am trying to convert some Expect/Tcl code into Python by using the > Pexpect module. The environment is such that authenticated keys are > disabled although SSH is available. I do not have control over this > environment, so I'm trying to automate tasks

Re: When is List Comprehension inappropriate?

2007-03-19 Thread Duncan Booth
"Ben" <[EMAIL PROTECTED]> wrote: > What's the most "pythony" way to do this: > > even = [] > for x in range(0,width,2): > for y in range(0,height,2): > color = im.getpixel((x,y)) > even.append(((x,y), color)) > > versus list comprehension: > > even2 = [((x,y), im.getpixel((x

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

2007-03-19 Thread Bruno Desthuilliers
Steve Holden a écrit : > Bruno Desthuilliers wrote: > >> Diez B. Roggisch a écrit : >> (snip) >>> You want boil to be called __init__, which is python's constructor name. >> >> >> Actually, __init__ is the initializer. The proper constructor is __new__. >> >> > I'm not sure Diez qualifies as

Re: PythonCard thoughts

2007-03-19 Thread king kikapu
Ο/Η John Henry έγραψε: > (If I understand your question correctly) > > There is no restirction on what you call your objects. For instance, > I do call all of my buttons btnSomeThing, and so forth. No, i surely didn't mean this! What i mean is that the creation of these components happens to NOT

Writing files

2007-03-19 Thread Adonis Vargas
I am writing a program that walks a directory full of mp3s reads their ID3 data (using Mutagen), this part works perfectly. The problem is I write these tags to a CSV file through the CSV module. But when I read the file the file seems to be incomplete. Further inspecting it has seemed to have

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

2007-03-19 Thread Diez B. Roggisch
John Nagle schrieb: > I'm looking for something that can read .MDB files, the format > Microsoft Access uses, from Python. I need to do this on > Linux, without using Microsoft tools. I just need to read > the files once, so I can load the tables into another database. > Speed isn't an issue, a

Re: Boost Python properties/getter functions for strings

2007-03-19 Thread Shawn McGrath
On Mar 19, 12:49 pm, "Jon Clements" <[EMAIL PROTECTED]> wrote: > On 19 Mar, 16:40, "Shawn McGrath" <[EMAIL PROTECTED]> wrote: > > > On Mar 19, 12:00 pm, "Shawn McGrath" <[EMAIL PROTECTED]> wrote: > > > > I forgot to mention, getname is defined as: > > > const std::string &Entity::getName() const;

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

2007-03-19 Thread John Nagle
I'm looking for something that can read .MDB files, the format Microsoft Access uses, from Python. I need to do this on Linux, without using Microsoft tools. I just need to read the files once, so I can load the tables into another database. Speed isn't an issue, and I don't need to access the

Create TarFile using string buffers

2007-03-19 Thread [EMAIL PROTECTED]
I have a program that generates a number of files that will be packaged into a tarball. Can I stream the content into TarFile without first writing them out to the file system? All add(), addfile() and gettarinfo() seems to assume there is a file in the disk. But for me I seems inefficient to write

Re: Load three different modules which have the same name

2007-03-19 Thread Carsten Haese
On Mon, 2007-03-19 at 11:42 -0700, abcd wrote: > 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() > > sys.path.remove(a) > s

Re: Choosing Python

2007-03-19 Thread kyosohma
On Mar 19, 1:52 pm, "Sells, Fred" <[EMAIL PROTECTED]> wrote: > glad to hear it. Those of us who would like to introduce it in reluctant > schools elsewhere could benefit from a post-semester evaluation, including > student comments and some sample, running projects. > > -Original Message-

Pycron for windows - please help

2007-03-19 Thread Al
Hey all, I'm using Pycron for windows to run 5 scripts at various times of the day, all of which work well. I recently added a 6th job, a simply file copy operation, and it won't run. Once the job is configured, I click the test execution button, and it works fine. However, it won't run automa

RE: Choosing Python

2007-03-19 Thread Sells, Fred
glad to hear it. Those of us who would like to introduce it in reluctant schools elsewhere could benefit from a post-semester evaluation, including student comments and some sample, running projects. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL P

  1   2   >