Re: Simple programme - Just want to know whether this is correct way of coding

2009-05-08 Thread Lie Ryan
guptha wrote: Hi group, This is my first programme in python ,I need to know whether my code is in the right path of performance I wrote a code using multithreading to send mails Can't you use BCC? The code Works fine ,but I doubt about the performance issue ,My intention is to send mails co

Re: Public attributes with really private data

2009-05-08 Thread Peter Otten
Mark Summerfield wrote: > I had a quick search & didn't find anything _nice_ that produced > attributes with really private data, so I came up with a possible > solution---for Python 3. Do really you think what you suggest below is "nice"? By the way, your Attribute descriptor stores the value f

Re: Python 2.6, File read() problems in Windows Xp

2009-05-08 Thread Dave Angel
Li Wang wrote: Hi all: I am trying to read a non-text file as a string by using Python read(), however, it seems there is some thing wrong with it. I can use read() on text file correctly, but unable to read .xls file correctly. (The program can read any file correctly in Fedora 10) Any idea ho

Re: SimpleXMLRPCServer and creating a new object on for each new client request.

2009-05-08 Thread Piet van Oostrum
> Jelle Smet (JS) wrote: One more thing: >JS> I start python interactively: > import xmlrpclib > session1=xmlrpclib.ServerProxy('http://localhost:8000') > session2=xmlrpclib.ServerProxy('http://localhost:8000') > print session1.show_random() >JS> 13930 > print session2.sh

Re: tkinter and widget placement after resizing

2009-05-08 Thread John Posner
jamieson wrote: i.e. start out with a window like this: [1][4][7] [2][5][8] [3][6][9] make the main window larger and end up with this: [1][6] [2][7] [3][8] [4][9] [5 Here's a solution, using Label widgets for clarity. The keys are: * start numbering from zero, not one * use divmod() on an

Re: Python 3.1 beta 1

2009-05-08 Thread pruebauno
On May 7, 11:57 am, bearophileh...@lycos.com wrote: > >Equality tests between OrderedDict objects are order-sensitive and are > >implemented as list(od1.items())==list(od2.items()). Equality tests between > >OrderedDict objects and other Mapping objects are order-insensitive< > > very nice idea.

About twisted.mail.smtp.SMTPDeliveryError

2009-05-08 Thread gganesh
hi group, I wrote a code as below from twisted.mail.smtp import sendmail from twisted.internet import reactor from twisted.python.log import err import time MAILSERVER = 'mail.xxx.com' listTo = ['gxxx...@gmail.com', 'gjangox...@gmail.com', 'lxx...@yahoo.co.in', 'gk...@gmail.com'] FROM = 'gan

Re: What would YOU like to see in a txt to html converter?

2009-05-08 Thread Dotan Cohen
> I already thought of using dots or asterisks > or whatever to let the user format the text instead of using html tags (this > would be quite paradox ;-) > Then please do not invent another wheel. Write a markdown parser: http://en.wikipedia.org/wiki/Markdown -- Dotan Cohen http://what-is-what

Re: Public attributes with really private data

2009-05-08 Thread Carl Banks
On May 7, 11:37 pm, Mark Summerfield wrote: > Hi, > > I had a quick search & didn't find anything _nice_ that produced > attributes with really private data, so I came up with a possible > solution---for Python 3. > (For Python 2 there does seem to be an approach although I'm not > keen on > it:h

Re: SQL and CSV

2009-05-08 Thread Peter Otten
Nick wrote: > self.cursor = self.connection.cursor() > first = True > for row in reader: > if first: > headers = [] > for r in row: > n = r.strip().replace (' ', '_').replace ('-','_') > hea

Re: Python 2.6, File read() problems in Windows Xp

2009-05-08 Thread Li Wang
2009/5/8 Chris Rebert : > On Thu, May 7, 2009 at 10:04 PM, Li Wang wrote: >> Hi all: >> > the file, e.g. open("the_file.xls", "rb") > Unlike *nix, Windows differentiates between binary and text files, > hence the need for the "b" flag to specify which you're dealing with. Hi Thank you very much

Re: Python 2.6, File read() problems in Windows Xp

2009-05-08 Thread Li Wang
Hi: Problem solved Thank you very much, it works, It is my own problem:) All the best, Li 2009/5/8 Li Wang : > 2009/5/8 Chris Rebert : >> On Thu, May 7, 2009 at 10:04 PM, Li Wang wrote: >>> Hi all: >>> > >> the file, e.g. open("the_file.xls", "rb") >> Unlike *nix, Windows differentiates betwee

