954,198 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Python Code Help!

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!

winz
Newbie Poster
1 post since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

from where did you get this command ?

ghostdog74
Junior Poster
156 posts since Apr 2006
Reputation Points: 75
Solved Threads: 44
 

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 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.

mouigher
Newbie Poster
9 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0
 

a newline is represented as "\n", not "/n". maybe a typo error

ghostdog74
Junior Poster
156 posts since Apr 2006
Reputation Points: 75
Solved Threads: 44
 

Yes now it also depends on which os you are using!

nytrokiss
Light Poster
47 posts since Jun 2006
Reputation Points: 10
Solved Threads: 5
 

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

On Windows XP.

mouigher
Newbie Poster
9 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0
 
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!

nytrokiss
Light Poster
47 posts since Jun 2006
Reputation Points: 10
Solved Threads: 5
 

hah, oh gees. Crazyness.

mouigher
Newbie Poster
9 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0
 

sorry newline scheme it is difrent in every major OS

nytrokiss
Light Poster
47 posts since Jun 2006
Reputation Points: 10
Solved Threads: 5
 
On windows xp it's /r/n which is the new line scheme for windows!

its like this "\r\n" in DOS.

ghostdog74
Junior Poster
156 posts since Apr 2006
Reputation Points: 75
Solved Threads: 44
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You