Re: Help needed - - running into issues with python and its tools

2024-08-06 Thread o1bigtenor via Python-list
On Tue, Aug 6, 2024 at 10:53 AM Bill Deegan 
wrote:

> I’m not looking through all the packages you have installed
>
> (Ctrl-F is your friend - - - )


> What version of python is installed on your system?
>
> There are actually 3 versions installed - - - which is why the whole list
was posted.
Your question was really not clear given the context.

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


Re: Help needed - - running into issues with python and its tools

2024-08-06 Thread Bill Deegan via Python-list
I’m not looking through all the packages you have installed

What version of python is installed on your system?


On Tue, Aug 6, 2024 at 5:24 AM o1bigtenor  wrote:

>
>
> On Mon, Aug 5, 2024 at 10:36 PM Bill Deegan 
> wrote:
>
>> why reply to me instead of to the list?
>> It's generally considered bad form to do so.
>>
>
> Got it - - - except this list wants only reply all the next one wants only
> reply and
> keeping straight which is which isn't always happening. I did apologize
> and asked
> you to advise in the next one whether you even wanted to be included
> (which you haven't
> responded to).
>
>>
>>
>> Do you have any python 3 installed on your system?
>> Or python 2.7?
>> If not, can you install such via system package?
>>
>
>
>  # dpkg -l | grep python*
> ii  2to3   3.11.2-1
>   all  2to3 binary using python3
> ii  idle-python3.113.11.2-6+deb12u2
>   all  IDE for Python (v3.11) using Tkinter
> ii  ipython3   8.5.0-4
>  all  Enhanced interactive Python 3 shell
> ii  libboost-python1.74.0  1.74.0+ds1-21
>  amd64Boost.Python Library
> ii  libpython3-all-dev:amd64   3.11.2-1+b1
>  amd64package depending on all supported Python 3
> development packages
> ii  libpython3-dev:amd64   3.11.2-1+b1
>  amd64header files and a static library for Python
> (default)
> ii  libpython3-stdlib:amd643.11.2-1+b1
>  amd64interactive high-level object-oriented language
> (default python3 version)
> rc  libpython3.10-minimal:amd643.10.9-1
>   amd64Minimal subset of the Python language (version
> 3.10)
> ii  libpython3.11:amd643.11.2-6+deb12u2
>   amd64Shared Python runtime library (version 3.11)
> ii  libpython3.11-dev:amd643.11.2-6+deb12u2
>   amd64Header files and a static library for Python
> (v3.11)
> ii  libpython3.11-minimal:amd643.11.2-6+deb12u2
>   amd64Minimal subset of the Python language (version
> 3.11)
> ii  libpython3.11-stdlib:amd64 3.11.2-6+deb12u2
>   amd64Interactive high-level object-oriented language
> (standard library, version 3.11)
> ii  libpython3.11-testsuite3.11.2-6+deb12u2
>   all  Testsuite for the Python standard library (v3.11)
> ii  libpython3.9-minimal:amd64 3.9.13-1
>   amd64Minimal subset of the Python language (version
> 3.9)
> ii  libpython3.9-stdlib:amd64  3.9.13-1
>   amd64Interactive high-level object-oriented language
> (standard library, version 3.9)
> ii  python-apsw-doc3.40.0.0-2
>   all  documentation for python-apsw
> ii  python-apt-common  2.6.0
>  all  Python interface to libapt-pkg (locales)
> ii  python-apt-common-devuan   2.5.3devuan2
>   all  Templates for aptitude
> ii  python-attr-doc22.2.0-1
>   all  documentation for the attrs Python library
> ii  python-babel-localedata2.10.3-1
>   all  tools for internationalizing Python applications
> - locale data files
> ii  python-cryptography-doc38.0.4-3
>   all  Python library exposing cryptographic recipes
> and primitives (documentation)
> ii  python-cycler-doc  0.11.0-1
>   all  composable kwarg iterator (documentation)
> ii  python-gmpy2-common2.1.2-2
>  all  common files for python3-gmpy2
> ii  python-ipython-doc 8.5.0-4
>  all  Enhanced interactive Python shell (documentation)
> ii  python-markdown-doc3.4.1-2
>  all  text-to-HTML conversion library/tool
> (documentation)
> ii  python-matplotlib-data 3.6.3-1
>  all  Python based plotting system (data package)
> ii  python-matplotlib-doc  3.5.2-4
>  all  Python based plotting system (documentation
> package)
> ii  python-mpmath-doc  1.2.1-2
>  all  library for arbitrary-precision floating-point
> arithmetic - Documentation
> ii  python-numpy-doc   1:1.23.5-2
>   all  NumPy documentation
> ii  python-pexpect-doc 4.8.0-4
>  al

Re: Help needed - - running into issues with python and its tools

2024-08-06 Thread o1bigtenor via Python-list
On Mon, Aug 5, 2024 at 10:36 PM Bill Deegan 
wrote:

> why reply to me instead of to the list?
> It's generally considered bad form to do so.
>

Got it - - - except this list wants only reply all the next one wants only
reply and
keeping straight which is which isn't always happening. I did apologize and
asked
you to advise in the next one whether you even wanted to be included (which
you haven't
responded to).

>
>
> Do you have any python 3 installed on your system?
> Or python 2.7?
> If not, can you install such via system package?
>


 # dpkg -l | grep python*
ii  2to3   3.11.2-1
all  2to3 binary using python3
ii  idle-python3.113.11.2-6+deb12u2
all  IDE for Python (v3.11) using Tkinter
ii  ipython3   8.5.0-4
 all  Enhanced interactive Python 3 shell
ii  libboost-python1.74.0  1.74.0+ds1-21
 amd64Boost.Python Library
ii  libpython3-all-dev:amd64   3.11.2-1+b1
 amd64package depending on all supported Python 3
development packages
ii  libpython3-dev:amd64   3.11.2-1+b1
 amd64header files and a static library for Python
(default)
ii  libpython3-stdlib:amd643.11.2-1+b1
 amd64interactive high-level object-oriented language
(default python3 version)
rc  libpython3.10-minimal:amd643.10.9-1
amd64Minimal subset of the Python language (version
3.10)
ii  libpython3.11:amd643.11.2-6+deb12u2
amd64Shared Python runtime library (version 3.11)
ii  libpython3.11-dev:amd643.11.2-6+deb12u2
amd64Header files and a static library for Python
(v3.11)
ii  libpython3.11-minimal:amd643.11.2-6+deb12u2
amd64Minimal subset of the Python language (version
3.11)
ii  libpython3.11-stdlib:amd64 3.11.2-6+deb12u2
amd64Interactive high-level object-oriented language
(standard library, version 3.11)
ii  libpython3.11-testsuite3.11.2-6+deb12u2
all  Testsuite for the Python standard library (v3.11)
ii  libpython3.9-minimal:amd64 3.9.13-1
amd64Minimal subset of the Python language (version 3.9)
ii  libpython3.9-stdlib:amd64  3.9.13-1
amd64Interactive high-level object-oriented language
(standard library, version 3.9)
ii  python-apsw-doc3.40.0.0-2
all  documentation for python-apsw
ii  python-apt-common  2.6.0
 all  Python interface to libapt-pkg (locales)
ii  python-apt-common-devuan   2.5.3devuan2
all  Templates for aptitude
ii  python-attr-doc22.2.0-1
all  documentation for the attrs Python library
ii  python-babel-localedata2.10.3-1
all  tools for internationalizing Python applications -
locale data files
ii  python-cryptography-doc38.0.4-3
all  Python library exposing cryptographic recipes and
primitives (documentation)
ii  python-cycler-doc  0.11.0-1
all  composable kwarg iterator (documentation)
ii  python-gmpy2-common2.1.2-2
 all  common files for python3-gmpy2
ii  python-ipython-doc 8.5.0-4
 all  Enhanced interactive Python shell (documentation)
ii  python-markdown-doc3.4.1-2
 all  text-to-HTML conversion library/tool
(documentation)
ii  python-matplotlib-data 3.6.3-1
 all  Python based plotting system (data package)
ii  python-matplotlib-doc  3.5.2-4
 all  Python based plotting system (documentation
package)
ii  python-mpmath-doc  1.2.1-2
 all  library for arbitrary-precision floating-point
arithmetic - Documentation
ii  python-numpy-doc   1:1.23.5-2
all  NumPy documentation
ii  python-pexpect-doc 4.8.0-4
 all  Python module for automating interactive
applications (documentation)
ii  python-pil-doc 9.4.0-1.1+deb12u1
 all  Examples for the Python Imaging Library
ii  python-pygments-doc2.14.0+dfsg-1
 all  documentation for the Pygments
ii  python-scipy-doc

Re: Help needed - - running into issues with python and its tools

2024-08-05 Thread Bill Deegan via Python-list
why reply to me instead of to the list?
It's generally considered bad form to do so.


Do you have any python 3 installed on your system?
Or python 2.7?
If not, can you install such via system package?

-Bill



On Mon, Aug 5, 2024 at 6:06 PM o1bigtenor  wrote:

>
>
> On Mon, Aug 5, 2024 at 5:28 PM Bill Deegan via Python-list <
> python-list@python.org> wrote:
>
>> Did Mats suggestion of:
>> python3.13 -m venv new_venv
>> $ new_venv/bin/python --version
>> Python 3.13.0b4
>> $ source new_venv/bin/activate
>>
>> Not work?
>> That should work on any system, with any system installl python.
>> It's not trying to modify the system installed python in anyway...
>>
>> If not, please paste the error output you're getting.
>>
>
>  # python3.13 -m venv new_venv
> -bash: python3.13: command not found
>
> $ python3.13 -m venv new_venv
> bash: python3.13: command not found
>
> There you have it - - - the first one run as superuser and the second as
> usr.
>
> Regards
>
>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Help needed - - running into issues with python and its tools

