Summary
The string output can be formatted by these specifiers:
d, f, s, o, x, e, %
path = os.
getcwd() returns the current working directory
os.
listdir(path) lists anything in the current directory
os.
chdir(path) sets path as the current directory
The arguments to open file: r, w, a, +, b, t.
open(filename, “argument”) can open a file with argument.
open(“fileName”, “r”) uses “r” mode for opening file
f.
read( ) reads the contents of the file
open(“fileName”, “w”) uses “w” mode for opening file
f.
write( “text” ) writes text to the file
open(“fileName”, “a”) uses “a” mode to append text
f.
write( “text” ) appends text to the file
open("fileName", "r+") uses “r+” mode for reading & writing
f.
seek(index) sets the pointer to the specified index
import webbrowser imports webbrowser
webbrowser.
open(“URL”) opens a specified web page