File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change 1+ # Overview
12Variables do not stay after your program is done. Files can help save data
23after your program is finished. A file is just a large string.
34
4- # File Paths and File Extensions
5+ # New Concepts
6+ ### File Paths and File Extensions
57 Show Tree structure of a folder hierarchy
68 What is the Root Folder?
79 How are USB Drives seen differently in Windows and Linux?
810 Windows show entirely different root folders
911 Linux + OSX attach the drive to another folder in root
1012
11- # Backslash on Windows and Forward Slash on OSX and Linux
13+ ### Backslash on Windows and Forward Slash on OSX and Linux
1214 Windows paths are written with backslashes (\)
1315 OSX and Linux uses forward slashes (/)
1416 To make python work on all OS-es, you need to handle both cases
@@ -69,3 +71,19 @@ after your program is finished. A file is just a large string.
6971 os.path.getsize(path) returns the size in bytes of the file
7072 os.listdir(path) returns a list of strings for each file in the path
7173
74+ os.path.abspath()
75+ os.path.basename()
76+ os.path.exists()
77+ file.startswith()
78+ file.endswith()
79+ open()
80+ write()
81+ os.path.join()
82+
83+
84+ Need
85+ list()
86+ dict.keys()
87+ dict.values()
88+ random.shuffle()
89+
You can’t perform that action at this time.
0 commit comments