Re: Simple programme - Just want to know whether this is correct way of coding

2009-05-08 Thread Dave Angel
guptha wrote: Hi group, This is my first programme in python ,I need to know whether my code is in the right path of performance I wrote a code using multithreading to send mails FROM = 'com' SUBJECT = 'This is the subject' MSGBODY = 'This the body of the message ' MAILSERVER = 'mailco

Re: Python 2.6, File read() problems in Windows Xp

2009-05-08 Thread Li Wang
Hi Dave: Thank you very much for you explanation:) > Chances are you forgot the "b" parameter to open(). Unnecessary in Unix, it > tells the library to *not* translate \r\n to \n upon read, or the inverse > on write. In other words, with the "b" parameter, the file is read in > unchanged. So

xml in python

2009-05-08 Thread Rustom Mody
Can someone give me a heads up on xml parsing in python? The context is that I want to write a simple docbook to text converter. DOM is alright -- dont want to break my head with SAX just for performance when my documents are not likely to be large. My problem is that there seems to be so many nea

Re: SimpleXMLRPCServer and creating a new object on for each new client request.

2009-05-08 Thread Piet van Oostrum
> Piet van Oostrum (PvO) wrote: > Jelle Smet (JS) wrote: >PvO> One more thing: >JS> I start python interactively: > import xmlrpclib > session1=xmlrpclib.ServerProxy('http://localhost:8000') > session2=xmlrpclib.ServerProxy('http://localhost:8000') > print session1.show_

Re: Simple programme - Just want to know whether this is correct way of coding

2009-05-08 Thread Piet van Oostrum
> guptha (g) wrote: >g> Hi group, >g> This is my first programme in python ,I need to know whether my code >g> is in the right path of performance >g> I wrote a code using multithreading to send mails >g> FROM = 'com' >g> SUBJECT = 'This is the subject' >g> MSGBODY = 'This the body of

Re: Which python version do I use with "virtualenv"?

2009-05-08 Thread OldGrantonian
On May 7, 9:33 pm, Duncan Booth wrote: > OldGrantonian wrote: > > Where do I find the win32 extensions? > > http://www.google.com/search?q=python+win32 > > Any of the first 4 hits should help. Success :) Many thanks to all responders in this thread :) -- http://mail.python.org/mailman/listinfo/

Re: Which python version do I use with "virtualenv"?

2009-05-08 Thread OldGrantonian
On May 7, 9:33 pm, Duncan Booth wrote: > OldGrantonian wrote: > > Where do I find the win32 extensions? > > http://www.google.com/search?q=python+win32 > > Any of the first 4 hits should help. Success :) Many thanks to all responders in this thread :) -- http://mail.python.org/mailman/listinfo/

Re: Newcomer to Python tutorial question

2009-05-08 Thread Alan Cameron
"Terry Reedy" wrote in message news:mailman.5248.1241732704.11746.python-l...@python.org... > Alan Cameron wrote: >> > why is the printed result of > basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'} print(basket) > {'orange', 'banana', 'pear', 'apple

Creating temperory files for a web application

2009-05-08 Thread koranthala
Hi, I am doing web development using Django. I need to create an image (chart) and show it to the users - based on some data which user selects. My question is - how do I create a temporary image for the user? I thought of tempfile, but I think it will be deleted once the process is done - wh

Re: Web Based Front End?

2009-05-08 Thread Jeremiah Dodds
On Fri, May 8, 2009 at 2:52 AM, wrote: > So, my question is what is the best method to be able to have a user > enter specific data on a web page, have that data be passed to the > Python script and then have the output returned to the web page? > Essentially, I want to use a web based front end

Re: heapq.merge with key=

2009-05-08 Thread bearophileHUGS
Looking for this, Kevin D. Smith? http://code.activestate.com/recipes/502295/ Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating temperory files for a web application

2009-05-08 Thread Diez B. Roggisch
koranthala wrote: > Hi, >I am doing web development using Django. I need to create an image > (chart) and show it to the users - based on some data which user > selects. >My question is - how do I create a temporary image for the user? I > thought of tempfile, but I think it will be delete

php to python code converter

2009-05-08 Thread bvidinli
if anybody needs: http://code.google.com/p/phppython/ -- http://mail.python.org/mailman/listinfo/python-list

Compiling snippets of python code

2009-05-08 Thread Basil Brush
I need some advice on compiling snippets of python source at runtime. So perhaps some python experts can point the way. I am rewriting an old Java app in python. It tries to find solutions to computational problems based on the idea of genetic evolution. The Java version just used an array of byt

Re: IIR filter conversion routines for Python?

2009-05-08 Thread Lawrence D'Oliveiro
In message , wzab wrote: > I'm looking for procedures converting the IIR filters into cascade and/ > or parallel forms. Tried a DSP textbook? -- http://mail.python.org/mailman/listinfo/python-list

Re: SQL and CSV

2009-05-08 Thread Lawrence D'Oliveiro
In message , Peter Otten wrote: > While it may not matter here using placeholders instead of manually > escaping user-provided values is a good habit to get into. Until you hit things it can't deal with. -- http://mail.python.org/mailman/listinfo/python-list

How do I test the integrity of a Python installation in Debian and Ubuntu

2009-05-08 Thread Geoff Gardiner
How do I assure myself of the integrity of a Python installation acquired using apt-get install on Debian and Ubuntu? I can run regrtest but there's nothing in the basic installation to run, viz.: geg...@gegard:~$ python Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2u

String.Template Source ...

2009-05-08 Thread Mic Pringle
Hi, I'd like to have a 'dig around' in the source for String.Template, but can't seem to find where it lives. Could someone please let me know where about's in the source (perhaps a path?) the template functions live ? I'm working on a Mac, using Leopard and the bundled version of Python. Thank

Re: Creating temperory files for a web application

2009-05-08 Thread koranthala
On May 8, 2:49 pm, "Diez B. Roggisch" wrote: > koranthala wrote: > > Hi, > >    I am doing web development using Django. I need to create an image > > (chart) and show it to the users - based on some data which user > > selects. > >    My question is - how do I create a temporary image for the use

Re: String.Template Source ...

2009-05-08 Thread Peter Otten
Mic Pringle wrote: > I'd like to have a 'dig around' in the source for String.Template, but > can't seem to find where it lives. I assume that you mean string.Template. > Could someone please let me know where about's in the source (perhaps > a path?) the template functions live ? > > I'm worki

Re: String.Template Source ...

2009-05-08 Thread Mic Pringle
Brilliant, thanks Peter. -Mic 2009/5/8 Peter Otten <__pete...@web.de>: > Mic Pringle wrote: > >> I'd like to have a 'dig around' in the source for String.Template, but >> can't seem to find where it lives. > > I assume that you mean string.Template. > >> Could someone please let me know where abo

Re: Public attributes with really private data

2009-05-08 Thread Mark Summerfield
On 8 May, 08:19, Peter Otten <__pete...@web.de> wrote: > MarkSummerfieldwrote: > > I had a quick search & didn't find anything _nice_ that produced > > attributes with really private data, so I came up with a possible > > solution---for Python 3. > > Do really you think what you suggest below is "n

Re: Creating temperory files for a web application

2009-05-08 Thread koranthala
On May 8, 5:22 pm, koranthala wrote: > On May 8, 2:49 pm, "Diez B. Roggisch" wrote: > > > > > koranthala wrote: > > > Hi, > > >    I am doing web development using Django. I need to create an image > > > (chart) and show it to the users - based on some data which user > > > selects. > > >    My q

Re: Public attributes with really private data

2009-05-08 Thread Mark Summerfield
On 8 May, 09:52, Carl Banks wrote: > On May 7, 11:37 pm, MarkSummerfield wrote: > > > > > Hi, > > > I had a quick search & didn't find anything _nice_ that produced > > attributes with really private data, so I came up with a possible > > solution---for Python 3. > > (For Python 2 there does seem

Re: SQL and CSV

2009-05-08 Thread andrew cooke
Lawrence D'Oliveiro wrote: > In message , Peter Otten wrote: > >> While it may not matter here using placeholders instead of manually >> escaping user-provided values is a good habit to get into. > > Until you hit things it can't deal with. The post you are replying to was talking about using the

Re: Which one is best Python or Java for developing GUI applications?

2009-05-08 Thread Pascal Chambon
On Thu, May 7, 2009 at 1:42 PM, Pascal Chambon mailto:chambon.pas...@wanadoo.fr>> wrote: Hello When a lot of code using wxwidgets is in place, it's sure that moving to qt is a big task ; even though, thanks to qt's GUI designer, it's possible to quickly reproduce the structure o

