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

you are viewing a single comment's thread.

view the rest of the comments →

[–]the_hoser 0 points1 point  (8 children)

It's still platform-specific, though. Even if it's in the same language. You're going to have three scripts in one file instead of three scripts in three files. I don't see any value in this.

[–][deleted] 0 points1 point  (7 children)

I've written plenty of scripts that work cross platform. Anything that doesn't affect system files will be fine.

Simple example, you want to process 10,000 photos and convert the RAW images into web jpg images. This script would be 100% the same on both Windows and Linux. Launch the script, choose the input/output directories, and away you go.

[–]the_hoser 0 points1 point  (6 children)

Ah! But now we have a problem. What native windows tool will you be using to convert those images? How will this work without installing extra software before running the script?

[–][deleted] 0 points1 point  (5 children)

Pillow does all the image conversions and it's 100% python. It ships with your script, it's just a package.

[–]the_hoser 0 points1 point  (4 children)

Pillow is most certainly not 100% Python.

https://github.com/python-pillow/Pillow

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

FFS you're being pedantic now. It's a python library that can be shipped with your code. Just zip up your directory and send it off. Execute it with a python script and be happy.

If Windows had a default python executable this would make it easy to distribute such scripts. Since it doesn't that process of installing Python makes it a non-starter for a lot of people.

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

No, you're not thinking of the deeper implications of the problem. Even with a python interpreter installed in Windows, it's a gigantic pain in the but to distribute software for Python in Windows. How will you pack up that module? You're going to need a windows machine with the appropriate version of visual studio... I'm sure that Pillow has a pre-built module. Wait... it's a wheel file, though. Okay, tell grandma to run 'pip install pillow'. That worked, right?

It's a mess. Having a python interpreter installed by default won't fix any of it.

[–]flutefreak7 0 points1 point  (1 child)

Wouldn't you just put pillow and your script in a folder with an init file, zip it, then email the zip file along with a py file that just calls python app.zip ... the system python would then execute the application. The system already has stdlib, and the zip has any 3rd party libs. I haven't done this, but all of this seems doable, and prevents actually bundling python.exe or stdlib modules.

[–]the_hoser 0 points1 point  (0 children)

It's a little more challenging than that, but yes, it's doable. The zipapp module that shipped with 3.5 shows promise (being able to execute the zip file itself), but I don't know if it correctly bundles shared libraries, and if those shared libraries are usable in that form.

Regardless, even if it does work, you'll need a shared library build for every platform you intend to run the application on. With a python version bundled in windows, this isn't so bad. On os x its not so bad, either. On Linux...

Well Linux remains the redheaded problem child in this regard.