GUI Python Script - ArrowElectronics/Reconfigurable-Industrial-Robotics-Platform GitHub Wiki

Python Setup

An alternative to running the Windows EXE GUI is through a Python script, which can also run on Windows. This requires installing the following tools and setting up the environment. Note: This is optional and only required to run the GUI as a Python script.

The service used for package management and code distribution in this project is Anaconda. This allows the user to recreate the python environment used for this project with ease.

Requirements:

  • Download and install Anaconda 3
  • The project file (MotorControlGUI) acquired from cloning the repository.

The Python script can be run using one of either method:

  • Using Anaconda Navigator
  • Using Anaconda Command Shell

Using Anaconda Navigator

  1. Open Anaconda Navigator by typing Anaconda Navigator in the Windows Search bar and running it.

  2. Click the Environments symbol in the left margin then click Import at the bottom of the pane, and navigate to the /MotorControlGUI/Python/environment.yml for Specification File fields, on the PC and click the Green Import button.

Note: This may take a while for the first time import.

  1. Click the Home symbol in the left margin and Launch the Spyder Application.

  2. In the Spyder App widow, click the Open File icon and navigate to open the <folder location>/MotorControlGUI/Python/app.py file.

  3. Click the Run button.

    • Note: The ADI GUI may open behind the Spyder GUI and may not be visible. Look for it.

Using Anaconda Command Shell

  1. Open the Anaconda command shell by typing Anaconda Prompt in the Windows Search bar.

  2. If the project environment has not been previously established, import the pre-created one using:
    $ conda env create -f <folder location>/MotorControlGUI/Python/environment.yml

  3. List the environments to confirm that "motorGUI_env" is there:

    $ conda env list

  4. Activate the environment:

    $ conda activate motorGUI_env

  5. Run the application using the commands:

     $ cd <folder location>/MotorControlGUI/Python
     $ python app.py   

If you want to look at the source code, in the anaconda-supported IDE of your choice (Spyder is recommended for this project), open the app.py file in the MotorControlGUI folder. If you need to install an IDE, use the following command, and hit [y] on the keyboard when prompted:

    $ conda install spyder  

You can then run this IDE in the current environment from the anaconda prompt by typing:

    $ spyder <folder location>/MotorControlGUI/Python/app.py  

Using the ADI Motor Control GUI application

The Python GUI operates very similarly to the Windows GUI. Either method provides a GUI to interface to the platform. Further instructions are described in the demonstration section.

Return to Run the Demonstration

Information on this site was obtained from
⚠️ **GitHub.com Fallback** ⚠️