2024-08-05 Thread Bill Deegan via Python-list
Did Mats suggestion of:
python3.13 -m venv new_venv
$ new_venv/bin/python --version
Python 3.13.0b4
$ source new_venv/bin/activate

Not work?
That should work on any system, with any system installl python.
It's not trying to modify the system installed python in anyway...

If not, please paste the error output you're getting.


On Mon, Aug 5, 2024 at 3:13 PM Mats Wichmann via Python-list <
python-list@python.org> wrote:

> On 8/5/24 15:17, o1bigtenor via Python-list wrote:
>
> >> That's something like
> >>
> >> pyenv install 3.12.4
> >>
> >
> > $ pyenv install 3.12.4
> > bash: pyenv: command not found
> >
>
> > pyenv is not a 'global' package
> >
> > there is a mountain of /root/.pyenv  files though
> > there is also quite a number of /root/.pyenv/plugins/pyenv-virtualenv/
> > files
> >
> > when looking in the /root/.pyenv files I can find options for all the
> older
> > version of python
> > but none for anything newer than what is on my system
> >
> > is there something else to install to achieve this 'version freedom' that
> > pyenv promises?
>
> It has to go somewhere your shell can find it.  Mine is a shell
> function, but it was set up so many years ago I don't remember details.
> It's presumably the pyenv installation instructions...
>
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Help needed - - running into issues with python and its tools

2024-08-05 Thread Mats Wichmann via Python-list

On 8/5/24 15:17, o1bigtenor via Python-list wrote:


That's something like

pyenv install 3.12.4



$ pyenv install 3.12.4
bash: pyenv: command not found




pyenv is not a 'global' package

there is a mountain of /root/.pyenv  files though
there is also quite a number of /root/.pyenv/plugins/pyenv-virtualenv/
files

when looking in the /root/.pyenv files I can find options for all the older
version of python
but none for anything newer than what is on my system

is there something else to install to achieve this 'version freedom' that
pyenv promises?


It has to go somewhere your shell can find it.  Mine is a shell 
function, but it was set up so many years ago I don't remember details. 
It's presumably the pyenv installation instructions...




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


Re: Help needed - - running into issues with python and its tools

2024-08-05 Thread o1bigtenor via Python-list
On Mon, Aug 5, 2024 at 3:56 PM Mats Wichmann  wrote:

>
> > On Mon, Aug 5, 2024 at 8:51 AM Mats Wichmann  > > wrote:
> >
> > On 8/5/24 06:48, o1bigtenor via Python-list wrote:
> >  > On Sun, Aug 4, 2024 at 8:49 AM Mats Wichmann via Python-list <
> >  > python-list@python.org > wrote:
> >  >
> >  >> On 8/3/24 20:03, o1bigtenor via Python-list wrote:
> >  >>
> >  >>> My question was, is and will be (and the doc absolutely doesn't
> > cover it)
> >  >>> how do I install a different version in the venv so that python
> > 3.11.x on
> >  >>> the
> >  >>> system is not discombobulated by the python 3.12.x in the venv.
> >  >>> That python 3.12 would let me run the tools needed.
> >  >>> (Its the how to install the next version of python that I just
> > haven't
> >  >> been
> >  >>> able to find information on - - - and I would be looking for
> > information
> >  >>> on how to install on a *nix.)
> >  >>
> >  >> To get a different Python "in" the venv, you use the version you
> > want in
> >  >> the construction of the venv. For example:
> >  >>
> >  >>
> >  >> $ python3.13 -m venv new_venv
> >  >> $ new_venv/bin/python --version
> >  >> Python 3.13.0b4
> >  >> $ source new_venv/bin/activate
> >  >>
> >  >>
> >  >   "https://peps.python.org/pep-0668/
> >  PEP 668, which prevents pip from
> >  > interacting with the OS installed python. This change has been
> > done in red
> >  > hat and other distros too . . . "
> >  >
> >  > similarly your first command produces and error code for the same
> > reason.
> >  >
> >  > Sorry - - - not my policy - - -
> >
> > What? Yes, the *system* pip should have some restrictions, if it's a
> > system mainly managed by a package manager.
> >
> > Setting up a venv is the *expected* approach to such situations, and
> > creating one doesn't cause any problems. You end up with a pip in the
> > activated venv that's going to install to a different path (the one
> in
> > the venv), and will not be marked as externally managed, as the
> package
> > manager has no control over that path.
> >
> > That's the whole point.  What error are you getting?  The venv
> > module is
> > not the pip module so restrictions on the system pip have nothing to
> do
> > with it.
> >
> > set up pyenv
> > activated a venv
> > trying to install python3.12 into it
> >
> > 1. download of python3.12 (blahblahblahetc).deb will not install
> > 2. download of python3.12.tar.xz similarly will not install
> >
> > (venv2) memyself@devuanbigbox:~$ pip install
> > /home/memyself/Downloads/Python-3.12.4.tar.xz
> > Processing ./Downloads/Python-3.12.4.tar.xz
> > ERROR: file:///home/memyself/Downloads/Python-3.12.4.tar.xz does not
> > appear to be a Python project: neither 'setup.py' nor 'pyproject.toml'
> > found.
> >
> > seems that I need a different version (installable as it were) of
> > python3.12
> > or my approach is all wrong!
>
>
> you can't install Python "into" a venv.
>
> you use a version of Python as the base when *creating* a venv, the venv
> will use the same binary as the base python (symlinks if possible, as in
> the Linux case), but with different paths.
>
> Since you've already got pyenv, use it to build the version you want to
> use - I think you said there wasn't a deb for 3.12 in your distro?
>

correct


> That's something like
>
> pyenv install 3.12.4
>

$ pyenv install 3.12.4
bash: pyenv: command not found


>
> that will use the build recipe it has... and hopefully work.  Distro
> Pythons sometimes have some strange setups that are hard to reproduce.
> Pyenv knows how to build micropython, too, should it ever come to that.
>
> If you indeed found a deb for the right Python, use apt to install it,
> and then use *that* Python to create your venv.
>
> If you have the pyenv-virtualenv plugin, you can ask it to make the
> virtualenv for you, if pyenv built the Python
>
>
pyenv is not a 'global' package

there is a mountain of /root/.pyenv  files though
there is also quite a number of /root/.pyenv/plugins/pyenv-virtualenv/
files

when looking in the /root/.pyenv files I can find options for all the older
version of python
but none for anything newer than what is on my system

is there something else to install to achieve this 'version freedom' that
pyenv promises?

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


Re: Help needed - - running into issues with python and its tools

2024-08-05 Thread o1bigtenor via Python-list
On Mon, Aug 5, 2024 at 3:55 PM Bill Deegan 
wrote:

> Your approach is wrong.
> You don't build python from source using pip.
>
> You don't install new versions of python into a venv either.
>
> Have you read the following?
> https://docs.micropython.org/en/latest/esp8266/tutorial/intro.html
>
> That seems to have instructions for what you want to do..
>

See item 1.4 - - - - that's where I'm at (and that's where the problems
are hidden at as well!)

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


Re: Help needed - - running into issues with python and its tools

2024-08-05 Thread Mats Wichmann via Python-list

On 8/5/24 14:39, o1bigtenor wrote:
Matt - if you would rather that you were not included in the address 
list - -

please advise.

On Mon, Aug 5, 2024 at 8:51 AM Mats Wichmann > wrote:


On 8/5/24 06:48, o1bigtenor via Python-list wrote:
 > On Sun, Aug 4, 2024 at 8:49 AM Mats Wichmann via Python-list <
 > python-list@python.org > wrote:
 >
 >> On 8/3/24 20:03, o1bigtenor via Python-list wrote:
 >>
 >>> My question was, is and will be (and the doc absolutely doesn't
cover it)
 >>> how do I install a different version in the venv so that python
3.11.x on
 >>> the
 >>> system is not discombobulated by the python 3.12.x in the venv.
 >>> That python 3.12 would let me run the tools needed.
 >>> (Its the how to install the next version of python that I just
haven't
 >> been
 >>> able to find information on - - - and I would be looking for
information
 >>> on how to install on a *nix.)
 >>
 >> To get a different Python "in" the venv, you use the version you
want in
 >> the construction of the venv. For example:
 >>
 >>
 >> $ python3.13 -m venv new_venv
 >> $ new_venv/bin/python --version
 >> Python 3.13.0b4
 >> $ source new_venv/bin/activate
 >>
 >>
 >   "https://peps.python.org/pep-0668/
 PEP 668, which prevents pip from
 > interacting with the OS installed python. This change has been
done in red
 > hat and other distros too . . . "
 >
 > similarly your first command produces and error code for the same
reason.
 >
 > Sorry - - - not my policy - - -

What? Yes, the *system* pip should have some restrictions, if it's a
system mainly managed by a package manager.

Setting up a venv is the *expected* approach to such situations, and
creating one doesn't cause any problems. You end up with a pip in the
activated venv that's going to install to a different path (the one in
the venv), and will not be marked as externally managed, as the package
manager has no control over that path.

That's the whole point.  What error are you getting?  The venv
module is
not the pip module so restrictions on the system pip have nothing to do
with it.

set up pyenv
activated a venv
trying to install python3.12 into it

1. download of python3.12 (blahblahblahetc).deb will not install
2. download of python3.12.tar.xz similarly will not install

(venv2) memyself@devuanbigbox:~$ pip install 
/home/memyself/Downloads/Python-3.12.4.tar.xz

Processing ./Downloads/Python-3.12.4.tar.xz
ERROR: file:///home/memyself/Downloads/Python-3.12.4.tar.xz does not 
appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' 
found.


seems that I need a different version (installable as it were) of 
python3.12

or my approach is all wrong!



you can't install Python "into" a venv.

you use a version of Python as the base when *creating* a venv, the venv 
will use the same binary as the base python (symlinks if possible, as in 
the Linux case), but with different paths.


Since you've already got pyenv, use it to build the version you want to 
use - I think you said there wasn't a deb for 3.12 in your distro? 
That's something like


pyenv install 3.12.4

