In default configuration the Python script downloaded to module and enabled is executed at every module power on if the DTR line is sensed LOW (2.8V at the module DTR pin - RS232 signals are inverted) on USIF0 at start-up (this means that no AT command interface is connected to the modem serial port), and if the script name enabled matches with one of the script names of the scripts downloaded.
For example the Python script correctly downloaded and enabled is executed when the module is powered on and the serial cable was previously disconnected from USIF0.
In order to block Python script execution and control the module through the AT command interface on the serial port (for example to update locally a new script) the module shall be powered on with the DTR line HIGH (0V at the module DTR pin). In this condition the Python engine is not started and the script is not executed.
The real execution of the .py Python script is delayed from the power on due to the time needed by Python to parse the script. The larger is the script, the longer is this delay.
The execution of .pyc compiled Python script is faster because there is no parsing of the script, just reading the file from NVM.
Another possibility is to run the correctly downloaded and enabled Python script from terminal emulator using the following AT command:
AT#EXECSCR
Another possibility is to select a second way of executing the Python script at every module power on using the following AT command:
AT#STARTMODESCR=<script_start_mode>[,<script_start_to>]
where
<script_start_mode>: mode (default 0)
<script_start_to>: timeout (default 10)
If the mode is set to 1 than the Python script downloaded to module and enabled is executed at every module power on if the user does not send any AT command on the serial port for the time interval specified in <script_start_to> parameter (default 10s).