k6control icon indicating copy to clipboard operation
k6control copied to clipboard

Print errors under Python 3

Open thorstenkampe opened this issue 6 years ago • 3 comments

Running k6control with Python3 generates multiple errors:

SyntaxError: Missing parentheses in call to 'print'. Did you mean print()?

thorstenkampe avatar Oct 11 '18 18:10 thorstenkampe

@thorstenkampe k6control is a python 2 application. I'd love to get a PR that makes it run as both a Python 2 and Python 3 app.

ragnarlonn avatar Oct 11 '18 19:10 ragnarlonn

Sorry, I don't know what a PR is. Basically you would have to...

  • convert the print statement to a function by adding parentheses. This does not affect Python2 if you're printing strings.
  • change / to //. This should also not affect Python 2

thorstenkampe avatar Oct 12 '18 05:10 thorstenkampe

@thorstenkampe k6control is a python 2 application. I'd love to get a PR that makes it run as both a Python 2 and Python 3 app.

Time to go fully Python 3 now - Py2 is dead as of this year (see #4 for making this Python3 compat)

teward avatar Dec 01 '20 17:12 teward