that will use the build recipe it has... and hopefully work.  Distro 
Pythons sometimes have some strange setups that are hard to reproduce. 
Pyenv knows how to build micropython, too, should it ever come to that.


If you indeed found a deb for the right Python, use apt to install it, 
and then use *that* Python to create your venv.


If you have the pyenv-virtualenv plugin, you can ask it to make the 
virtualenv for you, if pyenv built the Python





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


Re: Help needed - - running into issues with python and its tools

2024-08-05 Thread Bill Deegan via Python-list
Your approach is wrong.
You don't build python from source using pip.

You don't install new versions of python into a venv either.

Have you read the following?
https://docs.micropython.org/en/latest/esp8266/tutorial/intro.html

That seems to have instructions for what you want to do..

-Bill



On Mon, Aug 5, 2024 at 1:41 PM o1bigtenor via Python-list <
python-list@python.org> wrote:

> Matt - if you would rather that you were not included in the address list -
> -
> please advise.
>
> On Mon, Aug 5, 2024 at 8:51 AM Mats Wichmann  wrote:
>
> > On 8/5/24 06:48, o1bigtenor via Python-list wrote:
> > > On Sun, Aug 4, 2024 at 8:49 AM Mats Wichmann via Python-list <
> > > python-list@python.org> wrote:
> > >
> > >> On 8/3/24 20:03, o1bigtenor via Python-list wrote:
> > >>
> > >>> My question was, is and will be (and the doc absolutely doesn't cover
> > it)
> > >>> how do I install a different version in the venv so that python
> 3.11.x
> > on
> > >>> the
> > >>> system is not discombobulated by the python 3.12.x in the venv.
> > >>> That python 3.12 would let me run the tools needed.
> > >>> (Its the how to install the next version of python that I just
> haven't
> > >> been
> > >>> able to find information on - - - and I would be looking for
> > information
> > >>> on how to install on a *nix.)
> > >>
> > >> To get a different Python "in" the venv, you use the version you want
> in
> > >> the construction of the venv. For example:
> > >>
> > >>
> > >> $ python3.13 -m venv new_venv
> > >> $ new_venv/bin/python --version
> > >> Python 3.13.0b4
> > >> $ source new_venv/bin/activate
> > >>
> > >>
> > >   "https://peps.python.org/pep-0668/ PEP 668, which prevents pip from
> > > interacting with the OS installed python. This change has been done in
> > red
> > > hat and other distros too . . . "
> > >
> > > similarly your first command produces and error code for the same
> reason.
> > >
> > > Sorry - - - not my policy - - -
> >
> > What? Yes, the *system* pip should have some restrictions, if it's a
> > system mainly managed by a package manager.
> >
> > Setting up a venv is the *expected* approach to such situations, and
> > creating one doesn't cause any problems. You end up with a pip in the
> > activated venv that's going to install to a different path (the one in
> > the venv), and will not be marked as externally managed, as the package
> > manager has no control over that path.
> >
> > That's the whole point.  What error are you getting?  The venv module is
> > not the pip module so restrictions on the system pip have nothing to do
> > with it.
> >
> > set up pyenv
> activated a venv
> trying to install python3.12 into it
>
> 1. download of python3.12 (blahblahblahetc).deb will not install
> 2. download of python3.12.tar.xz similarly will not install
>
> (venv2) memyself@devuanbigbox:~$ pip install
> /home/memyself/Downloads/Python-3.12.4.tar.xz
> Processing ./Downloads/Python-3.12.4.tar.xz
> ERROR: file:///home/memyself/Downloads/Python-3.12.4.tar.xz does not appear
> to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.
>
> seems that I need a different version (installable as it were) of
> python3.12
> or my approach is all wrong!
>
> Please advise
>
> TIA
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Help needed - - running into issues with python and its tools

2024-08-05 Thread o1bigtenor via Python-list
Matt - if you would rather that you were not included in the address list -
-
please advise.

On Mon, Aug 5, 2024 at 8:51 AM Mats Wichmann  wrote:

> On 8/5/24 06:48, o1bigtenor via Python-list wrote:
> > On Sun, Aug 4, 2024 at 8:49 AM Mats Wichmann via Python-list <
> > python-list@python.org> wrote:
> >
> >> On 8/3/24 20:03, o1bigtenor via Python-list wrote:
> >>
> >>> My question was, is and will be (and the doc absolutely doesn't cover
> it)
> >>> how do I install a different version in the venv so that python 3.11.x
> on
> >>> the
> >>> system is not discombobulated by the python 3.12.x in the venv.
> >>> That python 3.12 would let me run the tools needed.
> >>> (Its the how to install the next version of python that I just haven't
> >> been
> >>> able to find information on - - - and I would be looking for
> information
> >>> on how to install on a *nix.)
> >>
> >> To get a different Python "in" the venv, you use the version you want in
> >> the construction of the venv. For example:
> >>
> >>
> >> $ python3.13 -m venv new_venv
> >> $ new_venv/bin/python --version
> >> Python 3.13.0b4
> >> $ source new_venv/bin/activate
> >>
> >>
> >   "https://peps.python.org/pep-0668/ PEP 668, which prevents pip from
> > interacting with the OS installed python. This change has been done in
> red
> > hat and other distros too . . . "
> >
> > similarly your first command produces and error code for the same reason.
> >
> > Sorry - - - not my policy - - -
>
> What? Yes, the *system* pip should have some restrictions, if it's a
> system mainly managed by a package manager.
>
> Setting up a venv is the *expected* approach to such situations, and
> creating one doesn't cause any problems. You end up with a pip in the
> activated venv that's going to install to a different path (the one in
> the venv), and will not be marked as externally managed, as the package
> manager has no control over that path.
>
> That's the whole point.  What error are you getting?  The venv module is
> not the pip module so restrictions on the system pip have nothing to do
> with it.
>
> set up pyenv
activated a venv
trying to install python3.12 into it

1. download of python3.12 (blahblahblahetc).deb will not install
2. download of python3.12.tar.xz similarly will not install

(venv2) memyself@devuanbigbox:~$ pip install
/home/memyself/Downloads/Python-3.12.4.tar.xz
Processing ./Downloads/Python-3.12.4.tar.xz
ERROR: file:///home/memyself/Downloads/Python-3.12.4.tar.xz does not appear
to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.

seems that I need a different version (installable as it were) of
python3.12
or my approach is all wrong!

Please advise

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


Re: Help needed - - running into issues with python and its tools

2024-08-05 Thread Mats Wichmann via Python-list

On 8/5/24 06:48, o1bigtenor via Python-list wrote:

On Sun, Aug 4, 2024 at 8:49 AM Mats Wichmann via Python-list <
python-list@python.org> wrote:


On 8/3/24 20:03, o1bigtenor via Python-list wrote:


My question was, is and will be (and the doc absolutely doesn't cover it)
how do I install a different version in the venv so that python 3.11.x on
the
system is not discombobulated by the python 3.12.x in the venv.
That python 3.12 would let me run the tools needed.
(Its the how to install the next version of python that I just haven't

been

able to find information on - - - and I would be looking for information
on how to install on a *nix.)


To get a different Python "in" the venv, you use the version you want in
the construction of the venv. For example:


$ python3.13 -m venv new_venv
$ new_venv/bin/python --version
Python 3.13.0b4
$ source new_venv/bin/activate



  "https://peps.python.org/pep-0668/ PEP 668, which prevents pip from
interacting with the OS installed python. This change has been done in red
hat and other distros too . . . "

similarly your first command produces and error code for the same reason.

Sorry - - - not my policy - - -


What? Yes, the *system* pip should have some restrictions, if it's a 
system mainly managed by a package manager.


Setting up a venv is the *expected* approach to such situations, and 
creating one doesn't cause any problems. You end up with a pip in the 
activated venv that's going to install to a different path (the one in 
the venv), and will not be marked as externally managed, as the package 
manager has no control over that path.


That's the whole point.  What error are you getting?  The venv module is 
not the pip module so restrictions on the system pip have nothing to do 
with it.




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


Re: Help needed - - running into issues with python and its tools

2024-08-05 Thread o1bigtenor via Python-list
On Sun, Aug 4, 2024 at 8:49 AM Mats Wichmann via Python-list <
python-list@python.org> wrote:

> On 8/3/24 20:03, o1bigtenor via Python-list wrote:
>
> > My question was, is and will be (and the doc absolutely doesn't cover it)
> > how do I install a different version in the venv so that python 3.11.x on
> > the
> > system is not discombobulated by the python 3.12.x in the venv.
> > That python 3.12 would let me run the tools needed.
> > (Its the how to install the next version of python that I just haven't
> been
> > able to find information on - - - and I would be looking for information
> > on how to install on a *nix.)
>
> To get a different Python "in" the venv, you use the version you want in
> the construction of the venv. For example:
>
>
> $ python3.13 -m venv new_venv
> $ new_venv/bin/python --version
> Python 3.13.0b4
> $ source new_venv/bin/activate
>
>
 "https://peps.python.org/pep-0668/ PEP 668, which prevents pip from
interacting with the OS installed python. This change has been done in red
hat and other distros too . . . "

similarly your first command produces and error code for the same reason.

Sorry - - - not my policy - - -

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


Re: Help needed - - running into issues with python and its tools

2024-08-05 Thread o1bigtenor via Python-list
On Sun, Aug 4, 2024 at 4:24 AM Peter J. Holzer via Python-list <
python-list@python.org> wrote:

> On 2024-08-03 15:17:11 -0500, o1bigtenor via Python-list wrote:
> > One of the tools I need to be able to use is esptools - -  well in the
> > devuan world you need to run that on either Devaun 3 or 5 - - - its just
> > not available on devuan 4.
>
> Couldn't you just upgrade to Devuan 5, then?
>

I like uptime and not measured in hours either so I'm presently not running
Devuan 5
or testing - - - although I used to. Just found that I didn't need the most
recent versions
of most of the tools I was using so find the stability (except for the
bloody browsers)
in stable version is to be appreciated.

>
>
> > Tried installing all the tools I need using downloads and .deb installs
> but
> > then I need to have python3.12 and that's also not part of Devuan4.
>
> It seems weird that something would work with the (presumably) older
> version of Python in Devuan 3 and the (presumably) newer version of
> Python in Devuan 5, but not with the version in Devuan 4.
>

Well - - - pstool was available in a version that worked in Devuan 3,
psytool is available in a version that works in Devuan 4 - - - beyond my
pay
grade as to why there isn't a version available for Devuan 4.

>
>
> > Not versed enough to set up a good venv (if that's possible) so that I
> > could work in that specific venv and have my cake (and get to eat it too
> > (grin!).
>
> You need to install Python first to create a venv. AFAIK there is no way
> to set up a venv first and then install Python into it.
>
> Does Devuan have a testing or unstable suite? You might be able to
> install a newer Python version from that. If not your best bet is to
> install Python from source.
>
>
First question answered earlier.
If I installed python 3.12 from source I would create a hung system for
myself.
(Been there and done that - - - got the T-shirt and it still stinks!)

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


Re: Help needed - - running into issues with python and its tools

2024-08-04 Thread Mats Wichmann via Python-list

On 8/3/24 20:03, o1bigtenor via Python-list wrote:


My question was, is and will be (and the doc absolutely doesn't cover it)
how do I install a different version in the venv so that python 3.11.x on
the
system is not discombobulated by the python 3.12.x in the venv.
That python 3.12 would let me run the tools needed.
(Its the how to install the next version of python that I just haven't been
able to find information on - - - and I would be looking for information
on how to install on a *nix.)


To get a different Python "in" the venv, you use the version you want in 
the construction of the venv. For example:



$ python3.13 -m venv new_venv
$ new_venv/bin/python --version
Python 3.13.0b4
$ source new_venv/bin/activate
...




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


Re: Help needed - - running into issues with python and its tools

2024-08-04 Thread Peter J. Holzer via Python-list
On 2024-08-03 15:17:11 -0500, o1bigtenor via Python-list wrote:
> One of the tools I need to be able to use is esptools - -  well in the
> devuan world you need to run that on either Devaun 3 or 5 - - - its just
> not available on devuan 4.

Couldn't you just upgrade to Devuan 5, then?


> Tried installing all the tools I need using downloads and .deb installs but
> then I need to have python3.12 and that's also not part of Devuan4.

It seems weird that something would work with the (presumably) older
version of Python in Devuan 3 and the (presumably) newer version of
Python in Devuan 5, but not with the version in Devuan 4.


> Not versed enough to set up a good venv (if that's possible) so that I
> could work in that specific venv and have my cake (and get to eat it too
> (grin!).

You need to install Python first to create a venv. AFAIK there is no way
to set up a venv first and then install Python into it.

Does Devuan have a testing or unstable suite? You might be able to
install a newer Python version from that. If not your best bet is to
install Python from source.

hp


-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Help needed - - running into issues with python and its tools

2024-08-03 Thread o1bigtenor via Python-list
On Sat, Aug 3, 2024 at 7:11 PM dn via Python-list 
wrote:

> On 4/08/24 09:34, o1bigtenor via Python-list wrote:
> > On Sat, Aug 3, 2024 at 4:06 PM dn via Python-list <
> python-list@python.org>
> > wrote:
> >
> >> On 4/08/24 08:17, o1bigtenor via Python-list wrote:
> >>> Greetings
> >>>
> >>> Looking at ESP8266 and wanting to program it using micropython (really
> >>> don't want to have to learn C++ (not enough hours in the day as it
> >> is!!)).
> >>>
> >>> One of the tools I need to be able to use is esptools - -  well in the
> >>> devuan world you need to run that on either Devaun 3 or 5 - - - its
> just
> >>> not available on devuan 4.
> >>>
> >>> Tried installing all the tools I need using downloads and .deb installs
> >> but
> >>> then I need to have python3.12 and that's also not part of Devuan4.
> >>>
> >>> Not versed enough to set up a good venv (if that's possible) so that I
> >>> could work in that specific venv and have my cake (and get to eat it
> too
> >>> (grin!).
> >>>
> >>> Suggestions - - - ideas - - - please?
> >>
> >> Sorry if this offends, but this is a list of short-cuts and reasons why
> >> they don't work (immediately).
> >>
> >>
> >> Have just come from a discussion about 'how to start a project'. Amongst
> >> the questions to ask are: "what resources do we have (or can add) to
> >> achieve?".
> >>
> >
> > Fair question details interleaved - - -
> >
> >>
> >> In this case, if Python-skill is a "personnel-resource" (and C++ a
> >> "constraint"), will question the ESP over Raspberry Pi (say)?
> >>
> >
> > Well - - - RPi world technical specs is usable from -20 to 60 C (iirc on
> > the top number)
> > and for my project I absolutely need to have usability to at least -40 -
> -
> > could possibly do a bit less but -35 C is a hard requirement so the RPi
> > and Pico (which I would like to use) is out but ESP8266 runs in that -40
> to
> > 65 C
> > range.
>
> Interesting, but creates a mis-match of tools - battles for you to fight...
>

Not really - - - it takes a computer with psytool and about 5 or 6 other
python3.12
programs to load the microcontroller.
It is in writing the program for the microcontroller that micropython is
used not at
all in the loading.

>
>
> >> Why talking of Python 3.12 when the solution involves MicroPython?
> >>
> >
> > Because one uses psytool on one computer to transfer a program to the
> > MicroPython system.  In fact there are a set of tools that need
> Python3.12
> > to be able to do this and therefore the question.
> >
> >>
> >>
> >> Perhaps need to take a step back and look at 'options' - relate needs to
> >> resources, and evaluate the impact of each decision on later ones - as
> >> well as against your personal skills (modify objectives to limits, or
> >> accept that some learning/training will be necessary as pre-requisite to
> >> (being able to) attack the project).
> >>
> >> I have been investigating using a venv but am not finding clear
> directions
> > so
> > that I could set up Python3.12 inside (along with the other needed
> tools).
> > The
> > more I'm looking the less useful most of the information I'm finding is
> > becoming.
> > Therefore I thought I would go to the python gurus for information - - -
> > which I
> > have.
> >
> > So please - - - how do I set up a venv so that I can install and run
> python
> > 3.12
> > (and other needed programs related to 3.12) inside?
>
> If you mean venv itself, which "directions" have you reviewed?
> This one (https://python.land/virtual-environments/virtualenv) seems
> very straight-forward and shows "What's inside a venv?" to include
> python.exe. Given that venv is more-or-less the official/traditional
> solution, what are you doing differently - perhaps the question is
> lacking detail.
>
> Interesting - - - that's the doc I have been reading.

My question was, is and will be (and the doc absolutely doesn't cover it)
how do I install a different version in the venv so that python 3.11.x on
the
system is not discombobulated by the python 3.12.x in the venv.
That python 3.12 would let me run the tools needed.
(Its the how to install the next version of python that I just haven't been
able to find information on - - - and I would be looking for information
on how to install on a *nix.)


> Personally, I'm using Poetry (https://python-poetry.org) which seemed
> just as easy to pick-up; plus pyenv to maintain multiple versions of
> Python on one machine.
>
>
Will give python-poetry a look.

Have been looking at pyenv but that seems to be a whole rat's nest of other
stuff to install and its using a bunch of different tools to get there - -
- is it
necessary - - - yes or no (in the running of multiple python versions on
the
same machine).

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


Re: Help needed - - running into issues with python and its tools

2024-08-03 Thread o1bigtenor via Python-list
On Sat, Aug 3, 2024 at 6:20 PM Cameron Simpson via Python-list <
python-list@python.org> wrote:

> On 03Aug2024 16:34, o1bigtenor  wrote:
> >So please - - - how do I set up a venv so that I can install and run
> >python
> >3.12
> >(and other needed programs related to 3.12) inside?
>
> Maybe this github comment will help with this:
>
> https://github.com/orgs/micropython/discussions/10255#discussioncomment-671
>

Not really.

A computer that has psytool + about 5 or 6 other python 3.12 tools is
needed to load
the microcontroller so I don't see how having venv in the microcontroller
would help the
loading of software onto the microcontroller.

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


Re: Help needed - - running into issues with python and its tools

2024-08-03 Thread dn via Python-list

On 4/08/24 09:34, o1bigtenor via Python-list wrote:

On Sat, Aug 3, 2024 at 4:06 PM dn via Python-list 
wrote:


On 4/08/24 08:17, o1bigtenor via Python-list wrote:

Greetings

Looking at ESP8266 and wanting to program it using micropython (really
don't want to have to learn C++ (not enough hours in the day as it

is!!)).


One of the tools I need to be able to use is esptools - -  well in the
devuan world you need to run that on either Devaun 3 or 5 - - - its just
not available on devuan 4.

Tried installing all the tools I need using downloads and .deb installs

but

then I need to have python3.12 and that's also not part of Devuan4.

Not versed enough to set up a good venv (if that's possible) so that I
could work in that specific venv and have my cake (and get to eat it too
(grin!).

Suggestions - - - ideas - - - please?


Sorry if this offends, but this is a list of short-cuts and reasons why
they don't work (immediately).


Have just come from a discussion about 'how to start a project'. Amongst
the questions to ask are: "what resources do we have (or can add) to
achieve?".



Fair question details interleaved - - -



In this case, if Python-skill is a "personnel-resource" (and C++ a
"constraint"), will question the ESP over Raspberry Pi (say)?



Well - - - RPi world technical specs is usable from -20 to 60 C (iirc on
the top number)
and for my project I absolutely need to have usability to at least -40 - -
could possibly do a bit less but -35 C is a hard requirement so the RPi
and Pico (which I would like to use) is out but ESP8266 runs in that -40 to
65 C
range.


Interesting, but creates a mis-match of tools - battles for you to fight...



Why talking of Python 3.12 when the solution involves MicroPython?



Because one uses psytool on one computer to transfer a program to the
MicroPython system.  In fact there are a set of tools that need Python3.12
to be able to do this and therefore the question.




Perhaps need to take a step back and look at 'options' - relate needs to
resources, and evaluate the impact of each decision on later ones - as
well as against your personal skills (modify objectives to limits, or
accept that some learning/training will be necessary as pre-requisite to
(being able to) attack the project).

I have been investigating using a venv but am not finding clear directions

so
that I could set up Python3.12 inside (along with the other needed tools).
The
more I'm looking the less useful most of the information I'm finding is
becoming.
Therefore I thought I would go to the python gurus for information - - -
which I
have.

So please - - - how do I set up a venv so that I can install and run python
3.12
(and other needed programs related to 3.12) inside?


If you mean venv itself, which "directions" have you reviewed?
This one (https://python.land/virtual-environments/virtualenv) seems 
very straight-forward and shows "What's inside a venv?" to include 
python.exe. Given that venv is more-or-less the official/traditional 
solution, what are you doing differently - perhaps the question is 
lacking detail.

(see also @Cameron's take)

Personally, I'm using Poetry (https://python-poetry.org) which seemed 
just as easy to pick-up; plus pyenv to maintain multiple versions of 
Python on one machine.


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


Re: Help needed - - running into issues with python and its tools

2024-08-03 Thread Cameron Simpson via Python-list

On 03Aug2024 16:34, o1bigtenor  wrote:
So please - - - how do I set up a venv so that I can install and run 
python

3.12
(and other needed programs related to 3.12) inside?


Maybe this github comment will help with this:
https://github.com/orgs/micropython/discussions/10255#discussioncomment-671
--
https://mail.python.org/mailman/listinfo/python-list


Re: Help needed - - running into issues with python and its tools

2024-08-03 Thread o1bigtenor via Python-list
On Sat, Aug 3, 2024 at 4:06 PM dn via Python-list 
wrote:

> On 4/08/24 08:17, o1bigtenor via Python-list wrote:
> > Greetings
> >
> > Looking at ESP8266 and wanting to program it using micropython (really
> > don't want to have to learn C++ (not enough hours in the day as it
> is!!)).
> >
> > One of the tools I need to be able to use is esptools - -  well in the
> > devuan world you need to run that on either Devaun 3 or 5 - - - its just
> > not available on devuan 4.
> >
> > Tried installing all the tools I need using downloads and .deb installs
> but
> > then I need to have python3.12 and that's also not part of Devuan4.
> >
> > Not versed enough to set up a good venv (if that's possible) so that I
> > could work in that specific venv and have my cake (and get to eat it too
> > (grin!).
> >
> > Suggestions - - - ideas - - - please?
>
> Sorry if this offends, but this is a list of short-cuts and reasons why
> they don't work (immediately).
>
>
> Have just come from a discussion about 'how to start a project'. Amongst
> the questions to ask are: "what resources do we have (or can add) to
> achieve?".
>

Fair question details interleaved - - -

>
> In this case, if Python-skill is a "personnel-resource" (and C++ a
> "constraint"), will question the ESP over Raspberry Pi (say)?
>

Well - - - RPi world technical specs is usable from -20 to 60 C (iirc on
the top number)
and for my project I absolutely need to have usability to at least -40 - -
could possibly do a bit less but -35 C is a hard requirement so the RPi
and Pico (which I would like to use) is out but ESP8266 runs in that -40 to
65 C
range.

>
> Why talking of Python 3.12 when the solution involves MicroPython?
>

Because one uses psytool on one computer to transfer a program to the
MicroPython system.  In fact there are a set of tools that need Python3.12
to be able to do this and therefore the question.

>
>
> Perhaps need to take a step back and look at 'options' - relate needs to
> resources, and evaluate the impact of each decision on later ones - as
> well as against your personal skills (modify objectives to limits, or
> accept that some learning/training will be necessary as pre-requisite to
> (being able to) attack the project).
>
> I have been investigating using a venv but am not finding clear directions
so
that I could set up Python3.12 inside (along with the other needed tools).
The
more I'm looking the less useful most of the information I'm finding is
becoming.
Therefore I thought I would go to the python gurus for information - - -
which I
have.

So please - - - how do I set up a venv so that I can install and run python
3.12
(and other needed programs related to 3.12) inside?

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


Re: Help needed - - running into issues with python and its tools

2024-08-03 Thread dn via Python-list

On 4/08/24 08:17, o1bigtenor via Python-list wrote:

Greetings

Looking at ESP8266 and wanting to program it using micropython (really
don't want to have to learn C++ (not enough hours in the day as it is!!)).

One of the tools I need to be able to use is esptools - -  well in the
devuan world you need to run that on either Devaun 3 or 5 - - - its just
not available on devuan 4.

Tried installing all the tools I need using downloads and .deb installs but
then I need to have python3.12 and that's also not part of Devuan4.

Not versed enough to set up a good venv (if that's possible) so that I
could work in that specific venv and have my cake (and get to eat it too
(grin!).

Suggestions - - - ideas - - - please?


Sorry if this offends, but this is a list of short-cuts and reasons why 
they don't work (immediately).



Have just come from a discussion about 'how to start a project'. Amongst 
the questions to ask are: "what resources do we have (or can add) to 
achieve?".


In this case, if Python-skill is a "personnel-resource" (and C++ a 
"constraint"), will question the ESP over Raspberry Pi (say)?


Why talking of Python 3.12 when the solution involves MicroPython?


Perhaps need to take a step back and look at 'options' - relate needs to 
resources, and evaluate the impact of each decision on later ones - as 
well as against your personal skills (modify objectives to limits, or 
accept that some learning/training will be necessary as pre-requisite to 
(being able to) attack the project).


--
Regards =dn

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


Help needed - - running into issues with python and its tools

2024-08-03 Thread o1bigtenor via Python-list
Greetings

Looking at ESP8266 and wanting to program it using micropython (really
don't want to have to learn C++ (not enough hours in the day as it is!!)).

One of the tools I need to be able to use is esptools - -  well in the
devuan world you need to run that on either Devaun 3 or 5 - - - its just
not available on devuan 4.

Tried installing all the tools I need using downloads and .deb installs but
then I need to have python3.12 and that's also not part of Devuan4.

Not versed enough to set up a good venv (if that's possible) so that I
could work in that specific venv and have my cake (and get to eat it too
(grin!).

Suggestions - - - ideas - - - please?

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


Re: Patrick Sheehan: Major Issues with Python

2023-03-26 Thread Thomas Passin

On 3/25/2023 4:03 PM, Patrick Sheehan wrote:

Hello, I have been working with the attached book (See photo)


Photos do not come through on this list, so don't bother to attach any.
Type or copy-paste any useful text.


to try to learn Python and so far it has been a complete nightmare
trying to get python installed and operating correctly.  I have
received a plethora of error messages and consulted youtube videos
and chat groups to try to remedy the issues.  I am using a computer
that is running Windows 10.


That's too bad. Normally a Python install on Windows is trouble free.
Perhaps we can help.


I have installed, and un-installed several versions of Python


Please give more information.  What versions of Python, where did you
get it, how did you install it, what options if any did you choose
during the installation?


and was able to complete the first two lessons in the attached book,
but could not complete lesson 3 (Turtledemo)...Some of the error
messages I have received include:  "This app cannot run on your PC";
"Unable to initialize device PRN"; “Python is not recognized as an
internal or external command”: "Python was not found: run without
arguments to install from Microsoft Store, or disable this shortcut
from settings mange, app execution aliases:"


You need to tell us just what you have done.  What was this "lesson" 
supposed to do?  Did you try to run it while you were working in 
PyCharm?  Just how did you try to run the lesson?



...I have been at this
for 4 days now at least three hours each day...Any information or
help you can provide would be greatly appreciated.  Additionally, I
do have PyCharm installed (As you can tell, I am a beginner), is
PyCharm the same thing as Python?  Thank you in advance!


No, PyCharm is an editor and Python IDE; it is not the same as Python.
Python is a programming language.  The problems you have been having 
could be caused by PyCharm not being set up to work with your 
installation of Python.


To see if Python has been installed correctly, open a Windows console. 
If you don't know how, one way is to hit the Windows key and type "cmd". 
 Windows will offer "Command Prompt".  Hit the ENTER key to accept it, 
and a console window will open. (There are more convenient ways, but we 
don't need to get into them right now).


In the console window, type (without the quotes) "py -V".  You should 
see something like this (The first line is what I typed, the second line 
is the response):


C:\Users\tom>py -V
Python 3.10.9

If this works, Python has been installed and apparently working.

If it is working, save the Python program from your lesson as a file 
with a name such as such as "lesson1.py". In an open console window. try 
to run it by typing


py lesson1.py

Instead of just "lesson1.py", you will either need to change directory 
(using the cd command) to the directory that contains that file, or you 
will need to use the full path to the file.  For example, if the file is


c:\temp\python\lesson1.py

then run it by typing

py c:\temp\python\lesson1.py

Let us know how it goes.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Patrick Sheehan: Major Issues with Python

2023-03-26 Thread MRAB

On 2023-03-25 20:03, Patrick Sheehan wrote:

Hello,
I have been working with the attached book (See photo) to try to learn
Python and so far it has been a complete nightmare trying to get python
installed and operating correctly.  I have received a plethora of error
messages and consulted youtube videos and chat groups to try to remedy the
issues.  I am using a computer that is running Windows 10.  I have
installed, and un-installed several versions of Python and was able to
complete the first two lessons in the attached book, but could not complete
lesson 3 (Turtledemo)...Some of the error messages I have received
include:  "This app cannot run on your PC"; "Unable to initialize device
PRN"; “Python is not recognized as an internal or external command”:
"Python was not found: run without arguments to install from Microsoft
Store, or disable this shortcut from settings mange, app execution
aliases:"...I have been at this for 4 days now at least three hours each
day...Any information or help you can provide would be greatly
appreciated.  Additionally, I do have PyCharm installed (As you can tell, I
am a beginner), is PyCharm the same thing as Python?  Thank you in advance!

This list strips attachments such as images, so I don't know which book 
you're referring to.


I'd go for Python 3.11 and the installer "Windows installer (64-bit)" at 
https://www.python.org/downloads/release/python-3112/, i.e. 
"https://www.python.org/ftp/python/3.11.2/python-3.11.2-amd64.exe"; 
(assuming that it's a 64-bit PC).
To run Python, the recommended way is to use the Python Launcher, py.exe 
(so type "py my_program.py" in a Command window), or just double-click 
on it if it's a GUI program.


As for PRN, that's the printer. Does anyone use PRN these days?

And, no, PyCharm is not the same thing as Python. PyCharm is an IDE 
(integrated development environment) for Python, but Python is its own 
thing.

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


Re: Patrick Sheehan: Major Issues with Python

2023-03-26 Thread Mats Wichmann

On 3/25/23 14:03, Patrick Sheehan wrote:

Hello,
I have been working with the attached book (See photo) to try to learn
Python and so far it has been a complete nightmare trying to get python
installed and operating correctly.  I have received a plethora of error
messages and consulted youtube videos and chat groups to try to remedy the
issues.  I am using a computer that is running Windows 10.  I have
installed, and un-installed several versions of Python and was able to
complete the first two lessons in the attached book, but could not complete
lesson 3 (Turtledemo)...Some of the error messages I have received
include:  "This app cannot run on your PC"; "Unable to initialize device
PRN"; “Python is not recognized as an internal or external command”:
"Python was not found: run without arguments to install from Microsoft
Store, or disable this shortcut from settings mange, app execution
aliases:"...


If you installed the conventional way, use the command name "py" instead 
of "python" to run things from a command shell.  Alternatively, you 
could try an installation of Python from the Microsoft Store (as the 
little stub program named python, which Microsoft preinstalls for the 
express purpose of giving you this hint).  There are times when getting 
Python working without hassle is easier when going that route.


You *can* add python to the search PATH, there's an option in the 
installer (you can rerun this from the Apps & features Settings 
applet)... in the screen for advanced options there's something that 
says "Add python to environment variables" or similar wording.


>I have been at this for 4 days now at least three hours each

day...Any information or help you can provide would be greatly
appreciated.  Additionally, I do have PyCharm installed (As you can tell, I
am a beginner), is PyCharm the same thing as Python? 


No. It's an "integrated development environment" - editor, debugger, 
source control wrangler and many other things.  It still needs to have a 
working Python installed. It will probably find the installed Python 
more easily than you will.  The concept of an IDE is you can do all your 
programming work without leaving it - you don't have to hop between 
editor, command line, and invoke other tools.  PyCharm is only one of 
many entrants in this space for Python programmers.  It's excellent, but 
I find it rather, ummm, "bulky", for beginners - there are a ton of 
features you'll not use early on in your journey, and thus I find it 
makes it much harder to find the things you do need in menus, help, etc. 
Up to you whether you push ahead with using it now, or leave it for a 
bit later when you're doing more complex things.


We have no idea what book you're using, by the way, as the list strips 
images and other attachments.  In any case, there are hundreds of Python 
books out now, most of us don't know about a particular one (unless we 
wrote it :) )



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


Patrick Sheehan: Major Issues with Python

2023-03-26 Thread Patrick Sheehan
Hello,
I have been working with the attached book (See photo) to try to learn
Python and so far it has been a complete nightmare trying to get python
installed and operating correctly.  I have received a plethora of error
messages and consulted youtube videos and chat groups to try to remedy the
issues.  I am using a computer that is running Windows 10.  I have
installed, and un-installed several versions of Python and was able to
complete the first two lessons in the attached book, but could not complete
lesson 3 (Turtledemo)...Some of the error messages I have received
include:  "This app cannot run on your PC"; "Unable to initialize device
PRN"; “Python is not recognized as an internal or external command”:
"Python was not found: run without arguments to install from Microsoft
Store, or disable this shortcut from settings mange, app execution
aliases:"...I have been at this for 4 days now at least three hours each
day...Any information or help you can provide would be greatly
appreciated.  Additionally, I do have PyCharm installed (As you can tell, I
am a beginner), is PyCharm the same thing as Python?  Thank you in advance!

Respectfully,
Patrick Sheehan
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Issues with Python

2020-06-03 Thread DL Neil via Python-list

On 4/06/20 2:22 PM, Kelley Hudson wrote:

Keep getting an error when trying to us Python with Pycharm. I uninstalled
it but this was the error I received.

 


Sent from [1]Mail for Windows 10

 


References

Visible links
1. https://go.microsoft.com/fwlink/?LinkId=550986



Many folk are security-conscious and will not click on links provided by 
unknown people (apologies for sounding unfriendly).


Recommend you copy-paste the exact message into an email (also request a 
descriptive Subject: which will help anyone with a similar problem to 
search the archives). Also, it may help to know the OpSys (assuming 
MS-Windows), the version of Python, and that of the Pycharm IDE...


Meantime, the Pycharm folk have invested considerable time and effort in 
their on-line manual. Is there an answer there about how to link 
particular (versions) Python interpreters to the current project?

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


Issues with Python

2020-06-03 Thread Kelley Hudson
   Keep getting an error when trying to us Python with Pycharm. I uninstalled
   it but this was the error I received.

    

   Sent from [1]Mail for Windows 10

    

References

   Visible links
   1. https://go.microsoft.com/fwlink/?LinkId=550986
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fwd: Issues with python commands in windows powershell

2017-09-21 Thread Thomas Jollans
On 2017-09-20 21:52, Terry Reedy wrote:
> On 9/20/2017 1:09 PM, Joey Steward wrote:
>> -- Forwarded message --
>> From: Joey Steward 
>> Date: Tue, Sep 19, 2017 at 10:30 PM
>> Subject: Issues with python commands in windows powershell
>> To: python-list@python.org
>>
>>
>> Hello,
>>
>> I've been having issues using basic python commands in windows
>> powershell.
>> I'm new to programming so just going off of online tutorials.
>>
>> Earlier I was unable to use pip to install Django (pip install
>> Django), and
>> came to this forum for help and someone was able to give me the correct
>> command for windows 10 (py -m pip install django).
>>
>> I've been trying to run this command django-admin startproject
>> mytests, but
>> get the same error message as when trying to run the original pip
> 
> Try py -m django-admin startproject mytests.  If this does not work, ask
> on django lists.

I doubt that will work; "django-admin" is not a valid module name.


Joey, there should be a folders called "bin" and "scripts" (or something
like that) in your Python installation. One of them, I expect, will
contain a django-admin.exe. (Or .bat? Or .cmd? Whatever.)
Adding these folders to your PATH environment variable (don't ask me
how) will solve these problems. IIRC you can do this for PowerShell
specifically or for Windows in general, whichever you think is best.

> 
>> django-admin : *The term 'django-admin' is not recognized as the name
>> of a
>> cmdlet, function, script file, or operable program. Check the spelling of
>> the name, or if a path was included,*
>> *verify that the path is correct and try again.*
>> *At line:1 char:1*
>> + django-admin startproject mytestsite
>> + 
>>  + CategoryInfo  : ObjectNotFound: (django-admin:String) [],
>> CommandNotFoundException
>>  + FullyQualifiedErrorId : CommandNotFoundException
>>
>>
>> I'm very new so honestly have no idea what the issue may be, but from
>> previously trying to use python I think it may have something to do with
>> configuring windows environment variables? Not sure, but just something
>> I've ran into in the past previous times trying to learn python for more
>> data analysis purposes.
>>
>> Any help would be greatly appreciated!
>>
>> Thanks a lot,
>>
>> Joey Steward
>>
> 
> 


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


Re: Fwd: Issues with python commands in windows powershell

2017-09-20 Thread Terry Reedy

On 9/20/2017 1:09 PM, Joey Steward wrote:

-- Forwarded message --
From: Joey Steward 
Date: Tue, Sep 19, 2017 at 10:30 PM
Subject: Issues with python commands in windows powershell
To: python-list@python.org


Hello,

I've been having issues using basic python commands in windows powershell.
I'm new to programming so just going off of online tutorials.

Earlier I was unable to use pip to install Django (pip install Django), and
came to this forum for help and someone was able to give me the correct
command for windows 10 (py -m pip install django).

I've been trying to run this command django-admin startproject mytests, but
get the same error message as when trying to run the original pip


Try py -m django-admin startproject mytests.  If this does not work, ask 
on django lists.



django-admin : *The term 'django-admin' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included,*
*verify that the path is correct and try again.*
*At line:1 char:1*
+ django-admin startproject mytestsite
+ 
 + CategoryInfo  : ObjectNotFound: (django-admin:String) [],
CommandNotFoundException
 + FullyQualifiedErrorId : CommandNotFoundException


I'm very new so honestly have no idea what the issue may be, but from
previously trying to use python I think it may have something to do with
configuring windows environment variables? Not sure, but just something
I've ran into in the past previous times trying to learn python for more
data analysis purposes.

Any help would be greatly appreciated!

Thanks a lot,

Joey Steward




--
Terry Jan Reedy

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


Re: Fwd: Issues with python commands in windows powershell

2017-09-20 Thread Bill

Joey Steward wrote:

-- Forwarded message --
From: Joey Steward 
Date: Tue, Sep 19, 2017 at 10:30 PM
Subject: Issues with python commands in windows powershell
To: python-list@python.org


Hello,

I've been having issues using basic python commands in windows powershell.


Did you try the same ones in an environment besides powershell?


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


Fwd: Issues with python commands in windows powershell

2017-09-20 Thread Joey Steward
-- Forwarded message --
From: Joey Steward 
Date: Tue, Sep 19, 2017 at 10:30 PM
Subject: Issues with python commands in windows powershell
To: python-list@python.org


Hello,

I've been having issues using basic python commands in windows powershell.
I'm new to programming so just going off of online tutorials.

Earlier I was unable to use pip to install Django (pip install Django), and
came to this forum for help and someone was able to give me the correct
command for windows 10 (py -m pip install django).

I've been trying to run this command django-admin startproject mytests, but
get the same error message as when trying to run the original pip

django-admin : *The term 'django-admin' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included,*
*verify that the path is correct and try again.*
*At line:1 char:1*
+ django-admin startproject mytestsite
+ 
+ CategoryInfo  : ObjectNotFound: (django-admin:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException


I'm very new so honestly have no idea what the issue may be, but from
previously trying to use python I think it may have something to do with
configuring windows environment variables? Not sure, but just something
I've ran into in the past previous times trying to learn python for more
data analysis purposes.

Any help would be greatly appreciated!

Thanks a lot,

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


Fwd: Issues with python commands in windows powershell

2017-09-20 Thread Joey Steward
-- Forwarded message --
From: Joey Steward 
Date: Wed, Sep 20, 2017 at 10:09 AM
Subject: Fwd: Issues with python commands in windows powershell
To: python-list@python.org



-- Forwarded message --
From: Joey Steward 
Date: Tue, Sep 19, 2017 at 10:30 PM
Subject: Issues with python commands in windows powershell
To: python-list@python.org


Hello,

I've been having issues using basic python commands in windows powershell.
I'm new to programming so just going off of online tutorials.

Earlier I was unable to use pip to install Django (pip install Django), and
came to this forum for help and someone was able to give me the correct
command for windows 10 (py -m pip install django).

I've been trying to run this command django-admin startproject mytests, but
get the same error message as when trying to run the original pip

django-admin : *The term 'django-admin' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included,*
*verify that the path is correct and try again.*
*At line:1 char:1*
+ django-admin startproject mytestsite
+ 
+ CategoryInfo  : ObjectNotFound: (django-admin:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException


I'm very new so honestly have no idea what the issue may be, but from
previously trying to use python I think it may have something to do with
configuring windows environment variables? Not sure, but just something
I've ran into in the past previous times trying to learn python for more
data analysis purposes.

Any help would be greatly appreciated!

Thanks a lot,

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


Fwd: Issues with python commands in windows powershell

2017-09-20 Thread Joey Steward
-- Forwarded message --
From: Joey Steward 
Date: Tue, Sep 19, 2017 at 10:30 PM
Subject: Issues with python commands in windows powershell
To: python-list@python.org


Hello,

I've been having issues using basic python commands in windows powershell.
I'm new to programming so just going off of online tutorials.

Earlier I was unable to use pip to install Django (pip install Django), and
came to this forum for help and someone was able to give me the correct
command for windows 10 (py -m pip install django).

I've been trying to run this command django-admin startproject mytests, but
get the same error message as when trying to run the original pip

django-admin : *The term 'django-admin' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included,*
*verify that the path is correct and try again.*
*At line:1 char:1*
+ django-admin startproject mytestsite
+ 
+ CategoryInfo  : ObjectNotFound: (django-admin:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException


I'm very new so honestly have no idea what the issue may be, but from
previously trying to use python I think it may have something to do with
configuring windows environment variables? Not sure, but just something
I've ran into in the past previous times trying to learn python for more
data analysis purposes.

Any help would be greatly appreciated!

Thanks a lot,

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


Issues with python commands in windows powershell

2017-09-19 Thread Joey Steward
Hello,

I've been having issues using basic python commands in windows powershell.
I'm new to programming so just going off of online tutorials.

Earlier I was unable to use pip to install Django (pip install Django), and
came to this forum for help and someone was able to give me the correct
command for windows 10 (py -m pip install django).

I've been trying to run this command django-admin startproject mytests, but
get the same error message as when trying to run the original pip

django-admin : *The term 'django-admin' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included,*
*verify that the path is correct and try again.*
*At line:1 char:1*
+ django-admin startproject mytestsite
+ 
+ CategoryInfo  : ObjectNotFound: (django-admin:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException


I'm very new so honestly have no idea what the issue may be, but from
previously trying to use python I think it may have something to do with
configuring windows environment variables? Not sure, but just something
I've ran into in the past previous times trying to learn python for more
data analysis purposes.

Any help would be greatly appreciated!

Thanks a lot,

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


Re: Issues with Python

2017-07-31 Thread Daniele Forghieri

Il 30/07/2017 23:31, Ode Idoko via Python-list ha scritto:

Hi, I am new to Python and though I have been able to download the 3.6 version 
on my laptop , I still have issues with the syntax. While writing a program to 
execute, it will display syntax error with different shades of color usually 
green or yellow.
What can I do about this? How do I know the error and effect it? Can't it be 
programmed like we have in excel that will tell you error and prompt you if you 
wish to accept the right formula format?
Please I need more information on this.
Thanks.
Ode

Sent from my iPhone


If you use eclipse with the pydev extensions or, directly, liclipse 
you have (some) error and warnings, for example if you use a variable 
not defined or if you try to use a variable with the same name of a 
reserved symbol.


It's not completed as you run the program but it's really helpful.

Daniele Forghieri




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


Re: Issues with Python

2017-07-30 Thread Byung-Hee HWANG (황병희, 黃炳熙)
Ode Idoko via Python-list  께서 쓰시길,
 《記事 全文  에서》:

> ... it will display syntax error with ...

Maybe, you did copy & paste, just i guess ... if not, ignore it.

-- 
^고맙습니다 _白衣從軍_ 감사합니다_^))//

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


Re: Issues with Python

2017-07-30 Thread Rick Johnson
> Hi, I am new to Python and though I have been able to
> download the 3.6 version on my laptop , I still have
> issues with the syntax. While writing a program to
> execute, it will display syntax error with different
> shades of color usually green or yellow.

Which IDE (aka: fancy text editor) are you using to write this
code?

> What can I do about this?

About what?

(!) Do you want to change the colors of the syntax
hilighting?

(2) Do you want to know how to prevent or fix syntax errors?

(3) Something else entirely?

Unfortunately last weekend i had to pawn my crystal ball to
payoff the vig, (it seems my financier is not the type to
just "fuggetaboutit") so i'm afraid you'll have to be a
_little_ more specific when asking questions. But seriously.
:-) Syntax hilighting is used by some editors to help a
programmer differentiate between certain elements of code.
And this hilighting can be very helpful to the beginner.

> How do I know the error and effect it?

Oh, you'll know when you make a mistake, because Python will
throw an error message. For instance, if you type "aaa"
(without the quotes) at the Python command prompt, you'll
receive a message that looks similar to this:

Traceback (most recent call last):
  File "", line 1, in 
aaa
NameError: name 'aaa' is not defined

This one is easy to diagnose. But in order to understand
Python exception messages you need to read some tutorials.
If you think you can start writing code (even Python code)
without some sort of "guide", then you're going to have a
real difficult time. Even folks with prior programming
experience need a guide. I imagine it would be like a
delivery driver moving from Paris to London and trying to
navigate around the streets of Merry ol' London using a map
of Paris. It's just not practical.

> Can't it be programmed like we have in excel that will tell
> you error and prompt you if you wish to accept the right
> formula format?

By utilizing Python, or any other programming language that
is available (and boy, there are quite a few of them!), you
can program your computer to do just about anything you
want. Maybe you could even write a real life HAL5000! But if
you're expecting that your experience with Micrcosoft Excel
formulas will translate over into Python, well, then, you're
in a tough time. Excel is a "single purpose software"
whereas Python is a "general purpose programming language".
Using Python, you could write a spreadsheet program like
Excel. Although I wouldn't suggest it, as there are already
tons of them freely available, and Python is not the best
language for something like that, and Microsoft would not be
too happy about it. But you could do it if you were so
inclined. My advice is that you visit the Python.org website
and look through the list of tutorials for absolute
beginners. After completing a few of these tutorials, you
should be off and running in no time. Here is link:

https://wiki.python.org/moin/BeginnersGuide/NonProgrammers

After clicking the link, skip down to the section titled
"Tutorials and Websites", and start with "One Day of IDLE
Toying". IDLE is a "fancy text editor" that ships with
Python, and this tutorial is very gentle on beginners. After
you have finished "One Day of IDLE Toying", my next
suggestion would be "A Byte of Python", which will introduce
you to some basics. From there, you can go through all the
other tutorials. When you have finished all the beginner
tutorials, then take a stab at the advanced section. Here is
a link

https://wiki.python.org/moin/BeginnersGuide/Programmers

And don't forget, Google is a programmers best friend.

Who surprisingly, hardly ever complains.

Which unfortunately, is something i cannot say for the women
i have known. But i digress! O;-)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Issues with Python

2017-07-30 Thread Irmen de Jong
On 30/07/2017 23:31, Ode Idoko wrote:
> Hi, I am new to Python and though I have been able to download the 3.6 
> version on my laptop , I still have issues with the syntax. While writing a 
> program to execute, it will display syntax error with different shades of 
> color usually green or yellow. 
> What can I do about this? How do I know the error and effect it? Can't it be 
> programmed like we have in excel that will tell you error and prompt you if 
> you wish to accept the right formula format? 
> Please I need more information on this. 
> Thanks. 
> Ode 
> 
> Sent from my iPhone
> 

You'll have to learn the language if you want to do anything meaningful with it.
Python isn't anything like excel formula's, it is a full general multipurpose
programming language.  If you make a mistake, it usually is almost impossible 
to deduce
what you meant to write instead. (because otherwise we wouldn't have to program 
our
computers anymore and instead let them figure out automatically what we wanted 
to do,
right? Just joking)

Because you are comparing it to excel formulas: are you sure you've chosen the 
right
tool for whatever the task is that you wanted to solve?
If so: may I suggest first working through the Python tutorial.
https://docs.python.org/3/tutorial/index.html


Irmen

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


Re: Issues with Python

2017-07-30 Thread MRAB

On 2017-07-30 22:31, Ode Idoko via Python-list wrote:

Hi, I am new to Python and though I have been able to download the 3.6 version 
on my laptop , I still have issues with the syntax. While writing a program to 
execute, it will display syntax error with different shades of color usually 
green or yellow.
What can I do about this? How do I know the error and effect it? Can't it be 
programmed like we have in excel that will tell you error and prompt you if you 
wish to accept the right formula format?
Please I need more information on this.
Thanks.
Ode


If there's a syntax error, it'll tell you what the error is.

If it's merely showing parts of a line in different colours, that's 
"syntax colouring". In IDLE, for example, comments are shown in red and 
string literals are shown in green.

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


Issues with Python

2017-07-30 Thread Ode Idoko via Python-list
Hi, I am new to Python and though I have been able to download the 3.6 version 
on my laptop , I still have issues with the syntax. While writing a program to 
execute, it will display syntax error with different shades of color usually 
green or yellow. 
What can I do about this? How do I know the error and effect it? Can't it be 
programmed like we have in excel that will tell you error and prompt you if you 
wish to accept the right formula format? 
Please I need more information on this. 
Thanks. 
Ode 

Sent from my iPhone
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: issues with Python

2015-10-15 Thread Ian Kelly
On Thu, Oct 15, 2015 at 8:04 AM,   wrote:
>
> I am using the Python Programming third edition for absolute beginners.
> I was able to create my Game over program, but I do not have the start menu
> with the icons and cannot seem to find it. I have the Shell and the script
> mode but I am not able to find the start menu with the icons the book speaks
> of. When I try to edit the Idle/Shell screen I cannot.
>
> I am un installing and going to re-install, but wanted you to be aware.

I'm not familiar with the book, but by "start menu" might it mean the
*Windows* start menu?
-- 
https://mail.python.org/mailman/listinfo/python-list


issues with Python

2015-10-15 Thread vjdeluccie




I am using the Python Programming third edition for absolute beginners. 

I was able to create my Game over program, but I do not have the start menu 
with the icons and cannot seem to find it. I have the Shell and the script mode 
but I am not able to find the start menu with the icons the book speaks of. 
When I try to edit the Idle/Shell screen I cannot. 


I am un installing and going to re-install, but wanted you to be aware. 





Sent from Windows Mail-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Indentation issues with python

2015-02-05 Thread Denis McMahon
On Wed, 04 Feb 2015 19:07:53 -0800, syed khalid wrote:

> I downloaded this code and am attempting to run it. I keep getting
> indentation error.

> class EventHubClient(object):
> def sendMessage(self,body,partition):eventHubHost =
> "pac-ns.servicebus.windows.net"
>httpclient = _HTTPClient(service_instance=self)

> def sendMessage(self,body,partition):
> ^

> IndentationError: expected an indented block
> ***
> sasKeyName = "SendPolicy"
> sasKeyValue = "erENqf/5wdWCNEbCA9NsDIRqd5MRKdkii07+wezl/NU="

class starts a class definition. def starts a function (or method) 
definition. The parser expects these definitions to be followed by one or 
more indented lines being the code of the class or function (method).

The following lines down to either a return or the next function 
definition line should probably all be indented.

eg:

class EventHubClient(object):

def sendMessage(self,body,partition):
eventHubHost = "pac-ns.servicebus.windows.net"
httpclient = _HTTPClient(service_instance=self)
sasKeyName = "SendPolicy"
sasKeyValue = "erENqf/5wdWCNEbCA9NsDIRqd5MRKdkii07+wezl/NU="
.. more indented code should probably follow

Getting the indentation correct is absolutely critical in Python.

-- 
Denis McMahon, denismfmcma...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Indentation issues with python

2015-02-04 Thread Terry Reedy



class EventHubClient(object):  ...
def sendMessage(self,body,partition):

...
> ^

IndentationError: expected an indented block
***


and 'def' is not indented as it must be.  This must be covered in the 
tutorial.


--
Terry Jan Reedy

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


Re: Indentation issues with python

2015-02-04 Thread Ben Finney
syed khalid  writes:

>  I downloaded this code and am attempting to run it. I keep getting
> indentation error.

Indentation is crucial information in Python code. If it is lost, don't
waste time trying to guess it; instead, get the correct code.

How did you download it? You should download the code as a “plain text”
file.

-- 
 \ “I got some new underwear the other day. Well, new to me.” —Emo |
  `\   Philips |
_o__)  |
Ben Finney

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


Indentation issues with python

2015-02-04 Thread syed khalid
 I downloaded this code and am attempting to run it. I keep getting
indentation error. there is a way to handle it with a editor which can
recognize the tab or space issue. I have tried different options such as 2
or 3 spaces or tab to no avail.

I have encased the error mesage with line 23 between ""

import sys
import azure
import socket

from azure.servicebus import (
_service_bus_error_handler
)

from azure.servicebus.servicebusservice import (
ServiceBusService,
ServiceBusSASAuthentication
)

from azure.http import (
HTTPRequest,
HTTPError
)

from azure.http.httpclient import _HTTPClient

class EventHubClient(object):
def sendMessage(self,body,partition):eventHubHost =
"pac-ns.servicebus.windows.net"
httpclient = _HTTPClient(service_instance=self)
 
File "test1.py", line 23
def sendMessage(self,body,partition):
^
IndentationError: expected an indented block
***
sasKeyName = "SendPolicy"
sasKeyValue = "erENqf/5wdWCNEbCA9NsDIRqd5MRKdkii07+wezl/NU="

authentication = ServiceBusSASAuthentication(sasKeyName,sasKeyValue)

request = HTTPRequest()
request.method = "POST"
request.host = eventHubHost
request.protocol_override = "https"
request.path = "/myhub/publishers/" + partition +
"/messages?api-version=2014-05
"
request.body = body
request.headers.append(('Content-Type',
'application/atom+xml;type=entry;charset
=utf-8'))

authentication.sign_request(request, httpclient)

request.headers.append(('Content-Length', str(len(request.body)))



-- 
*Syed Khalid*
-- 
https://mail.python.org/mailman/listinfo/python-list


Issues with python/libtcod

2012-11-07 Thread Graham Fielding




Hey, all. I'm trying to program a roguelike, using the wonderful tutorials 
written by João F. Henriques (a.k.a. Jotaf), but I've stumbled onto a bit of a 
problem setting up the game's inventory system, and I was hoping someone could 
help me out. Here's a code snippet, including the affected line. #def 
menu(header, options, width):
#if len(options) > 26: raise ValueError('Cannot have a menu with more than 
26 options.')
 
#calculate total height for the header (after auto-wrap) and one line per 
option
#header_height = libtcod.console_height_left_rect(con, 0, 0, width, 
SCREEN_HEIGHT, header)
#height = len(options) + header_height
In a nutshell: def menu() is an all-encompassing 'menu processor' function -- 
it contains a standardized menu layout that can be called, from anywhere in the 
stack, to create a generic menu. When I launch the game to check things out, 
everything runs smoothly until I try to open the inventory window -- at which 
point, IDLE  tosses up an AttributeError:
File "C:/Python Project/Roguelike.py", line 602, in 
player_action = handle_keys()
  File "C:/Python Project/Roguelike.py", line 531, in handle_keys
chosen_item = inventory_menu('Press the key next to an item to use it, or 
any other to cancel.\n')
  File "C:/Python Project/Roguelike.py", line 487, in inventory_menu
index = menu(header, options, INVENTORY_WIDTH)
  File "C:/Python Project/Roguelike.py", line 447, in menu
header_height = libtcod.console_height_left_rect(con, 0, 0, width, 
SCREEN_HEIGHT, header)
AttributeError: 'module' object has no attribute 'console_height_left_rect' 
I've tried moving the entire def menu() function to various sections of the 
stack, I've changed its arguments manually, and I've even removed the affected 
line entirely to see if that would help; nothing seems to work, and it's only 
when def menu() is called that this happens. Anyone got any ideas what could be 
going flooey?-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Issues with Python + Batch File

2008-03-25 Thread Gabriel Genellina
En Tue, 25 Mar 2008 08:55:12 -0300, tarun <[EMAIL PROTECTED]>  
escribió:

> I've a batch file which invoks a python file. The python code in the file
> brings up a GUI. The GUI is of a test tool which can execute scripts.
>
> I tried using the following 2 sample of code for my batch file:
>
> * (1)   (2)*
> D:\opengui.py  D:\opengui.py
> goto:end   goto:end
> :end   :end
> EXIT   TASKKILL /IM C:\WINDOWS\system32\cmd.exe
>
> Double clicking on the batch file brings up a DOS BOX which opens up the
> GUI. On Closing the GUI, the DOS BOX both get closed. But if I close the  
> GUI
> when a test is under execution, the GUI gets closed but the DOS BOX still
> remains open.
>
> I want to some how close the DOS BOX when the GUI is closed.

Either rename the script "opengui.pyw" or start it explicitely using:  
pythonw d:\opengui.py

pythonw.exe doesn't create a console (what you call a "DOS BOX").

-- 
Gabriel Genellina

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


Issues with Python + Batch File

2008-03-25 Thread tarun
Hi All,
I've a batch file which invoks a python file. The python code in the file
brings up a GUI. The GUI is of a test tool which can execute scripts.

I tried using the following 2 sample of code for my batch file:

* (1)   (2)*
D:\opengui.py  D:\opengui.py
goto:end   goto:end
:end   :end
EXIT   TASKKILL /IM C:\WINDOWS\system32\cmd.exe

Double clicking on the batch file brings up a DOS BOX which opens up the
GUI. On Closing the GUI, the DOS BOX both get closed. But if I close the GUI
when a test is under execution, the GUI gets closed but the DOS BOX still
remains open.

I want to some how close the DOS BOX when the GUI is closed.

Thanks & Regards,
Tarun
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list