new gerbil

This commit is contained in:
Thomas Herrmann 2023-12-22 20:06:34 +01:00
parent b4d2bcebab
commit 56076fc4b4
3 changed files with 16 additions and 1 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "gcode_machine"]
path = gcode_machine
url = https://github.com/michaelfranzl/gcode_machine.git

1
gerbil

@ -1 +0,0 @@
Subproject commit 37758e6f60805b7ed00b2880420bfc8a928ce3a3

13
regex_test.py Normal file
View File

@ -0,0 +1,13 @@
import re
line = "<Idle|WPos:69.000,40.000,-20.000|Bf:15,128|FS:0,0>"
pattern = r"<[^|]*\|WPos:([^,]*),([^,]*),([^|]*)\|"
m = re.match(pattern, line)
if m:
print("Group 1 (X):", m.group(1))
print("Group 2 (Y):", m.group(2))
print("Group 3 (Z):", m.group(3))
else:
print("No match found.")