If I create a file makehash.py with the following lines, I can run it in the terminal and get a hex hash.
<pre> #!/usr/bin/python3 import hashlib myhash = hashlib.pbkdf2_hmac('sha256',password="sw0rdf!sh".encode(),salt="NaCl".encode(),iterations=100000).hex() print(myhash) </pre>
When I have the file up in geany and I press F5 or click the gear to run it from the IDE, I get this error:
<pre> Traceback (most recent call last): File "geany_hashlib_bug.py", line 4, in <module> myhash = hashlib.pbkdf2_hmac('sha256',password="sw0rdf!sh".encode(),salt="NaCl".encode(),iterations=100000).hex() AttributeError: 'str' object has no attribute 'hex' </pre>
------------------ (program exited with code: 1) Press return to continue
Whats the execute command in Geany set to?
Set the Execute build command to python3 (or regular shell, since it has an appropriate shebang line).
When I set the build execute command to python3 "%f" everything is good so thank you very much. What exactly do I need to enter to instead of python3 to get geany to rely on the shebang line?
As @codebrainz said, a regular shell if on Linux, not sure what on Windows
Or just `./%e` on linux should work too.
I'm on Debian 10. I tried ./%e with no success but ./%f works. Thanks so much for helping me out.
Closed #2563.
github-comments@lists.geany.org