This question is actually threefold. I have questions mostly regarding Python and the installation process. I also have questions on how I can find documentation for a module that is hosted on GitHub.
I am currently running Ubuntu 14.04. Does this version of Ubuntu come with Python 2.x or 3.x already installed? I forgot to check this before moving forward with my own install of Python 2.7. I performed the install by downloading the tarball (is that what people call it?) from the Python website, unzipping it, and then running the make commands. Now I'm worried that I may have 2 installations of Python installed on my PC, but in two different directories. I'm not overly familiar with Ubuntu, so I don't know how to check if I unnecessarily installed Python when it was really there when I initially put Ubuntu onto my PC. Is this something I should be concerned about? And if so, what's the best way for me to get rid of the second installation?
My second question involves the
python-twitter module. I installed this via
sudo apt-get install python-twitter. I'm not sure if that was a valid approach, but I did see it come up on other posts on this forum. I am trying to do the Arduino Tweet-a-Pot and would like to understand the Python code that it uses. When I look at the
python-twitter page on GitHub, it appears that I can find documentation using the PyDoc command. However, if I run the commands they recommend, I see the following output on my terminal:
mike@BIGRED:~$ pydoc twitter.api no Python documentation found for 'twitter.api'
However, if I run
pydoc modules, I receive the following output:
mike@BIGRED:~$ pydoc modules Please wait a moment while I gather a list of all available modules... BaseHTTPServer array ihooks sgmllib Bastion ast imaplib sha CDROM asynchat imghdr shelve CGIHTTPServer asyncore imp shlex Canvas atexit importlib shutil ConfigParser audiodev imputil signal Cookie audioop inspect site DLFCN base64 io smtpd Dialog bdb itertools smtplib DocXMLRPCServer binascii json sndhdr FileDialog binhex keyword socket FixTk bisect lib2to3 spwd HTMLParser bsddb linecache sqlite3 IN bz2 linuxaudiodev sre MimeWriter cPickle locale sre_compile Queue cProfile logging sre_constants ScrolledText cStringIO macpath sre_parse SimpleDialog calendar macurl2path ssl SimpleHTTPServer cgi mailbox stat SimpleXMLRPCServer cgitb mailcap statvfs SocketServer chunk markupbase string StringIO cmath marshal stringold TYPES cmd math stringprep Tix code md5 strop Tkconstants codecs mhlib struct Tkdnd codeop mimetools subprocess Tkinter collections mimetypes sunau UserDict colorsys mimify sunaudio UserList commands mmap symbol UserString compileall modulefinder symtable _LWPCookieJar compiler multifile sys _MozillaCookieJar contextlib multiprocessing sysconfig __builtin__ cookielib mutex syslog __future__ copy netrc tabnanny _abcoll copy_reg new tarfile _ast crypt nis telnetlib _bisect csv nntplib tempfile _codecs ctypes ntpath termios _codecs_cn curses nturl2path test _codecs_hk datetime numbers textwrap _codecs_iso2022 dbhash opcode this _codecs_jp dbm operator thread _codecs_kr decimal optparse threading _codecs_tw difflib os time _collections dircache os2emxpath timeit _csv dis ossaudiodev tkColorChooser _ctypes distutils parser tkCommonDialog _ctypes_test doctest pdb tkFileDialog _curses dumbdbm pickle tkFont _curses_panel dummy_thread pickletools tkMessageBox _elementtree dummy_threading pipes tkSimpleDialog _functools email pkgutil toaiff _hashlib encodings platform token _heapq ensurepip plistlib tokenize _hotshot errno popen2 trace _io exceptions poplib traceback _json fcntl posix ttk _locale filecmp posixfile tty _lsprof fileinput posixpath turtle _multibytecodec fnmatch pprint types _multiprocessing formatter profile unicodedata _osx_support fpformat pstats unittest _pyio fractions pty urllib _random ftplib pwd urllib2 _socket functools py_compile urlparse _sqlite3 future_builtins pyclbr user _sre gc pydoc uu _ssl gdbm pydoc_data uuid _strptime genericpath pyexpat warnings _struct getopt quopri wave _symtable getpass random weakref _sysconfigdata gettext re webbrowser _testcapi glob readline whichdb _threading_local grp repr wsgiref _tkinter gzip resource xdrlib _warnings hashlib rexec xml _weakref heapq rfc822 xmllib _weakrefset hmac rlcompleter xmlrpclib abc hotshot robotparser xxsubtype aifc htmlentitydefs runpy zipfile antigravity htmllib sched zipimport anydbm httplib select zlib argparse idlelib sets
As you can see, PyDoc works, it just doesn't seem to work for the Twitter module. And I know that the
python-twitter was indeed installed correctly because the code works with my Arduino. How can I correct this? I'd like to have the PyDoc functionality work correctly for this and any future modules I plan to install.
I should mention that I am try to teach myself programming and only have a fair amount of exposure of Python. I definitely still have much to learn. My last question is a simple one: How do I find documentation for the
python-twitter module on GitHub? PyDoc doesn't seem to work, but I believe there should still be something on GitHub that would include the same information: what classes there are, the different methods available for each class, etc. Is it somewhere in the source code? Where on the GitHub page do I find this sort of information?
Any clarification on any of this would be greatly appreciated!