Re: Public attributes with really private data

2009-05-08 Thread Mark Summerfield
[snip] > By the way, your Attribute descriptor stores the value for all instances of > A in the same variable... > > Peter You're right. -- http://mail.python.org/mailman/listinfo/python-list

Re: Public attributes with really private data

2009-05-08 Thread Peter Otten
Mark Summerfield wrote: > On 8 May, 08:19, Peter Otten <__pete...@web.de> wrote: >> MarkSummerfieldwrote: >> > I had a quick search & didn't find anything _nice_ that produced >> > attributes with really private data, so I came up with a possible >> > solution---for Python 3. >> >> Do really you t

Re: Python 3.1 beta 1

2009-05-08 Thread pruebauno
On May 7, 6:33 pm, Benjamin Peterson wrote: >   latinmail.com> writes: > > > Congratulations! > > Thanks! > > > > > Is it just me or was some nice summary output added to the make > > process? I get a nice list of modules that didn't compile and the ones > > where the library could not be found. >

Re: Public attributes with really private data

2009-05-08 Thread Mark Summerfield
On 8 May, 13:56, Peter Otten <__pete...@web.de> wrote: > MarkSummerfieldwrote: > > On 8 May, 08:19, Peter Otten <__pete...@web.de> wrote: > >> MarkSummerfieldwrote: > >> > I had a quick search & didn't find anything _nice_ that produced > >> > attributes with really private data, so I came up with

Re: Python 2.6, File read() problems in Windows Xp

2009-05-08 Thread pruebauno
On May 8, 5:08 am, Li Wang wrote: > Hi  Dave: > Thank you very much for you explanation:) > > > Chances are you forgot the "b" parameter to open().  Unnecessary in Unix, it > > tells the library to *not* translate \r\n  to \n upon read, or the inverse > > on write.  In other words, with the "b" pa

Re: Python 2.6, File read() problems in Windows Xp

2009-05-08 Thread Scott David Daniels
Li Wang wrote: So, if I am using python in Linux, do open('file', 'r') and open('file', 'rb') work the same way? You get identical results, but you ar lying to the reader of your code. you should include the 'b' if what you want is bytes (or octets if you prefer), and not use it if what you exp

Tutorial or example use for python-graph library

2009-05-08 Thread Paul Moore
I have just discovered the python-graph library. I've been interested in graph algorithms for a long time, so I'd like to give this a try. But there seems to be very little in the way of examples, or tutorial documentation available. There's the API documentation, but that's not really narrative fo

Re: Python 2.6, File read() problems in Windows Xp

2009-05-08 Thread Li Wang
2009/5/8 Scott David Daniels : > Li Wang wrote: >> >> So, if I am using python in Linux, do open('file', 'r') and >> open('file', 'rb') work the same way? > > You get identical results, but you ar lying to the reader of your code. > you should include the 'b' if what you want is bytes (or octets if

Re: Python 2.6, File read() problems in Windows Xp

2009-05-08 Thread Li Wang
2009/5/8 : > On May 8, 5:08 am, Li Wang wrote: >> Hi Dave: >> Thank you very much for you explanation:) >> >> > Chances are you forgot the "b" parameter to open(). Unnecessary in Unix, >> > it >> > tells the library to *not* translate \r\n to \n upon read, or the inverse >> > on write. In ot

Re: Tutorial or example use for python-graph library

2009-05-08 Thread (e.g. emre)
On May 8, 3:21 pm, Paul Moore wrote: > I have just discovered the python-graph library. I've been interested > in graph algorithms for a long time, so I'd like to give this a try. > But there seems to be very little in the way of examples, or tutorial > documentation available. There's the API do

Re: list comprehension question

2009-05-08 Thread J Kenneth King
Terry Reedy writes: > J Kenneth King wrote: >> >> Keep in mind that nested comprehensions are still available because >> they do have a use case that justifies their existence. > > Nested comprehensions are available because because the syntax makes > them available by default and making a fiddly

Re: SQL and CSV

2009-05-08 Thread Nick
On May 8, 1:49 pm, "andrew cooke" wrote: > Lawrence D'Oliveiro wrote: > > In message , Peter Otten wrote: > > >> While it may not matter here using placeholders instead of manually > >> escaping user-provided values is a good habit to get into. > > > Until you hit things it can't deal with. > > Th

