cancel
Showing results for 
Search instead for 
Did you mean: 

BlueNRG Python Scriptlauncher

Dhaval Malav
Associate II
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
3 REPLIES 3
Benoit Duflos_O
Associate
Posted on December 07, 2016 at 08:18

Hi,

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

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 <

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.