nex Python Package

nex Python Package provides a simple way to run Python scripts that control NeuroExplorer (open data file, get file data, run analysis, save results, etc.) in any Python IDE.

For NeuroExplorer scripting documentation, see Scripting Reference.

To use an external Python environment to run Python scripts in NeuroExplorer:

  • In NeuroExplorer, select Script | Enable Running Python Scripts in External Editor menu command

  • Install nex Python package. Run this command in Windows Command Prompt:

    python.exe -m pip install -U nex
    
  • If you get an error message pip: command not found, run this command first to install pip:

    python.exe -m ensurepip --upgrade
    
  • If you are using Anaconda:

    • Type Anaconda Prompt in Windows Search box

    • Select a version of Anaconda Prompt in Best Match panel above Windows Search box

    • Run this command in Anaconda Prompt

      pip install -U nex
      

No changes in your script are required.

If you are using Visual Studio Code:

  • Open Python script in Visual Studio Code or, in NexScript, select menu command File | Open in VS Code

  • In Visual Studio Code, you will see full IntelliSense support (code completion, parameter info, etc.) for nex package:

    ../_images/vscode_intel.png
  • Press F5 to debug your script in Visual Studio Code:

    ../_images/vscode_debug1.png