Coding error in putty

I used putty where I verify the basic problem it runs successfully but I try run the device status program I faces some issues with the output


can anyone rectify it ASAP

@rajmohanoff Could you please share the code that you are trying to run?

@shobhit.kumawat


I just us the code which I found in my training module I hope I didn’t do anything extra
first I use: sudo nano device_status.py (where I get my device detail)
then I use : sudo python3 device_status.py
but I get an error please rectify it

@rajmohanoff Please check the indentation in your code first. After confirming, do remove boltiot python library by running pip uninstall boltiot. Once you do it, reinstall the boltiot python library by running pip install boltiot. Try running the code and let me know what you get on the console.

sir I tried but the error is still there can you suggest any other options

Hi @rajmohanoff,

I have tried running the same code at my end and the library is working perfectly fine.

Windows:
image

Ubuntu

I would suggest you delete the existing droplet and create a new one if you are using digital ocean. If you are using a virtual box then uninstall the current ubuntu os and create a new desktop on it.

You can also use the command prompt in your windows to run this code. Your code should run without any errors. This is the code that you need to paste into python file

from boltiot import Bolt
api_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
device_id  = "BOLTXXXXXX"
mybolt = Bolt(api_key, device_id)
response = mybolt.isOnline()
print (response)

Sure sir I will try thanks for the suggestions

@shobhit.kumawat its working thank you sir

1 Like