# DroneBlocks Python with Tello Webinar - June 28, 2022

**URL:** <https://community.droneblocks.io/t/droneblocks-python-with-tello-webinar-june-28-2022/451>\
**Category:** DroneBlocks News\
**Created:** [July 5, 2022, 1:51am UTC](https://community.droneblocks.io/t/droneblocks-python-with-tello-webinar-june-28-2022/451 "2022-07-05T01:51:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbaldwin](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dbaldwin](https://community.droneblocks.io/u/dbaldwin)\
**Post date:** [July 5, 2022, 1:51am UTC](https://community.droneblocks.io/t/droneblocks-python-with-tello-webinar-june-28-2022/451/1 "2022-07-05T01:51:16Z")

</div>

Here is the video from the DroneBlocks webinar hosted by Clinton Evans:

[![](https://canada1.discourse-cdn.com/flex036/uploads/droneblocks/original/1X/ca9bc3604716f56cdbd83b0e80cbfafe7c61b657.jpeg "DroneBlocks Introduction to Python with Tello Drones - June 28, 2022 Webinar") ](https://www.youtube.com/watch?v=IzGlzU9q7gU)

The code from the webinar can be found below:

```auto
# Import required Libraries 
from droneblocks.DroneBlocksTello import DroneBlocksTello
import time

# Start the Tello instance
tello = DroneBlocksTello()

# Join RMTT Wifi first
# Once you have connected to the Tello Wifi then run tello.connect() 
tello.connect()

# Find out the battery life
tello.get_battery()

# Some Tello movements below, remove the # if you want to use the code
# tello.takeoff()
# tello.fly_forward(100)
# tello.rotate_clockwise(90)
# tello.fly_backward(100)
# tello.rotate_counter_clockwise(90)

# Running this function returns the battery value
def BatReport():
    return tello.get_battery()

# If statement to see if we can fly if battery is above 50%
if BatReport() > 50:
    print("Let's fly!!")
    print(BatReport())

# Create flight check function. Let's do some fancy inline comments
def PreFlightCheck(): # name function
    if tello.get_battery() > 30: # if battery life is higher than 30
        print("Drone's Up! " + str(tello.get_battery()) + "% Battery Left") # print message + battery life %
    else: # else do the following
        print("Not enough power captain") # print message saying not enough power

# Create mission to fly in a square
def SquareMission():
    tello.takeoff()
    for i in range(4):
        time.sleep(3)
        tello.move_forward(100)
        time.sleep(3)
        tello.rotate_clockwise(90)
    tello.land()

# Create function that asks if it is safe to fly
def SafeToFly():
    ans = input("Is it safe to fly? ").lower() # this makes the typed answer lower case and easier to compare 
    if ans == "yes": # if yes == yes then print success message and take off
        print("Awesome! Drones Up!")
        tello.takeoff()
    else: 
        print("Well maybe next time")
    tello.land()

```

Here you can find the [DroneBlocksPythonUtils](https://pypi.org/project/droneblocks-python-utils/) pip package that will enable you to run the code above and do a lot of cool stuff covered in many of [these courses](https://learn.droneblocks.io/courses/author/764019).

If you’d like to give the DroneBlocks Python Simulator a try, [please go here](https://pypi.org/project/DroneBlocksTelloSimulator/) and read through the instructions. If you have any problems don’t hesitate to post a question and we’ll be happy to respond.

Lastly, you can learn about OpenCV with Tello from Pat Ryan by checking out [this course](https://learn.droneblocks.io/p/advanced-tello-programming-with-python-part-1).

---

<div class="post-metadata">

**Author:** ![SethL](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@SethL](https://community.droneblocks.io/u/SethL)\
**Post date:** [July 6, 2022, 11:51pm UTC](https://community.droneblocks.io/t/droneblocks-python-with-tello-webinar-june-28-2022/451/2 "2022-07-06T23:51:16Z")

</div>

In the demo you talked about using VisualStudio. In starting the online curriculum, we load Anaconda and you mention not worrying about VisualStudio. So what is the best path to follow? I would like to follow a path I could show the students how to follow.

---

<div class="post-metadata">

**Author:** ![dbaldwin](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dbaldwin](https://community.droneblocks.io/u/dbaldwin)\
**Post date:** [July 7, 2022, 5:14pm UTC](https://community.droneblocks.io/t/droneblocks-python-with-tello-webinar-june-28-2022/451/3 "2022-07-07T17:14:00Z")

</div>

I’ve personally adopted VS Code over the years. I would recommend taking that path and following Clinton’s advice in the Webinar. There is not right/wrong answer, but as you know technology and best practices evolve over time. If the VS Code dependency becomes a challenge please let us know. Sometimes there are hurdles regarding what software districts will allow. We’re happy to help you walk through it.
