Elproma Elektronika Sp. z o.o.
ul. Szymanowskiego 13
05-092 Łomianki k/Warszawy
E-mail:
office@elproma.com.pl
Tel. +48 (22) 751 76 80
www.teleorigin.com
31
Compilation in PythonWin can also be performed with the shortcut key F6.
In case of an error during the compilation process, a new file (with a red Python icon)
and associated error log are created with a *.pye extension. The DOS window will remain
open in case of compilation errors, otherwise it’s closed at the end of the compilation.
When the Python script is compiled in PythonWin, further errors will be reported in
the Interactive Window, while in the Python script window they’ll be indicated by the cursor.
A “download” option has beed added to the contextual menu of compiled and simple
text Python files, which implement a reliable download of Python scripts on the module.
Shortcut key F3 in PythonWin will start a quick search of selected text in the active
file.
12.1.2. Write Python script
A Python script is a simple text file, it can be written with any text editor but for your
convenience a complete Integrated Development Environment (IDE) is included in a
software package provided by Telit. You can download it using link below:
http://teleorigin.com/download/Telit/Python/Telit_Pythov4_1.rar
Remembering the supported features described in 2.6, it is simple to write the script
and test it directly from the IDE.
The following is the “Hello Word” short Python script that sends the simplest AT
command to the AT command parser, waits for response, prints it and then ends.
import MDM
print 'Hello World!'
result = MDM.send('AT\r', 0)
print result
c = MDM.receive(10)
print c
12.1.3. Download Python script
Command:
AT#WSCRIPT=”<script_name>”, <size>,<know-how>
<script_name>: file name
<size>: file size [number of bytes]
<know-how>: know how protection, 1=on, 0 =off [default]
The script, the compiled script, any text or binary file, can be downloaded on the
module using the #WSCRIPT command. In order to guarantee your company know-how,
you have the option to hide the script text so that the #RSCRIPT command does not return
the text of the scri
pt and keeps it “confidential”, you can see the name of the script only
using the #LSCRIPT command.