[Tutor] get_python_lib()

2008-01-15 Thread Kakada
Hi list, I was just wondering why the below function return different location on different machine? import distutils.sysconfig distutils.sysconfig.get_python_lib() On my computer: '/usr/lib/python2.5/site-packages' On my friend's computer: '/usr/local/lib/python2.5/site-packages' What is the

[Tutor] open email client from Help menu

2008-01-03 Thread Kakada
Hi every one, In my program, I want to have "Report Bug..." under Help menu. So, whenever user clicks on it, it will open an email client for reporting bugs with the given address. How can I do this? I set text to actionReportBug like this: Report Bug... but it doesn't support html tag. Any m

Re: [Tutor] cannot pickle instancemethod objects

2007-06-18 Thread hok kakada
នៅថ្ងៃ ពុធ 13 មិថុនា 2007 19:09, Kent Johnson បាន​សរសេរ​ថា ៖ > hok kakada wrote: > >> What kind of object is matcher? Does it have any attributes that are > >> functions? (Not methods you defined for the class, but functions or > >> methods that you assign to attribu

[Tutor] cannot pickle instancemethod objects

2007-06-11 Thread hok kakada
Dear everyone, I got a problem while pickling a class object. I have done something as below: pickleFile = open(filename, 'wb') pickle.dump(matcher, pickleFile) pickleFile.close() where matcher is class object and I got the follow errors: Traceback (most recent call last)

[Tutor] How to set value back to .conf file

2007-03-20 Thread hok kakada
Hi all, I just start to use ConfigParser to store the configuration for my application. I surfed the mails related to ConfigParser, however I couldn't found the way of how to set value back to the .conf file. Let say, I have a test.conf file with: [General] userName="da" later on, I wanna add

[Tutor] python2vb.net

2006-10-25 Thread hok kakada
Dear All, A friend of mine is well programming in vb.net and C#. He got a python sourcecode of KhmerConverter tool. He would like to port to either vn.net or C#. Are there any tools to do this? Thanks, da ___ Tutor maillist - Tutor@python.org http:/

Re: [Tutor] save configuration of one application.

2006-10-11 Thread hok kakada
On Wednesday 04 October 2006 11:54, John Fouhy wrote: > On 04/10/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: > > you can make a config.ini file and use that one module that parses ini > > files. > > I can't remember what it's called. > > configparser I think, but I wouldn't bet my life on it :

[Tutor] save configuration of one application.

2006-10-03 Thread hok kakada
Hi, Can anybody guide me how to write the code for configure one application? For example, I want to set Font and Color for a textbox; later when the application is opened again. the previous font is set. So, which related function are used to form this feature? Thanks, da _

Re: [Tutor] python import problem

2006-08-09 Thread kakada
បានសរសេរ Alan Gauld: Hi Alan, >> the folders modules and translate are in the same level, so if I want to >> import factory.py into myfile.py, how can I do? > > You need to make your folders into packages. > Its fairly simple, you basically create an init.py file > But its worth reading about packa

[Tutor] python import problem

2006-08-09 Thread kakada
Hi all, I have problem with import statement. supposed that I have two files in different folders : modules/myfile.py and translate/factory.py. the folders modules and translate are in the same level, so if I want to import factory.py into myfile.py, how can I do? I have already done in myfil

Re: [Tutor] playing around with function

2006-07-28 Thread kakada
បានសរសេរ kakada: > Thank Alan and Luke, > > My coding is divided up into many modules and import from one to another. > Here is my editor.py interface. > > > #!/usr/bin/python > # -*- coding: utf8 -*- > > import sys > import application_rc > from PyQt4 import Q

Re: [Tutor] playing around with function

2006-07-28 Thread kakada
Thank Alan and Luke, My coding is divided up into many modules and import from one to another. Here is my editor.py interface. #!/usr/bin/python # -*- coding: utf8 -*- import sys import application_rc from PyQt4 import QtCore, QtGui from ui_editor import Ui_MainWindow from translate.storage imp

[Tutor] playing around with function

2006-07-27 Thread kakada
Hello, I have problem with function jumping: in my class, I have three function here: def gotoNextFuzzy(self): state = "isfuzzy" self.navigationNext(state) def gotoNextFuzzy(self): state = "isapproved" self.navigationNext(state) def navigationNext(self,state):

[Tutor] treeWidget in QT Designer

2006-07-25 Thread kakada
Hi there, I am trying to build GUI python using Qt4. I am working with treeWidget to view my data. With the first load, I want the selected item go to the first row by doing: curItem = self.ui.treeWidget.itemAt(1,1) self.ui.treeWidget.setCurrentItem(curItem) It's ok. Then I want it jump to 4th

[Tutor] error when installing sip-4.4.5

2006-07-14 Thread kakada
Hello list, I am on the way of learning QT design. I need to have pyQT installed. In the meanwhile, It needs sip-4.4.5 before proceed. I went across with the steps: python configure.py ...ok make In this step, I got alot of errors as follow and some more: siplib.c: In function ‘sipGetAdd

[Tutor] icon on windows manager

2006-06-11 Thread kakada
Hi everyone! Does any body know how to put icon on windows manager using Tix module? Thanks, da ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] combo box

2006-06-11 Thread kakada
Michael Lange wrote: > On Tue, 06 Jun 2006 13:39:21 +0700 > kakada <[EMAIL PROTECTED]> wrote: > > >> Dear Friends, >> >> I am now working on GUI python (Tkinter). >> I want to use combobox as my widget, but I cannot find it in any document. &g

[Tutor] combo box

2006-06-05 Thread kakada
Dear Friends, I am now working on GUI python (Tkinter). I want to use combobox as my widget, but I cannot find it in any document. Does anybody have experience with that? Thanks, da ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman

Re: [Tutor] How to import a module which was not in the current working directory?

2006-05-26 Thread kakada
Hi Linda, Let say you have a tool named convert.py and other module (processing.py) in modules folder. In modules folder create an empty file named __init__.py In convert.py do: from modules import processing.py It would work. da linda.s wrote: > Hi, > How to import a module which was not in t

Re: [Tutor] StringIO

2006-05-22 Thread kakada
Danny Yoo wrote: >> I want to use the module StringIO as read and write strings as files, >> I looked into document but cannot understand. Could anyone give me a >> simple example? >> >> something like: >> from StringIO import * >> fin = StringIO("abc") >> . >> How can I used fin? > > 'fin' is

[Tutor] StringIO

2006-05-22 Thread kakada
Hello list, I want to use the module StringIO as read and write strings as files, I looked into document but cannot understand. Could anyone give me a simple example? something like: from StringIO import * fin = StringIO("abc") . How can I used fin? Thanks, da __

Re: [Tutor] [Linux] open a file in any home "~" ?

2006-04-24 Thread kakada
learner404 wrote: > It works great, thanks very much to the three of you for these > light-speed answers ... I love this list ! > > Wesley, I've just pre-order your new edition "Core Python programming" > on amazon France, it looks great. :) > > Thanks I love this list too. Da __

[Tutor] encode

2006-04-18 Thread kakada
Hi again folks, I wonder if we can check the encoding of text in one text file. user is free to encode the file whether Latin1, utf-8, ANSI... Any ideas? Thx da ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] dictionary datatype

2006-04-12 Thread kakada
orks for me: > > >>> dict1 = { 0x2018:u'k', 0x2019:u'd'} > >>> n = 0x2018 > >>> print dict1[n] > k > >>> > > On 4/11/06, * kakada* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > He

[Tutor] dictionary datatype

2006-04-11 Thread kakada
Hello all, For example, I have a dictionary: dict1 = { 0x2018:u'k', 0x2019:u'd'} I assign: n = 0x2018 print dict1[n] Then: KeyError: '0x2018' But I can call directly: print dict1[0x2018] So, what is wrong with this? Ho

[Tutor] encoding

2006-04-11 Thread kakada
o it? Thanks and !Happy Khmer New Year! kakada ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] file?

2006-04-03 Thread kakada
Hi all, How can we know that one specific file is already exist in filesystem? for instance, I want to read zipfile by issuing code: import zipfile ziparchive = zipfile.ZipFile(inputfilename, "r") if the inputfilename doesn't exist then an error would be occurred. I want to catch up this special

[Tutor] getAttribute

2006-03-31 Thread kakada
Hello all, Could anyone help me by giving example of getAttribute xmldata = ziparchive.read("content.xml") xmldoc = minidom.parseString(xmldata) officeNode = xmldoc.getElementsByTagName('office:text') I have another function: def go_thru (nodelist): for x in range(nodelist.length): n

[Tutor] remove not-empty directory

2006-03-30 Thread kakada
Hi all, Just a quick question again, how can I remove not-empty directory in python? assumed I have the following directory: ( temp/a/b/ temp/a/c/d.odt temp/e.xml) I want to remove the whole temp/ directory. Thanks :) da ___ Tutor maillist -

[Tutor] number of nodes

2006-03-29 Thread kakada
Hello everyone, textp = xmldoc.getElementsByTagName('text:p') from the example above, How can I know how many node are there? Thanks, da ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor