How to set environmental variables for Python

2022-01-17 Thread Shaozhong SHI
I got quite a few version of Python on my machine.

How do I set environmental variables for Python 3.6.1 to work?

Regards,

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


Re: How to set environmental variables for Python

2022-01-17 Thread dn via Python-list
On 17/01/2022 22.31, Shaozhong SHI wrote:
> I got quite a few version of Python on my machine.
> 
> How do I set environmental variables for Python 3.6.1 to work?


Set from Python, or set in the OpSys?

https://docs.python.org/3/library/os.html?highlight=environment%20variable

MS-Win: https://docs.python.org/3/using/windows.html#setting-envvars
-- 
Regards,
=dn
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to set environmental variables for Python

2022-01-17 Thread Shaozhong SHI
Set Operation System but not disturbing existing setting.  Only to add at
the command line.

Regards,

David

On Mon, 17 Jan 2022 at 10:57, dn via Python-list 
wrote:

> On 17/01/2022 22.31, Shaozhong SHI wrote:
> > I got quite a few version of Python on my machine.
> >
> > How do I set environmental variables for Python 3.6.1 to work?
>
>
> Set from Python, or set in the OpSys?
>
> https://docs.python.org/3/library/os.html?highlight=environment%20variable
>
> MS-Win: https://docs.python.org/3/using/windows.html#setting-envvars
> --
> Regards,
> =dn
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


About Python Compressed Archive or Binaries

2022-01-17 Thread Sina Mobasheri
Java offers download JDK as Compressed Archive or NodeJS offers download Node 
as Binaries both give us a compressed file for Linux and windows that we can 
just unzipped it and put in a custom directory and set some environment 
variables and start working


I'm aware that Python also have something called Embedded Zip for Windows and 
nothing like that for Linux as far as I know, and I think this Embedded Zip is 
not something that the user wants to work with that directly it's for embedding 
in a C++ application, so it's not the same as options that Java and NodeJS 
offering


My question is why is Python haven't an option for downloading as Compressed 
Archive?
Is it's due to a technical issue? political reasons? or is it just simply 
because nobody has thought of doing it?

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


Re: What to write or search on github to get the code for what is written below:

2022-01-17 Thread NArshad
Avi Gross:

-“They just were hoping someone would post complete code and they could then 
move on without learning anything.”

This is due to the time factor
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: About Python Compressed Archive or Binaries

2022-01-17 Thread Chris Angelico
On Tue, Jan 18, 2022 at 2:42 AM Sina Mobasheri
 wrote:
>
> Java offers download JDK as Compressed Archive or NodeJS offers download Node 
> as Binaries both give us a compressed file for Linux and windows that we can 
> just unzipped it and put in a custom directory and set some environment 
> variables and start working
>
>
> I'm aware that Python also have something called Embedded Zip for Windows and 
> nothing like that for Linux as far as I know, and I think this Embedded Zip 
> is not something that the user wants to work with that directly it's for 
> embedding in a C++ application, so it's not the same as options that Java and 
> NodeJS offering
>
>
> My question is why is Python haven't an option for downloading as Compressed 
> Archive?
> Is it's due to a technical issue? political reasons? or is it just simply 
> because nobody has thought of doing it?
>

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

:)

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


Re: About Python Compressed Archive or Binaries

2022-01-17 Thread Chris Angelico
On Tue, Jan 18, 2022 at 2:47 AM Chris Angelico  wrote:
>
> On Tue, Jan 18, 2022 at 2:42 AM Sina Mobasheri
>  wrote:
> >
> > Java offers download JDK as Compressed Archive or NodeJS offers download 
> > Node as Binaries both give us a compressed file for Linux and windows that 
> > we can just unzipped it and put in a custom directory and set some 
> > environment variables and start working
> >
> >
> > I'm aware that Python also have something called Embedded Zip for Windows 
> > and nothing like that for Linux as far as I know, and I think this Embedded 
> > Zip is not something that the user wants to work with that directly it's 
> > for embedding in a C++ application, so it's not the same as options that 
> > Java and NodeJS offering
> >
> >
> > My question is why is Python haven't an option for downloading as 
> > Compressed Archive?
> > Is it's due to a technical issue? political reasons? or is it just simply 
> > because nobody has thought of doing it?
> >

Premature send, oops.

That's already possible: https://docs.python.org/3/library/zipapp.html :)

Alternatively, if you mean the CPython binary itself, then that is
available in a number of formats, so I'm not sure what you're asking
about in that case.

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


Re: What to write or search on github to get the code for what is written below:

2022-01-17 Thread Chris Angelico
On Tue, Jan 18, 2022 at 2:46 AM NArshad  wrote:
>
> Avi Gross:
>
> -“They just were hoping someone would post complete code and they could then 
> move on without learning anything.”
>
> This is due to the time factor

Then pay someone to write it. There are plenty of contractors out
there. You can't expect this list to be a free consulting programmer
for you.

I strongly encourage everyone to stop helping the OP until there's
some code to help with.

(I'm not surprised, given that the original request was basically
"what should I search for to magically find what I want".)

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


Why There Is No Python Compressed Archive or Binaries ?

2022-01-17 Thread Sina Mobasheri
Java offers download JDK as Compressed 
Archive or 
NodeJS offers download Node as 
Binaries both give us a compressed 
file for Linux and windows that we can just unzipped it and put in a custom 
directory and set some environment variables and start working

I'm aware that Python also have something called Embedded 
Zip for 
Windows and nothing like that for Linux as far as I know, and I think this 
Embedded Zip is not something that user wants to work with that directly it's 
for embedding in a C++ application, so it's not the same as options that Java 
and NodeJS offers

