I am creating a program where you create a text file and it runs ls
in the terminal to display the files that I have in that folder. My problem is that I have 2 folders. One is for the program itself, and one is for the text files that I create. By default, the text file saves to the folder that contains the program. here is my code
#!/usr/bin/python
import time
import termcolor
import os
os.system("cd /home/marc/QuickJotTexts && ls")
print ""
title = raw_input("What Will Your Title Be? ")
print""
print "Your Title Is", title
text_file = open(title, "w")
print ""
text = raw_input("What Do You Want To Write In This Document? ")
text_file.write(text)
text_file.close()
text_file = open(title, "r")
print "YOU WROTE", text_file.read()
nub = raw_input("Is This Correct? y/n ")
if nub == "y":
print "Ok, Bye :)"
text_file.close()
if nub == "n":
os.system("rm", title)
This is only a very small part of my code.