Re: [Tutor] Arbitrary-argument set function

2013-10-01 Thread Steven D'Aprano
On Tue, Oct 01, 2013 at 11:43:09PM +0100, Spyros Charonis wrote: > Dear Pythoners, > > > I am trying to extract from a set of about 20 sequences, the characters > which are unique to each sequence. For simplicity, imagine I have only 3 > "sequences" (words in this example) such as: > > > s1='sp

Re: [Tutor] Arbitrary-argument set function

2013-10-01 Thread Alan Gauld
On 01/10/13 23:43, Spyros Charonis wrote: I am trying to extract from a set of about 20 sequences, the characters which are unique to each sequence. For simplicity, imagine I have only 3 "sequences" (words in this example) such as: s1='spam'; s2='scam', s3='slam' I would like the character t

Re: [Tutor] Arbitrary-argument set function

2013-10-01 Thread Dave Angel
On 1/10/2013 18:43, Spyros Charonis wrote: > Dear Pythoners, > > > I am trying to extract from a set of about 20 sequences, the characters > which are unique to each sequence. For simplicity, imagine I have only 3 > "sequences" (words in this example) such as: > > > s1='spam'; s2='scam', s3='slam'

[Tutor] Arbitrary-argument set function

2013-10-01 Thread Spyros Charonis
Dear Pythoners, I am trying to extract from a set of about 20 sequences, the characters which are unique to each sequence. For simplicity, imagine I have only 3 "sequences" (words in this example) such as: s1='spam'; s2='scam', s3='slam' I would like the character that is unique to each seque

Re: [Tutor] Python for SPSS help

2013-10-01 Thread Alan Gauld
On 01/10/13 19:21, Elise Rosa wrote: Hello! I'm using Python in SPSS to rename and arrange some files. The setup is this: I have many .txt files in a folder, and I'd like to first remove part of their names. Next, I need to paste the second and third columns from each .txt file into another docu

Re: [Tutor] PYTHON 2.5.6 64 Bit Compilation is failing on Aix

