liably with John Machin's xlrd package.
See http://pypi.python.org/pypi/xlrd
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
session to the server to run and test the code.
Is that what you're after?
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
will be
file1_line1+file2_line1+file3_line1, etc.
Hint: Look at zip.
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
for line in open(filename) ]
Then your loop looks like:
for i in zip([ cleanedup(filename) for filename in myfiles ])
HTH,
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
been ported to 3.x, so many of us (me included)
haven't yet made the jump to 3.x.
Just be aware that the two exist and the info you find on the net may
not apply.
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscri
ush faster that pairs.sort()...
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
;test1' _or_ 'test2'
so, the first test is i=='test1' and the second test if simply 'test2'.
Try the following:
if 'test2': print "non-empty strings evaluate as true"
if not "": print "the not of an empty string evaluates true
you set
numValue outside your function and refer to it.
Emile
Is
this the byref/pointer object distinction? I replaced a the pointer
object with a byref object, which reduced processing time by about 10 %.
Cython might be interesting as a hobby project, but I'm affraid I'll
never get
. eg, use logistic(0.11)
Emile
ActivePython 2.6.1.1 (ActiveState Software Inc.) based on
Python 2.6.1 (r261:67515, Dec 5 2008, 13:58:38) [MSC v.1500 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>
True
>>>
Although I'm not sure what to make of the joins What are you trying to do?
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On 4/1/2011 10:16 AM Karim said...
I would like to get advice on the best practice to count elements
Well, I suspect you're more interested in knowing the total count of how
many as opposed to counting how many. To get the total count of how
many use len(mylist).
for those just learning to
program in python.
You can browse at http://osdir.com/ml/rhythmbox-devel/ and subscribe at
http://mail.gnome.org/mailman/listinfo/rhythmbox-devel
HTH,
Emile
I've been able to get actions working correctly in my other plugin.
(http://launchpad.net/rb-fileorganizer) b
ugins'
warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
You're missing the command -- try install
hth,
Emile
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
An
On 4/11/2011 10:40 AM sunil tech said...
Hi all...
is there any way to convert any file (eg: document files & image files)
to .pdf?
Look into reportlab. Look at the opensource area:
http://www.reportlab.com/software/opensource/
if so, kindly share...
thank you in advance.
_
e if
it starts with one of the targets, then spilt the fields from the line
and select the fourth field. Accumulate those and return the result.
Post your code when you follow up please.
Emile
___
Tutor maillist - Tutor@python.org
To u
ts[0]]=parts[3]
origs=open("dummy.atomID").read().split()
print " ".join([mapping[orig] for orig in origs])
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
endent
processing. Pyro, stackless, and twisted come to mind. It looks like
the info at http://wiki.python.org/moin/ParallelProcessing is more up to
date than my memory...
Emile
...
def categorize_reports():
if __name__ == '__main__':
root2 = Tkinter.Tk(className
4592,
'uptime' : 5784399}
node['server2'] = {'state' : 'active', 'ncpu' : 32, 'mem' : 34359738368,
'uptime' : 5416796}
node['server3'] = {'state' : 'inactive', 'ncpu' : 8, 'mem' : 8
replace
an existing one with "if parts[0] in mapping:" if that helps.
Emile
#!/bin/python
mapping={}
for line in open("confout.pdb").readlines():
parts=line.strip().split()
if len(parts)>6:
mapping[parts[1]]=parts[4]+parts[3]
origs=open("dummy.
On 5/17/2011 10:19 AM Brad Hudson said...
Thanks for the quick response Emile! However, this only seems to solve
part of the problem.
Yes -- I figured that by understanding the one-liner I replied with
you'd be able to construct the missing part. And then by restructuring
to a loop
; file object
Open a file using the file() type, returns a file object.
This is the preferred way to open a file.
>>>
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
, line 1, in
File "imagen_shp.py", line 32, in
lyr.datasource = mapnik.Shapefile(base=filepath, file=filepath)
Without having actually dug into this, should base and file have the
same value?
Emile
File "C:\mapnik-0.7.1\python\2.6\site-packages\mapnik\__init__.py"
ain quote characters.
mystring = "That's the difference"
other = 'Python was named after "Monty Python" the TV show'
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
me as you
appear to step through the data looking for \x10\x00 tags and
calculating a distance.
If my reading is correct, perhaps using split to break the data into
pieces would be easier to work with?
frames = data.split('\x10\x00')
HTH,
Emile
oving dime 3
kilometers (two miles) away."
(http://en.wikipedia.org/wiki/Lunar_Laser_Ranging_experiment)
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Where and how?
Further, because global is used, it tells you that 'bet' is not in the
local scope, nor in the global scope. Python's general scoping
resolution rule is local-global-builtin. So bet, wherever you think it
may be defined, lives in a different namespace.
"!")
Alan mentioned using concatenation as well and "".join() is generally
preferred, particularly when many strings are involved.
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
sortkey to value+flag
append sortkey and line to decorated list
sort decorated list
for key,line in decorated list
print line
HTH,
Emile
i try this
http://pastebin.com/2mvxn5GY
but without look
maybe somebody can give some hint , i know that this is maybe not a
directly python quest
line.
For example,
XXXs,Dval,Cval = line.split("|")
then, assuming a consistent valid file structure,
if int(Dval): key="D"+Dval
else: key="C"+Cval
then, append (key,line) to your decorated list for each line, and
finally sort and print the lines fro
ile.txt
you might also try the shortened:
from csv import reader,writer
def sortkey(row): return max(row[1],row[2]),row[1]>row[2]
writer(open("outfile.txt", "wb"), delimiter="|").writerows(
sorted(reader(open("infile.txt", "rb"), delimi
Item is not known yet. Any ideas?
You want to embed an instance of a class as an attribute of the same
class? Does this help:
class BaseItem(object):
ident = Attribute("ident", "int")
owner = Attribute("owner", "str")
BaseItem.item = Att
mistry and thought
the funnest way to do it would be to build a program that can do this
(if it works, I'd also like to replicate it for level of
electronegativity, atomic radius size, electron affinity, and ionization
levels 2, 3, and 4).
Extend the dictionary for the additional attributes.
Em
ere's a
better answer I can deploy quicker.
What sorts
of things is Python useful for and what things is it not? And finally,
if there is code after Python, what’s a good second language, and when
should someone start learning it?
I'd say C, and I'd start by browsing
You'll likely get more traction on this at
http://mail.python.org/mailman/listinfo/xml-sig
Emile
On 7/22/2011 11:18 AM Garry Bettle said...
Howdy all,
Hope this message finds everyone well - roll on the weekend!
I'm trying some calls to an wsdl API I've subscribed to.
But
On 7/22/2011 12:09 PM Stefan Behnel said...
Emile van Sebille, 22.07.2011 20:59:
You'll likely get more traction on this at
http://mail.python.org/mailman/listinfo/xml-sig
Unlikely.
Wow. Agreed. Five unanswered posts this year.
Emile
___
when you get stuck.
Emile
import mapnik
import os,fnmatch, sys
from mapnik import LineSymbolizer,PolygonSymbolizer,PointSymbolizer
from osgeo import ogr,gdal,osr
directorio = sys.argv[1]
extension = sys.argv[2]
drop this...
try:
outdent this...
if len(sys.argv) == 3:
pri
, include the following:
import html
htmlButton = html.button
std.html.button(*arglist)
#OR
import html from tlib
html.button(*arglist)
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http
On 8/21/2011 4:57 AM Lisi said...
If sys.py is a file, it must be somewhere; but I can't find it. Where is it?
I would like to look at it.
The modules within it must surely be somewhere too. But since I can't find
sys, I obviously can't find the modules. Again, I'd like to look at them.
In c
mail address is verified and those 'new to the list' get
this message -- do you have multiple email accounts or possibly typoed
in your email address on the message that evoked the 'new' response?
Emile
___
Tutor maillist - Tutor@
mmand in some form. Can you guys
tell me how to store the output of a terminal or show the output in a
GUI in python??
Instead of os.system, try the commands or subprocess module as
appropriate for your version of python.
HTH,
Emile
___
Tutor mai
On 8/22/2011 6:45 AM Lisi said...
On Monday 22 August 2011 00:13:37 Steven D'Aprano wrote:
The modules within it must surely be somewhere too. But since I can't
find sys, I obviously can't find the modules. Again, I'd like to look at
them.
I don't understand what you mean by "modules within
pfile library includes a setpassword option.
help(zipfile.PyZipFile.setpassword)
Help on method setpassword in module zipfile:
setpassword(self, pwd) unbound zipfile.PyZipFile method
Set default password for encrypted files.
Emile
___
Tutor mai
-file
? Check the answer that references the external open-source 7-Zip utility.
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
#x27;, name + '.zip'] + self.file_locs)
(from now)
oddly enough, when I open up a python shell, i can run the above just
fine and it creates a .zip file.
But when I run it from eclipse, the exact thing, I get the error.
I'd try providing the full path to 7z -- may
On 8/27/2011 8:21 AM surya k said...
If you take a close look at my code.
for i in range (1,100) :
for j in range (i,100) :
Temp = palindrome(i*j)
here, as the loop goes on, i*j can never become smaller
Of course it can... i=3 * j=90 is less than i=4 * j=4...
Emile
index [0], while the second one is
index[1].
No, it is true. The resulting code would be:
if roll[0] > 15:
doeggs()
elif roll[1] >= 2
dospam()
where the second test only occurs when roll[0] <= 15.
Emile
if roll[0]> 15:
if roll[1]>= 2:
print("Success"
a program' or 'load a
program' approaches to adding quotes.
For learning purposes, I think I'd advise a complete newbie to start
with the monolithic approach and build up and out from there.
Emile
___
Tutor maillist - Tutor@
_STEP
j = j+1
i = i + 1
the error I get is:-
File "", line 18 (33)
SyntaxError: can't assign to function call
delta_temp access and assignment likely wants to be expressed with
brackets rather than parens.
Emile
ActivePython 2.6.6.15 (
On 8/29/2011 4:52 PM questions anon said...
I am trying to select particular files within
a particular subdirectory,
You might find glob a better starting point:
ActivePython 2.6.6.15 (ActiveState Software Inc.) based on
Python 2.6.6 (r266:84292, Aug 24 2010, 16:01:11) [MSC v.1500 32 bit
(Int
On 9/1/2011 11:30 AM Chris Fuller said...
On Thursday 01 September 2011, Richard D. Moores wrote:
Thanks, James, from your ideas I've come up with this function as a
general test for hashibility of any object:
def is_hashable(object):
try:
if hash(object):
return True
get my head around it...
tries = tries + 1
This simply increments tries by one each time through the loop. So the
first time through it takes on the value 2, then 3, then 4, etc.
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or
up on Steven's reference to the py-dev thread, here's the link
to the patch that details the simple changes that Chris Withers applied
to httplib to improve his testcase performance from ~20 minutes to <3
seconds.
http://svn.python.org/view/python/trunk/Lib/httplib.
o
until after the test, ergo, UnboundLocalError.
HTH,
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
n Qb_list:# Iterate over Qb_list
quarterbacks.append(Qb(*this_qb)) # append Qb instance to quarterbacks
...or even drop the quarterbacks declaration above...
quarterbacks = [Qb(*this_qb) for this_qb in Qb_list
Emile
print (quarterbacks[3].phone) # Print an item f
or your current
question, you'll find makedirs with sample code at
http://effbot.org/media/downloads/librarybook-core-modules.pdf
Although dated, it's still a great place to start as most internal
functions have changed little over the years.
Emile
so it would not surprise me, but I
that for
$15k a piece you could get the tech to come out and clip the strap on
the high order bit of the address space register which would double the
usable space. Kinda like getting a discount on a caddy but they deliver
the car with the back doors welded shut.
Emile
ir support list [1], and follow up there.
We focus mainly on getting you far enough along with python basics and
generally leave specific library support to the library authors and
support groups.
HTH
Emile
[1] start at http://www.scipy.org/Mailing_Lists
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On 12/10/2011 8:46 AM Massimo Di Stefano said...
Hi All,
i'm tring to learn how to use threads in python to save a list of
object. i'm starting from this code :
Moving lista into the instance seems to do it...
Emile
#
import threading
import urllib
from tempf
i in range(3):
for j in range(3):
listB[i].append(listA[count])
... if not, where's this come from?
Emile
count+=1
My question is: is there any alternative way I can initialize listB
without resorting to using 2 loops?
I'm learning Python coming from a C++ bac
express it as a single statement using list comprehensions:
>>> listB = [ [ [] for ii in range(3) ] for jj in range(3) ]
>>> listB
[[[], [], []], [[], [], []], [[], [], []]]
>>> listB[1][1].append(1)
>>> listB
[[[], [], []], [[], [1], []], [[], [], []]]
HTH,
Emil
he 'open' documentation.
HTH,
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
platform and specific needs.
Google python path search for some ideas, and ask with more specifics.
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
gt;> import settings
>>> settings.whatever
We are having to do:
>>> import settings
>>> settings.settings.whatever
You could
from settings import settings
... which then allows access as
settings.whatever
HTH,
Emile
This is inconvenient and probabl
If, as others suggest, the files do fit in memory, you might try:
content = open(thisfile).read()
for fragment in content.split(keyword)[1:]:
myresults.append(fragment.split('\n')[1]
Emile
___
Tutor maillist - Tutor@python.org
T
fflib:
class SequenceMatcher
| SequenceMatcher is a flexible class for comparing pairs of sequences of
| any type, so long as the sequence elements are hashable.
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription op
nloads
It will get you all the windows related support you're likely to want in
a single installation.
HTH,
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
a production environment.
I think I'd examine the scanned image for a location marker, then from
that and an answer template that provides the answer box locations,
locate the answer box area for each question in turn and identify the
filled in multiple
;print message" does it...
... but I suspect your requirement isn't accurate.
Emile
myList = message.split()
y = random.choice(myList)
z = len(myList)
while z !=0:
myList.remove(y)
print(y)
I can't figure out
1) How to remove "y" from the list and conti
lace:
Help on built-in function replace:
replace(...)
S.replace (old, new[, count]) -> string
Return a copy of string S with all occurrences of substring
old replaced by new. If the optional argument count is
given, only the first count occurrences are replaced.
HTH,
Emile
>
To avoid this, look at copy.deepcopy as an alternative:
>>> d = copy.deepcopy(c)
>>> d
[[1, 2, 3], [4, 5, 6, 7]]
>>> b.append(8)
>>> c
[[1, 2, 3], [4, 5, 6, 7, 8]]
>>> d
[[1, 2, 3], [4, 5, 6, 7]]
>>>
HTH,
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On 3/30/2012 12:57 PM S.Irfan Rizvi said...
please help me disable this...i made big mistake searching your site
note that at the bottom of every email you're getting from this list has
a link to the unsubscribe page...
___
Tutor maillist -
-- you could also say
proprietary I imagine. I'm not aware if there's a formal name...
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On 3/30/2012 2:41 PM Barry Drake said...
On 30/03/12 19:18, Cranky Frankie wrote:
Here's what you need - he starts simple and winds up with some nice
games:
http://www.amazon.com/Python-Programming-Absolute-Beginner-Edition/dp/1435455002/ref=sr_1_6?ie=UTF8&qid=1333131438&sr=8-6
If you have
sed to refer to when it
was not mentioned prior?
Prior value or not, j is the loop variable that steps over range(dlen)
and refers to the numbers 0 to dlen-1 in turn.
Did you mean to ask something about the code below as well?
Emile
from random import randrange, choice
from string import a
s is executed, but that there is a SyntaxError for that
same reference of a 'int' literal.
I'd welcome comments, explanations or URLs to discussions.
thanks
Try
>>> (6).__class__.__name__
'int'
>>>
HTH,
Emile
___
Tu
content type to deliver plain text -- anything
html-ish allows compression of spaces hence the formatting loss.
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On 4/6/2012 3:07 PM myles broomes said...
import random
from tkinter import *
What version of python on what platform please...
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org
pertaining to third party packages if the
third party itself.
Try http://biopython.org/wiki/Mailing_lists -- they'll get you going
faster than we will... unless of course someone here has sufficient
experience with that package.
Emile
___
Tutor mai
.. L=glob.glob(D)
... for pypgm in L:
... pgm = open(pypgm,'r').readlines()
... totalLines+=len(pgm)
... LongLines.extend([(pypgm,jj) for jj in pgm if len(jj)>79])
...
>>>
>>> print len(LongLines),totalLines
12043 606760
>>>
On 5/3/2012 2:28 PM Adrian said...
I recently created a gui form using tkinter, is it possible to integrate this
form to my website page? How do i integrate?
pyjs aka pyjamas allows you to write once and run on both web and
desktop. I'd start there.
On 5/5/2012 11:01 AM Santosh Kumar said...
I am reading the documentation and I'm in the section 4.1. Let me
write it down here:
You'll need to peek ahead to section 8 Errors and Exceptions.
Try and see if that doesn't get you going.
Emile
x = int(input("Ple
the string interpolation related docs. Start
with http://docs.python.org/release/2.5.2/lib/typesseq-strings.html or
the equivalent for your python version.
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription opt
On 5/8/2012 11:31 AM xancorreu said...
isinstance(2, function)
like I do
isinstance(2, int)
Do you understand my reasoning?
Nope, but here ya go:
Python 2.6.4rc2 (r264rc2:75497, Oct 20 2009, 02:55:11)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more informat
On 5/8/2012 3:14 PM Alan Gauld said...
On 08/05/12 19:42, Emile van Sebille wrote:
>>> from types import *
>>> def test():pass
...
>>> function=FunctionType
>>> print isinstance(test,function)
Wow, thanks for that. I knew about all the different functio
Can anyone explain me on it..
The folks at Django can -- see
https://docs.djangoproject.com/en/dev/faq/help/ for django resources.
HTH,
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
print(sum(L))
Also, in the future please post the complete traceback -- it relly helps.
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
actual files are really un-important.
What I want is for the folder to be represented as a single file by
any normal file browser,
pyfuse allows you to create and represent whatever you want using python
as a file system to the OS. Probably worth a look...
Emile
n source:
... print ts, [ int(ii) for ii in
ts.replace("/","").replace(":","").split() ]
...
03/10/2010 02:00:00 [3, 10, 2010, 2, 0, 0]
03/10/2010 02:10:00 [3, 10, 2010, 2, 10, 0]
03/10/2010 02:20:00 [3, 10, 2010, 2, 20, 0]
03/10/2010 02:30:00 [3, 10, 2010
ly root can run this script\n")
See
http://code.activestate.com/recipes/299410-root-access-required-to-run-a-script/
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
I can do the following:
Interprocess communications may be a bit advanced for this forum. Look
at http://wiki.python.org/moin/ParallelProcessing as you're likely to
find something appropriate there.
HTH,
Emile
- Process 2 receives icmpv6 (or any packet) from process1 and retransm
On 6/6/2012 4:28 PM Steven D'Aprano said...
Prasad, Ramit wrote:
That is, for loops first try to build an iterator by calling
__iter__, and if
that fails they try the sequence protocol obj[0], obj[1], obj[2], ...
So...I could instead write __getitem__ for the same effect?
Er, no... __getite
lassing. Pep 8 speaks to their use. See
http://www.python.org/dev/peps/pep-0008/
HTH,
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
u're asking, so even when
you do get it going, it's not a stable platform.
I'd-like-apples-to-be-oranges-but-they're-not-ly y'rs,
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
f __name__ == '__main__':
print "__name__ == '__main__'"
else:
print "__name__ == '",__name__,"'"
Emile@MIS2 ~
$ python test.py
__name__ == '__main__'
Emile@MIS2 ~
$ python
Python 2.4.3 (#1, May 18 2006, 07:40:45)
[GC
t;> L
[1, 2, 3, '?', 4]
How does python get the result of slicing?Such as the examples
above,they really confused me.
There's some good examples at:
http://stackoverflow.com/questions/509211/good-primer-for-python-slice-notation
HTH,
Emile
_
provide you the specific help you need to keep you moving
forward.
You might also want to read the highly regarded article at
http://www.catb.org/~esr/faqs/smart-questions.html
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subsc
talled. Then I
downloaded and ran
http://pypi.python.org/packages/2.7/n/numpy/numpy-1.6.2.win32-py2.7.exe
and I can now import numpy.
What did you try?
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscriptio
mble-')
...
A
-grumble-
B
D
-grumble-
E
A
B
C
D
-grumble-
E
>>>
Or spice it up!
>>> import random
>>> undefined = ['-grumble-','-mumble-','-garbled-','-cough-']
>>> for ii in 'agbdteabcdfe':
...
s that belong together?
If so, there's are several techniques for locations a sub-list within a
list at
http://stackoverflow.com/questions/2250633/python-find-a-list-within-members-of-another-listin-order
But if not, I'm not sure there's an answer.
Emile
I am not aware of any list
checks for equality such as
if w[0] == 'x':
This does the same thing and works even when w is an empty string.
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
301 - 400 of 527 matches
Mail list logo