Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #65725
| References | <72a7dd52-7619-4520-991e-20db7ce55ba3@googlegroups.com> <roy-C8B893.09080908022014@news.panix.com> <ld6237$ju9$1@news.albasani.net> <CAPTjJmp-g0KOYzs9dd_C_E75SyiOSwfDKBu1LFOBdiWHR8CUwQ@mail.gmail.com> |
|---|---|
| Date | 2014-02-09 05:49 +0000 |
| From | Gisle Vanem <gvanem@yahoo.no> |
| Subject | Vedr: What does """ means in python? |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.6570.1391925165.18130.python-list@python.org> (permalink) |
Gisle V.
"Computers are useless. They can only give answers" --Pablo Picasso
Chris Angelico <rosuav@gmail.com> wrote:
> For SQL? Ignore the extra spaces, it's a free-form language. The only
> reason to consider dedent() would be if you're worried about how your
> log files will look. The actual execution of SQL won't be bothered by
> newlines and spaces/tabs.
Regrading handy uses of ''', you learned me one trick when using Python
code in a Windows .bat file:
rem = '''
@echo off
echo This is
batch
\python32\python %0
echo All done
exit /b
rem '''
import
sys
print("This is Python")
for i,p in
enumerate(sys.path):
print('sys.path[%2d]: %s' % (i, p))
print("Python
done")
You'll have a variable in Python called 'rem' which contains all
your
batch code :) It exploits the fact that 'rem' makes a
one-line
comment, but the triple quotes go across multiple lines.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
What does """ means in python? Sam <lightaiyee@gmail.com> - 2014-02-08 06:02 -0800
Re: What does """ means in python? Roy Smith <roy@panix.com> - 2014-02-08 09:08 -0500
Re: What does """ means in python? Walter Hurry <walterhurry@gmail.com> - 2014-02-08 19:55 +0000
Re: What does """ means in python? Chris Angelico <rosuav@gmail.com> - 2014-02-09 08:40 +1100
Vedr: What does """ means in python? Gisle Vanem <gvanem@yahoo.no> - 2014-02-09 05:49 +0000
Re: Vedr: What does """ means in python? Duncan Booth <duncan.booth@invalid.invalid> - 2014-02-10 10:50 +0000
csiph-web