PyPE 2.1 run problem

2005-08-17 Thread tony . ha

Hello,

I have downloaded the PyPE2.1-win-unicode.zip,
after unzip it with winzip
into PyPE2.1-win-unicode dierctory on
window XP. I try to run "pype.exe" by double 
click on it, but nothing has happen,
then when I run it with "run as..." using the right click button.

I have the following Message in the
pype.exe.log

Traceback (most recent call last):
  File "pype.py", line
30, in ?
  File "configuration.pyc",
line 129, in ?
WindowsError: [Errno 267] The directory
name is invalid: 'E:\\Downloads\\Python\\PyPE\\PyPE2.1-win-unicode\\library.zip/*.*'

I also copy the "PyPE2.1-win-unicode"
directory into "C:\Python24\Lib\site-packages" and run it, but
it behaves the same !!

Then I downloaded the source code and
unzip it into "PyPe2.1-src", and run "python pype.py"
in a command window.
The progroam detected I have an older
version of wxPython 2.5.5 and askes me do I want to download the newer
version
2.6.1. Which I did.

After downlowd the wxPython 2.6.1 (win-unicode"
version). I installed it into Python 2.4.1, then re-run PyPE.
i.e re-issue "python pype.py"
in a command window." I have the following traceback Error message:

[ Wed Aug 17 09:32:32 2005 ] Loading
history from C:\Documents and Settings\gbr02333\.pype\history.txt

Traceback (most recent call last):

  File "pype.py", line
3926, in ?

    main()

  File "pype.py", line
3916, in main

    filehistory.root = root
= app.frame = MainWindow(None, -1, "PyPE", sys.argv[1+opn:])

  File "pype.py", line
438, in __init__

    self.loadHistory()

  File "pype.py", line
1152, in loadHistory

    self.config[nam][k] =
dict(v)

TypeError: iteration over non-sequence


I wonder does anyone using PyPE2.1 on
Windown XP SP2 and have the same problem? Can any one help
with the problem? Thanks in advance
!

Tony Ha.

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

Python Design Patterns

2004-11-29 Thread Tony Ha
Hello

I am learning Python for in the pass ten months, and have brought a few 
books about Python. Most of them are good books by its only right, and all 
of them only teach you how to write Python programs using Python syntax and 
Python ways, but no one single Python book explicitly teaches you on how to 
analyst your application, and structure your programmes in a way, so that, 
it is easy to maintain, easily to reuse, (i.e. use loosely couple), and 
easily to extend or add new features (programming to Interface instead of 
Implementation) without introduce bugs into your existing working codes.

I recently brought a book called "Head First Design Patterns" published by 
O'reilly. This book is simply a gem. It shows you how to use and apply 
Design Patterns to analyst and structure your code, so that, the programs 
can be easy maintains, reuse, modify and extend. (It is the books I have 
been looking for a long time while I am learning Python, but cannot find 
one). The only caveat about this book is that the authors use Java (not 
Python) in the examples.

I wonder, can any Python guru out there translate the Java examples in the 
book into Python examples, or write a similar book in Python, perhaps 
called "Head First Design Patterns in Python". I think, this will be a 
great addition to Python books, and a great benefit to Python community.

P.S. I am not sure is this the right news group to post this request.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Design Patterns

2004-11-30 Thread Tony Ha
Hello Dave,

Thanks for pointing me to the Cookbook website.

Tony Ha.


"Dave Cook" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2004-11-29, Tony Ha <[EMAIL PROTECTED]> wrote:
>
> > I wonder, can any Python guru out there translate the Java examples in
the
>
> Should be a good exercise, and not just for gurus ;}.
>
> > book into Python examples, or write a similar book in Python, perhaps
>
> I've also wished for a design patterns book aimed at Python, or at least
> dynamic languages with first class functions and modules.  There's a paper
> Python book with "Patterns" in the title, but it has precious little
content
> in it related to design patterns, at least not the GOF variety.
>
> This web book has the word "Patterns" in it, too:
>
> http://www.brpreiss.com/books/opus7/
>
> But looks like it's mainly data structures.
>
> If you do a google search, and also search the Python Cookbook
>
> http://aspn.activestate.com/ASPN/Python/Cookbook/
>
> you can find examples of:
>
> Singleton
> Borg
> Null
> Factory
> Observer (including a Publish/Subscribe recipe)
> Memento
> State
> Decorator
> Masquerading and Adaptation patterns (Alex Martelli paper)
> Template (another Alex Martelli paper)
> Chain of Responsibility
> Proxy
> Prototype
>
> There must be good examples in actual source code out there, too.
>
> > called "Head First Design Patterns in Python". I think, this will be a
> > great addition to Python books, and a great benefit to Python community.
>
> I just bought this book as well.  I must have adult ADD, because I do
enjoy
> the Head First format, though I disdained it at first.
>
> > P.S. I am not sure is this the right news group to post this request.
>
> Yup, this is the place.
>
> Dave Cook


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


How to pass an argument to a python program open in IDLE?

2006-11-15 Thread tony . ha

Hello,

I have open a Python program in the
IDLE, but when I select the "run module" under "run"
menu, it
does not allow me to pass an argument
to my Python program! 
How do you pass an argument to a Python
program under the IDLE? Thanks for you help!


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

Help with ConfigParser

2006-10-02 Thread tony . ha

Hello I use ConfigParser as show below
to read a config.txt file;

from ConfigParser import ConfigParser

config = ConfigParser()
config.read('config.txt')
items = config.items('FV')
for item in items:
   module_name = item[0]
   print module_name


The config.txt file has the following

[FV]
# Set the module to "1" to
enable the regression test run on it, otherwise set it to "0"

ip_dtlmmio0_1803: 0
ip_gpio0_4004: 0
ip_dmac0_1903: 0
ip_ptA_a_sdramc_2022: 1
ip_timer0_3012: 0



the output has been convert to lowercase,
i.e ip_ptA_a_sdramc_2022  become ip_pta_a_sdramc_2022
(the captial letter 'A, become lower
case 'a').

Question: How can I pervent ConfigParse
to convert Upper case yo lower case??, thanks.
-- 
http://mail.python.org/mailman/listinfo/python-list