开发者

Iron python is not accepting characters like _,`,:

开发者 https://www.devze.com 2023-02-28 21:46 出处:网络
Hi I ve a script in iron python where a variable mite contain special characters. Ex name- megha_lohit

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 '`'

>>>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号