Return to site

Download Wing Ide For Python

broken image


  1. Download Wing Ide For Python
  2. Download Wing Ide For Python Commands

Using Wing with Raspberry Pi

For most Unix systems, you must download and compile the source code. The same source code archive can also be used to build the Windows and Mac versions, and is the starting point for ports to all other platforms. Download the latest Python 3 and Python 2 source. Wing IDE 101 is a simple and free Python IDE intended to help new programmers get used to coding in Python. There are a number of resources to help with training, and Wing IDE 101 is available for. Wing IDE 101 is an integrated development environment designed for the Python programming language. Download Wing IDE 101 free on your PC and try its tools If you're looking for Wing IDE for Windows, You have come to the right place.

Index of All Documentation » How-Tos » How-Tos for Educational Tools »


'Within a couple of minutes I could fence in and eliminate an errorwith the handling of a GPRS modem attached to the Raspberry Pi thatbefore I was trying to hunt down for hours.'-- Robert Rottermann, redCOR AG

Wing is a Python IDE that can be used to develop, test, anddebug Python code running on the Raspberry Pi.

Two versions of Wing are appropriate for use with this document: Wing Pro is thefull-featured Python IDE for professional developers, and Wing Personal is a freealternative with reduced feature set.

If you do not already have Wing installed, download it now.

This document describes how to configure Wing for Raspberry Pi. To get started using Wingas your Python IDE, please refer to the tutorial in Wing's Help menu or read theQuickstart Guide.

Introduction

Wing does not run on the Raspberry Pi, but you can set up Wing on a computer connected tothe Raspberry Pi to work on and debug Python code remotely.

Download wing ide for python commands

If you have Wing Pro, then you can set up development on the Raspberry Pi very quicklyas described in the following section.

If you have Wing Personal, you will need to set up remote file sharing and debuggingmanually, as described in Manual Configuration for Wing Personal below.

In either case you will first need a TCP/IP network connection between the machine whereWing is running and the Raspberry Pi. The easiest way to connect the Raspberry Pi toyour network is with ethernet, or see the instructions at the end of this document forconfiguring a wifi connection.

Remote Development with Wing Pro

To use Wing Pro's remote development capabilities with the Raspberry Pi, takethe following steps:

  • If you do not already have Wing installed, download it now on Windows, Linux, or OS X.
  • Make sure you can connect to the Raspberry Pi from the machine where WingIDE will be running, using ssh (or PuTTY onWindows) without entering a password. You need to set up the SSH keyson each machine, and load them into your SSH user agent via ssh-add (orin Pageant on Windows). See SSH Setup Detailsfor step-by-step instructions.
  • Start up Wing and use NewProject from the Project menu to createa project. Select project type RaspberryPi. Fill in the fields asfollows:

    • Identifier -- Set this to rasp or some other string to identifythe Raspberry Pi
    • Host Name -- Set this to the string you use to SSH into the RaspberryPi. In most cases you'll need both a username and IP address, such aspi@192.168.0.2.

    Note that you can edit your configuration later, or add remote hosts to anyproject, from the RemoteHosts item in the Project menu.

  • Next click OK to create that remote host. Wing will attempt to installthe remote agent and then establish a connection. If this fails, details ofthe SSH command's output will be given in the resulting dialog.
  • Once you have the remote agent working, go into ProjectPropertiesand set PythonExecutable to Remote and choose the remote hostdefinition you just created above. Then click OK to save theproject configuration. If you have not already done so, save the projectto disk using a name ending in .wpr, for example raspremote.wpr.
  • Next right click on the Project tool in Wing and select AddExistingDirectory. In the resultin dialog, press Browse to choice directorieson the Raspberry Pi.

Once this is done, you can open files from the Project tool, with OpenFromProject and in other ways, and work with them as if they were onyour local machine. That includes debugging, running unit tests, issuingrevision control commands, searching, running a Python Shell or OS Commandsremotely, and using other features like goto-definition, find uses, andrefactoring.

Manual Configuration for Wing Personal

This section describes how to set up remote debugging on a Raspberry Pi manually,for Wing Personal. These instructions also work with Wing Pro but itis much easier to use Wing Pro's remote development features (see instructionsabove).

To do this, you will first need (1) a network connection between the Raspberry Pi and thecomputer where Wing will be running, and (2) a way to share files from the machinerunning Wing and the Raspberry Pi. For file sharing, use Samba, or simply transfera copy of your files to the Raspberry Pi using scp or rsync.

Download

If you have Wing Pro, then you can set up development on the Raspberry Pi very quicklyas described in the following section.

If you have Wing Personal, you will need to set up remote file sharing and debuggingmanually, as described in Manual Configuration for Wing Personal below.

