ip

How to use any obtained variable from a function in other functions in Python classes?

How to use any obtained variable from a function in other functions in Python classes? Question: I am trying to use one variable obtained from one function in other function. However , it gives error. Let me explain it wih my code. class Uygulama(object): def __init__(self): self.araclar() self.refresh() self.gateway_find() def refresh(self): self.a, self.b = srp(Ether(dst="FF:FF:FF:FF:FF:FF") …

Total answers: 2

Getting rid of extra printing in subprocess Python

Getting rid of extra printing in subprocess Python Question: I am trying to print my ip address using subprocess.run() in Linux. So , i wrote the following code: ip=subprocess.run(["ifconfig | grep -w ‘inet’ | awk ‘{print $2}’ | head -n 1"],shell=True,) It gives me my Ip address "192.168.1.103" in terminal , but i wrote it …

Total answers: 1

How to access FastAPI backend from a different machine/IP on the same local network?

How to access FastAPI backend from a different machine/IP on the same local network? Question: Both the FastAPI backend and the Next.js frontend are running on localost. On the same computer, the frontend makes API calls using fetch without any issues. However, on a different computer on the same network, e.g., on 192.168.x.x, the frontend …

Total answers: 2

How are these values calculated in Python Scapy?

How are these values calculated in Python Scapy? Question: I am curious about the values of the chksum and how it is calculated. ###[ IP ]### chksum = 0x95d3 ###[ UDP ]### chksum = 0x1a77 What is chksum=0x1a77 and chksum=0x95d3 how are they calculated in python Scapy? I need some explanation for these values. Asked …

Total answers: 1

Getting different IP addresses in scapy

Getting different IP addresses in scapy Question: from scapy.all import * sniffdata = sniff(count=10) sniffdata.summary() Output: Ether / IP / TCP 192.168.1.35:51642 > 20.42.65.85:https A / Raw Ether / IP / TCP 34.233.187.197:https > 192.168.1.35:51654 A / Raw Ether / IP / TCP 34.233.187.197:https > 192.168.1.35:51654 A / Raw Scapy is not working, it gives …

Total answers: 1

How can I send my file to another network?

How can I send my file to another network? Question: I can’t find a way to send a file over to another network. I have a file that I want to send to a different computer which is not on the same network. Right now I’m using a server and a client side. Here is …

Total answers: 1

How to get python code to keep running even if error occurs

How to get python code to keep running even if error occurs Question: the code that i currently use from pythonping import ping import random while 1: d1 = (random.randrange(1,255)) d2 = (random.randrange(1,255)) d3 = (random.randrange(1,255)) d4 = (random.randrange(1,255)) h = f'{d1}.{d2}.{d3}.{d4}’ ping(h, verbose=True) but when an error happens(below) it ends the program how can …

Total answers: 1

How can i connect two computers with python socket?

How can i connect two computers with python socket? Question: im new here! I have a problem with connection between two computers connected with different wi-fi’s. After about 20 seconds i get information that connection can’t be done. There is my code: SERVER: from socket import * lista = [‘computer’] s = socket(AF_INET, SOCK_STREAM) port …

Total answers: 2

Detect if IPv6 is supported, OS-agnostic, no external program?

Detect if IPv6 is supported, OS-agnostic, no external program? Question: Is there a way to detect if IPv6 is supported on a system, without using external programs and in an OS-agnostic way? I’ve searched high and low, here and throughout the Internet, it seems nearly every offered solution relies either on accessing /proc (not available …

Total answers: 3