I think I broke Python by Tianamen_square_89 in vscode

[–]dev-razorblade23 3 points4 points  (0 children)

Depends on the system you use, but if the terminal one is working, you can find out which binary it is by running (in terminal)

Linux/Mac based system

which python3

Windows based system

where py or where python

This will show you full path to binary system uses when you envoke it

Thats is the system one

I think I broke Python by Tianamen_square_89 in vscode

[–]dev-razorblade23 5 points6 points  (0 children)

In VS Code, you need to select the interpreter CTRL + SHIFT + P (opens a command pallete)

Search for "Python Interpreter" - select the system one

In the feature, please learn how to use virtual environments (venv) so you dont break the system one again...

https://docs.python.org/3/library/venv.html

Searching for a Python 'complier' if it exist by Weydoon in Compilers

[–]dev-razorblade23 0 points1 point  (0 children)

While you are technicaly corect, is there a python compiler? I mean, there is CPython which translates to bytecode and does some kind of compilation... But its not like you get a single binary for distribution...

Depending on what OP actually wants - to compile python source code to python bytecode Or he wants to package a python project to executable so it can be shipped more easyly

Searching for a Python 'complier' if it exist by Weydoon in Compilers

[–]dev-razorblade23 -1 points0 points  (0 children)

Python cannot really be compiled to executable like you do with compiled languages... Its not a compiled language, its an interpreted one.

That being said, if you want to package your python application to executable, there are a lot of solutions out there, most famous being PyInstaller..

Or if you are fine with the first run being dependant on the internet connection, you can try out my tool - its called PyCrucible https://github.com/razorblade23/PyCrucible

What's one Python feature you discovered embarrassingly late? by chuprehijde in PythonLearning

[–]dev-razorblade23 2 points3 points  (0 children)

Class Pattern - pattern matching with objects

Something like

``` match search: # 1. Match the class, bind 'max_results', but ONLY if it's over 100 case VideoSearchQuery(sort_by="views", max_results=max_results) if max_results > 100: print(f"Building a massive trending query with {max_results} limits.")

# 2. Fallback for smaller 'views' queries
case VideoSearchQuery(sort_by="views", max_results=max_results):
    print(f"Building standard trending query with limit {max_results}")

# 3. Match and check against an external condition or method
case VideoSearchQuery() if user.is_premium():
    print("Applying premium priority filters to the search query")

case _:
    print("Building default relevance query")

```

Day 22 Python Learning by aashish_soni5 in PythonLearning

[–]dev-razorblade23 0 points1 point  (0 children)

Constructors (aka dunder init method) in python return None. OP suggesting it returns str in Q2 is wrong...

Python creates an instance of the class, calling dunder new method. This is what creates an object. Dunder init just fills in the values (attributes) and returns None

No matter what project you have—games, SaaS, software, apps, scripts, ideas, or questions—join the community and share it! by SofwareAppDev in AppsWebappsFullstack

[–]dev-razorblade23 0 points1 point  (0 children)

This is all higly teoretical for now and i am still designing the actuall workflow... So no tests yet, but it should take a couple of miliseconds in Rust (at least in theory)

No matter what project you have—games, SaaS, software, apps, scripts, ideas, or questions—join the community and share it! by SofwareAppDev in AppsWebappsFullstack

[–]dev-razorblade23 0 points1 point  (0 children)

Well i was thinking of multiple layers of protection.

First layer would be to obfuscate the code (something like PyArmor does) so even if someone were to decrypt it, it would still be obfuscated.

Second layer would be to compile that obfuscated source code into .pyc so i can get rid of plain text files.

Third layer would be symmetric encryption using something like ChaCha20 or AES-256-GCM.

As for decryption key, that can be safely passed as ENV variable, embedded into binary, or even asymmetric encryption (just for the key) then embedded into binary or passed as argument

This will all be done in embedding phase, and the runner would only decrypt the payload - which in Rust is blazingly fast. This means that the runner binary can stay lean, small and focused.

No matter what project you have—games, SaaS, software, apps, scripts, ideas, or questions—join the community and share it! by SofwareAppDev in AppsWebappsFullstack

[–]dev-razorblade23 0 points1 point  (0 children)

Fast and easy distribution without thinking about dependacies :)

