forked from mbrochh/vim-as-a-python-ide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.py
51 lines (38 loc) · 1.14 KB
/
utils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""Another file in our package."""
from urlparse import urljoin
def print_twitter_url():
"""We can lookup the urljoin method via ``<Leader>g``."""
print urljoin('http://www.twitter.com', 'mbrochh')
def try_to_import_from_demo_py():
"""Code completion makes importing easy!"""
print 'Try to import that method which starts with ``open_``.'
def set_breakpoint(arg1, arg2, data=None):
"""
We can set breakpoints via ``<Leader>b``.
Make sure you have ipython and ipdb installed::
pip install ipython
pip install ipdb
Then run your program from a new terminal window like so:
python demo.py
Use ``?`` to show all available commands and ``? <command>`` to show help
for a certain command.
"""
foo = 'bar'
result = arg1 + arg2
import ipdb; ipdb.set_trace() # BREAKPOINT
print 'Try to set a breakpoint before this statement.'
print 'Then run ``python demo.py``.'
import ipdb; ipdb.set_trace() # BREAKPOINT
print 'Good bye!'
# Nice commands to try in ipdb:
# ?
# help a
# a
# l
# next
# inspect data
# bt
# u
# s
# c
# exit