[Tutor] Syntax for Simplest Way to Execute One Python Program Over 1000's of Datasets

2011-06-09 Thread B G
I'm trying to analyze thousands of different cancer datasets and run the same python program on them. I use Windows XP, Python 2.7 and the IDLE interpreter. I already have the input files in a directory and I want to learn the syntax for the quickest way to execute the program over all these data

Re: [Tutor] Syntax for Simplest Way to Execute One Python Program Over 1000's of Datasets

2011-06-09 Thread Walter Prins
On 9 June 2011 20:49, B G wrote: > I'm trying to analyze thousands of different cancer datasets and run the > same python program on them. I use Windows XP, Python 2.7 and the IDLE > interpreter. I already have the input files in a directory and I want to > learn the syntax for the quickest way

Re: [Tutor] Syntax for Simplest Way to Execute One Python Program Over 1000's of Datasets

2011-06-09 Thread Corey Richardson
On 06/09/2011 03:49 PM, B G wrote: > I'm trying to analyze thousands of different cancer datasets and run the > same python program on them. I use Windows XP, Python 2.7 and the IDLE > interpreter. I already have the input files in a directory and I want to > learn the syntax for the quickest way

Re: [Tutor] Syntax for Simplest Way to Execute One Python Program Over 1000's of Datasets

2011-06-09 Thread James Reynolds
My advice would be to stay away from generic names, like: for item in items: do stuff with item For a couple of lines its ok, but when programs get large, your program will get confusing even to you as the author. Sometimes, it's best just to do "for all in listx: but I think that's rare. Us

Re: [Tutor] Syntax for Simplest Way to Execute One Python Program Over 1000's of Datasets

2011-06-09 Thread B G
hmm, thanks for the help. So I kinda got it working, although from an efficiency perspective it leaves a lot to be desired. I managed to do the following: 1) Create a script that gives me a list of all the filenames in the folder: path = "...\\Leukemia_Project" i = 0 for (files) in os.walk(path):

Re: [Tutor] Syntax for Simplest Way to Execute One Python Program Over 1000's of Datasets

2011-06-10 Thread Válas Péter
A few hints to make it more efficient: 2011/6/10 B G > 1) Create a script that gives me a list of all the filenames in the folder: > I managed to do the following: > path = "...\\Leukemia_Project" > Use / in path instead of \\, it will work in all environments, not just Windows. One of the adva

Re: [Tutor] Syntax for Simplest Way to Execute One Python Program Over 1000's of Datasets

2011-06-10 Thread Válas Péter
2011/6/10 B G > > path = "...\\Leukemia_Project" > i = 0 > for (files) in os.walk(path): > print(files) > print("\n") > i += 1 > Continuing my thoughts: I ran your loop, and got several tuples, each representing a directory. All the tuples have the same structure: 0th element is the

Re: [Tutor] Syntax for Simplest Way to Execute One Python Program Over 1000's of Datasets

2011-06-10 Thread James Reynolds
> > 3) Open the .txt file in Excel, remove the few lines I don't need (ie > single quotes, etc) Regarding Excel, you can write your output directly to an Excel file from python using the Python-Excel module. Just install all three packages. I use them all the time. Here is something that I wrote

Re: [Tutor] Syntax for Simplest Way to Execute One Python Program Over 1000's of Datasets

2011-06-10 Thread Válas Péter
2011. június 10. 15:51 James Reynolds írta, : > > Regarding Excel, you can write your output directly to an Excel file from > python using the Python-Excel module. Just install all three packages. I use > them all the time. > > > Do they work with Py3K?

Re: [Tutor] Syntax for Simplest Way to Execute One Python Program Over 1000's of Datasets

2011-06-10 Thread James Reynolds
Honestly no idea. At work I use 2.6 / 2.7. At home it's 3.2 / 2.7. I've never actually tried doing this at home, so I don't know. They have a mail list though, I would post there to find out. 2011/6/10 Válas Péter > > > 2011. június 10. 15:51 James Reynolds írta, : > > >> Regarding Excel, you