Guest User

Untitled

a guest
Oct 20th, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. #!/path/to/python
  2.  
  3.  
  4. # numerical data
  5. # python GraphicalPart.py ../S001R03_data.txt_motor.txt_0.0_T0.txt
  6.  
  7. import sys
  8. import matplotlib.pyplot as plt
  9.  
  10. import sys
  11.  
  12. def startDivide(fileName):
  13.     inputFile = open(fileName)
  14.     outputFile = open(fileName + "_out.txt", "w")
  15.     #a = []
  16.  
  17.     for line in inputFile.readlines():
  18.         data = line.split(" ")
  19.         outputFile.write("%s" % (data[1]))
  20.        
  21.     plt.plot(a)
  22.     plt.show()
  23.     inputFile.close()
  24.     outputFile.close()
  25.  
  26.  
  27. def main():
  28.     if len(sys.argv) != 2:
  29.         print "Not enough arguments. *_data.txt file only!"
  30.     else:
  31.         startDivide(sys.argv[1])
  32.  
  33. if __name__ == "__main__":
  34.     main()
Advertisement
Add Comment
Please, Sign In to add comment