FAST 0 (h)
12 RETURN_VALUE
Thanks Fredrik!
Kent
--
http://mail.python.org/mailman/listinfo/python-list
David Vincent wrote:
> > import unittest
> >
> > class IntegerArithmenticTestCase(unittest.TestCase):
> > def testAdd(self): ## test method names begin 'test*'
> > assertEquals((1 + 2), 3)
> > assertEquals(0 + 1, 1)
assertEquals is a member function, inherited from unittest.T
[EMAIL PROTECTED] wrote:
> I found a way to create "Open File" or "Open Folder" windows dialog
> boxes, but not to create an easier Yes / No dialog box...
> Maybe someone has a solution for this?
Maybe you would like EasyGui
http://www.ferg.org/easygui/
Kent
--
h
Roman wrote:
> I would appreciate it if somebody could tell me where I went wrong in
> the following snipet:
>
> When I run I get no result
>
> cnt = 0
> p=[]
> reader = csv.reader(file("f:\webserver\inp.txt"), dialect="excel",
> quotechar="'", delimiter='\t')
> for line in
Roman wrote:
> Thanks for your help
>
> My intention is to create matrix based on parsed csv file. So, I would
> like to have a list of columns (which are also lists).
>
> I have made the following changes and it still doesn't work.
>
>
> cnt = 0
> p=[[], [], [], [], [], [], [], [], [], [], []]
>
James Mitchelhill wrote:
> Sorry for the clunky subject line - I have a feeling that not knowing
> the proper terms for this is part of my problem.
>
> I'm trying to write a class that analyses some data. I only want it to
> do as much work as necessary, so it saves method results to a
> dictionary
[EMAIL PROTECTED] wrote:
> Hello,Im using Python 2.4.2 and I'm starting a few very basic
> programs,but theres two problems I've not found the answers for.
> My first problem is I need code that will count the number of letters
> in a string and return that number to a variable.
>>> s = "hello"
>
> feed_list = open("feed_listing.conf","r")
What could it be about the above line that means "Open this file for
READ ONLY"?
--
http://mail.python.org/mailman/listinfo/python-list
le
Init fldr: $FileDir
regex to match output:
^.*"([^"]+)", *line ([0-9]+)
with File: 1, Line: 2
Kent
--
http://mail.python.org/mailman/listinfo/python-list
ad of IDLE?
You're kidding, right?
Kent
--
http://mail.python.org/mailman/listinfo/python-list
Dick Moores wrote:
> At 06:30 PM 9/10/2006, Kent Johnson wrote:
>> Dick Moores wrote:
>>> Also, why do you use TextPad instead of IDLE?
>> You're kidding, right?
>
> No. Tell me, please. Macros? Comparing files? What else?
OK...please, no one interpret this as
noro wrote:
> Is there a more efficient method to find a string in a text file then:
>
> f=file('somefile')
> for line in f:
> if 'string' in line:
> print 'FOUND'
Probably better to read the whole file at once if it isn't too big:
f = file('somefile')
data = f.read()
if 'string' in
[EMAIL PROTECTED] wrote:
> Hi Stéphane,
>
> stéphane bard wrote:
>> hello, my boss ask me to prefer windev to python.
>> I have to argue
>
> First, no matter how good is Python, you should not desagree with your
> boss.
> Second, Windew is quite good and fun, you will love it.
Yes, the boss is a
so clearly at work the difference
between projects that practice YAGNI and those that are designed to meet
any possible contingency. It's the difference between running with
running shoes on or wet, muddy boots.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> On Wed, 29 Nov 2006 19:42:16 -0800, rjtucke wrote:
>
>> I want an iterable from 0 to N except for element m (<=M).
> x = range(m-1) + range(m+1, N)
Should be range(m) + range(m+1, N)
Kent
--
http://mail.python.org/mailman/listinfo/python-list
gly, and a callable class is the Right Thing -- if there's a
> way to actually make it work.
If the only reason for a callable class is to save a single value (the
original function), you could instead store it as an attribute of the
wrapper function.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
gly, and a callable class is the Right Thing -- if there's a
> way to actually make it work.
If the only reason for a callable class is to save a single value (the
original function), you could instead store it as an attribute of the
wrapper function.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
;>> reload(main)
> ### Execution Occurs ###
If you edit music.py you will have to
import music
reload(music)
to get the new music module, then
reload(main)
to run again.
You could just type
> python main.py
at the command line each time you want to run, or use an editor that
lets you run the program from within the editor.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
> Stephen Eilert wrote:
>
>> I do think that, if it is faster, Python should translate
>> "x.has_key(y)" to "y in x".
>
> http://svn.python.org/view/sandbox/trunk/2to3/fix_has_key.py?view=markup
Seems to have moved to here:
http://svn.python.org/view/sandbox/trunk/2to3/fixes
a module - but in general my major classes are
each to a module.
It does make the imports look funny - I tend to give the module the same
name as the class, Java style, so I have
from foo.bar.MyClass import MyClass
but that is a minor point IMO.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
Carl Banks wrote:
> Kent Johnson wrote:
>> Carl Banks wrote:
>>> Now, I think this is the best way to use modules, but you don't need to
>>> use modules to do get higher-level organization; you could use packages
>>> instead. It's a pain if you'
s Task Manager or the equivalent.
Jython is a Java application and you can increase the max heap available
the same as for other java apps, using the command line switch -Xmx,
e.g. -Xmx512m to set the max heap to 512 megabytes.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
ds-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list.htm
Kent
--
http://mail.python.org/mailman/listinfo/python-list
What encoding does the NTFS store the filename?
I got some downloaded files, some with Chinese filename, I can not
backup them to CD because the name is not accepted.
I use walk, then print the filename, there are some ? in it, but some
Chinese characters were display with no problem. I suspect t
e to do it in a more
> 'functional' style (executing a database query by using map, reduce,
> filter, etc.
You might be interested in a similar attempt:
http://www.jtauber.com/relational_python
Kent
--
http://mail.python.org/mailman/listinfo/python-list
efinition of page is in my_objects.py, and that file is on the
Python search path, you can use
import my_module
cls = getattr(my_module, 'path')
instance = cls()
to create an instance of my_module.path.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
idea is then applied
recursively to the pieces of the sequences to the left and to the
right of the matching subsequence.
So no, it doesn't seem to be using Levenshtein distance.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
:
self.name = None
self.caption = None
self.functions = []
With the above definitions, an equivalent class is created by calling
page = classFactory( 'page', { 'name' : None, 'caption': None,
'functions' : []} )
Kent
--
http://mail.python.org/mailman/listinfo/python-list
with a
> work-around (I'm getting pretty good at this one :), so my question
> stands:
>
> is it possible to access the individual members of a dictionary using %
> locals() when creating a string?
You might want to use a more powerful templating engine, for example
http://c
in or
long integer division yields an integer of the same type; the result is
that of mathematical division with the `floor' function applied to the
result." so this seems to be intentional.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
In my experience the original point is valid - Python is usually
(always?) more concise than equivalent Java code, and often dramatically
so. Python makes common operations easy; Java sometimes seems to go out
of its way to make them awkward.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
Many beginners' tutorials listed here:
http://wiki.python.org/moin/BeginnersGuide/NonProgrammers
Kent
--
http://mail.python.org/mailman/listinfo/python-list
to the list variable it just modifies the local
> (to the function) name space, and that those changes aren't reflected
> in the list in the original name space.
Try
list[:] = response.get('args')
this will change the value of the list passed in.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
you didn't
bind B.bar and b.bar to anything so the id was reused.
>>> class B(object):
... def bar(self): pass
...
>>> Bbar = B.bar
>>> bbar = B().bar
>>> Bbar
>>> bbar
>
>>> id(Bbar)
10751312
>>> id(bbar)
10736624
>>> Bbar is bbar
False
Kent
--
http://mail.python.org/mailman/listinfo/python-list
same way...)
You might get the behaviour you want if you put the line
import sys
fit.FitServer.main(sys.argv)
at the end of your file. This will run the main() function of the Java
class.
Kent
>
> I think this is because I do not understand the jython mechanism for
> inheritance
appens. IIUC type.__call__ implements the
standard class creation calling __new__ and __init__.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
e
__init__().
Any other opinions? Any consensus about the "best" way to do this?
BTW I understand what super() does, I know why the original code is
broken, I'm not asking for help with that. I'm wondering what others
think best practices are.
Thanks,
Kent
--
http://mail.python.org/mailman/listinfo/python-list
mytextfile, '\n'
will print two newlines, one explicit and one implicit in the print.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
h('_') and
callable(getattr(self, s)) ]
At first I thought self.__dict__ would do it, but callable methods
> seem to be excluded so I had to resort to dir, and deal with the
> strings it gives me.
The callables are attributes of the class and its base classes, not of
self. self.__d
ing module. A single log entry can be
written to multiple destinations based on level or source of the entry.
The distribution of log entries is controlled by the logging
configuration which can be stored in a text file if you like.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
yObject message) {
> Looks like something in the Jython core causes the problem
> (org\python\core\Py.java) any Ideas what I can do?
I think jythonc is not compatible with Java 1.5, try compiling with 1.4.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
Frank LaFond wrote:
> Jython 2.2 Alpha 1 supports Java 1.5
It is also buggy and IIRC has a broken jythonc which is what the OP is
trying to use.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
ruct and that this implementation path would always be
> so slow. On the other hand would a 100% Jython solution be faster?
Inheritance from Java works well and I have never seen performance
problems like this.
Java JUnit uses introspection to find test methods so it won't find
methods
Mark Fink wrote:
> Alan, Kent, many thanks this really helped!
> But there is still a problem I guess with inheritance. I use the java
> testsuit supplied with the original to test the server. If I use the
> Java FitServer the testsuite can be completed. I commented everything
> ou
uot;", line 1, in ?
File "C:\Downloads\Java\jython-2.1\Lib\socket.py", line 135, in connect
TypeError: java.net.Socket(): 1st arg can't be coerced to
java.net.InetAddress or String
Note it complains about the first arg; this may well be your error.
In general Python does not coerce argumentt types for you. Jython will
translate between Java and Python types but it won't go as far as
converting a String to an int.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
x27;. Likely candidates are
b.encode('utf-8')
b.encode('utf_16_be')
b.encode('utf_16_le')
Kent
>
> Suppose I get a unicode string:
> a = u'\xc8\xce\xcf\xcd\xc6\xeb';
> then, by
> a.encode('latin-1');
> I can get the 8bit-string re
a file open browser box as well?
Take a look at EasyGUI:
http://www.ferg.org/easygui/
Kent
--
http://mail.python.org/mailman/listinfo/python-list
Mark Fink wrote:
> Hi Kent,
> many thanks for your help! In the meantime I received my "Jython
> Essentials" book and hope that I have much fewer questions in the near
> future.
> One last question for this thread. I tried to inherit from a Java class
> and override on
g as explicit typecasting. What to do?
The problem is that the second arg is not an int. The second problem is
that the error message errorneously points to the first arg. See my
earlier post.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
rtilley wrote:
> Hi,
>
> While trying to better understand security descriptors on Windows. I've
> been examining text-based security descriptors. I have the security
> descriptors on individual lines stored in a text file. I want to break
> these lines apart based on owner, group, dacl and sac
jodawi wrote:
> I need to find a bunch of C function declarations by searching
> thousands of source or html files for thousands of known function
> names. My initial simple approach was to do this:
>
> rxAllSupported = re.compile(r"\b(" + "|".join(gAllSupported) + r")\b")
> # giving a regex of
paron wrote:
> I forgot -- I like the idea of Kerrigell, too. It runs on top of
> CherryPy
Karrigell is independent of CherryPy, it has it's own web server built in.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
imports module in A).
If you follow this rule your packages will be more testable and
reusable. The alternative tends to devolve into
everything-depends-on-everything-else which makes testing harder and
reuse nearly impossible.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
Grant Edwards wrote:
> I've got no complaints about the way things work, I was just
> going to suggest changing the documentation to correctly
> describe the way things work. Too mundane a solution?
Submit a patch, it's quick and easy and fun:
http://docs.python.org/about.
st = range(1000)" "lst.count(1001) > 1"
1 loops, best of 3: 55.5 usec per loop
D:\>python -m timeit -s "lst = range(100)" "lst.count(-1) > 1"
10 loops, best of 3: 62.2 msec per loop
D:\>python -m timeit -s "lst = range(100)" &
s=('printFoo', 'printFOO')
for function in functions:
globals()[function]()
If the functions are in a 'functions' module:
funcs=('printFoo', 'printFOO')
for function in funcs:
getattr(functions, function)()
Kent
--
http://mail.python.org/mailman/listinfo/python-list
hat
> "D:\AUT_TEST\workspace\JyFIT" should be included in the pythonpath but
> it does not work. Nor does it work to include this path in the java
> classpath. Any idea whats wrong?
Do you have a file D:\AUT_TEST\workspace\JyFIT\testutil\__init__.py ?
Kent
--
http://mail.python.org/mailman/listinfo/python-list
program does, but try to identify code that does
the actual work and put it in separate modules that implement a data
model or business logic for the program. These modules should be
independent of Tkinter.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
Thomas Heller wrote:
> The standard unittest module can do this also: replace
> calls to failUnless(a == b) with failUnlessEqual(a, b).
or assertEquals(a, b)
--
http://mail.python.org/mailman/listinfo/python-list
2c
shows how do do a redirect with HTTP headers.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
ut now i see this
> is not correct.
>
> Now i need a script for uploading the files from MY pc and then use the
> sendmail thingie. Any tips about that script?
>
google 'python cgi file upload' for many examples.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
kanchy kang wrote:
> Is there any reviews/remarks on these frameworks?
> nose, OOBTest,testosterone, py.test, Sancho.
http://agiletesting.blogspot.com/2005/02/articles-and-tutorials.html
--
http://mail.python.org/mailman/listinfo/python-list
kanchy kang wrote:
> i browsed the following frameworks briefly: nose, OOBTest,
> testosterone, py.test, Sancho ... and found out they do support
> imediate screen-output only.
unittest.TextTestRunner() has an optional stream argument that would let
you output to a file.
Kent
Gaz wrote:
> Aye, but i dont need to run an FTP daemon every time i want to upload
> an image to Imageshack or any other website.
Did you google 'python cgi file upload' yet? Several people have pointed
you to an answer that doesn't use FTP.
--
http://mail.python.org/mailman/listinfo/python-list
the cost of
getting the time in the second call. On my computer with Python 2.4:
D:\Projects\CB>python -m timeit -s "import time;timer=time.time" "t=timer()"
100 loops, best of 3: 0.498 usec per loop
which is almost exactly the same as the difference between timer1() and
timer2() on my machine:
timer1 0.3094278
timer2 0.812000274658
using Python 2.4.2 on Win2k.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
ava 1.4, or just run the class in the
jython interpreter without compiling it first. For simple examples like
this you don't need to compile, just run it with
jython factor.py
Kent
--
http://mail.python.org/mailman/listinfo/python-list
it contains a file
object, not a string. Maybe call it f instead. ('file' is also a bad
name because it is the name of a Python built-in function.)
Kent
--
http://mail.python.org/mailman/listinfo/python-list
low. Current success is nearly 4x speedup, and now it seems
> to me that decimals are the bottleneck. Is anybody working on C version
> of decimals? Is it a really hard work? (I am thinking about
> re-implementing decimals in C by myself)
Maybe gmpy would help?
http://gmpy.so
ontains:
import sys
sys.ps1 = ' >>> '
sys.ps2 = ' ... '
Kent
--
http://mail.python.org/mailman/listinfo/python-list
nice
> ImportError: No module named raw2nice_def.py
Maybe it will work without the .py extension which is the correct form
for an import (and what worked from the command line).
Kent
--
http://mail.python.org/mailman/listinfo/python-list
t; with ASP.NET), instead of writing my code in Python. Is that not the case?
See http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B276494
The last example on this page is exactly what you have been asking for.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
John Salerno wrote:
> Kent Johnson wrote:
>
>> John Salerno wrote:
>>
>>> Magnus Lycka wrote:
>>>
>>>> The other option is ASP. You have been given information about
>>>> that already. Be aware that ASP does not imply VBScript. You can
&
to some part of cassidy.
>
> But I was wondering whether I could fool or "backend" the normal import
> mechanism. Even in Java, I can write my own class loader which can
> quick compile Java snippets and load the anonymous byte code.
See http://www.python.org/doc/2.3/whatsnew/section-pep302.html
Kent
--
http://mail.python.org/mailman/listinfo/python-list
eplace('abc \xff\xe8 def')
> u'abc \\xff\\xe8 def'
>>> s='abc \xff\xe8 def'
>>> s.encode('string_escape')
'abc \\xff\\xe8 def'
>>> unicode(s.encode('string_escape'))
u'abc \\xff\\xe8 def'
Kent
--
http://mail.python.org/mailman/listinfo/python-list
programs,
where importing java packages can be noticably slow.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
I
don't think anyone claims it leads to computational satori - it's more
an attitude of "try it, you'll like it!". Using Python does seem to
spoil people - I for one hate to code in Java now. Maybe "bliss" is a
better word for it than "satori".
Kent
--
http://mail.python.org/mailman/listinfo/python-list
Gabriel B. wrote:
> what does a string became when it's decoded?
>
> I mean, it must be encoded in something, right?
Unicode, for encodings like latin-1 or utf-8. A few special cases like
str.decode('string_escape') yield byte strings again.
Kent
--
http://mail.pyt
of 3: 6.29 usec per loop
D:\Projects\CB>python -m timeit -s
"A=['hello','there','this','that'];B=[3,4,2,5]" "[a for b,a in
sorted(zip(B,A))]"
10 loops, best of 3: 5.53 usec per loop
(I'm bored this morning :-)
There's probably a clever way to do it using the key parameter to sort
but I can't think of it...
>
> The sort method on lists does in-place sorting. Is there a way to do
> what I want here?
The example above does not sort in place, if you want it to be in place use
A[:] = [a for b,a in sorted(zip(B,A))]
Kent
--
http://mail.python.org/mailman/listinfo/python-list
r patter in The Little Book of Semaphores:
http://greenteapress.com/semaphores/
It requires that you know in advance how many threads need to rendezvous
so you will have to preprocess your args a little.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
al:
def getText(nodelist):
global colorIndex
for str in strings:
print colors[colorIndex % colors.length]
colorIndex += 1
Kent
--
http://mail.python.org/mailman/listinfo/python-list
all else fails try the index:
http://docs.python.org/lib/genindex.html
>
> how do i either grab the full path or append it later ...
Use os.path.join():
base = '/some/useful/path'
for f in os.listdir(base):
full_path_to_file = os.path.join(base, f)
Kent
--
http://mail.python.or
6:'B', 56:'C'}
>>> dict((key, dict2[value]) for key, value in dict1.iteritems())
{1: 'A', 2: 'B', 4: 'C'}
Kent
--
http://mail.python.org/mailman/listinfo/python-list
ve you have to run the socket in a
separate thread; this recipe may give you some help though it may be
more complex than you need:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/82965
Kent
--
http://mail.python.org/mailman/listinfo/python-list
ll this method, you have to provide the instance as the first argument:
>>> f=spam.ham
>>> f(s, 'Ha!')
Ha!
So...
s.strip() gets a bound method object from the class and calls it with no
additional argument.
str.strip(s) gets an unbound method object from the class and calls it,
passing a class instance as the first argument.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
n the string module.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
you can still use
for k in myDictionary.keys()
There is also UserDict.IterableUserDict which does support iteration.
I don't think there is much reason to use UserDict in modern Python as
dict can be subclassed.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
AttributeError: Dict instance has no
> attribute 'itervalues'
What version of Python are you using? itervalues() is in Python 2.2 and
later.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
und `_' is a valid variable name. So I don't know it is a just
> a plain variable or like something pattern matching in Haskell.
_ is just a plain variable name in Python. It is sometimes when a
variable is needed to receive a value that won't be used. So your
example was correct
7
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/435883
Kent
--
http://mail.python.org/mailman/listinfo/python-list
x usage you may want a class.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
s):
> threading.Thread(target=self.blah,
>*args,
>**kwargs).start()
No. threading.Thread() doesn't use *args, **kwargs, it uses explicit
named parameters.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
place it will
affect the subsequent walk. So you could use
for base, dirs, walk_files in os.walk(root):
dirs.sort(key=str.lower) # note no need for lambda
walk_files.sort(key=str.lower)
# etc
Kent
--
http://mail.python.org/mailman/listinfo/python-list
e(10))
I think you should call the superclass __init__ as well:
class __metaclass__(type):
def __init__(cls, name, bases, classdict):
super(__metaclass__, cls).__init__(name, bases, classdict)
cls.sum = sum(xrange(10))
Kent
--
http://mail.python.org/mailman/listinfo/python-list
gt; docs, and I suppose I was curious how to do the same sort of thing
> without 'apply'.
Apply has been replaced by 'extended call syntax', that is why it is
deprecated. Instead of
return apply(self._function,_args,_kargs)
write
return self._function(*_a
th in the module that uses it. Imports in one
module don't (in general) affect the variables available in another module.
module_f.py
from math import sqrt # more explicit than from math import *
def f(x):
""" Compute sqrt of x """
return sqrt(x)
Kent
--
http://mail.python.org/mailman/listinfo/python-list
nction that returns a tuple of the two values you want to
sort on:
def make_key(f):
return (os.path.dirname(f), f.lower())
files.sort(key=make_key)
Kent
--
http://mail.python.org/mailman/listinfo/python-list
if item is o:
return i
raise ValueError, "%s not in list" % o
If you just want the index available inside the loop, this replaces your
original loop:
for i, object in enumerate(lst):
print i
Kent
--
http://mail.python.org/mailman/listinfo/python-list
mlentitydefs&rnum=2#fce6c2f6c3d46e9c
Kent
--
http://mail.python.org/mailman/listinfo/python-list
above.
What I do is run always from the base directory (violates your first
requirement). I make a util package to hold commonly used code. Then B
and D both use
from util import foo
In Python 2.5 you will be able to say (in D, for example)
from ..util import foo
http://www.python.org/peps/pep-0328.html
Kent
--
http://mail.python.org/mailman/listinfo/python-list
yy
> yyy
> yyy
>
>
> yyy
That's not what I get:
In [2]: data='''xxx.xxx.xxx.xxx:yyy
...: xxx.xxx.xxx.xxx:yyy
...: xxx.xxx.xxx.xxx:yyy
...: xxx.xxx.xxx.xxx
...: xxx.xxx.xxx.xxx
...: xxx.xxx.xxx.xxx:yyy'''.splitlines()
In [3]: for line in data:
...: print line.split(':')[-1]
...:
...:
yyy
yyy
yyy
xxx.xxx.xxx.xxx
xxx.xxx.xxx.xxx
yyy
Kent
--
http://mail.python.org/mailman/listinfo/python-list
401 - 500 of 792 matches
Mail list logo