Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. def fileOpenEncrypt(): #Defines "fileOpenEncrypt" to ask the user for the file, then opens it for encryption
  2. fileName = raw_input("Enter the name of the file, with extension, to be encrypted: ")
  3. try:
  4. with open(fileName, 'r') as myFile:
  5. fileContents=myFile.read().replace('\n', ' ')
  6. except:
  7. print ("\nFile not found, try again")
  8. textMenu()
  9. selectOption()
  10. else:
  11. print " "
  12. print "Here are the contents of the file: ",fileContents
  13. with open(fileName, "r") as ins:
  14. fileContentsArray = []
  15. for line in ins:
  16. fileContentsArray.append(line)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement