Код: Выделить всё
#test.py
#!/bin/python3.9
import os
if len(os.lisdir('staging')) == 0:
print("Staging is empty")
else:
print("Staging is not empty")
Я попробовал следующее
Код: Выделить всё
#realscript.py
#!/bin/python3.9
import os
import re
from packaging.version import Version
....
def inst_pkg():
...
if len(os.listdir('staging')) == 0:
print("staging is not empty")
for(root, dirs, file) in os.walk(esi_dir):
....
else:
print("No new content")
....
Подробнее здесь: https://stackoverflow.com/questions/790 ... a-function