Write from boltiot import Bolt in the starting of the program
1 Like
from boltiot import Bolt
api_key = “”
device_id = “”
mybolt = Bolt(api_key, device_id)
response = mybolt.digitalWrite(‘0’,‘HIGH’)
print(response)
Hope this helped.
1 Like
Hi,
First off open the terminal at the bottom of the pycharm screen and type in the following command:
pip3 install boltiot
Next, in your .py code, add this line at the top of the code:
from boltiot import Bolt
Hey @ramesh00845
Problem
You haven’t imported the bolt module into your current python file.
Solution
- So, if you have not installed
boltiot
module
a. Open command prompt
b. Type in the following and hit enter
pip install boltiot
- Now that you have installed the module in your system
a. Use the following code and paste it on top of your entire code
from boltiot import Bolt
Last Look
from boltiot import Bolt
api_key = "Paste_Your_API_Key" #You must insert your unique API Key
device_id = "BOLTXXXX" #You must insert your device ID
mybolt = Bolt(api_key, device_id)
response = mybolt.isOnline()
print(response)
1 Like