Re: Mailing-Lists (pointer)

2023-01-09 Thread Chris Angelico
On Tue, 10 Jan 2023 at 09:37, dn  wrote:
>
> On 10/01/2023 08.46, Stefan Ram wrote:
> >If anyone is interested: In "comp.misc", there's a discussion
> >about the use of mailing lists in software development.
> >Subject: An objective criteria for deprecating community platforms
> >(I did not create this subject!)
>
> (and I don't read comp.misc)
>
>
> There is an increasingly relevant question though: how do we 'reach' as
> many people as possible, without diluting the (community) value of
> responses?
>
> At one time, if you wanted to talk/hear certain folk you felt compelled
> to join Twitter (see also AOL, MySpace, Facebook, ...). Recently many
> more people have realised that a single, centralised, (and
> corporately-owned) 'service' has its down-sides.
>

Relevant XKCD: https://xkcd.com/1810/

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


Re: No module named 'playsound'‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏

2023-01-09 Thread Thomas Passin

On 1/9/2023 3:00 PM, Eryk Sun wrote:

On 1/9/23, MRAB  wrote:


On Windows it's best to use pip via the Python Launcher:

py -m pip show playsound


Python's app distribution on the Microsoft Store doesn't include the
py launcher, and we don't (but should) have a standalone app or
desktop version of the launcher. Unlike the desktop distribution,
however, the app distribution installs a versioned name as a link,
such as "python3.11". (Note that a venv virtual environment only has a
"python" command on Windows.)

If "pip" is in PATH, a versioned name such as "pip3.11" should also be
available. If multiple versions of the app distribution are installed,
and for some reason the "python" and "pip" links are mapped to
different versions, one can match up the versioned names "pip3.11" and
"python3.11" to ensure consistency. Or simply run "python -m pip".


It better be "pythonx.xx -m pip", though!

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


Re: Mailing-Lists (pointer)

2023-01-09 Thread dn

On 10/01/2023 08.46, Stefan Ram wrote:

   If anyone is interested: In "comp.misc", there's a discussion
   about the use of mailing lists in software development.
   Subject: An objective criteria for deprecating community platforms
   (I did not create this subject!)


(and I don't read comp.misc)


There is an increasingly relevant question though: how do we 'reach' as 
many people as possible, without diluting the (community) value of 
responses?


At one time, if you wanted to talk/hear certain folk you felt compelled 
to join Twitter (see also AOL, MySpace, Facebook, ...). Recently many 
more people have realised that a single, centralised, (and 
corporately-owned) 'service' has its down-sides.


If there are too many channels for communication, it increases the 
difficulty for any one person to 'keep up', eg python-list and python-forum.


On the other hand, by splitting the community, eg python-list and 
python-tutor, there are benefits of relevance and focus.


What some don't seem to appreciate is that whilst a conversation such as 
"how do I ..." seems to have the objective of (quickly) solving that 
(one) person's problem, at that one point in time; it also (potentially) 
forms a 'knowledgebase' for people who have the same problem, at some 
later time.


For those brought-up with, or in the mode of, 'instant messaging', there 
is no concept of future-value. This is evidenced by the many folk who 
fail to scan the mailing-list archives before posting a question 'here' 
(who may not even realise that archives are kept, and for that very 
purpose).


This in-turn, feeds the notion of splitting 'learners' from 'core 
developers' (for example). How many times have you seen a question about 
how to use Python for the very first time after installing on Windows?


See also the wisdom of enabling comp.lang.python and python-list as 
'mirrors', enabling those who prefer one mechanism/client to another, 
yet maintaining a single 'community'.


--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: I'm installing playsound but it keeps saying No module named playsound

2023-01-09 Thread Thomas Passin

On 1/9/2023 12:29 PM, om om wrote:

I'm installing playsound and its saying
but it keeps saying No module named playsound
and this error occurs on other packages

when I install it saying Requirement already satisfied: playsound in
c:\users\omrio\appdata\local\programs\python\python39\lib\site-packages


This doesn't tell us anything new.  Please say exactly what you did and 
saw when you got the error messages.  Please tell us the result of 
running "pip -V" and "python -m pip -V".


No one will be able to help if you don't tell us important details.

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


Re: No module named 'playsound'‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏

2023-01-09 Thread Thomas Passin

On 1/9/2023 2:10 PM, MRAB wrote:

On Windows it's best to use pip via the Python Launcher:

py -m pip show playsound


Sure - I just didn't want to complicate the post any more, though I did 
mention it in passing.  py is definitely the best way.  I wonder how 
many people know that py can launch other versions of Python too?


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


Re: No module named 'playsound'‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏

2023-01-09 Thread Eryk Sun
On 1/9/23, MRAB  wrote:
>
> On Windows it's best to use pip via the Python Launcher:
>
> py -m pip show playsound

Python's app distribution on the Microsoft Store doesn't include the
py launcher, and we don't (but should) have a standalone app or
desktop version of the launcher. Unlike the desktop distribution,
however, the app distribution installs a versioned name as a link,
such as "python3.11". (Note that a venv virtual environment only has a
"python" command on Windows.)

If "pip" is in PATH, a versioned name such as "pip3.11" should also be
available. If multiple versions of the app distribution are installed,
and for some reason the "python" and "pip" links are mapped to
different versions, one can match up the versioned names "pip3.11" and
"python3.11" to ensure consistency. Or simply run "python -m pip".
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: No module named 'playsound'‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏

2023-01-09 Thread MRAB

On 2023-01-09 17:11, Thomas Passin wrote:


I wrote


"the most likely reason is that it got installed by a different
version of python than the one that used pip to install it."


That's not quite what I meant to say.  Better:

"the most likely reason is that you are trying to import it using a
different version of python than the one that used pip to install it."


On Windows it's best to use pip via the Python Launcher:

py -m pip show playsound



On 1/9/2023 11:59 AM, Mats Wichmann wrote:

On 1/9/23 08:30, Thomas Passin wrote:

On 1/9/2023 9:40 AM, om om wrote:

I'm installing playsound pip install playsound
but it keeps saying No module named playsound
and this error occurs on other packages


Did the installation by pip succeed? if not, what was the error message?

"It keeps saying ...". What keeps saying that (it's not a standard 
error message from pip)? What is the code or command that causes this 
error message?


You would get such a message if you tried to import a package but it 
had not been installed.  If you used pip to install a package and it 
succeeded but you could not import the package (or module), the most 
likely reason is that it got installed by a different version of 
python than the one that used pip to install it.  You may have several 
different versions of Python on your computer.


You can check versions by running

pip -V


As described in this reply, but to be more explicit: if a package 
installed wtihout error, and then you can't import it in Python, it's 
basically always a path problem.


Invoking pip the same way as you did to install, do:

pip show playsound

This will tell you where it put it. If that's not a place your Python is 
looking, it won't find it.




Then use the command you normally use to run Python (i.e., python3, 
py, etc.) and run


py_x -m pip -V

(don't type "py_x", use the command name you normally use to run python)

If the two outputs are different, then you will know for sure that 
your packages got installed to a different version of Python.  
Re-install them using "python -m pip install" instead of "pip install" 
- again, make sure that you use the actual name for the python command 
that you normally use.







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


Re: No module named 'playsound'‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏

2023-01-09 Thread Thomas Passin


I wrote


"the most likely reason is that it got installed by a different
version of python than the one that used pip to install it."


That's not quite what I meant to say.  Better:

"the most likely reason is that you are trying to import it using a 
different version of python than the one that used pip to install it."



On 1/9/2023 11:59 AM, Mats Wichmann wrote:

On 1/9/23 08:30, Thomas Passin wrote:

On 1/9/2023 9:40 AM, om om wrote:

I'm installing playsound pip install playsound
but it keeps saying No module named playsound
and this error occurs on other packages


Did the installation by pip succeed? if not, what was the error message?

"It keeps saying ...". What keeps saying that (it's not a standard 
error message from pip)? What is the code or command that causes this 
error message?


You would get such a message if you tried to import a package but it 
had not been installed.  If you used pip to install a package and it 
succeeded but you could not import the package (or module), the most 
likely reason is that it got installed by a different version of 
python than the one that used pip to install it.  You may have several 
different versions of Python on your computer.


You can check versions by running

pip -V


As described in this reply, but to be more explicit: if a package 
installed wtihout error, and then you can't import it in Python, it's 
basically always a path problem.


Invoking pip the same way as you did to install, do:

pip show playsound

This will tell you where it put it. If that's not a place your Python is 
looking, it won't find it.




Then use the command you normally use to run Python (i.e., python3, 
py, etc.) and run


py_x -m pip -V

(don't type "py_x", use the command name you normally use to run python)

If the two outputs are different, then you will know for sure that 
your packages got installed to a different version of Python.  
Re-install them using "python -m pip install" instead of "pip install" 
- again, make sure that you use the actual name for the python command 
that you normally use.





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


Re: file.read Method Documentation (Python 2.7.10)

2023-01-09 Thread Chris Angelico
On Tue, 10 Jan 2023 at 01:36, Stephen Tucker  wrote:
>
> Dear Python-list,
>
> Yes, I know that Python 2.x is no longer supported.
>
> I have found that the documentation for this method is misleading when the
> file being read is UTF-8-encoded:
>
>Instead of reading *size* bytes, the method reads *size *UTF-8 byte
> *sequences*.
>
> Has this error been corrected in the Python 3.x documentation?
>

What documentation is this? The builtin 'file' type doesn't know
anything about encodings, and only ever returns bytes.

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


I'm installing playsound but it keeps saying No module named playsound

2023-01-09 Thread om om
I'm installing playsound and its saying
but it keeps saying No module named playsound
and this error occurs on other packages

when I install it saying Requirement already satisfied: playsound in
c:\users\omrio\appdata\local\programs\python\python39\lib\site-packages
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: No module named 'playsound'‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏

2023-01-09 Thread Mats Wichmann

On 1/9/23 08:30, Thomas Passin wrote:

On 1/9/2023 9:40 AM, om om wrote:

I'm installing playsound pip install playsound
but it keeps saying No module named playsound
and this error occurs on other packages


Did the installation by pip succeed? if not, what was the error message?

"It keeps saying ...". What keeps saying that (it's not a standard error 
message from pip)? What is the code or command that causes this error 
message?


You would get such a message if you tried to import a package but it had 
not been installed.  If you used pip to install a package and it 
succeeded but you could not import the package (or module), the most 
likely reason is that it got installed by a different version of python 
than the one that used pip to install it.  You may have several 
different versions of Python on your computer.


You can check versions by running

pip -V


As described in this reply, but to be more explicit: if a package 
installed wtihout error, and then you can't import it in Python, it's 
basically always a path problem.


Invoking pip the same way as you did to install, do:

pip show playsound

This will tell you where it put it. If that's not a place your Python is 
looking, it won't find it.




Then use the command you normally use to run Python (i.e., python3, py, 
etc.) and run


py_x -m pip -V

(don't type "py_x", use the command name you normally use to run python)

If the two outputs are different, then you will know for sure that your 
packages got installed to a different version of Python.  Re-install 
them using "python -m pip install" instead of "pip install" - again, 
make sure that you use the actual name for the python command that you 
normally use.



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


Re: file.read Method Documentation (Python 2.7.10)

2023-01-09 Thread Barry Scott



On 09/01/2023 14:34, Stephen Tucker wrote:

Dear Python-list,

Yes, I know that Python 2.x is no longer supported.

I have found that the documentation for this method is misleading when the
file being read is UTF-8-encoded:

Instead of reading *size* bytes, the method reads *size *UTF-8 byte
*sequences*.

Has this error been corrected in the Python 3.x documentation?


Please read the python 3 docs and let us know if you think its correct now.

Barry

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


Re: No module named 'playsound'‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏

2023-01-09 Thread Thomas Passin

On 1/9/2023 9:40 AM, om om wrote:

I'm installing playsound pip install playsound
but it keeps saying No module named playsound
and this error occurs on other packages


Did the installation by pip succeed? if not, what was the error message?

"It keeps saying ...". What keeps saying that (it's not a standard error 
message from pip)? What is the code or command that causes this error 
message?


You would get such a message if you tried to import a package but it had 
not been installed.  If you used pip to install a package and it 
succeeded but you could not import the package (or module), the most 
likely reason is that it got installed by a different version of python 
than the one that used pip to install it.  You may have several 
different versions of Python on your computer.


You can check versions by running

pip -V

Then use the command you normally use to run Python (i.e., python3, py, 
etc.) and run


py_x -m pip -V

(don't type "py_x", use the command name you normally use to run python)

If the two outputs are different, then you will know for sure that your 
packages got installed to a different version of Python.  Re-install 
them using "python -m pip install" instead of "pip install" - again, 
make sure that you use the actual name for the python command that you 
normally use.


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


Re: No module named 'playsound'‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏

2023-01-09 Thread MRAB

On 2023-01-09 14:40, om om wrote:

I'm installing playsound pip install playsound
but it keeps saying No module named playsound
and this error occurs on other packages


What are you typing on the command line? Which operating system are you 
using?


Please copy and post what you're typing (with the command prompt) and 
the complete error message.

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


No module named 'playsound'‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏

2023-01-09 Thread om om
I'm installing playsound pip install playsound
but it keeps saying No module named playsound
and this error occurs on other packages
-- 
https://mail.python.org/mailman/listinfo/python-list


file.read Method Documentation (Python 2.7.10)

2023-01-09 Thread Stephen Tucker
Dear Python-list,

Yes, I know that Python 2.x is no longer supported.

I have found that the documentation for this method is misleading when the
file being read is UTF-8-encoded:

   Instead of reading *size* bytes, the method reads *size *UTF-8 byte
*sequences*.

Has this error been corrected in the Python 3.x documentation?

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


[Python-announce] ANN: astropy 5.2 released

2023-01-09 Thread Thomas Robitaille
Dear colleagues,

We are very happy to announce the v5.2 release of astropy, a core Python
package for Astronomy (and a v5.2.1 release which fixes compatibility with
Numpy 1.24):

http://www.astropy.org

The astropy core package is a community-driven Python package intended to
contain much of the core functionality and common tools needed for
astronomy and astrophysics. It is part of the Astropy Project, which aims
to foster an ecosystem of interoperable astronomy packages for Python.

New and improved major functionality in this release includes:

* Quantity data types
* Updates to astropy.cosmology
* Topocentric ITRS Frame
* Enhanced Fixed Width ASCII Tables
* Accessing cloud-hosted FITS files
* Drawing the instrument beam and a physical scale bar on celestial images
Interior ticks and tick labels
* Support for tilde-prefixed paths
* CCDData PSF Image representation

In addition, hundreds of smaller improvements and fixes have been made. An
overview of the changes is provided at:

 http://docs.astropy.org/en/stable/whatsnew/5.2.html

Instructions for installing astropy are provided on our website, and
extensive documentation can be found at:

 http://docs.astropy.org

If you usually use pip/vanilla Python, you can do:

pip install astropy --upgrade

If you make use of the Anaconda Python Distribution, soon you will be able
update to Astropy v5.2 with:

conda update astropy

Or if you cannot wait for Anaconda to update their default version, you can
use the conda-forge channel:

 conda update -c conda-forge astropy

Please report any issues, or request new features via our GitHub repository:

 https://github.com/astropy/astropy/issues

Over 430 people have contributed code to the core astropy package so far,
and you can find out more about the team here:

 https://www.astropy.org/team.html

If you use astropy directly for your work, or as a dependency to another
package, please remember to acknowledge it by citing the appropriate
Astropy paper. For the most up-to-date suggestions, see the acknowledgement
page:

https://www.astropy.org/acknowledging.html

We hope that you enjoy using astropy as much as we enjoyed developing it!

Thomas Robitaille
v5.2 Release Coordinator
on behalf of The Astropy Project
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


Re: subprocess equivalent for "os.execvp()"?

2023-01-09 Thread Eryk Sun
On 1/9/23, c.bu...@posteo.jp  wrote:
>
> On Python for Windows what is the appropriate way how a process can call
> itself again?
>
> Let me give you an example [1]:
> There is a project "bitcli" having two entry points
>
> [project.scripts]
> bitcli = "bitcli.__main__:main"
> bitcli-root = "bitcli.__main__:run_main_as_root_via_policykit"
>
> The first is usual.
>
> But the second does call "bitcli" via "pkexec" to give it some root
> rights.
>
> This application is intended to be run as user or root by the user
> himself.
>
>  def run_main_as_root_via_policykit():
>  cmd = ['pkexec', '--disable-internal-agent', 'bitcli']
>
>  # See https://github.com/python/cpython/issues/39569
>  os.execvp(cmd[0], cmd)

The nearest equivalent on Windows, if the current process doesn't have
administrator access and high integrity level, would be to spawn a
process with administrator access and elevated integrity level by
calling ShellExecuteExW() with the "runas" operation. The original
process should wait on the spawned process and proxy its exit status.
It should also add the spawned process to a kill-on-close,
silent-breakaway job, such that terminating the original process also
terminates the spawned process.

The standard library doesn't support calling ShellExecuteExW() or
working with job objects, except via ctypes. Or use the PyWin32
package.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: subprocess equivalent for "os.execvp()"?

2023-01-09 Thread c . buhtz

Dear Eryk,

Am 08.01.2023 17:22 schrieb Eryk Sun:

Avoid using any of the `os.exec*` functions on Windows. There's no
support for replacing a Windows process image, so the `exec*()`
functions simply spawn a child process and terminate the current one.


Thanks for bringing this up.

On Python for Windows what is the appropriate way how a process can call 
itself again?


Let me give you an example [1]:
There is a project "bitcli" having two entry points

[project.scripts]
bitcli = "bitcli.__main__:main"
bitcli-root = "bitcli.__main__:run_main_as_root_via_policykit"

The first is usual.

But the second does call "bitcli" via "pkexec" to give it some root 
rights.


This application is intended to be run as user or root by the user 
himself.


def run_main_as_root_via_policykit():
cmd = ['pkexec', '--disable-internal-agent', 'bitcli']

# See https://github.com/python/cpython/issues/39569
os.execvp(cmd[0], cmd)

Is there a better way to achiev this?

[1] -- 

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