Skip to content

Commit d325554

Browse files
committed
* Fix .gitignore issue
* Add pypi package 🚀
1 parent a612e97 commit d325554

20 files changed

+2274
-0
lines changed

.gitignore

100755100644
File mode changed.

.npmignore

100755100644
File mode changed.

LICENSE

100755100644
File mode changed.

README.md

100755100644
File mode changed.

images/tic-tac-toe/after_board_initialized.png

100755100644
File mode changed.

images/tic-tac-toe/after_row_initialized.png

100755100644
File mode changed.

mixed_tabs_and_spaces.py

100755100644
File mode changed.

package.json

100755100644
File mode changed.

wtfpython

100755100644
File mode changed.
1.14 KB
Binary file not shown.

wtfpython-pypi/content.md

+2,190
Large diffs are not rendered by default.

wtfpython-pypi/main.pyc

1.39 KB
Binary file not shown.

wtfpython-pypi/setup.py

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
from setuptools import setup, find_packages
2+
3+
if __name__ == "__main__":
4+
setup(name='wtfpython',
5+
version='0.1.3',
6+
description='What the f*ck Python!',
7+
author="Satwik Kansal",
8+
maintainer="Satwik Kansal",
9+
maintainer_email='satwikkansal@gmail.com',
10+
url='https://github.com/satwikkansal/wtfpython',
11+
platforms='any',
12+
license="WTFPL 2.0",
13+
long_description="An interesting collection of subtle & tricky Python Snippets"
14+
" and features.",
15+
keywords="wtfpython gotchas snippets tricky",
16+
packages=find_packages(),
17+
entry_points = {
18+
'console_scripts': ['wtfpython = wtf_python.main:load_and_read']
19+
},
20+
classifiers=[
21+
'Development Status :: 4 - Beta',
22+
23+
'Environment :: Console',
24+
'Environment :: MacOS X',
25+
'Environment :: Win32 (MS Windows)',
26+
27+
'Intended Audience :: Science/Research',
28+
'Intended Audience :: Developers',
29+
'Intended Audience :: Education',
30+
'Intended Audience :: End Users/Desktop',
31+
32+
'Operating System :: OS Independent',
33+
34+
'Programming Language :: Python :: 3',
35+
'Programming Language :: Python :: 2',
36+
37+
'Topic :: Documentation',
38+
'Topic :: Education',
39+
'Topic :: Scientific/Engineering',
40+
'Topic :: Software Development'],
41+
)

wtfpython-pypi/wtf_python/__init__.py

Whitespace-only changes.
178 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.

wtfpython-pypi/wtf_python/main.py

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import pydoc
2+
try:
3+
from urllib.request import urlretrieve
4+
except ImportError:
5+
from urllib import urlretrieve
6+
7+
url = ("https://raw.githubusercontent.com/satwikkansal/"
8+
"wtfpython/master/README.md")
9+
file_name = "content.md"
10+
11+
12+
def fetch_updated_doc():
13+
try:
14+
print("Fetching the latest version...")
15+
urlretrieve(url, file_name)
16+
print("Done!")
17+
except Exception as e:
18+
print(e)
19+
print("Uh oh, failed to check for the latest version, "
20+
"using the local version for now.")
21+
22+
23+
def render_doc():
24+
with open(file_name, 'r') as f:
25+
content = f.read()
26+
pydoc.pager(content)
27+
28+
29+
def load_and_read():
30+
fetch_updated_doc()
31+
render_doc()
32+
33+
34+
if __name__== "__main__":
35+
load_and_read()

wtfpython-pypi/wtf_python/main.pyc

1.43 KB
Binary file not shown.

wtfpython-pypi/wtfpython

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env python3
2+
3+
import sys
4+
5+
from wtf_python.main import load_and_read
6+
7+
if __name__ == "__main__":
8+
sys.exit(load_and_read())

0 commit comments

Comments
 (0)