Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #_*_coding: utf-8_*_
- print ("||#######################||")
- print ("||###### SubWrite #######||")
- print ("||#######################||")
- print ("Digite # e de enter para sair")
- print ("0) criar arquivo *.txt")
- print ("1) editar arquivo")
- opc = input("opção: ")
- if opc == "#":
- exit()
- elif opc == "0":
- local = input ("nome e local a ser salvo: ")
- while 1:
- sub = str(input(""))
- if sub == "#":
- exit()
- else:
- subw = open(local, "a")
- subw.writelines(sub)
- subw.write("\n")
- subw.close()
- elif opc == "1":
- sub = input("arquivo: ")
- subw = open (sub, "r")
- txt = subw.readlines()
- for l in txt:
- while 1:
- fl = open(sub, "a")
- edit = str(input(l))
- if edit == "#":
- fl.close()
- subw.close()
- exit()
- else:
- fl.writelines(edit)
- fl.write("\n")
- fl.close()
- subw.close()
- else:
- print ("command not found!")
Add Comment
Please, Sign In to add comment