Closed kkoci closed 8 years ago
Your logs indicate python2.7 is being run, though I don't see why z.print() would not work with python2.7. Can you make sure that Python 3.x is being used and try again?
Yeah, now it's perfect, but I've had to install python3 system wide, not a problem at all tho
But sill I don't get it with pyenv, I think that module (pyenv) it's kind of tricky or buggy anyways
Thank You!
Hi, pretty sure the issue with using print as a function name is that it is also a built in function. In your code if you replace the print() function in the ZReport and Receipt objects with _print() and change where the function is called to reflect this naming update the code will run fine in python 2.7 and 3.x
I should probably rename that function to print_out, or something similar so as to not be confusing. I'll leave this open until I get the time to do this.
Interesting @SamuelDudley gonna check it
I'll submit a pull request shortly
Hi again
I was retaking this project after a while, really busy over here lately.
BTW, after I've cloned the actual project, now I can't run migrate or runserver, etc
Because of this:
''Unhandled exception in thread started by <function wrapper at 0xb6773f7c> Traceback (most recent call last): File "/home/kkoci/.virtualenvs/orthosie/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(_args, *_kwargs) File "/home/kkoci/.virtualenvs/orthosie/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run autoreload.raise_last_exception() File "/home/kkoci/.virtualenvs/orthosie/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception six.reraise(__exception) File "/home/kkoci/.virtualenvs/orthosie/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(_args, kwargs) File "/home/kkoci/.virtualenvs/orthosie/local/lib/python2.7/site-packages/django/init.py", line 18, in setup apps.populate(settings.INSTALLED_APPS) File "/home/kkoci/.virtualenvs/orthosie/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate app_config.import_models(all_models) File "/home/kkoci/.virtualenvs/orthosie/local/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models self.models_module = import_module(models_module_name) File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module import**(name) File "/home/kkoci/python_examples/orthosie/register/models.py", line 69 z.print() ^ SyntaxError: invalid syntax '''
Is this related to the Python version?
I'm using pyenv, with python 3.3.1
Thank You
Best Regards