PyEdit in Programming Python 2nd ed 
Author Message
 PyEdit in Programming Python 2nd ed

Hi,
I just wanted to make sure you are running Launch_PyDemos.pyw, not
PyDemos.pyw.  If you are running PyDemos.pyw directly without setting up
PYTHONPATH, this may explain the problem.

The first of these (Launch_PyDemos) auto-configures the environment for
spawning book demos, and starts PyDemos.  The second (PyDemos itself)
assumes
that the environment has already been configured, either manually, or by the
top-level Launch_PyDemos layer.

That's why PyEdit (and a few others demos run from PyDemos that depend on
the
module search path) will not work from PyDemos, unless you've done manual
environment configuration, or started PyDemos indirectly by running
Launch_PyDemos.  Both of these scripts are described in the Preface.

If this doesn't take care of the problem, let me know, there are some other
things we can do.

Laura

Quote:

>This is about one of the example programs in Programming python 2nd ed.
>I just bought the book and while I was trying its Demo Launcher script, I
>found that I
>couldn't start the PyEdit script by clicking on its button. I'm running
>ActiveState python 2.1
>on my Win98SE machine. Has anyone encountered this problem before? PyEdit
>should
>work on Win98SE and with ActiveState python 2.1.



Fri, 17 Oct 2003 21:49:55 GMT  
 PyEdit in Programming Python 2nd ed
Yes, I launched Launch_PyDemos.pyw first by double-clicking the
"Launch_PyDemos" Python icon in Explorer and then at the DOS prompt by
typing "python Launch_PyDemos.pyw".
The launcher would appear and all of the scripts could display their GUI
windows except PyEdit and PyView.
I copied d:\Examples\PP2E to c:\PP2E and set PYTHONPATH to "C:\PP2E" then
tried running from their but that didn't help PyEdit to appear.

Yes, please share with me other options. Thank you.


Quote:
> Hi,
> I just wanted to make sure you are running Launch_PyDemos.pyw, not
> PyDemos.pyw.  If you are running PyDemos.pyw directly without setting up
> PYTHONPATH, this may explain the problem.

> The first of these (Launch_PyDemos) auto-configures the environment for
> spawning book demos, and starts PyDemos.  The second (PyDemos itself)
> assumes
> that the environment has already been configured, either manually, or by
the
> top-level Launch_PyDemos layer.

> That's why PyEdit (and a few others demos run from PyDemos that depend on
> the
> module search path) will not work from PyDemos, unless you've done manual
> environment configuration, or started PyDemos indirectly by running
> Launch_PyDemos.  Both of these scripts are described in the Preface.

> If this doesn't take care of the problem, let me know, there are some
other
> things we can do.

> Laura


> >This is about one of the example programs in Programming Python 2nd ed.
> >I just bought the book and while I was trying its Demo Launcher script, I
> >found that I
> >couldn't start the PyEdit script by clicking on its button. I'm running
> >ActiveState python 2.1
> >on my Win98SE machine. Has anyone encountered this problem before? PyEdit
> >should
> >work on Win98SE and with ActiveState python 2.1.



Sat, 18 Oct 2003 09:57:38 GMT  
 PyEdit in Programming Python 2nd ed
Hi,
As described in the book and CD's Examples\README-root.txt file, PYTHONPATH
should include the directory that _contains_ the PP2E root directory, not
PP2E
itself.  Moreover, the directory that contains the PP2E directory copy must
also include a file named __init__.py, because it is a package directory.  
That file can be empty, but it is required in PP2E's parent.  (The PP2E root
directory is a Python modules package).

Cross-directory imports in book examples are always relative to the PP2E
root.
 PyEdit, for example, says this to load menu/toolbar maker tools from
elsewhere
in the examples directory tree:

    from PP2E.Gui.Tools.guimaker import *

So, the directory containing PP2E must be a package too, and should look
like
the top-level Examples directory on the CD.  In your case, if PP2E is copied
from the CD to C:\PP2E, then two things probably need to be fixed:

1) The C: directory must be added to PYTHONPATH, not C:\PP2E
2) A C:\__init__.py file must exist, even if it's simply empty

If this still doesn't fix the problem, then perhaps the PyEdit source files
have been altered locally. (Can you run PyEdit directly?)

Laura

Quote:

>Yes, I launched Launch_PyDemos.pyw first by double-clicking the
>"Launch_PyDemos" Python icon in Explorer and then at the DOS prompt by
>typing "python Launch_PyDemos.pyw".
>The launcher would appear and all of the scripts could display their GUI
>windows except PyEdit and PyView.
>I copied d:\Examples\PP2E to c:\PP2E and set PYTHONPATH to "C:\PP2E" then
>tried running from their but that didn't help PyEdit to appear.

>Yes, please share with me other options. Thank you.



Sun, 19 Oct 2003 22:31:31 GMT  
 PyEdit in Programming Python 2nd ed
Thank you for your assistance, but I have followed your instructions and
read the README-root.txt file included in the CD. The PyEdit window is still
not appearing. My machine is running Windows 98 SE, ActivePython-2.1.0.210,
ActiveTcl-8.3.3.8330 and ActivePerl-5.6.0.623-MSWin32-x86-multi-thread. This
could also be the result of a bug in this version of Tcl/Tk and I'll try
installing other versions of Python.

---------Fiel
C:\PP2ndEd>cd examples

C:\PP2ndEd\Examples>dir

 Volume in drive C has no label
 Volume Serial Number is 2A48-1B05
 Directory of C:\PP2ndEd\Examples

.              <DIR>        05-03-01  7:08p .
..             <DIR>        05-03-01  7:08p ..
README~1 TXT         2,996  12-10-00 10:46a README-root.txt
__INIT__ PY          3,144  09-09-00  5:15p __init__.py
PP2E           <DIR>        05-03-01  7:08p PP2E
         2 file(s)          6,140 bytes
         3 dir(s)        6,402.16 MB free

C:\PP2ndEd\Examples>echo %PYTHONPATH%
---------Fiel


Quote:
> Hi,
> As described in the book and CD's Examples\README-root.txt file,
PYTHONPATH
> should include the directory that _contains_ the PP2E root directory, not
> PP2E
> itself.  Moreover, the directory that contains the PP2E directory copy
must
> also include a file named __init__.py, because it is a package directory.
> That file can be empty, but it is required in PP2E's parent.  (The PP2E
root
> directory is a Python modules package).

> Cross-directory imports in book examples are always relative to the PP2E
> root.
>  PyEdit, for example, says this to load menu/toolbar maker tools from
> elsewhere
> in the examples directory tree:

>     from PP2E.Gui.Tools.guimaker import *

> So, the directory containing PP2E must be a package too, and should look
> like
> the top-level Examples directory on the CD.  In your case, if PP2E is
copied
> from the CD to C:\PP2E, then two things probably need to be fixed:

> 1) The C: directory must be added to PYTHONPATH, not C:\PP2E
> 2) A C:\__init__.py file must exist, even if it's simply empty

> If this still doesn't fix the problem, then perhaps the PyEdit source
files
> have been altered locally. (Can you run PyEdit directly?)

> Laura


> >Yes, I launched Launch_PyDemos.pyw first by double-clicking the
> >"Launch_PyDemos" Python icon in Explorer and then at the DOS prompt by
> >typing "python Launch_PyDemos.pyw".
> >The launcher would appear and all of the scripts could display their GUI
> >windows except PyEdit and PyView.
> >I copied d:\Examples\PP2E to c:\PP2E and set PYTHONPATH to "C:\PP2E" then
> >tried running from their but that didn't help PyEdit to appear.

> >Yes, please share with me other options. Thank you.



Tue, 21 Oct 2003 07:28:25 GMT  
 PyEdit in Programming Python 2nd ed
Hi,
All the things I've said so far are valid, but here's the final story, which
will also show up on the author's book updates page...

There seems to be a bug in ActivePython 2.1's implementation of Tkinter that
makes a few of the book examples fail on Windows.  At the least, any example
that uses the guimaker.py tool will not work as is under ActivePython 2.1.
This includes PyEdit, PyView, PyMail (its mail composition windows), and
probably big_gui and shellgui.  However, all of these examples still work
under the standard Python 2.1 release for Windows that is available from
www.python.org.

The reason is that ActivePython 2.1's Tkinter for Windows does not recognize
the cursor='hand2' and cursor='gumby' configuration options used by the
guimaker.py module for toolbars and help buttons.  Note that these are
standard
Tk cursor settings, and should work in all Tkinters.  ActivePython's Tkinter
not only does not implement these options, it raises an exception for them,
which makes programs that use these (and likely other) cursors fail.  This
is
a bug in ActivePython 2.1, and should be reported to ActiveState.

The settings do work as advertised in the standard Python 2.1 release.  But
if
you have installed ActivePython 2.1 and need a workaround for the problem,
you
have two options:

1) Either you can instead download and install the standard Python 2.1
release
from python.org (and install the win32all package separately if you want the
extra Windows tool set that comes with AP).

2) Or, you can simply edit the guimaker.py script on your machine: find and
delete the two "cursor=" configuration options in this script. The examples
work again after these edits, but you don't get the nice mouse cursors.

Again, this is a bug in ActivePython 2.1, not in the examples or the
standard
Python install.

Hope this helps!

Laura

Quote:

>Thank you for your assistance, but I have followed your instructions and
>read the README-root.txt file included in the CD. The PyEdit window is still
>not appearing. My machine is running Windows 98 SE, ActivePython-2.1.0.210,
>ActiveTcl-8.3.3.8330 and ActivePerl-5.6.0.623-MSWin32-x86-multi-thread. This
>could also be the result of a bug in this version of Tcl/Tk and I'll try
>installing other versions of Python.

>---------Fiel



Tue, 21 Oct 2003 23:15:30 GMT  
 PyEdit in Programming Python 2nd ed
FYI,
I removed ActivePython-2.1.0.210,
ActiveTcl-8.3.3.8330 and ActivePerl-5.6.0.623-MSWin32-x86-multi-thread from
my PC and then installed Python-2.1.exe from www.python.org and now PyEdit
and all the demos are running.

Fiel Cabral


Quote:
> Hi,
> As described in the book and CD's Examples\README-root.txt file,
PYTHONPATH
> should include the directory that _contains_ the PP2E root directory, not
> PP2E
> itself.  Moreover, the directory that contains the PP2E directory copy
must
> also include a file named __init__.py, because it is a package directory.
> That file can be empty, but it is required in PP2E's parent.  (The PP2E
root
> directory is a Python modules package).

> Cross-directory imports in book examples are always relative to the PP2E
> root.
>  PyEdit, for example, says this to load menu/toolbar maker tools from
> elsewhere
> in the examples directory tree:

>     from PP2E.Gui.Tools.guimaker import *

> So, the directory containing PP2E must be a package too, and should look
> like
> the top-level Examples directory on the CD.  In your case, if PP2E is
copied
> from the CD to C:\PP2E, then two things probably need to be fixed:

> 1) The C: directory must be added to PYTHONPATH, not C:\PP2E
> 2) A C:\__init__.py file must exist, even if it's simply empty

> If this still doesn't fix the problem, then perhaps the PyEdit source
files
> have been altered locally. (Can you run PyEdit directly?)

> Laura


> >Yes, I launched Launch_PyDemos.pyw first by double-clicking the
> >"Launch_PyDemos" Python icon in Explorer and then at the DOS prompt by
> >typing "python Launch_PyDemos.pyw".
> >The launcher would appear and all of the scripts could display their GUI
> >windows except PyEdit and PyView.
> >I copied d:\Examples\PP2E to c:\PP2E and set PYTHONPATH to "C:\PP2E" then
> >tried running from their but that didn't help PyEdit to appear.

> >Yes, please share with me other options. Thank you.



Fri, 24 Oct 2003 06:25:35 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. PyEdit in Programming Python 2nd ed

2. Programming Python by Mark Lutz 2nd Ed.

3. Parallel Functional Programming Bibliography (2nd ed)

4. Announce: Python Essential Reference, 2nd Ed.

5. Programming Language Converters, 2nd ed. (~230 lines)

6. Object-Oriented Software Construction, 2nd Ed. Canceled?

7. 0bject-Oriented Software Construction 2nd Ed?

8. bject-Oriented Software Construction 2nd Ed?

9. OOSC 2nd ed?

10. Object Oriented Software Construction, 2nd ed coming soon???

11. Availability of Starting FORTH, 2nd ed.

12. Starting Forth 1st/2nd ed

 

 
Powered by phpBB® Forum Software