Skip to content

test_flask.py works with python3, also added cleaner fstrings #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LEvinson2504
Copy link

I made a few changes so it works with python3, also used fstrings because the look cleaner.

@drandreaskrueger
Copy link
Owner

Thanks a lot, that's much appreciated. Do you want to adapt the whole repo like this?

Yes, I got your code running with py3:

deactivate
python3 -m venv env3
source env3/bin/activate
pip install -U pip && pip install bottle cherrypy Flask tornado web.py psutil requests
python3 test_flask.py 

well done.

@drandreaskrueger
Copy link
Owner

but now the same code fails on py27

deactivate
virtualenv env2; source env2/bin/activate; python --version
source env2/bin/activate
pip install -U pip && pip install bottle cherrypy Flask tornado web.py psutil requests
python2 test_flask.py

I'd prefer re-writing it in a way that would work in py27 AND in python3x.
Identical code also has the advantage that comparing the performance of the py27 and py3x libraries is more straightforward.

I understand your aesthetics argument - but could you live without that here? :-)

@drandreaskrueger
Copy link
Owner

drandreaskrueger commented Jun 15, 2020

I understand your aesthetics argument - but could you live without that here? :-)

Or rather: Yes, improve the aesthetics please (since I wrote it back then, my experience has increased too, so I get your point), but in a way that keeps it working in both py27 and py3x.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants