Tell me, please, how to transfer and process the file name in a program written in Python?For example: python text.txt program.py
python text.txt program.py
The easiest way:
import sys print(sys.argv[1])
And pass the argument when running the script:
python program.py text.txt
Source: https://ru.stackoverflow.com/questions/939966/More articles:Do not start localhostWhy not see the class?Maven. Dependence of child modules of modulesGet a miniature product by its ID in WordPressHow to use classes of heterontecs with hetero and object objects using Spring java?How to organize the structure and implementation?How to make module.exports for db.each?Failed to start mariadb.service: Unit mariadb.service not foundComparing 2 arrays from 10 000 000How to change the encoding in one of the pages in asp core?All Articles