Skip to content

Commit

Permalink
setting up a notbook for random testing of funktions and stuff
Browse files Browse the repository at this point in the history
because the requirements have changed you need to run the 
installAllDependencies Script by pulling it into the commandline
(your venv has to be active      green (venv) should show up in the beginning of the line
  • Loading branch information
walkerdustin committed Mar 26, 2021
1 parent de5c479 commit b802dba
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 0 deletions.
Binary file modified requirements.txt
Binary file not shown.
114 changes: 114 additions & 0 deletions src/test/test.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.2-final"
},
"orig_nbformat": 2,
"kernelspec": {
"name": "python3",
"display_name": "Python 3.9.2 64-bit ('venv')",
"metadata": {
"interpreter": {
"hash": "ff356282b251f006c0c08831b579e99ab02398858bd553c1c7eef07b8e012e56"
}
}
}
},
"nbformat": 4,
"nbformat_minor": 2,
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"IP: 192.168.32.16\nMask: 255.255.0.0\nSubnet: 192.168.0.0\nHost: 0.0.32.16\nBroadcast: 192.168.255.255\n"
]
}
],
"source": [
"import ipaddress\n",
"\n",
"IP = '192.168.32.16'\n",
"MASK = '255.255.0.0'\n",
"\n",
"host = ipaddress.IPv4Address(IP)\n",
"net = ipaddress.IPv4Network(IP + '/' + MASK, False)\n",
"print('IP:', IP)\n",
"print('Mask:', MASK)\n",
"print('Subnet:', ipaddress.IPv4Address(int(host) & int(net.netmask)))\n",
"print('Host:', ipaddress.IPv4Address(int(host) & int(net.hostmask)))\n",
"print('Broadcast:', net.broadcast_address)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"import socket"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"'192.168.178.80'"
]
},
"metadata": {},
"execution_count": 6
}
],
"source": [
"socket.gethostbyname(socket.gethostname())"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"IPv4Address('192.168.32.16')"
]
},
"metadata": {},
"execution_count": 7
}
],
"source": [
"host"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
]
}

0 comments on commit b802dba

Please sign in to comment.