Project 6 Python Code

Hey There,
I am not getting the print output after saving the code. And the code window appears again and again. I am posting the screenshot of my code window along with this query.

Hi there,
You can try the following steps to rectify the issue:

  1. Try restarting the code window.
  2. Recheck your code.
  3. If the above steps do not work, try contacting boltiot support - Also attach this code window along with the mail for reference.

Hope you find this helpful.

Thank You

After saving your code.
this is the following command to run the file:

sudo python3
#following command runs your python file

You might have mistakenly typed the below command:

sudo nano
#following command opens the file to edit its content

1 Like

Hey @dhanugk21 , you need to import the Bolt class from the bolt library by using the following command:

from boltiot import Bolt

This should be the first line of your code! Without this, the function .isOnline() won’t work.

1 Like

Hello my friend , In your code you need import the bolt python packages. In those packages we have those functions like “Bolt, isOnline”. Without import the bolt package those function will not work .
for import the package you need to write this line of code in the first line or beginning of the program

“from boltiot import Bolt”

Hey Everyone,

I am very grateful for your help!