Active Topics

 


Reply
Thread Tools
Posts: 1 | Thanked: 0 times | Joined on Aug 2010
#1
Hi guys,

I am eager to learn Python (I have no previous development experience).

I have installed:
Python
Python GTK Editor
PyQt4 Full Install
PyQt4 Demo

I am creating a simple, non-linear, text based RPG to teach myself the code structure etc.

What I can't figure out is:
How to create a GUI for the game
Why PyQt4 Full does not have an icon in my menu and why I can't seem to be able to open it from the Terminal either (is it a program that opens? I was under the impression that it is a tool to create python Gui directly on the n900.)

After failing with the above, I attempted to find and install pygame. However, the dependency libsdl-ttf2.0.0 was not met. I attempted to install it and then get the error advising libsdl-ttf2.0.0-0 is not installed. Am I doing something wrong or do I simply have the wrong idea about what I'm doing?

Please note, I do not want to create a python gui on my pc, I want to use my n900 for both the coding and the aesthetic.

After the game, I intend to attempt to code a basic (productive) application for my n900.


Sorry for the essay sized question. Any and all help would be appreciated (I have spent 4 hours trying to find these answers on forums to no avail >.<).

Thanks.

Lady Linx
 
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#2
Originally Posted by l4dyl1nx View Post
Why PyQt4 Full does not have an icon in my menu and why I can't seem to be able to open it from the Terminal either (is it a program that opens? I was under the impression that it is a tool to create python Gui directly on the n900.)
Err... no. PyQt is a language binding, it is "just" a bridge between Python and Qt, is it not a runnable thing per se. As such, it has no special GUI or editor or sorts, if you want to use a more GUI-based approach, use the QtCreator/QtDesigner that comes with "regular" Qt. The resulting .ui files you generate in those can be used in both C++ and Python applications.

Please note, I do not want to create a python gui on my pc, I want to use my n900 for both the coding and the aesthetic.
While this is possible, it is very difficult and tiresome to do (=not recommended), especially as with Python you do not need scratchbox, crosscompilers and such on your desktop, just a regular desktop Qt install.
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 
Posts: 35 | Thanked: 21 times | Joined on Feb 2010 @ Copenhagen, Denmark
#3
Originally Posted by l4dyl1nx View Post
Please note, I do not want to create a python gui on my pc, I want to use my n900 for both the coding and the aesthetic.
Unless you're a masochistic kind of person and really love typing a lot on the small keyboard, I'd recommend using your pc for developing. Here's my setup, for inspiration:

All my files are on the phone. I'm running Ubuntu on my laptop. I start by connecting the pc and n900 to the same wireless network.

Then I start a terminal on the pc and SSH from the laptop into the phone (requires ssh-server on the phone, get it from the repos). I also SFTP from pc to phone to access the files on the phone [1].

Now I'm able to work directly on the phone from my laptop. When running my python scripts in the terminal via SSH, if there's any sort of GUI, it will happen on the phone display, as if it was run from the phone itself.

That way, I always have the files with me on the phone [2]. But when I'm at home (or somewhere else with a computer), I'm able to do the development without having to type on the small phone keyboard.

It's a very simple way to do it, without any complex SDK's and IDE's. I'm just using my favorite text editor.

[1] Theoretically, the pc and the phone doesn't have to be on the same network. If the pc is on the internet and the phone is too, via a 3G connection, it should also be possible to SSH/SFTP to the phone. But the connection may not be as stable/fast as when on a local network.

[2] I keep most of my python files in a subversion repository on a server. The files on my phone are under SVN version control. Besides the fact that version control is a good thing, my files are not completely lost if I loose my phone.
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#4
Using the above method, along with something like VNC, you can actually get something resembling Android development all on the computer . You can actually see the N900 screen on your PC and run the apps/control it just as if it were an "emulator" to test your apps with.

I do similar to the above, I don't use SVN though, I just modify my python files, rebuild a deb package, install it on my N900 and launch it all via SCP/SSH. My "SVN" is just maintaining older versions of the deb files I create. I also just use simple gedit to code the python in, no fancy editors or anything. (I did build my UI with QT Designer though.)

I then do minor adjustments on my phone while I am away from my Desktop and when I get home just copy the files to my desktop overwriting the old stuff, and rebuild the deb file.

It's really very simple.. no harder than using any FTP-like system.
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 
Reply

Tags
develop, pygame, pyqt4, python


 
Forum Jump


All times are GMT. The time now is 04:33.