Advertisement
Guest User

python shit

a guest
Apr 26th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. import sys
  2. import os
  3. #import keras
  4. #x = int(sys.argv[1])  
  5. #y = int(sys.argv[2])
  6.  
  7. def getDataFile():
  8.    
  9.     print("Im getting data")
  10.  
  11.     exists = os.path.isfile('toPython.txt')
  12.  
  13.     while not exists:
  14.         #Nothing happens here, im just waiting for the file to exist
  15.         sick = "hej"
  16.  
  17.     f = open("toPython.txt", "r")
  18.  
  19.     i = 0
  20.  
  21.     f1 = f.readlines()
  22.     for x in f1:
  23.         i += 1
  24.    
  25.     f.close()
  26.  
  27.     os.remove("toPython.txt")
  28.  
  29.     return i
  30.    
  31.    
  32. def makeChoiceFile(i):
  33.  
  34.     f = open("toCs.txt","w+")
  35.  
  36.     f.write(str(i))
  37.  
  38.     f.close()
  39.  
  40. numberOfLines = getDataFile()
  41.  
  42. makeChoiceFile(numberOfLines)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement