Re: [Tutor] shutil.rmtree clarification

2012-05-18 Thread Steven D'Aprano
Garry Willgoose wrote: I'm trying to remove a directory that has within it a directory tree structure and files and thought the following would work (the online docs seem to suggest it will remove the underlying directory tree and included files) shutil.rmtree('test_directory') but I got bac

Re: [Tutor] Parsing data from a set of files iteratively

2012-05-18 Thread Steven D'Aprano
Spyros Charonis wrote: Dear Python community, I have a set of ~500 files which I would like to run a script on. My script extracts certain information and generates several lists with items I need. For one of these lists, I need to combine the information from all 500 files into one super-list.

Re: [Tutor] New to Python

2012-05-18 Thread Vignesh Sathiamoorthy
Hi Jeremy, I am new to Python too. I find docs.python.org very helpful. *Understanding functions:* http://docs.python.org/tutorial/controlflow.html#defining-functions *Reading and Writing Files:* http://docs.python.org/tutorial/inputoutput.html#reading-and-writing-files *File Objects:* http:

Re: [Tutor] Parsing data from a set of files iteratively

2012-05-18 Thread Alan Gauld
On 18/05/12 19:23, Spyros Charonis wrote: Dear Python community, I have a set of ~500 files which I would like to run a script on. > ...Is there a way in which I can iteratively execute my script > over all 500 files Yes. You could use os.walk() or the glob module depending on whether the file

Re: [Tutor] Parsing data from a set of files iteratively

2012-05-18 Thread Prasad, Ramit
>I have a set of ~500 files which I would like to run a script on. My script >extracts certain information and >generates several lists with items I need. For one of these lists, I need to >combine the information from all >500 files into one super-list. Is there a way in which I can iterativel

Re: [Tutor] Parsing data from a set of files iteratively

2012-05-18 Thread Joel Goldstick
On Fri, May 18, 2012 at 2:23 PM, Spyros Charonis wrote: > Dear Python community, > > I have a set of ~500 files which I would like to run a script on. My script > extracts certain information and > generates several lists with items I need. For one of these lists, I need to > combine the informati

Re: [Tutor] Parsing data from a set of files iteratively

2012-05-18 Thread Sarma Tangirala
On 18 May 2012 23:53, Spyros Charonis wrote: > Dear Python community, > > I have a set of ~500 files which I would like to run a script on. My > script extracts certain information and > generates several lists with items I need. For one of these lists, I need > to combine the information from al

[Tutor] Parsing data from a set of files iteratively

2012-05-18 Thread Spyros Charonis
Dear Python community, I have a set of ~500 files which I would like to run a script on. My script extracts certain information and generates several lists with items I need. For one of these lists, I need to combine the information from all 500 files into one super-list. Is there a way in which I

Re: [Tutor] Python sqlite with implicit cursor open and close

2012-05-18 Thread Joel Goldstick
On Fri, May 18, 2012 at 5:34 AM, Dinesh B Vadhia wrote: > In the Python documentation > (http://docs.python.org/library/sqlite3.html?highlight=sqlite#using-shortcut-methods) > it says: > "Using the nonstandard execute(), executemany() and executescript() methods > of the Connection object, your co

Re: [Tutor] table to dictionary and then analysis

2012-05-18 Thread Russel Winder
On Thu, 2012-05-17 at 19:35 +1000, Steven D'Aprano wrote: > On Thu, May 17, 2012 at 08:27:07AM +0100, Russel Winder wrote: > > > Should we be promoting use of the format method in strings rather than > > the % operator? % is deprecated now. > > It most certainly is not. > > There are no plans to

Re: [Tutor] How to create self contained Windows executables (.exe files) from python scripts

2012-05-18 Thread Timo
Op 18-05-12 01:02, Brad Hudson schreef: Can someone point me to information on how to create Windows .exe files from python 2.7.3? The py2exe method (www.py2exe.org ) appears to only be available for python 2.6 from the sites I've seen. I distribute a PyGTK application th

[Tutor] Python sqlite with implicit cursor open and close

2012-05-18 Thread Dinesh B Vadhia
In the Python documentation (http://docs.python.org/library/sqlite3.html?highlight=sqlite#using-shortcut-methods) it says: "Using the nonstandard execute(), executemany() and executescript() methods of the Connection object, your code can be written more concisely because you don't have to crea

Re: [Tutor] New to Python

2012-05-18 Thread Steven D'Aprano
Hi Jeremy, Welcome to Python, but please don't send HTML email (what some programs wrongly call "Rich Text"), as it completely destroys the necessary indentation of your Python code and makes it difficult or impossible to work out what your code is supposed to be. However, I will take a wild

Re: [Tutor] Installing graphics module on python 2.7

2012-05-18 Thread Steven D'Aprano
Emeka wrote: Hello All, I would like to install graphics. So that I can do this: import graphics Please help me. I tried "pip install graphics" nothing came out of it. Is this for the John Zelle book "Python Programming: An Introduction to Computer Science"? If so, did you follow the instruc