pandoc -f docx -t markdown -o my_example_output.md my_example_input.docx
"""Nice Title Case Function plus quick demo""" | |
def nice_title_case(str_in: str) -> str: | |
"""Converts a string to Title Case, with conventional exceptions which | |
need not be capitalized if they are not the first word in the title. | |
Reference: https://en.wikipedia.org/wiki/Title_case | |
*Note*: Prepositional rules are not strictly enforced |
http_bad_codes = { | |
"400": "Bad Request", | |
"401": "Unauthorized", | |
"402": "Payment Required", | |
"403": "Forbidden", | |
"404": "Not Found", | |
"405": "Method Not Allowed", | |
"406": "Not Acceptable", | |
"407": "Proxy Authentication Required", | |
"408": "Request Timeout", |
- Before beginning, you should have a version of pip installed. If you don't, it is recommended you install it universally via the Terminal:
sudo easy_install pip
- Once you do, install virtualenvwrapper:
sudo pip install virtualenvwrapper
. More information can be found in Read the Docs - Change into the directory where your new project is; e.g.,
cd ~/Documents/Repos/my_new_project
- Create your new environment in this directory, automatically giving it the name of the current directory:
thisdir=${PWD##*/};mkvirtualenv -a . -r requirements.txt $thisdir
- To make sure you remember what your virtual environment is named (and, indeed - all you have created), execute
lsvirtualenv
which lists all virtual environments.
Sphinx is a documentation generator that is the de facto standard for Python projects. The official documentation can be a bit daunting as it includes so many options, it's hard to know where to start.
Note: This Gist was updated on 04/04/2019 to accomodate a newer version of Sphinx, as well as Python 3.7. YMMV!
This document is written with the following presuppositions:
- You want to leverage the DocStrings in your Python code.
- You'd rather write your DocStrings in Google-style instead of a more awkward reStructuredText format for calling documentation.
Testing reST Code Blocks
Code Block (Python):
jnk_instance = "http://jenkins.jarvis.cylancecorp.com:8080/"
jnk_user = 'myusername'
jnk_pass = 'mypassword'
my_test_run = JenkinsJobTestRunRetrieval(jnk_instance, jnk_user, jnk_pass)
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Determine whether integer is a prime or not. | |
- *Module*: is_prime | |
- *Platform*: Unix, Windows | |
- *Author*: [mailto:[email protected]?subject=About is_prime.py|Greg Meece] | |
""" |
# Starting with a generic "Open Browser to Page" keyword, following that are examples for: | |
# Google Chrome | |
# PhantomJS | |
# | |
# Assumed global or suite variables: | |
# ${browser} - the browser you want to use in testing | |
# ${delay} - the "speed" that Selenium verbs execute at | |
# ${user_agent} - User Agent string like: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36 | |
# | |
# Note: The documentation is written with the libdoc utility in mind. See: |
This is a quick "how to run" if you already have everything Robot Framework-related installed. This Gist might be especially handy for those you either just starting out, or if you've inherited a code-base from someone else.
The following assumes you have a terminal (CMD or PowerShell on Windows, Terminal on Mac or Linux) and aren't afraid to use it.
cd
into the root directory of the Robot Framework files and test cases; we'll assume all test cases are somewhere within a directory namedtest_cases
.