Re: [Tutor] pgdb and console output

2010-03-10 Thread Alan Gauld
"pylist1" wrote sys.stdout.write(str(i)) Yes that does indeed work like this: But it leaves formatting issues with leaving the command prompt in the middle of the screen. That's not an issue at the moment. Yes, stdout.write has no formatting if you need spaces or newlines you have to exp

Re: [Tutor] Macbook Pro+python programming

2010-03-10 Thread Alan Gauld
"Brett Wunderlich" wrote Because I just got a brand new Mac (the one on apple store) and it seems that the build in Python 2.6.1 from darwin is garbage Thats unlikely, but the configuration may be faulty. dual core and each time I open terminal, then type idle and try to use IDLE the scree

Re: [Tutor] Encoding

2010-03-10 Thread Giorgio
2010/3/8 Dave Angel > >> You still didn't provide the full context. Are you trying to do store > binary data, or not? > Yes i think ti's binary data. I'm just reading with file.read a JPG image. Stefan: yes, read that tutorial :) Giorgio > > > -- -- AnotherNetFellow Email: anothernetfel.

Re: [Tutor] WSGI / Apache

2010-03-10 Thread Giorgio
2010/3/8 Benno Lang > > > WSGI is based on CGI, so I imagine that it's not too difficult to have > a wrapper that converts between the protocols. I haven't tried > wsgiref, though. > Yes Benno it isn't. It seems that mod_wsgi is the most used alternative. > > > Do you have any idea i should us

[Tutor] Timezone issues with datetime module.

2010-03-10 Thread kushal gupta
Hi, I am facing an issue with datetime module with some timezones (especially day light savings). Given the date and the timezone, I want to convert it to the UTC date and time. Here is the snippet: import datetime import mx.DateTime from dateutil import zoneinfo def parse_date(date, tzname):

Re: [Tutor] SQLite error messages

