java-random icon indicating copy to clipboard operation
java-random copied to clipboard

Import javarandom error

Open rcliu opened this issue 5 years ago • 5 comments

import javarandom as jr Traceback (most recent call last): File "", line 1, in File "/home/.conda/envs/py36/lib/python3.6/site-packages/javarandom.py", line 43 self._seed = (seed ^ 0x5deece66dl) & ((1 << 48) - 1)

rcliu avatar Nov 14 '19 16:11 rcliu

Same error here with python3, had to downgrade to python2 to use.

# python3
Python 3.7.3 (default, Apr 24 2020, 18:51:23) 
[Clang 11.0.3 (clang-1103.0.32.62)] on yoursystem
Type "help", "copyright", "credits" or "license" for more information.
>>> import javarandom
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/3.7/site-packages/javarandom.py", line 43
    self._seed = (seed ^ 0x5deece66dl) & ((1 << 48) - 1)
                                    ^
SyntaxError: invalid syntax
>>> exit()

Greenwolf avatar Aug 09 '20 23:08 Greenwolf

And, here we are, I just started playing with this too, and no P3 support :(

coolacid avatar Aug 10 '20 17:08 coolacid

@coolacid @rcliu @Greenwolf Are you able to solve this issue?

mustansarsaeed avatar Jan 19 '21 10:01 mustansarsaeed

Feel free to forward-port to Python 3. It shouldn't be hard. I haven't needed this code for a long time, and it's really only of interest for folks doing historical research or doing reverse-engineering. Like, I wrote this module to help reverse-engineer Minecraft in Java! If you don't need that sort of thing, then please use random instead.

MostAwesomeDude avatar Mar 25 '21 02:03 MostAwesomeDude

PR #2 solved this issue 5 years ago. I think the problem is that the packaged version on PyPI is outdated.

@MostAwesomeDude could you push the current version to PyPI please?

In the meantime, anyone experiencing this issue can install this module using:

pip install 'git+https://github.com/MostAwesomeDude/java-random.git'

markuspi avatar Jun 01 '21 19:06 markuspi