My question is why Python hasn't option for downloading as Compressed Archive ?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why There Is No Python Compressed Archive or Binaries ?

2022-01-17 Thread Grant Edwards
On 2022-01-17, Sina Mobasheri  wrote:
> Java offers download JDK...
> [...]
> My question is why Python hasn't option for downloading as
> Compressed Archive ?

Isn't that what the installers are?

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


Re: What to write or search on github to get the code for what is written below:

2022-01-17 Thread Dennis Lee Bieber
On Tue, 18 Jan 2022 02:51:22 +1100, Chris Angelico 
declaimed the following:

>
>I strongly encourage everyone to stop helping the OP until there's
>some code to help with.
>
Well, we did squeeze about four lines of code from the OP -- though
still incomplete (no import statements so we have to research what 3rd
party module the OP might be invoking -- and they seem to have totally
skipped direct usage of an module for reading Excel format files in favor
of loading the massive pandas package [with its need for those direct
reading modules along with SciPy/NumPy -- does it also load matplotlib?]).

>(I'm not surprised, given that the original request was basically
>"what should I search for to magically find what I want".)

To which the closest viable response I've extracted is to Google

python library management system

(presuming Python is a firm requirement). Of course all of those have the
problems

1A  They use an RDBM (most examples seem to be 
MySQL based,
though SQLite3 might show up in some)
1B  No sign of Excel spreadsheets anywhere

2A  They handle adding/removing books from the 
inventory
(permanent actions), along with
2B  Check-out/Check-in of books from the inventory 
(OP seems to
only focus on Check-out/Reservation)
2C  They may even track who is allowed to run the 
application
(staff only... for all functions or just some, etc.)

3   Every copy of a book is an individual record in 
the
database -- if there are 30 copies of a book, there are 30 records for it,
and each copy can only have one check-out at a time; no "decrement" of a
"number available".

4   Some are local/desktop applications using Qt or 
similar GUI
framework, others might be web-based but likely not Flask


{And, from my personal viewpoint, they may be using SQLAlchemy... I
have the O'Reilly text for that, and find it still makes no sense to me...
I can code direct SQL queries faster than trying to figure out the
equivalent functionality in SQLAlchemy... And if the OP has a fixation on
spreadsheet views of the data, SQLAlchemy will really be a mystery.

}


-- 
Wulfraed Dennis Lee Bieber AF6VN
wlfr...@ix.netcom.comhttp://wlfraed.microdiversity.freeddns.org/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why There Is No Python Compressed Archive or Binaries ?

2022-01-17 Thread Dennis Lee Bieber
On Mon, 17 Jan 2022 08:07:07 -0800 (PST), Grant Edwards
 declaimed the following:

>On 2022-01-17, Sina Mobasheri  wrote:
>> Java offers download JDK...
>> [...]
>> My question is why Python hasn't option for downloading as
>> Compressed Archive ?
>
>Isn't that what the installers are?

I get the impression they are looking for a zero-install option... IE:
unpack onto a USB flash drive, take to another computer, and just be able
to run from the flash drive without needing to fiddle with PATH, registry,
etc. A way to run Python on shared (library) computers that may not have it
installed, and for which users have no ability to install applications.


-- 
Wulfraed Dennis Lee Bieber AF6VN
wlfr...@ix.netcom.comhttp://wlfraed.microdiversity.freeddns.org/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why There Is No Python Compressed Archive or Binaries ?

2022-01-17 Thread Grant Edwards
On 2022-01-17, Dennis Lee Bieber  wrote:
> On Mon, 17 Jan 2022 08:07:07 -0800 (PST), Grant Edwards
> declaimed the following:
>
>>On 2022-01-17, Sina Mobasheri  wrote:
>>> Java offers download JDK...
>>> [...]
>>> My question is why Python hasn't option for downloading as
>>> Compressed Archive ?
>>
>>Isn't that what the installers are?
>
>   I get the impression they are looking for a zero-install option... IE:
> unpack onto a USB flash drive, take to another computer, and just be able
> to run from the flash drive without needing to fiddle with PATH, registry,
> etc.

OK, I see.

> A way to run Python on shared (library) computers that may not have it
> installed, and for which users have no ability to install applications.

I guess I don't know enough about Windows to comment. I've packaged
apps for Windows that include the Python interpreter and libs, but
they still need to be "installed".

--
Grant


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


Re: What to write or search on github to get the code for what is written below:

2022-01-17 Thread Avi Gross via Python-list

I can appreciate people under time pressure wanting the job DONE first and 
maybe learning more after. So, yes, it makes perfect sense to delegate the task 
to others with expertise or ask for advice.
This forum may mean many things to many people but for me, it is a place to 
offer guidance and small amounts of help as a voluntary activity. Doing a major 
project for free is not necessarily why I am here. I prefer being hired and 
compensated, LOL!
But I share the frustration when someone dumps an ill-defined project on you 
without realizing what they handed you is an old application that cannot 
trivially be shifted into something new without serious effort and preparation.
The feedback here has included suggestions that we were shown only a part of 
the task needed and that it would be a good idea to not even try to keep your 
data in some EXCEL format if it was used heavily in ways perhaps never 
intended. Obviously, feeling urgency to do something quickly will make it hard 
to accept our suggestions, but nonetheless, a request here, as has been pointed 
out, should anticipate a python-oriented answer. Asking us here to make a set 
of macros for EXCEL to do this task would be inappropriate. Some are suggesting 
that a solution that keeps reading and writing to an EXCEL file for each 
transaction is also not necessarily a great design.
I think your answer makes me amend what I wrote. I grant you may be interested 
in learning but due to the press of time, you want a working set of software 
first.
Good luck with that. 

