StringIO and BytesIO: in-memory streams with different types
io.StringIO handles text, while io.BytesIO handles bytes. They help when a library expects a file-like object but the data is already in memory.
1274 results
io.StringIO handles text, while io.BytesIO handles bytes. They help when a library expects a file-like object but the data is already in memory.
fnmatch compares names with shell-style patterns. fnmatch.fnmatchcase('report.csv', '*.csv') is True, and fnmatchcase preserves case sensitivity.
glob finds paths matching patterns such as *.csv, but does not guarantee their order. Sort the results explicitly for an ordered import.
Lunenburg is a planned British colonial settlement in Canada founded in 1753. Its original layout and substantial timber architecture survive.
Conchas are Mexican sweet buns with a characteristic topping. King Arthur prepares that layer separately from the yeast dough and shapes it over the portions.
tempfile.TemporaryDirectory can act as a context manager that cleans up its temporary directory on exit. It suits intermediate conversion files.
ZF's AxTrax 2 integrates electric propulsion into an axle for medium- and heavy-duty commercial vehicles. The idea is to gather key drive components around the conventional axle locatio...
shutil.copy2() attempts to preserve more file metadata than merely copying contents. The documentation warns that even high-level copying cannot transfer every attribute on every platfo...
Old Québec combines a fortified Upper Town on the cliff with a Lower Town and historic districts. Religious, administrative and defensive buildings form a shared ensemble.
The Czech kolaches in this recipe are sweet yeast pastries shaped to hold filling. The depression and dough border determine how the filling sits in the finished portion.
os.environ exposes process environment variables as text. A configured port, for example, needs conversion and validation before being used as a number.
sys.argv contains program arguments, with the initial element describing the script or invocation. A supplied quantity such as 12 starts as text, not an automatically validated number.