I am creating a GUI in Python that needs to be ran in Unix and Windows. In the python main script I need to create and open (like a popup) a text file. I have the code for unix operative system and it is:
os.chdir(path=app.sourceFolder+"/Fastq_downloaded") files = os.listdir(os.getcwd()) sample_data = open("sample_data.txt", "w") sample_data.write("ID" + "\t" + "Condition" + "\n") for i in range(len(files)-1): sample_data.write(files[i][:-6] + "\t" + "\n") sample_data.write(files[-1][:-6] + "\t") sample_data.close() if "Linux" in o_sys or "Darwin" in o_sys: os.system('gedit sample_data.txt')
First I create a file with information and then I open it calling the gedit from the terminal. But in windows I don't have any idea of how we can open a text file from terminal and show it to the user. Some advise? Thank you very much
notepad sample_data.txt
?