1. Preferences파일을 수정함.
위치 : F:\Documents and Settings\jgnam\.boa-constructor\fprefs.rc.py
수정내용 :

staticInfoPrefs = { 'Purpose': '',
'Author': 'NaHyunJae(http://j.finfra.com/)',
'Copyright': 'Copyright Finfra(http://www.finfra.com) All Rights Reserved 2004-2005',
'Licence': 'GPL',
'Email': 'j@finfra.com',
}

수정사유 :
일단은 'Add Moudle Info'버튼을 제대로 쓰기위함.
이올린에 북마크하기

Posted by 나현재

2005/07/20 17:22 2005/07/20 17:22
Response
No Trackback , No Comment
RSS :
http://j.finfra.com/tt/rss/response/267

C:\Python24\Lib\site-packages\boa-constructor\Explorers\Explorer.py

491행
[CODE] for dummy, dummy, name, itm in orderedList: self.items.append(itm) self.InsertImageStringItem(self.GetItemCount(), name, itm.imgIdx)[/CODE]

||
V
[CODE] for dummy, dummy, name, itm in orderedList: self.items.append(itm) try: self.InsertImageStringItem(self.GetItemCount(), unicode(name,"euc-kr").encode('utf-8'), itm.imgIdx) except: self.InsertImageStringItem(self.GetItemCount(), name, itm.imgIdx)[/CODE]




.
.
바꿀것이 너무 많음...짝퉁 방법이지만...
C:\Python24\Lib\encodings\utf_8.py
파일을 아래와 같이 바꿈.
[CODE]""" Python 'utf-8' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs encode = codecs.utf_8_encode def decode(input, errors='strict'): try: input = unicode(input,"euc-kr") except: input = input return codecs.utf_8_decode(input, errors, True) class StreamWriter(codecs.StreamWriter): encode = codecs.utf_8_encode class StreamReader(codecs.StreamReader): decode = codecs.utf_8_decode ### encodings module API def getregentry(): return (encode,decode,StreamReader,StreamWriter)[/CODE]
이올린에 북마크하기

Posted by 나현재

2005/07/20 15:53 2005/07/20 15:53
Response
No Trackback , No Comment
RSS :
http://j.finfra.com/tt/rss/response/266

출처 - http://groups.google.com/groups?oi=djq&selm=an_576866337

Fast Python Database • Fast, flexible, easy, royalty-free, scalable, secure, source included • www.codebase.com 스폰서 링크

Archive tape drive • Tape drive repair, sale & service Buy online- same day shipping • www.pacificdata.com
Pygame Coding Tools • Debugger, Editor, Browser, and more Faster, Easier Python Development • www.wingware.com


글쓴이:Malcolm Tredinnick (malcolmt@smart.net.au)
제목:Re: Tkinter and wxPython
View: Complete Thread (22 글)
Original Format
뉴스그룹:comp.lang.python
날짜:2000/01/24


On Sun, Jan 23, 2000 at 05:45:47AM -0800, Timothy Grant wrote:
> OK, After just spending three weeks learning Tkinter on-the-fly, I have
> to ask this question, what advantages/disadvantages are there to each
> Tkinter and wxPython?

I'll have a stab at this and will no doubt be stomped on by greater minds
tomorrow (although most of the Greater Minds are probably all at the
conference, so I may be safe) ...

Tkinter:
+ It is truly cross-platform: The same program will run without changes on
machines with MS Windows, MacOS or any version of Unix that can run a version
of X Windows. You can also be "reasonably certain" that if Python is installed
on a platform, Tkinter will be there, too (or, if not, can be easily
obtained).
+ It is reasonably well documented and getting more so. There are already
articles around on how to "translate" Tcl/Tk man pages into Tkinter commands
and I, personally, have found some stuff on Perl/Tk to be helpful here, too.
An O'Reilly publications book on Tkinter is due out later this year.
- It is a bit slow to start up and run (since Tk is written in Tcl, which is a
fairly slow language -- at least by Python standards).
- Many people feel it looks a bit "clunky", although this seems to vary from
person to person. I don't mind it (and the amount of time I spend playing
PySol means I spend a lot of time looking at a Tkinter interface :-) ).

wxPython:
+ A bit more "feature laden" than Tkinter in some respects (this may be a "-"
in some books). More things are customisable (sort of -- see below). I believe
there are more "ready to work" gadgets in wxPython, but I haven't sat down and
counted and I don't use Tkinter much, so I probably don't know what is really
available there.
+ Although I haven't benchmarked stuff, it certainly feels faster than
Tkinter. Noticeably so when starting up a program, but also when a program
with a lot of windows is running. Tkinter tends to bog down a bit when lots of
windows need to be updated. wxPython is a step or two closer to the native
C-code (well, C++ code in this case), so this may explain it.
+ Updated regularly. Robin Dunn (Mr. wxPython) seems to fix bug reports about
two minutes before you send him the email and you can download the current CVS
version (or even a compiled snapshot thereof for Microsoft-types) as often as
you like.
+/- Not a lot of documentation (in a nutshell: read the wxWindows docs and
then you know pretty much everything about wxPython. The problem is, the docs
are like a reference manual, rather than a tutorial). However, (good point!)
the wxPython mailing list is an excellent source of help.
- Trickier to install than Tkinter. This is partly because wxWindows, the
product it is wrapping is still very much in development, so there are a
reasonable number of bugs (although I seem to have stopped being bitten by
them in the last three or months, so it is definitely getting better).
- Not included with the standard Python distribution, so if you are
distributing an application, you need to include instructions on how to
download and install wxWindows and wxPython (again, this is getting easier
every day, but it is still non-trivial).
- Not available (yet!) on Macintoshes, although Robin recently made it clear
he will be happy to fix that as soon as a Macintosh machine complete with
development software is made available to him. (wxWindows is available on
Macintoshes, so it's "only" a matter of getting the Python bindings to
compile, as far as I understand it).
- Your applications don't look and feel 100% the same on MS Windows and X
Windows platforms. This is because wxWindows does *not* aim for the lowest
common denominator across all its implementations. Rather, it supplies a
bunch of features and some of them may be no-ops on any given implementation.
The differences, however, are not major (mostly cosmetic things).
- Steeper learning curve than for Tkinter. wxWindows (and hence wxPython) is a
BIG package and can be quite intimidating if you haven't done any sort of
windows class library programming (GTK, Motif/LessTif or MFC, say) before.

Having written all that, my own personal preference is for wxPython for any
moderate sized application and Tkinter for the "quick and dirty" stuff where I
just want a window *now*. I like the look-n-feel of wxWindows applications.
Of course, I only write apps for myself, so my audience is very sympathetic
towards the programmer. :-)

Don't be too put off by the extra learning for wxPython -- you won't be able
to write the next super-app overnight, but with a bit of work (and much
reading of the example/test scripts) it is manageable.

Hopefully this is of some benefit (and not too far from reality).

Cheers,
Malcolm Tredinnick

--
For every action there is an equal and opposite criticism.


--------------------------------------------------------------------------------
이올린에 북마크하기

Posted by 나현재

2005/07/20 13:33 2005/07/20 13:33
Response
No Trackback , No Comment
RSS :
http://j.finfra.com/tt/rss/response/265

1. 클레스만 사용하기.
아래와 같은 소스를 폼(프레임등)의 컨스트럭터에 넣어준다.
l=wx.Log
dum= 페널클레스명(self,l)

#Boa:Frame:Frame1

import wx

def create(parent):
return Frame1(parent)

[wxID_FRAME1] = [wx.NewId() for _init_ctrls in range(1)]

class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)

b = wx.Button(self, -1, "Create and Show a DirDialog", (50,50))
self.Bind(wx.EVT_BUTTON, self.OnButton, b)


def OnButton(self, evt):
# In this case we include a "New directory" button.
dlg = wx.DirDialog(self, "Choose a directory:",
style=wx.DD_DEFAULT_STYLE|wx.DD_NEW_DIR_BUTTON)

# If the user selects OK, then we process the dialog's data.
# This is done by getting the path data from the dialog - BEFORE
# we destroy it.
if dlg.ShowModal() == wx.ID_OK:
self.log.WriteText('You selected: %s\n' % dlg.GetPath())

# Only destroy a dialog after you're done with it.
dlg.Destroy()


#---------------------------------------------------------------------------


class Frame1(wx.Frame):
def _init_ctrls(self, prnt):
# generated method, don't edit
wx.Frame.__init__(self, id=wxID_FRAME1, name='', parent=prnt,
pos=wx.Point(216, 346), size=wx.Size(400, 250),
style=wx.DEFAULT_FRAME_STYLE, title='Frame1')
self.SetClientSize(wx.Size(392, 223))

def __init__(self, parent):
self._init_ctrls(parent)
l=wx.Log
tp=TestPanel(self,l)



2. 전체 다 사용하기.
demo가 설치 되어 있는 폴더(C:\Program Files\wxPython2.6 Docs and Demos\demo)의 run.py를 복사해서 같은 폴더에서 돌린다.
이올린에 북마크하기

Posted by 나현재

2005/07/19 17:59 2005/07/19 17:59
Response
No Trackback , No Comment
RSS :
http://j.finfra.com/tt/rss/response/263

2005.07.15 - 기준 (리눅스,BSD,맥,ms윈도우 다된다고는 하는데 테스트는 윈도우만 해봤음)

1. python을 다운 받아 설치 한다..
http://www.python.org/2.4.1/

1.5 윈도우 사용자라면 pythonWin도 설치 한다.

2. wxPython을 다운 받아 설치한다.
wxPython을 다운 받아 설치 한다.
추가로 Doc and Demo도 받아서 설치한다.(유용함)

3. boaCounstructor을 다운받아 설치한다.
http://prdownloads.sourceforge.net/boa-constructor/

4. SPE를 다운 받아 설치한다.
http://www.stani.be/python/spe/page_blender


Written by NaHyunJae(http://j.finfra.com)
Copyright Finfra(http://www.finfra.com) All Rights Reserved
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 나현재

2005/07/15 11:47 2005/07/15 11:47
Response
No Trackback , No Comment
RSS :
http://j.finfra.com/tt/rss/response/262

Spec. of python IDEs

 

pythonWin

boaContructor

SPE

Version

build 204

v0.4.4

v0.7.3a

AutoComplete

some

good(ctrl-space)

good(auto)

Multi language in source code

Best
but,This may be worst(It save code by euc-kr.)

Good

Good(some trouble with not utf-8 code character)

UML

n/a

Good

Good

fileExplorer

n/a

Good

Good

InterFace

Good

Good

Good

stability

Good(except wxPython)

Good or Bad

normal

Gui Dev.

n/a

Best

normal
(It use outter gui generator wxGlade)


결론 :
비베나 비주얼 스튜디오 같은 환경에서 파이썬 윈도우즈 어플리케이션을 개발하는 것은 무리가 있으나 비슷하게는 할 수 있음.
UI는 boaConstructor로 코드 수정은 SPE로 개발을 해야 할 것 같음.
유니코드와 utf-8간의 호환 문제로 인한 wxPython의 문제가 해결 되었슴.
pythonWin은 euc-kr을 기본 문자셋으로 사용함으로 가급적 사용안하는 것이 좋음.


Written by NaHyunJae(http://j.finfra.com)
Copyright Finfra(http://www.finfra.com) All Rights Reserved
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 나현재

2005/07/12 10:01 2005/07/12 10:01
Response
No Trackback , No Comment
RSS :
http://j.finfra.com/tt/rss/response/260

WxPython사용기 3.

몇가지 셈플소스.


1. 응용프로그램 기본
import wx
app = wx.App()
frame = wx.Frame(None, -1, "Hello World")
frame.Show(1)
app.SetTopWindow(frame)
app.MainLoop()

import wx
class Frame(wx.Frame):
pass

class App(wx.App):
def OnInit(self):
self.frame=Frame(parent=None, id=-1, title="Test...")
self.frame.Show()
self.SetTopWindow(self.frame)
return True

if __name__ == '__main__':
app = App()
app.MainLoop()

-아래와 위는 같은 코드이나 클레스를 사용해서 실현해야 확장성 높음.


2. textBox, button사용법.
# -*- coding: utf-8 -*-

import wx

[wxID_FRAME1, wxID_FRAME1BUTTON1, wxID_FRAME1TEXTCTRL1, wxID_FRAME1BUTTON2
] = [wx.NewId() for _init_ctrls in range(4)]

class t1Frame1(wx.Frame):
def _init_ctrls(self, prnt):
# generated method, don't edit
wx.Frame.__init__(self, id=wxID_FRAME1, name='', parent=prnt,
pos=wx.Point(448, 310), size=wx.Size(400, 250),
style=wx.DEFAULT_FRAME_STYLE, title='Frame1')
self.SetClientSize(wx.Size(392, 223))

self.textCtrl1 = wx.TextCtrl(id=wxID_FRAME1TEXTCTRL1, name='textCtrl1',
parent=self, pos=wx.Point(128, 56), size=wx.Size(100, 22),
style=0, value='textCtrl1')

self.button1 = wx.Button(id=wxID_FRAME1BUTTON1, label='텍스트에 -----넣기',
name='button1', parent=self, pos=wx.Point(136, 88),
size=wx.Size(175, 24), style=0)

self.button1.Bind(wx.EVT_BUTTON, self.OnButton1Button,
id=wxID_FRAME1BUTTON1)

self.button2 = wx.Button(id=wxID_FRAME1BUTTON2, label='텍스트값 메세지박스로 보여주기',
name='button2', parent=self, pos=wx.Point(136, 130),
size=wx.Size(175, 24), style=0)

self.button2.Bind(wx.EVT_BUTTON, self.OnButton2Button,
id=wxID_FRAME1BUTTON2)

def __init__(self, parent):
self._init_ctrls(parent)

def OnButton1Button(self, event):
self.textCtrl1.SetValue("---------")

def OnButton2Button(self, event):
dlg = wx.MessageDialog(self, self.textCtrl1.GetValue(),
'텍스트 박스의 값',
wx.OK | wx.ICON_INFORMATION
#wx.YES_NO | wx.NO_DEFAULT | wx.CANCEL | wx.ICON_INFORMATION
)
dlg.ShowModal()
dlg.Destroy()


class BoaApp(wx.App):
def OnInit(self):
wx.InitAllImageHandlers()
self.main = t1Frame1(None)
self.main.Show()
self.SetTopWindow(self.main)
return True

if __name__ == '__main__':
app = BoaApp()
app.MainLoop()



- 특별한 것은 없음. 소스가 좀 길어짐.
- 위 소스 1줄에 첨가된 것은 한글사용시 워닝 메세지를 표시하지 않기 위해 한글 코드셋을 지정함.


Written by NaHyunJae(http://j.finfra.com)
Copyright Finfra(http://www.finfra.com) All Rights Reserved
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 나현재

2005/06/28 13:28 2005/06/28 13:28
Response
A trackback , No Comment
RSS :
http://j.finfra.com/tt/rss/response/255

WxPython사용기 2.

Getting Started 셈플코드로 연습.
1. "Hellow World."
import wx
app = wx.PySimpleApp()
frame = wx.Frame(None, -1, "Hello World")
frame.Show(1)
app.MainLoop()

- 위 소스의 문제 pythonWin에서 두번이상 안돌아감.(원인은 대충 알것 같으나, 확인은 안해봄. 이 밖에 정식 소스는 2번이상 잘 돌아감.)
- 참고 : http://wxwidgets.org/manuals/2.5.3/wx_wxframe.html#wxframe

2. 작동하는 셈플
import wx
class MainWindow(wx.Frame):
""" We simply derive a new class of Frame. """
def __init__(self,parent,id, title):
wx.Frame.__init__(self,parent,wx.ID_ANY,title,size=(200,100),style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE)
self.control = wx.TextCtrl(self,1,style=wx.TE_MULTILINE)
self.Show(True)

app = wx.PySimpleApp()

frame=MainWindow(None,-1,'Small editor')
app.MainLoop()

- 텍스트 컨트롤이 추가된 작은 메모장

3. 메뉴가 추가된
import os
from wxPython.wx import *
ID_ABOUT=101 #1. 이벤트 아이디를 생성.
class MainWindow(wxFrame):
def __init__(self,parent,id,title):
wxFrame.__init__(self,parent,wxID_ANY, title, size = ( 200,100),
style=wxDEFAULT_FRAME_STYLE|
wxNO_FULL_REPAINT_ON_RESIZE)
self.control = wxTextCtrl(self, 1, style=wxTE_MULTILINE)
self.CreateStatusBar() # A StatusBar in the bottom of the window
# Setting up the menu.
filemenu= wxMenu()
filemenu.Append(ID_ABOUT, "&About"," Information about this program")
# Creating the menubar.
menuBar = wxMenuBar()
menuBar.Append(filemenu,"&File") # Adding the "filemenu" to the MenuBar
self.SetMenuBar(menuBar) # Adding the MenuBar to the Frame content.
EVT_MENU(self, ID_ABOUT, self.OnAbout) # 2. 이벤트와 메써드를 연결. attach the menu-event ID_ABOUT to the OnAbout
self.Show(true)

# 3. 이벤트와 연결된 메써드
def OnAbout(self,e):
d= wxMessageDialog( self, " A sample editor \n"
" in wxPython","About Sample Editor", wxOK)
# Create a message dialog box
d.ShowModal() # Shows it
d.Destroy() # finally destroy it when finished.

app = wxPySimpleApp()
frame = MainWindow(None, -1, "Sample editor")
app.MainLoop()

- 이벤트 추가 절차
1. 이벤트 아이디를 생성.
2. 이벤트와 메써드를 연결.
3. 이벤트와 연결된 메써드를 작성.

Written by NaHyunJae(http://j.finfra.com)
Copyright Finfra(http://www.finfra.com) All Rights Reserved
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 나현재

2005/06/27 14:53 2005/06/27 14:53
Response
2 Trackbacks , No Comment
RSS :
http://j.finfra.com/tt/rss/response/254

WxPython사용기 1.

개요

WxPython은 python을 위한 Gui 작성 모듈로 현재 2.6.1.0버전 까지 나왔다.

관련 사이트
http://www.wxpython.org/
down : http://www.wxpython.org/download.php

시작

다운 받아 설치 하고, 샘플을 실행시켜 본다.(셈플을 보기 위한 Gui인터페이스를 지원한다.)

장단점

소스코드도 오픈되어 있고, 셈플도 충실하나 같은 소스로 여러 오에스에서 빠른 속도로 실행될지는 의문임(윈도우즈 함수를 사용하는 것 같음). 아직 리눅스에서 테스트전임.

학습

wxPython위키의 Getting Started(http://wiki.wxpython.org/index.cgi/Getting_20Started)에서 시작.
기초적인 코딩 연습은 Getting Started을 읽어 보면서, pythonWin을 가지고 테스트.
시간이 나서 좀더 해보고 싶으면http://wxpython.org/tutorial.php를 읽어 볼까 생각중...ㅋㅋ

Written by NaHyunJae(http://j.finfra.com)
Copyright Finfra(http://www.finfra.com) All Rights Reserved
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 나현재

2005/06/27 14:49 2005/06/27 14:49
Response
A trackback , No Comment
RSS :
http://j.finfra.com/tt/rss/response/253

That is simple..!!
Just copy MFC71.dll to C:\Python24\Lib\site-packages\pythonwin after install win32all.
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 나현재

2005/06/06 06:31 2005/06/06 06:31
Response
No Trackback , No Comment
RSS :
http://j.finfra.com/tt/rss/response/247


블로그 이미지

Insufficient memory! So,Blog is my 2nd Brain!

- 나현재

Notices

Archives

Authors

  1. 나현재

Calendar

«   2012/05   »
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Site Stats

Total hits:
205602
Today:
16
Yesterday:
22