On 2019-08-10 09:10:12 +1000, Cameron Simpson wrote:
> On 09Aug2019 22:28, Paul St George <email at paulstgeorge.com> wrote:
> > On 09/08/2019 16:29, Rhodri James wrote:
> > > (Actually I would probably use outstream.write() and do my own
> > > formatting, but let's not get side-tracked ;-)
> > >
> > I would love to hear your outstream.write() side-track!
> I am not Rhodri James, but you can just write strings to text files:
> outstream.write("X: ") # note, includes the space separator
You can also format the string before passing it to write (which is
probably what Rhodri meant by "do my own formatting", like this:
outstream.write("X: %7.2f\n" % thing)
or (since Python 3.6) this:
There are of course many variants to all three methods.
_ | Peter J. Holzer | we build much bigger, better disasters now
|_|_) | | because we have much more sophisticated
| | | hjp at hjp.at | management tools.
__/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: not available