From 6e519aedbce3e9dc7c8b329bec42e46963e9a34a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20G=C3=B6r?= Date: Mon, 29 Jul 2024 20:06:00 +0300 Subject: [PATCH] shell match case --- python/psd_shell_match_case.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 python/psd_shell_match_case.py diff --git a/python/psd_shell_match_case.py b/python/psd_shell_match_case.py new file mode 100644 index 0000000..68b80be --- /dev/null +++ b/python/psd_shell_match_case.py @@ -0,0 +1,14 @@ +while True: + cmd = input('CSD>').split() + + match cmd: + case ('delete', path) | ('remove', path) | ('erase', path): + print(f'{path} dosyası siliniyor') + case 'copy', source_path, dest_path: + print(f'{source_path} dosyası {dest_path} olarak kopyalanıyor') + case 'rename', oldname, newname: + print(f'{oldname} dosyanının ismi {newname} olarak değiştiriliyor') + case 'exit' | 'quit': + break + case _: + print('geçeriz komut!') \ No newline at end of file