Python files and paths
Build a receipt path, save a note, or read a shopping list.
Names and locations
- Path and Path.nameBuild a receipt path without hard-coded separators
- Path equalityDeduplicate a handout before download
- Path.absoluteGive an attachment an absolute location
- Path.as_uriExport a receipt as a local file URI
- Path.name and parentPrint a receipt name and its folder
- Path.partsSeparate sales reports from similarly named folders
- os.path.relpathLink a course handout to a diagram
Read and write
- Binary file seekRead the third locker status
- Path.read_bytes and write_bytesRecover the brightest setting from a preset
- Path.read_textRead a saved shopping note
- Path.write_textSave an item to a grocery note
Manage files and folders
- Path.iterdirCount only the invoices in a folder
- Path.mkdirPrepare nested hand-in folders
- Path.renamePublish a signed attendance sheet
- Path.rglobFind a receipt below the month folder
- Path.symlink_to and readlinkFollow a shortcut to the latest timetable
- Path.unlinkClear a disposable print preview
- TemporaryDirectoryIsolate two simultaneous label previews
- open in exclusive modeStop two desks claiming the same ticket
- shutil.copyfileKeep a separate copy of a receipt
- tempfile.TemporaryFileStage a receipt before exporting it
Inspect files and storage
- Path.chmodLimit a practice payroll file to its owner
- Path.is_file and is_dirTell an uploaded file apart from its folder
- Path.statRead a receipt catalog card
- Path.statCheck a receipt attachment size
- filecmp.cmpCheck the bytes in a backup
- mimetypes.guess_typeChoose a preview for a text attachment
- os.utimeRestore a newsletter publication date
- shutil.disk_usageCheck room for a class recording
Archives
- ZipExtFile.closeClose one receipt inside an archive
- ZipExtFile.readRead the text of an archived receipt
- ZipFileOpen an archive of receipts
- ZipFile.closeFinish reading an archive
- ZipFile.infolistList the entries in a receipt archive
- ZipFile.openOpen a receipt inside a ZIP archive
- ZipInfo.compress_sizeFind the stored size of a receipt
- ZipInfo.compress_typeIdentify how a receipt was stored
- ZipInfo.file_sizeCheck the original receipt size
- ZipInfo.filenameRead an archived receipt name