fork(1) download
  1. import re
  2.  
  3. patron = r'\/\/([^\/]+)\/.+\.(zip|rar)'
  4.  
  5. file = open('text.txt', 'r+')
  6. text = file.read()
  7.  
  8. for linea in text:
  9. m = re.search(patron, linea)
  10. if m:
  11. linea = linea.replace(m.group(1), "miserver.com")
  12.  
  13.  
  14. file.seek(0)
  15. file.write(linea)
  16. file.truncate()
  17. file.close()
Runtime error #stdin #stdout #stderr 0.04s 9568KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 5, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'text.txt'