Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import sys
  2.  
  3. try:
  4.  
  5. f = open("h:\nosuchdirectory\nosuchfile.txt","w") # do not modify this line
  6.  
  7. except IOError:
  8. print('Cannot open, no such directory or file')
  9.  
  10. f.write("This is the grape file") # do not modify this line
  11.  
  12. f.close() # do not modify this line
  13.  
  14. f = open("h:\nosuchdirectory\nosuchfile.txt","w" # do not modify this line
  15.  
  16. f.write("This is the grape file") # do not modify this line
  17.  
  18. f.close() # do not modify this line
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement