Install wxpython in Ubuntu

Source: Internet
Author: User

Wxpython is a GUI toolbox in the python programming language. He enables Python programmers to easily create programs with robust and powerful graphical user interfaces. It is used by the Python language to bind the popular wxWidgets cross-platform GUI tool library. WxWidgets is written in C ++. Like the Python language and the wxWidgets GUI tool library, wxpython is an open source software. This means that anyone can use it for free, view and modify its source code, or contribute patches to add features. Wxpython is cross-platform. This means that the same program can run on multiple platforms without modification. Currently, the supported platforms include: 32-bit Microsoft Windows operating system, most Unix or Unix-like systems, and Apple Mac
OS X. Because python is used as a programming language, wxpython is easy to write and understand.

Install wxpython in Ubuntu as follows:

Open the console and enter the command apt-cache search wxpython. If you can return wxpython information, enter the command sudo apt-Get install Python-wxtools to install it.

If you cannot return wxpython information, perform the following steps:

1. Add the software source address to the APT list. Input statement: curl http://apt.wxwidgets.org/key.asc | sudo apt-key add-

2. Add the following lines of text to the/etc/APT/sources. list file. Replace "Dist" with the name suitable for your system in the following table.
# WxWidgets/wxpython repository at apt.wxwidgets.org
Deb http://apt.wxwidgets.org/dist-WX main
Deb-Src http://apt.wxwidgets.org/dist-WX main

Release

Dist name

Ubuntures

Python versions

Latest WX

Ubuntu 6.06

Dapper

I386, amd64

2.4

2.8.8.0

Ubuntu 6.10

Edgy

I386, amd64

2.4, 2.5

2.8.6.1

Ubuntu 7.04

Feisty

I386, amd64

2.4, 2.5

2.8.9.1

Ubuntu 7.10

Gutsy

I386, amd64

2.4, 2.5

2.8.9.2

Ubuntu 8.04

Hard

I386, amd64

2.4, 2.5

2.8.10.1

Ubuntu 8.10

Intrepid

I386, amd64

2.4, 2.5

2.8.10.1

Ubuntu 9.04

Jaunty

I386, amd64

2.5, 2.6

2.8.11.0

Ubuntu 9.10

Karmic

I386, amd64

2.5, 2.6

2.8.11.0

Ubuntu 10.4

Lucid

I386, amd64

2.6

2.8.12.0

Ubuntu 10.10

Maverick

I386, amd64

2.6

2.8.12.0

Ubuntu 11.4

Natty

I386, amd64

2.6, 2.7

2.8.12.0

Debian 4.0

Etch

I386, amd64

2.4

2.8.12.0

Debian 5.0

Lenny

I386, amd64

2.4, 2.5

2.8.12.0

Debian 6.0

Squeeze

I386, amd64

2.5, 2.6

2.8.12.0

3. Enter the following commands on the console in sequence to complete the installation.
Sudo apt-Get update
Sudo apt-Get install python-wxgtk2.8 Python-wxtools wx2.8-i18n
Sudo apt-Get install python-wxgtk2.8 Python-wxtools wx2.8-i18n libwxgtk2.8-dev libgtk2.0-Dev

Of course. In this way, writing GUI programs in the idle environment is not my dish. I am still used to writing in the IDE environment. Eclipse + wxpython is a good choice. Wxpython has just been successfully installed on Ubuntu. I have introduced how to install the pydev plug-in eclipse in Ubuntu. If you have not installed the pydev plug-in eclipse, first install the pydev plug-in according to the previous procedures. Start eclipse and perform the following steps.

Restart eclipse to write the GUI program. A simple GUI program is as follows:

# _ * _ Coding: UTF-8 _ * _ ''' Creator: Shan creation date: ''' import wxapp = wx. APP () win = wx. frame (none, Title = "simple Editor", size = (410,335) loadbtn = wx. button (Win, label = "open", Pos = (, 5), size = (80, 25) savebtn = wx. button (Win, label = "save", Pos = (), size = (80, 25) filename = wx. textctrl (Win, Pos = (5, 5), size = (210,25) contents = wx. textctrl (Win, Pos = (5, 35), size = (390,260), style = wx. te_multiline | wx. hscroll) win. show () app. mainloop ()

The running result is as follows:

Reprinted please indicate the source: http://blog.csdn.net/iAm333

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.