Skip to main content
Dhaval Malav
Associate II
December 6, 2016
Question

BlueNRG Python Scriptlauncher

  • December 6, 2016
  • 1 reply
  • 1133 views
Posted on December 07, 2016 at 00:39

Hi,

Referring to this question: 

https://community.st.com/0D50X00009Xke8kSAB

 

Dear customer,

I'll try to give a feedback to you:

•Can scripts be run in a normal Python debug environment rather than using BlueNRG_Script_Launcher to run?

- No the scripts written for BlueNRG device cannot be runned in a normat Python debug because they contain special command understanding only using BlueNRG_Script_Launcher or GUI.

•Can I import standard Python modules into my BlueNRG GUI script?

Yes, you can import any standard Python modules into BlueNRG GUI script.

•Is there a BlueNRG module or package I can import to add Bluetooth capabilities to a normal Python program?

No

Regards,

Graziella Marchese

I tried to import a python package in the script and ran using script launcher but it failed with ImportError. I am using Windows 7 OS. Any suggestion on how to fix this issue?

Thanks in advance.

#bluenrg #bluenrg-gui
    This topic has been closed for replies.

    1 reply

    Benoit Duflos_O
    Visitor II
    December 7, 2016
    Posted on December 07, 2016 at 08:18

    Hi,

    Can you share the the complete error message and the lines that cause the error ?

    Dhaval Malav
    Associate II
    December 7, 2016
    Posted on December 07, 2016 at 16:47

    Hi,

    Error:

    C:\Projects

     

    BlueNRG GUI 2.2.1\Application

    *>BlueNRG_Script_Launcher.exe -p COM120 -s 'C:\Projects\BlueNRG GUI

    2.2.1\Application\scripts\DemoX\SensorDemo_Central.py'*

    Exception: Traceback (most recent call last):

    • File

    'c:\GIT_vobs\BlueNRG_GUI_2.2.1\GUI\src\bluenrg_script_launcher\build\BlueNRG_Script*

    Launcher\out00-PYZ.pyz\scriptexecuter', line 582, in run

    • File 'C:\Projects\BlueNRG GUI 2.2.1\App*

    lication\scripts\DemoX\SensorDemo_Central.py', line 68, in <module>

    • import json*

    ImportError: No module named json

    Thank You,

    Dhaval

    On Wed, Dec 7, 2016 at 2:18 AM, duflos.benoit <

    Benoit Duflos_O
    Visitor II
    December 9, 2016
    Posted on December 09, 2016 at 08:34

    I would be intersting to know what version is embedded into BlueNRG_Script_Launcher tools.

    Can you try:

       import sys,os

       print sys.version

       print os.__file__

    Before the error - to identify what version Python is executing the script.

    Whatever json module have to be supported.