R
Ruchika
Hi,
I am new to Python, so this may be a very simple question for most of
you. What does the % operator stand for in Python? I came across a
script that uses the % operator as follows -
def sync(delf,name):
os.popen3( 'P4 -s sync -f %s' % name)
I would suspect that this just replaces the %s with the value of name.
Is % before name required? Should there be a space between % and name?
On a similar note, how can I print the value of name using the print
statement? Should print %name print the value of name?
Most of the time, when I add some print statements to my script I get
Autoindent error. Can someone tell me what this error is and how to
fix it?
Thanks for your help.
Ruchika
I am new to Python, so this may be a very simple question for most of
you. What does the % operator stand for in Python? I came across a
script that uses the % operator as follows -
def sync(delf,name):
os.popen3( 'P4 -s sync -f %s' % name)
I would suspect that this just replaces the %s with the value of name.
Is % before name required? Should there be a space between % and name?
On a similar note, how can I print the value of name using the print
statement? Should print %name print the value of name?
Most of the time, when I add some print statements to my script I get
Autoindent error. Can someone tell me what this error is and how to
fix it?
Thanks for your help.
Ruchika