Re: Compiling snippets of python code

2009-05-08 Thread Scott David Daniels
Basil Brush wrote: I need some advice on compiling snippets of python source at runtime. So perhaps some python experts can point the way. I am rewriting an old Java app in python. It tries to find solutions to computational problems based on the idea of genetic evolution. The Java version just

Re: Creating temperory files for a web application

2009-05-08 Thread Stephen Hansen
> > > Thank you Diez. > I would like to go ahead with the cleanest solution indeed. > I am creating the image on the fly. But I could not understand what > you meant by render to memory as a string. > How do we send the image to the browser? > > Were you mentioning about having the image as a strin

Re: Public attributes with really private data

2009-05-08 Thread Mark Summerfield
On 8 May, 13:56, Peter Otten <__pete...@web.de> wrote: > Mark Summerfield wrote: > > On 8 May, 08:19, Peter Otten <__pete...@web.de> wrote: > >> MarkSummerfieldwrote: > >> > I had a quick search & didn't find anything _nice_ that produced > >> > attributes with really private data, so I came up wit

unicode bit me

2009-05-08 Thread anuraguni...@yahoo.com
#how can I print a list of object which may return unicode representation? # -*- coding: utf-8 -*- class A(object): def __unicode__(self): return u"©au" __str__ = __repr__ = __unicode__ a = A() try: print a # doesn't work? except UnicodeEncodeError,e: print e try: p

Re: Call a function when a thread exits

2009-05-08 Thread Giampaolo Rodola'
On 8 Mag, 03:33, Carl Banks wrote: > On May 7, 6:12 pm, "Giampaolo Rodola'" wrote: > > > > > > > Hi, > > I'm searching for a smooth way to call a certain function when a > > thread has finished its job. > > I guess I can keep calling isAlive() in a loop and call my function > > when it returns Fa

Re: Tutorial or example use for python-graph library

2009-05-08 Thread Scott David Daniels
Paul Moore wrote: I have just discovered the python-graph library. I've been interested in graph algorithms for a long time, so I'd like to give this a try. But there seems to be very little in the way of examples, or tutorial documentation available. There's the API documentation, but that's not

Re: Newcomer to Python tutorial question

2009-05-08 Thread Peter Pearson
On Fri, 8 May 2009 10:16:55 +0100, Alan Cameron wrote: [snip] > > In particular reference to the tutorial section > http://docs.python.org/3.0/tutorial/datastructures.html#nested-list-comprehensions > > There is a word which is ambiguous, at least to me. > > Perhaps you can explain the use of the

Re: php to python code converter

2009-05-08 Thread Pascal Chambon
Hello That's funny, I was precisely thinking about a php to python converter, some weeks ago. Such a tool, allowing for example to convert some CMS like Drupal to python, would be a killer app, when we consider the amount of php code available. But of course, there are lots of issues that'd

Path difficulties with Python 2.5 running on Cygwin

2009-05-08 Thread walterbyrd
It workerd fine yesterday, but it won't work today. I can still run python, but when I try to import csv, I get an error: File "/usr/lib/python2.5/csv.py", line 8 in . . . The module is there. I am guessing that python can not find it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Path difficulties with Python 2.5 running on Cygwin

2009-05-08 Thread walterbyrd
On May 8, 9:22 am, walterbyrd wrote: > It workerd fine yesterday, but it won't work today. > > I can still run python, but when I try to import csv, I get an error: > > File "/usr/lib/python2.5/csv.py", line 8 in  . . . > > The module is there. I am guessing that python can not find it. I should

Decorating methods - where do my arguments go?

2009-05-08 Thread Mikael Olofsson
Hi all! I have long tried to avoid decorators, but now I find myself in a situation where I think they can help. I seem to be able to decorate functions, but I fail miserably when trying to decorate methods. The information I have been able to find on-line focuses on decorating functions, and

Re: Path difficulties with Python 2.5 running on Cygwin

2009-05-08 Thread Jerry Hill
On Fri, May 8, 2009 at 11:29 AM, walterbyrd wrote: > I accidently named a script csv.py, put I deleted that. You probably still have a stale csv.pyc in that directory. Delete that too. To tell for sure, open the python interpreter and do: import csv print csv.__file__ That will tell you exactl

Re: php to python code converter

2009-05-08 Thread D'Arcy J.M. Cain
On Fri, 08 May 2009 17:19:13 +0200 Pascal Chambon wrote: > That's funny, I was precisely thinking about a php to python converter, > some weeks ago. > Such a tool, allowing for example to convert some CMS like Drupal to > python, would be a killer app, when we consider the amount of php code >

Re: unicode bit me

2009-05-08 Thread Scott David Daniels
anuraguni...@yahoo.com wrote: #how can I print a list of object which may return unicode representation? # -*- coding: utf-8 -*- class A(object): def __unicode__(self): return u"©au" __str__ = __repr__ = __unicode__ a = A() try: print a # doesn't work? except UnicodeEncod

Re: Path difficulties with Python 2.5 running on Cygwin

2009-05-08 Thread walterbyrd
On May 8, 9:36 am, Jerry Hill wrote: > On Fri, May 8, 2009 at 11:29 AM, walterbyrd wrote: > > I accidently named a script csv.py, put I deleted that. > > You probably still have a stale csv.pyc in that directory.  Delete that too. > I don't, I am very certain of that. I have also used find to ma

Re: free chart lib for Python?

2009-05-08 Thread Glenn Hutchings
On Fri, 08 May 2009 10:27:08 +0800, oyster wrote: > I mean chart, not plot. If you don't know the difference, you can > check www.advsofteng.com, which is a commercial program > > is there such a thing with many kinds of chart, i.e. pie-chart, > line-chart, ..? You could try matplotlib: http

Re: subprocess.Popen howto?

2009-05-08 Thread norseman
Øystein ; Down below: change >yourPy.py to | yourPy.py I just noticed the typo. Sorry Steve norseman wrote: Øystein Johansen (OJOHANS) wrote: Hi, I have problems understanding the subprocess.Popen object. I have a iterative calculation in a process running and I want to pipe the

Re: Path difficulties with Python 2.5 running on Cygwin

2009-05-08 Thread walterbyrd
On May 8, 10:01 am, walterbyrd wrote: > On May 8, 9:36 am, Jerry Hill wrote: > > > On Fri, May 8, 2009 at 11:29 AM, walterbyrd wrote: > > > I accidently named a script csv.py, put I deleted that. > > > You probably still have a stale csv.pyc in that directory.  Delete that too. > Okay, I got it

Re: Compiling snippets of python code

2009-05-08 Thread Basil Brush
Scott David Daniels wrote: > make lists and dictionaries containing functions, and that would be > the normal Python way of handling this, rather than generating source > from snippets. You should take a look at Numpy if the "maths functions" Thank you very much for your response. I hadn't thoug

Re: php to python code converter

2009-05-08 Thread Pascal Chambon
D'Arcy J.M. Cain a écrit : On Fri, 08 May 2009 17:19:13 +0200 Pascal Chambon wrote: That's funny, I was precisely thinking about a php to python converter, some weeks ago. Such a tool, allowing for example to convert some CMS like Drupal to python, would be a killer app, when we consider th

Re: php to python code converter

2009-05-08 Thread Pascal Chambon
D'Arcy J.M. Cain a écrit : On Fri, 08 May 2009 17:19:13 +0200 Pascal Chambon wrote: That's funny, I was precisely thinking about a php to python converter, some weeks ago. Such a tool, allowing for example to convert some CMS like Drupal to python, would be a killer app, when we consider t

Re: free chart lib for Python?

2009-05-08 Thread cgoldberg
> You could try matplotlib:http://matplotlib.sourceforge.net. +1 Matplotlib. It's a very nice module with impressive graphing/charting/plotting capabilities. -- http://mail.python.org/mailman/listinfo/python-list

Re: SQL and CSV

2009-05-08 Thread andrew cooke
even if you're not open to injection attacks, you're still less likely to get escaping correct than a puprose written, widely used library. my request for more information was directed to lawrence, who said "until you hit things it can't deal with" which seemed to be some kind of cryptic argument

Re: Path difficulties with Python 2.5 running on Cygwin

2009-05-08 Thread Scott David Daniels
walterbyrd wrote: On May 8, 10:01 am, walterbyrd wrote: On May 8, 9:36 am, Jerry Hill wrote: On Fri, May 8, 2009 at 11:29 AM, walterbyrd wrote: I accidently named a script csv.py, put I deleted that. You probably still have a stale csv.pyc in that directory. Delete that too. Okay, I got

Re: Decorating methods - where do my arguments go?

