User Tools

Site Tools


python:file_handling

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
python:file_handling [2016/10/18 11:32] – [Writing a File] peterpython:file_handling [2020/07/15 09:30] (current) – external edit 127.0.0.1
Line 160: Line 160:
  
 <file python files.py> <file python files.py>
-path = '/users/sammy/days.txt'+path = '/home/john/days.txt'
 days_file = open(path,'r') days_file = open(path,'r')
 days = days_file.read() days = days_file.read()
  
- +new_path = '/home/john/new_days.txt'
-new_path = '/users/sammy/new_days.txt'+
 new_days = open(new_path,'w') new_days = open(new_path,'w')
  
python/file_handling.1476790338.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki