Go to advanced search

by eddie25wm
Sat Nov 08, 2014 11:15 am
Forum: Beginners
Topic: How to get the return value from python script
Replies: 6
Views: 7089

Re: urgent : how to get the return value from python script

hi,

i have the following error when i run the following code:

$ python -c 'from test02 import *; print hello()'

attributeerror: 'module' object has no attribute
by eddie25wm
Sat Nov 08, 2014 10:39 am
Forum: Beginners
Topic: How to get the return value from python script
Replies: 6
Views: 7089

Re: urgent : how to get the return value from python script

You've defined a function but you don't have any clause that calls that function. def add(a, b): return a, b , a+b x,y,z = add(4,18) print "x: %d\tY: %d\tZ: %d\n" % (x,y,z) Thank you. But i would like it to be assigned to 3 variables when i run the test.py. Can advise me? thank In linux, how do cal...
by eddie25wm
Sat Nov 08, 2014 10:37 am
Forum: Beginners
Topic: How to get the return value from python script
Replies: 6
Views: 7089

Re: urgent : how to get the return value from python script

DougieLawson wrote:You've defined a function but you don't have any clause that calls that function.

Code: Select all

def add(a, b):
  return a, b , a+b

x,y,z = add(4,18)
print "x: %d\tY: %d\tZ: %d\n" % (x,y,z)
Thank you.

But i would like it to be assigned to 3 variables when i run the test.py. Can advise me? thank
by eddie25wm
Sat Nov 08, 2014 10:26 am
Forum: Beginners
Topic: How to get the return value from python script
Replies: 6
Views: 7089

How to get the return value from python script

Hi,

the following code is in test.py

def add(a, b):
return a, b , a+b

i am trying to get the return values by using $ python test.py. it runs but nothing being return..

Please advise

Thank you
by eddie25wm
Sat Nov 08, 2014 7:34 am
Forum: Beginners
Topic: Urgent : sending sms
Replies: 8
Views: 1332

Re: Urgent : sending sms

Hi,

anyone know how?

Thanks
by eddie25wm
Sat Nov 08, 2014 4:44 am
Forum: Beginners
Topic: Urgent : sending sms
Replies: 8
Views: 1332

Re: Urgent : sending sms

Hi,

Please help.

Thank you
by eddie25wm
Sat Nov 08, 2014 4:00 am
Forum: Beginners
Topic: Urgent : sending sms
Replies: 8
Views: 1332

Urgent : sending sms

I would like to send an sms that is in the variable. But i got no value when receiving the sms

code :

set var="http:\\google.com.sg/maps?"
echo "$var" | sudo gammu sendsms TEXT +65123456

please advise.

Thank you.
by eddie25wm
Sat Nov 08, 2014 2:43 am
Forum: Beginners
Topic: for loop and fi issue
Replies: 14
Views: 1897

Re: urgent : for loop and fi issue

I wrote the following code but I kept having syntax error: end of file unexpected (expecting 'do')
I run the following LXterminal.

count=10
while [ $count -gt 0 ]; do #after [ have a space.
. batch.txt
count=$[count - 1]
done


please help. thank you
by eddie25wm
Fri Nov 07, 2014 5:26 pm
Forum: Beginners
Topic: for loop and fi issue
Replies: 14
Views: 1897

Re: urgent : for loop and fi issue

Hi, I am having trouble in running the following code as unexpected end of file , expecting ("fi") For "%count%"=10 then runbat.txt -c /etc fi Hi, %var% like a DOS variable reference, but, for syntax are wrong. for loop not work on shell script or batch file same as on languages like C. On shell, f...
by eddie25wm
Fri Nov 07, 2014 4:59 pm
Forum: Beginners
Topic: for loop and fi issue
Replies: 14
Views: 1897

Re: urgent : for loop and fi issue

You need to tell us what you are doing. I get this error. For "%count%"=10 then runbat.txt -c /etc fi -bash: For: command not found i am trying to call a batch.txt 10 times on startup of the raspberry pi. How can I do it? this batch.txt file is to send sms message to myself i really need help on th...
by eddie25wm
Fri Nov 07, 2014 4:49 pm
Forum: Beginners
Topic: for loop and fi issue
Replies: 14
Views: 1897

Re: urgent : for loop and fi issue

joan wrote:You need to tell us what you are doing.

I get this error.

Code: Select all

For "%count%"=10 then runbat.txt -c /etc fi
-bash: For: command not found

i am trying to call a batch.txt 10 times on startup of the raspberry pi. How can I do it?
this batch.txt file is to send sms message to myself
by eddie25wm
Fri Nov 07, 2014 4:35 pm
Forum: Beginners
Topic: for loop and fi issue
Replies: 14
Views: 1897

Re: urgent : for loop and fi issue

RaTTuS wrote:dos [Disk Operating System] is not raspberry
that does not look like dos commands
can you point to the link give us a URL as we're not psychic

http://www.penguintutor.com/raspberrypi ... -reference
by eddie25wm
Fri Nov 07, 2014 4:30 pm
Forum: Beginners
Topic: for loop and fi issue
Replies: 14
Views: 1897

Re: urgent : for loop and fi issue

joan wrote:Which language? It's not one I recognise.

i am trying to call a batch.txt 10 times on startup of the raspberry pi. How can I do it?

Please advise. Thank you
by eddie25wm
Fri Nov 07, 2014 4:21 pm
Forum: Beginners
Topic: for loop and fi issue
Replies: 14
Views: 1897

Re: urgent : for loop and fi issue

joan wrote:Which language? It's not one I recognise.

I have got it from raspberry pi site. But I always got the mentioned error. Is dos?
by eddie25wm
Fri Nov 07, 2014 4:09 pm
Forum: Beginners
Topic: for loop and fi issue
Replies: 14
Views: 1897

for loop and fi issue

Hi,

I am having trouble in running the following code as unexpected end of file , expecting ("fi")

For "%count%"=10 then runbat.txt -c /etc fi
by eddie25wm
Sat Oct 18, 2014 6:04 am
Forum: Troubleshooting
Topic: setting up raspberry pi with SIM900 and GPS receiver
Replies: 1
Views: 2482

setting up raspberry pi with SIM900 and GPS receiver

I am going to use Raspberry pi Model B to do a microcontroller based vehicle tracked system.I will be using C++ programming language to write codes on vehicle tracked system. The Raspberry pi will be connected to a SIM900 GPS/GPRS minimum System module with Raspberry pi SIM900 GSM/GPRS Module Adapte...

Go to advanced search