Python User Interface Error

  • JT
  • JT's Avatar Topic Author
  • Away
  • Administrator
  • Administrator
More
25 Nov 2023 14:29 - 25 Nov 2023 15:39 #286460 by JT
I'm trying to use the python interface to create a new GUI using PyQt6 but I can't seem to figure out how to load the ini file without an error inifile(-ini_ failed.

Edit: repo was just a scratch repo so I deleted it.

One way to get the ini file into the python module for both local testing and as the DISPLAY entry is:
		for i in range(len(sys.argv)):
			if sys.argv[i].endswith('.ini'):
				inifile = linuxcnc.ini(sys.argv[i])

JT 
Last edit: 25 Nov 2023 15:39 by JT.

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

  • JT
  • JT's Avatar Topic Author
  • Away
  • Administrator
  • Administrator
More
25 Nov 2023 15:12 #286465 by JT
Replied by JT on topic Python User Interface Error
I did figure it out, I was using the docs and the sys.argv is not correct if you are running the GUI directly in LinuxCNC.
/usr/bin/emc3
-ini
/home/john/linuxcnc/configs/emc/emc.ini

So the docs say to use inifile = linuxcnc.ini(sys.argv[1]) but that's not correct. Qtvcp has a better approach to getting the ini file location.

JT
The following user(s) said Thank You: tommylight

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

Time to create page: 0.063 seconds
Powered by Kunena Forum