for x in ['string', 10, True, [1,2,3] ]:
... print '%s' %x
...
string
10
True
[1, 2, 3]
That's cool! I didn't know that. I guess I'm crazy... : )
(We already knew that here.)
The difference is in how the formatting details work.
For numbers the formatting digits
Jacob S. wrote:
Even so, doctest doesn't seem to recognize the module level docstring.
It will run the test inside the functions, but it says there isn't a test on
the module level.
I put the docstring just like in the example at the link you provided...
Please post the code for the module you are
Alan Gauld wrote:
Also, anything I can do... Presently, since I'm running windows xp,
I would
have to hunt for the command prompt and type in the command
Start-Run
Type cmd,
Hit OK
:-)
Or drag the icon from accessories into the start menu or to
the desktop.
Or drag the icon to the left side of
OK simple query,
I have a list consisting of about 250 items, I need to know if a
particular item is in the list. I know this is better suited to a
dictionary but thats not the way it ended up ;-)
I could do a for loop to scan the list compare each one, but I have a
suspission that there is
You might want to try:
x in list
this will return true if, for example, list = [x,y,z,w], false if list
= [y,y,y,y]
Bill
Dave S wrote:
OK simple query,
I have a list consisting of about 250 items, I need to know if a
particular item is in the list. I know this is better suited to a
Hi Dave,
I have a list consisting of about 250 items, I need to know if a
particular item is in the list. I know this is better suited to a
dictionary but thats not the way it ended up ;-)
I could do a for loop to scan the list compare each one, but I have a
suspission that there is a
Hi there again,
My matrix 'self.data' consists of a list of 110 items, each item is a
dictionary of 250 keys, each key holds two lists, one of four items, one
of 12 items.
I needed to copy this matrix to 'self.old_data', so I have been using
.deepcopy(), which works OK but is SLOW (12+
Hello,
An easy one to start the year.
Trying to write my first class, already running into problems after 3
lines! :-(
So have this little class:
class rt:
def walk(self):
print 'yeah'
So if I write this in the Python shell, instantiate rt and call walk(),
I get the
hi Bernard,
you have to specify the module as well:
let's say your module is called rtModule.py,
then in your case you'd do:
import rtModule
testClass = rtModule.rt()
testClass.walk()
or:
from rtModule import rt
testClass = rt()
testClass.walk()
regards,
tanja
On Sun, 02 Jan 2005 17:43:07
Hi folks...
I was thinking about this the other day while prepping to write up
another CGI thing.
It occurred to me to wonder how other folks prepare an app, script,
whatever.
So the question is, and I am not looking for a right answer here. (I
doubt ther eis one, to be honest.)
How do you
I have a list consisting of about 250 items, I need to know if a
particular item is in the list. I know this is better suited to a
dictionary but thats not the way it ended up ;-)
I could do a for loop to scan the list compare each one, but I
have a
suspission that there is a better way ?
This is my second script (if you don't include the last time I
programmed (20 years ago...)
it's a nasty hack but it works...
---
?xml version=1.0 encoding=UTF-8 ?
- !-- This grammar has been deprecated - use FMPXMLRESULT
12 matches
Mail list logo