In either case you will first need a TCP/IP network connection between the machine whereWing is running and the Raspberry Pi. The easiest way to connect the Raspberry Pi toyour network is with ethernet, or see the instructions at the end of this document forconfiguring a wifi connection.

Remote Development with Wing Pro

To use Wing Pro's remote development capabilities with the Raspberry Pi, takethe following steps:

  • If you do not already have Wing installed, download it now on Windows, Linux, or OS X.
  • Make sure you can connect to the Raspberry Pi from the machine where WingIDE will be running, using ssh (or PuTTY onWindows) without entering a password. You need to set up the SSH keyson each machine, and load them into your SSH user agent via ssh-add (orin Pageant on Windows). See SSH Setup Detailsfor step-by-step instructions.
  • Start up Wing and use NewProject from the Project menu to createa project. Select project type RaspberryPi. Fill in the fields asfollows:

    • Identifier -- Set this to rasp or some other string to identifythe Raspberry Pi
    • Host Name -- Set this to the string you use to SSH into the RaspberryPi. In most cases you'll need both a username and IP address, such aspi@192.168.0.2.

    Note that you can edit your configuration later, or add remote hosts to anyproject, from the RemoteHosts item in the Project menu.

  • Next click OK to create that remote host. Wing will attempt to installthe remote agent and then establish a connection. If this fails, details ofthe SSH command's output will be given in the resulting dialog.
  • Once you have the remote agent working, go into ProjectPropertiesand set PythonExecutable to Remote and choose the remote hostdefinition you just created above. Then click OK to save theproject configuration. If you have not already done so, save the projectto disk using a name ending in .wpr, for example raspremote.wpr.
  • Next right click on the Project tool in Wing and select AddExistingDirectory. In the resultin dialog, press Browse to choice directorieson the Raspberry Pi.

Once this is done, you can open files from the Project tool, with OpenFromProject and in other ways, and work with them as if they were onyour local machine. That includes debugging, running unit tests, issuingrevision control commands, searching, running a Python Shell or OS Commandsremotely, and using other features like goto-definition, find uses, andrefactoring.

Manual Configuration for Wing Personal

This section describes how to set up remote debugging on a Raspberry Pi manually,for Wing Personal. These instructions also work with Wing Pro but itis much easier to use Wing Pro's remote development features (see instructionsabove).

To do this, you will first need (1) a network connection between the Raspberry Pi and thecomputer where Wing will be running, and (2) a way to share files from the machinerunning Wing and the Raspberry Pi. For file sharing, use Samba, or simply transfera copy of your files to the Raspberry Pi using scp or rsync.

Installing and Configuring the Debugger

