By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,846 Members | 2,107 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,846 IT Pros & Developers. It's quick & easy.

Python 2.5 idle and print command How do I suppress a line feed?

P: n/a
Hi,
I am having a problem with print statements always cause a line feed.
I need to print a line of text, then the next print statement will
start printing where the last one stopped rather than drop down a line.

In basic we can do this with print "texst"; followed by next command
print "text2"
So how do I do that in python?

Nov 23 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
notejam wrote:
Hi,
I am having a problem with print statements always cause a line feed.
I need to print a line of text, then the next print statement will
start printing where the last one stopped rather than drop down a line.

In basic we can do this with print "texst"; followed by next command
print "text2"
So how do I do that in python?
Thusly...

print "texst",
print "text2"

--
work: http://www.kelpiesoft.com
blog: http://www.willmcgugan.com
Nov 23 '06 #2

P: n/a
notejam wrote:
Hi,
I am having a problem with print statements always cause a line feed.
I need to print a line of text, then the next print statement will
start printing where the last one stopped rather than drop down a line.

In basic we can do this with print "texst"; followed by next command
print "text2"
So how do I do that in python?
Or if you want to get rid of the space...

import sys
sys.stdout.write("texst")
sys.stdout.write("text2")

--
--
work: http://www.kelpiesoft.com
blog: http://www.willmcgugan.com
Nov 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.