Python: invalid syntax

Question:

I have written a code and I am trying to run it with python version 3.9 and I am getting this error:

File "/home/user/hackthebox/blue/42315.py", line 928
def smb_send_file(smbConn, '/home/user/hackthebox/blue/eternalblue.exe', 'C', '/eternalblue.exe'):

This is the code:

Asked By: magedo

||

Answers:

You should have variables as arguments to a function. If you want to have variables with default values you just assign them on the function:

def smb_send_file(smbConn, path = '/home/user/hackthebox/blue/eternalblue.exe', lang = 'C', path2 = '/eternalblue.exe'):
Answered By: rfdf
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.