Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    How to run Python (.py) files

    Reply
    antoarts | # 1 | 2010-01-10, 18:55 | Report

    I've got the software development environment setup with scratchbox and all, but I wonder, how can I run Python (.py) files inside the n900 emulator(?)?

    I've tried using PyGTKEditor and clicked the run button, but all I see is a notification saying "launching [file name]", which then disappears and nothing happens after that.

    Have also tried to click the .py file in the file manager, but it asks what program to use and none of the suggestions seem right.

    I'm not having X Terminal (or any other terminal for that matter) in the SDK environment and can't start the .py file from that.

    I believe I might be missing some package to run Python files...? Anyway, help would be greatly appreciated!

    Edit | Forward | Quote | Quick Reply | Thanks

     
    nux | # 2 | 2010-01-10, 19:05 | Report

    write in terminal "python your_file.py"

    and you can get xterminal in sdk too, I have it.

    open terminal in linux,
    1. run "/scratchbox/login"
    2. now inside scratchbox run "fakeroot apt-get install osso-xterm"
    3. now run "logout" and then run your sdk again and you should have xterm

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by nux; 2010-01-10 at 19:17.
    The Following User Says Thank You to nux For This Useful Post:
    antoarts

     
    EIPI | # 3 | 2010-01-27, 03:37 | Report

    I am embarking on a widget development, but I am not well versed in the SDK, and C or Python. I therefore humbly ask for some assistance in getting beyond a "hello world" app using pymaemo.

    I have installed the Maemo 5 SDK, and have run the hello world app from the pymaemo quick start guide. That worked.

    I then downloaded the python code for "touchsearch", and entered the following within scratchbox:

    Code:
    python2.5 touchsearch.py
    This gave back the following error:

    Code:
    Traceback (most recent call last):
      File "touchsearch.py", line 21, in <module>
        import hildondesktop
    ImportError: No module named hildondesktop
    Any suggestions on what I could do to get the touchsearch app running within the SDK? Many thanks.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    mikkov | # 4 | 2010-01-27, 04:09 | Report

    install with apt-get install touchsearch

    Then start desktop environment as instructed in SDK install document

    Add widget to desktop as you would do with device. Desktop widgets are plugins to hildon-home and they cannot be run "standalone"

    Edit | Forward | Quote | Quick Reply | Thanks

     
    twaelti | # 5 | 2010-01-27, 08:47 | Report

    You could also get the source of one of my simple widgets, such as sleeper or recaller. The first line in their sourcecode describes how to launch them manually. Sleepr is only a hundred lines or so.
    TouchSearch might be a too large bite to begin with :-) Brent has added so many cool things (that I now greatly profit from when trying to extend my widgets :-)

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to twaelti For This Useful Post:
    EIPI

     
    mece | # 6 | 2010-01-27, 09:07 | Report

    I don't have the sdk here now but I think
    apt-get install python-hildondesktop python-hildon
    should help.

    And you can run it standalone just fine since it has the main at the bottom.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to mece For This Useful Post:
    EIPI

     
    EIPI | # 7 | 2010-01-27, 12:45 | Report

    Thank you for the responses.

    @mece - I was missing those two packages. Thanks.

    @twaelti - Yes, touchsearch is a little more complicated than I need (for now). I will also look at those two widgets you developed. Thank you

    I ran touchsearch.py standalone, and was able to 'add widget' from the desktop of the SDK. However, it did not actually show up on the desktop. I think the icon is missing, since I was still able to access the preferences of touchsearch via the 'spanner'.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by EIPI; 2010-01-27 at 12:48.

     
    mece | # 8 | 2010-01-28, 07:39 | Report

    Originally Posted by EIPI View Post
    Thank you for the responses.

    @mece - I was missing those two packages. Thanks.

    @twaelti - Yes, touchsearch is a little more complicated than I need (for now). I will also look at those two widgets you developed. Thank you

    I ran touchsearch.py standalone, and was able to 'add widget' from the desktop of the SDK. However, it did not actually show up on the desktop. I think the icon is missing, since I was still able to access the preferences of touchsearch via the 'spanner'.
    When you install it properly from a deb file, it will copy the image files to their correct locations. since you simply ran the code, no image files were copied. Hence, no images.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to mece For This Useful Post:
    EIPI

     
vBulletin® Version 3.8.8
Normal Logout