This shows you the differences between two versions of the page.
Next revision Both sides next revision | |||
other:python:misc_by_jyp [2021/06/30 13:17] jypeter created |
other:python:misc_by_jyp [2021/06/30 15:20] jypeter |
||
---|---|---|---|
Line 20: | Line 20: | ||
* Stopping a script\\ <code>sys.exit('Some optional message about why we are stopping')</code> | * Stopping a script\\ <code>sys.exit('Some optional message about why we are stopping')</code> | ||
+ | |||
+ | * Checking if a file/directory is writable by the current user\\ <code>>>> os.access('/', os.W_OK) | ||
+ | False | ||
+ | >>> os.access('/home/jypmce/.bashrc', os.W_OK) | ||
+ | True</code> | ||
/* | /* |