On 15:37, venerdì 13 giugno 2008 Nader wrote:
> try:
> list_of_files != []
> get the files
>
For file in list_of_files:
try:
myfile = open(file, 'r')
except (IOError, OSError):
print"Your %s file wasn't open" %file
# here you can do something with your open file as read
On Jun 13, 11:34 am, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Fri, 13 Jun 2008 04:37:44 -0300, Nader <[EMAIL PROTECTED]> escribió:
>
> > Hello,
>
> > I read some files name from a directory and then I put these name in a
> > list. I will check whether it is empty or not, and I would do i
En Fri, 13 Jun 2008 04:37:44 -0300, Nader <[EMAIL PROTECTED]> escribió:
Hello,
I read some files name from a directory and then I put these name in a
list. I will check whether it is empty or not, and I would do it with
an exception. With if statement it is very simple:
If list_of_files != ""
Hello,
I read some files name from a directory and then I put these name in a
list. I will check whether it is empty or not, and I would do it with
an exception. With if statement it is very simple:
If list_of_files != "" :# this can be if list_of_files !=
[]:
get the files
elas: