are metaclasses like templates in C++
thanks for your explanations
No, there is no direct concept of metaclasses in C++.
You need to ook to languages like Lisp and Smaltalk for those.
The nearest you get to meta-classes in C++ is static members
and methods. But they don't allow you to alter
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
Hello,
I am reading the Regular Expression HOWTO at
http://www.amk.ca/python/howto/regex/
I am at the bit where greediness is discussed with respect to
metacharacters enabling repetition of sections of a RE. I understand
the concept.
The author gives a step by step example of how the matching
It depends a lot on what your prior programming experience in other
languages is.
I have a large amount of prior programming experience, and I found Learning
Python very good. The Python Cookbook (Martelli et. al., also O'Reilly)
is very useful for learning the idioms.
-Original
On 14/07/06, Steve Nelson [EMAIL PROTECTED] wrote:
What I don't understand is how in the end the RE *does* actually match
- which may indicate a serious misunderstanding on my part.
re.match(a[bcd]*b, abcbd)
_sre.SRE_Match object at 0x186b7b10
I don't see how abcbd matches! It ends with a
On 7/14/06, John Fouhy [EMAIL PROTECTED] wrote:
It doesn't have to match the _whole_ string.
Ah right - yes, so it doesn't say that it has to end with a b - as per
your comment about ending with $.
If you look at the match object returned, you should se that the match
starts at position 0
Dear Alan,
Probably you will be interested
about list comprehension and zip(), as it can simplify all the similar
tasks.
s = ('Monday 7373 3663657 2272 547757699
reached 100%','Tuesday 7726347 552 766463 2253 under-achieved 0%','Wednesday
9899898 8488947 6472 77449 reached 100%','Thursday
Hi
I'm a begginner in python,tried the link
pythonchallenge.comsolved the first level,but i dont know how to go to the next one.
Can somebody tell me how?
Thanks
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
anil maran wrote:
hi guys
are metaclasses like templates in C++
No. Templates are a way to make generic functions that will work with a
variety of types of data. Because Python is dynamically typed, all
functions are generic in this sense and templates are not needed.
See
anil maran wrote:
hi you wonderful energetic pygurus
i need to send out lot of emails and sms messages from a python program
please let me know if you know of any library like java sms library or
possible solutions
smtplib will help with sending emails. I hope they are not spam!
Kent
Steve Nelson wrote:
On 7/14/06, John Fouhy [EMAIL PROTECTED] wrote:
It doesn't have to match the _whole_ string.
Ah right - yes, so it doesn't say that it has to end with a b - as per
your comment about ending with $.
The matched portion must end with b, but it doesn't have to
On 14/07/06, Steve Nelson [EMAIL PROTECTED] wrote:
How does one query a match object in this way? I am learning by
fiddling interactively.
If you're fiddling interactively, try the dir() command --
ie:
m = re.match(...)
dir(m)
It will tell you what attributes the match object has.
Or you
Alan Collins wrote:
Hi,
I do a far bit of data manipulation and decided to try one of my
favourite utilities in Python. I'd really appreciate some optimization
of the script. I'm sure that I've missed many tricks in even this short
script.
Let's say you have a file with this data:
On 7/14/06, John Fouhy [EMAIL PROTECTED] wrote:
m = re.match(...)
dir(m)
It will tell you what attributes the match object has.
Useful - thank you.
I am now confuse on this:
I have a file full of lines beginning with the letter b. I want a
RE that will return the whole line if it begins
I have a file full of lines beginning with the letter b. I want a
RE that will return the whole line if it begins with b.
I find if I do eg:
m = re.search(^b, b spam spam spam)
m.group()
'b'
How do I get it to return the whole line if it begins with a b?
S.
for line in
Steve Nelson wrote:
On 7/14/06, John Fouhy [EMAIL PROTECTED] wrote:
m = re.match(...)
dir(m)
It will tell you what attributes the match object has.
Useful - thank you.
I am now confuse on this:
I have a file full of lines beginning with the letter b. I want a
RE
On 7/14/06, Kent Johnson [EMAIL PROTECTED] wrote:
But for this particular application you might as well use
line.startswith('b') instead of a regex.
Ah yes, that makes sense.
Incidentally continuing my reading of the HOWTO I have sat and puzzled
for about 30 mins on the difference the
On 7/14/06, Jason Massey [EMAIL PROTECTED] wrote:
Devayani,What answer did you get? One of the things to rember on the challenge is to take your answer and put .html (no qutoes) on the end of it in the url.So for the first problem the url would be:
http://www.pythonchallenge.com/pc/def/ your
Steve Nelson wrote:
Incidentally continuing my reading of the HOWTO I have sat and puzzled
for about 30 mins on the difference the MULTILINE flag makes. I can't
quite see the difference. I *think* it is as follows:
Under normal circumstances, ^ matches the start of a line, only. On a
line
Hello all,
I am writing a function in which (in its simplified form) I am trying to
return a list of a specified attribute, given a list of objects. It is
best if I write some hypothetical code to explain:
class foo:
def __init__(self, name, data):
self.name = name
Did you considered getattr?
def getAttrs(fooObjs, attr):
return map(lambda item: getattr(item, attr), fooObjs)
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Emily Fortuna wrote:
Hello all,
I am writing a function in which (in its simplified form) I am trying to
return a list of a specified attribute, given a list of objects. It is
best if I write some hypothetical code to explain:
class foo:
def __init__(self, name, data):
Greetings:
Like Matthew, I have a been programming for several years, mostly in
C-like languages and various assembly languages. I started using Python
about two years ago. Learning Python is my text book; Python in a
Nutshell is my language reference. Both are excellent. I use one or
both
On Thu, 13 Jul 2006, Grady Henry wrote:
I have three books on Python programming, Learning Python by O'Reilly,
Beginning Python by Hetland, and Python in a Nutshell by O'Reilly.
Are these good (recommended) books? Any others that might be
recommended?
I don't know the Hetland book.
I
On 7/14/06, Terry Carroll [EMAIL PROTECTED] wrote:
On Thu, 13 Jul 2006, Grady Henry wrote:
I have three books on Python programming, Learning Python by O'Reilly,
Beginning Python by Hetland, and Python in a Nutshell by O'Reilly.
Are these good (recommended) books? Any others that might be
Date: Fri, 14 Jul 2006 12:12:42 +0200
From: J?nos Juh?sz [EMAIL PROTECTED]
Subject: [Tutor] Help with strings and lists.
To: [EMAIL PROTECTED], tutor@python.org
Message-ID:
[EMAIL PROTECTED]
Content-Type: text/plain; charset=iso-8859-2
Dear Alan,
Probably you will be interested
Date: Fri, 14 Jul 2006 16:43:32 +1200
From: John Fouhy [EMAIL PROTECTED]
Let me attempt to be the first to say:
String substitutions!!!
The docs are here: http://docs.python.org/lib/typesseq-strings.html
snip
Thanks John, that looks way better. I'll also check out the page.
Alan.
Hi all,
I am trying to get to grips with QT, putting a friendly face on some of my
apps :) Its early days and my first attempt but I expected the following to
print 'hi it works' every second.
There problem I am stuck with is ...
The debugged program raised the exception unhandled
I have three books on Python programming, Learning Python by O'Reilly,
Beginning Python by Hetland, and Python in a Nutshell by O'Reilly. Are
these good (recommended) books? Any others that might be recommended?
Learning is a good book to learn from if you already know C.
Beginning is a good
On 7/14/06, wesley chun [EMAIL PROTECTED] wrote:
while it would be a conflict-of-interest for me to give *my* opinion
of the book, it appears to be pretty well-received (mostly by
word-of-mouth) based on comments i've seen so far. :-)
I don't know about others, but I think it might be of
I'm trying to write a program that will read a text file and return a random subset of the words contained therein. (Its purpose is to generate lists of words for spelling bees. I'm a teacher.) Here's what I have so far:
CODE STARTS ***L1 = []# create an empty
I don't know about others, but I think it might be of benefit if you
could give an assessment that would include a description of the
weaknesses of the book
[I could be in a minority opinion here. People like Kent, Alan,
Danny, etc. should probably comment.]
I'm no expert since I've only
def exists('/Users/username/Documents/python/word_bank.txt'):
return os.access('/Users/usernameDocuments/python/word_bank.txt',
1. I get a syntax error message at the line that starts with def
exists, but I don't see the mistake.
You are defining a function with a constant as an
On Friday 14 July 2006 19:21, Dave S wrote:
Hi all,
I am trying to get to grips with QT, putting a friendly face on some of my
apps :) Its early days and my first attempt but I expected the following to
print 'hi it works' every second.
There problem I am stuck with is ...
The debugged
I also am a novice. Nearly finished with the first book listed below...
If learning Python for the fun of it I have found this one enjoyable (pasted
below is listing at Amazon):
Python Programming for the Absolute Beginner, Second Edition (For the
Absolute Beginner) by Michael Dawson
(LONG... you've been warned ;-) )
andre wrote:
I don't know about others, but I think it might be of benefit if you
could give an assessment that would include a description of the
weaknesses of the book
I'm no expert since I've only browsed Wesley's book in a store
a few times but
supposeI need to create 1000 000 variables
var_1, var_2, var_100
how to do this using for?
(something like
for i in range(100):
___var_
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
--- ÁÕàÓöÙ [EMAIL PROTECTED] wrote:
suppose I need to create 1000 000 variables
var_1, var_2, var_100
how to do this using for?
(something like
for i in range(100):
___var_
How would you consider NOT creating 100,000 variables
??
Answer that question and you should be
Сергій wrote:
suppose I need to create 1000 000 variables
var_1, var_2, var_100
how to do this using for?
(something like
for i in range(100):
___var_
Rather than creating 100 variables, create a list with 100 values.
data = []
for i in range(100):
data.append(i*i)
Thanks guys for all your inputs so far.
Unfortunately, I still cant get it to work using the methods below.
Attached is the code from my python shell,
and the output is still Backup failed when I run it.
Can somebody explain what Im doing
wrong?
Thanks,
Shashi
Email : [EMAIL
Hello,I am new to programming in Python, but I am very excited about
the possibilities that it (Python) has.I maybe jumping the gun a
little bit here, but this is what I would like to do:I would like to
41 matches
Mail list logo