other:python:misc_by_jyp
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
other:python:misc_by_jyp [2021/07/07 15:07] – Added the paths/filenames section jypeter | other:python:misc_by_jyp [2021/07/15 15:29] – [Working with paths and filenames] Added shutil and and example jypeter | ||
---|---|---|---|
Line 49: | Line 49: | ||
* Available since Python version 3.4 | * Available since Python version 3.4 | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | === Example: getting the size(s) of all the files in a directory === | ||
+ | |||
+ | < | ||
+ | $ ls -l | ||
+ | total 72 | ||
+ | -rw-r--r-- 1 jypmce ipsl 18147 Jun 25 2012 get_TS_cmip5.py | ||
+ | -rw-r--r-- 1 jypmce ipsl 16152 Jun 21 2012 get_TS_cmip5.py~ | ||
+ | -rw-r--r-- 1 jypmce ipsl 13954 Jul 3 2012 get_TS_cmip5_regular.py | ||
+ | -rw-r--r-- 1 jypmce ipsl 16539 Jun 22 2012 get_TS_cmip5_regular.py~</ | ||
+ | |||
+ | < | ||
+ | >>> | ||
+ | / | ||
+ | >>> | ||
+ | >>> | ||
+ | [' | ||
+ | >>> | ||
+ | >>> | ||
+ | [16152, 13954, 16539, 18147] | ||
+ | >>> | ||
+ | 64792</ | ||
==== Using command-line arguments ==== | ==== Using command-line arguments ==== | ||
other/python/misc_by_jyp.txt · Last modified: 2024/11/04 15:01 by jypeter