How does pyCharm use the fileinput.input() function?
That is, how can I point to the incoming file?

 i=1 for line in fileinput.input(): path1 = line.rstrip("\n") print("File #", i, path1) i = i + 1 

Here, for example, this piece of code that I could run in a far manager, and now I want to switch to pyCharm, but I cannot run this code here.

    1 answer 1

     for line in fileinput.input(["1.log", "2.py"]): print(line) 
    • That is, you have to manually specify the path to the incoming file? - user200355
    • what does it mean manually? use variable or input () - vadim vaduxa
    • understood thanks! - user200355