← Back to team overview

sikuli-driver team mailing list archive

[Question #245442]: how does the python code looks like for this task

 

New question #245442 on Sikuli:
https://answers.launchpad.net/sikuli/+question/245442

Hello all,

how can I do this generic (loop in python) ?

I have a directory called "myTXT" and in this directory there are many txt-files, e.g.

myTXT
        tc1.txt
        tc2.txt
        tc3.txt
        tc4.txt
        tc5.txt
        tc6.txt
        ...

in tc1.txt looks like this, e.g.

suc=x1
suc=x2
suc=x3
err=x4
suc=x5
...

OK, now I would like to loop in the directory myTXT to get all tc*.txt and THEN loop each tc*.txt to read everything from the file.
What I have done is to read from 1 file, e.g.
-----
fobj = open("C:\\myTXT\\\\tc1.txt", "r")
for line in fobj:
print line
----

Could you help ? :-)

Thank you

Loren







-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.