pys60
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| pys60 [2012/01/15 10:57] – 119.192.238.152 | pys60 [2018/07/18 14:10] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 29: | Line 29: | ||
| # note: your phone must have the ' | # note: your phone must have the ' | ||
| # and receive satalite data in order to make this script work. (can be problematic indoors). | # 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([{" | ||
| + | " | ||
| + | " | ||
| + | |||
| + | def send_sms_myposition(phone_number): | ||
| + | result = positioning.position() | ||
| + | #print 'all gps data: ', result | ||
| + | coordinates=result[" | ||
| + | mylatitude = coordinates[" | ||
| + | mylongitude = coordinates[" | ||
| + | print ' | ||
| + | print ' | ||
| + | messaging.sms_send(phone_number, | ||
| + | | ||
| + | send_sms_myposition(" | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | # Example 2. Non-blocking call | ||
| + | def cb(event): | ||
| + | print " | ||
| + | print event | ||
| + | print " | ||
| + | |||
| + | print " | ||
| + | print positioning.position(course=1, | ||
| + | |||
| + | </ | ||
| + | < | ||
| import positioning | import positioning | ||
| + | import messaging | ||
| + | import httplib, urllib | ||
| positioning.select_module(positioning.default_module()) | positioning.select_module(positioning.default_module()) | ||
| Line 39: | Line 74: | ||
| def getmyposition(): | def getmyposition(): | ||
| result = positioning.position() | result = positioning.position() | ||
| - | #print 'all gps data: ', result | + | #print 'all gps data: ', result |
| + | # | ||
| coordinates=result[" | coordinates=result[" | ||
| mylatitude = coordinates[" | mylatitude = coordinates[" | ||
| Line 45: | Line 81: | ||
| print ' | print ' | ||
| print ' | print ' | ||
| + | messaging.sms_send(" | ||
| + | params = urllib.urlencode({' | ||
| + | headers = {" | ||
| + | conn = httplib.HTTPConnection(" | ||
| + | conn.request(" | ||
| + | conn.close() | ||
| + | # | ||
| getmyposition() | getmyposition() | ||
| </ | </ | ||
| ===== 참고 ===== | ===== 참고 ===== | ||
| + | * sms 보내기: http:// | ||
| + | * http post: http:// | ||
pys60.1326625075.txt.gz · Last modified: 2018/07/18 14:09 (external edit)