From b802dba3a77f7d8f68a966dc0d4ba6e123837ead Mon Sep 17 00:00:00 2001 From: Dustin_dusTir Date: Fri, 26 Mar 2021 20:55:44 +0100 Subject: [PATCH] setting up a notbook for random testing of funktions and stuff 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 --- requirements.txt | Bin 302 -> 988 bytes src/test/test.ipynb | 114 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 src/test/test.ipynb diff --git a/requirements.txt b/requirements.txt index 007878a8738d4239c925702be53b4e5d61eba6aa..9ff673182a711f1101f5bce0f95288b15307eea5 100644 GIT binary patch literal 988 zcmZvb-A=+#5QO*I#7C*26x18v!B;4>L7=S_O89wr^_yJ|)o93p(4C!~ojLvbENyRt z?d;vwR@n=msXf@7liR)B*}_U&+LlvV!$*h-RiP%1Skl{Yb|6|#Ld-zS98pvP3LWU}F zNY&i)iRmp|(xMcV`j+n4w*aXQd8C=I=v;9h!jW)ZuK%2TcF&Sysz#onSzblb87Y+f zt8YnakH2h3)O1!*QN2J$X!-ExQ}2}4!jAb-3QU;7xuGXzHm}xEb%DIHW+gA!Zy&MmtsRL{g!>Ba@@gQ6i~V Iw=E_64PBUz*Z=?k delta 33 pcmcb^zK&^v(nJ@f$xMtglcz9-Os->+nJmXFH@SvcW%2=L8347C3KReU diff --git a/src/test/test.ipynb b/src/test/test.ipynb new file mode 100644 index 0000000..483d9d3 --- /dev/null +++ b/src/test/test.ipynb @@ -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": [] + } + ] +} \ No newline at end of file