I want to actually open it not just read it.
I tried to do something like this:
x = open("filename", "r")
abc = x.read()
x.close()
The above code just read the file, it did not actually open the file.
The file is a "bat" file
I want to actually open it not just read it.
I tried to do something like this:
x = open("filename", "r")
abc = x.read()
x.close()
The above code just read the file, it did not actually open the file.
The file is a "bat" file
open
creates a stream of data associated with the file. It does not initiate a file viewing software.You must invoke
filename.bat
Also, the explicit
.read()
can be removed inabc = x.read()
.