Start An Interactive Python Session - Digi IX10-00G4 User Manual

Table of Contents

Advertisement

Applications
> scp host 192.168.4.1 user admin remote /home/admin/bin/test.py local
/etc/config/scripts/ to local
admin@192.168.4.1's password: adminpwd
test.py
>
c. Type exit to exit the Admin CLI.
Depending on your device configuration, you may be presented with an Access selection
menu. Type quit to disconnect from the device.
Note
You can also create scripts by using the vi command when logged in with shell access.
2. Select a device in Remote Manager that is configured to allow shell access to the admin user,
and click Actions > Open Console. Alternatively, log into the IX10 local command line as a user
with shell access.
Depending on your device configuration, you may be presented with an Access selection
menu. Type shell to access the device shell.
3. Use the python command to run the Python application. In the following example, the Python
application, test.py, takes 3 parameters: 120, ports and storage:
# python /etc/config/scripts/test.py 120 ports storage

Start an interactive Python session

Use the python command without specifying any parameters to start an interactive Python session.
The Python session operates interactively using REPL (Read Evaluate Print Loop) to allow you to write
Python code on the command line.
Note
The Python interactive session is not available from the Admin CLI. You must access the device
shell in order to run Python applications from the command line. See
information about configuring authentication groups that include shell access.
1. Select a device in Remote Manager that is configured to allow shell access to the admin user,
and click Actions > Open Console. Alternatively, log into the IX10 local command line as a user
with shell access.
Depending on your device configuration, you may be presented with an Access selection
menu. Type shell to access the device shell.
2. At the shell prompt, use the python command with no parameters to enter an interactive
Python session:
# python
Python 3.10.1 (default, May
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
3. Type Python commands at the Python prompt. For example, to view help for the digidevice
module, type:
IX10 User Guide
Start an interactive Python session
100%
36MB
Authentication groups
9 2021, 22:49:59)
11.1MB/s
00:03
for
528

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ix10Ix10-00n4

Table of Contents