'"""' and linefeed characters 
Author Message
 '"""' and linefeed characters

I'm assuming that returns in a '"""' quoted string are given
the linefeed character(s) of the operating system python is
run on.  Is this right?

Thanks in advance.



Wed, 01 Jan 2003 03:00:00 GMT  
 '"""' and linefeed characters

Quote:

> I'm assuming that returns in a '"""' quoted string are given
> the linefeed character(s) of the operating system Python is
> run on.  Is this right?

> Thanks in advance.

They're given a newline ('\n'), which is independent of the end-of-line
sequence of your operating system.

--

 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ The chicken was the egg's idea of getting more eggs.
\__/ Samuel Butler
    Fat Boy and Little Man / http://www.fatboyandlittleman.com/
 Watch Fat Boy and Little Man go about their antics.



Wed, 01 Jan 2003 03:00:00 GMT  
 '"""' and linefeed characters

Quote:

> > I'm assuming that returns in a '"""' quoted string are given
> > the linefeed character(s) of the operating system Python is
> > run on.  Is this right?

> They're given a newline ('\n'), which is independent of the
> end-of-line sequence of your operating system.

Ah, so my reply was wrong. Sorry to confuse matters. A quick check
would have been a good idea:-

  [on linux]
  >>> f = open('foo.py','w')
  >>> f.write('"""\r\n"""\r\n')
  >>> f.close()
  >>> import foo
  >>> repr(foo.__doc__)
  "'\\012'"

-Steve

--
Steve Purcell,  Technical Director, Inkontact
Get in touch at http://www.inkontact.com/
Get testing at http://pyunit.sourceforge.net/
"Life must be simple if I can do it" -- Me



Wed, 01 Jan 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. "'Snakeymathtem'": Virus?

2. LabView 5.1.1, 'Failure: "linker.c", line 1825': Please Help

3. About ''"CooL": low-level macros considered useful

4. string.join(["Tk 4.2p2", "Python 1.4", "Win32", "free"], "for")

5. python -c "help('while')"

6. Characters "?", "?", "ΓΌ" shown in wrong font

7. `exec tclsh "$0" "$@"' doesn't work on some /bin/sh

8. Difference between ST's "[]" and Lisp's "lambda"

9. BEGIN{want[]={"s1o", "s2o", "s2q", "s3q"}

10. Iverson's "Calculus"

11. "Can't optimize #repeat" warning

12. HGTV's "Incredible Basements"

 

 
Powered by phpBB® Forum Software