Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Ma Bell is a mean mother!


devel / comp.lang.python / RE: Windows installer from python source code without access to source code

SubjectAuthor
o RE: Windows installer from python source code without access toJim Schwartz

1
RE: Windows installer from python source code without access to source code

<mailman.1.1680810598.20750.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=22823&group=comp.lang.python#22823

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: jsch...@sbcglobal.net (Jim Schwartz)
Newsgroups: comp.lang.python
Subject: RE: Windows installer from python source code without access to
source code
Date: Thu, 6 Apr 2023 14:49:50 -0500
Lines: 142
Message-ID: <mailman.1.1680810598.20750.python-list@python.org>
References: <01a501d96709$b3f86f70$1be94e50$@sbcglobal.net>
<79F9B803-CE16-418C-B5CA-E88155DD42C5@barrys-emacs.org>
<00b201d968c0$f3c1e380$db45aa80$@sbcglobal.net>
Mime-Version: 1.0
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de p3VGAfWyZeuRMQt0GefBFw3jALlFDjE5IqLQPhPiJLtw==
Return-Path: <jschwar@sbcglobal.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=sbcglobal.net header.i=@sbcglobal.net header.b=qkRaVqgo;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'generated': 0.03;
'traceback': 0.04; '(most': 0.05; '2022': 0.05; '31,': 0.05;
'last):': 0.05; 'subject:python': 0.06; '2023': 0.07;
'subject:Windows': 0.07; 'subject:without': 0.07; 'bat': 0.09;
'c++.': 0.09; 'cc:addr:python-list': 0.09; 'compiler': 0.09;
'const': 0.09; 'installer': 0.09; 'int': 0.09; 'obviously,': 0.09;
'prompt.': 0.09; 'skip:_ 20': 0.09; 'snippets': 0.09; 'though.':
0.09; 'downloaded': 0.13; 'cc:no real name:2**0': 0.14;
'url:mailman': 0.15; '"hello,': 0.16; 'barry': 0.16; 'char': 0.16;
'command:': 0.16; 'compiled': 0.16; 'directory.': 0.16; 'dlls':
0.16; 'embeddable': 0.16; 'eryk': 0.16; 'executable': 0.16;
'extensions': 0.16; 'init': 0.16; 'program?': 0.16; 'script.':
0.16; 'static': 0.16; 'subject:code': 0.16; 'subject:source':
0.16; 'wrote:': 0.16; 'python': 0.16; 'developer': 0.16; 'code.':
0.17; 'reduce': 0.19; 'cc:addr:python.org': 0.20; 'written': 0.22;
"i've": 0.22; 'ran': 0.22; 'skip:_ 10': 0.22; 'version': 0.23;
'install': 0.23; 'code': 0.23; 'cc:2**1': 0.23; 'command': 0.23;
'installed': 0.23; 'run': 0.23; 'skip:- 10': 0.25; 'url-
ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24': 0.25;
'python,': 0.25; 'url:listinfo': 0.25; 'url-ip:188.166/16': 0.25;
'friday,': 0.26; 'library': 0.26; 'object': 0.26; 'visual': 0.26;
'creating': 0.27; 'etc': 0.28; 'example,': 0.28; 'requests': 0.28;
'environment': 0.29; 'skip:_ 40': 0.31; 'module': 0.31;
'program,': 0.31; 'community': 0.31; 'url-ip:188/8': 0.31;
'program': 0.31; "doesn't": 0.32; 'needed,': 0.32; 'but': 0.32;
"i'm": 0.33; 'there': 0.33; 'march': 0.33; 'script': 0.33;
'windows': 0.34; 'header:In-Reply-To:1': 0.34; 'particularly':
0.35; 'following': 0.35; 'received:66': 0.35; 'files': 0.36;
'source': 0.36; 'subject:from': 0.37; 'using': 0.37; 'file': 0.38;
'this,': 0.39; 'received:66.163': 0.39;
'received:consmr.mail.ne1.yahoo.com': 0.39; 'use': 0.39; 'prompt':
0.39; 'studio': 0.40; 'something': 0.40; 'hello,': 0.40; 'want':
0.40; 'from:': 0.62; 'to:': 0.62; 'skip:* 20': 0.62; 'here': 0.62;
'copy': 0.63; 'once': 0.63; 'skip:m 20': 0.63; 'hear': 0.64;
'complete': 0.64; 're:': 0.64; 'your': 0.64; 'named': 0.65;
'before,': 0.69; 'cc:': 0.69; 'skip:/ 10': 0.69; 'easy': 0.74;
'tools': 0.74; 'read,': 0.75; 'skip:f 20': 0.75; 'rights': 0.76;
'sent:': 0.78; '(c)': 0.81; 'reserved.': 0.81; 'copyright': 0.84;
'converted': 0.84; 'extracted': 0.84; 'optimizing': 0.84;
'incremental': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sbcglobal.net; s=s2048;
t=1680810595; bh=fj0NihtKdMSnH9H3Ux56Sx6Ad6dTVibEECpMk1HnW64=;
h=From:To:Cc:References:In-Reply-To:Subject:Date:From:Subject:Reply-To;
b=qkRaVqgoWQ92nv7l0QRC7JPogwMb70K8FLA6Fbtd38Y5WuIkU8lESaVQST5TrzYFa6JaaLHWzFBET8m9z5EoURbkigsPy04bvJP+w9QjeU3cHB4bDKtZ0cJ1fFdLce4VdQ8WWLVzCCXcAPyMU/o8BEBxzGAOkGXI65tDrO7tlCXSZpJI1BCYgbaxsrI4nh/OHzuZkUmBvMcdmxnyZqMk/ylMTctKINz3l+MahevCtB07Jcq+jTTn6hAEMjZ4IjEjiwzoS3HjRug3VbtCulw6LqcXdFCioYMjExe0gBzaaqyL1tkZeG8jDR2y1ScPcCkPeLHIuijUKD744/NEU4E90A==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
t=1680810595; bh=xK4cOiD+QURdcwoPNxV3OiBTrvHfnIZ816+bW7oudTV=;
h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
b=dmXoYiyJu12SBy2naVQA6rfQGb2Qi5uKPUIZW6l9E2fqFi4XOsd6dZsm2NzYj2emjQR5Z86uMKZGXd3Zc1Eg2E9oJ1I2gaf43sppjC+QgZY6GxzHnm/YDpLDE/SmRYa4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7PKfXM1uvUlpeaEGZZNblW4ShcuHG8uCE63Is072cuXvsXrr_qXYl2XoIedlFmJ_CC6PEGi
xajJWTvbRlfMu2aS_LrtgnwpeJb3OBf5zg83NX1mSgiL0TYVIXavy665J8G8LKgx5ektRd6jD9ia
et7WHEYA2W5_lNkoNrYnVe0DOeaYC0wSNL5FJgUBpxbzzsW1TtVNBwlfNT_mz0EJrIyEnJFM9uZ6
I5SIGULBBi4ug75SjpzG.5JrN9syawqHaf6vm1pVsYckxnCXOs61KSNol6LzKXppqAVDlzd0lQ15
qOmRQR3phNFlQB_ez6tiVWq5C3eMdPYSNibD2_Di.nIDtJVeM5S9iq151EMuAd2ZWSZHEARGIxnY
S9yAL7smbhdalrF0HPCxZ5l7cswBee83.V4FkOfS06i4rzN7r.86yRCiGoxQz5l1vfxmBEQ--
X-Sonic-MF: <jschwar@sbcglobal.net>
X-Sonic-ID: 0cbe14b2-8ef1-4be4-8393-9b155c514f2e
In-Reply-To: <79F9B803-CE16-418C-B5CA-E88155DD42C5@barrys-emacs.org>
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQFNWpe1KsKglJvcDU6kKmTKoTDlSgIL4GvZsCZsnAA=
Content-Language: en-us
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <00b201d968c0$f3c1e380$db45aa80$@sbcglobal.net>
X-Mailman-Original-References: <01a501d96709$b3f86f70$1be94e50$@sbcglobal.net>
<79F9B803-CE16-418C-B5CA-E88155DD42C5@barrys-emacs.org>
 by: Jim Schwartz - Thu, 6 Apr 2023 19:49 UTC

