On Nov 23, 3:17 pm, Dan Bishop danb...@yahoo.com wrote:
You meant:
x = '%.1f' % y
Thanks, I'm a dufus today.
--
http://mail.python.org/mailman/listinfo/python-list
I'd like to convert a list of floats to formatted strings. The
following example raises a TypeError:
y = 0.5
x = '.1f' % y
--
http://mail.python.org/mailman/listinfo/python-list
Thanks all. That did it.
--
http://mail.python.org/mailman/listinfo/python-list
I have python 2.6 on OS X 10.5.8:
$ python --version
Python 2.6.2
$ which python
/Library/Frameworks/Python.framework/Versions/2.6/bin/python
When installing an egg, python 2.5 shows up:
$ sudo easy_install ipython-0.10-py2.6.egg
Password:
Processing ipython-0.10-py2.6.egg
removing
I'd like to convert a list of floats to a list of strings constrained
to one .1f format. These don't work. Is there a better way?
[.1f % i for i in l]
or
[(.1f % i) for i in l]
StephenB
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 9, 10:43 am, Carl Banks pavlovevide...@gmail.com wrote:
You need a % in there, chief.
Carl Banks
You are so right. Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
I've installed the latest 2.5 python today from python.org, and I
think it ended up in /Applications/MacPython 2.5.
I also have a /Applications/MacPython 2.4 and a /Applications/
MacPython-2.4. Can I delete these, or did one of them come with
Leopard?
I still have a /Library/Python/2.3 and a
On Jan 8, 11:33 pm, Tommy Nordgren [EMAIL PROTECTED] wrote:
I still have a /Library/Python/2.3 and a /Library/Python/2.5.
Thanks.
Stephen
Leopard INCLUDES Python 2.5, there is no need to install it.
Thanks -- that made the decision easy. I didn't need all those
MacPythons.
This doesn't seem to work in a dos terminal at the start of a script:
from os import popen
print popen('clear').read()
Any idea why not? Thanks.
Stephen
--
http://mail.python.org/mailman/listinfo/python-list
On Dec 13, 11:21 am, Chris Mellon [EMAIL PROTECTED] wrote:
It opens clear with it's own virtual terminal and clears that
instead.
Even when I launch the script from a cmd shell with python
myscript.py?
There's an ANSI control code you can use to reset the screen, try printing
that.
I
I like to have unum units imported automatically on my PYTHONSTARTUP
since I'm always converting things, and I also like to use pyshell.
They conflict for some reason I don't understand (pyshell doesn't like
the Unum.as method, maybe since it will be a keyword):
1.0*IN.as(M)
File input, line 1
Can someone let me know why this won't work? Thanks.
from os import popen
popen('export asdfasdf=hello').read()
''
popen('echo $asdfasdf').read()
'\n'
Thanks.
Stephen
--
http://mail.python.org/mailman/listinfo/python-list
12 matches
Mail list logo