Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in Python only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
Python
Print python code for \t escape character?
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
Jeremy Rohrer
New Member
Join Date:
Oct 2010
Posts:
6
#1
Print python code for \t escape character?
Oct 10 '10, 11:03 PM
What is the python code for printing this sentence? "The \t is the tab escape character."
bvdet
Recognized Expert
Specialist
Join Date:
Oct 2006
Posts:
2851
#2
Oct 11 '10, 12:25 AM
To print a backslash character:
print "\\"
Comment
Post
Cancel
Jeremy Rohrer
New Member
Join Date:
Oct 2010
Posts:
6
#3
Oct 11 '10, 05:14 AM
Thanks man, but I need to know how to print out that sentence so it looks the exactly same way in my script.
I want it to look like this: The \t is the tab escape character.
Whenever I do it though it looks like this:
The is the tab escape character.
Thanks for your help.
Comment
Post
Cancel
bvdet
Recognized Expert
Specialist
Join Date:
Oct 2006
Posts:
2851
#4
Oct 11 '10, 12:54 PM
I gave you the answer, you just did not think about it. Add a backslash in front of the tab character.
If you are in Python 3, print is a function instead of a statement.
Comment
Post
Cancel
Jeremy Rohrer
New Member
Join Date:
Oct 2010
Posts:
6
#5
Oct 11 '10, 03:18 PM
my fault. thank you.
Comment
Post
Cancel
bvdet
Recognized Expert
Specialist
Join Date:
Oct 2006
Posts:
2851
#6
Oct 11 '10, 03:22 PM
No problem. I am glad to help. :)
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment