Jump to content

Python Visual Interface

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
Midnight

Midnight

    Newbie

  • Members
  • Pip
  • 4 posts
Hey there!
I'm Midnight, aka Riccardo, I'm n00b, new and italian, so don't expect much from me. I've 14 years and I've started "programming" with Python about two weeks ago, and I need help.
I followed some simple tutorial, and I realized come very simple programs too, like a Password Requester and a Contact Rubric.
Now, I'm using IDLE as IDE, and all my programs are just text. Now I'm tryin' to make them look better with Qt Designer and, well, I can design the form, and obtein the relative XML file. But how do I do to convert that XML file into python code? Thank you in advance.

#2
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
Well, I don't have any experience with Qt, but I'm pretty sure you don't need to convert the XML file you've got into Python code. You'll have to use some of Qt's functionality to load the XML file, and receive the design of the program. I don't know how to do this, as I've no experience with Qt, but you could check the documentation. And of course, you shall make sure you've installed Qt's libraries for Python.

Edit:
If you just want simple graphical user interfaces, you should check out Tkinter. It ships with Python, so you won't have to install third-party libraries. You can find lots of tutorial on it, and Python has a big official documentation for it. I think you should check it, and see if it fits your requirements.

Edited by v0id, 17 April 2008 - 03:38 AM.


#3
Midnight

Midnight

    Newbie

  • Members
  • Pip
  • 4 posts
Well, for Qt probably ur right, but now I need to know what is the function to convert the XML. Maybe this phantomatic pyuic that I don't know what is???

For TKinter, I don't know because of its old fashoned graphic... There is a thing like Qt Designer, but for Tkinter?

#4
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
I found this using a single search on Google:
PyQT Tutorial
I think it's what you need. In the bottom you can see the three example files, and how everything is loaded together.

Good luck!

#5
Midnight

Midnight

    Newbie

  • Members
  • Pip
  • 4 posts
Thanks a lot... But I think I have another problem: when I type import qt in my python shell, I get an error message. Is it normal??

Edited by Midnight, 18 April 2008 - 02:14 AM.


#6
Midnight

Midnight

    Newbie

  • Members
  • Pip
  • 4 posts
Edited

Edited by Midnight, 18 April 2008 - 02:13 AM.


#7
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
Well, I guess you haven't installed PyQt properly.

You can get PyQt from the official website here:
Riverbank : PyQt : Overview

Or, if you're using a Debian-based Linux distribution, do like this:
$ sudo apt-get install python-qt4 python-qt4-dev python-qt4-doc pyqt4-dev-tools