Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #73556 > unrolled thread
| Started by | "Peter Tomcsanyi" <tomcsanyi@slovanet.sk> |
|---|---|
| First post | 2014-06-24 20:11 +0200 |
| Last post | 2014-06-27 23:52 +0200 |
| Articles | 9 — 3 participants |
Back to article view | Back to comp.lang.python
Python 3.4.1 installer on Mac links Python to old Tcl/Tk "Peter Tomcsanyi" <tomcsanyi@slovanet.sk> - 2014-06-24 20:11 +0200
Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk Christian Gollwitzer <auriocus@gmx.de> - 2014-06-25 08:58 +0200
Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk "Peter Tomcsanyi" <tomcsanyi@slovanet.sk> - 2014-06-25 21:26 +0200
Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk Christian Gollwitzer <auriocus@gmx.de> - 2014-06-25 22:48 +0200
Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk "Peter Tomcsanyi" <tomcsanyi@slovanet.sk> - 2014-06-26 12:39 +0200
Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk Christian Gollwitzer <auriocus@gmx.de> - 2014-06-26 14:37 +0200
Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk Christian Gollwitzer <auriocus@gmx.de> - 2014-06-26 20:38 +0200
Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk Ned Deily <nad@acm.org> - 2014-06-26 15:29 -0700
Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk "Peter Tomcsanyi" <tomcsanyi@slovanet.sk> - 2014-06-27 23:52 +0200
| From | "Peter Tomcsanyi" <tomcsanyi@slovanet.sk> |
|---|---|
| Date | 2014-06-24 20:11 +0200 |
| Subject | Python 3.4.1 installer on Mac links Python to old Tcl/Tk |
| Message-ID | <mailman.11225.1403635811.18130.python-list@python.org> |
Hello, I use the Python 3.4.1 installer from https://www.python.org/downloads/release/python-341/ The Windows installation comes with Tcl/Tk version 8.6 which has some new features (compared to 8.5) that are very important to me. But the Mac installer does not include Tcl/Tk and the page: https://www.python.org/download/mac/tcltk says: "The Python 64-bit/32-bit Mac OS X installers for Python 3.4.x, 3.3.x, 3.2.x, and 2.7.x dynamically link to Tcl/Tk 8.5 frameworks." I tried to download and install ActiveTcl 8.6.1 for Mac, but Python does not use it... Can anyone help me make Python 3.4.1 use Tcl/Tk 8.6 on Mac OS X (10.9.2, if that matters)? Does anyone know why the Windows installer brings the newest version of Tcl/Tk while the Mac installer remains with the previous version? When this is planned to be changed? Maybe this is not the right place for this kind of question... can anyone suggest a better place so that the question has a chance to be read by the person who is actually creating the installation packages? Should I try to send this as a bug to bugs.python.org? Thanks, Peter Tomcsanyi
[toc] | [next] | [standalone]
| From | Christian Gollwitzer <auriocus@gmx.de> |
|---|---|
| Date | 2014-06-25 08:58 +0200 |
| Message-ID | <lodruv$k45$1@dont-email.me> |
| In reply to | #73556 |
Hi Peter, Am 24.06.14 20:11, schrieb Peter Tomcsanyi: > I use the Python 3.4.1 installer from > https://www.python.org/downloads/release/python-341/ > > The Windows installation comes with Tcl/Tk version 8.6 which has some > new features (compared to 8.5) that are very important to me. may I ask which features of 8.6 you need in particular? I'm just curious, because I thought that Python mainly uses the Tk part, and there has not been much of a difference in Tk between 8.5 and 8.6. In contrast, the Tcl language itself got massively enhanced (stackless execution engine, coroutines, core OO system, ...) Christian
[toc] | [prev] | [next] | [standalone]
| From | "Peter Tomcsanyi" <tomcsanyi@slovanet.sk> |
|---|---|
| Date | 2014-06-25 21:26 +0200 |
| Message-ID | <mailman.11241.1403724416.18130.python-list@python.org> |
| In reply to | #73564 |
"Christian Gollwitzer" <auriocus@gmx.de> wrote in message news:lodruv$k45$1@dont-email.me... > Hi Peter, > may I ask which features of 8.6 you need in particular? Hi Christian, I need two of them: - Angled text - PNG image support with alpha channel (even if it seems a bit limited, particularly I still did not find the way to programmatically set/read the alpha channel of one individual pixel of the image, but maybe it is just my inability and a question to another newsgroup). Peter
[toc] | [prev] | [next] | [standalone]
| From | Christian Gollwitzer <auriocus@gmx.de> |
|---|---|
| Date | 2014-06-25 22:48 +0200 |
| Message-ID | <lofciv$nq6$1@dont-email.me> |
| In reply to | #73586 |
Am 25.06.14 21:26, schrieb Peter Tomcsanyi: > "Christian Gollwitzer" <auriocus@gmx.de> wrote in message > news:lodruv$k45$1@dont-email.me... >> may I ask which features of 8.6 you need in particular? > > I need two of them: > - Angled text > - PNG image support with alpha channel (even if it seems a bit limited, > particularly I still did not find the way to programmatically set/read > the alpha channel of one individual pixel of the image, but maybe it is > just my inability and a question to another newsgroup). For PNG image support you can load either the Img package which gives support for a large variety of images, or the smaller tkpng package. After loading these, Tk 8.5 will accept PNG as in 8.6. For angled text it's right, I don't know, there used to be some hacks before, it's probably not possible in a clean way. Glad to see, that you are pushing the adoption of 8.6 ;) (I'm a Tcl-guy) Christian
[toc] | [prev] | [next] | [standalone]
| From | "Peter Tomcsanyi" <tomcsanyi@slovanet.sk> |
|---|---|
| Date | 2014-06-26 12:39 +0200 |
| Message-ID | <mailman.11256.1403779201.18130.python-list@python.org> |
| In reply to | #73590 |
"Christian Gollwitzer" <auriocus@gmx.de> wrote in message news:lofciv$nq6$1@dont-email.me... > For PNG image support you can load either the Img package which gives > support for a large variety of images, or the smaller tkpng package. My first Google search for "tkpng" "python" gave no usable results. So I am not sure if and how can I use these Tk extensions from Python... And finally I want to show the picture(s) on a Tk-based Canvas on top of each other with properly handled semi-transparency. In our project we want to use as little as possible additonal packages because we expect that the end-users will use several platforms (Windows, Mac, Linux) and installing any extra Python-related package on non-Windows platform seems to be a nightmare, at least that is the result of the past three months of experience. The need to go to the command line level for such a basic thing like installing or uninstalling something seems to me like going 20 to 30 years back in history. We cannot expect that our end-users (especially the Mac-based ones) will have that expertise even if they have enough expertise to program in Python when it is finally correctly installed on their computers. > For angled text it's right, I don't know, there used to be some hacks > before, it's probably not possible in a clean way. I was actually negatively surprised by the lack of this very basic feature (especially in a vector-graphics-based environment) when I started with Python+Tk a few months ago, so I was very glad to see it in 8.6 and I immediately started using it on Windows. But then I receved complaints from a Mac user that it just does not work... Peter
[toc] | [prev] | [next] | [standalone]
| From | Christian Gollwitzer <auriocus@gmx.de> |
|---|---|
| Date | 2014-06-26 14:37 +0200 |
| Message-ID | <loh45o$14g$1@dont-email.me> |
| In reply to | #73615 |
Am 26.06.14 12:39, schrieb Peter Tomcsanyi:
> "Christian Gollwitzer" <auriocus@gmx.de> wrote in message
> news:lofciv$nq6$1@dont-email.me...
>> For PNG image support you can load either the Img package which gives
>> support for a large variety of images, or the smaller tkpng package.
>
> My first Google search for
> "tkpng" "python"
> gave no usable results. So I am not sure if and how can I use these Tk
> extensions from Python...
As I said, it doesn't have a special interface, you just load it and
that's it. So if you do a tk.eval("package require tkpng"), your
Tk.PhotoImage will magically recognize PNG. I don't know how widespread
the installation is, but compilation is easy. An alternative is the
widely available Img package, which adds support for many image formats
like gif, bmp, jpeg, tga, tiff etc. On my Mac it came with the OS (I
think); you'll do Tk.eval("package require Img"). Since there are no
additional commands, it'll just work from Python as well. An alternative
employed by Pythonistas is to load the image using PIL and create a Tk
PhotoImage via the ImageTk bridge.
> And finally I want to show the picture(s) on a Tk-based Canvas on top of
> each other with properly handled semi-transparency.
This has been in the canvas for a long time, if you managed to create an
image with an alpha channel.
> In our project we want to use as little as possible additonal packages
> because we expect that the end-users will use several platforms
> (Windows, Mac, Linux) and installing any extra Python-related package on
> non-Windows platform seems to be a nightmare, at least that is the
> result of the past three months of experience.
I understand.
> The need to go to the command line level for such a basic thing like
> installing or uninstalling something seems to me like going 20 to 30
> years back in history. We cannot expect that our end-users (especially
> the Mac-based ones) will have that expertise even if they have enough
> expertise to program in Python when it is finally correctly installed on
> their computers.
On the Mac you can create an APP bundle which contains everything,
including extra dependencies. It is a folder with a special structure,
you put it into a DMG archive and it matches the expectation a Mac user
has of an "installer". Unfortunately these things are very
system-dependent, and it's a lot of work to provide deployment (do
program icons, setup file associations etc.)
>
>> For angled text it's right, I don't know, there used to be some hacks
>> before, it's probably not possible in a clean way.
>
> I was actually negatively surprised by the lack of this very basic
> feature (especially in a vector-graphics-based environment)
Yes this was a long-deferred feature due to its inhomogeneous
implementation on the supported platforms. There were some extensions
like 10 years ago to do it, but only in 8.6 (2012) it made it into the
core Tk.
Christian
[toc] | [prev] | [next] | [standalone]
| From | Christian Gollwitzer <auriocus@gmx.de> |
|---|---|
| Date | 2014-06-26 20:38 +0200 |
| Message-ID | <lohpaq$6hr$1@dont-email.me> |
| In reply to | #73616 |
Am 26.06.14 14:37, schrieb Christian Gollwitzer:
> Am 26.06.14 12:39, schrieb Peter Tomcsanyi:
>> "Christian Gollwitzer" <auriocus@gmx.de> wrote in message
>> news:lofciv$nq6$1@dont-email.me...
>>> For PNG image support you can load either the Img package which gives
>>> support for a large variety of images, or the smaller tkpng package.
>>
>> My first Google search for
>> "tkpng" "python"
>> gave no usable results. So I am not sure if and how can I use these Tk
>> extensions from Python...
>
> On my Mac it came with the OS (I
> think); you'll do Tk.eval("package require Img").
Just checked back with my vanilla VM install of Snow Leopard (10.6),
that the Img package is installed. So doing this package require Img in
case you detect 8.5 should solve your PNG problem on the Mac (you can do
"package require Tk" to get the version number). I haven't checked alpha
channel, though. For the rotated text there is no good solution. Of
course, pushing people to install 8.6 is better:)
Christian
[toc] | [prev] | [next] | [standalone]
| From | Ned Deily <nad@acm.org> |
|---|---|
| Date | 2014-06-26 15:29 -0700 |
| Message-ID | <mailman.11270.1403821787.18130.python-list@python.org> |
| In reply to | #73627 |
In article <lohpaq$6hr$1@dont-email.me>,
Christian Gollwitzer <auriocus@gmx.de> wrote:
> Am 26.06.14 14:37, schrieb Christian Gollwitzer:
> > Am 26.06.14 12:39, schrieb Peter Tomcsanyi:
> >> "Christian Gollwitzer" <auriocus@gmx.de> wrote in message
> >> news:lofciv$nq6$1@dont-email.me...
> >>> For PNG image support you can load either the Img package which gives
> >>> support for a large variety of images, or the smaller tkpng package.
> >>
> >> My first Google search for
> >> "tkpng" "python"
> >> gave no usable results. So I am not sure if and how can I use these Tk
> >> extensions from Python...
> >
> > On my Mac it came with the OS (I
> > think); you'll do Tk.eval("package require Img").
> Just checked back with my vanilla VM install of Snow Leopard (10.6),
> that the Img package is installed. So doing this package require Img in
> case you detect 8.5 should solve your PNG problem on the Mac (you can do
> "package require Tk" to get the version number). I haven't checked alpha
> channel, though. For the rotated text there is no good solution. Of
> course, pushing people to install 8.6 is better:)
Just a reminder that you should *not* depend on the Apple-supplied Tk
8.5 in OS X 10.6. That was the first release of Cocoa Tk and it has
proven to be almost unusable, at least with IDLE and some other
Tkinter-based apps. Install a newer Tcl/Tk 8.5.x, like from ActiveTcl,
and use a python that links with it, like from the python.org
installers. The ActiveTcl installer also installs "teacup" which allows
you to easily install additional Tcl packages.
--
Ned Deily,
nad@acm.org
[toc] | [prev] | [next] | [standalone]
| From | "Peter Tomcsanyi" <tomcsanyi@slovanet.sk> |
|---|---|
| Date | 2014-06-27 23:52 +0200 |
| Message-ID | <mailman.11295.1403905985.18130.python-list@python.org> |
| In reply to | #73616 |
"Christian Gollwitzer" <auriocus@gmx.de> wrote in message
news:loh45o$14g$1@dont-email.me...
> As I said, it doesn't have a special interface, you just load it and
> that's it. So if you do a tk.eval("package require tkpng"), your
> Tk.PhotoImage will magically recognize PNG.
I will try it on the Mac, but on Windows this does not work (with python.org
installation of Python), and I need to have the same environment on both Win
and Mac (at least).
> On the Mac you can create an APP bundle which contains everything,
> including extra dependencies.
Thanks for the hint, I may consider it, but maybe it is not applicable to my
project where the outcome should be in fact a few modules in Python and the
en-users (college students) should program in Python using IDLE and those
extra modules. So there is no "Main program" and there will be no
"application".
Is an APP budle applicable for such a situation?
> Yes this was a long-deferred feature due to its inhomogeneous
> implementation on the supported platforms. There were some extensions like
> 10 years ago to do it, but only in 8.6 (2012) it made it into the core Tk.
Thanks for many insights into Tk and your hints.
I will try some of them in next days and maybe later I will come with some
more questions.
Peter
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web