Hi I ve a script in iron python where a variable mite contain special characters. Ex name- megha_lohit url - http://url.com
if name == megha_lohit: print 'success' else raise testcaseexception(failed)
Here the code doesnt pass the i开发者_如何学Cf loop and enters teh else part failing the test case , even though name = megha_lohit(right hand side expression), same case is with url too. Could somebody help me out
By design variable names cannot contain ":" and "`". Underscores are ok. Maybe your problem is something else in your code.
IronPython 2.7 (2.7.0.40) on .NET 4.0.30319.1
Type "help", "copyright", "credits" or "license" for more information.
>>> a_foo= "hello"
>>> a:foo= "hello"
File "<stdin>", line 1
a:foo= "hello"
^
SyntaxError: unexpected token ':'
>>> a`foo= "hello"
File "<stdin>", line 1
a`foo= "hello"
^
SyntaxError: unexpected token '`'
>>>
精彩评论