The use of __main__.py
to create executables
myprojectfolder/
|_ __main__.py
|_ __init__.py
Being __main__.py
:
print("Hello")
#define COBJMACROS | |
#define INITGUID | |
#include <intrin.h> | |
#include <windows.h> | |
#include <d3d11.h> | |
#include <gl/GL.h> | |
#include "glext.h" // https://www.opengl.org/registry/api/GL/glext.h | |
#include "wglext.h" // https://www.opengl.org/registry/api/GL/wglext.h |
#define BINKGL_LIST \ | |
/* ret, name, params */ \ | |
GLE(void, LinkProgram, GLuint program) \ | |
GLE(void, GetProgramiv, GLuint program, GLenum pname, GLint *params) \ | |
GLE(GLuint, CreateShader, GLenum type) \ | |
GLE(void, ShaderSource, GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length) \ | |
GLE(void, CompileShader, GLuint shader) \ | |
GLE(void, GetShaderiv, GLuint shader, GLenum pname, GLint *params) \ | |
GLE(void, GetShaderInfoLog, GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog) \ | |
GLE(void, DeleteShader, GLuint shader) \ |
#include "mu.h" | |
#define _CRT_SECURE_NO_WARNINGS | |
#include <malloc.h> | |
#define _USE_MATH_DEFINES | |
#include <math.h> | |
#define _NO_CRT_STDIO_INLINE | |
#include <stdio.h> | |
#include <stdarg.h> | |
#define NO_STRICT |
# This is a simplified version of a more complex problem I'm trying to solve. | |
# search() seems to have the desired behavior (see docstring), but seems a bit clumsy. | |
# Is there a more pythonic way to do this? | |
def search(my_list, my_dict, search_term): | |
"""Example Output: | |
--- | |
>>> l = [1, 2, 3, 4] | |
>>> d = {1: "foo", 2: "bar", 3: "baz", 4: "baz"} | |
>>> search(l, d, "borkborkbork") |
'''Demonstrate the "prime number conspiracy" as described at | |
https://www.quantamagazine.org/20160313-mathematicians-discover-prime-conspiracy/ | |
"Among the first billion prime numbers, for instance, a prime ending in | |
9 is almost 65 percent more likely to be followed by a prime ending in 1 | |
than another prime ending in 9. In a paper posted online today, Kannan | |
Soundararajan and Robert Lemke Oliver of Stanford University present | |
both numerical and theoretical evidence that prime numbers repel other | |
would-be primes that end in the same digit, and have varied | |
predilections for being followed by primes ending in the other possibl |
The use of __main__.py
to create executables
myprojectfolder/
|_ __main__.py
|_ __init__.py
Being __main__.py
:
print("Hello")
/** | |
* Advanced Window Snap | |
* Snaps the Active Window to one of nine different window positions. | |
* | |
* @author Andrew Moore <[email protected]> | |
* @version 1.0 | |
*/ | |
/** | |
* SnapActiveWindow resizes and moves (snaps) the active window to a given position. |
#!/bin/bash | |
if [ $# -eq 1 ] ; then | |
path=$1 | |
else | |
clipboard=$(xclip -selection clipboard -o) | |
if [ $(<<<$clipboard grep -P "^http") ] ; then | |
path=$clipboard | |
else | |
if [ -t 1 ] ; then |
# Generate PDFs from the Markdown source files | |
# | |
# In order to use this makefile, you need some tools: | |
# - GNU make | |
# - Pandoc | |
# - LuaLaTeX | |
# - DejaVu Sans fonts | |
# Directory containing source (Markdown) files | |
source := src |
me: | |
@true | |
a: | |
@true | |
sandwich: | |
@[ "$$(id -u)" -eq 0 ] && echo "Okay." || echo "What? Make it yourself." | |
.PHONY: me a sandwich |