Skip to content

Instantly share code, notes, and snippets.

@dalmago
dalmago / my_sample_py_file.py
Created July 24, 2020 22:31
Python file used to test debugpy when called from an embedded application
import sys
import os
import time
DEBUG_PORT = 5678
def my_sample_function():
attach_debugger()
print("My code in here")
@dalmago
dalmago / python_c_api_call.cpp
Created July 24, 2020 22:29
Uses the Python C-API to load a file called "my_sample_py_file.py" and runs its "my_sample_function" function
#include <iostream>
#include <filesystem>
#include <Windows.h>
#include <Python.h>
int main(int argc, char** argv) {
Py_SetPythonHome(L"C:\\python36");
Py_SetProgramName(L"my_test_program");
# -*- coding: iso-8859-1 -*-
"""
Created on Sat May 24 17:13:35 2014
@author: iury
"""
import numpy as np
matNucleo = [1, 0.4]
@dalmago
dalmago / fluidos.py
Last active August 29, 2015 14:01
Plot the graph height X pressure two fluids
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#"THE BEER-WARE LICENSE" (Revision 42):
#
#<matheusdalmago10@hotmail.com> wrote this file. As long as you retain this
#notice you can do whatever you want with this stuff. If we meet some day,
#and you think this stuff is worth it, you can buy me a beer in return.
#
#Created: 2014-05-13