-2
  File "C:\Users\Dk\Desktop\New folder\DDos.py", line 18, in <module>
    host=raw_input(":" )
NameError: name 'raw_input' is not defined

I get this error when I run this code:

print ("DDoS mode loaded")
print ("python script ")
host=raw_input(":" )
port=input(":" )
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Anniket
  • 7
  • 4
  • 1
    If you are using Python3 replace `raw_input()` with `input()` – techytushar Dec 27 '20 at 07:49
  • 1
    Just be warned that if the script is in Python 2 there are probably many other things in it that are not compatible with Python 3. See if you Can find a more up-to date version. I can not recommend that you switch to using Python 2. It has been obsolete for years and reached end-of-life a year ago, so it is no longer supported. – BoarGules Dec 27 '20 at 08:00
  • try installing python2 for it to work unchanged – AmaanK Dec 27 '20 at 08:05
  • I'd not trust that script especially if you cannot understand the code. Best to just delete it. –  Dec 27 '20 at 08:49
  • Does this answer your question? [How do I use raw\_input in Python 3](https://stackoverflow.com/questions/954834/how-do-i-use-raw-input-in-python-3) – Tomerikoo Jan 19 '21 at 15:50

1 Answers1

1

raw_input in Python 2.x is replaced by input in Python 3.x.

Try using input instead of raw_input.

If you regularly work with Python 2.x, you might want to look into the Python 2 and 3 compatiblity library named six. This will help you develop code that has lesser compatibility issues. Official docs for six

stuckoverflow
  • 625
  • 2
  • 7
  • 23