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
473 B
14 lines
473 B
{% calculate run = '/usr/bin/python', package = 'test-category/new-package' %}
|
|
import os
|
|
files_list = os.listdir('./')
|
|
files_list.remove('test')
|
|
if not files_list:
|
|
with open('./file_0', 'w') as new_file:
|
|
new_file.write('from script_2')
|
|
else:
|
|
new_file_path = './file_{}'.format(int(files_list[-1].lstrip('file_')) + 1)
|
|
print('script_2 creates file:', new_file_path)
|
|
with open(new_file_path, 'w') as new_file:
|
|
new_file.write('from script_2')
|
|
|