Re: [Tutor] Wish to upgrade Python 3.6.5 to Python 3.6.6 for Linux Mint 19

2018-07-15 Thread Mats Wichmann
On 07/15/2018 12:38 AM, boB Stepp wrote:
> On Sat, Jul 14, 2018 at 11:52 PM boB Stepp  wrote:
>>
>> On Sat, Jul 14, 2018 at 8:43 PM boB Stepp  wrote:
>>>
>>> On Sat, Jul 14, 2018 at 8:23 PM Mats Wichmann  wrote:

 take a look at pyenv. should make it fairly easy.

 https://github.com/pyenv/pyenv
>>>
>>> This does look interesting.  On the linked page, after installing and
>>> configuring pyenv, it says to install Python as follows giving a 2.7.8
>>> example:
>>>
>>> $ pyenv install 2.7.8
>>>
>>> Where and how does it get its Python installation?
>>
>> After a lot of searching, I'm still not sure how pyenv is working its
>> magic.  On https://github.com/pyenv/pyenv/wiki it says:
>>
>> "pyenv will try its best to download and compile the wanted Python version, 
>> ..."
>>
>> This suggests that it is getting the source from somewhere
>> (python.org/downloads ?) and then compiling it locally.  Is this what
>> it actually does?
> 
> After too much fruitless searching I finally found a more direct
> confirmation of what I was suspecting to be true at
> 
> "In contrast, with PyEnv, you install a Python. This can be a version
> of CPython, PyPy, IronPython, Jython, Pyston, stackless, miniconda, or
> even Anaconda. It downloads the sources from the official repos, and
> compiles them on your machine [1]. Plus, it provides an easy and
> transparent way of switching between installed versions (including any
> system-installed versions). After that, you use Python's own venv and
> pip."
> 
> This sounds like exactly what I need!  Thanks for this, Mats!!  I will
> give it a whirl later today after I wake up.
> 

Right... sorry for not following up sooner, it tries to download and
build a Python from sources, while not messing with the system-installed
Python.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] putting accent on letters while user is typing in Entrybox (Tkinter)

2018-07-15 Thread Ali M
Hi. I want to write these (ĝ, ĉ, ĵ, ĥ, ŭ, ĉ) accented letters when the user
types (gx, cx, jx, ux, cx).

when user types 'gx' for example i want to remove that x and replace it
with the accent. how should i do that? and how should i specify which
accent goes above which letter? thanks.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Wish to upgrade Python 3.6.5 to Python 3.6.6 for Linux Mint 19

2018-07-15 Thread Terry Carroll

On Sat, 14 Jul 2018, boB Stepp wrote:


Linux Mint 19 comes with Python 3.6.5 pre-installed
But after much searching I cannot find an _easy_ way to do
this upgrade.


Unlike many distributions, Mint's philosophy is *not* to install most 
updates by default, on the "if it's not broken, don't fix it" theory.


That being said, if you do want to update to the latest version available 
for Mint, this command should do it for you:


  sudo apt-get install --only-upgrade python3

If Mint doesn't have a vetted 3.6.6 yet, I would leave it alone.

--
Terry Carroll
carr...@tjc.com
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Wish to upgrade Python 3.6.5 to Python 3.6.6 for Linux Mint 19

2018-07-15 Thread boB Stepp
On Sun, Jul 15, 2018 at 3:30 PM Terry Carroll  wrote:
> That being said, if you do want to update to the latest version available
> for Mint, this command should do it for you:
>
>sudo apt-get install --only-upgrade python3
>
> If Mint doesn't have a vetted 3.6.6 yet, I would leave it alone.

This is what led me to my question, I could not find a "vetted 3.6.6".
However, I will keep your suggested command in mind for the future.

I have decided I am going to try out Mats' suggestion of pyenv.  It
seems clean, flexible, and does not mess with the system Python.

Thanks!
-- 
boB
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] 哦zdtzewsswzzs

2018-07-15 Thread Ting Qu


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] 草中心主任ccttfz

2018-07-15 Thread Ting Qu


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] 你

2018-07-15 Thread Ting Qu
这次S太相信z C x x z c z xs
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] ze

2018-07-15 Thread Ting Qu


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Wish to upgrade Python 3.6.5 to Python 3.6.6 for Linux Mint 19

2018-07-15 Thread boB Stepp
On Sat, Jul 14, 2018 at 8:23 PM Mats Wichmann  wrote:
>
> take a look at pyenv. should make it fairly easy.
>
> https://github.com/pyenv/pyenv

I just completed getting access to Python 3.6.6 using pyenv, so I
guess I'll post my experience for future searchers.  It was not
totally painless, and I am still pondering whether I used "sudo"
inappropriately or not.  Recall I am on Linux Mint 19 Cinnamon
edition.

First, the page Mats linked to mentioned an automatic installer for
pyenv in another GitHub project of the author's, so I used that.  It
was here:  https://github.com/pyenv/pyenv-installer

I used the recommended "GitHub way" instead of the PyPi way which
apparently is still in development and doesn't work for Python 3
anyway.  So I ran:

$ curl -L 
https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer
| bash

Then I added to the end of my .bashrc:

export PATH="/home/bob/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

This apparently allows pyenv's "shims" to take precedence in the
search path for Python versions.  Warning:  On the page Mats linked
there are some reports of getting into an infinite search loop if
these lines are added to .bashrc.  After pondering the specifics I did
not think it would affect me, so I went ahead with what I did.

I then did the suggested restart of my shell with:

$ exec "$SHELL"

pyenv seemed to be successfully installed.  I ran

$ pyenv update

just to be sure I had the latest, greatest, which I did.  I then ran

$pyenv install --list

to see if Python 3.6.6 was available.  It was and the list of
available versions is HUGE running from 2.1.3 to 3.8-dev to Active
Python versions to Anaconda versions, IronPython, Jython, MiniConda,
PyPy, Stackless, etc.  So I thought I was ready to download and
install Python 3.6.6 with

$ pyenv install 3.6.6

It *did* download from
https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tar.xz, something
you could tell I was concerned about from my earlier posts.
Unfortunately I got:

Installing Python-3.6.6...

BUILD FAILED (LinuxMint 19 using python-build 20180424)

So I went to https://github.com/pyenv/pyenv/wiki/Common-build-problems,
which at the very top of the page recommended running this:

$ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev
libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev

So without pausing for further thought I did run it, but now wonder if
this will cause me future consequences with system stuff as later I
read on the FAQ page a similar command without granting sudo
privileges.  So I jumped into the fire on this one without fully
understanding what I was doing.

But after doing this I was able to get 3.6.6, but there was still one
more thing to do and that was to run

$ pyenv global 3.6.6

because I did want to be able to type python3 in the shell and get
specifically 3.6.6 as my default version -- for now at least.

I probably did not do everything like I should, but maybe this will
help someone down the line do better.  So far I seem to have
everything working and doing what I had hoped for.  pyenv looks like a
fine tool for managing as many Python versions as one wants to play
around with, and does seem to support virtual environments with a
plugin.

boB
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] putting accent on letters while user is typing in Entrybox (Tkinter)

2018-07-15 Thread Alan Gauld via Tutor
On 15/07/18 20:44, Ali M wrote:
> Hi. I want to write these (ĝ, ĉ, ĵ, ĥ, ŭ, ĉ) accented letters when the user
> types (gx, cx, jx, ux, cx).
> 
> when user types 'gx' for example i want to remove that x and replace it
> with the accent. how should i do that? and how should i specify which
> accent goes above which letter? thanks.

You need to replace the two characters with a single unicode
character representing the accented character.

But you also need to be displaying your output on a device
or terminal capable of displaying the unicode characters.

Mapping a pair of characters to a single unicode one is
not particularly difficult, although not trivial either.

But its rarely necessary. If we knew more about what you
really want to do rather tan what you think is the solution
we might be able to offer more specific help.

Where are you reading the input from?
Where are you displaying the output?
How do you read the input?
How do you display the output?

Why can the user not just type the accented code into
the input?

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor