diff --git a/Untitled.md b/Untitled.md deleted file mode 100644 index 8248a5c..0000000 --- a/Untitled.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -tags: [] -created: Monday, October 21, 2024 ---- -# Untitled - - - - diff --git a/scripts/auto_save.sh b/scripts/auto_save.sh index 2bb7719..aa46072 100755 --- a/scripts/auto_save.sh +++ b/scripts/auto_save.sh @@ -23,8 +23,8 @@ changes_exist="$(git status --porcelain | wc -l)" # If no changes, exit. Else commit and push with timestamp if [ "$changes_exist" -eq 0 ]; then - echo "No changes, exiting" - exit 0 + echo "No changes, exiting" + exit 0 fi # echo "Standardising file-names..." @@ -34,8 +34,8 @@ fi # source ${purge_images} # pointless comment -/home/thomas/repos/neuron-zk-generator/dist/app - +neuron-zk-generator +# /home/thomas/repos/neuron-zk-generator/dist/app echo "Changes exist. Updating remote..." git pull >/dev/null 2>&1 @@ -43,5 +43,4 @@ git add . git commit -q -m "Autosave: $(date +"%Y-%m-%d %H:%M:%S")" git push -/home/thomas/repos/slack-notifier/src/index.js 'eolas' '✅ Eolas: auto-save executed' - +/home/thomas/repos/slack-notifier/src/index.js 'eolas' '✅ Eolas: auto-save executed' diff --git a/zk/File_CRUD_operations_in_Python.md b/zk/File_CRUD_operations_in_Python.md deleted file mode 100644 index 7551047..0000000 --- a/zk/File_CRUD_operations_in_Python.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -tags: [python, file-system, procedural] -created: Friday, October 25, 2024 ---- - -# File operations in Python - -Most create, delete, move etc operations invoke the inbuilt `os` module. - -// Add directory CRUD operations in Python - -## Renaming files (moving) - -```py -import os -os.rename('original-file-name.txt', 'new-file-name.txt') -``` - -## Deleting files - -```py -import os -os.remove('file-name.txt') -``` diff --git a/zk/Working_with_directories_in_Python.md b/zk/Working_with_directories_in_Python.md index 2dc0f88..1b91664 100644 --- a/zk/Working_with_directories_in_Python.md +++ b/zk/Working_with_directories_in_Python.md @@ -17,6 +17,15 @@ with os.scandir("/a/directory") as dir: print(Path(entry).suffix) ``` +## List files without extension + +```python + +file = "/some/file/with/markdown.md" +return os.path.splitext(os.path.basename(file))[0] +# markdown +``` + ## Create a directory ```py