我知道,这是一个菜鸟问题..
我有这些变量:
pgwdth = 30;
mrgn = 0;
fmt = True
而这个功能:
def Param(x,pgwdth,mrgn,fmt):
parametros = x.split(" ")
if parametros[0][1] == "p":
numerozinho = int(parametros[1])
print "Changing pgwdth"
pgwdth += numerozinho
print pgwdth
elif parametros[0][1] == "m":
numerozinho = int(parametros[1])
print "Changing mrgn"
mrgn += numerozinho
print mrgn
elif parametros[0][1] == "f":
numerozinho = parametros[1]
print "On/Off"
if numerozinho == "on\n":
fmt = True
elif numerozinho == "off\n":
fmt = False
else:
"Error"
print fmt
else:
print "Error"
我只希望它在更改它后返回它用作参数的变量。