2010-03-10 Thread Alan Harris-Reid
Benno Lang wrote: On 10 March 2010 11:37, Alan Harris-Reid wrote: Hi there, I am using the sqlite3 module with Python 3.1, and have some code which goes something like as follows... import sqlite3 con = sqlite3.connect('MyDatabase.db') try: execresult = con.execute('INSERT INTO MyTable

Re: [Tutor] SQLite error messages

2010-03-10 Thread Alan Harris-Reid
Sander Sweers wrote: - Original message - I am using the sqlite3 module with Python 3.1, and have some code which goes something like as follows... import sqlite3 con = sqlite3.connect('MyDatabase.db') try: execresult = con.execute('INSERT INTO MyTable (field_name) VALUES ("

Re: [Tutor] SQLite error messages

2010-03-10 Thread Sander Sweers
On 10 March 2010 21:02, Alan Harris-Reid wrote: > Maybe I have misunderstood you, but I always thought that the 'finally' > section was run even if the 'try' section is successful, in which case I > would not want a rollback. I was thinking something like this. import sqlite3 con = sqlite3.conne

[Tutor] Running a dos program with python

2010-03-10 Thread Armstrong, Richard J.
Hello all, This is my first post to the Tutor@python.org mailing list. I am in the process of switching from Matlab to Python and there is one task that I am having a hard time doing and cannot find the answer on the web. I want to write a script in python that will open up a windows dos progra

Re: [Tutor] Running a dos program with python

2010-03-10 Thread Wayne Werner
On Wed, Mar 10, 2010 at 3:20 PM, Armstrong, Richard J. < rarms...@water.ca.gov> wrote: > Hello all, > > > > This is my first post to the Tutor@python.org mailing list. I am in the > process of switching from Matlab to Python and there is one task that I am > having a hard time doing and cannot fi

Re: [Tutor] Running a dos program with python

2010-03-10 Thread Armstrong, Richard J.
From: sri...@gmail.com [mailto:sri...@gmail.com] On Behalf Of Wayne Werner Sent: Wednesday, March 10, 2010 2:24 PM To: Armstrong, Richard J. Cc: tutor@python.org Subject: Re: [Tutor] Running a dos program with python On Wed, Mar 10, 2010 at 3:20 PM, Armstrong, Richard J. wrote: Hello al

Re: [Tutor] Difflib comparing string sequnces

2010-03-10 Thread Ricardo Aráoz
Vincent Davis wrote: > I have never used the difflib or similar and have a few questions. > I am working with DNA sequences of length 25. I have a list of 230,000 > and need to look for each sequence in the entire genome (toxoplasma > parasite) I am not sure how large the genome is but more that 23

Re: [Tutor] Difflib comparing string sequnces

2010-03-10 Thread Ricardo Aráoz
Vincent Davis wrote: > I have never used the difflib or similar and have a few questions. > I am working with DNA sequences of length 25. I have a list of 230,000 > and need to look for each sequence in the entire genome (toxoplasma > parasite) I am not sure how large the genome is but more that 23

Re: [Tutor] Running a dos program with python

2010-03-10 Thread Wayne Werner
On Wed, Mar 10, 2010 at 4:51 PM, Armstrong, Richard J. < rarms...@water.ca.gov> wrote: > > > The dos program pops up and if I hit the enter key three times then it > runs. How can I add these three “enters” into the script? > I'm not at all sure if this way would work, but you could send the \r\n

Re: [Tutor] Running a dos program with python

2010-03-10 Thread Randy Raymond
I use wxPython, which allows a statement like: wx.Execute('c:\shake91.exe "FLAC.txt" "a.txt" "b.txt"') From: Armstrong, Richard J. Sent: Wednesday, March 10, 2010 4:51 PM To: Wayne Werner Cc: tutor@python.org Subject: Re: [Tutor] Running a dos program with python From: sri...@

Re: [Tutor] Running a dos program with python

2010-03-10 Thread Armstrong, Richard J.
From: sri...@gmail.com [mailto:sri...@gmail.com] On Behalf Of Wayne Werner Sent: Wednesday, March 10, 2010 3:00 PM To: Armstrong, Richard J. Cc: tutor@python.org Subject: Re: [Tutor] Running a dos program with python On Wed, Mar 10, 2010 at 4:51 PM, Armstrong, Richard J. wrote: The d

Re: [Tutor] Running a dos program with python

2010-03-10 Thread Armstrong, Richard J.
Thanks Randy, maybe I should check out wxPython. From: tutor-bounces+rarmstro=water.ca@python.org [mailto:tutor-bounces+rarmstro=water.ca@python.org] On Behalf Of Randy Raymond Sent: Wednesday, March 10, 2010 3:06 PM To: Tutor Python Subject: Re: [Tutor] Running a dos program with pytho

Re: [Tutor] Running a dos program with python

2010-03-10 Thread Martin Walsh
Armstrong, Richard J. wrote: > Hello all, > > This is my first post to the Tutor@python.org > mailing list. I am in the process of switching from Matlab to Python and > there is one task that I am having a hard time doing and cannot find the > answer on the web. I want to

Re: [Tutor] Difflib comparing string sequnces

2010-03-10 Thread Vincent Davis
@Ricardo Aráoz Thanks for your response, Before I saw your response I had posted the question on stack overflow. See link below. I like your solution better than the re solution posted. It looks like this task may take longer than I think. The .re solution I guess might take more than 10 days. The

[Tutor] Feedparser and Google News feeds

2010-03-10 Thread David Kim
I have been working through some of the examples in the Programming Collective Intelligence book by Toby Segaran. I highly recommend it, btw. Anyway, some of the exercises use feedparser to pull in RSS/Atom feeds from different sources (before doing more interesting things). The algorithm stuff I

Re: [Tutor] Timezone issues with datetime module.

2010-03-10 Thread DK
kushal gupta gmail.com> writes: > > Hi,  I am facing an issue with datetime module with some timezones You may want to check out the pytz library at http://pytz.sourceforge.net/ for easier timezone manipulation. ___ Tutor maillist - Tutor@pytho

[Tutor] Feedparser and google news/google reader

2010-03-10 Thread David Kim
I have been working through some of the examples in the Programming Collective Intelligence book by Toby Segaran. I highly recommend it, btw. Anyway, one of the simple exercises required is using feedparser to pull in RSS/Atom feeds from different sources (before doing more interesting things). Th

Re: [Tutor] Feedparser and google news/google reader

2010-03-10 Thread Alan Gauld
"David Kim" wrote me CRAZY. I can't seem to pull more than 10 items from a google news feed. For example, I'd like to pull 1000 google news items (using some search term, let's say 'lightsabers'). The associated atom feed url, however, only holds ten items. And its hard to do some of the clu