2013-10-01 Thread Alan Gauld
On 01/10/13 12:00, D N, Mahesh wrote: While compiling python2.5.6 by passing 64 bit arguments on aix5.3, make is failing . The tutor list is for folks learning the Python language and standard library. You might find somebody here familiar with compiling on AIX (although maybe not v2.5 - why

[Tutor] PYTHON 2.5.6 64 Bit Compilation is failing on Aix

2013-10-01 Thread D N, Mahesh
Hi, While compiling python2.5.6 by passing 64 bit arguments on aix5.3, make is failing . Command used to build: ./configure --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64" --disable-ipv6 AR="ar -X64" --prefix=/usr/prasad/python --disable-shared --with-libs='/usr/prasad/ncurses/lib/libncurses.

[Tutor] Python for SPSS help

2013-10-01 Thread Elise Rosa
Hello! I'm using Python in SPSS to rename and arrange some files. The setup is this: I have many .txt files in a folder, and I'd like to first remove part of their names. Next, I need to paste the second and third columns from each .txt file into another document (could be an excel sheet), and mat

Re: [Tutor] sqlite3 COMMIT directive

2013-10-01 Thread Tim Golden
On 01/10/2013 11:41, Tim Golden wrote: > You're sort-of correct. What happens is that the database doesn't enter > autocommit mode (you'll still need to specify the right isolation level > on the .connect for that). Rather, the __exit__ method of the > connection-as-context-manager issues the db.co

Re: [Tutor] sqlite3 COMMIT directive

2013-10-01 Thread Alan Gauld
On 01/10/13 11:41, Tim Golden wrote: Python, the database starts and ends transactions automatically from within the execute() function. Not so, I'm afraid. If you want autocommit, you need to send an isolation_level of None to the .connect function. """ Connection objects can be used as co

Re: [Tutor] sqlite3 COMMIT directive

2013-10-01 Thread Tim Golden
On 01/10/2013 11:28, Alan Gauld wrote: > On 01/10/13 09:25, Tim Golden wrote: >> On 01/10/2013 09:03, Alan Gauld wrote: >>> You don't normally need to use COMMIT when programming SQLite from >>> Python, the database starts and ends transactions automatically from >>> within the execute() function.

Re: [Tutor] Tutor Digest, Vol 116, Issue 4

2013-10-01 Thread Ismar Sehic
can't even do that, then it obviously > won't work when you try to contact the same URL via your program. > > I'd suggest you go find a working web service, and experiment interfacing > with that first. You can hopefully find some to work with here: > http://www.webservice

Re: [Tutor] sqlite3 COMMIT directive

2013-10-01 Thread Alan Gauld
On 01/10/13 09:25, Tim Golden wrote: On 01/10/2013 09:03, Alan Gauld wrote: You don't normally need to use COMMIT when programming SQLite from Python, the database starts and ends transactions automatically from within the execute() function. Not so, I'm afraid. If you want autocommit, you nee

Re: [Tutor] sqlite3 COMMIT directive

2013-10-01 Thread Alex Kleider
Thank you to respondents. That the code worked at all is something I don't understand. As Alan G pointed out, I had forgotten to include the "cur = con.cursor()" line. After this was corrected and the try/except statement deleted, it worked as I expected. Thanks to "-nick" for pointing me to

Re: [Tutor] soappy, soap, xml ..fuss

2013-10-01 Thread Walter Prins
Hi, On 1 October 2013 09:08, Ismar Sehic wrote: > hello, it's me again with my stubborn soap and xml request.please take a > look at this code and the output, just tell if i'm missing something - i > don't get it. > >> File "/usr/lib/python2.6/socket.py", line 514, in create_connection >>

Re: [Tutor] sqlite3 COMMIT directive

2013-10-01 Thread Mark Lawrence
On 01/10/2013 04:16, Alex Kleider wrote: try: cur.execute("COMMIT;") except: pass And the problem = \ """ If the 'cur.execute("COMMIT;")' statement is left by itself, outside of a "try/except" clause, I get an error with the following t

Re: [Tutor] sqlite3 COMMIT directive

2013-10-01 Thread Tim Golden
On 01/10/2013 09:03, Alan Gauld wrote: > You don't normally need to use COMMIT when programming SQLite from > Python, the database starts and ends transactions automatically from > within the execute() function. You only need to manually commit if you > manually create the transaction using BEGIN..

[Tutor] soappy, soap, xml ..fuss

2013-10-01 Thread Ismar Sehic
hello, it's me again with my stubborn soap and xml request.please take a look at this code and the output, just tell if i'm missing something - i don't get it. > code > ''' > Created on 30.09.2013 > > @author: i.sehic > ''' > import SOAPpy > from xml.etree.ElementTree import Element, SubEle

Re: [Tutor] sqlite3 COMMIT directive

2013-10-01 Thread Alan Gauld
On 01/10/13 09:03, Alan Gauld wrote: BTW. I notice you are using an implicit cursor within the with block. Now while that may work, my personal preference is for explicit variables, ... Actually I'm not sure how it is working. I've just read the docs again and it seems to me that your code sh

Re: [Tutor] sqlite3 COMMIT directive

2013-10-01 Thread Alan Gauld
On 01/10/13 04:16, Alex Kleider wrote: And the problem = \ """ If the 'cur.execute("COMMIT;")' statement is left by itself, outside of a "try/except" clause, I get an error with the following trace back: " Traceback (most recent call last): File "./uwomeds68.py", line 119, in go_on.inse

Re: [Tutor] Creating To Do List Program - Question

2013-10-01 Thread Alan Gauld
On 01/10/13 02:25, Steven D'Aprano wrote: Ah, no I think I see what Rafael is trying to do! I remember those old BASIC listings from the 1970s where the first thing the program did was print out a page and a half of introductory text telling you what the program did and what commands to give to