'Kali Linux Vscode Python - Operation not permitted run python file with internal terminal

Hy guys, i am trying to use vscode in kali linux. But I ran into a problem. The moment I start the python file from the play symbol in the terminal it gives me a permission error.

But if I boot from the terminal using sudo python main.py it works fine.

Would you know how to help me fix this problem? i am used to launch with play, i find it annoying to type in the terminal every time.

Screen error

I also tried the solution found on the internet of sudo code --user-data-dir = "~ / .vscode-root" my/path, but it doesn't solve the problem.

the code to execute:

import socket
import struct 
import binascii

s = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(0x0800))
while True:
    print (s.recvfrom(2048))


Solution 1:[1]

Try to use :

sudo code

in the terminal

If it doesn't work try to remove it and install it again.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ahmed Abdallah