Mercurial > hg > config
annotate python/pastebin.py @ 694:ebca6d85213a
File "/usr/lib/python3/dist-packages/IPython/config/__init__.py", line 16, in <module>
from .application import *
File "/usr/lib/python3/dist-packages/IPython/config/application.py", line 31, in <module>
from IPython.config.configurable import SingletonConfigurable
File "/usr/lib/python3/dist-packages/IPython/config/configurable.py", line 33, in <module>
from IPython.utils.text import indent, wrap_paragraphs
File "/usr/lib/python3/dist-packages/IPython/utils/text.py", line 28, in <module>
from IPython.external.path import path
File "/usr/lib/python3/dist-packages/IPython/external/path/__init__.py", line 2, in <module>
from path import *
File "/home/jhammel/python/path.py", line 25
print root(path)
^
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Wed, 09 Jul 2014 16:26:49 -0700 |
parents | 6b8573a62cd3 |
children |
rev | line source |
---|---|
37
6b8573a62cd3
add a python pastebin script for mozilla (pastebinit strangely doesnt seem to work at all)
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
1 #!/usr/bin/env python |
6b8573a62cd3
add a python pastebin script for mozilla (pastebinit strangely doesnt seem to work at all)
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
2 |
6b8573a62cd3
add a python pastebin script for mozilla (pastebinit strangely doesnt seem to work at all)
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
3 import sys |
6b8573a62cd3
add a python pastebin script for mozilla (pastebinit strangely doesnt seem to work at all)
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
4 import urllib2 |
6b8573a62cd3
add a python pastebin script for mozilla (pastebinit strangely doesnt seem to work at all)
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
5 import urllib |
6b8573a62cd3
add a python pastebin script for mozilla (pastebinit strangely doesnt seem to work at all)
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
6 content = sys.stdin.read() |
6b8573a62cd3
add a python pastebin script for mozilla (pastebinit strangely doesnt seem to work at all)
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
7 url = 'http://pastebin.com/api_public.php' |
6b8573a62cd3
add a python pastebin script for mozilla (pastebinit strangely doesnt seem to work at all)
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
8 data = dict(paste_code=content, paste_subdomain='mozilla') |
6b8573a62cd3
add a python pastebin script for mozilla (pastebinit strangely doesnt seem to work at all)
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
9 values = urllib.urlencode(data) |
6b8573a62cd3
add a python pastebin script for mozilla (pastebinit strangely doesnt seem to work at all)
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
10 req = urllib2.Request(url, values) |
6b8573a62cd3
add a python pastebin script for mozilla (pastebinit strangely doesnt seem to work at all)
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
11 response = urllib2.urlopen(req) |
6b8573a62cd3
add a python pastebin script for mozilla (pastebinit strangely doesnt seem to work at all)
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
12 the_page = response.read() |
6b8573a62cd3
add a python pastebin script for mozilla (pastebinit strangely doesnt seem to work at all)
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
13 |
6b8573a62cd3
add a python pastebin script for mozilla (pastebinit strangely doesnt seem to work at all)
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
14 print the_page |