×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    2

    Question python send sms problem

    Hi!

    In the application I am trying to make the number add 1 automatically,like this first recipient is 13805710571,the second recipient is 13805710572, the third recipient is 13805710573, and so on...

    my codes :

    import appuifw
    import messaging
    sys.setdefaultencoding('utf8')
    txt = "text!"
    number = "13805710571"
    messaging.sms_send(number,txt,'UCS2')

    how to amend the codes to achieve my aim, please help me!

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: python send sms problem

    Well, you could do number=unicode(int(number)+1) or something similar.

  3. #3
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    285

    Re: python send sms problem

    Quote Originally Posted by mycs View Post
    Hi!

    In the application I am trying to make the number add 1 automatically,like this first recipient is 13805710571,the second recipient is 13805710572, the third recipient is 13805710573, and so on...
    In principle this will work -
    Code:
    import appuifw
    import messaging
    sys.setdefaultencoding('utf8')
    txt = "text!"
    number = "13805710570"
    i = 1
    while (i<10):
    	num = str(int(number)+i)
    	messaging.sms_send(number,txt,'UCS2')
    This would send your messages to all numbers from 13805710571 to 13805710579

    However, Python on Symbian doesn't seem to handle numbers more than 9 digits long. So, a simpler option would be -
    Code:
    import appuifw
    import messaging
    sys.setdefaultencoding('utf8')
    txt = "text!"
    number = "1380571057"
    i = 1
    while (i<10):
    	num = number+str(i)
    	messaging.sms_send(number,txt,'UCS2')
    Let me know if it works..

  4. #4
    Registered User
    Join Date
    Dec 2009
    Posts
    2

    Re: python send sms problem

    Quote Originally Posted by kedarm View Post
    In principle this will work -
    Code:
    import appuifw
    import messaging
    sys.setdefaultencoding('utf8')
    txt = "text!"
    number = "13805710570"
    i = 1
    while (i<10):
    	num = str(int(number)+i)
    	messaging.sms_send(number,txt,'UCS2')
    This would send your messages to all numbers from 13805710571 to 13805710579

    However, Python on Symbian doesn't seem to handle numbers more than 9 digits long. So, a simpler option would be -
    Code:
    import appuifw
    import messaging
    sys.setdefaultencoding('utf8')
    txt = "text!"
    number = "1380571057"
    i = 1
    while (i<10):
    	num = number+str(i)
    	messaging.sms_send(number,txt,'UCS2')
    Let me know if it works..
    Thanks for you help, the works code is very simple,Just like you said “Python on Symbian doesn't seem to handle numbers more than 9 digits long”,we can change int to long!
    Code:
    import appuifw
    import messaging
    sys.setdefaultencoding('utf8')
    txt = "text!"
    number = "13805710570"
    i = 1
    while (i<10):
    	num = str(long(number)+i)
    	messaging.sms_send(number,txt,'UCS2')

  5. #5
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    285

    Thumbs up Re: python send sms problem

    Yes, you could use 'long'. I guess depending on the requirement, size of number, etc. you could choose any one of the methods.

    When I had attempted something similar, I remember, the size of int causing me a lot of grief - I just didn't know why the program failed!


Similar Threads

  1. Send SMS Problem. Cannot Get SMSC Address. Due to Strange SIM Card?
    By cksong in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2007-07-02, 16:13
  2. how to send multiple sms from exe.
    By ankushbabrekar in forum Symbian
    Replies: 2
    Last Post: 2007-03-28, 06:10
  3. send sms using sms client mtm problem
    By xhsoldier in forum Symbian Networking & Messaging (Closed)
    Replies: 9
    Last Post: 2006-07-26, 11:05
  4. Nokia 6600 Socket Server send delay Problem
    By dicson_hu in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-10-31, 07:37
  5. Problem about send Unicode Messages use SMS ?
    By haipt1810 in forum PC Suite API and PC Connectivity SDK
    Replies: 3
    Last Post: 2004-03-06, 02:15

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×