When you're launching from a command line, the current working directory may not be the same as the home directory of your top-level file (i.e., the directory where your program file resides).
If you run it in cmd.exe
(Command Prompt), then path to file "Text.txt"
will be searched for in the directory currently opened in the Command line. Usually, C:\Users\[user]\
is the default working directory on Windows.
You need to run your program using Python interpreter/Py Laucher, that is usually opened on double click on *.py
top-level program file or simply change the current directory in Command prompt with cd <TOP_LEVEL_FILE_DIR>
.