hi guys,
Thanks all for input, if anything else.. please let me know.
cheers,
Andrei
> On 03 Jun 2016, at 11:14, Alan Gauld via Tutor wrote:
>
> On 02/06/16 21:43, Andrei Colta wrote:
>> Hi,
>>
>> Anyone can recommend practical work on learning python.. seems readi
Hi,
Anyone can recommend practical work on learning python.. seems reading and
reading does not helping.
Thanks in advance,
Andrei
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman
Thanks for sharing, will try it.
Cheers,
Andrei
On 9 May 2015 15:45, "Nym City" wrote:
> I am on the same boat. I have tried using online sites like codeacademy
> and courses on courser but now I am starting with this new book called
> "Automate The Boring Stuff with
A good place to look at : http://www.norvig.com/sudoku.html
On Mon, Apr 7, 2008 at 6:53 PM, Luke Paireepinart <[EMAIL PROTECTED]>
wrote:
> W W wrote:
> > On 4/7/08, Luke Paireepinart <[EMAIL PROTECTED]> wrote:
> >
> >> W W wrote:
> >> What are you talking about? I don't understand what you mean
i'm thinking the same way Eric do.
On Wed, Feb 27, 2008 at 11:18 PM, Eric Brunson <[EMAIL PROTECTED]> wrote:
> Alan Gauld wrote:
>
> "bob gailer" <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote
>
>
>
> i don't really understand that. you are trying to say that the
> tests
> from the online judge
write(number)
[/code]
Any alternatives for the personal rambling(if it's a wrong way to do it, of
course):
L = [1,2,[3,4],[5,5]]
for item in L:
if type(item) == list:
print L[item[0]], L[item[1]]
else:
print L[item]
Thanks,
Andrei
import sys
def write(numb
Hello,
I want to read from the standard input numbers until i reach a certain value
or to the end of the "file".
What is the simplest, straightforward, pythonic way to do it?
a sketch of how i tried to do it:
[code]
while 1 < 2:
x = raw_input()
if type(x) != int or x == 11:
break
Glade - you can design your
interface in a point-and-click manner. You will need to learn a bit
about wxPython in the process, but don't have to become an expert.
--
Yours,
Andrei
=
Mail address in header catches spam. Real contact info:
''.join([''.join(s) for s in
around all this metaclass safety by adding
using this code:
NoNewAttrs.__metaclass__.__setattr__ = type.__setattr__
NoNewAttrs.__setattr__ = object.__setattr__
nna.x = 5
print 'After reset: nna.x =', nna.x
Run this and you'll see
552211', '"/home/whoever"'),
('dir0.8258732656650.272559810163', '"/home/florian"'),
('dir0.6565224032210.703769464586', '"/home/john"')]
Note that it will do this for *all* options in your file, even
owHelp()
else:
fileop.Perform()
Adding new operations would be a matter of implementing an appropriate class and
adding it to the operations dictionary. With a bit of Python magic you could
even get the operation classes to auto-register, so just writing an operation
class would
es if you need getter/setter methods or simple attributes
otherwise. In your case, I would not make __filename etc. 'private'
(that's what the double underscore suggests), then write a getter method
for it - just call it FileName and be done with it. Python idiom here is
more flexi
n
may consist of multiple characters". But I cannot figured out why this
simple example not working:
s = "spam;egg mail"
s.split("; ")
output: ['spam;egg mail']
instead of ['spam', 'egg', 'mail']
any suggestion is welcome,
andre
yourself, movie stars, pets or other frivolities
- flattering as it may be - will become problematic when a couple of
months later you're wondering why the application crashes upon adding
Fido to DarthVader, appending the result to ApplePie and writin
and my app is yet another CDROM
> database program; more details available if it matters.)
--
Yours,
Andrei
=
Mail address in header catches spam. Real contact info:
''.join([''.join(s) for s in zip(
"[EMAIL PROTECTED] pmfe!Pes ontuei ulcpss edtels,s hr' on
ving to manually update who knows how many
translations whenever you decide to rename a variable
On the other hand, having the variable name in there may give the translator
useful information about the way he should translate a string, as the
translation may be in
r 'Name: %s' string and he gives you 'Borkbork: %s' or
whatever. The translation doesn't need to be modified if you decide to
make a user class and get rid of the username and userage vars.
- format strings give you more control, so you can e.g. specify how many
digits
.keys()
... [1,2,3,4]
The set solution is the Most Obvious Way to do it, but the dict one
doesn't require an understanding of list comprehensions.
--
Yours,
Andrei
=
Mail address in header catches spam. Real contact info:
''.join([''.join(s) for s in zi
articular time?
Not as such. In your case, I think the task manager would be enough. You
only have this one demanding data structure I assume, so in a rough
approximation you can pretend that whatever the task manager reports
(have a look at VM and peak memory usage columns, not just memory u
ome webscraping if the files are not readily modifiable.
Its setup is about 350 kB.
In terms of installers, NSIS (with the package to make it look modern,
instead of that awful default look - forgot its name) or InnoSetup are
the usual suspects. NSIS has a smaller overhead, but an uglier langu
gt; >
> > doesn't work (not that I expected it to).
>
> Why not use a Set?
>
> s = Set([somefun(i) for i in some-iterator])
>
Alternatively, you could put the results as keys in a dictionary, then request
mydict.keys() to get a list of unique outcomes.
Yours,
An
_init__(self, x): self.x = x
... def dostuff(self, arg):
... print self.x
... print arg
...
>>> def dostuff(obj, method):
... method(obj, 'blabla')
...
>>> a = A(5)
>>> dostuff(a, A.dostuff)
5 # this demonstate
a child, otherwise they're
unrelated.
> I can't seem to rack my brains around a solution for this. Maybe it's
> my tree-structure that is making this more complex than it should be?
Hierarchies are easier if you look at them as families: it's easier to
ask a parent how many children it has, than it is to ask one of the
siblings if there is any sibling younger than it, then ask that younger
sibling if it has any younger siblings, etc.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
ses very
cumbersome to deal with, or trusting the programmer to do the right thing -
thereby making it easier to stick his grubby little fingers in places where he
shouldn't. Some people prefer the former, some the latter.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
ing is potentially dangerous.
Say I accidentally specify p=2atn. The program will calculate with 2 kPa, but I
wouldn't know that. If instead it displayed its interpretation of my input by
writing "p = 2 kPa" to the screen, I'd have a better chance of noticing.
Alternatively
ested), but it
will take anything you throw at it as long as Python itself can handle it.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
ewed by a teacher in a more classical approach.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
PA sapo.pt> writes:
> Is there any site offering e-learning about Python?
>
> If not, the PSF should do it!
If you mean if there are any online tutorials: lots of them. Here's a very large
list: http://www.awaretek.com/tutorials.htm
od
on a certain object, without knowing what that object is - it needs to examine
the object at runtime to determine if the method is available. The potential
compiler would have to handle all of these cases, meaning you'd end up with...
well, CPython. Typical compiler efforts in the past have limited the flexibility
of the language.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
are not
specified. You could read it like "if the filename ends with .gif or .jpg or
.tiff". In older Python versions, you could implement the same functionality as:
if s.endswith('.gif') or s.endswith('.jpg') or s.endswith('.tiff')
This is in co
ll take
item #0 in MyList and request its item #1. It's equivalent to saying
MySubList = MyList[0]
print MySubList[1]
In an interactive session:
>>> li = [[1,2], [3,4]]
>>> li[0]
[1, 2]
>>> li[0][0]
1
>>> li[0][1]
2
>>> li[1][1]
4
Yours,
Andr
rted locs:", locs
maxrange = locs[0][:] # guaranteed to start with min
for loc in locs[1:]: # loop over rest of locs
if loc[0] <= maxrange[1]:
maxrange[1] = loc[1]
else:
print " discontinuity found for", loc
return None
Py, which is part of TurboGears) seems to have decent
support for all kinds of Python things, but it's paid - if they allow a
1-month account, you could try it out for very little money over there.
Yours,
Andrei
___
Tutor maillist - Tutor@python.o
for function names is that they should contain a (well chosen) verb
and an object. As always it ends up being a matter of personal taste. I for
example might call that function insertSeparators or formatNumber, but other
people might prefer longer names
ith
'%%'. E.g.:
>>> "%%.%df" % 2 # the '%%' will be changed to '%' in the result
'%.2f'
>>> "%%.%df" % 4
'%.4f'
>>> s1 = "%%.%df" % 2
>>> print s1, s1 % 3.41234
'%.2f', '3.41'
>>> s2 = "%%.%df" % 4
>>> print s2, s2 % 3.41234
'%.4f', '3.4123'
>>> ("%%.%df" % 2) % 3.23423
'3.23'
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
cript, this difference is of no
consequence (that value is close enough to zero):
>>> "%.2f" % (.1+.1+.1-.3)
'0.00'
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Patricia gmail.com> writes:
> I have to store and retrieve text files from a database table and
> the size of each file is about 500k. Can someone give me an idea
> on how to do this?
You might want to have a look at this:
http://sourceforge.net/projects/mysql-python
Yo
on "amount <= 0" and
inform the user that a number larger than 0 is required.
Here's a modified version:
def getAmount(currency):
while True:
useramount = raw_input('Amount: ').lower().strip()
if useramount in 'qx':
return
"Hello %s" % username
else:
print "Incorrect name or password!"
Other environments (e.g. wxPython, PyGame or web interfaces) offer different
ways of achieving the same results, but I presume you're really new to Python
and not yet messing around with those.
Yours,
Andr
put a
webbased interface onto it, or subclass it and make a glossary which can
also do multiple language translations, or use a different storage
backend, etc.).
--
Yours,
Andrei
=
Mail address in header catches spam. Real contact
gt; def func(self):
... print self.__class__
>>> A.f = func
>>> B.f = func
>>> a, b = A(), B()
>>> a.f(), b.f()
--
Yours,
Andrei
=
Mail address in header catches spam. Real contact info:
''.join([''.join(s) for s in zip(
"[E
quires a single update, while the dictionary
requires one new key-value pair and modifications in another two
places in order to get it working correctly.
--
Yours,
Andrei
=
Mail address in header catches spam. Real contact info:
''.join([''.join(s) for s in
mutation
retList.append(word)
else:
# Return a list of all permutations using all characters
[ retList.extend(
[ word[pos] + item
for item in permute3(word[0:pos]+word[pos+1:len(word)]) ] )
for pos in range(len(wor
s for input
and the return statement to output any necessary modifications, e.g.:
def p(inp):
output = inp + 1
print output
return output
if __name__ == '__main__':
x = 5
x = p(x)
It would be even better with a decent function name of course :). More
i
ython, which seems to be what you got - one is a
Python distro, the other is an extension of the VisualStudio IDE. Neither is a
.Net implementation of Python, IronPython is (http://www.ironpython.com/).
Yours,
Andrei
___
Tutor maillist - Tutor@pyth
ng at the top of the digest:
'When replying, please edit your Subject line so it is more specific
than "Re: Contents of Tutor digest..."'
--
Yours,
Andrei
=
Mail address in header catches spam. Real contact info:
''.join([''.join(s) for s in
x27;, e.g. ">>> print 6; print 5"
will work just fine.
--
Yours,
Andrei
=
Mail address in header catches spam. Real contact info:
''.join([''.join(s) for s in zip(
"[EMAIL PROTECTED] pmfe!Pes ontuei ulc
important difference. You should terminate the try-except
block (confirm with extra ENTER) before doing more stuff.
--
Yours,
Andrei
=
Mail address in header catches spam. Real contact info:
''.join([''.join(s) for s in zip(
"[EMAIL PROTECTED] pmfe!Pes ontuei ulcp
h of if-statements.
if g is between X1 and Y1: result is Z1
else if g is between X2 and Y2: result is Z2
else if ...
--
Yours,
Andrei
=
Mail address in header catches spam. Real contact info:
''.join([''.join(s) for s in zip(
"[EMAIL PROTECTED] pmfe!Pes ontuei
> I can't see a simple way around it (wood for the trees)
How about using a "while True" loop that you break out of only when a
correct value has been identified:
while True:
dau_version = raw_input('blabla')
if dau_version in ("2.8",
ave an editor in which
to be productive, it's probably better to invest some time in learning
to use one of the existing options. Whether it's Spe, Scite, Komodo,
Vim, Emacs or whatever else suits you, is not very relevant.
--
Yours,
Andrei
=
Mail address in header catches sp
looking up
treatments/illnesses for a given patient (with the patient being the key
in the database) or if the number of patients is quite low (hundreds).
If however an important use is to do other types of searches too (e.g.
find all patients with an age above X who use a drug Y) and you ha
sition, swallows and just about
anything else that seems weird can usually be tracked down to that same
source.
--
Yours,
Andrei
=
Mail address in header catches spam. Real contact info (decode with rot13):
[EMAIL PROTECTED] Fcnz-serr! Cyrnfr qb abg hfr va choyvp cbfgf. V
ernq gur yvfg, fb
n: http://en.wikipedia.org/wiki/Binary_search
Yours,
Andrei
=
Mail address in header catches spam. Real contact info (decode with rot13):
[EMAIL PROTECTED] Fcnz-serr! Cyrnfr qb abg hfr va choyvp cbfgf. V
ernq gur yvfg, fb gurer'f ab arrq gb PP.
___
if the function finds it has called itself too many
times - helps against infinite recursion too.
>>> def a(i):
... i += 1
... if i < 500:
... a(i)
>>> a(0)
If you try the function above without the if condition, it will generate a
Runt
e of loading all
kinds of simple minigames. I don't know how far it is by now, but if you look in
the pygame mailing list archives you should be able to find it.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
ly in the directions which could be
foreseen beforehand). Going from design-in-head straight to production code
doesn't (at least for me) lead to the best of results in those respects, even
though the code may work.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
omething
similar, this code would still not be quite high level, because shuffling the
source, taking a slice and such are not built into those languages. In fact,
in those languages you'd most likely choose a different approach at this
level.
Yours,
Andrei
_
y get more
comments, while easier portions get fewer comments - just as it should be.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
all games
exit
If you go into more detail, you'll end up writing a long version of the Python
code, which kind of defeats the purpose of pseudocode.
> Any useful advice for algorithm would be appreciated.
It's more important (at least for larger progams) to think about good design in
couldn't convert to integer
print 'Not a number'
choice = 5
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
t;> test5.var()
Traceback (most recent call last):
File "", line 1, in ?
File "", line 4, in var
NameError: global name 'dummy' is not defined
>>> dummy = 234
>>> test5.var()
234
>>> test5().var()
234
Which soultion is right, depends on your needs. I'm tempted to say (3) is the
best one, unless you really need that to be a class attribute.
Tip: http://zephyrfalcon.org/labs/python_pitfalls.html
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
or
2-person rooms and applies a discount if the reservation is on a day between
monday and thursday.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
be decrypted without the password, even if
the source code is available.
--
Yours,
Andrei
=
Real contact info (decode with rot13):
[EMAIL PROTECTED] Fcnz-serr! Cyrnfr qb abg hfr va choyvp cbfgf. V ernq
gur yvfg, fb gurer'f ab arrq gb PP.
__
when a specific revision is requested. Sure you
> hope it's the same as it was in the beginning but there's always a
> chance for error.
Yep. But the fact that only the indentation changed, sounds fishy. I'd rather
expect editor settings to be at fault than the VCS. If you
at "How to think like a computer scientist in
Python" (http://www.ibiblio.org/obp/thinkCSpy/). Chapters 8 and 10 discuss Lists
and Dictionaries
http://www.ibiblio.org/obp/thinkCSpy/chap08.htm
http://www.ibiblio.org/obp/thinkCSpy/chap10.htm ,
but I'd recommend you rea
should go around modifying code on its
own in *any* way, even if it's spaces. Although, now that I think about it, a
VCS might have an option of ignoring leading/trailing whitespace when doing
diffs, such an option could bite when merging Python code.
Yours,
Andrei
__
7;,indexfile.read(4))[0]" and similar lines.
A file class which would wrap this stuff and offer a nice interface with methods
like ReadInt, ReadDouble would clear it up a bit.
- "Private function" in the comment of __newdemo. I'd remove it, since the
double underscore already documents this.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
learn a bit more about Python's facilities before
embarking on an ambitious project :) - you won't get very far without knowing
how to use lists and dictionaries.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
o this mailing list and ask questions (though I do caution
> them not to submit their homework simply to get a solution).
I think people reading a magazine called "IT Pro" should be aware of such
basic etiquette :).
--
Yours,
Andrei
=
Real contact info (decode with rot13)
ut to
have some benefits (it's possible to mix OO and procedural code). If a project
runs into thousands of lines of code, it virtually always makes sense to bring
OO into the picture.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
than regular Python, it is still much
> slower than C.
Except in some amusing cases:
http://mail.python.org/pipermail/python-list/2004-April/215272.html
--
Yours,
Andrei
=
Real contact info (decode with rot13):
[EMAIL PROTECTED] Fcnz-serr! Cyrnfr qb abg hfr va choyvp cbfgf. V ernq
gu
above shows that numbering begins at 0, with the fourth line having
number 3. So either I misunderstand the question, or the snippet is confusing.
That being said, I can imagine counting lines from 1 because programming editors
also tend to count from 1 instead of 0 and this way it
ce for
your application :). Command line apps which wipe out the command line
history are bad. You might prefer making a GUI or a web application
instead.
--
Yours,
Andrei
=
Real contact info (decode with rot13):
[EMAIL PROTECTED] Fcnz-serr! Cyrnfr qb abg hfr va choyvp cbfgf. V ernq
gur yv
Joseph Quigley wrote on Fri, 22 Apr 2005 13:45:05 -0600:
> Interesting. So several distros use rpms? I though only red hat used 'em.
Yeah, including some major ones like Mandrake and Suse.
--
Yours,
Andrei
=
Real contact info (decode with rot13):
[EMAIL PROTECTED] Fcnz-serr! C
g else -
though more obsfucation != more security). The effect this will have in stopping
a determined person will be pretty much zero, but at least it's not out there in
the open and a simple text search won't cause it to just show up.
Yours,
Andrei
_
eful to rise to the top of
> the examples?
It would indeed, if someone implemented it :).
> would get used or not. Perhaps the personal feedback of the tutor list
> is more effective.
OTOH, finding it yourself is faster than waiting for a reply.
Yours,
Andrei
___
Tkinter wrapper) it would be even
absolutely trivial (show a standard directory selection dialog, then copy the
stuff - 5 lines of code or so). It would be cross-platform too.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> always thought it a bad smell.
It does indeed smell of a maintenance nightmare waiting to happen :). The bad
part is that it tends to get progressively worse. Imagine also what would happen
if you'd get even more of those similar modules.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
ary and mistakes might lead to breakage)
It's quite obvious though that no method is good enough if you attach any kind
of value to high scores, by e.g. posting the highest scores on your webpage.
Yours,
Andrei
___
Tutor maillist - Tutor@python
erything goes well,
you'll get a NameError if you try to print it. Also if it does exist, it will
need to be reset before the try-except, otherwise afterwards you won't know
whether its value comes from the last try-except or from some time in the past.
On a sidenote: recommended Python
> mydb = bsddb.btopen('game.db')
>>> pickle.loads(mydb['lastplayer'])
'John Doe'
This is not useful for small amounts of data like the highscores list, but if
you have more data (e.g. level data, dialog texts) and you need quick access to
it without having to keep everything in memory all the time, bsddb is a
comfortable option.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
en then it's still easier to keep them in a list of tuples, because it's
easier to do manipulations like "remove the lowest score" when you insert a
higher one.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
ith certain connections between them (if there aren't too many points,
otherwise you'll hit a recursion depth limit or a stack overflow). Or for a menu
navigation system, where a showmenu() routine calls itself to display submenus.
Yours,
Andrei
___
ke it a global variable and only initialize it at the
start of the program).
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
t 4 letters, type i[-4:].
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
, but from that point on, it's no longer your
responsibility to protect them from themselves. Python works on the assumption
that programmers are responsible adults :).
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
a plain text
generic editor, save the program and double-click on it in Explorer (if you're
on Windows) or launch it by typing at the command line:
python myscript.py
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
t does! However, a different test reveals this:
>>> d = {4:0, 5:0, 1:0}
>>> d.keys()
[1, 4, 5]
Aha! So it sorts the keys (both tests support this conclusion). Or does it?
>>> d = {4:0, -1:0, 5:0}
>>> d.keys()
[4, 5, -1]
Nope, not sorted, not ordered - exactly as the Python specification states,
dictionaries are unordered.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
y and add the appropriate methods, so that the
interface remains the same.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
not Python-specific: if they
convey their ideas clearly, you can implement such things on your own.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
s
context just a different way of defining a function. The net result is a
comparison function which is called by the sort() method in order to determine
which of two dictionaries is 'smaller' or 'larger'.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
erfectly, even though
initial random file distributions give 240+ discs), but I haven't checked the
results very thoroughly. It might be doing something really stupid. It's also
reasonably fast (1000 generations of 1000 individuals each is feasible for
example, but not necessarily
a more detailed description it's hard to determine. I would say it's
perpahs a bit unusual if you do indeed have two modules with the same interface
but different behavior.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
7;t provide?
--
Yours,
Andrei
=
Real contact info (decode with rot13):
[EMAIL PROTECTED] Fcnz-serr! Cyrnfr qb abg hfr va choyvp cbfgf. V ernq
gur yvfg, fb gurer'f ab arrq gb PP.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/
ink of an address book (where you use names as keys and
addresses as values), a menu system (where certain user input is mapped to
a certain function), a cache system (where results of certain
time-consuming operations are saved in case the user asks for the same
operation again) and there are man
e the fact that __init__ is indeed
inherited:
>>> class C(A):
... pass
>>> c = C() # inherited __init__ (A.__init__) is called
>>> c.a
13
--
Yours,
Andrei
=
Real contact info (decode with rot13):
[EMAIL PROTECTED] Fcnz-serr! Cyrnfr qb abg hfr va choyvp cbfgf. V er
pick up excalibur even though
conan already has it.)
You can see that conan and donan are both players (Player objects), but each of
them has his own name, inventory and strength. Even if conan's inventory is
full, donan can still pick up new things.
Yours,
Andrei
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Bob Gailer alum.rpi.edu> writes:
> At 12:22 PM 4/7/2005, Andrei wrote:
> >Kevin gmail.com> writes:
> >
> > > I am fooling around with classes and I was trying to create a very
> > > small one player text adventure. I made a class called commands here
&g
he
player is in plus the connected rooms), an Item class (with subclasses for
different types of items, where different implementations of e.g. PickUp methods
would determine if the player could pick up a pencil or a skyscraper), etc.
Yours,
Andrei
1 - 100 of 119 matches
Mail list logo