‘Hello, world!’

In this sample, we will create and deploy the proverbial 1st app, “Hello, world!” to any device running Windows 10 IoT Core.

Set up your PC

  • Follow the instructions here to setup your device and PC.

  • Install Python for Windows (3.*) from http://www.python.org/downloads

  • Download and install PTVS (Python Tools for Visual Studio) VS 2015 latest release from here.

  • Download and install the latest Python UWP SDK (pyuwpsdk.vsix) release from here.

Create new Python project

  • Create new project based on Template > Python > Windows 10 IoT Core > Background Application (IoT)

Output Hello World!

Modify StartupTask.py like this

print("Hello, World from IoT!")

Deploy Python app to your Windows 10 IoT Core device

  • Follow the instructions to setup remote debugging and deploy the app.

    NOTE: For now, use device name in lieu of IP address. If the device name is not unique, use setcomputername tool on the device to reset the device name and reboot. Documentation for this can be found here

  • The Python app will deploy and start on the device.

    NOTE: Launching the debugger for Python can take a few minutes to connect and start debugging the remote Python. If it takes more than a few minutes, there may be a problem with msvsmon on the remote device. Please check the FAQ for any potential fixes/workarounds.

  • The ‘Hello, World from IoT!’ message will be displayed in the output window of Visual Studio. Open the output window by Debug > Window > Output.

Use Windows Devices from Python (e.g. GPIO, I2C, SPI)

  • Right-click on the References node in the Python project

  • Click Add Reference…

  • Click on Browse tab

  • Download pywindevices content from here

  • Navigate to ARM for RPi2 or RPi3 or win32 for MBM

  • Select the PYD file for the device type and configuration you want to use (e.g. _wingpio_d.pyd if a Debug configuration and _wingpio.pyd for a Release configuration)

  • Add import _wingpio as gpio to your StartupTask.py

  • Start using gpio functions (similar steps for I2C or SPI)

  • WinDevices documentation can be found here

Questions/Suggestions

Please refer to the FAQ for issues.

No sample code available

Language: Python

Tags: c#, python, node.js, beginner, foreground

Verified to work with:
Windows 10 IoT Core: Version 10.0.15063.0
Visual Studio 2017
Windows SDK: Version 15063
(Included with Visual Studio)


Edit this page on GitHub


Was this page helpful?
Additional feedback?
Thank you! We appreciate your feedback.
Follow us