Skip to content

Instantly share code, notes, and snippets.

View kujyp's full-sized avatar

kujyp kujyp

View GitHub Profile
@kujyp
kujyp / selenium_cheetsheets.py
Created October 22, 2018 01:20
selenium_cheetsheets.py
## Install chrome driver
# https://chromedriver.storage.googleapis.com/index.html?path=2.43/
def execute_with_message(statement):
print("Execute... {}".format(statement))
result = get_result_from_subprocess(statement)
print("Done message=[{}]".format(result))
def get_result_from_subprocess(cmd):
return (subprocess.check_output(cmd, shell=True)).decode("utf-8")
@kujyp
kujyp / string_cheetsheets.py
Created October 22, 2018 01:10
Python Cheat Sheets
# Does Python have a string 'contains' substring method?
# https://stackoverflow.com/questions/3437059/does-python-have-a-string-contains-substring-method
if "blah" not in somestring:
continue
#!/bin/bash
# Tested Environments : Centos6
start_script_on_background() {
echo "nohup ${1} > ${2} &"
nohup ${1} > ${2} &
}
get_script_path() {
SCRIPT=`readlink -e $0`