-Original Message-
From: NArshad 
To: python-list@python.org
Sent: Mon, Jan 17, 2022 4:55 am
Subject: Re: What to write or search on github to get the code for what is 
written below:

Avi Gross:

-“They just were hoping someone would post complete code and they could then 
move on without learning anything.”

This is due to the time factor
-- 
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: About Python Compressed Archive or Binaries

2022-01-17 Thread Kirill Ratkin

Hi,

Yes, this is good question for Windows users.

Of course, you can download installer exe-file -> do installation -> 
pack directory with python interpreter to zip (for example, or 7z) -> 
copy archive file to another place/computer and unpack.


But it will not work out of box because original installer modifies 
resources in MZ file and path to stdlib is there.


So just to use interpreter from that archive file you need to open 
python.exe file and fix it (in any binary/hex editor).


This simple procedure but ... anyway ... I agree with Sina.

It would be nice to have just zip file with python interpreter (not 
executable installer), unpack it anywhere, add path  to this 'anywhere' 
to PATH, and use it.


Java/DotNet/Go have this option. But python - not.

And question is - why?


On 1/17/22 18:37, Sina Mobasheri wrote:

Java offers download JDK as Compressed Archive or NodeJS offers download Node 
as Binaries both give us a compressed file for Linux and windows that we can 
just unzipped it and put in a custom directory and set some environment 
variables and start working


I'm aware that Python also have something called Embedded Zip for Windows and 
nothing like that for Linux as far as I know, and I think this Embedded Zip is 
not something that the user wants to work with that directly it's for embedding 
in a C++ application, so it's not the same as options that Java and NodeJS 
offering


My question is why is Python haven't an option for downloading as Compressed 
Archive?
Is it's due to a technical issue? political reasons? or is it just simply 
because nobody has thought of doing it?


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


Re: Why There Is No Python Compressed Archive or Binaries ?

2022-01-17 Thread Calvin Spealman
I maintain a small project that provides this, a drop-in Python runtime you
can ship without installation called Feet. Get it? It makes Python run.

https://github.com/ironfroggy/feet

On Mon, Jan 17, 2022 at 11:16 AM Sina Mobasheri 
wrote:

> Java offers download JDK as Compressed Archive<
> https://www.oracle.com/java/technologies/downloads/#jdk17-linux> or
> NodeJS offers download Node as Binaries<
> https://nodejs.org/en/download/current/> both give us a compressed file
> for Linux and windows that we can just unzipped it and put in a custom
> directory and set some environment variables and start working
>
> I'm aware that Python also have something called Embedded Zip<
> https://www.python.org/ftp/python/3.10.1/python-3.10.1-embed-amd64.zip>
> for Windows and nothing like that for Linux as far as I know, and I think
> this Embedded Zip is not something that user wants to work with that
> directly it's for embedding in a C++ application, so it's not the same as
> options that Java and NodeJS offers
>
> My question is why Python hasn't option for downloading as Compressed
> Archive ?
> --
> https://mail.python.org/mailman/listinfo/python-list
>
>

-- 

CALVIN SPEALMAN

SENIOR QUALITY ENGINEER

