User Tools

Site Tools


pys60

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
pys60 [2012/01/15 10:57] 119.192.238.152pys60 [2018/07/18 14:10] (current) – external edit 127.0.0.1
Line 11: Line 11:
   * PythonScriptShell_2.0.0_high_capas.sis   * PythonScriptShell_2.0.0_high_capas.sis
  
-http://mobilenin.com/pys60/menu.htm 
  
 ===== 패키징 ===== ===== 패키징 =====
Line 22: Line 21:
   * S60 Module Reference http://pys60.garage.maemo.org/doc/s60/s60.html   * S60 Module Reference http://pys60.garage.maemo.org/doc/s60/s60.html
   * https://garage.maemo.org/frs/download.php/7490/PyS60_2_0_documentation.pdf   * https://garage.maemo.org/frs/download.php/7490/PyS60_2_0_documentation.pdf
-===== 참고 ===== +  * http://mobilenin.com/pys60/menu.htm
  
 +===== GPS 정보 가져오기 =====
 +http://pys60.garage.maemo.org/doc/s60/position-example.html
 +
 +<code>
 +# note: your phone must have the 'Location' (GPS data /position) application on, 
 +# and receive satalite data in order to make this script work. (can be problematic indoors).
 +import messaging
 +import positioning
 +
 +positioning.select_module(positioning.default_module())
 +positioning.set_requestors([{"type":"service",
 +                             "format":"application",
 +                             "data":"test_app"}])
 +
 +def send_sms_myposition(phone_number):
 +    result = positioning.position()
 +    #print 'all gps data: ', result    
 +    coordinates=result["position"]
 +    mylatitude = coordinates["latitude"]
 +    mylongitude = coordinates["longitude"]
 +    print 'mylatitude: ', mylatitude
 +    print 'mylongitude:', mylongitude
 +    messaging.sms_send(phone_number, str(mylatitude) +' '+ str(mylongitude))
 +    
 +send_sms_myposition("01094378282")
 +</code>
 +
 +<code>
 +# Example 2. Non-blocking call
 +def cb(event):
 +    print "---"
 +    print event
 +    print "---"
 +
 +print "***starts the position feed***"
 +print positioning.position(course=1,satellites=1,callback=cb,interval=500000, partial=0)
 +
 +</code>
 +
 +<code>
 +import positioning
 +import messaging
 +import httplib, urllib
 +
 +positioning.select_module(positioning.default_module())
 +positioning.set_requestors([{"type":"service",
 +                             "format":"application",
 +                             "data":"test_app"}])
 +
 +def getmyposition():
 +    result = positioning.position()
 +    #print 'all gps data: ', result     
 +    #messaging.sms_send("01094378282", result)
 +    coordinates=result["position"]
 +    mylatitude = coordinates["latitude"]
 +    mylongitude = coordinates["longitude"]
 +    print 'mylatitude: ', mylatitude
 +    print 'mylongitude:', mylongitude
 +    messaging.sms_send("01094378282", str(mylatitude) +' '+ str(mylongitude))
 +    params = urllib.urlencode({'latitude': str(mylatitude), 'longitude' : str(mylongitude)})
 +    headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain"}
 +    conn = httplib.HTTPConnection("donghee8.com:4567")
 +    conn.request("POST", "/", params, headers)
 +    conn.close()
 +
 +#messaging.sms_send("01094378282", "test start")
 +getmyposition()
 +</code>
 +===== 참고 ===== 
  
 +  * sms 보내기: http://pys60.garage.maemo.org/doc/s60/module-messaging.html
 +  * http post: http://www.developer.nokia.com/Community/Wiki/Performing_web_tasks_in_PySymbian
pys60.1326625020.txt.gz · Last modified: 2018/07/18 14:09 (external edit)