Python: Get executing block as string?

More
03 Apr 2023 01:55 #268139 by chowderhead
Python: Get executing block as string? was created by chowderhead
Hi, All:

Is there a way to get the currently executing block as string in Python? I see the tool path scrolling by in the Axis interface; is there a slick way to grab it from there?

Thanks.

Please Log in or Create an account to join the conversation.

More
11 Apr 2023 22:36 #268846 by HansU
Replied by HansU on topic Python: Get executing block as string?
You can get the line number and file name and then display the line accordingly.

Not 100% sure if "line-changed" is the correct message, but you can start with this. See linuxcnc.org/docs/html/gui/GStat.html#_messages
And you have "file-loaded" for the file name.
The following user(s) said Thank You: chowderhead

Please Log in or Create an account to join the conversation.

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
20 Jun 2023 11:36 #273921 by tommylight
Replied by tommylight on topic Python: Get executing block as string?
Spammer booted.
The following user(s) said Thank You: chowderhead

Please Log in or Create an account to join the conversation.

More
12 Jul 2023 19:05 #275292 by chowderhead
Replied by chowderhead on topic Python: Get executing block as string?
Knew nothing about Gstat. Thank you, HansU!

Please Log in or Create an account to join the conversation.

More
26 Jul 2023 12:19 #276301 by gulshan212
Replied by gulshan212 on topic Python: Get executing block as string?
Hello this is Gulshan Negi
Well, Python doesn't have a built-in feature to directly retrieve the currently executing block as a string take reference from here www.techgeekbuzz.com/blog/python-int-to-string-tutorial/.
Thanks

Please Log in or Create an account to join the conversation.

Time to create page: 0.065 seconds
Powered by Kunena Forum