other:python:misc_by_jyp
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
other:python:misc_by_jyp [2021/08/18 16:04] – Added pprint section jypeter | other:python:misc_by_jyp [2021/08/25 14:00] – [Working with paths and filenames] Added more examples jypeter | ||
---|---|---|---|
Line 50: | Line 50: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | |||
+ | |||
+ | === Example: getting the full path of the Python used === | ||
+ | |||
+ | < | ||
+ | >>> | ||
+ | >>> | ||
+ | '/ | ||
+ | |||
+ | |||
+ | === Example: getting the full path of a script === | ||
+ | |||
+ | < | ||
+ | >>> | ||
+ | '/ | ||
+ | >>> | ||
+ | True | ||
+ | >>> | ||
+ | '/ | ||
+ | >>> | ||
+ | True | ||
+ | </ | ||
+ | |||
=== Example: getting the size(s) of all the files in a directory === | === Example: getting the size(s) of all the files in a directory === | ||
Line 110: | Line 133: | ||
==== Using ordered dictionaries ==== | ==== Using ordered dictionaries ==== | ||
- | Check the [[https:// | + | **Dictionary order is guaranteed to be insertion order**! Note that the [[https:// |
+ | |||
+ | Check the [[https:// | ||
==== Printing a readable version of long lists or dictionaries ==== | ==== Printing a readable version of long lists or dictionaries ==== |
other/python/misc_by_jyp.txt · Last modified: 2024/11/04 15:01 by jypeter