Created
November 18, 2018 08:42
-
-
Save nkp216/6b7212d09cb696c9478cb7668e239984 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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