You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
486 B

{% calculate run = '/usr/bin/python', package = 'test-category/other-package',
merge = 'test-category/new-package' %}
import os
files_list = os.listdir('./')
if not files_list:
with open('./file_0', 'w') as new_file:
new_file.write('from script_1')
else:
new_file_path = './file_{}'.format(int(files_list[-1].lstrip('file_')) + 1)
print('script_1 creates file:', new_file_path)
with open(new_file_path, 'w') as new_file:
new_file.write('from script_1')