Author Topic: Can I Run A Python Script As An Opie Application?  (Read 8863 times)

reklov

  • Newbie
  • *
  • Posts: 7
    • View Profile
Can I Run A Python Script As An Opie Application?
« on: January 09, 2006, 09:55:47 am »
Is it possible to run a Python-PyQt script as an Opie application?

So far my script runs from the console. But while it is running I can't launch another programm without killing it.

Can someone help me with some URLs to special guides to get me going?

Zaurus 5500G, OpenZaurus 3.5.3, Opie 1.2.0

Thanks
Volker

DrWowe

  • Hero Member
  • *****
  • Posts: 696
    • View Profile
    • http://
Can I Run A Python Script As An Opie Application?
« Reply #1 on: January 09, 2006, 11:46:37 am »
Did you try running it from the launcher?

Just go to the /home/QtPalmtop/apps/Applications/ directory and create a launch icon.  You can use the other files in that directory as a template.

reklov

  • Newbie
  • *
  • Posts: 7
    • View Profile
Can I Run A Python Script As An Opie Application?
« Reply #2 on: January 10, 2006, 06:56:45 am »
Quote
Did you try running it from the launcher?

Just go to the /home/QtPalmtop/apps/Applications/ directory and create a launch icon.  You can use the other files in that directory as a template.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=110149\"][{POST_SNAPBACK}][/a][/div]

Well, I did, and I don't get any icon displayed, even after system restart.

The directory proper in my settings is /media/card/opt/QPalmtop/apps/Games.

My bht.desktop:

[Desktop Entry]
Name=Bht
Icon=gaim
Exec=bht
Comment=Program to record Bridge Home Tournaments
Comment[de]=Programm zur Protokollierung von Bridge-Heimturnieren
Type=Application
Type[de]=Anwendung

As a picture I borrowed some other already there (.../QPalmtop/pics/gaim.png) for the time being, only to test.
In .../QPalmtop/bin/ I put the symlink "bht" to my script "bht.py", which is executable.

What is wrong or missing?
Volker
« Last Edit: January 10, 2006, 06:58:52 am by reklov »

nilch

  • Hero Member
  • *****
  • Posts: 668
    • View Profile
    • http://
Can I Run A Python Script As An Opie Application?
« Reply #3 on: January 10, 2006, 02:52:20 pm »
I don't know exactly for Opie - but the stepe are more or less the same as on a Sharp ROM.

A few steps necessary

1) copy the .py file to /home/QtPalmtop/bin and make it executable
      (you did a symlink - probably that might work as well)

2) make a .desktop file under /home/QtPalmtop/apps/<whichever tab you want>

as

[Desktop Entry]
Exec = file.py
Categories=
MimeType = application/python
Icon = <graphics file under /home/qtpalmtop/pics>
Name = <whatever app>
Type = Application
Display

3) edit the /home/QtPalmtop/etc/mime.types  file and add a mime type for python
(this may not be necessary if you set the mimetypes in the .desktop file).

4) Restart Qtopia

That should put your application icon on the desktop.
Remember - for desktop apps - all scripts have to be in /home/QtPalmtop/bin

Hope this works...
New no more-C1000 / 5000D (sold my 6000 and 750) | Cacko ROM 1.23 on C1000 | 256 MB CF | 2GB PNY SD card | Socket Networker WiFi CF Card | USB Host cable from StreamlineCPUS | Mini Microphone (for voice recording) |

reklov

  • Newbie
  • *
  • Posts: 7
    • View Profile
Can I Run A Python Script As An Opie Application?
« Reply #4 on: January 11, 2006, 01:41:18 am »
Quote
I don't know exactly for Opie - but the stepe are more or less the same as on a Sharp ROM.

A few steps necessary

1) copy the .py file to /home/QtPalmtop/bin and make it executable
      (you did a symlink - probably that might work as well)

2) make a .desktop file under /home/QtPalmtop/apps/<whichever tab you want>

as

[Desktop Entry]
Exec = file.py
Categories=
MimeType = application/python
Icon = <graphics file under /home/qtpalmtop/pics>
Name = <whatever app>
Type = Application
Display

3) edit the /home/QtPalmtop/etc/mime.types  file and add a mime type for python
(this may not be necessary if you set the mimetypes in the .desktop file).

4) Restart Qtopia

That should put your application icon on the desktop.
Remember - for desktop apps - all scripts have to be in /home/QtPalmtop/bin

Hope this works...
[div align=\"right\"][a href=\"index.php?act=findpost&pid=110320\"][{POST_SNAPBACK}][/a][/div]

Thank you for clarification. But I can see no difference to my settings but for the different /home/ in my Hentges-ROM.

Well, I tried the MimeType line. Still no icon displayed. And for the symlink: there are a lot of other symlinks in my .../QPalmtop/bin/ - and they work.

Volker

reklov

  • Newbie
  • *
  • Posts: 7
    • View Profile
Can I Run A Python Script As An Opie Application?
« Reply #5 on: January 11, 2006, 09:32:26 am »
It works.

Thank you for your help.

Volker