Hi,
I am trying to write a simple python script to manipulate files and call
other programs. I have a program installed (rocs) which I run using
cygwin on my XP (but is not in python). Can I run the pyhton script and
then call the other program in the same script?
For example:
Python Code
Hi Pythoneers,
I have a question about a code I wrote with the help of someone. The
code below copy a few lines from different files into one file. It works
fine as it is given here and generates the new file 'pockets.out'
correctly, but says:py returned exit code 0. However, if I add
Emile van Sebille wrote:
Ben Keshet wrote:
Hi Pythoneers,
I have a question about a code I wrote with the help of someone. The
code below copy a few lines from different files into one file. It
works fine as it is given here and generates the new file
'pockets.out' correctly, but says
Wojtek Walczak wrote:
On Fri, 22 Aug 2008 10:42:13 -0400, Ben Keshet wrote:
Thanks. I tried to use 'for' instead of 'while' as both of you
suggested. It's running well as my previous version but breaks
completely instead of just skipping the empty file. I suspect the
reason
Thanks. I tried to use 'for' instead of 'while' as both of you
suggested. It's running well as my previous version but breaks
completely instead of just skipping the empty file. I suspect the
reason is that this part is inside another 'for' so it stops
everything. I just want to it to
Hi -
I am writing now my second script ever in python and need some help with
'while'. I am reading text from a set of files and manipulating the data
somehow. I use 'while 'word' not in line' to recognize words in the
texts. Sometimes, the files are empty, so while doesn't find 'word' and
:
On Thu, 21 Aug 2008 18:01:25 -0400, Ben Keshet wrote:
somehow. I use 'while 'word' not in line' to recognize words in the
texts. Sometimes, the files are empty, so while doesn't find 'word' and
runs forever. I have two questions:
1) how do I overcome this, and make the script skip the empty files
# print the current folder
filename='Folder/%s/myfile.txt' %[x]
f=open(filename,'r')
gives: IOError: [Errno 2] No such file or directory:
Folder/['1']/myfile.txt
Tim Cook wrote:
On Wed, 2008-07-09 at 00:00 -0400, Ben Keshet wrote:
oops, my mistake, actually it didn't work...
when I
Hi fans,
I want to use a 'for' iteration to manipulate files in a set of folders,
something like:
folders= ['1A28','1A6W','56Y7']
for x in folders:
print x # print the current folder
f = open('my/path/way/x/my_file.txt', 'r')
...
where 'x' in the pathway should iterate over
right or using the right terms as
I am fairly new to programing and python.
Thanks for your time.
Ben
Brian Blais wrote:
On Jul 8, 2008, at Jul 8:8:08 PM, Ben Keshet wrote:
I want to use a 'for' iteration to manipulate files in a set of
folders, something like:
folders= ['1A28','1A6W
Brian Blais wrote:
On Jul 8, 2008, at Jul 8:8:08 PM, Ben Keshet wrote:
I want to use a 'for' iteration to manipulate files in a set of
folders, something like:
folders= ['1A28','1A6W','56Y7']
for x in folders:
print x # print the current folder
f = open('my/path/way/x/my_file.txt', 'r
I have a probably simple beginner's question -
I have a script that I am currently able to print its output. instead,
i want to write it into a file - I tried different versions of write()
but might have gotten the syntax wrong. the variable I want to write is
a line from a file I am
Hi,
I am a very beginner Python programmer with limited programming
experience overall.
I am trying to write a script that will search for the second and third
appearance of the symbol '@' in a file, will read a random line between
them, and write the line into a new file. So far I was only
13 matches
Mail list logo