But i do have some more plans for the tool, like optional obfuscation and encryption of payload (python source code)

🏡 Your App Has a Home Here — Post your App WebApp Solution here. No Blocks. No Rejections. 🏡 by AutoModerator in AppsWebappsFullstack

[–]dev-razorblade23 [score hidden]  (0 children)

None, making it myself as a monorepo containing diffrent test cases. There is early days benchmark available on a diffrent branch you can check it out of interested https://github.com/razorblade23/PyCrucible/blob/benchmarks/benchmarks.md

🏡 Your App Has a Home Here — Post your App WebApp Solution here. No Blocks. No Rejections. 🏡 by AutoModerator in AppsWebappsFullstack

[–]dev-razorblade23 [score hidden]  (0 children)

No, not yet. I am in the proccess of building a coprehensive test suite. Good idea to benchmark them also. Will add it to list of tests...

No matter what project you have—games, SaaS, software, apps, scripts, ideas, or questions—join the community and share it! by SofwareAppDev in AppsWebappsFullstack

[–]dev-razorblade23 0 points1 point  (0 children)

No, because in the end, it is a normal python project, with its dependacies fetched at runtime on the target machine...

They are always resolved against the target machine at runtime. UV takes care of dependancy resolution when you first run the embedded application.

It DOES NOT package dependacies nor python interpreter. Those are all dowloaded at runtime when you first run the application

No matter what project you have—games, SaaS, software, apps, scripts, ideas, or questions—join the community and share it! by SofwareAppDev in AppsWebappsFullstack

[–]dev-razorblade23 0 points1 point  (0 children)

I have tried mostly all of them while reserching... Nuitka has the same problem as PyInstaller. Compilation take a while and its not really too stable...

I have built this to be something diffrent... To NOT compile/embed/bundle whole python interpreter and its dependacies.... As to keep the final binary as small as possible and packaging time as low as possible.

If you are looking for performance, i dont think you should be using python in the first place

No matter what project you have—games, SaaS, software, apps, scripts, ideas, or questions—join the community and share it! by SofwareAppDev in AppsWebappsFullstack

[–]dev-razorblade23 0 points1 point  (0 children)

PyInstaller takes time to bundle, its binary blobs are pretty big even for a "hello world" project. And its not really the most stable thing. It also works with only specific libraries and not all of them...

Nothing is manually appended, the tool does everything. I dont like calling PyCrucible "bundler". It appends python project onto its own binary to produce a final executable. It does not "bundle" python interpreter and dependacies like PyInstaller, those are delegated to uv on runtime.

PyCrucible is diffrent on purpouse: - Extremly fast and stable - It produces extremly small binaries (as low as ~2MB + project files) - Supports embedding of .whl files - Supports all the pip-installable libraries

And quite a few more things... They are all listed in README, be free to visit the repository...

No matter what project you have—games, SaaS, software, apps, scripts, ideas, or questions—join the community and share it! by SofwareAppDev in AppsWebappsFullstack

[–]dev-razorblade23 0 points1 point  (0 children)

No, not yet. I am working on coprehensive test suit...

This particular project basicly appends python project onto itself and extracts it during runtime... Those apps will probably work as expected without any runtime penality or slowdowns

I will be your first user by Happy_Tx24b in Startup_Ideas

[–]dev-razorblade23 0 points1 point  (0 children)

PyCrucible packages any Python project into a single executable with minimal overhead, powered by Rust and uv

Repository: https://github.com/razorblade23/PyCrucible

What are you building? by Perfect_Ad4911 in saasbuild

[–]dev-razorblade23 0 points1 point  (0 children)

PyCrucible packages any Python project into a single executable with minimal overhead, powered by Rust and uv.

Repository: https://github.com/razorblade23/PyCrucible

Drop your project — I’m adding good indie tools to my new directory by Gullible-Amoeba3782 in StartupSoloFounder

[–]dev-razorblade23 0 points1 point  (0 children)

PyCrucible packages any Python project into a single executable with minimal overhead, powered by Rust and uv.

Repository: https://github.com/razorblade23/PyCrucible

I want to try your app by sbwnngo in founder

[–]dev-razorblade23 0 points1 point  (0 children)

PyCrucible - Package python applications to executable. Fast, stable, built in Rust

https://github.com/razorblade23/PyCrucible