Python fileinput.input() Syntax
Syntax :
fileinput.input(files)
Parameter :
fileinpu
t
module in Python hasinput()
for reading from multiple files.input()
infileinput
reads input from various sources.files
parameter specifies file names, defaulting to stdin if not specified.Return : Return the data of the file.
fileinput.input() in Python
With the help of fileinput.input()
method, we can get the file as input and can be used to update and append the data in the file by using fileinput.input()
method.