[Tutor] Hi

2006-04-04 Thread Kaushal Shriyan
Hi ALL A simple query is that the python mailing List is python powered What does python powered means thanks Regards Kaushal ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] defined()

2006-04-04 Thread János Juhász
Dear Tim, Dear Alan, I can't find the defined() function in python, so I used 'variable name' in dir() Is it really missing, or I am just so simple ? It is really missing, just as it is for most programming languages. Which language(s) do you know that has such a feature? I should came

Re: [Tutor] Hi

2006-04-04 Thread Steve Nelson
On 4/4/06, Kaushal Shriyan [EMAIL PROTECTED] wrote: Hi ALL A simple query is that the python mailing List is python powered What does python powered means The list, and many like it, use a piece of software called Mailman, which is written in Python. A few years back, the tool of choice was

[Tutor] how to get data from xml

2006-04-04 Thread ទិត្យវិរៈ
Dear all Pythoners, I am quiet new to python and now working with xml. I have an xml like this: ?xml version=1.0 encoding=utf-8? fonttables table name=abc CONSONANTS KA0x6B/KA KHA0x78/KHA KO0x4B/KO KHO0x58/KHO NGO0x67/NGO

Re: [Tutor] Bigrams and nested dictionaries

2006-04-04 Thread Kent Johnson
Michael Broe wrote: dict = {} dict is the name of the builtin dictionary class, so you shouldn't use it as the name of your dict - you shadow the built-in name. file is also a built-in name. L = file[0] for R in file[1:]:# move right edge of window across the file if not L in

[Tutor] Bits

2006-04-04 Thread Øyvind
Hello. Is it possible to read the bits (the 0's and 1's) of a string or a file with Python? What module would I use? Thanks in advance, Øyvind -- This email has been scanned for viruses spam by Decna as - www.decna.no Denne e-posten er sjekket for virus spam av Decna as - www.decna.no

Re: [Tutor] Bits

2006-04-04 Thread Kent Johnson
Øyvind wrote: Hello. Is it possible to read the bits (the 0's and 1's) of a string or a file with Python? What module would I use? I don't know exactly what you mean by read the bits but you can use data = open('afile', 'b').read() to get the data into a string byte1=ord(data[1]) to get a

Re: [Tutor] defined()

2006-04-04 Thread Alan Gauld
Which language(s) do you know that has such a feature? I should came from Marco Cantu's Delphi 2005 book, that I have read just recently. But I am unable to find it again. I'd be very surprised if it came from Delphi for two reasons: a) I used Delphi a lot for several years and never came

Re: [Tutor] Bits

2006-04-04 Thread Alan Gauld
Øyvind [EMAIL PROTECTED] wrote in message Is it possible to read the bits (the 0's and 1's) of a string or a file with Python? What module would I use? Yes, you can read the bits by reading bytes and applying bitmasks and bitwise operations. You can get the bytes using the struct module

Re: [Tutor] Protected methods/variables

2006-04-04 Thread Alan Gauld
Miquel Oliete [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have been programming in object oriented languages for several years and I'm learning python now. Congratulations :-) I have missed protected method/variables in Python. In what sense have you missed them? Have you

Re: [Tutor] Protected methods/variables

2006-04-04 Thread w chun
I have missed protected method/variables in Python. How do you declare methods/variables used only by a class and their derived classes? hi Ktalà, welcome to Python! you missed protection in OOP with Python bceause there are no such declarations in Python! 1) there is a privacy *hint*, which

Re: [Tutor] Protected methods/variables

2006-04-04 Thread Kent Johnson
w chun wrote: I have missed protected method/variables in Python. How do you declare methods/variables used only by a class and their derived classes? hi Ktalà, welcome to Python! you missed protection in OOP with Python bceause there are no such declarations in Python! 1) there is a

Re: [Tutor] Protected methods/variables

2006-04-04 Thread Mike Hansen
- you can use __slots__ to restrict arbirtrary creation of (dynamic) instrance attributes You can do this, but it is generally considered a misuse of __slots__ and potentially problematic. I'll bite. What is the proper/intended use of __slots__? Does it have something to do with

[Tutor] Space the final frontier!

2006-04-04 Thread John Corry
Dear All, I am having difficulty removing white spaces from my file. The file is 999 lines long and looks like the sample below: 001, new field,dial= 028 90 79 0154, dial= 002, borfiled, dial= 02890 618521, dial= 003, newcomp, dial=02890419689, dial= The program, I am using to import the file