2009-05-08 Thread Peter Otten
Mikael Olofsson wrote: > Hi all! > > I have long tried to avoid decorators, but now I find myself in a > situation where I think they can help. I seem to be able to decorate > functions, but I fail miserably when trying to decorate methods. The > information I have been able to find on-line focus

Re: php to python code converter

2009-05-08 Thread Dotan Cohen
> I'm not a big fan of PHP but I don't understand the desireability of > such a tool.  If you have a good PHP app just run it.  The point of > Python in my mind is that it is a cleaner syntax and promotes better > code.  Anything that converts PHP to Python is going to leave you with > some butt-ug

building 32-bit PyQT4 and matplotlib on X86_64

2009-05-08 Thread enricong
I'm having some issues attempting to build PyQT4 and matplotlib. I'm on a 64-bit machine and am trying to build a 32-bit version. I have already installed seperate 32-bit libs and a 32-bit version of python however I continue to run into two basic problems With PyQT4, I dont know how to tell it

How to debug this import problem?

2009-05-08 Thread Iwan Vosloo
Hi there, We have a rather complicated program which does a bit of os.chdir and sys.path manipulations. In between all of this, it imports the decimal module several times. However, it imports a new instance of decimal sometimes. (Which is a problem, since a decimal.Decimal (imported at point A

Re: How do I test the integrity of a Python installation in Debian and Ubuntu

2009-05-08 Thread Aahz
In article , Geoff Gardiner wrote: > >How do I assure myself of the integrity of a Python installation >acquired using apt-get install on Debian and Ubuntu? How important is the apt-get requirement? Building Python yourself in this situation sounds like it would be simpler/safer. -- Aahz (a...

import overwrites __name__

2009-05-08 Thread Marco
Hi, There happened something that I do not understand. Actually I don't even know how it can be possible. I import a module and then the name space of the importing module seems do be overwritten. my_name = __name__ print my_name print len(dir()) from x import y as z print __name__ print len(d

Re: php to python code converter

2009-05-08 Thread D'Arcy J.M. Cain
On Fri, 8 May 2009 19:33:10 +0300 Dotan Cohen wrote: > It would be a great learning tool. I am pretty decent with PHP but > just getting started in Python. This might help such users flatten out > the learning curve. If there were such a tool available I would sugegst it come with huge warnings s

Re: Self function

2009-05-08 Thread Gabriel Genellina
En Wed, 06 May 2009 23:32:23 -0300, Luis Alberto Zarrabeitia Gomez escribió: Quoting Steven D'Aprano : But regardless, everyone is missing the most important point: why are you copying and pasting code in the first place? That is surely very close to the top of the list of Worst Ever An

Re: subprocess.Popen howto?

2009-05-08 Thread norseman
Carl Banks wrote: On May 7, 2:58 pm, norseman wrote: If you don't like a lot of typing that obscures the process, take a look at os.Popen2 Pg.39 or so in Lib.pdf for 2.5.2 In this case - the popen3 is probably your best bet. I took a test run on "subprocess" a few months ago. My review: exces

Re: How to debug this import problem?

2009-05-08 Thread Diez B. Roggisch
Iwan Vosloo wrote: > Hi there, > > We have a rather complicated program which does a bit of os.chdir and > sys.path manipulations. In between all of this, it imports the decimal > module several times. > > However, it imports a new instance of decimal sometimes. (Which is a > problem, since a

Re: php to python code converter

2009-05-08 Thread Diez B. Roggisch
Dotan Cohen wrote: >> I'm not a big fan of PHP but I don't understand the desireability of >> such a tool.  If you have a good PHP app just run it.  The point of >> Python in my mind is that it is a cleaner syntax and promotes better >> code.  Anything that converts PHP to Python is going to leave

Re: php to python code converter

2009-05-08 Thread Dotan Cohen
> I'm almost 100% sure it won't. The code is machine-generated, thus not easy > to the human eye, not idiomatic so you don't learn how to write good python > through it. You learn how to jump through hoops to code the same way in > python that you do in PHP. > I meant for single functions, not for

Re: FLV download script works, but I want to enhance it

2009-05-08 Thread The Music Guy
On Thu, May 7, 2009 at 9:29 AM, Aahz wrote: > > Here's my download script to get you started figuring this out, it does > the wget in the background so that several downloads can run in parallel > from a single terminal window: > > #!/bin/bash > > echo "Downloading $1" > wget "$1" > /dev/null 2>&1

Re: How to debug this import problem?

2009-05-08 Thread Scott David Daniels
Diez B. Roggisch wrote: Iwan Vosloo wrote: We have a rather complicated program which does a bit of os.chdir and sys.path manipulations. In between all of this, it imports the decimal module several times However, it imports a new instance of decimal sometimes. (Which is a problem, since a

Re: unicode bit me

2009-05-08 Thread Terry Reedy
Scott David Daniels wrote: It would be a bit easier if people would bother to mention their Python version, as we regularly get questions from people running 2.3, 2.4, 2.5, 2.6, 2.7a, 3.0, and 3.1b. They run computers with differing operating systems and versions such as: Windows 2000, OS/X Leo

Re: import overwrites __name__

2009-05-08 Thread Terry Reedy
Marco wrote: Hi, There happened something that I do not understand. Actually I don't even know how it can be possible. I import a module and then the name space of the importing module seems do be overwritten. my_name = __name__ print my_name print len(dir()) from x import y as z print __n

ECG segmentation

2009-05-08 Thread Filip Gruszczyński
Hi! I need to create a script, that performs ECG segmentation, but I can hardly find any useful materials on the web. Did anyone try to do this and could point me to some good materials/snippets about this? -- Filip Gruszczyński -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode bit me

2009-05-08 Thread J. Cliff Dyer
On Fri, 2009-05-08 at 07:53 -0700, anuraguni...@yahoo.com wrote: > #how can I print a list of object which may return unicode > representation? > # -*- coding: utf-8 -*- > > class A(object): > > def __unicode__(self): > return u"©au" > > __str__ = __repr__ = __unicode__ > Your

I'm intrigued that Python has some functional constructions in the language.

2009-05-08 Thread Casey Hawthorne
I'm intrigued that Python has some functional constructions in the language. Would it be possible to more clearly separate the pure code (without side effects) from the impure code (that deals with state changes, I/O, etc.), so that the pure code could be compiled and have aggressive functional tr

Re: php to python code converter

2009-05-08 Thread J. Cliff Dyer
On Fri, 2009-05-08 at 17:19 +0200, Pascal Chambon wrote: > PS : Am I the only one having most of answers rejected by the > antispam > system of python-list ? That's humiliating :p > I've had several messages not make it through. :( -- http://mail.python.org/mailman/listinfo/python-list

Re: ECG segmentation

2009-05-08 Thread CTO
On May 8, 2:04 pm, Filip Gruszczyński wrote: > Hi! > > I need to create a script, that performs ECG segmentation, but I can > hardly find any useful materials on the web. Did anyone try to do this > and could point me to some good materials/snippets about this? > > -- > Filip Gruszczyński How are

Re: I'm intrigued that Python has some functional constructions in the language.

2009-05-08 Thread pruebauno
On May 8, 3:04 pm, Casey Hawthorne wrote: > I'm intrigued that Python has some functional constructions in the > language. > > Would it be possible to more clearly separate the pure code (without > side effects) from the impure code (that deals with state changes, > I/O, etc.), so that the pure co

Re: I'm intrigued that Python has some functional constructions in the language.

2009-05-08 Thread Carl Banks
On May 8, 12:04 pm, Casey Hawthorne wrote: > I'm intrigued that Python has some functional constructions in the > language. > > Would it be possible to more clearly separate the pure code (without > side effects) from the impure code (that deals with state changes, > I/O, etc.), so that the pure c

Re: import overwrites __name__

2009-05-08 Thread Marco
Terry Reedy wrote: > Marco wrote: >> Hi, >> >> There happened something that I do not understand. Actually I don't even >> know how it can be possible. >> >> I import a module and then the name space of the importing module seems >> do be overwritten. >> >> my_name = __name__ >> print my_name >

Complete frustration

2009-05-08 Thread hellcats
I have Python2.5 installed on Windows XP. Whenever I double click on a something.pyw file, IDLE launches and opens something.pyw in the editor. I would prefer to actually *RUN* the program, not edit it. If I want to edit it then I'll choose the "Edit with IDLE" context menu. So I then have to press

Re: I'm intrigued that Python has some functional constructions in the language.

2009-05-08 Thread namekuseijin
prueba...@latinmail.com escreveu: Don't forget that the Python interpreter is simple. It makes maintenance easier and allows embedding it into other programs. Good optimizing compilers for functional languages are not simple. Good optimizing compilers are not simple, period. The python interpr

  1   2   >