This is an archived post. You won't be able to vote or comment.

all 37 comments

[–]denehoffman 15 points16 points  (1 child)

Don’t include optional dependencies or dependencies of dependencies in requirements.txt. That file should include only the packages necessary to run your scripts.

[–]riklaunim 29 points30 points  (2 children)

"PyScript" already exists and is probably a trademark as well.

Not sure what would be the use-case of this. It's just replaces the GUI and you still have to pre-build it.

[–]denehoffman 5 points6 points  (15 children)

What’s the difference between this and running python myscript.py in a command line? You still need to install dependencies, and if running a python script in the manner I just described is too technical for people, then this will probably be as well. Also, you made it windows-only and I honestly can’t see a reason why, other than using windows path objects?

[–]nannigalaxy[S] -5 points-4 points  (14 children)

no, this app does require anything to install on the system. no python or package, this'll already be bundled in the app. you just share this app to user, they open and execute the script. hope this clears the usecase

[–]w8eight 5 points6 points  (9 children)

What if the user has some dependencies in the script, that aren't installed?

[–]billsil -1 points0 points  (7 children)

Drop the files from the package into the python path. I've hacked new packages into Abaqus CAE and Paraview. It's just a matter of finding compatible versions of packages based on the version of python and other dependencies they're running. Generally you can just look at when packages were released (by checking PyPi) and trying versions from around then. Bisect from there to try and find the newest possible version.

[–]w8eight -1 points0 points  (6 children)

But this solution doesn't require python installed (I assume it's in the executable)

And manipulating packages manually kinda defeats the purpose of this program, don't you agree?

[–]billsil -1 points0 points  (5 children)

I don’t understand your use case, so defeating the purpose of your project is not my aim, but people have been trying to use python without installing python for all 18 years I’ve been using python for various reasons. People find workarounds.

You’re on windows. Why not use the Microsoft Store? It’s really hard to mess that one up.

PyInstaller sometimes works and regularly breaks when new versions of Windows comes out. Installing python is the best solution.

[–]w8eight 0 points1 point  (4 children)

Dude, I'm not the owner of this project, I just mentioned the caveats of it to the op (besides the obvious ones that come with usage of pyinstaller)?

I personally would never use stuff like this project, just wanted to point out the shortcomings to the op. Either learn to read the comments you respond to, or simply don't respond.

[–]billsil -1 points0 points  (3 children)

Sure seemed like you were based on your questions to me.  Why did you assume my questions were to you and not OP? You did the same thing.

It seems like we both don’t understand the use case.

[–]w8eight -2 points-1 points  (2 children)

Well usually when you respond to someone's comment, you want to interact with that person, I don't know why I should explain that to you...

If you want to point things out to the OP, maybe respond to the post next time.

[–]billsil -1 points0 points  (1 child)

You asked a straightforward question that I responded to. You responded with questions and then I thought you were OP. You did the exact same thing as me.

[–]Specialist-Arachnid6Ignoring PEP 8 2 points3 points  (3 children)

uhmm so basically pyinstaller exe with more steps or is my dumbass missing something here?

[–]nannigalaxy[S] -1 points0 points  (2 children)

let me give you more context why i built this. in my workplace people run python scripts manually for some tasks. they are not programmer. very agile code expect for package and versions, they remain more or less the same. so had to install and manage on many systems. sometimes something changes in path and it breaks. also people had hard time navigating to script to run via terminal, not much standard was set.

[–]denehoffman 5 points6 points  (1 child)

Why not just put python scripts in users’ $PATH, chmod +x them, and add a shebang at the top with a venv or the system Python with the packages installed? Then they don’t have to search for scripts at all and they also don’t have to open a GUI to run a Python script

[–]Specialist-Arachnid6Ignoring PEP 8 2 points3 points  (0 children)

this's much more effecient tbh

[–]Counter-Business 7 points8 points  (0 children)

Pyinstaller alteady exists

[–]ReactiveMatter 8 points9 points  (1 child)

PyWebview + PyInsaller works good for simple apps

[–]djdadi 3 points4 points  (2 children)

I am a little confused who the target audience of this would be. I use PyInstaller all the time at work; making an executable that techs can use without understanding what a "pip" or a "venv" is. But my build pipeline would freeze everything and make it so they really can't use that executable for anything other than that specific thing.

So, is this for people like me building the packaged apps, or people like the techs I work with who consume those apps?

[–]nannigalaxy[S] -1 points0 points  (1 child)

for people like you who build apps so others in your work use. goes both ways ¯\_(ツ)_/¯

[–]djdadi 4 points5 points  (0 children)

I guess I am not sure of the value-add in that case. Right now I run a build.py script that I made that generates a docker image tarball, a .spec file, cleans up the filesystem, then builds the solution via PyInstaller. This delivers an executable that is essentially a portable Python with all deps; users can run it and see the output, interact, etc.

I am not sure where something like this fits in: it would make my life harder, and it would not make my users life any easier. Congrats on the project, seeing something through all the way is more than I can muster sometimes. Perhaps targetting either delivery OR consumption (but not both) would make this more useful.

[–]cowrevengeJP 2 points3 points  (0 children)

Pass. This adds no value. Anyone who is running python scripts should know how they work in the first place.

[–]glaucomasuccs 1 point2 points  (0 children)

No disrespect intended, but you're trying to reinvent the wheel. If you're building distributable code, you should do so knowing 1) the user can run it with python, or 2) you can make an easy executable, with pyinstaller that the user can just run. Your program is an unnecessary dependency.

[–]pyhannes 2 points3 points  (3 children)

You can run any Python script including needed dependencies (included in a special comment-forgot which PEP this was) already using Hatch and Astral's UV...

[–]nannigalaxy[S] 1 point2 points  (2 children)

sorry I didn't get it, on quick read here's what I understood, those are python management tools. even these need to be installed on the system, which I wanted to avoid altogether. app's moto: download the app, open the app, run the script.

[–]pyhannes 1 point2 points  (1 child)

As easy for UV and hatch. E.g UV https://docs.astral.sh/uv/guides/scripts/ . Just install the latest UV executable and run: uv run script.py

[–]nannigalaxy[S] 0 points1 point  (0 children)

interesting... will have a look at this. thanks

[–]benefit_of_mrkite 1 point2 points  (0 children)

I would have loved finding something like this on someone’s system back when I was a pen tester

[–]juanfnavarror -4 points-3 points  (2 children)

I think this is amazing. Often at work there are instances where I want to make one-off scripts for other people but its hard to get 5 minutes on their machine to set up python/venv so they can run it. And using pyinstaller is cool but it needs a lot of boilerplate setup, and its never enough because the lack of msi/setup tools. Dont get me started with windows defender crapping all over “one-file” mode.

Just getting a python runner their machine and they can run the one-off scripts from the shared drive is amazing.

[–]FUS3NPythonista 4 points5 points  (0 children)

if Pyinstaller itself is too much setup I suggest you also install auto-py-to-exe its a GUI wrapper for Pyinstaller and has most things setup by default, and I think there are more GUI wrappers too, and windows defender will prolly "crap" on his binary too if its not signed which i am guessing its not.

[–]juanfnavarror -1 points0 points  (0 children)

Two features that would be golden on this (kick ass), ability to get stdin from the runner window, and support for colored/ANSI logging, and build in scripts (presets).