Quick Start
Get up and running with Blockly Python Executor in just a few minutes!
Your First Program
Let's create a simple "Hello, World!" program to get familiar with the interface.
Step 1: Open the Application
- Launch Blockly Python Executor
- You'll see the main interface with:
- Toolbox (left side) - Contains all available blocks
- Workspace (center) - Where you build your program
- Code pane (right side) - Shows generated Python code
- Terminal (bottom) - Shows program output
Step 2: Create a Simple Program
- Find the Text category in the toolbox (left side)
- Drag a "print" block to the workspace
- Drag a "text" block and connect it to the print block
- Type "Hello, World!" in the text block
Your workspace should look like this:
Step 3: Run Your Program
- Click "Run Code" button
- Watch the terminal - You should see "Hello, World!" printed
- Check the code pane - You'll see the generated Python code
Understanding the Interface
Main Components
Toolbox
Contains all available blocks organized by category: - Logic - If/else, comparisons, boolean operations - Loops - For loops, while loops, repeat - Math - Numbers, arithmetic, functions - Text - String operations and manipulation - Lists - Array operations - Variables - Create and use variables - Functions - Define custom functions - Timing - Sleep and wait operations - Drone Commands - Flight control blocks
Workspace
The main area where you build your program: - Drag blocks from the toolbox - Connect blocks by dragging them together - Delete blocks by dragging them to the trash - Zoom and pan using mouse wheel and right-click drag
Code Pane
Shows the Python code generated from your blocks: - Real-time updates as you modify blocks - Syntax highlighting for better readability - Line numbers for easy reference - Copy functionality to use code elsewhere
Terminal
Shows the output when you run your program: - Execution results from your Python code - Error messages if something goes wrong - Interactive input for programs that need user input - Resizable - drag the top border to adjust height
Basic Block Operations
Connecting Blocks
- Drag a block from the toolbox
- Position it near another block
- Snap them together - they'll connect automatically
- Disconnect by dragging them apart
Block Types
- Statement blocks - Do something (print, assign, etc.)
- Value blocks - Return a value (numbers, text, etc.)
- Conditional blocks - Control program flow (if, loops)
- Hat blocks - Start of programs (when clicked, etc.)
Your Second Program: Math Operations
Let's create a program that performs calculations:
Step 1: Create Variables
- Go to Variables category
- Click "Create variable" and name it "number1"
- Create another variable named "number2"
Step 2: Set Values
- Drag "set number1 to" block to workspace
- Add a number block (value: 10)
- Drag "set number2 to" block
- Add a number block (value: 5)
Step 3: Perform Calculation
- Drag "print" block
- Add "text join" block to combine text and numbers
- Add "number1 + number2" math block
- Add text "The sum is: "
Your program should look like:
Step 4: Run and See Results
Click "Run Code" to see the calculation result!
Working with Loops
Let's create a program that counts from 1 to 5:
Step 1: Create a Loop
- Go to Loops category
- Drag "repeat 5 times" block
- Add "print" block inside the loop
Step 2: Add Counter
- Create a variable named "counter"
- Set counter to 1 before the loop
- Print counter inside the loop
- Increment counter by 1 inside the loop
Your program should look like:
Drone Control (Optional)
If you have a drone connected, try this simple flight sequence:
Step 1: Connect to Drone
- Click "Connect Server" button
- Wait for "Connected" status
- Check the floating telemetry window for drone data
Step 2: Create Flight Program
- Go to Drone Commands category
- Drag "takeoff" block (set altitude to 2.0)
- Add "hover" block (set duration to 3 seconds)
- Add "land" block
Step 3: Execute Flight
- Click "Run Code"
- Watch the terminal for flight progress
- Monitor telemetry in the floating window
Tips for Success
Best Practices
- Start simple - Begin with basic programs before complex ones
- Test frequently - Run your code often to catch errors early
- Use meaningful names - Name variables and functions clearly
- Comment your code - Add text blocks to explain what you're doing
Common Mistakes
- Forgetting to connect blocks - Make sure blocks are properly connected
- Missing variable declarations - Create variables before using them
- Infinite loops - Be careful with loop conditions
- Type mismatches - Ensure you're using the right data types
Getting Help
- Hover over blocks - See tooltips with explanations
- Check the terminal - Error messages will help you debug
- Use the examples - Look at the provided examples for inspiration
- Read the documentation - Detailed guides are available
Next Steps
Now that you've created your first programs:
- Explore more blocks - Try different categories and combinations
- Read the Block Reference - Learn about all available blocks
- Try the Examples - See more complex programs
- Learn about Drone Control - If you have a drone
- Check out Advanced Features - Learn about code generation
Troubleshooting
Program Won't Run
- Check block connections - Make sure all blocks are properly connected
- Look at the terminal - Error messages will tell you what's wrong
- Verify syntax - Check the generated Python code for errors
Blocks Won't Connect
- Check block types - Some blocks only connect to specific types
- Look at the shapes - Matching shapes indicate compatible connections
- Try different positions - Sometimes blocks need to be positioned just right
Drone Issues
- Check connection - Ensure the drone server is running
- Verify network - Make sure you can reach the drone
- Check battery - Ensure the drone has sufficient power
Ready to dive deeper? Check out the User Guide for detailed instructions on all features!