I have the following code in a python 2.7.10 script
params = {'F': '250', 'I': '-22.5', 'J': '-22.5', 'Y': '12.817175976', 'X': '7.4', 'Z': '-50'}
G3 = 'G3 F {F} I {I} J {J} X {X} Y {Y} Z {Z} \n'
print(params)
print(G3)
print(G3.format(params))
When I try to run it it gives the following output:
./g-codeGenerator.py
{'F': '250', 'I': '-22.5', 'J': '-22.5', 'Y': '12.817175976', 'X': '7.4', 'Z': '-50'}
G3 F {F} I {I} J {J} X {X} Y {Y} Z {Z}
Traceback (most recent call last):
**Traceback truncated**
File "./g-codeGenerator.py", line 342, in siliconOutputSequence
print(G3.format(params))
KeyError: 'F'
Why is this causing the key error, as far as I can see all of the required elements are present in the parameters?