Re: How to run self-contained Python scripts who don't need Python installation?

2017-06-09 Thread Akira Li
"Juan C."  writes:

> I need to run some Python 3.6.0 scripts on the users' machines (W7 and
> W10) in an enterprise environment, but I can't install Python on those
> machines. I tried looking for those "py to exe", but sadly they don't
> support Python 3.6.0.

I've tried PyInstaller (development version) and it works with Python 3.6:

  $ py -3.6 -m pip install 
https://github.com/pyinstaller/pyinstaller/archive/develop.zip

From
https://www.reddit.com/r/Python/comments/6fpr70/how_do_i_distribute_a_py_file_and_its/


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to run self-contained Python scripts who don't need Python installation?

2017-06-08 Thread Michael Torrie
On 06/08/2017 07:40 PM, Juan C. wrote:
> 2. I'd like to create a simple BAT to run my Python script, so there
> would be only 2 things (a 'dist' folder with everything and a run.bat
> to make it clear what should be run), for example:

Sure you can. You just have to do it like this (untested; I haven't used
Windows in many years):

@echo off

start %~dp0dist\python-3.6.0-embed-win32\python.exe %~dp0dist\app.py %*

I think %* expands to all the commandline parameters, apparently
excluding %0, which would be the command name itself.





-- 
https://mail.python.org/mailman/listinfo/python-list


How to run self-contained Python scripts who don't need Python installation?

2017-06-08 Thread Juan C.
I need to run some Python 3.6.0 scripts on the users' machines (W7 and
W10) in an enterprise environment, but I can't install Python on those
machines. I tried looking for those "py to exe", but sadly they don't
support Python 3.6.0. Then I found out about "Windows x86/x86-64
embeddable zip file" that Python.org made available since 3.5.0, and I
thought it would be the right thing for my case.

I have some questions regarding embeddable Python:

1. How can I install custom modules using pip?

2. I'd like to create a simple BAT to run my Python script, so there
would be only 2 things (a 'dist' folder with everything and a run.bat
to make it clear what should be run), for example:
@echo off
start %~dp0dist\python-3.6.0-embed-win32\python.exe %~dp0dist\app.py

The issue is that I can't parse args to app.py in this case. How would
that be possible? In the example above, if Python was fully installed,
I would give a file as argument to app.py, generally clicking and
dragging the file into the app.py icon so that it would start.

3. Is there a better approach for my case other than embedded Python?
-- 
https://mail.python.org/mailman/listinfo/python-list