Once you have a network connection and some sort of file sharing set up, thenext step is to install and configure Wing's debugger. This is doneas follows:

  • If you do not already have Wing installed, download it now on Windows, Linux, or OS X.
  • Download the Raspberry Pi debugger packageto your Raspberry Pi and unpack it withtarxjfwing-debugger-linux-arm32-7.2.6.0.tar.bz2. This creates adirectory named wing-debugger-linux-arm32-7.2.6.0.
  • Launch Wing and make sure that AcceptDebugConnections is checkedwhen you click on the bug icon in the lower left of Wing's main window.Hovering the mouse over the bug icon will show additional status information,including the port Wing is listening on, which should be 50005 by default.
  • On the Raspberry Pi, use /sbin/ifconfig to determine the IP addressof the Raspberry Pi (not 127.0.0.1, but instead the number listed undereth0 or wlan0 if you're using wifi).
  • On the host where Wing is running (not the Raspberry Pi), establish anssh reverse tunnel to the Raspberry Pi so the debugger can connect back to the IDE.On Linux and OS X this is done as follows: Graphicriver eyes photoshop action 19363896 download free.

    You'll need to replace @ with the login name on the RaspberryPi and the ip address from the previous step.

    The -f option can be added just after ssh to cause ssh to run in thebackground. Without this option, you can use Ctrl-C to terminate the tunnel.With it, you'll need to use ps and kill to manage the process.

    On Windows, use PuTTY to configure an ssh tunnel usingthe same settings on the Connections>SSH>Tunnelspage: Set Sourceportto 50005, Destination to localhost:50005, and select the Remoteradio button, then press the Add button. Once this is done the tunnel willbe established whenever PuTTY is connected to the Raspberry Pi.

  • Next create a project in Wing from the Project menu using the EmptyPythonProject project type, and add all your source directories to the project. Thisallows Wing to automatically discover a mapping between where files are locatedon the Raspberry Pi and the local host. See File Location Maps for details.

Invoking the Debugger

There are two ways to invoke the debugger: (1) from the command line, or (2) fromwithin your Python code. The latter is useful if debugging code running under aweb server or other environment not launched from the command line.

Debugging from the Command Line

To invoke the debugger without modifying any code, use the following command:

This is the same thing as pythonyourfile.pyarg1arg2 but runs your code in Wing'sdebugger so you can stop at breakpoints and exceptions in the IDE, step through your code,and interact using the DebugConsole in the Tools menu.

By default this runs with python and connects the debugger to localhost:50005,which matches the above configuration. To change which Python is run, set theenvironment variable WINGDB_PYTHON:

Use the Tutorial in Wing's Help menu to learn moreabout the features available in Wing.

Starting Debug from Python Code

To start debug from within Python code that is already running, editwing-debugger-linux-arm32-7.2.6.0/wingdbstub.py and change the lineWINGHOME=None to WINGHOME=/home/pi/wing-debugger-linux-arm32-7.2.6.0where /home/pi should be replaced with the full path where you unpacked thedebugger package earlier. Use pwd to obtain the full path if you don't know what it is.

Copy your edited wingdbstub.py into the same directory as your code and add importwingdbstub to your code. This new line is what initiates debugging and connects back tothe IDE through the ssh tunnel.

An alternative to editing wingdbstub.py is to set WINGHOME in the environmentinstead with a command like exportWINGHOME=/home/pi/wing-debugger-linux-arm32-7.2.6.0.

Download Wing Ide For Python

Access Control

The first time you initiate debug from a Raspberry Pi, Wing will reject the debugconnection and prompt you to accept a new security token. After accepting the token,future debug connections should be accepted.

To preauthorize the debug connection, copy wingdebugpw from Settings Directory on the machine where you have Wing installed to thedirectory wing-debugger-linux-arm32-7.2.6 on the Raspberry Pi.

Configuration Details

If for some reason you can't use port 50005 as the debug port on either machine,this can be changed on the Raspberry Pi with kHostPort in wingdbstub.py orwith the WINGDB_HOSTPORT environment variable. To change the port the IDE islistening on, use the Debugger>Listening>ServerPort preference and orDebugServerPort in Project Properties in Wing.

If this is done, you will need to replace the port numbers in the ssh tunnel invocationin the following form:

The first port number is the port specified in kHostPort or with WINGDB_HOSTPORTenvironment variable, and the second one is the port set in Wing's preferences orProject Properties.

On Windows using PuTTY, the Sourceport is the port set with kHostPort orWINGDB_HOSTPORT on the Raspberry Pi, and the port in the Destination isthe port Wing is configured to listen on.

Refer to the documentation for ssh or PuTTY for details.

Trouble-Shooting

There are several ways in which a debug configuration can fail and when a connectioncannot be established to the IDE code will run without debug. Additional diagnosticoutput is needed to find the cause of most problems. This is done by setting anextra environment variable before initiating debug on the Raspberry Pi:

Hovering the mouse over the bug icon in the lower left of Wing's window will show ifa debug connection is active. Wing also adds icons to the toolbar while debugging.

If Wing is not receiving a connection, check the reverse ssh tunnel, and make sure thatWing is listening for debug connections.

If Wing is receiving a connection but breakpoints are not reached or source code is notshown when reaching an exception, check that all your source files have been added to yourproject, or if you manually configured a file mapping then check your location mappreference. A good way to test this is to add a deliberate unhandled exception to yourcode (such as assert0) to see if Wing's debugger stops but fails to show the sourcecode. This can be used to correct any manually configured location map.

Setting up Wifi on a Raspberry Pi

It is possible to easily and cheaply connect a Raspberry Pi 2 to a wifi network.Here are instructions for doing this using an Edimax EW-7811Un wifi USB card(although other cards may also work) for a passphrase-protected wifi network:

  • Plug in the USB wifi card and reboot your Raspberry Pi
  • Edit /etc/network/interfaces and comment out the interface for wlan1.Nothing works if this is not done.
  • Edit /etc/wpa_supplicant/wpa_supplicant.conf and add the following to the end:

    Replace your wifi network name and with yourwifi passphrase. Be sure to use exactly the above with no changes in spacing and withthe quotes for the ssid and passphrase but not for other things. Otherwise nothingworks and you won't get any usable error messages.

  • Restart your Raspberry Pi again and wifi should work.

Related Documents

Download Wing Ide For Python Commands

For more information see:

  • Raspberry Pi home page for documentation and downloads.
  • Quickstart Guide contains additional basic informationabout getting started with Wing.
  • Tutorial provides a gentler introduction to Wing's features.
  • Wing Reference Manual documents Wing in detail.





broken image