Closed grenadn closed 8 years ago
Unlike the original Biligrab, BiliDan is Python 3 only.
haha, that code just a bit redundant 😄
在 2015年12月21日,上午12:21,David Zhuang notifications@github.com 写道:
Unlike the original Biligrab, BiliDan is Python 3 only.
— Reply to this email directly or view it on GitHub https://github.com/m13253/BiliDan/issues/44#issuecomment-166133362.
SyntaxError: Non-ASCII character '\xe2' in file bilidan.py on line 14, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
I fixed this by adding a charset declaration in e806ec11b61877e6aaf8e3dd6d15395e71fe2e7b. But there is still an exception:
File "bilidan.py", line 61
def biligrab(url, *, debug=False, verbose=False, media=None, cookie=None, quality=None, source=None, keep_fps=False, mpvflags=[], d2aflags={}, fakeip=None):
^
SyntaxError: invalid syntax
I really don't know how to make the version check work. :joy:
Add #!/usr/bin/env python3
in the code, and point out the correct version is Python 3 in the main document and comments.
There is a another stupid solution: you write spilit the code into two parts: one for Python version check and the other for the main code. If the former find that the version is correct, execute the later, like subprocess.run('main.py')
while main.py
has the correct shebang #!/usr/bin/env python3
, or complain the user is using wrong Python.
Okay. I already have the shebang. Since there is no other way to solve it without introducing a seperate launcher, I will close it for now until I find a solution.
Hello,
I noticed some code snippets like this:
But the interpreter(python2 on OS X) shows syntax error(caused by asterisk) and will also trigger
thus,
will never run Insignificant minor bug :-)