| Reply | « Previous Thread | Next Thread » |
|
hi
i m writing small app my code is: Code:
import inbox, e32, appuifw, switchoff
def quit():
app_lock.signal()
appuifw.app.exit_key_handler=quit
app_lock=e32.Ao_lock()
code=(u'shutdown')
def cb(id):
i=inbox.Inbox()
id=i.sms_messages()[0]
x = i.content(id)
if x == code + u't' # t = time (t=6 T=15 etc.)
e32.ao_sleep(t) # i wanna wait t seconds
switchoff.Shutdown()
i.delete(id)
switchoff.Shutdown()
i=inbox.Inbox()
i.bind(cb)
app_lock.wait()
and i send sms to my phone shutdown6 but my app is no worknig ![]() |
| cool_eagle |
| View Public Profile |
| Find all posts by cool_eagle |
|
PLS HELPPPP
![]() |
| cool_eagle |
| View Public Profile |
| Find all posts by cool_eagle |
|
Quote:
Why do you need those brackets ? Anyway it should work either ways Code:
code=u"shutdown" Code:
if x == code + u't' You need to modify your code. And you need to manipulate your text sms string to separate "t" and use it as an integer. t=int(t) would also be required before you call the delay ! Hope that helps, Best Regards, Croozeus |
|
Quote:
![]() |
| cool_eagle |
| View Public Profile |
| Find all posts by cool_eagle |
|
Why you can't ?
![]() Here you are, Code:
def cb(id):
i=inbox.Inbox()
id=i.sms_messages()[0]
x = i.content(id)
t= int(x[8:9])
if x[0:8]== code:
e32.ao_sleep(t)
switchoff.Shutdown()
i.delete(id)
switchoff.Shutdown()
Croozeus |
|
Btw, you had forgot the colon in the statement above Code:
if x == code + u't' : Croozeus |
|
Instead you can also use regular expression as it will make your job much easier.
Code:
import re
y=re.compile('shutdown[0-9]') # Include range convinent to you
if y.match(abc): # To compare with the sms you have sent
print abc
IDEAS is all they need but still they think only Genius can give them that. |
| shubhendra |
| View Public Profile |
| Find all posts by shubhendra |
|
can u give me an example
|
| cool_eagle |
| View Public Profile |
| Find all posts by cool_eagle |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Problem with eglSwapBuffers and heap corruption | greatape | Symbian Media (Graphics & Sounds) | 2 | 2007-05-24 04:35 |
| netcards - Problem with opening adapter | kernj | Symbian Tools & SDKs | 5 | 2007-01-10 09:56 |
| WAP service problem on Apache | bigg_o | Browsing and Mark-ups | 3 | 2005-04-17 17:05 |
| Problem: S60 SDK for CW in PC with .NET | anttij | Carbide.c++ IDE and plug-ins | 1 | 2005-02-28 12:36 |
| wireless problem | sash_mca | General Browsing | 0 | 2003-06-06 12:34 |