Youâre welcome. Bear in mind that itâs generally recommended to test for features , not for version, in case you later switch interpreters/ Python version:
Thanks.
In my case I have different behavior of IronPython than CPython. Such check was my first idea to solve issue. Unfortunately didât help much. .
Also I think theres a problem with line 29 in zserver:
q = str("\"",input("Enter something to this client: "),"\"")
Did you mean: q = "\""+str(input("Enter something to this client: "))+"\""
Which can be âsimplifiedâ to q = '"'+str(input("Enter something to this client: "))+'"'
to avoid escaping the "
It was already 4a.m. this is just a build up from str(input()) , an evolution. I didnât clean the code. I was gonna do it after I make it work on IronPython properly.
Ahh got you Looks like you also need to work on the socket calls as there seem to have been changes to how they work from 2.7 through to modern Python.
What I donât understand is why does it keep treating the text thatâs entered as non string whereas the input() is inside a str(). Is this an issue with IronPython? It works properly with CPython.
Next, I wish to try on IronPython side to use .net libraries instead of Python modules. Exactly with try: except: as you suggested. That would require me translating csharp to python again
[quote=âivelin.peychev, post:13, topic:79267, full:trueâ]
What I donât understand is why does it keep treating the text thatâs entered as non string whereas the input() is inside a str(). Is this an issue with IronPython? It works properly with CPython.
/quote]
In Cpython you are executing line 27, transforming the result of input() into a string. This is a null operation as input() already returns a string.
In Ironpython you are executing line 29, trying to run the str() function with 3 parameters separated by commas, but in python 2, the str function only takes a single parameter, so it wont like this.