The easiest way, if you have all file names at hand, is to use a text file
with each line having one filename, like:

with open("filename_list.txt") as f:
    for line in f:
        do_something(line.strip())

If all files are in a single directory, take a look at os.walk()
<https://docs.python.org/2/library/os.html#os.walk>.

Just note that this isn't really Spyder-specific, but a Python thing. If
you want to run a script that takes a filename as argument, you can either
use your shell's facilities to pass the names (or walk the tree), or you
may use another Python script to run what you want. Or, as I would do, just
encapsulate your existing script in a function and use the above solutions
to loop through the arguments.

2016-12-11 14:34 GMT-02:00 Rod McGovern <[email protected]>:

> Hi,
> I need to process a large number of files with a program written in
> Spyder. Currently I have to type in each file name, then select run. It
> would be a lot easier if I could specify all the files that need to process
> and have the program open each sequentially. Is there a way to do so?
> Thanks,
> Rod
>
> --
> You received this message because you are subscribed to the Google Groups
> "spyder" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/spyderlib.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Reply via email to