calvin.speal...@redhat.com  M: +1.336.210.5107
[image: https://red.ht/sig] 
TRIED. TESTED. TRUSTED. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why There Is No Python Compressed Archive or Binaries ?

2022-01-17 Thread Sina Mobasheri
It's cool project definitely something that I'm personally interested about, 
but I talking about compressed archive of cpython that we can simply unzipped 
and starting developing an app, not running  an app that already developed... 😀

From: Calvin Spealman 
Sent: Monday, January 17, 2022 10:19:13 PM
To: Sina Mobasheri 
Cc: python-list@python.org 
Subject: Re: Why There Is No Python Compressed Archive or Binaries ?

I maintain a small project that provides this, a drop-in Python runtime you can 
ship without installation called Feet. Get it? It makes Python run.

https://github.com/ironfroggy/feet

On Mon, Jan 17, 2022 at 11:16 AM Sina Mobasheri 
mailto:sinamobash...@outlook.com>> wrote:
Java offers download JDK as Compressed 
Archive or 
NodeJS offers download Node as 
Binaries both give us a compressed 
file for Linux and windows that we can just unzipped it and put in a custom 
directory and set some environment variables and start working

I'm aware that Python also have something called Embedded 
Zip for 
Windows and nothing like that for Linux as far as I know, and I think this 
Embedded Zip is not something that user wants to work with that directly it's 
for embedding in a C++ application, so it's not the same as options that Java 
and NodeJS offers

My question is why Python hasn't option for downloading as Compressed Archive ?
--
https://mail.python.org/mailman/listinfo/python-list



--

CALVIN SPEALMAN

SENIOR QUALITY ENGINEER

calvin.speal...@redhat.com  M: 
+1.336.210.5107

[https://red.ht/sig]
TRIED. TESTED. TRUSTED.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: About Python Compressed Archive or Binaries

2022-01-17 Thread Sina Mobasheri
That's exactly what I mean thank you 👌🏻🚀

From: Python-list  on 
behalf of Kirill Ratkin 
Sent: Monday, January 17, 2022 9:19:44 PM
To: python-list@python.org 
Subject: Re: About Python Compressed Archive or Binaries

Hi,

Yes, this is good question for Windows users.

Of course, you can download installer exe-file -> do installation ->
pack directory with python interpreter to zip (for example, or 7z) ->
copy archive file to another place/computer and unpack.

But it will not work out of box because original installer modifies
resources in MZ file and path to stdlib is there.

So just to use interpreter from that archive file you need to open
python.exe file and fix it (in any binary/hex editor).

This simple procedure but ... anyway ... I agree with Sina.

It would be nice to have just zip file with python interpreter (not
executable installer), unpack it anywhere, add path  to this 'anywhere'
to PATH, and use it.

Java/DotNet/Go have this option. But python - not.

And question is - why?


On 1/17/22 18:37, Sina Mobasheri wrote:
> Java offers download JDK as Compressed Archive or NodeJS offers download Node 
> as Binaries both give us a compressed file for Linux and windows that we can 
> just unzipped it and put in a custom directory and set some environment 
> variables and start working
>
>
> I'm aware that Python also have something called Embedded Zip for Windows and 
> nothing like that for Linux as far as I know, and I think this Embedded Zip 
> is not something that the user wants to work with that directly it's for 
> embedding in a C++ application, so it's not the same as options that Java and 
> NodeJS offering
>
>
> My question is why is Python haven't an option for downloading as Compressed 
> Archive?
> Is it's due to a technical issue? political reasons? or is it just simply 
> because nobody has thought of doing it?
>
--
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why There Is No Python Compressed Archive or Binaries ?

2022-01-17 Thread Calvin Spealman
Well, on its own, I'd say the reason we don't have such a download is that
it wouldn't be very useful.

On Mon, Jan 17, 2022 at 2:08 PM Sina Mobasheri 
wrote:

> It's cool project definitely something that I'm personally interested
> about, but I talking about compressed archive of cpython that we can simply
> unzipped and starting developing an app, not running  an app that already
> developed... 😀
> --
> *From:* Calvin Spealman 
> *Sent:* Monday, January 17, 2022 10:19:13 PM
> *To:* Sina Mobasheri 
> *Cc:* python-list@python.org 
> *Subject:* Re: Why There Is No Python Compressed Archive or Binaries ?
>
> I maintain a small project that provides this, a drop-in Python runtime
> you can ship without installation called Feet. Get it? It makes Python run.
>
> https://github.com/ironfroggy/feet
>
> On Mon, Jan 17, 2022 at 11:16 AM Sina Mobasheri 
> wrote:
>
> Java offers download JDK as Compressed Archive<
> https://www.oracle.com/java/technologies/downloads/#jdk17-linux> or
> NodeJS offers download Node as Binaries<
> https://nodejs.org/en/download/current/> both give us a compressed file
> for Linux and windows that we can just unzipped it and put in a custom
> directory and set some environment variables and start working
>
> I'm aware that Python also have something called Embedded Zip<
> https://www.python.org/ftp/python/3.10.1/python-3.10.1-embed-amd64.zip>
> for Windows and nothing like that for Linux as far as I know, and I think
> this Embedded Zip is not something that user wants to work with that
> directly it's for embedding in a C++ application, so it's not the same as
> options that Java and NodeJS offers
>
> My question is why Python hasn't option for downloading as Compressed
> Archive ?
> --
> https://mail.python.org/mailman/listinfo/python-list
>
>
>
> --
>
> CALVIN SPEALMAN
>
> SENIOR QUALITY ENGINEER
>
> calvin.speal...@redhat.com  M: +1.336.210.5107
> [image: https://red.ht/sig] 
> TRIED. TESTED. TRUSTED. 
>


-- 

CALVIN SPEALMAN

SENIOR QUALITY ENGINEER

calvin.speal...@redhat.com  M: +1.336.210.5107
[image: https://red.ht/sig] 
TRIED. TESTED. TRUSTED. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why There Is No Python Compressed Archive or Binaries ?

2022-01-17 Thread Sina Mobasheri
Consider scenario that I want run python 3.10 in CentOS 8, I think last python 
version in CentOS repository is 3.6, if I use epel I can get 3.8 so ..., I 
think (correct me if I'm wrong 🙏🏻) the only way that I can run python 3.10 is 
to compile it manually, which is need to know what dependencies python needs 
for compilation ... (different distribution different packages, which packages 
for what, you can see that it is intimidating for beginners like me)
It's useful to just use wget , 
unzipped, ser path and ta-da you have cpython 3.10 in CentOS 8

This is Linux specific use case that I can think of, I'm sure there are plenty 
for windows, consider scenario that I wrote script for scraping some site and 
entered in some excel worksheet I can simply ship cpython with my script to 
clients machine and there is no need that client install cpython by himself...

Sorry about my bad grammar

From: Calvin Spealman 
Sent: Monday, January 17, 2022, 22:53
To: Sina Mobasheri
Cc: python-list@python.org
Subject: Re: Why There Is No Python Compressed Archive or Binaries ?

Well, on its own, I'd say the reason we don't have such a download is that it 
wouldn't be very useful.

On Mon, Jan 17, 2022 at 2:08 PM Sina Mobasheri 
mailto:sinamobash...@outlook.com>> wrote:
It's cool project definitely something that I'm personally interested about, 
but I talking about compressed archive of cpython that we can simply unzipped 
and starting developing an app, not running  an app that already developed... 😀

From: Calvin Spealman mailto:cspea...@redhat.com>>
Sent: Monday, January 17, 2022 10:19:13 PM
To: Sina Mobasheri mailto:sinamobash...@outlook.com>>
Cc: python-list@python.org 
mailto:python-list@python.org>>
Subject: Re: Why There Is No Python Compressed Archive or Binaries ?

I maintain a small project that provides this, a drop-in Python runtime you can 
ship without installation called Feet. Get it? It makes Python run.

https://github.com/ironfroggy/feet

On Mon, Jan 17, 2022 at 11:16 AM Sina Mobasheri 
mailto:sinamobash...@outlook.com>> wrote:
Java offers download JDK as Compressed 
Archive or 
NodeJS offers download Node as 
Binaries both give us a compressed 
file for Linux and windows that we can just unzipped it and put in a custom 
directory and set some environment variables and start working

I'm aware that Python also have something called Embedded 
Zip for 
Windows and nothing like that for Linux as far as I know, and I think this 
Embedded Zip is not something that user wants to work with that directly it's 
for embedding in a C++ application, so it's not the same as options that Java 
and NodeJS offers

My question is why Python hasn't option for downloading as Compressed Archive ?
--
https://mail.python.org/mailman/listinfo/python-list



--

CALVIN SPEALMAN

SENIOR QUALITY ENGINEER

calvin.speal...@redhat.com  M: 
+1.336.210.5107

[https://red.ht/sig]
TRIED. TESTED. TRUSTED.


--

CALVIN SPEALMAN

SENIOR QUALITY ENGINEER

calvin.speal...@redhat.com  M: 
+1.336.210.5107

[https://red.ht/sig]
TRIED. TESTED. TRUSTED.

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


Re: Why There Is No Python Compressed Archive or Binaries ?

2022-01-17 Thread Antoon Pardon

You could try miniconda.

Op 17/01/2022 om 20:53 schreef Sina Mobasheri:

Consider scenario that I want run python 3.10 in CentOS 8, I think last python 
version in CentOS repository is 3.6, if I use epel I can get 3.8 so ..., I 
think (correct me if I'm wrong 🙏🏻) the only way that I can run python 3.10 is 
to compile it manually, which is need to know what dependencies python needs 
for compilation ... (different distribution different packages, which packages 
for what, you can see that it is intimidating for beginners like me)
It's useful to just use wget , 
unzipped, ser path and ta-da you have cpython 3.10 in CentOS 8

This is Linux specific use case that I can think of, I'm sure there are plenty 
for windows, consider scenario that I wrote script for scraping some site and 
entered in some excel worksheet I can simply ship cpython with my script to 
clients machine and there is no need that client install cpython by himself...

Sorry about my bad grammar

From: Calvin Spealman 
Sent: Monday, January 17, 2022, 22:53
To: Sina Mobasheri
Cc: python-list@python.org
Subject: Re: Why There Is No Python Compressed Archive or Binaries ?

Well, on its own, I'd say the reason we don't have such a download is that it 
wouldn't be very useful.

On Mon, Jan 17, 2022 at 2:08 PM Sina Mobasheri 
mailto:sinamobash...@outlook.com>> wrote:
It's cool project definitely something that I'm personally interested about, 
but I talking about compressed archive of cpython that we can simply unzipped 
and starting developing an app, not running  an app that already developed... 😀

From: Calvin Spealman mailto:cspea...@redhat.com>>
Sent: Monday, January 17, 2022 10:19:13 PM
To: Sina Mobasheri mailto:sinamobash...@outlook.com>>
Cc: python-list@python.org 
mailto:python-list@python.org>>
Subject: Re: Why There Is No Python Compressed Archive or Binaries ?

I maintain a small project that provides this, a drop-in Python runtime you can 
ship without installation called Feet. Get it? It makes Python run.

https://github.com/ironfroggy/feet

On Mon, Jan 17, 2022 at 11:16 AM Sina Mobasheri 
mailto:sinamobash...@outlook.com>> wrote:
Java offers download JDK as Compressed 
Archive or NodeJS 
offers download Node as Binaries both give 
us a compressed file for Linux and windows that we can just unzipped it and put in a custom 
directory and set some environment variables and start working

I'm aware that Python also have something called Embedded 
Zip for 
Windows and nothing like that for Linux as far as I know, and I think this Embedded 
Zip is not something that user wants to work with that directly it's for embedding in 
a C++ application, so it's not the same as options that Java and NodeJS offers

My question is why Python hasn't option for downloading as Compressed Archive ?
--
https://mail.python.org/mailman/listinfo/python-list



--

CALVIN SPEALMAN

SENIOR QUALITY ENGINEER

calvin.speal...@redhat.com  M: 
+1.336.210.5107

[https://red.ht/sig]
TRIED. TESTED. TRUSTED.


--

CALVIN SPEALMAN

SENIOR QUALITY ENGINEER

calvin.speal...@redhat.com  M: 
+1.336.210.5107

[https://red.ht/sig]
TRIED. TESTED. TRUSTED.



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


Re: Why There Is No Python Compressed Archive or Binaries ?

2022-01-17 Thread Sina Mobasheri
Yes​ sure, actually I can continue working and developing with python without 
this feature no problem but it's something that I like and I'm just curious 
about it, about why Python doesn't implement this kind of installation (most 
languages do, Java, NodeJS, Deno, PHP, Go, DotNet) is it because some 
limitations (technically or politically) or maybe in future they would do 
that... ?


From: Python-list  on 
behalf of Antoon Pardon 
Sent: Monday, January 17, 2022, 23:51
To: python-list@python.org
Subject: Re: Why There Is No Python Compressed Archive or Binaries ?

You could try miniconda.

Op 17/01/2022 om 20:53 schreef Sina Mobasheri:
> Consider scenario that I want run python 3.10 in CentOS 8, I think last 
> python version in CentOS repository is 3.6, if I use epel I can get 3.8 so 
> ..., I think (correct me if I'm wrong 🙏🏻) the only way that I can run python 
> 3.10 is to compile it manually, which is need to know what dependencies 
> python needs for compilation ... (different distribution different packages, 
> which packages for what, you can see that it is intimidating for beginners 
> like me)
> It's useful to just use wget  tar.xz>, unzipped, ser path and ta-da you have cpython 3.10 in CentOS 8
>
> This is Linux specific use case that I can think of, I'm sure there are 
> plenty for windows, consider scenario that I wrote script for scraping some 
> site and entered in some excel worksheet I can simply ship cpython with my 
> script to clients machine and there is no need that client install cpython by 
> himself...
>
> Sorry about my bad grammar
> 
> From: Calvin Spealman 
> Sent: Monday, January 17, 2022, 22:53
> To: Sina Mobasheri
> Cc: python-list@python.org
> Subject: Re: Why There Is No Python Compressed Archive or Binaries ?
>
> Well, on its own, I'd say the reason we don't have such a download is that it 
> wouldn't be very useful.
>
> On Mon, Jan 17, 2022 at 2:08 PM Sina Mobasheri 
> mailto:sinamobash...@outlook.com>> wrote:
> It's cool project definitely something that I'm personally interested about, 
> but I talking about compressed archive of cpython that we can simply unzipped 
> and starting developing an app, not running  an app that already developed... 
> 😀
> 
> From: Calvin Spealman mailto:cspea...@redhat.com>>
> Sent: Monday, January 17, 2022 10:19:13 PM
> To: Sina Mobasheri 
> mailto:sinamobash...@outlook.com>>
> Cc: python-list@python.org 
> mailto:python-list@python.org>>
> Subject: Re: Why There Is No Python Compressed Archive or Binaries ?
>
> I maintain a small project that provides this, a drop-in Python runtime you 
> can ship without installation called Feet. Get it? It makes Python run.
>
> https://github.com/ironfroggy/feet
>
> On Mon, Jan 17, 2022 at 11:16 AM Sina Mobasheri 
> mailto:sinamobash...@outlook.com>> wrote:
> Java offers download JDK as Compressed 
> Archive or 
> NodeJS offers download Node as 
> Binaries both give us a compressed 
> file for Linux and windows that we can just unzipped it and put in a custom 
> directory and set some environment variables and start working
>
> I'm aware that Python also have something called Embedded 
> Zip 
> for Windows and nothing like that for Linux as far as I know, and I think 
> this Embedded Zip is not something that user wants to work with that directly 
> it's for embedding in a C++ application, so it's not the same as options that 
> Java and NodeJS offers
>
> My question is why Python hasn't option for downloading as Compressed Archive 
> ?
> --
> https://mail.python.org/mailman/listinfo/python-list
>
>
>
> --
>
> CALVIN SPEALMAN
>
> SENIOR QUALITY ENGINEER
>
> calvin.speal...@redhat.com  M: 
> +1.336.210.5107
>
> [https://red.ht/sig]
> TRIED. TESTED. TRUSTED.
>
>
> --
>
> CALVIN SPEALMAN
>
> SENIOR QUALITY ENGINEER
>
> calvin.speal...@redhat.com  M: 
> +1.336.210.5107
>
> [https://red.ht/sig]
> TRIED. TESTED. TRUSTED.
>

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

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


Re: What to write or search on github to get the code for what is written below:

2022-01-17 Thread Dennis Lee Bieber
On Mon, 17 Jan 2022 01:55:15 -0800 (PST), NArshad 
declaimed the following:


>This is due to the time factor

And that opens another can of worms... Before this "assignment" was
given to you, surely someone made some sort of estimate of how long it
would take to produce, taking into account your (apparent) lack of
familiarity with any of the technology required.

Python, Flask, and web-hosting (on Heroku) all appear to be a result of
stumbling onto a "Hello World" tutorial that does no persist ant data
storage and relies upon a free/hobbyist level account on the hosting
provider -- an obvious flag that this is not a well thought out project for
some actual customer/employer (it might qualify as an internship assignment
at some school looking to automate the reservation/check-out of text
books). The lack of understanding in how Python dictionaries are
manipulated doesn't leave one impressed either...

In one respect, given the limited functionality stated, one gets the
impression of a class GROUP assignment, in which the individual functions
were divvied up to each group member to work, with pretty much no analysis
of suitable data storage, etc. (You only gave some sort of CONOPS for
"users" to "reserve" books; no CONOPS for unreserving books, an implication
that after reserving books the user will go to some desk [in library, in
store {unlikely if there is a return date for books}, some warehouse] and
receive a copy of the reserved book -- but no CONOPS for how this deck
validates that the user has reserved any particular book [no report printed
by user of reservations made during a session, no search function for desk
staff, etc.).

The Excel requirement comes across as "this is how we've been doing it,
and we have a lot of data in the file we don't want to lose". In other
words -- one should have defined a migration path to replace the Excel
spreadsheet with something suited to a multi-user and/or web-based
application. That, or someone in the group has squashed any discussion on
data storage to force their biased viewpoint. (I've been on the fringe of
one such: in a department with over 80 VAX FORTRAN-77 programmers [some of
us quite skilled in working the internals of the language] and some 20-30
PDP Macro-11 programmers, the Macro-11 group was tasked with porting their
application to VAX systems. One person held out for the port to be done in
VAX Pascal "because colleges were teaching Pascal" at the time [TurboPascal
in all likelihood] totally ignoring the massive F-77 expertise available;
he also is rumored to have threatened to leave if Pascal was not chosen and
management caved-in. Even though VAX Pascal was much different from
TurboPascal [no development environment, though it did support separate
compilation and linking], it did not have advanced math
operations/functions -- just the ones found in Jensen&Wirth, try doing
orbital computations with a subset of trig functions -- requiring
programmers to import the F-77 runtime library for the missing functions. A
few years later the manager confessed that submitting to Pascal was a
mistake -- it didn't take long for the VAX Pascal project to be ported to
HPUX workstations using C and X-window system).


I also note that during the course of this thread, the spreadsheet
appears to have gone from a somewhat logical "one-row per title"

TITLE   |   AUTHORs |   INVENTORY   |   AVAILABLE   
...
A Book  Someguy 10  9   
..
Book 2  Who Dat 100 100 
...
Popular Madonna 30  1   
...

to the illogical "one-column per title"

TITLE   A Book  Book 2  Popular
AUTHORs Someguy Who Dat Madonna
INVENTORY   10  100 
30
AVAILABLE   9   100 
1
...

Consider that Excel only supports some 16K columns, but 1M rows, and
expanding each column to show, say a 200 character title (there are some
long book titles in the world) results in only two or three books being
visible at a time... And there is no "side scroll" page key. In contrast
the first layout would only need one column to be expanded, the rest can be
narrower, and one can use page-up/page-down to scroll through a lot of
books at a time. Oh, and while a cell can hold some 4K text -- Excel itself
can only display the first 255 of those. That's going to put a limit on how
many names you can fit in the reserved-by column (about 10 25char names)
and easily find while scrolling. More than that and you have use "Find"
operations from the menu.

Heroku-Specific note: a recent web-page I encountered searching for
information for a different question indicates that Heroku 

Re: Why There Is No Python Compressed Archive or Binaries ?

2022-01-17 Thread Barry Scott


> On 17 Jan 2022, at 19:53, Sina Mobasheri  wrote:
> 
> Consider scenario that I want run python 3.10 in CentOS 8, I think last 
> python version in CentOS repository is 3.6, if I use epel I can get 3.8 so 
> ..., I think (correct me if I'm wrong 🙏🏻) the only way that I can run python 
> 3.10 is to compile it manually, which is need to know what dependencies 
> python needs for compilation ... (different distribution different packages, 
> which packages for what, you can see that it is intimidating for beginners 
> like me)
> It's useful to just use wget  tar.xz>, unzipped, ser path and ta-da you have cpython 3.10 in CentOS 8

Are there features in python 3.10 that are missing from 3.6 that you need?
If not then the easy thing to do is use 3.6.

You could build a docker containers you based on fedora 35 that has the python 
3.10
and the python libs that you need installed and use that.

You would use podman and its tools to build and run the container on Centos 8.

For my work I'm planning to use 3.6 on Centos 8 as that is one thing I can 
avoid packaging
and maintaining myself.

Barry

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


Re: Why There Is No Python Compressed Archive or Binaries ?

2022-01-17 Thread Grant Edwards
On 2022-01-17, Sina Mobasheri  wrote:

> Yes sure, actually I can continue working and developing with python
> without this feature no problem but it's something that I like and
> I'm just curious about it, about why Python doesn't implement this
> kind of installation

You talk about "Python" implementing something. Python is a language.

If what you want hasn't been implmented, it's because there haven't
been any _people_ who have wanted it enough to do it. I spent 90
seconds googling and found that what you wanted has been implemented a
couple times for Windows. There was "Portable Python," which appears
to have been abandonded.

There's also WinPython  which seems to be
active.  AFAICT, you just unzip it and run it (nothing needs to be
"installed"). It says you can even move that directory to another
machine and run it there if you want.

Both of those were for Windows.

It's probably never been done for Linux because Linux distros pretty
much all come with Python already installed by default, and it's
usually trivial to install alternative versions as well (and keep them
all updated) via whatever package manager the Distro uses.

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


Re: How to set environmental variables for Python

2022-01-17 Thread Cameron Simpson
On 17Jan2022 11:36, Shaozhong SHI  wrote:
>Set Operation System but not disturbing existing setting.  Only to add at
>the command line.

If you mean: "set on the command line so that I run some script using 
Python 3.6.1", usually you would just invoke the specific Python 3.6.1 
executable.

You can do that directly, or modify $PATH (UNIX, %path% on Windows?) to 
find that executable first when looking for the "python" (or "python3" 
or "py") command, or use a virtual environment.

The first approach (direct execution) might look like this:

[~]fleet2*> /usr/local/bin/python3.10
Python 3.10.0 (v3.10.0:b494f5935c, Oct  4 2021, 14:59:20) [Clang 
12.0.5 (clang-1205.0.22.11)] on darwin
Type "help", "copyright", "credits" or "license" for more 
information.
>>>

That's on my local Mac, "[~]fleet2*>" is my prompt, and there's a Python 
3.10 installed as /usr/local/bin/python3.10.

The second approach might look like this:

env PATH=/Library/Frameworks/Python.framework/Versions/3.10/bin:$PATH python

That places the Python 3.10 "bin" directory in my $PATH _ahead_ of all 
other paths, so that "python" is found there first, thus running the 
desired python version:

[~]fleet2*> env 
PATH=/Library/Frameworks/Python.framework/Versions/3.10/bin:$PATH python3
Python 3.10.0 (v3.10.0:b494f5935c, Oct  4 2021, 14:59:20) [Clang 12.0.5 
(clang-1205.0.22.11)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

That particular long path is an artifact of how Python is installed on 
my Mac. Adjust for your platform.

The third approach is to use a virtual environment, a common approach 
for python development. A virtual environment is a little install 
directory based on a particular python version, where you can install a 
custom set of third party modules. You make one like this:

/usr/local/bin/python3.10 -m venv venv

That uses the "venv" module from python 3.10 to create a new virtual 
environment in the directory "venv" (in the current directory).

>From that point onward you want the virtual env "bin" directory in your 
PATH:

export PATH=$PWD/venv/bin:$PATH

and thereon, _in that shell_, "python3" will run the python from the 
virtual environment (which uses the python3.10 you used to create the 
venv) and "pip3" will install modules into that virtual environment, not 
disturbing other setups.

Virtualenvs come with an "activate" script whose purpose it to set up 
your current shell to use the environment; they essentially do the 
"export" above and also fiddle your prompt to remind you that you're 
using a particular environment. You don't need to use that - technically 
it is enough to directly invoke the python3 executable from the 
environment. Fiddling $PATH lets other things find that "python3" by 
default.

Cheers,
Cameron Simpson 

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


Re: What to write or search on github to get the code for what is written below:

2022-01-17 Thread Chris Angelico
On Tue, Jan 18, 2022 at 7:44 AM Dennis Lee Bieber  wrote:
> Heroku-Specific note: a recent web-page I encountered searching for
> information for a different question indicates that Heroku does not support
> SQLite3 and, by extension, ANY file-based dynamic data storage (so, no
> Excel files either). An Heroku Python "dyno" [virtualized work container]
> is initialized using a requirements file -- that file basically lists all
> the 3rd party Python modules that need to be installed using "pip". If the
> "dyno" is stopped (application shut down to upload modifications, or maybe
> just to remove an application that has been idle for some hours) it, and
> any data files, are just deleted -- when someone tries to connect to the
> app again, a new "dyno" is spun up and loaded from scratch. One is supposed
> to use one of the client server databases provided by Heroku for persist
> ant storage (since those are not inside "dyno" container -- the app makes a
> network connection to the database server.

This is correct. I've used Heroku for a number of projects, since it's
easy to deploy there and can be done for zero dollars. If you know how
to use PostgreSQL from Python, it's almost trivially easy to deploy
that to Heroku (just need to arrange your credentials, nothing more).
In contrast, manipulating external files is tricky; in fact, if you
want to do something simple like "upload an image to use as your
avatar", it's probably easier to store that in Postrges than on the
file system.

Part of the reason for the "wipe everything on shutdown" policy is
that it makes Heroku apps extremely easy to scale. You want one
process? Done. Want two dynos so you can serve more clients at once?
Easy. But for that to work, you have to make absolutely sure that
everything is stored externally to the dyno itself.

Like everything else, it requires discipline, a set of rules that you
follow. (And it's a lot easier than some - for instance, the
discipline required for a live-code-update system is a lot harder.)
But while it isn't particularly difficult, it does require some
comprehension. Some time investment. Some actual effort. And that's
what the OP might be running into difficulties.

(For what it's worth, we used Heroku at my last teaching job; it's a
great way to ensure that every student is able to deploy projects, and
since it doesn't cost anything to have a bunch of projects up there,
it doesn't hurt to deploy apps that don't have any "real-world use".
Originally we taught them to use MongoDB, which requires external
hosting, but switched that out for PostgreSQL, which is ever so much
better to work with.)

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


Re: Why There Is No Python Compressed Archive or Binaries ?

2022-01-17 Thread Kirill Ratkin

Hi Grant

Hmmm...  definitly you are right in particular solution.

But Ok, let me show example.


I often use Go in parallel with Python and sometimes I switch between 
Windows/Linux also. On both systems I just download Go toolset as 
tarball/zip file and unpack in place where I like.


The point here is Go toolset officially distributed as tarball/zip for 
all supported operating system. This is not PortableGo or WinGo or some 
anther third party Go distribution. This is one of supported way do get 
Go toolset.


On Windows I put toolset on separate drive 'D:\Go' and on linux - 
$HOME/.local/go


And I set up several environment variables (doing 'setx' on Windows and 
edit .profile on linux): GOPATH, GOROOT, GOCACHE, ... and modify my PATH.


Now I can build any Go project. I don't care about which Go compiler was 
set on OS (Linux or Windows) before. I just unpack tarball/zip in place 
where I have permissions and use it.



I take Go just for example. In same way you can unpack and use Java SDK 
and DotNet SDK. All these toolsets have option (provided by vendor) to 
be downloaded as compressed file.



You are absolutely right. It's easy to google and find something like 
winpython. But I'm sure there are reasons why www.python.org doesn't 
provide this.



On 1/18/22 00:13, Grant Edwards wrote:

On 2022-01-17, Sina Mobasheri  wrote:


Yes sure, actually I can continue working and developing with python
without this feature no problem but it's something that I like and
I'm just curious about it, about why Python doesn't implement this
kind of installation

You talk about "Python" implementing something. Python is a language.

If what you want hasn't been implmented, it's because there haven't
been any _people_ who have wanted it enough to do it. I spent 90
seconds googling and found that what you wanted has been implemented a
couple times for Windows. There was "Portable Python," which appears
to have been abandonded.

There's also WinPython  which seems to be
active.  AFAICT, you just unzip it and run it (nothing needs to be
"installed"). It says you can even move that directory to another
machine and run it there if you want.

Both of those were for Windows.

It's probably never been done for Linux because Linux distros pretty
much all come with Python already installed by default, and it's
usually trivial to install alternative versions as well (and keep them
all updated) via whatever package manager the Distro uses.

--
Grant

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