Skip to content

Instantly share code, notes, and snippets.

using PyCall
function pyeval_impl(source, globals, locals, lnn, mode)
parse = pyimport("ast")[:parse]
increment_lineno = pyimport("ast")[:increment_lineno]
eval = pyimport("builtins")[:eval]
compile = pyimport("builtins")[:compile]
if lnn === nothing
filename = "<PyCall>"
from ctypes import c_char_p, c_void_p
import ctypes
import os
import subprocess
def juliainfo():
out = subprocess.check_output(
["julia", "-e", """
using Libdl
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
#=
exec julia --color=yes --startup-file=no -e "include(popfirst!(ARGS))" \
"${BASH_SOURCE[0]}" "$@"
=#
@show ARGS # put any Julia code here
#!/bin/bash
# -*- mode: julia -*-
#=
exec julia --color=yes --startup-file=no -e "include(popfirst!(ARGS))" \
"${BASH_SOURCE[0]}" "$@"
=#
@show ARGS # put any Julia code here
@tkf
tkf / stacktrace
Created September 28, 2018 05:01
signal (11): Segmentation fault
in expression starting at no file:0
jl_compile_linfo at /buildworker/worker/package_linux64/build/src/codegen.cpp:1191
emit_invoke at /buildworker/worker/package_linux64/build/src/codegen.cpp:3094
emit_expr at /buildworker/worker/package_linux64/build/src/codegen.cpp:3893
emit_ssaval_assign at /buildworker/worker/package_linux64/build/src/codegen.cpp:3615
emit_stmtpos at /buildworker/worker/package_linux64/build/src/codegen.cpp:3801 [inlined]
emit_function at /buildworker/worker/package_linux64/build/src/codegen.cpp:6254
jl_compile_linfo at /buildworker/worker/package_linux64/build/src/codegen.cpp:1159
emit_invoke at /buildworker/worker/package_linux64/build/src/codegen.cpp:3094
@tkf
tkf / .gitignore
Last active October 25, 2018 06:18
venv
@tkf
tkf / .gitignore
Last active March 21, 2023 23:14
A script to locate libpython associated with the given Python executable.
*.pyc
.pytest_cache
from ctypes import c_char_p, c_void_p
import ctypes
import os
import subprocess
def juliainfo():
out = subprocess.check_output(
["julia", "-e", """
using Libdl
from contextlib import contextmanager
import os
import signal
import threading
import time
from julia.core import Julia
@contextmanager