Skip to content

Instantly share code, notes, and snippets.

bash-4.2# pip3.6 install cx_Oracle
Requirement already satisfied: cx_Oracle in /usr/lib64/python3.6/site-packages
bash-4.2# python3.6 app.py
Traceback (most recent call last):
File "app.py", line 1, in <module>
import cx_Oracle
ModuleNotFoundError: No module named 'cx_Oracle'
bash-4.2# python3.6 -m site
sys.path = [
'/syncro',
'/usr/local/lib/python36.zip',
'/usr/local/lib/python3.6',
'/usr/local/lib/python3.6/lib-dynload',
'/usr/local/lib/python3.6/site-packages',
]
USER_BASE: '/root/.local' (doesn't exist)
USER_SITE: '/root/.local/lib/python3.6/site-packages' (doesn't exist)
bash-4.2# head $(which pip3.6)
#!/usr/bin/python3.6
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==9.0.1','console_scripts','pip3.6'
__requires__ = 'pip==9.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
bash-4.2# which python3.6
/usr/local/bin/python3.6
bash-4.2# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/oracle/12.2/client64/bin
bash-4.2#
if resp.status_code == 200:
return resp
if resp.status_code == 404:
raise ModelNotFound(instance_type, self.model_names)
if resp.status_code == 500:
raise InternalInventoryError
@wklm
wklm / fac.ml
Created August 25, 2017 11:31
ocaml SO
let rec factorial (number : int) =
if number >= 1 then number * factorial (number - 1)
else 1
print_int (factorial 242);;
#use "topfind"
#thread
#require "core"
open Core
let rec factorial (number : int) =
if number >= 1 then number * factorial (number - 1)
else 1 ;;
@wklm
wklm / users.fs
Created September 13, 2017 19:45
module Program
open Chiron
open Suave
open Suave.Filters
open Suave.Json
open Suave.Operators
open Suave.Successful
type User =
@wklm
wklm / silicon-valley.fs
Last active September 14, 2017 10:34
Suave + Chrion nested jsons simple example
module Program
open Chiron
open Suave
open Suave.Filters
open Suave.Json
open Suave.Operators
open Suave.Successful
@wklm
wklm / fib.fs
Last active September 24, 2017 16:05
fibonacci async
let rec fib = function
| 0L | 1L as n -> n
| n -> (fib (n - 1L) + fib (n - 2L))
let memoize f =
let memo = ref Map.empty
fun arg ->
if Map.containsKey arg !memo then Map.find arg !memo
else
let result = f arg