homework 4.2: add questions 1-2, move homework to subdir

This commit is contained in:
2022-04-07 10:38:49 +07:00
parent 31fbe09273
commit 2981f9cab8
7 changed files with 65 additions and 8 deletions

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import os
cd_command = "cd ~/netology/sysadm-homeworks"
bash_command = [cd_command, "git status"]
top_level_command = [cd_command, "git rev-parse --show-toplevel"]
top_level = os.popen(' && '.join(top_level_command)).read().replace('\n', '')
result_os = os.popen(' && '.join(bash_command)).read()
for result in result_os.split('\n'):
if result.find('modified') != -1:
prepare_result = result.replace('\tmodified: ', '')
full_path = top_level + '/' + prepare_result
print(full_path)