diff options
-rw-r--r-- | kpov_judge/tasks/copy_rename_20_files_tail_env/task.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py index d1b67a4..7b113a2 100644 --- a/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py +++ b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py @@ -128,8 +128,8 @@ def gen_params(user_id, params_meta): params['DNS_static'] = r.choice(dns_servers) count = 0 while(count<user_id): - params[count]=random.randInt(10000000,99999999) - count=count+1 + params[count]=random.randInt(10000000,99999999) + count=count+1 return params def task_check(results, params): @@ -182,8 +182,9 @@ def preimenuj(): #napisi cimkrajsi ukaz, ki vse datoteke iz /home/user/mapa/mojimenik premakne v /hostuser/novi def premakni(): import os - for filename in os.filename("/home/user/mapa/mojimenik/"): - os.rename('/home/user/mapa/mojimenik/' + filename, '/home/user/novi/' + filename) + + for filename in os.filename("/home/user/mapa/mojimenik/"): + os.rename('/home/user/mapa/mojimenik/' + filename, '/home/user/novi/' + filename) #napisi ukaz, ki s pomocjo ukaza grep v datoteko "mama.txt" izpise vse navadne (ne skrite) datoteke v trenutnem imeniku, ki vsebujejo niz "mama", v datoteko "napake.txt" pa izpise vse morebitne napake @@ -210,7 +211,7 @@ def izpisi(): open('napake.txt','w').write(napaka) #napisi ukaz, ki bo 5s sledil vsebini /var/log/syslog. V primeru, da se pojavi niz "zmeda", naj program izpise "imam ga". Polega tega naj program med sledenjem odsteva od 5 do 1 -def sledi() +def sledi(): import time import re import mmap |