Guest User

Untitled

a guest
Nov 18th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # --*-- coding:utf-8 --*--
  3. #create (large)tooltable Linuxcnc for testing
  4.  
  5. import random
  6.  
  7. Tools = 250
  8. toolFileName = "IR500.tbl"
  9.  
  10. tfile = open(toolFileName, "w")
  11. t = 1
  12.  
  13. r = random.uniform(0, 18)
  14.  
  15. while (t <= Tools):
  16. z = round(random.uniform(0, 50),2)
  17. d = round(random.uniform(6, 18),2)
  18. string = ['T',str(t),' ','P',str(t),' ','Z',str(z) ,' ','D',str(d) ,' ',';tool',str(t),'\n']
  19. j=''.join(string)
  20. tfile.write(j)
  21. t += 1
  22.  
  23. tfile.close()
Add Comment
Please, Sign In to add comment