G+_Tnt Seeker Posted May 14, 2014 Share Posted May 14, 2014 from os import listdir Folder_Content = listdir("Encrypted_Files/") #list the entire content of the directory (Thank's to "Egbie Anderson" For helping me) for counter in range(0,len(Folder_Content)): print counter, " --> " , Folder_Content[counter] counter = 0 GetUserInput = raw_input ('What file would you like to Decrypt?(Only 10 files Will be able to be Chosen from) ') if GetUserInput == 0 : File = open("Encrypted_Files/", Folder_Content[0] , "r") File2 = File.read() print File2 It dosent print File2. Why? Link to comment Share on other sites More sharing options...
G+_Jayunderwood Kent Posted May 14, 2014 Share Posted May 14, 2014 Does it throw an error when you run it Link to comment Share on other sites More sharing options...
G+_Joe Maruschek Posted May 14, 2014 Share Posted May 14, 2014 I think you need a "+" between "Encrypted_Files/" and Folder_Content[0] and not a comma. Link to comment Share on other sites More sharing options...
G+_L I Posted May 14, 2014 Share Posted May 14, 2014 raw_input will return a string and your if statement below it is looking for an int Link to comment Share on other sites More sharing options...
G+_L I Posted May 14, 2014 Share Posted May 14, 2014 Also the comma after open("Encrypted_Files/" should be a + Link to comment Share on other sites More sharing options...
Recommended Posts