taaz30
المساهمات : 114 تاريخ التسجيل : 28/11/2008
| موضوع: [شرح] Python for Series 60 applications >>> Part 2 (Send SMS) السبت ديسمبر 27, 2008 2:11 pm | |
| بسم الله الرحمن الرحيم
الجزء التانى بسيط وسريع جدا إن شاء الله
فكرة برنامجنا المره دى ... هو إن يرسل رسالة Greetings from: Ur Name لشخصين ويسألك هل موافق ام لا واخيرا ... رسالة تأكيد الإرسال ^_^
الكود - اقتباس :
- # Copyright (c) 2005 Jurgen Scheible
# this script lets you send an sms to 2 users at the same time
import appuifw import messaging
data = appuifw.query(u"Type your name:", "text")
nbr1 = "123456" # change the mobile number here nbr2 = "234567" # change the mobile number here txt = u"Greetings from:" +data
if appuifw.query(u"Send message to your 2 friends","query") == True: messaging.sms_send(nbr1, txt) messaging.sms_send(nbr2, txt)
appuifw.note(u"Messages sent", "info") else: appuifw.note(u"Well, your Messages are not sent then", "info") لاحظ انا nbr1,2 هى مجرد ارقام إفتراضيه ... تقدر إنت تغيرها براحتك
إستخدمنا الدالة messaging.sms_send() لاحظ انها بتاخد 2 arguments الأول هو الرقم ... والثانى هو الرساله nbr1, txt
آخر سطر .. ف حالت ضغطك على OK بيطلعلك رسالة التأكيد appuifw.note(u"Messages sent", "info")
ف حال غير ذلك : appuifw.note(u"Well, your Messages are not sent then", "info")
صورة التطبيق :
تقدر تعدل فيه براحتك ::: الأمثله جميعا من مصدرها الرسمى لضيق الوقت ..
http://www.mobilenin.com/pys60/ex_sms_sending.htm
السلام عليكم
| |
|