Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # IPython log file
- get_ipython().magic(u'cd Python/')
- get_ipython().magic(u'logstart')
- str.capitalize()
- import string_capwords
- s
- from string_capwords import *
- s
- string.capwords(s)
- string.capitalize(s)
- s
- string.capwords(s)
- string.ascii_letters(s)
- string.atof(s)
- string.aatoi(s)
- string.atoi(s)
- string.atol(s)
- string.capitalize(s)
- string.capwords(s)
- string.digits(s)
- string.expandtabs(s)
- string.count(s)
- str.decode(s)
- str.encode(s)
- str.endswith(s)
- str.find(s)
- str.find((s)z)
- str.find(s) z
- str.find(s[z])
- str.find(z[s])
- import string
- str.find(z) in s
- 'z' in s
- str.format(s)
- "The sum of 1 + 2 is {0}".format(1+2)
- str.index(s)
- str.isalpha(s)
- str.isupper(s)
- str.lstrip(s)
- s.lstrip(T,q,b)
- ' spacious '.lstrip()
- 'www.altsci.com'.lstrip('cmowz.')
- 'www.altsci.com'.lstrip('w.')
- 'www.altsci.com'.lstrip('.c')
- 'www.altsci.com'.lstrip('.com')
- 'www.altsci.com'.lstrip('com')
- 'www.altsci.com'.lstrip('com.')
- 'www.altsci.com'.lstrip('cm.')
- 'www.altsci.com'.lstrip('cmoz.')
- 'www.altsci.com'.lstrip('w.')
- 's'.rsplit(T)
- str.rsplit(s)
- d = "str.rsplit() Return a list of the words in the string, using sep as the delimiter string. if maxsplit is given, at most maxsplit splits are done, the rightmost ones. if sep is not specified or none, any whitespace string is a seperator. Except for splitting from from the right, rsplit() behaves like split() which is described in detail below."
- d
- str.rsplit(d)
- str.rsplit(d) | less
- import textwrap
- textwrap.fill.func_defaults()
- import textwrap
- from textwrap_example import sample_text
- dedented_text = textwrap.dedent(sample_text).strip()
- print textwrap.fill(dedented_text,
- initial_ident='',
- subsequent_indent=' ' * 4,
- )
- def test():
- # end first line with \ to avoid the empty line!
- s = '''\
- hello
- world
- '''
- print repr(s)
- print repr(dedent(s))
- s
- wrapper = TextWrapper(initial_indent="* ")
- wrapper = TextWrapper()
- wrapper.initial_indent = "* "
- import re
- pattern = 'this'
- text = 'Does this text match the pattern?'
- match = re.DEBUG(pattern, text)
- match = re.DOTALL(pattern, text)
- match = re.I(pattern, text)
- match = re.IGNORECASE(pattern, text)
- match = re.L(pattern, text)
- match = re.LOCALE(pattern, text)
- match = re.M(pattern, text)
- match = re.MULTILINE(pattern, text)
- match = re.S(pattern, text)
- match = re.Scanner(pattern, text)
- match = re.TEMPLATE(pattern, text)
- match = re.U(pattern, text)
- match = re.UNICODE(pattern, text)
- match = re.VERBOSE(pattern, text)
- match = re.X(pattern, text)
- match = compile(pattern, text)
- match = re.compile(pattern, text)
- match = re.copy_reg(pattern, text)
- match = re.error(pattern, text)
- match = re.escape(pattern, text)
- match = re.findall(pattern, text)
- s = match.start()
- match = re.search(pattern, text)
- s = match.start()
- e = match.end()
- print 'Found "%s"\nin "%s"\nfrom %d to %d ("%s")' % \
- (match.re.pattern, match.string, s, e, text[s:e])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement