[Tutor] how to get a line text from input file.

2006-03-21 Thread Keo Sophon
Hi all, i am new to programming language and python. I wonder how to get a line text from input file. Thanks, sophon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] how to set a value to a block of memory

2006-03-21 Thread Keo Sophon
Hi all, How can i set a value to a bytes of block of memory. In C, i think they use memset like this. Thanks, Sophon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tutor Digest, Vol 25, Issue 54

2006-03-22 Thread Keo Sophon
On Wednesday 22 March 2006 14:14, [EMAIL PROTECTED] wrote: > Hi Sophon, > > You may want to look at: > > http://wiki.python.org/moin/BeginnersGuide/NonProgrammers > > Many of the tutorials there talk about reading from files, including Alan > Gauld's "How to Program": > > http://www.freen

Re: [Tutor] Tutor Digest, Vol 25, Issue 54

2006-03-22 Thread Keo Sophon
On Wednesday 22 March 2006 14:14, [EMAIL PROTECTED] wrote: > Hi Sophon, > > Secondary question: why are you trying to do this? Are you trying to > represent a collection or "array" of things? i am trying to port a program written in C to python language. The program is reading a plain text file

[Tutor] compilte python to an executable file.

2006-03-26 Thread Keo Sophon
hi all, Does anyone know how to compile a python filename.py to an executable file? thanks, phon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] compilte python to an executable file.

2006-03-26 Thread Keo Sophon
On Monday 27 March 2006 10:38, Ars wrote: > > On 27/03/06, Keo Sophon <[EMAIL PROTECTED]> wrote: > > > hi all, > > > > > > Does anyone know how to compile a python filename.py to an executable > > file? > I don't know how python creates executa

[Tutor] get a character of an ascii-value

2006-03-28 Thread Keo Sophon
Hi all, I wonder how to get a character of an Ascii-value. For example, i have r = 37. So i wanna print the character of 37. Is there any function? Thanks, Sophon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] get a character of an ascii-value

2006-03-28 Thread Keo Sophon
On Wednesday 29 March 2006 13:54, Keo Sophon wrote: > Hi all, > > I wonder how to get a character of an Ascii-value. For example, i have r = > 37. So i wanna print the character of 37. Is there any function? > > Thanks, > Sophon I just got the answer from Pujo. How about

[Tutor] removing file from zip archive.

2006-03-28 Thread Keo Sophon
Hi all, How can we remove one file inside of a zip archive? I'm using this method: import zipfile ziparchive = zipfile.ZipFile('test.odt', 'r') xmldata = ziparchive.read('content.xml') ziparchive.close Thanks in advance, Sophon _

Re: [Tutor] removing file from zip archive.

2006-03-29 Thread Keo Sophon
On Wednesday 29 March 2006 15:38, Tim Golden wrote: > | How can we remove one file inside of a zip archive? > | > | I'm using this method: > | > | import zipfile > | > | ziparchive = zipfile.ZipFile('test.odt', 'r') > | xmldata = ziparchive.read('content.xml') > | ziparchive.close >

Re: [Tutor] newbie exercises

2006-03-29 Thread Keo Sophon
On Monday 27 March 2006 19:53, Steve Nelson wrote: > On 3/27/06, josip <[EMAIL PROTECTED]> wrote: > > Can someone give me exercises to do with loops, maybe functions to? > > How about a program that produces truth tables for the basic gates? > AND, NAND, NOT, OR, XOR? > > You could write a function

Re: [Tutor] get a character of an ascii-value

2006-03-29 Thread Keo Sophon
On Thursday 30 March 2006 01:25, Hugo González Monteverde wrote: > Hi, > > Python strings are binary strings as they can contain any value, > including 0 (NULL) Depending on the encoding of the string, this may or > may not be printable, and characters over ASCII 127 will mean different > letters a

[Tutor] XML node name and property

2006-03-30 Thread Keo Sophon
Hi all, How can I get a name of an XML node and and its property name and its property value? Thanks, Sophon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] XML node name and property

2006-03-31 Thread Keo Sophon
On Friday 31 March 2006 17:37, Kent Johnson wrote: > Keo Sophon wrote: > > Hi all, > > > > How can I get a name of an XML node and and its property name and its > > property value? > > How are your reading the XML? (xml.dom, Elemen

[Tutor] how to get the content of an XML elements.

2006-03-31 Thread Keo Sophon
Hi all, Is there anyway to get the content of an XML elements. I am using xml.dom. Thanks, Phon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] convert decimal to hexa, to octal and vice versa.

2006-04-05 Thread Keo Sophon
Hi, How to convert a decimal number to hexadecimal, octal and vice versa? Thanks, phon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] convert an integer number to string.

2006-04-05 Thread Keo Sophon
hi, how to convert an integer number to string? thanks, phon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] how to get the content of an XML elements.

2006-04-05 Thread Keo Sophon
On Sunday 02 April 2006 04:47, Kent Johnson wrote: > Alan Gauld wrote: > > "Keo Sophon" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > >>Is there anyway to get the content of an XML elements. I am using > >> xml.dom. >

[Tutor] testing u=unicode(str, 'utf-8') and u = str.decode('utf-8')

2006-04-05 Thread Keo Sophon
Hi, Today i tested u=unicode(str,'utf-8') and u=str.decode('utf-8'). Then in both case I used: if isinstance(u,str): print "just string" else: print "unicode" the result of both case are "unicode". So it seems u=unicode(str,'utf-8') and u=str.decode('utf-8') are the same. How about the pr

[Tutor] input with default value option

2006-04-10 Thread Keo Sophon
Hi, With raw_input(), it allows to input value. Can it be used to input value with default value option? Phon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] How use relative path of Linux environment in Python

2006-04-24 Thread Keo Sophon
Hi all, Do you have any idea of how to use relative path of Linux environment in Python. For example, if a program would like to create an oupfile from these assignment: outputfile = "~/Desktop/" + workingfile, while "~" is the short cut to the path of current user. Thanks, Phon __

[Tutor] getting system temporary directory.

2006-04-25 Thread Keo Sophon
Hi all, Does python has any function to get a system tempdir of an OS? Thanks, Phon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] FileDialogBox in Tkinter

2006-06-05 Thread Keo Sophon
Hi all, What to do in order to get FileDialogBox in Tkinter for using? Where to find a complete reference of Tkinter? Thanks, Phon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] FileDialogBox in Tkinter

2006-06-06 Thread Keo Sophon
On Tuesday 06 June 2006 14:49, you wrote: > > What to do in order to get FileDialogBox in Tkinter for using? > > > >>> import tkFileDialog > >>> res = tkFileDialog.asksaveasfilename(defaultextension=".txt") > > Does that help? > > > Where to find a complete reference of Tkinter? > > I assume you ha

[Tutor] Combo Box in Tkinter

2006-06-06 Thread Keo Sophon
Hi, Is there any Combo Box in Tkinter? I looked for it but only found list box. Might it be list box having any option to make itself as a combo box? Thanks, Phon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Graphical Toolkit for new XLIFF translation editor

2006-06-26 Thread Keo Sophon
Hello list, KhmerOS is going to write an XLIFF translation editor with Python. Before starting, we would like to know which Graphical Toolkit should be used for the editor which supports many languages including Latin, Indic, Arabic and so on. However, there are many GUI toolkits such as QT, GT

[Tutor] Internal Python memory dump

2007-01-28 Thread Keo Sophon
Hi, Does anyone know where I can find documents of Internal python memory dump? thanks, Phon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor