RSS Forums RSS
Please support our Python advertiser: Programming Forums

How to do Input in Python?

Join Date: Oct 2004
Posts: 2,534
Reputation: vegaseat will become famous soon enough vegaseat will become famous soon enough 
Rep Power: 11
Solved Threads: 178
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Solution Re: How to do Input in Python?

  #9  
Jun 13th, 2005
Just a moment ...

I can't repeat your problem, both PythonWin and IDLE give a perfect one line result!

I tried to mimic your predicament ...
[php]test = raw_input ("Input word")
print "Why "+ test +" there a line break all the time?"

# add a newline to the end for testing
test = test + '\n'
print "Why "+ test +" there a line break all the time?"

# simple way to remove a trailing newline
if '\n' in test:
test = test[:-1]
print "Why "+ test +" there a line break all the time?"
[/php]
May 'the Google' be with you!
Reply With Quote  
All times are GMT -4. The time now is 10:06 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC