mirror of
https://github.com/Marsh232/Telegram-IP-CALC.git
synced 2026-10-26 05:09:58 +00:00
Добавил комменты и пару строчек
This commit is contained in:
1 parent
312de56373
commit
58bc31adee
2 files changed
+29
-4
No files matched your search
Generated
+24
-1
@@ -31,9 +31,31 @@
|
|||||||
"node.js.detected.package.eslint": "true",
|
"node.js.detected.package.eslint": "true",
|
||||||
"node.js.detected.package.tslint": "true",
|
"node.js.detected.package.tslint": "true",
|
||||||
"node.js.selected.package.eslint": "(autodetect)",
|
"node.js.selected.package.eslint": "(autodetect)",
|
||||||
"node.js.selected.package.tslint": "(autodetect)"
|
"node.js.selected.package.tslint": "(autodetect)",
|
||||||
|
"settings.editor.selected.configurable": "preferences.lookFeel"
|
||||||
}
|
}
|
||||||
}]]></component>
|
}]]></component>
|
||||||
|
<component name="RunManager">
|
||||||
|
<configuration name="main" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
|
||||||
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
|
<option name="PARENT_ENVS" value="true" />
|
||||||
|
<option name="SDK_HOME" value="C:\Users\truno\AppData\Local\Programs\Python\Python310\python.exe" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||||
|
<option name="IS_MODULE_SDK" value="false" />
|
||||||
|
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||||
|
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||||
|
<module name="" />
|
||||||
|
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||||
|
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/main.py" />
|
||||||
|
<option name="PARAMETERS" value="" />
|
||||||
|
<option name="SHOW_COMMAND_LINE" value="true" />
|
||||||
|
<option name="EMULATE_TERMINAL" value="false" />
|
||||||
|
<option name="MODULE_MODE" value="false" />
|
||||||
|
<option name="REDIRECT_INPUT" value="false" />
|
||||||
|
<option name="INPUT_FILE" value="" />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||||
<component name="TaskManager">
|
<component name="TaskManager">
|
||||||
<task active="true" id="Default" summary="Default task">
|
<task active="true" id="Default" summary="Default task">
|
||||||
@@ -44,6 +66,7 @@
|
|||||||
<updated>1662478847997</updated>
|
<updated>1662478847997</updated>
|
||||||
<workItem from="1662478877356" duration="1804000" />
|
<workItem from="1662478877356" duration="1804000" />
|
||||||
<workItem from="1662485900255" duration="690000" />
|
<workItem from="1662485900255" duration="690000" />
|
||||||
|
<workItem from="1662496666820" duration="3601000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@@ -2,8 +2,10 @@ import ipaddress
|
|||||||
|
|
||||||
ip = input('Введите ip: ') # Пользователь вводит ip
|
ip = input('Введите ip: ') # Пользователь вводит ip
|
||||||
|
|
||||||
list_ip = ip.split('/')
|
list_ip = ip.split('/') # Разделяет вводимый ip на часть с маской, и без
|
||||||
ipv4 = ipaddress.ip_address(list_ip[0])
|
ipv4 = ipaddress.ip_address(list_ip[0])
|
||||||
print(ipv4)
|
print('Ваш ip адрес:', ip) # Выводит например "Ваш ip адрес: 192.168.10.128/24"
|
||||||
net = ipaddress.ip_network('192.168.10.0/24') # В функцию кладётся сетевая часть ip, без хостовой части
|
|
||||||
|
net = ipaddress.ip_network(ip, strict=False) # В функцию кладётся сетевая часть ip, без хостовой части
|
||||||
|
print(net)
|
||||||
print(net.netmask)
|
print(net.netmask)
|
||||||
Reference in new issue
Block a user