p.match(line):
print 'I found requested'
or you can use one of the string modules, I suggest hitting up the
documentation on python.org if you wish to know string functions.
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
Bruno Desthuilliers wrote:
> Carl J. Van Arsdall a écrit :
>
>> david brochu jr wrote:
>>
>>
>>> Hello,
>>>
>>>
>>> I have a text file with the following string:
>>> ['\r\n', 'Pinging www.ebayyy.com <
Bruno Desthuilliers wrote:
> Carl J. Van Arsdall a écrit :
> (snip)
>
>
>> With a file object, to iterate through the lines in a file don't you
>> have to use readlines()?
>>
>
> Nope - no more, should I say. The file object is now an iterable.
nization at some point
#END Code
Anyhow, there are more ways to do it and it really depends on your needs
as to how far you need to take this.
Hope that helps.
-carl
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
gt; I think something Monty Python related would be better. How
>> about a nice can of spam?
>>
>
> Six words: copyright violation ... trademark violation.
>
Six?
Looks more like 4 to me.
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
unction if i was writing
some type of manager for a computing farm or something like that.
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
bjects into
files as they are and read them again as they were. Its fairly easy to
use and might work well for you.
HTH
-carl
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
d + " and " + root.bTag
if nodeToFind == root.bTag:
return root
elif nodeToFind < root.bTag:
return( self.findNode(nodeToFind, root.left) )
else:
return( self.findNode(nodeToFind, root.right) )
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Buil
t; globals()
{'__builtins__': , '__name__':
'__main__', '__doc__': None, 'blah': None}
#Taking this a step further, this is a dictionary so you can use the
has_key method or try to access the dict and catch an exception should
the key not exist
>>> if globals().has_key('blah'):
... print "I have blah"
...
I have blah
-carl
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
tion, conditions are based on
> fields by using regexp
>
>
I just wanted to make the comment that there already exists a
Condition() class in the threading module. If you plan on using your
class with the threading module you might wish to use another name.
-carl
--
Carl J. Van
constructs for making threads wait: Check out Events and Conditions
-carl
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
ading standards (should they ever become
available). I see other use cases as well, but I just wanted to throw a
couple ideas to see if this was worth thinking about further.
Thanks for reading this one, I know it was long but I'd really
appreciate your comments!
-Carl
--
Carl J. Va
is for this belief.
>
>
To be honest, Monty really makes the most sense to me for a mascot
name... now if we can only get past all that damn copyright infringement ;)
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
wtf is it ?), so it had to be called
> something !
>
>
Well, we could call the perl camel Joe but I don't know if the perlcores
(read: hardcore PERL users) would be down for that ;)
.c
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://ma
r way, and in the end the indentation levels all
work out fine.
People want to fight tooth and nail over this debate. But its really
not worth it. Get an editor that doesn't completely suck and you won't
have problems.
.c
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
gt;
>
Why couldn't you tab your third line over as close as possible to the
start of the quote then use a couple spaces? Then the tabs would work
just fine and you could still have your pretty line.
.c
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
Andy Sy wrote:
> Carl J. Van Arsdall wrote:
>
>
>>> Next major objection then, how can one practically use 'tabs as
>>> semantic indentation' without screwing up formatting of code like
>>> the below??
>>>
>>>
>>>
Dave Hansen wrote:
> On Wed, 17 May 2006 12:02:46 -0700 in comp.lang.python, "Carl J. Van
> Arsdall" <[EMAIL PROTECTED]> wrote:
>
>
>> Andy Sy wrote:
>>
>>> Carl J. Van Arsdall wrote:
>>>
>>>
>>>
>>
abs".
I think we've just about beat this discussion to death... nice work
everyone!
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
amn.
>
>
Odi(e) was a punk. I'm gonna be a rebel without a cause and stay with
Monty ;)
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
nto the framework making it easy for developers to distribute
tasks. Anyhow, any comments would be greatly appreciated! I also hope
to release this framework as an open-source project when its finished,
so again I community input is important.
Thanks!
.c
--
Carl J. Van Arsdall
[EMAI
other technologies enough to comment on them?
.c
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
sub{$_+9}]
>
> That was easy.
>
Wakka wakka.
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
t;
>
> Debate? There's no valid dabate. Tabs bad. Spaces good.
>
>
Hrmms, I think we should debate about the debate now, I mean we've
already beaten the actual topic to DEATH.
.c
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
ionary
try:
self.__userData[variableName] = value
finally:
self.__mutex.release()
return
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
rson
reading my code would more easily see any exit points in my code. Turns
out that it came to bite me later.
Again, thanks to all your help and comments on my coding style.
.c
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
ee a couple typos
First, on the line
for line in fsfiles.readlines():
There's an extra s in fsfile
Secondly, the line:
print line
should have an indentation to denote that its the block of code that the
for loop will execute on.
.c
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
but that
seems like overkill to do such a simple thing.
-Carl
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
> messed up what str is? This code used to work. I am trying to figure
> out what caused it to cease to work.
>
> Any ideas?
>
>
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
but i not even
> can write from the python shell with that.
>
> python 2.2
> linux
> kernel 2.4
> glibc-2.3.2-95.6
>
> Thanks in advance for any help.
> sorry for my bad english
> Grazie
> Marcello
>
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
oject, thanks!
-carl
--
Carl J. Van Arsdall
[EMAIL PROTECTED]
Build and Release
MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
101 - 131 of 131 matches
Mail list logo