hexagon logo

How to open a python script in pcdmis?

I've got a couple basic scripts running on our programs and you simply go to INSERT > BASIC SCRIPT and chose the .bas file. But it won't let me choose a python file .py.
I tried external command and that doesn't work and I've tried INSERT > FILE I/O COMMAND > FILE OPEN, but when I run the program it runs the program without doing anything inside the python script.

How were those running some python scripts here actually getting pcdmis to open the python script?

Thanks.

Parents


  • Here's how I would do this. I would look into some fancier way of doing it as I'm somewhat confident there's a way....


    First do this:
    1. Create a folder called Python
    2. In Python folder create two files
    • CallPythonScript.bat
    • hello_world.py
    3. Write this in your CallPythonScript.bat and save it

    @echo OFF
    python "C:\<Path of Python folder>\hello_world.py"
    


    4. Write this in your hello_world.py and save it
    print('hello world')
    


    5. In Pc-Dmis insert an external command like so
    EXTERNALCOMMAND/DISPLAY ; C:\<Path Python folder>\Python\CALLPYTHONSCRIPT.BAT
    


    Let me know if this works. If it does, I'll tell ya how to get Pc-Dmis variable values from A to B by using print commands to write to text files as a start.
Reply


  • Here's how I would do this. I would look into some fancier way of doing it as I'm somewhat confident there's a way....


    First do this:
    1. Create a folder called Python
    2. In Python folder create two files
    • CallPythonScript.bat
    • hello_world.py
    3. Write this in your CallPythonScript.bat and save it

    @echo OFF
    python "C:\<Path of Python folder>\hello_world.py"
    


    4. Write this in your hello_world.py and save it
    print('hello world')
    


    5. In Pc-Dmis insert an external command like so
    EXTERNALCOMMAND/DISPLAY ; C:\<Path Python folder>\Python\CALLPYTHONSCRIPT.BAT
    


    Let me know if this works. If it does, I'll tell ya how to get Pc-Dmis variable values from A to B by using print commands to write to text files as a start.
Children
No Data