Skip to content

Instantly share code, notes, and snippets.

@nkp216
Created November 18, 2018 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nkp216/6b7212d09cb696c9478cb7668e239984 to your computer and use it in GitHub Desktop.
Save nkp216/6b7212d09cb696c9478cb7668e239984 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# --*-- coding:utf-8 --*--
#create (large)tooltable Linuxcnc for testing
import random
Tools = 250
toolFileName = "IR500.tbl"
tfile = open(toolFileName, "w")
t = 1
r = random.uniform(0, 18)
while (t <= Tools):
z = round(random.uniform(0, 50),2)
d = round(random.uniform(6, 18),2)
string = ['T',str(t),' ','P',str(t),' ','Z',str(z) ,' ','D',str(d) ,' ',';tool',str(t),'\n']
j=''.join(string)
tfile.write(j)
t += 1
tfile.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment