New Member FAQ | Forums | Earn Revenue


Resources Entrance Ask Experts Exam Papers Jobs English Projects Universities Colleges Courses Schools Training My India



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



Sending SMS through linux


Posted Date:     Total Responses: 0    Posted By: Thangakannan   Member Level: Bronze   Points/Cash: 6   


Sending sms code:


import commands as cd
import pgdb
db = pgdb.connect('localhost:postgres','postgres','bingo')
cur = db.cursor()
class myclass:
def sendsms(self,sendernumber,message):
first_pointer=0
last_pointer=140
strlength=len(message)
if(strlength >= 150):

while 1:
self.sendsms1(sendernumber, message[first_pointer:last_pointer])
first_pointer=last_pointer+1
last_pointer=last_pointer+140
if (last_pointer>=strlength):
self.sendsms1(sendernumber, message[first_pointer:strlength])
return 0
else:
self.sendsms1(sendernumber,message)

def sendsms1(self,number,text):
while 1:
string= "echo '" + str(text) + "' | gnokii --sendsms " + str(number)
output=cd.getoutput(string)
cur.execute("insert into sms1 values('"+str(number)+"','"+text+"')")
cur.execute('COMMIT')
splited_output=output.split("\n")
length=len(splited_output)
word=splited_output[length-1].split(" ")
if (word[0]=="Send"):
print(text)
print("sent")
break
else:
cd.getoutput("sleep 5s")


Project Feedbacks

Author: Guduru Phani KumarMember Level: BronzeRevenue Score: 4 out of 54 out of 54 out of 54 out of 5
Thanks for giving such a wonderful concept of sending sms through linux but please provide comments after every important statement which makes the viewers to understand easily.please keep in mind that a good programmer is the one who comments after every important statement.

once again i am very thankful to you for providing such a good piece of code


Author: Amaresh Chandra DasMember Level: GoldRevenue Score: 2 out of 52 out of 5
can u guide me how it will work ?

Where will i embeded this code ?

Thanks in Advance..
-Amaresh


Author: P.Mohamed RiyasMember Level: GoldRevenue Score: 1 out of 5
Thank you for the information you have provided. I have tried your code and made success on it. Please provide some more valuable information as so.


Post Feedback
You must Sign In to post a feedback.
Next Project: Checking Network Status Notification for Internet and Intranet
Previous Project: Calculation for Capacitor Bank requirement for a power distribution system

Return to Project Index

Post New Project


Related Projects



Advertise Here





Contact Us   Advertise   Editors    Privacy Policy    Terms Of Use   

ISC Technologies.
2006 - 2009 All Rights Reserved.