PythonConsole icon indicating copy to clipboard operation
PythonConsole copied to clipboard

Including the Python standard library by default

Open jqdq opened this issue 4 years ago • 3 comments

I've been thinking about using some external Python libraries with your mod (downloading them is possible using pip install --target) and I've noticed you are not including Python standard library with this Python build (random and other similar packages are not available). I've managed to go around this by adding a pure Python implementation of the standard library to the import folder. The implementation I used came from the PyPy project. Have you thought about including these in your mod? Doing this would greatly improve its power.

jqdq avatar Sep 27 '21 20:09 jqdq

My idea is a lot more extreme - rewriting the client in pure Python. If we can use native Python as client, then life will be a lot simpler for us. Yes, you can even use your existing Python interpreter and installed PyPI packages! I'm currently working on it, but I'm not sure whether it would be a successful attempt.

HuangFuSL avatar Sep 29 '21 16:09 HuangFuSL

@PogromcaPapai I'm not a regular python user so I've never thought about that. I will check it out and add it if possible.

@HuangFuSL Good luck. I'm currently rewriting the client from scratch so that it includes some caching logic and other improvements. Though I must say that implementing the client purely in Python isn't a bad idea, but I can't do that as I'm primarily a C# programmer.

Strdate avatar Oct 02 '21 15:10 Strdate

@PogromcaPapai I included PyPy in the newest release. I tested it with the random module and it seems to be working. I would be happy if you could tell me if everything works correctly as I didn't know which files to copy from the PyPy project. I copied everything from the lib-python folder but I'm not sure that's enough.

Strdate avatar Oct 08 '21 14:10 Strdate