hello,
i'd like to know how to set up a flag to change a variable,
for example, i want a simple script to combine 2 numbers,
sum = num + another_num
print "Now the sum of the numbers equals : ", sum
how could i make it so that if i type python ./script.py 21 41
that i get the sum of 21 and 41 ?
Thanks a lot
--
https://mail.python.org/mailman/listinfo/python-list
when expandig the script to multiple calcs i got a problem
>>> a = 32
>>> c = 51
>>> sign = *
File "", line 1
sign = *
^
SyntaxError: invalid syntax
is there a way of adding * without quoting marks, because if you do it just
soms the arguments
--
https://mail.python.org/mailman/l
well i'm trying something else but no luck :
#!bin/bash/python
import sys
import os
a = int(sys.argv[1])
sign = (sys.argv[2])
b = int(sys.argv[3])
if sign == '+':
sum = a + b
print a, sign, b, "=", a + b
command1 = "sudo mpg321
'http://translate.google.com/translate_tts?tl=en&q=%s_plus%s_
Op dinsdag 11 februari 2014 19:55:59 UTC+1 schreef Gary Herron:
> On 02/11/2014 10:37 AM, luke.gee...@gmail.com wrote:
>
> > well i'm trying something else but no luck :
>
> >
>
> > #!bin/bash/python
>
> > import sys
>
> > import os
>
> > a = int(sys.argv[1])
>
> > sign = (sys.argv[2])
>
>
Op dinsdag 11 februari 2014 19:51:40 UTC+1 schreef Peter Otten:
> luke.gee...@gmail.com wrote:
>
>
>
> > well i'm trying something else but no luck :
>
> >
>
> > #!bin/bash/python
>
>
>
> Hm.
>
>
>
> > import sys
>
> > import os
>
>
>
> For debugging purposes put the line
>
>
>
>
Op dinsdag 11 februari 2014 20:01:05 UTC+1 schreef luke@gmail.com:
> Op dinsdag 11 februari 2014 19:51:40 UTC+1 schreef Peter Otten:
>
> > luke.gee...@gmail.com wrote:
>
> >
>
> >
>
> >
>
> > > well i'm trying something else but no luck :
>
> >
>
> > >
>
> >
>
> > > #!bin/bash/py
Op dinsdag 11 februari 2014 20:28:44 UTC+1 schreef Tim Chase:
> On 2014-02-11 11:06, luke.gee...@gmail.com wrote:
>
> > > > > command1 = "sudo mpg321
>
> > >
>
> > > >
>
> > >
>
> > > > >
> > > > > 'http://translate.google.com/translate_tts?tl=en&q=%s_times%s_equals%s'"
> > >
hey, i got another problem now,
if i use the imterpreter to do 3 * 4 it gives twelve
the script gives ?
any tips
--
https://mail.python.org/mailman/listinfo/python-list
Would it be possible to make an
int(sys.argv[1])
Not needed and set value 0 ( or in another script 1)
For example
a = int(sys.argv[1])
b = int(sys.argv[2])
c = int(sys.argv[3])
And I run
Python ./script.py 2 3
It just set c automaticly to 0 or 1
Luke
(PS thanks for the quick help)
--
https:
Can I make it that if
C = int(sys.argv[3])
But when I only enter 2 argumentvariable it sets c automaticly to 0 or 1
--
https://mail.python.org/mailman/listinfo/python-list
Op woensdag 12 februari 2014 06:23:14 UTC+1 schreef Dave Angel:
> luke.gee...@gmail.com Wrote in message:
>
> > Can I make it that if
>
> > C = int(sys.argv[3])
>
> > But when I only enter 2 argumentvariable it sets c automaticly to 0 or 1
>
> >
>
>
>
> Why do you ask for 'automatically'?
Op woensdag 12 februari 2014 17:10:36 UTC+1 schreef Alain Ketterlin:
> luke.gee...@gmail.com writes:
>
>
>
> > Can I make it that if
>
> > C = int(sys.argv[3])
>
> > But when I only enter 2 argumentvariable it sets c automaticly to 0 or 1
>
>
>
> C = int(sys.argv[3]) if len(sys.argv) > 3 e
hello,
i have been working on a python resistor calculator to let my class show what
you can do with python.
now i have a script that makes the more speekable value of the resistance (res)
#if len(str(res)) > 9:
# res2 = res / 10
# print "de weerstand is %s,%s giga ohms" % (res2)
#elif
Op zaterdag 15 februari 2014 10:18:36 UTC+1 schreef Luke Geelen:
> hello,
>
> i have been working on a python resistor calculator to let my class show what
> you can do with python.
>
> now i have a script that makes the more speekable value of the resistance
> (res)
>
Op zaterdag 15 februari 2014 11:04:17 UTC+1 schreef Frank Millman:
> "Luke Geelen" wrote in message
>
> news:ec88852e-1384-4aa5-834b-85135be94...@googlegroups.com...
>
> > Op zaterdag 15 februari 2014 10:18:36 UTC+1 schreef Luke Geelen:
>
> > hello,
&
If i do set form thing in my script i get
Invalide syntax pointing at the last word of the form rule
--
https://mail.python.org/mailman/listinfo/python-list
Op zaterdag 15 februari 2014 18:23:20 UTC+1 schreef Ian:
> On Sat, Feb 15, 2014 at 10:17 AM, Luke Geelen wrote:
>
> > If i do set form thing in my script i get
>
> > Invalide syntax pointing at the last word of the form rule
>
>
>
> Please copy and paste the
Op zaterdag 15 februari 2014 18:42:51 UTC+1 schreef Luke Geelen:
> Op zaterdag 15 februari 2014 18:23:20 UTC+1 schreef Ian:
>
> > On Sat, Feb 15, 2014 at 10:17 AM, Luke Geelen wrote:
>
> >
>
> > > If i do set form thing in my script i get
>
> >
>
19 matches
Mail list logo