On 10/18/19 5:00 PM, D'Arcy Cain wrote:
Finally, if this is in a loop do this.
FMT = '{0[0]:<12s}{0[3]:>12s}'.format
for temp_list in GetLists(): print FMT(temp_list)
Oops. Time warp. I meant "print(FMT(temp_list))
--
D'Arcy J.M. Cain
Vybe Networks Inc.
http://www.VybeNetworks.com/
IM:da...
On 10/18/19 2:21 PM, Jagga Soorma wrote:
I seem to have found a way to do this with the following:
print('{:<12s}{:>12s}'.format((temp_list[0]),(temp_list[3])))
Still let me know if there is a better way to format this output :)
I would start with removing the redundant parens.
print('{:<1
I seem to have found a way to do this with the following:
print('{:<12s}{:>12s}'.format((temp_list[0]),(temp_list[3])))
Still let me know if there is a better way to format this output :)
Thanks,
-J
On Fri, Oct 18, 2019 at 10:03 AM Jagga Soorma wrote:
>
> Hello,
>
> I am new to python and try
On 2019-10-18 18:03, Jagga Soorma wrote:
Hello,
I am new to python and trying to write a script that outputs some data
about users. I was able to write it and dump the data but can't seem
to align the output in column 2 correctly. Here is what I am trying
to do:
--
output:
user1 data1
use
Hello,
I am new to python and trying to write a script that outputs some data
about users. I was able to write it and dump the data but can't seem
to align the output in column 2 correctly. Here is what I am trying
to do:
--
output:
user1 data1
username2 data2
user3 data3
s
vsoler wrote:
> My script contains a print statement:
>
> print '%40s %15d' % (k, m)
>
> However,
>
> 1- the string is right adjusted, and I would like it left
> adjusted
> 2- the number is a decimal number, and I would like it with
> the thousands separator and 2
vsoler wrote:
> Hello,
>
> My script contains a print statement:
>
> print '%40s %15d' % (k, m)
>
> However,
>
> 1- the string is right adjusted, and I would like it left
> adjusted
> 2- the number is a decimal number, and I would like it with
> the thousands sepa
Hello,
My script contains a print statement:
print '%40s %15d' % (k, m)
However,
1- the string is right adjusted, and I would like it left
adjusted
2- the number is a decimal number, and I would like it with
the thousands separator and 2 decimals
If possible, the
Grant Edwards wrote:
> On 2007-02-13, hg <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> Considering the float 0.0, I would like to print 00.00.
>>
>> I tried '%02.02f' % 0.0 ... but I get 0.00
> ^^
> That's the specifierfor how many total columns you want to use
> (including the decimal point
On 2007-02-13, hg <[EMAIL PROTECTED]> wrote:
> NOSPAM plz wrote:
>>> Considering the float 0.0, I would like to print 00.00.
>>>
>>> I tried '%02.02f' % 0.0 ... but I get 0.00
>> Try this:
>>
>> a = 45.45 # the floating number
>>
>> print "some text",
>> print a,
>> print "some text again"
> S
On 2007-02-13, hg <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Considering the float 0.0, I would like to print 00.00.
>
> I tried '%02.02f' % 0.0 ... but I get 0.00
^^
That's the specifierfor how many total columns you want to use
(including the decimal point and all digits to either side).
>
Neil Cerutti wrote:
> The eighth-graders will be presenting Shakespeare's Hamlet in the church
> basement on Friday at 7 p.m. The congregation is invited to attend this
> tragedy. --Church Bulletin Blooper
;-) I like that !
hg
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-02-13, hg <[EMAIL PROTECTED]> wrote:
> Neil Cerutti wrote:
>
>> On 2007-02-13, hg <[EMAIL PROTECTED]> wrote:
>>> Hi,
>>>
>>> Considering the float 0.0, I would like to print 00.00.
>>>
>>> I tried '%02.02f' % 0.0 ... but I get 0.00
>>>
>>> Any clue ?
>>
>> Yes. How wide (total) is "0.00",
Peter Otten wrote:
> hg wrote:
>
>> Considering the float 0.0, I would like to print 00.00.
>>
>> I tried '%02.02f' % 0.0 ... but I get 0.00
>>
>> Any clue ?
>
> The first integer specifies the total width:
>
"%05.2f" % 0
> '00.00'
>
> Peter
Many thanks !
hg
--
http://mail.python.or
hg wrote:
> Considering the float 0.0, I would like to print 00.00.
>
> I tried '%02.02f' % 0.0 ... but I get 0.00
>
> Any clue ?
The first integer specifies the total width:
>>> "%05.2f" % 0
'00.00'
Peter
--
http://mail.python.org/mailman/listinfo/python-list
NOSPAM plz wrote:
> hg skrev:
>> Hi,
>>
>> Considering the float 0.0, I would like to print 00.00.
>>
>> I tried '%02.02f' % 0.0 ... but I get 0.00
>>
>> Any clue ?
>>
>> Thanks,
>>
>> hg
>>
>>
> Try this:
>
> a = 45.45 # the floating number
>
> print "some text",
> print a,
> print "some tex
Neil Cerutti wrote:
> On 2007-02-13, hg <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> Considering the float 0.0, I would like to print 00.00.
>>
>> I tried '%02.02f' % 0.0 ... but I get 0.00
>>
>> Any clue ?
>
> Yes. How wide (total) is "0.00", compared to "00.00"?
>
> --
> Neil Cerutti
I do not get
On 2007-02-13, hg <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Considering the float 0.0, I would like to print 00.00.
>
> I tried '%02.02f' % 0.0 ... but I get 0.00
>
> Any clue ?
Yes. How wide (total) is "0.00", compared to "00.00"?
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-li
hg skrev:
> Hi,
>
> Considering the float 0.0, I would like to print 00.00.
>
> I tried '%02.02f' % 0.0 ... but I get 0.00
>
> Any clue ?
>
> Thanks,
>
> hg
>
>
Try this:
a = 45.45 # the floating number
print "some text",
print a,
print "some text again"
or just this:
print "some text",
prin
Hi,
Considering the float 0.0, I would like to print 00.00.
I tried '%02.02f' % 0.0 ... but I get 0.00
Any clue ?
Thanks,
hg
--
http://mail.python.org/mailman/listinfo/python-list
20 matches
Mail list logo