Editing PyMaemo/Quick start guide
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 7: | Line 7: | ||
* Easily run the application (without installing it) | * Easily run the application (without installing it) | ||
- | + | There is also the option of using a full Python IDE for Maemo, called [http://pluthon.garage.maemo.org/ PluThon]. See the project site for details. While PluThon is easy to use and provides a complete solution, it is not necessary for basic Python development for Maemo. If you intend to use PluThon, there is no need to follow the instructions described here, as PluThon takes care of all the necessary steps. | |
This article will cover: | This article will cover: | ||
Line 16: | Line 16: | ||
* How to run the application | * How to run the application | ||
- | Application packaging and final deployment will be | + | Application packaging and final deployment will '''not''' be covered. |
- | + | ||
- | + | ||
== Requirements == | == Requirements == | ||
Line 31: | Line 29: | ||
Host requirements: | Host requirements: | ||
- | * | + | * A SSH client. For Linux, OpenSSH (through the "ssh" command) is enough. For Windows, [http://en.sourceforge.jp/projects/ttssh2/releases/ Tera Term] can be used. |
- | * | + | * A SCP/SFTP client. For Linux, OpenSSH (through the "scp" command) is enough. The KDE/GNOME environments also have built-in support for these protocols. For Windows, you can try [http://winscp.net/eng/index.php WinSCP] or [http://filezilla-project.org/ FileZilla]. |
For the purposes of this tutorial, you will '''not''' need Scratchbox installed. Scratchbox would only be necessary if you are unable to test your applications on the actual tablet. | For the purposes of this tutorial, you will '''not''' need Scratchbox installed. Scratchbox would only be necessary if you are unable to test your applications on the actual tablet. | ||
Line 40: | Line 38: | ||
You will need to install two applications on the tablet: | You will need to install two applications on the tablet: | ||
- | * | + | * OpenSSH Server |
- | * | + | * rootsh |
- | + | ||
- | + | ||
OpenSSH is needed to run commands remotely on your N900. This will make testing on the device a lot easier. | OpenSSH is needed to run commands remotely on your N900. This will make testing on the device a lot easier. | ||
- | + | rootsh allow to run commands as root on the X Terminal (using "sudo gainroot"). See http://wiki.maemo.org/Root_access for other options to enable root access. | |
To install these applications, follow these steps: | To install these applications, follow these steps: | ||
- | # | + | # Enable extras repository. See http://wiki.maemo.org/Extras#Using_Extras for how to do it. |
# Install the packages listed above. | # Install the packages listed above. | ||
# The installation will ask for a new root password for SSH access. Choose a good one. | # The installation will ask for a new root password for SSH access. Choose a good one. | ||
Line 58: | Line 54: | ||
== Enabling USB networking == | == Enabling USB networking == | ||
- | USB networking allows to easily and quickly transfer files to the device and connect to it using SSH. | + | USB networking allows to easily and quickly transfer files to the device and connect to it using SSH. To enable it, follow these steps (you need to repeat them every time you reboot the device): |
- | + | ||
- | + | ||
- | + | ||
- | To enable | + | |
# If the USB cable is plugged and in "Mass storage mode", unplug the cable and plug it again, now selecting "PC Suite Mode". | # If the USB cable is plugged and in "Mass storage mode", unplug the cable and plug it again, now selecting "PC Suite Mode". | ||
# On N900, open "X Terminal" and run: | # On N900, open "X Terminal" and run: | ||
rootsh ifup usb0 | rootsh ifup usb0 | ||
- | # Now you need to configure the host. This is dependent on which OS (or Linux distro) you use, | + | # Now you need to configure the host. This is dependent on which OS (or Linux distro) you use, see http://wiki.maemo.org/USB_networking#Host_USB_Network_Configuration for detailed instructions for various OSes and Linux distros. |
From now on you can connect to the N900 using any SSH client and the following information: | From now on you can connect to the N900 using any SSH client and the following information: | ||
Line 85: | Line 77: | ||
Note that the requirement to enable the "extras-devel" repository might be removed later. | Note that the requirement to enable the "extras-devel" repository might be removed later. | ||
- | To enable extras-devel add a new catalogue to the Application Manager, as instructed in | + | To enable extras-devel add a new catalogue to the Application Manager, as instructed in http://wiki.maemo.org/Extras-devel (did you see the big warning on that page?) |
After extras-devel is enabled, you will see on Application Manager a package called "maemo-python-device-env". Installing it will also install the basic environment necessary to run most Python applications on Maemo. | After extras-devel is enabled, you will see on Application Manager a package called "maemo-python-device-env". Installing it will also install the basic environment necessary to run most Python applications on Maemo. | ||
- | == | + | == Choosing an editor == |
- | + | Unless you use a Maemo specific solution like PluThon, any good programmer oriented editor will be enough for development. | |
Here we list some options, both for Linux and Windows: | Here we list some options, both for Linux and Windows: | ||
- | * [http://projects.gnome.org/gedit/ gedit]: the GNOME Editor has syntax highlight support for Python | + | * [http://projects.gnome.org/gedit/ gedit]: the GNOME Editor has syntax highlight support for Python (Linux only) |
* [http://www.vim.org/ VIM] and [http://www.gnu.org/software/emacs/ Emacs]: the most popular editors, with many advanced features and versions for both Linux and Windows | * [http://www.vim.org/ VIM] and [http://www.gnu.org/software/emacs/ Emacs]: the most popular editors, with many advanced features and versions for both Linux and Windows | ||
* [http://wiki.netbeans.org/Python NetBeans + Python plugin]: NetBeans is a multi-platform IDE, which with help of a plugin, supports development for Python | * [http://wiki.netbeans.org/Python NetBeans + Python plugin]: NetBeans is a multi-platform IDE, which with help of a plugin, supports development for Python | ||
- | |||
- | Note that | + | Note that any of these editors will support code completion for PyMaemo modules out of box. |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
== Running the Python application on the device == | == Running the Python application on the device == | ||
- | Now that you have the N900 properly setup | + | Now that you have the N900 properly setup, you just need to copy the Python code to the device and run it. |
The simplest way to copy files it to use a SFTP or SCP client. There are many free clients available for most OSes (we listed some examples on the "Requirements" section). On the Linux command line, you can use: | The simplest way to copy files it to use a SFTP or SCP client. There are many free clients available for most OSes (we listed some examples on the "Requirements" section). On the Linux command line, you can use: | ||
Line 131: | Line 107: | ||
cd /root/my_application | cd /root/my_application | ||
python my_application.py | python my_application.py | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
[[Category:N900]] | [[Category:N900]] | ||
[[Category:Python]] | [[Category:Python]] |
Learn more about Contributing to the wiki.