I downloaded VS community 2022 and I know how to access the developer command prompt. I'm using the one called x64 Native Tools Command Prompt for VS 2022

I ran a command to compile my python code that was converted to c with the following command:

H:\Users\LindaJim\Documents\SourceCode\Software\aws_pc_backup\src\c>cl /O2 /I"C:\\Users\\jschw\\AppData\\Local\\Programs\\Python\\Python3112\\include\\" aws_pc_backup.c C:\\Users\\jschw\\AppData\\Local\\Programs\\Python\\Python3112\\libs\\python311.lib
Microsoft (R) C/C++ Optimizing Compiler Version 19.35.32216.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

aws_pc_backup.c
Microsoft (R) Incremental Linker Version 14.35.32216.1
Copyright (C) Microsoft Corporation. All rights reserved.

/out:aws_pc_backup.exe
aws_pc_backup.obj
C:\\Users\\jschw\\AppData\\Local\\Programs\\Python\\Python3112\\libs\\python311.lib
Creating library aws_pc_backup.lib and object aws_pc_backup.exp

When I ran the program, I got this, though. Obviously, it doesn't know about the requests package. Do I have to link something in with the executable?

H:\Users\LindaJim\Documents\SourceCode\Software\aws_pc_backup\src\c>aws_pc_backup.exe -m:lb
Traceback (most recent call last):
File "src\\python\\aws_pc_backup_main.py", line 7, in init python.aws_pc_backup_main
ModuleNotFoundError: No module named 'requests'

