Re: SAX unicode and ascii parsing problem

2010-11-30 Thread Stefan Behnel
goldtech, 30.11.2010 22:15: Think I found it, for example: line = 'my big string' line.encode('ascii', 'ignore') I processed the problem strings during parsing with this and it works now. That's not the right way of dealing with encodings, though. You should open the file with a well defined

Watch the YANK CIA BUSTARDS Censorship live delete this post on KEY WIKILEAK REVELATIONS - RARE

2010-11-30 Thread small Pox
http://www.telegraph.co.uk/news/worldnews/northamerica/usa/8152326/WikiLeaks-release-Timeline-of-the-key-WikiLeaks-revelations.html WikiLeaks release: Timeline of the key WikiLeaks revelations By Jon Swaine in New York 6:53PM GMT 22 Nov 2010 December 2007: Guantanamo Bay operating procedures

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-11-30 Thread Martin v. Loewis
> This sounds like a strong prospect for how to get things working (I > didn't realize open would accept a bytes argument for the filename), > but I'm also interested in whether reading filenames from stdin and > subsequently opening them is supposed to "just work" given a suitable > encoding - lik

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-11-30 Thread Martin v. Loewis
> The world does not revolve around Python. Unix filenames have been > encoding-agnostic long before Python was around. If Python3 does not > support this then it's a regression on Python's part. Fortunately, Python 3 does support that. Regards, Martin -- http://mail.python.org/mailman/listinf

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-11-30 Thread Martin v. Löwis
> It'd be great if all programs used the same encoding on a given OS, > but at least on Linux, I believe historically filenames have been > created with different encodings. IOW, if I pick one encoding and go > with it, filenames written in some other encoding are likely to cause > problems. So I

Regarding searching directory and to delete it with specific pattern.

2010-11-30 Thread Ramprakash Jelari thinakaran
Hi all, Would like to search list of directories with specific pattern and delete it?.. How can i do it?. Example: in /home/jpr/ i have the following list of directories. 1.2.3-2, 1.2.3-10, 1.2.3-8, i would like to delete the directories other than 1.2.3-10 which is the higher value?.. Regards,

Re: Reading by positions plain text files

2010-11-30 Thread Tim Harig
On 2010-12-01, javivd wrote: > On Nov 30, 11:43 pm, Tim Harig wrote: >> On 2010-11-30, javivd wrote: >> >> > I have a case now in wich another file has been provided (besides the >> > database) that tells me in wich column of the file is every variable, >> > because there isn't any blank or tab

Re: Change one list item in place

2010-11-30 Thread Steve Holden
On 11/30/2010 8:28 PM, MRAB wrote: > On 01/12/2010 01:08, Gnarlodious wrote: >> This works for me: >> >> def sendList(): >> return ["item0", "item1"] >> >> def query(): >> l=sendList() >> return ["Formatting only {0} into a string".format(l[0]), l[1]] >> >> query() >> >> >> However,

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-11-30 Thread Albert Hopkins
On Wed, 2010-12-01 at 02:14 +, MRAB wrote: > If the filenames are to be shown to a user then there needs to be a > mapping between bytes and glyphs. That's an encoding. If different > users use different encodings then exchange of textual data becomes > difficult. That's presentation, that's s

To Thread or not to Thread....?

2010-11-30 Thread Jack Keegan
Hi there, I'm currently writing an application to control and take measurements during an experiments. This is to be done on an embedded computer running XPe so I am happy to have python available, although I am pretty new to it. The application basically runs as a state machine, which transitions

Re: Reading by positions plain text files

2010-11-30 Thread Tim Chase
On 11/30/2010 08:03 PM, javivd wrote: On Nov 30, 11:43 pm, Tim Harig wrote: VARIABLE NAME POSITION (COLUMN) IN FILE var_name_1 123-123 var_name_2 124-125 var_name_3 126-126 .. .. var_name_N 512-513 (last positions) and no,

Re: How to initialize each multithreading Pool worker with an individual value?

2010-11-30 Thread James Mills
On Wed, Dec 1, 2010 at 7:35 AM, Valery Khamenya wrote: > multithreading.pool Pool has a promissing initializer argument in its > constructor. > However it doesn't look possible to use it to initialize each Pool's > worker with some individual value (I'd wish to be wrong here) > > So, how to initia

Re: Reading by positions plain text files

2010-11-30 Thread MRAB
On 01/12/2010 02:03, javivd wrote: On Nov 30, 11:43 pm, Tim Harig wrote: On 2010-11-30, javivd wrote: I have a case now in wich another file has been provided (besides the database) that tells me in wich column of the file is every variable, because there isn't any blank or tab character tha

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-11-30 Thread MRAB
On 01/12/2010 01:28, Nobody wrote: On Tue, 30 Nov 2010 18:53:14 +0100, Peter Otten wrote: I think this is wrong. In Unix there is no concept of filename encoding. Filenames can have any arbitrary set of bytes (except '/' and '\0'). But the filesystem itself neither knows nor cares about enc

Re: Reading by positions plain text files

2010-11-30 Thread javivd
On Nov 30, 11:43 pm, Tim Harig wrote: > On 2010-11-30, javivd wrote: > > > I have a case now in wich another file has been provided (besides the > > database) that tells me in wich column of the file is every variable, > > because there isn't any blank or tab character that separates the > > vari

Re: Change one list item in place

2010-11-30 Thread Gnarlodious
Thanks. Unless someone has a simpler solution, I'll stick with 2 lines. -- Gnarlie -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming games in historical linguistics with Python

2010-11-30 Thread Gnarlodious
Have you considered entering all this data into an SQLite database? You could do fast searches based on any features you deem relevant to the phoneme. Using an SQLite editor application you can get started building a database right away. You can add columns as you get the inspiration, along with an

Re: Change one list item in place

2010-11-30 Thread MRAB
On 01/12/2010 01:08, Gnarlodious wrote: This works for me: def sendList(): return ["item0", "item1"] def query(): l=sendList() return ["Formatting only {0} into a string".format(l[0]), l[1]] query() However, is there a way to bypass the l=sendList() and change one list item

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-11-30 Thread Nobody
On Tue, 30 Nov 2010 18:53:14 +0100, Peter Otten wrote: >> I think this is wrong. In Unix there is no concept of filename >> encoding. Filenames can have any arbitrary set of bytes (except '/' and >> '\0'). But the filesystem itself neither knows nor cares about >> encoding. > > I think you mi

Intro to Python slides, was Re: how to go on learning python

2010-11-30 Thread Dan Stromberg
On Tue, Nov 30, 2010 at 6:37 AM, Xavier Heruacles wrote: > I'm basically a c/c++ programmer and recently come to python for some web > development. Using django and javascript I'm afraid I can develop some web > application now. But often I feel I'm not good at python. I don't know much > about ge

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-11-30 Thread Nobody
On Mon, 29 Nov 2010 21:26:23 -0800, Dan Stromberg wrote: > Does anyone know what I need to do to read filenames from stdin with > Python 3.1 and subsequently open them, when some of those filenames > include characters with their high bit set? Use "bytes" rather than "str". Everywhere. This means

Re: How to initialize each multithreading Pool worker with an individual value?

2010-11-30 Thread Dan Stromberg
On Tue, Nov 30, 2010 at 1:35 PM, Valery Khamenya wrote: > Hi, > > multithreading.pool Pool has a promissing initializer argument in its > constructor. > However it doesn't look possible to use it to initialize each Pool's > worker with some individual value (I'd wish to be wrong here) > > So, how

Change one list item in place

2010-11-30 Thread Gnarlodious
This works for me: def sendList(): return ["item0", "item1"] def query(): l=sendList() return ["Formatting only {0} into a string".format(l[0]), l[1]] query() However, is there a way to bypass the l=sendList() and change one list item in-place? Possibly a list comprehension opera

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-11-30 Thread Dan Stromberg
On Tue, Nov 30, 2010 at 9:53 AM, Peter Otten <__pete...@web.de> wrote: > $ ls > $ python3 > Python 3.1.1+ (r311:74480, Nov  2 2009, 15:45:00) > [GCC 4.4.1] on linux2 > Type "help", "copyright", "credits" or "license" for more information. with open(b"\xe4\xf6\xfc.txt", "w") as f: > ...     f.w

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-11-30 Thread Dan Stromberg
On Tue, Nov 30, 2010 at 7:19 AM, Antoine Pitrou wrote: > On Mon, 29 Nov 2010 21:52:07 -0800 (PST) > Yingjie Lan wrote: >> --- On Tue, 11/30/10, Dan Stromberg wrote: >> > In Python 3, I'm finding that I have encoding issues with >> > characters >> > with their high bit set.  Things are fine with

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-11-30 Thread Dan Stromberg
On Tue, Nov 30, 2010 at 11:47 AM, Martin v. Loewis wrote: >> Does anyone know what I need to do to read filenames from stdin with >> Python 3.1 and subsequently open them, when some of those filenames >> include characters with their high bit set? > > If your files on disk use file names encoded i

Re: Programming games in historical linguistics with Python

2010-11-30 Thread Vlastimil Brom
2010/11/30 Dax Bloom : > Hello, > > Following a discussion that began 3 weeks ago I would like to ask a > question regarding substitution of letters according to grammatical > rules in historical linguistics. I would like to automate the > transformation of words according to complex rules of phono

Re: Reading by positions plain text files

2010-11-30 Thread MRAB
On 30/11/2010 21:31, javivd wrote: Hi all, Sorry, newbie question: I have database in a plain text file (could be .txt or .dat, it's the same) that I need to read in python in order to do some data validation. In other files I read this kind of files with the split() method, reading line by lin

Re: how to go on learning python

2010-11-30 Thread Terry Reedy
On 11/30/2010 9:37 AM, Xavier Heruacles wrote: I'm basically a c/c++ programmer and recently come to python for some web development. Using django and javascript I'm afraid I can develop some web application now. But often I feel I'm not good at python. I don't know much about generators, descrip

Re: Catching user switching and getting current active user from root on linux

2010-11-30 Thread James Mills
On Wed, Dec 1, 2010 at 8:54 AM, Tim Harig wrote: > Well you could use inotify to trigger on any changes to /var/log/wtmp. > When a change is detected, you could check of deltas in the output of "who > -a" to figure out what has changed since the last time wtmp triggered. This is a good idea and y

Re: Catching user switching and getting current active user from root on linux

2010-11-30 Thread Tim Harig
On 2010-11-30, mpnordland wrote: > I have situation where I need to be able to get the current active > user, and catch user switching eg user1 locks screen, leaves computer, > user2 comes, and logs on. > basically, when there is any type of user switch my script needs to > know. Well you could u

Catching user switching and getting current active user from root on linux

2010-11-30 Thread mpnordland
I have situation where I need to be able to get the current active user, and catch user switching eg user1 locks screen, leaves computer, user2 comes, and logs on. basically, when there is any type of user switch my script needs to know. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading by positions plain text files

2010-11-30 Thread Tim Harig
On 2010-11-30, javivd wrote: > I have a case now in wich another file has been provided (besides the > database) that tells me in wich column of the file is every variable, > because there isn't any blank or tab character that separates the > variables, they are stick together. This second file sp

Re: IMAP support

2010-11-30 Thread pakalk
On 30 Lis, 22:26, Adam Tauno Williams wrote: > On Tue, 2010-11-30 at 13:03 -0800, pakalk wrote: > > Please, give me an example of raw query to IMAP server? > > > > I'm not certain what you mean by "raw query". m = imap() m.

How to initialize each multithreading Pool worker with an individual value?

2010-11-30 Thread Valery Khamenya
Hi, multithreading.pool Pool has a promissing initializer argument in its constructor. However it doesn't look possible to use it to initialize each Pool's worker with some individual value (I'd wish to be wrong here) So, how to initialize each multithreading Pool worker with the individual value

Reading by positions plain text files

2010-11-30 Thread javivd
Hi all, Sorry, newbie question: I have database in a plain text file (could be .txt or .dat, it's the same) that I need to read in python in order to do some data validation. In other files I read this kind of files with the split() method, reading line by line. But split() relies on a separator

Re: IMAP support

2010-11-30 Thread Adam Tauno Williams
On Tue, 2010-11-30 at 13:03 -0800, pakalk wrote: > Please, give me an example of raw query to IMAP server? I'm not certain what you mean by "raw query". > And why do you focus on "Nevermind is so ekhm... nevermind... "??

Re: SAX unicode and ascii parsing problem

2010-11-30 Thread Justin Ezequiel
can't check right now but are you sure it's the parser and not this line d.write(csv+"\n") that's failing? what is d? -- http://mail.python.org/mailman/listinfo/python-list

Re: SAX unicode and ascii parsing problem

2010-11-30 Thread goldtech
snip... > > I'm just as stumped as I was when you first asked this question 13 > minutes ago. ;-) > > regards >  Steve > snip... Hi Steve, Think I found it, for example: line = 'my big string' line.encode('ascii', 'ignore') I processed the problem strings during parsing with this and it works n

Re: IMAP support

2010-11-30 Thread pakalk
Please, give me an example of raw query to IMAP server? And why do you focus on "Nevermind is so ekhm... nevermind... "?? Cannot you just help? -- http://mail.python.org/mailman/listinfo/python-list

Re: SAX unicode and ascii parsing problem

2010-11-30 Thread Steve Holden
On 11/30/2010 3:43 PM, goldtech wrote: > Hi, > > I'm trying to parse an xml file using SAX. About half-way through a > file I get this error: > > Traceback (most recent call last): > File "C:\Python26\Lib\site-packages\pythonwin\pywin\framework > \scriptutils.py", line 325, in RunScript > e

SAX unicode and ascii parsing problem

2010-11-30 Thread goldtech
Hi, I'm trying to parse an xml file using SAX. About half-way through a file I get this error: Traceback (most recent call last): File "C:\Python26\Lib\site-packages\pythonwin\pywin\framework \scriptutils.py", line 325, in RunScript exec codeObject in __main__.__dict__ File "E:\sc\b2.py",

Re: [Q] get device major/minor number

2010-11-30 Thread Dan M
On Tue, 30 Nov 2010 21:35:43 +0100, Thomas Portmann wrote: > Thank you very much Dan, this is exactly what I was looking for. > > > Tom You're very welcome. -- http://mail.python.org/mailman/listinfo/python-list

Re: [Q] get device major/minor number

2010-11-30 Thread Thomas Portmann
On Tue, Nov 30, 2010 at 9:18 PM, Dan M wrote: > On Tue, 30 Nov 2010 21:09:14 +0100, Thomas Portmann wrote: >> In the example below, I would like to get the major (8) and minor (0, 1, >> 2) numbers of /dev/sda{,1,2}. How can I get them? > > I think the os.major() and os.minor() calls ought to do w

get a free domain , free design , and free host

2010-11-30 Thread mohammed_a_o
get a free domain , free design , and free host http://freedesignandhost.co.cc/ get a free domain , free design , and free host http://freedesignandhost.co.cc/free-design.php http://freedesignandhost.co.cc/free-host.php http://freedesignandhost.co.cc/free-domain.php -- http://mail.python.o

SAX unicode and ascii parsing problem

2010-11-30 Thread goldtech
Hi, I'm trying to parse an xml file using SAX. About half-way through a file I get this error: Traceback (most recent call last): File "C:\Python26\Lib\site-packages\pythonwin\pywin\framework \scriptutils.py", line 325, in RunScript exec codeObject in __main__.__dict__ File "E:\sc\b2.py",

Re: Memory issues when storing as List of Strings vs List of List

2010-11-30 Thread Ben Finney
OW Ghim Siong writes: > I have a big file 1.5GB in size, with about 6 million lines of > tab-delimited data. I have to perform some filtration on the data and > keep the good data. After filtration, I have about 5.5 million data > left remaining. As you might already guessed, I have to read them

Re: [Q] get device major/minor number

2010-11-30 Thread Dan M
On Tue, 30 Nov 2010 21:09:14 +0100, Thomas Portmann wrote: > Hello all, > > In a script I would like to extract all device infos from block or > character device. The "stat" function gives me most of the infos (mode, > timestamp, user and group id, ...), however I did not find how to get > the de

[Q] get device major/minor number

2010-11-30 Thread Thomas Portmann
Hello all, In a script I would like to extract all device infos from block or character device. The "stat" function gives me most of the infos (mode, timestamp, user and group id, ...), however I did not find how to get the devices major and minor numbers. Of course I could do it by calling an ext

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-11-30 Thread Martin v. Loewis
> Does anyone know what I need to do to read filenames from stdin with > Python 3.1 and subsequently open them, when some of those filenames > include characters with their high bit set? If your files on disk use file names encoded in iso-8859-1, don't set your locale to a UTF-8 locale (as you app

Re: C struct to Python

2010-11-30 Thread geremy condra
On Tue, Nov 30, 2010 at 10:57 AM, Eric Frederich wrote: > I am not sure how to proceed. > I am writing a Python interface to a C library. > The C library uses structures. > I was looking at the struct module but struct.unpack only seems to > deal with data that was packed using struct.pack or some

Almost free iPod

2010-11-30 Thread iGet
I know nothing is ever free and that is true. However, you can get things really cheap. Two offers I am working on right now are: (Copy and Paste link into your web browser) A Free iPod 64gb - http://www.YouriPodTouch4free.com/index.php?ref=6695331 Here is how it works: You click on one of the

C struct to Python

2010-11-30 Thread Eric Frederich
I am not sure how to proceed. I am writing a Python interface to a C library. The C library uses structures. I was looking at the struct module but struct.unpack only seems to deal with data that was packed using struct.pack or some other buffer. All I have is the struct itself, a pointer in C. Is

Re: Using property() to extend Tkinter classes but Tkinter classes are old-style classes?

2010-11-30 Thread Robert Kern
On 11/30/10 11:00 AM, Giacomo Boffi wrote: Terry Reedy writes: On 11/28/2010 3:47 PM, pyt...@bdurham.com wrote: I had planned on subclassing Tkinter.Toplevel() using property() to wrap access to properties like a window's title. After much head scratching and a peek at the Tkinter.py source,

Re: Using property() to extend Tkinter classes but Tkinter classes are old-style classes?

2010-11-30 Thread Hans Mulder
Giacomo Boffi wrote: Terry Reedy writes: On 11/28/2010 3:47 PM, pyt...@bdurham.com wrote: I had planned on subclassing Tkinter.Toplevel() using property() to wrap access to properties like a window's title. After much head scratching and a peek at the Tkinter.py source, I realized that all Tk

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-11-30 Thread Peter Otten
Albert Hopkins wrote: > On Tue, 2010-11-30 at 11:52 +0100, Peter Otten wrote: > Dan Stromberg wrote: >> >> > I've got a couple of programs that read filenames from stdin, and > then >> > open those files and do things with them. These programs sort of do >> > the *ix xargs thing, without requiri

Re: Using property() to extend Tkinter classes but Tkinter classes are old-style classes?

2010-11-30 Thread Giacomo Boffi
Terry Reedy writes: > On 11/28/2010 3:47 PM, pyt...@bdurham.com wrote: >> I had planned on subclassing Tkinter.Toplevel() using property() to wrap >> access to properties like a window's title. >> After much head scratching and a peek at the Tkinter.py source, I >> realized that all Tkinter class

Re: remote control firefox with python

2010-11-30 Thread baloan
On Nov 28, 4:22 pm, News123 wrote: > Hi, > > I wondered whether there is a simpe way to > 'remote' control fire fox with python. > > With remote controlling I mean: > - enter a url in the title bar and click on it > - create a new tab > - enter another url click on it > - save the html document of

Iran slams Wiki-release as US psywar - WIKILEAKS is replacing those BIN LADEN communiques of CIA (the global ELITE) intended to threaten MASSES

2010-11-30 Thread small Pox
Iran slams Wiki-release as US psywar - WIKILEAKS is replacing those BIN LADEN communiques of CIA (the global ELITE) intended to threaten MASSES CIA is the criminal agency of the global elite. They want to destroy the middle class from the planet and also create a global tyranny of a police state.

Re: how to go on learning python

2010-11-30 Thread Alice Bevan–McGregor
Howdy Xavier! [Apologies for the length of this; I didn't expect to write so much!] I've been a Python programmer for many years now (having come from a PHP, Perl, C, and Pascal background) and I'm constantly learning new idioms and ways of doing things that are more "Pythonic"; cleaner, more

Re: Memory issues when storing as List of Strings vs List of List

2010-11-30 Thread Antoine Pitrou
On Tue, 30 Nov 2010 18:29:35 +0800 OW Ghim Siong wrote: > > Does anyone know why is there such a big difference memory usage when > storing the matrix as a list of list, and when storing it as a list of > string? That's because any object has a fixed overhead (related to metadata and allocatio

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-11-30 Thread Antoine Pitrou
On Mon, 29 Nov 2010 21:52:07 -0800 (PST) Yingjie Lan wrote: > --- On Tue, 11/30/10, Dan Stromberg wrote: > > In Python 3, I'm finding that I have encoding issues with > > characters > > with their high bit set.  Things are fine with strictly > > ASCII > > filenames.  With high-bit-set characters,

Re: Python 2.7.1

2010-11-30 Thread Antoine Pitrou
On Mon, 29 Nov 2010 15:11:28 -0800 (PST) Spider wrote: > > 2.7 includes many features that were first released in Python 3.1. The > > faster io module ... > > I understand that I/O in Python 3.0 was slower than 2.x (due to quite > a lot of the code being in Python rather than C, I gather), and t

Re: Memory issues when storing as List of Strings vs List of List

2010-11-30 Thread Tim Chase
On 11/30/2010 04:29 AM, OW Ghim Siong wrote: a=open("bigfile") matrix=[] while True: lines = a.readlines(1) for line in lines: data=line.split("\t") if several_conditions_are_satisfied: matrix.append(data) print "Number of lines read:", len(li

Help: problem in setting the background colour ListBox

2010-11-30 Thread ton ph
Hi everyone , I have a requirement of displaying my data in a textCtrl like widget , but i need that the data in the row be clickable , so as when i click the data i could be able to get fire and even and get me the selected data value.After a long search i found ListBox to be perfect for my use

Programming games in historical linguistics with Python

2010-11-30 Thread Dax Bloom
Hello, Following a discussion that began 3 weeks ago I would like to ask a question regarding substitution of letters according to grammatical rules in historical linguistics. I would like to automate the transformation of words according to complex rules of phonology and integrate that script in

Re: How does GC affect generator context managers?

2010-11-30 Thread Duncan Booth
Jason wrote: > As I understood it, when the "with" block exits, the __exit__() method > is called immediately. This calls the next() method on the underlying > generator, which forces it to run to completion (and raise a > StopIteration), which includes the finally clause... right? > That is tru

Re: Needed: Real-world examples for Python's Cooperative Multiple Inheritance

2010-11-30 Thread Sol Toure
Most of the examples presented here can use the "decorator pattern" instead. Especially the window system On Mon, Nov 29, 2010 at 5:27 PM, Gregory Ewing wrote: > Paul Rubin wrote: > > The classic example though is a window system, where you have a "window" >> class, and a "scroll bar" class, an

how to go on learning python

2010-11-30 Thread Xavier Heruacles
I'm basically a c/c++ programmer and recently come to python for some web development. Using django and javascript I'm afraid I can develop some web application now. But often I feel I'm not good at python. I don't know much about generators, descriptors and decorators(although I can use some of it

nike shoes , fashi on clothes ; brand hand bags

2010-11-30 Thread SA sada
Dear customers, thank you for your support of our company. Here, there's good news to tell you: The company recently launched a number of new fashion items! ! Fashionable and welcome everyone to come buy. If necessary, please plut: http://www.vipshops.org == http://www.vipshops.org =

How does GC affect generator context managers?

2010-11-30 Thread Jason
I've been reading through the docs for contextlib and PEP 343, and came across this: Note that we're not guaranteeing that the finally-clause is executed immediately after the generator object becomes unused, even though this is how it will work in CPython. ...referring to context man

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-11-30 Thread Albert Hopkins
On Tue, 2010-11-30 at 11:52 +0100, Peter Otten wrote: Dan Stromberg wrote: > > > I've got a couple of programs that read filenames from stdin, and then > > open those files and do things with them. These programs sort of do > > the *ix xargs thing, without requiring xargs. > > > > In Python 2, t

Re: TDD in python

2010-11-30 Thread Roy Smith
In article <58fe3680-21f5-42f8-9341-e069cbb88...@r19g2000prm.googlegroups.com>, rustom wrote: > Looking around I found this: > http://bytes.com/topic/python/answers/43330-unittest-vs-py-test > where Raymond Hettinger no less says quite unequivocally that he > prefers test.py to builtin unittest

Re: remote control firefox with python

2010-11-30 Thread Hans-Peter Jansen
On Sunday 28 November 2010, 16:22:33 News123 wrote: > Hi, > > > I wondered whether there is a simpe way to > 'remote' control fire fox with python. > > > With remote controlling I mean: > - enter a url in the title bar and click on it > - create a new tab > - enter another url click on it > - save

Re: Memory issues when storing as List of Strings vs List of List

2010-11-30 Thread Peter Otten
OW Ghim Siong wrote: > Hi all, > > I have a big file 1.5GB in size, with about 6 million lines of > tab-delimited data. I have to perform some filtration on the data and > keep the good data. After filtration, I have about 5.5 million data left > remaining. As you might already guessed, I have to

ANNOUNCE: NHI1-0.10, PLMK-1.8 und libmsgque-4.8

2010-11-30 Thread Andreas Otto
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dear User, ANNOUNCE:Major Feature Release libmsgque: Application-Server-Toolkit for C, C++, JAVA, C#, Go, TCL, PERL, PHP, PYTHON, RUBY, VB.NET PLMK: Programming-Language-Microkernel NH

Re: Memory issues when storing as List of Strings vs List of List

2010-11-30 Thread Ulrich Eckhardt
OW Ghim Siong wrote: > I have a big file 1.5GB in size, with about 6 million lines of > tab-delimited data. How many fields are there an each line? > I have to perform some filtration on the data and > keep the good data. After filtration, I have about 5.5 million data left > remaining. As you m

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-11-30 Thread Peter Otten
Dan Stromberg wrote: > I've got a couple of programs that read filenames from stdin, and then > open those files and do things with them. These programs sort of do > the *ix xargs thing, without requiring xargs. > > In Python 2, these work well. Irrespective of how filenames are > encoded, thin

Memory issues when storing as List of Strings vs List of List

2010-11-30 Thread OW Ghim Siong
Hi all, I have a big file 1.5GB in size, with about 6 million lines of tab-delimited data. I have to perform some filtration on the data and keep the good data. After filtration, I have about 5.5 million data left remaining. As you might already guessed, I have to read them in batches and I d

Re: Python 3 encoding question: Read a filename from stdin, subsequently?open that filename

2010-11-30 Thread Marc Christiansen
Dan Stromberg wrote: > I've got a couple of programs that read filenames from stdin, and then > open those files and do things with them. These programs sort of do > the *ix xargs thing, without requiring xargs. > > In Python 2, these work well. Irrespective of how filenames are > encoded, thin

Re: Possible to determine number of rows affected by a SQLite update or delete command?

2010-11-30 Thread Kushal Kumaran
On Tue, Nov 30, 2010 at 2:29 PM, wrote: > Is there a cursor or connection property that returns the number of rows > affected by a SQLite update or delete command? > The cursor has a rowcount attribute. The documentation of the sqlite3 module says the implementation is "quirky". You might take

Possible to determine number of rows affected by a SQLite update or delete command?

2010-11-30 Thread python
Is there a cursor or connection property that returns the number of rows affected by a SQLite update or delete command? Or, if we want this information, do we have to pre-query our database for a count of records that will be affected by an operation? Thank you, Malcolm -- http://mail.python.org