SHARE
TWEET

Untitled

a guest Jul 25th, 2012 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # datoteki morata biti v istem direktoriju kot .py datoteka
  2.  
  3. angleska = "eng.txt" # napisi ime angleske datoteke
  4. slovenska = "slo.txt" # napisi ime slovenske datoteke
  5. output = "output.txt" #napisi ime output datoteke
  6.  
  7. file1 = open(angleska, 'r')
  8. file2 = open(slovenska, 'r')
  9. file3 = open(output, 'w')
  10. line_eng = "start"
  11. line_slo = "start"
  12. while line_eng  and line_slo:
  13.     line_eng = file1.readline()
  14.     line_slo = file2.readline()
  15.     file3.write(line_eng)
  16.     if line_eng == line_slo:
  17.         file3.write(file2.readline())
  18.         file1.readline() # preskocis line
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top