Skip to content

Instantly share code, notes, and snippets.

View KenoLeon's full-sized avatar

Keno Leon KenoLeon

View GitHub Profile
@KenoLeon
KenoLeon / pyScript_Imports.html
Last active May 3, 2022 20:12
Imports in PyScript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
<title>Imports in Pyscript, Numpy,Random in the Browser !</title>
<py-env>
@KenoLeon
KenoLeon / Pyscript_Fibonacci.html
Last active May 3, 2022 00:58
Fibonacci in pyscript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fibs be cool yo !</title>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
</head>
@KenoLeon
KenoLeon / fib.py
Last active May 3, 2022 00:54
fibonaci python below number
# print fibonacci numbers
def fib(n):
a, b = 0, 1
while b < n:
print(b, end=' ')
a, b = b, a + b
print()
@KenoLeon
KenoLeon / HW_Pyscript.html
Created May 2, 2022 19:53
Hello world py-script
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello World</title>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
</head>
@KenoLeon
KenoLeon / HW.html
Created May 2, 2022 19:46
Hello wrold html 5 emmet
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello World</title>
</head>
<body>
Such Content Very Wow
@KenoLeon
KenoLeon / WIFI_Scanner_INtegration_Example_V2.py
Created April 27, 2022 00:39
WIFI Scanner Integration example V2 Medium Article @_k3no
"""WIFI SCANNER for OSX GUI Integration Example from a Medium Article by @_k3no
Should scan and return a list of networks and their strength via GUI.
"""
import PySimpleGUI as sg
import subprocess
import re
@KenoLeon
KenoLeon / Integration_V1.py
Created April 26, 2022 01:13
WIFI Scanner Integration V1
import PySimpleGUI as sg
import subprocess
import re
_VARS = {'Networks': [],
'NetworkStrength': []}
EDGE_OFFSET = 8 # offset from the left edge for first bar
@KenoLeon
KenoLeon / GUI_tests.py
Created April 25, 2022 01:05
GUI Tests before Integration
import PySimpleGUI as sg
_VARS = {'Networks': ['Network 01', 'Network 02', 'Network 03', 'Network 04'],
'NetworkStrength': ['-84', '-91', '-53', '-100']}
EDGE_OFFSET = 8 # offset from the left edge for first bar
GRAPH_SIZE = DATA_SIZE = (600, 600) # size in pixels
GLOBAL_FONT = ('Helvetica', 14)
sg.theme('DarkAmber')
@KenoLeon
KenoLeon / wifi_scanner_data.py
Created April 23, 2022 02:21
get wifi data from subprocess and parse it
import subprocess
import re
# pipe stdout from subprocess to a string
process = subprocess.run(["airport", "en0", "--scan"],
check=True,
stdout=subprocess.PIPE,
universal_newlines=True)
# Split string by rows
processRows = process.stdout.split("\n")
import subprocess
import re
# pipe stdout from subprocess to a string
process = subprocess.run(["airport", "en0", "--scan"],
check=True,
stdout=subprocess.PIPE,
universal_newlines=True)
# Split string by rows
processRows = process.stdout.split("\n")