On Fri, Apr 10, 2015 at 5:19 AM, Ben Bacarisse wrote:
> Chris Angelico writes:
>
>> On Fri, Apr 10, 2015 at 4:46 AM, Ben Finney
>> wrote:
>>> Travis Griggs writes:
>>>
Here’s 3 examples:
if k + ‘_@‘ in documents:
timeKey = k + ‘_@‘
historyKey = th
Chris Angelico writes:
> On Fri, Apr 10, 2015 at 4:46 AM, Ben Finney
> wrote:
>> Travis Griggs writes:
>>
>>> Here’s 3 examples:
>>>
>>> if k + ‘_@‘ in documents:
>>>
>>> timeKey = k + ‘_@‘
>>>
>>> historyKey = thingID + ‘_’ + k
>>
>> In addition to the other responses, I'll point
On Fri, Apr 10, 2015 at 4:46 AM, Ben Finney wrote:
> Travis Griggs writes:
>
>> Here’s 3 examples:
>>
>> if k + ‘_@‘ in documents:
>>
>> timeKey = k + ‘_@‘
>>
>> historyKey = thingID + ‘_’ + k
>
> In addition to the other responses, I'll point out a different issue:
>
> Your client is
Travis Griggs writes:
> Here’s 3 examples:
>
> if k + ‘_@‘ in documents:
>
> timeKey = k + ‘_@‘
>
> historyKey = thingID + ‘_’ + k
In addition to the other responses, I'll point out a different issue:
Your client is composing messages that munge your text. Ensure you post
only the e
I am under the impression that using format() is the canonically "right way
to do it". It is certainly more readable than using ''.join() and is more
semantically specific than string addition.
On Thu, Apr 9, 2015 at 1:35 PM, Chris Angelico wrote:
> On Fri, Apr 10, 2015 at 4:29 AM, Travis Griggs
On Fri, Apr 10, 2015 at 4:44 AM, Andrew Farrell wrote:
> I am under the impression that using format() is the canonically "right way
> to do it". It is certainly more readable than using ''.join() and is more
> semantically specific than string addition.
Depends what you're doing. Sometimes it's
On Fri, Apr 10, 2015 at 4:29 AM, Travis Griggs wrote:
>
> if k + ‘_@‘ in documents:
>
> timeKey = k + ‘_@‘
>
> historyKey = thingID + ‘_’ + k
>
> I’m curious where others lean stylistically with this kind of thing. I see
> *at least* 2 other alternatives:
>
So few? I'd just use strin
I was doing some maintenance now on a script of mine… I noticed that I compose
strings in this little 54 line file multipole times using the + operator. I was
prototyping at the time I wrote it and it was quick and easy. I don’t really
care for the way they read. Here’s 3 examples:
if k + ‘
Hi Erich
If you're going to be doing a lot of string substitution, you should
look at the Templating support in the library:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/304005
and (a little bit fancier):
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/335308
Regards
Caleb
thank you, i just plainly overlooked it ; )
now it works
--
http://mail.python.org/mailman/listinfo/python-list
EHC a écrit :
> hello!
>
> since i am a py noob, please bear with me ; )
>
> how is it possible to concat a string and an integer in a
> print-command? i've tried
>
> print "This robot is named %s. The current speed setting is %d, and %s
> has a lifetime of %d" % (self.name , self.speed , self.n
hello!
since i am a py noob, please bear with me ; )
how is it possible to concat a string and an integer in a
print-command? i've tried
print "This robot is named %s. The current speed setting is %d, and %s
has a lifetime of %d" % (self.name , self.speed , self.name)
as well as
print "This ro
John Henry wrote:
> I have a list of strings (some 10,000+) and I need to concatenate them
> together into one very long string. The obvious method would be, for
> example:
>
> alist=["ab","cd","ef",.,"zzz"]
> blist = ""
> for x in alist:
>blist += x
>
> But is there a cleaner and faster
John Henry wrote:
> Sorry if this is a dumb question.
>
> I have a list of strings (some 10,000+) and I need to concatenate them
> together into one very long string. The obvious method would be, for
> example:
>
> alist=["ab","cd","ef",.,"zzz"]
> blist = ""
> for x in alist:
>blist += x
Sorry if this is a dumb question.
I have a list of strings (some 10,000+) and I need to concatenate them
together into one very long string. The obvious method would be, for
example:
alist=["ab","cd","ef",.,"zzz"]
blist = ""
for x in alist:
blist += x
But is there a cleaner and faster wa
Sorry if this is a dumb question.
I have a list of strings (some 10,000+) and I need to concatenate them
together into one very long string. The obvious method would be, for
example:
alist=["ab","cd","ef",.,"zzz"]
blist = ""
for x in alist:
blist += x
But is there a cleaner and faster wa
16 matches
Mail list logo