You Are Here:

Community: Developer Discussion Boards

#1 Old Question How to run a script? - 2007-02-01, 14:27

Join Date: Feb 2007
Posts: 5
hlaukkan
Offline
Registered User
This may be a stupid beginner's question, but I guess others will need the answer later as well. I just successfully installed PythonForS60_1_3_17_3rdEd_selfsigned.SIS to an E61, downloaded a simple .py file to the phone to test it, but when I open the .py file, it opens as a text file. The script doesn't execute, and there's no "run a script" kind of an option visible anywhere.

How to launch the script, and how to start the Python interpreter if it is not yet running? I cannot find the snake icon anywhere although the Application Manager says that the "Python for S60" has been installed.

The "simply run it" statement seems in practice not so simple in the instructions you can find here: http://www.mobilenin.com/pys60/intro.htm
Reply With Quote

#2 Old Re: How to run a script? - 2007-02-01, 14:49

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
Hi hlaukkan,

First of all a farm welcome to you on the Forum

So, few thing you have to know. Your device is a 3rd edition phone and there are still few issues on the PyS60 beta release.

With 2nd edition devices you just need to push a script on your phone, via Bluetooth for example, then an automatic installer will ask you if you want to install the pushed script as a library or a normal script (different locations on the phone).

If you read some previous threads you will often see stuff about signing and capabilites, few notions introduced on 3rd edition platform that contribute to a compatibility breakdown with 1st and 2nd edition softwares (C++ level).

As a Python user you don't see any differences because the PyS60 team is working hard at making Python code fully portable from different plateforms (i.e you have same functions and methods). There are issues with the automatic installer on 3rd edition, so you can't just push a script to your phone.

There are few methods to achieve the same operation, like zipping scripts, making installation packages... But there is a more simple solution. If you have a Bluetooth dongle, make a file OBEX transfert or FTP connection or whatever to be able to browse your phone memory. On your E: drive (memory card) create a folder named "python". Go to this folder and just upload your scripts in it.

After all you need to do is run Python, then Options > Run script

Your script(s) should appear in the list.

Happy Pythoning to you

LFD


Devices:
Nokia E61 3rd Edition - pys60 1.4.0

Tips and modules:
http://www.lfdm.net/thesis
Reply With Quote

#3 Old Re: How to run a script? - 2007-02-01, 15:16

Join Date: Feb 2007
Posts: 5
hlaukkan
Offline
Registered User
Quote:
Originally Posted by lfd
Hi hlaukkan,

First of all a farm welcome to you on the Forum
Thanks, and thank you also for the advice for creating the python directory, although I tried that already without success.

Quote:
Originally Posted by lfd
After all you need to do is run Python, then Options > Run script
OK otherwise, but how do I RUN Python? I cannot find its icon anywhere although it is installed. I suppose it's not running somehow automatically in the background after reboot.
Reply With Quote

#4 Old Re: How to run a script? - 2007-02-01, 15:31

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
I think I know,

You need to install _both_ PythonForS60_1_3_17_SDK_3rdEd_selfsigned.zip and PythonScriptShell_1_3_17_3rdEd_selfsigned.SIS

You'll then find the Python icon with your other applications.

LFD


Devices:
Nokia E61 3rd Edition - pys60 1.4.0

Tips and modules:
http://www.lfdm.net/thesis
Reply With Quote

#5 Old Re: How to run a script? - 2007-02-01, 16:15

Join Date: Feb 2007
Posts: 5
hlaukkan
Offline
Registered User
Quote:
Originally Posted by lfd
I think I know,

You need to install _both_ PythonForS60_1_3_17_SDK_3rdEd_selfsigned.zip and PythonScriptShell_1_3_17_3rdEd_selfsigned.SIS

You'll then find the Python icon with your other applications.

LFD
Thanks. The plot thickens. One more stupid question: What is the epoc32 directory on an E61 where I should unzip the SDK?
Reply With Quote

#6 Old Re: How to run a script? - 2007-02-01, 17:32

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
Ok! So almost ready with a fresh environment

First of all, download and install the 3rd edition sdk Maintenance Release at http://forum.nokia.com/info/sw.nokia...16-3.0-mr.html

Download and unzip the PyS60 SDK files PythonForS60_1_3_17_SDK_3rdEd_selfsigned.zip

If you kept the default installation parameters you will have the 3rd edition epoc directory in C:\Symbian\9.1\S60_3rd_MR\Epoc32. The unzipped sdk files have the same folder structure than the SDK epoc folder. So you just have to copy the files in SDK the folder.

Then start the emulator and the Snake should appear

LFD


Devices:
Nokia E61 3rd Edition - pys60 1.4.0

Tips and modules:
http://www.lfdm.net/thesis
Reply With Quote

#7 Old Re: How to run a script? - 2007-02-01, 17:51

