Skip to content
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

SyntaxError #40

Open
gmar5 opened this issue Jun 1, 2016 · 4 comments
Open

SyntaxError #40

gmar5 opened this issue Jun 1, 2016 · 4 comments

Comments

@gmar5
Copy link

gmar5 commented Jun 1, 2016

Hi.
First of all, thanks for the amazing project, I love the spirit of data collection and great visualisation!

When I run ulogme.sh, I constantly get the following error:

SyntaxError: invalid syntax
logged key frequency: Wed Jun  1 17:19:36 BST 2016 0 release events detected into logs/keyfreq_.txt
  File "rewind7am.py", line 27
    print rewindTime(int(time.time()))
                   ^
SyntaxError: invalid syntax
[...]

Data is still recorded in the window_txt and keyfreq_.txt logs (In this format, e.g.: 1464797947 ulogme - File Manager -- I don't know if it is correct, with that date format.)

I also get these errors running the UI scripts (and they don't do anything):

$ python export_events.py
  File "export_events.py", line 26
    except Exception, e:
                    ^
SyntaxError: invalid syntax

$ python ulogme_serve.py
  File "ulogme_serve.py", line 72
    print 'Serving ulogme, see it on http://localhost:' + `PORT`
                                                      ^
SyntaxError: Missing parentheses in call to 'print'

I am on Manjaro 16.06 (Xfce) Linux.

Do you know what the problem could be and how (if) it can be solved?

Thanks!

@pydolan
Copy link

pydolan commented Jun 1, 2016

Probably your version of python. Run python --version and it most likely will be 3+.

@gmar5
Copy link
Author

gmar5 commented Jun 1, 2016

Yes, it is 3.5.1. What would I need instead?

@pydolan
Copy link

pydolan commented Jun 1, 2016

A few options:

(1) modify your local copy to be python3 compatible: wrap print statements in parentheses; switch syntax of exception to, except Exception as e.

(2) [better option] Fork this github project, apply these python 3 changes, and issue a pull request so that others benefit from the change.

(3) Use python 2.x to run the script (either by explicitly calling python27 in ulogme.sh (or wherever) or telling your OS to default to python 2.x instead of 3.x.

@gmar5
Copy link
Author

gmar5 commented Jun 1, 2016

Thank you. For now, I have opted for (3), to avoid possible further problems until I manage to make it run correctly. If everything works, then I will propose the changes.

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

No branches or pull requests

2 participants