Text files are normally not executable. What do you mean with "open" here?
- This could mean "open it so that I can use it in the program".
This could mean "open it so that I can use it in the program".
This works with
file_object = open('/home/yash/Documents/ct.txt', 'r')and then using thatfile_object. This as well could mean "let the file type's associated application open the file so that the user can edit it".
In this case, you would have to find out what the associated application is. How you do this is dependent on the OS you use as well as the window manager/desktop environment. It cannot be answered in a few short sentences.
This works with file_object = open('/home/yash/Documents/ct.txt', 'r') and then using that file_object.
- This as well could mean "let the file type's associated application open the file so that the user can edit it".
In this case, you would have to find out what the associated application is. How you do this is dependent on the OS you use as well as the window manager/desktop environment. It cannot be answered in a few short sentences.