-----Original Message-----
From: Barry <barry@barrys-emacs.org>
Sent: Tuesday, April 4, 2023 1:25 PM
To: Jim Schwartz <jschwar@sbcglobal.net>
Cc: Eryk Sun <eryksun@gmail.com>; python-list@python.org
Subject: Re: Windows installer from python source code without access to source code

> On 4 Apr 2023, at 16:28, Jim Schwartz <jschwar@sbcglobal.net> wrote:
>
> Where can I download that cl program? I've used gcc before, but I hear that cl can use a setup.py program to run the compile and link and create a windows .msi installer. Is that true?

It is part of visual studio C++.
Once you have that installed there are bat files that setup environment in the terminal.
Then you can use cl, nmake etc

Barry
>
> -----Original Message-----
> From: Eryk Sun <eryksun@gmail.com>
> Sent: Friday, March 31, 2023 12:55 PM
> To: Jim Schwartz <jschwar@sbcglobal.net>
> Cc: python-list@python.org
> Subject: Re: Windows installer from python source code without access
> to source code
>
>> On 3/31/23, Jim Schwartz <jschwar@sbcglobal.net> wrote:
>> I want a windows installer to install my application that's written
>> in python, but I don't want the end user to have access to my source code.
>
> Cython can compile a script to C source code for a module or executable (--embed). The source can be compiled and linked normally.
> For example, the following builds a "hello.exe" executable based on a "hello.py" script.
>
>> cython -3 --embed hello.py
>> set "PYI=C:\Program Files\Python311\include"
>> set "PYL=C:\Program Files\Python311\libs"
>> cl /I"%PYI%" hello.c /link /libpath:"%PYL%"
>> copy hello.exe embed
>> embed\hello.exe
> Hello, World!
>
> I extracted the complete embeddable distribution of Python 3.11 into the "embed" directory. You can reduce the size of the installation, if needed, by minimizing the zipped standard library and removing pyd extensions and DLLs that your application doesn't use.
>
> The generated "hello.c" is large and not particularly easy to read, but here are some snippets [...]:
>
> [...]
> /* Implementation of 'hello' */
> static PyObject *__pyx_builtin_print;
> static const char __pyx_k_main[] = "__main__";
> static const char __pyx_k_name[] = "__name__";
> static const char __pyx_k_test[] = "__test__";
> static const char __pyx_k_print[] = "print";
> static const char __pyx_k_Hello_World[] = "Hello, World!";
> [...]
> /* "hello.py":1
> * print("Hello, World!") # <<<<<<<<<<<<<<
> */
> __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Hello_World);
> if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 1, __pyx_L1_error)
> [...]
> /* "hello.py":1
> * print("Hello, World!") # <<<<<<<<<<<<<<
> */
> __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple_,
> NULL);
> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
> [...]
> int wmain(int argc, wchar_t **argv) {
> [...]
> if (argc && argv)
> Py_SetProgramName(argv[0]);
> Py_Initialize();
> if (argc && argv)
> PySys_SetArgv(argc, argv);
> [...]
> m = PyInit_hello();
> [...]
> if (Py_FinalizeEx() < 0)
> return 2;
> [...]
> return 0;
> [...]
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor