944,052 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Unsolved
  • Views: 3068
  • Python RSS
Mar 20th, 2007
0

Python Code Help!

Expand Post »
Hey, I'm doing a project with Python right now and am wondering what the heck a "/n" command does?

ANY help would be greatly appreciated!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
winz is offline Offline
1 posts
since Mar 2007
Mar 20th, 2007
0

Re: Python Code Help!

from where did you get this command ?
Reputation Points: 75
Solved Threads: 44
Junior Poster
ghostdog74 is offline Offline
156 posts
since Apr 2006
Mar 20th, 2007
0

Re: Python Code Help!

I'm looking in a my python book and it says when using multi-line strings,

"You can think of a text file as a string that happens to be stored on disk. Of cource, a typical file generally contains more than a single line of text. A special character or sequence of characters is used to mark the end of each line. There are numerous conventions for end-of-line markers. Python uses a single character called newline."

"You can think of a newline as the character produced when you press the <enter> key on your keyboard. Although a newline is a single character, it is represented in Python using the special notation '/n'.

Hope that helps you out. It was under the "Multi-Line Strings" section.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mouigher is offline Offline
9 posts
since Feb 2007
Mar 20th, 2007
0

Re: Python Code Help!

a newline is represented as "\n", not "/n". maybe a typo error
Reputation Points: 75
Solved Threads: 44
Junior Poster
ghostdog74 is offline Offline
156 posts
since Apr 2006
Mar 26th, 2007
0

Re: Python Code Help!

Yes now it also depends on which os you are using!
Reputation Points: 10
Solved Threads: 4
Light Poster
nytrokiss is offline Offline
47 posts
since Jun 2006
Mar 27th, 2007
0

Re: Python Code Help!

My typo. I meant \n. /n is dividing by whatever n=.

On Windows XP.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mouigher is offline Offline
9 posts
since Feb 2007
Mar 27th, 2007
0

Re: Python Code Help!

Click to Expand / Collapse  Quote originally posted by mouigher ...
My typo. I meant \n. /n is dividing by whatever n=.

On Windows XP.
On windows xp it's /r/n which is the new line scheme for windows!
Reputation Points: 10
Solved Threads: 4
Light Poster
nytrokiss is offline Offline
47 posts
since Jun 2006
Mar 28th, 2007
0

Re: Python Code Help!

hah, oh gees. Crazyness.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mouigher is offline Offline
9 posts
since Feb 2007
Mar 28th, 2007
0

Re: Python Code Help!

sorry newline scheme it is difrent in every major OS
Reputation Points: 10
Solved Threads: 4
Light Poster
nytrokiss is offline Offline
47 posts
since Jun 2006
Mar 28th, 2007
0

Re: Python Code Help!

Click to Expand / Collapse  Quote originally posted by nytrokiss ...
On windows xp it's /r/n which is the new line scheme for windows!
its like this "\r\n" in DOS.
Reputation Points: 75
Solved Threads: 44
Junior Poster
ghostdog74 is offline Offline
156 posts
since Apr 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: wxPython tutorials?
Next Thread in Python Forum Timeline: Simple program help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC