Re: [Tutor] SQLite error messages

2010-03-09 Thread Sander Sweers
- 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 > ("MyValue")')

[Tutor] Difflib comparing string sequnces

2010-03-09 Thread Vincent Davis
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 230,000 sequences. The are prog

Re: [Tutor] SQLite error messages

2010-03-09 Thread Benno Lang
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 (field_

[Tutor] SQLite error messages

2010-03-09 Thread Alan Harris-Reid
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 (field_name) VALUES ("MyValue")') con.commit() except: con.ro

Re: [Tutor] Macbook Pro+python programming

2010-03-09 Thread Brett Wunderlich
On Mar 9, 2010, at 12:35 PM, tutor-requ...@python.org wrote: > Does anybody know any good python emulator that would work perfectly with > Mac OSX Leopard? > > 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 I'm run

Re: [Tutor] split a 5 chars word into 4 and 1

2010-03-09 Thread عمـ نوفل ـاد
On Tue, Mar 9, 2010 at 11:03 AM, Stefan Behnel wrote: > Emad Nawfal (عمـ نوفل ـاد), 09.03.2010 16:45: > > What about indexing >> part1 = word[:4] >> > > That's slicing. > > part2 = word[4] >> > > That's indexing. > > Stefan > Thanks Stefan. > > ___ >

Re: [Tutor] Macbook Pro+python programming

2010-03-09 Thread Shashwat Anand
On Wed, Mar 10, 2010 at 12:05 AM, Marco Rompré wrote: > Does anybody know any good python emulator that would work perfectly with > Mac OSX Leopard? > Why emulator ? Python 2.6.1 is pre-installed. You can install newer versions too. > > Because I just got a brand new Mac (the one on apple store)

[Tutor] Macbook Pro+python programming

2010-03-09 Thread Marco Rompré
Does anybody know any good python emulator that would work perfectly with Mac OSX Leopard? 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 I'm running a 2,88 ghz dual core and each time I open terminal, then type idle a

Re: [Tutor] split a 5 chars word into 4 and 1

2010-03-09 Thread Stefan Behnel
Emad Nawfal (عمـ نوفل ـاد), 09.03.2010 16:45: What about indexing part1 = word[:4] That's slicing. part2 = word[4] That's indexing. Stefan ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.

Re: [Tutor] split a 5 chars word into 4 and 1

2010-03-09 Thread عمـ نوفل ـاد
On Tue, Mar 9, 2010 at 10:31 AM, Rafik Ouerchefani wrote: > Hello, > > I'm trying to split 5 chars words (codes) into 2 variables. The first must > contain the first 4 characters. The second variable will only contain the > last character. I'm working in a loop pre-generated codes. > > Any magic c

Re: [Tutor] split a 5 chars word into 4 and 1

2010-03-09 Thread Serdar Tumgoren
> Hello, > > I'm trying to split 5 chars words (codes) into 2 variables. The first must > contain the first 4 characters. The second variable will only contain the > last character. I'm working in a loop pre-generated codes. > > Any magic command for this ? :-) > > Examples of codes : > 3cmvA > 3cm

Re: [Tutor] pgdb and console output

2010-03-09 Thread pylist1
On Mon, 8 Mar 2010, Alan Gauld wrote: "hithere there" wrote #! /usr/bin/env python import pgdb, sys db = pgdb.connect (dsn='192.168.0.1:familydata', user='postgres', password='') cursor = db.cursor () cursor.execute ("select * from names") rows = cursor.fetchall () for i in (ro

[Tutor] split a 5 chars word into 4 and 1

2010-03-09 Thread Rafik Ouerchefani
Hello, I'm trying to split 5 chars words (codes) into 2 variables. The first must contain the first 4 characters. The second variable will only contain the last character. I'm working in a loop pre-generated codes. Any magic command for this ? :-) Examples of codes : 3cmvA 3cmvB 3cmvC 3cmwA 1g18

Re: [Tutor] for _ in

2010-03-09 Thread spir
On Tue, 9 Mar 2010 11:25:19 +0800 Joson wrote: > if labels is None: labels = [OrderedSet() for _ in xrange(ndim)] > .. > > It's a library named "divisi". "OrderedSet" is a string set defined in this > lib. "ndim" is integer. What's the meaning of "for _ in" ? > > Joson