Getting Started with Python

The most efficient method of interfacing with the vx7500 is from within the Python programming language.

For a comprehensive Python installation on windows, with an emphasis on scientific tools, we highly recommend Python(x,y).

If you are new to Python, we highly recommend Learning Python.

Requirements

  • If you have not done so yet, download Python(x,y) and install. Refer to Software List for installation information.
  • When creating and running your scripts, save them in the c:\vena directory.

Starting Spider (Python Development Environment)

Spider is a powerful interactive development environment for the Python language with advanced editing, and debugging capabilities. Refer to Spider Documentation.

To open Spider, click on Start –> All Programs –> Python(x,y) –> Spider –> Spider.

Tip

It might be nice to create a shortcut to Spider on your desktop for future use.

Creating your first Python script

  1. Create a new file in Spider by selecting File –> New file...

    Note

    When Spyder creates a new document, it creates a few extra items at the top. These lines can all be deleted if desired (or ignored). Anything in Python that begins with a # is a comment, as well as text enclosed between """.

  2. Save the file as c:\vena\myscript.py

  3. Type the following into the editor:

    1
    2
    3
    4
    import numpy as np
    
    y = np.array([5.2,4.3,9.1,1.5])
    print 'median:', np.median(y)
    
  4. To run the script first save it File –> Save, then run the script by selecting Run –> Run. The output will be displayed in the console in the lower-right of the screen.

    median: 3.17133307457