Re: Cutting a deck of cards

2013-05-26 Thread RVic
Ah, brilliant -- yes, this is so much more elegant in Python: #now cut the cards x = random.randrange(2,range(13 * 4 * decks)) cards = cards[x:]+cards[:x] -- http://mail.python.org/mailman/listinfo/python-list

Cutting a deck of cards

2013-05-26 Thread RVic
to the top half of the cards array. For some reason, I can't see how this can be done (I know that it must be a simple line or two in Python, but I am really stuck here). Anyone have any direction they can give me on this? Thanks, RVic, python newbie -- http://mail.python.org/mailman/lis

Re: Polymoprhism question

2013-05-24 Thread RVic
to you or if it is really doable in Python: #thanks, RVic import sys argv = sys.argv[1:] ClassIamInstantiating = argv ClassIamInstantiating.in("something") x = ClassIamInstantiating.out() -- http://mail.python.org/mailman/listinfo/python-list

Polymoprhism question

2013-05-24 Thread RVic
mehow gets intantiated from that string. This way, I can have similar classes, but have my program use various ones by simply changing the commandline argument. Can anyone show me how this might be done in Python? Thanks. -RVic -- http://mail.python.org/mailman/listinfo/python-list