My tech blog
My tech blog
Showing posts with label
python
.
Show all posts
Showing posts with label
python
.
Show all posts
Wednesday, 1 August 2012
String concatenation problem and its fix in Python
When read string from keyboard or file, e.g.
file_date
=
str
(
input
(
"Enter file date: "
))
It may cause the cursor to go back to the start of the line when you try to print it out. You may want to trim the return value of the string.
For example, STRING_VALUE.rstrip()
Older Posts
Home
Subscribe to:
Posts (Atom)