Join Date: May 2004
Posts: 524
Location: Tampere, Finland
jethro.fn's Avatar
jethro.fn
Offline
Forum Nokia Champion
Quote:
Originally Posted by hlaukkan
What is the epoc32 directory on an E61 where I should unzip the SDK?
Whoops. The SDK is installed on a PC, if you wish to do software development in C++. It will be of no use on the phone...

The Python icon you are missing is actually an icon of the Python script shell: PythonScriptShell_1_3_17_3rdEd_selfsigned.SIS. The Python runtime used to have an icon back in the day, but does not anymore. Some outdated instructions can be a little difficult to follow because of that...

So, in plain English:
  • Install "PythonForS60_1_3_17_3rdEd_selfsigned.SIS"
  • Install "PythonScriptShell_1_3_17_3rdEd_selfsigned.SIS"
  • Create a directory called "Python" in memory card root ("E:\Python")
  • Use Bluetooth OBEX file transfer to copy any "*.py" files to "E:\Python"
  • Start Python Script shell from its icon (the icon is called "Python")
  • Select "Run Script" from "Options" menu
  • Choose an application to run

Hope this helps. The question about missing Python icon occurs regularly on this list. Somehow people miss the release announcement, where this detail is mentioned.
Reply With Quote

#8 Old Re: How to run a script? - 2007-02-01, 19:09

Join Date: Feb 2007
Posts: 5
hlaukkan
Offline
Registered User
Quote:
Originally Posted by jethro.fn
Hope this helps. The question about missing Python icon occurs regularly on this list. Somehow people miss the release announcement, where this detail is mentioned.
YES! That's it. Now it works. Thanks a lot!

Perhaps the only thing still missing from your very good instructions is that as the very first step in phone's Application Manager you need to set Options/Settings/Software installation to "All"
Reply With Quote

#9 Old Re: How to run a script? - 2007-02-01, 19:20

Join Date: May 2004
Posts: 524
Location: Tampere, Finland
jethro.fn's Avatar
jethro.fn
Offline
Forum Nokia Champion
Quote:
Originally Posted by hlaukkan
Perhaps the only thing still missing from your very good instructions is that as the very first step in phone's Application Manager you need to set Options/Settings/Software installation to "All"
Yes, that's right. Some operators disable that menu from their phones, essentially preventing installation of self-signed software.
Reply With Quote

#10 Old Re: How to run a script? - 2007-02-02, 07:03

Join Date: Feb 2007
Posts: 5
hlaukkan
Offline
Registered User
Now that this question is solved for my part, I'll summarize here the instructions I wrote down:

Instructions on how to run the Python programming language on your S60 phone Nokia E61

1. To be on the safe side, backup the phone's memory to the memory card (Tools / Memory / Options / Backup phone memory)

2. In the phone's Tools / Application Manager, set Options / Settings / Software installation temporarily to "All" to enable installation of self-signed software

3. Download to PC, copy to phone (e.g. using PC Suite), open and install "PythonForS60_1_3_17_3rdEd_selfsigned.SIS" (or newer 3rd Edition SIS) from http://sourceforge.net/project/showf...roup_id=154155

(I chose to install to the phone's memory. Please note that there are still some open issues on the PyS60 beta release.)

4. Download to PC, copy to phone, open and install "PythonScriptShell_1_3_17_3rdEd_selfsigned.SIS" (or newer 3rd Edition SIS) from http://sourceforge.net/project/showf...roup_id=154155

5. Using the phone's or PC Suite's File Manager create a directory called "Python" in the memory card root ("E:\Python"; the place where the Python Script shell looks for script files)

6. Write your Python script file(s) on your PC, see http://www.python.org/. Please refer also to the documentation file "PythonForS60_doc_1_3_17.pdf" (or newer) in http://sourceforge.net/project/showf...roup_id=154155

7. Use Bluetooth OBEX file transfer (e.g. PC Suite) to copy your Python "*.py" script files from PC to "E:\Python" of the phone's memory card

8. On the phone, start Python Script shell from its icon (the icon is called "Python" and is after installation by default located in the "Installat." folder)

9. Select "Run Script" from the Python Script shell's "Options" menu

10. Choose an application to run

11. In your phone's Application Manager, set Options / Settings / Software installation back to "Signed only"



Some useful links:

http://www.python.org/

http://wiki.opensource.nokia.com/pro...Python_for_S60

http://www.forum.nokia.com/devices/E61

http://www.forum.nokia.com/info/sw.n...n_for_S60.html

http://www.mobilenin.com/pys60/menu.htm

http://discussion.forum.nokia.com/fo...play.php?f=102



Clear so far. Are there any similar step-by-steps instructions out there for installing Python for S60 3rd Edition emulation environment on PC?
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Install a script as a standalone app ! cyke64 Python 5 2006-07-18 03:24
Run App on Uninstall problem JamesLockett General Symbian C++ 1 2006-07-07 13:36
write perl/python script in your S60 phone kamijawa Python 5 2006-06-03 16:59
Run Python script djoumbou Python 3 2005-04-01 15:32
Getting System.gc() to run.... jhodgski Mobile Java General 5 2004-01-28 14:03

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia