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 12:30] – 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 | import positioning | ||
| Line 37: | Line 37: | ||
| " | " | ||
| - | def getmyposition(): | + | def send_sms_myposition(phone_number): |
| result = positioning.position() | result = positioning.position() | ||
| - | result = positioning.last_position() | ||
| #print 'all gps data: ', result | #print 'all gps data: ', result | ||
| coordinates=result[" | coordinates=result[" | ||
| Line 46: | Line 45: | ||
| print ' | print ' | ||
| print ' | print ' | ||
| - | + | messaging.sms_send(phone_number, | |
| - | getmyposition() | + | |
| + | send_sms_myposition(" | ||
| </ | </ | ||
| Line 61: | Line 61: | ||
| </ | </ | ||
| - | ===== 참고 ===== | ||
| + | < | ||
| + | import positioning | ||
| + | import messaging | ||
| + | import httplib, urllib | ||
| + | |||
| + | positioning.select_module(positioning.default_module()) | ||
| + | positioning.set_requestors([{" | ||
| + | " | ||
| + | " | ||
| + | |||
| + | def getmyposition(): | ||
| + | result = positioning.position() | ||
| + | #print 'all gps data: ', result | ||
| + | # | ||
| + | coordinates=result[" | ||
| + | mylatitude = coordinates[" | ||
| + | mylongitude = coordinates[" | ||
| + | print ' | ||
| + | print ' | ||
| + | messaging.sms_send(" | ||
| + | params = urllib.urlencode({' | ||
| + | headers = {" | ||
| + | conn = httplib.HTTPConnection(" | ||
| + | conn.request(" | ||
| + | conn.close() | ||
| + | |||
| + | # | ||
| + | getmyposition() | ||
| + | </ | ||
| + | ===== 참고 ===== | ||
| + | * sms 보내기: http:// | ||
| + | * http post: http:// | ||
pys60.1326630659.txt.gz · Last modified: 2018/07/18 14:09 (external edit)