fbpx

CS-Lab Support Forum for CNC Community

Help to run this brand-new forum and stay with us.
Ask your questions, we are here to help! 

 

Please or Register to create posts and topics.

pyaction no longer works

Hello,

in the final 3.5 version my time pyaction does not work anymore.
This is the code for the action:

from datetime import datetime
# datetime object containing current date and time
now = datetime.now()

# dd/mm/YY H:M:S
dt_string = now.strftime("%H:%M:%S")
gui.edTime.setText( dt_string)

The code and my LineEdit is completely unchanged. Maybe you can test it.

 

Hello.

I checked, and on my computer, your code is working correctly.

 

Check if simCNC has a path to Python:

  1. Go to this location „C:\Program Files\simCNC\python”
  2. Open a file with Notepad „pythonInstallationPath”
  3. Check if there is an entry in the file „C:\Users\wojtek\AppData\Local\Programs\Python\Python311\python.exe”

Note, "wojtek" is the name of my computer; change it to the right one for you.

 

>>> in the final 3.5 version my time pyaction does not work anymore.

 

                What does that mean?

                Are you getting an error in the Python console?

 

Regards,

Wojtek

carbonkid has reacted to this post.
carbonkid

Hello, thank you that was the solution. Only why was the path not automatically entered in the file?
I have installed the last beta and now in parallel still the 3.5 final. Can that be the reason?
So far I never had to enter the path there manually.

 

What does that mean?
Are you getting an error in the Python console?

No I didn't get an error in the Python console, in LineEdit the time just wasn't showing.

I have now installed simCNC 3.5 on various computers and the "pythonInstallationPath" file never automatically contains the path. It is always empty.
When I install 3.406, the path is automatically in the file.

Great, the problem is now also fixed in the beta.

PARTNERS:

 

USA

Germany

Slovenia / Bosnia

Spain

South Africa

UNI-CAM

The Netherlands

Portugal

Greece

  Distrib milionis logo

Hungary

Distrib logot

Bulgaria

Master

Kenya

Proteq Automation

Egypt

Germanelectronix

China

Jun Ma

Serbia

ALCO

Italy

LVL tech r

Denmark

Varntoft Dania

Finland