Python Code Help!

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Mar 2007
Posts: 1
Reputation: winz is an unknown quantity at this point 
Solved Threads: 0
winz winz is offline Offline
Newbie Poster

Python Code Help!

 
0
  #1
Mar 20th, 2007
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!
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 149
Reputation: ghostdog74 is on a distinguished road 
Solved Threads: 40
ghostdog74 ghostdog74 is offline Offline
Junior Poster

Re: Python Code Help!

 
0
  #2
Mar 20th, 2007
from where did you get this command ?
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 9
Reputation: mouigher is an unknown quantity at this point 
Solved Threads: 0
mouigher mouigher is offline Offline
Newbie Poster

Re: Python Code Help!

 
0
  #3
Mar 20th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 149
Reputation: ghostdog74 is on a distinguished road 
Solved Threads: 40
ghostdog74 ghostdog74 is offline Offline
Junior Poster

Re: Python Code Help!

 
0
  #4
Mar 20th, 2007
a newline is represented as "\n", not "/n". maybe a typo error
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 47
Reputation: nytrokiss is an unknown quantity at this point 
Solved Threads: 4
nytrokiss nytrokiss is offline Offline
Light Poster

Re: Python Code Help!

 
0
  #5
Mar 26th, 2007
Yes now it also depends on which os you are using!
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 9
Reputation: mouigher is an unknown quantity at this point 
Solved Threads: 0
mouigher mouigher is offline Offline
Newbie Poster

Re: Python Code Help!

 
0
  #6
Mar 27th, 2007
My typo. I meant \n. /n is dividing by whatever n=.

On Windows XP.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 47
Reputation: nytrokiss is an unknown quantity at this point 
Solved Threads: 4
nytrokiss nytrokiss is offline Offline
Light Poster

Re: Python Code Help!

 
0
  #7
Mar 27th, 2007
Originally Posted by mouigher View Post
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!
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 9
Reputation: mouigher is an unknown quantity at this point 
Solved Threads: 0
mouigher mouigher is offline Offline
Newbie Poster

Re: Python Code Help!

 
0
  #8
Mar 28th, 2007
hah, oh gees. Crazyness.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 47
Reputation: nytrokiss is an unknown quantity at this point 
Solved Threads: 4
nytrokiss nytrokiss is offline Offline
Light Poster

Re: Python Code Help!

 
0
  #9
Mar 28th, 2007
sorry newline scheme it is difrent in every major OS
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 149
Reputation: ghostdog74 is on a distinguished road 
Solved Threads: 40
ghostdog74 ghostdog74 is offline Offline
Junior Poster

Re: Python Code Help!

 
0
  #10
Mar 28th, 2007
Originally Posted by nytrokiss View Post
On windows xp it's /r/n which is the new line scheme for windows!
its like this "\r\n" in DOS.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 2398 | Replies: 9
Thread Tools Search this Thread



Tag cloud for Python
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC