Python script and the socket syntax error

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Someone please help, not sure why this error is getting
./chat.py: line 6: syntax error near unexpected token `('
./chat.py: line 6: ` sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)'
Below is the code iam using
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ubuntu python socket python3
add a comment |Â
up vote
0
down vote
favorite
Someone please help, not sure why this error is getting
./chat.py: line 6: syntax error near unexpected token `('
./chat.py: line 6: ` sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)'
Below is the code iam using
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ubuntu python socket python3
4
This would be more on-topic on stackoverflow, but to get a useful answer either there or anywhere else, you'll need to show the full code you're trying to run. (I can tell it isn't, since the error refers toline 6, and yours only has one.) If the script is long, reduce it to the smallest one that you can, while still producing the error.
â ilkkachu
May 9 at 19:59
4
How do you run the script and what does the script's#!-line say? That error looks like it's from a shell interpreter, not Python.
â Kusalananda
May 9 at 20:01
Or it's a missing bracket in the code before the reported line.
â hoefling
May 10 at 7:58
Thanks all for your response, I have modified the code to run on python3.5, now the error got fixed. :)
â Jith
May 10 at 8:10
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Someone please help, not sure why this error is getting
./chat.py: line 6: syntax error near unexpected token `('
./chat.py: line 6: ` sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)'
Below is the code iam using
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ubuntu python socket python3
Someone please help, not sure why this error is getting
./chat.py: line 6: syntax error near unexpected token `('
./chat.py: line 6: ` sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)'
Below is the code iam using
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ubuntu python socket python3
edited May 9 at 21:07
Filipe Brandenburger
3,451521
3,451521
asked May 9 at 19:54
Jith
238
238
4
This would be more on-topic on stackoverflow, but to get a useful answer either there or anywhere else, you'll need to show the full code you're trying to run. (I can tell it isn't, since the error refers toline 6, and yours only has one.) If the script is long, reduce it to the smallest one that you can, while still producing the error.
â ilkkachu
May 9 at 19:59
4
How do you run the script and what does the script's#!-line say? That error looks like it's from a shell interpreter, not Python.
â Kusalananda
May 9 at 20:01
Or it's a missing bracket in the code before the reported line.
â hoefling
May 10 at 7:58
Thanks all for your response, I have modified the code to run on python3.5, now the error got fixed. :)
â Jith
May 10 at 8:10
add a comment |Â
4
This would be more on-topic on stackoverflow, but to get a useful answer either there or anywhere else, you'll need to show the full code you're trying to run. (I can tell it isn't, since the error refers toline 6, and yours only has one.) If the script is long, reduce it to the smallest one that you can, while still producing the error.
â ilkkachu
May 9 at 19:59
4
How do you run the script and what does the script's#!-line say? That error looks like it's from a shell interpreter, not Python.
â Kusalananda
May 9 at 20:01
Or it's a missing bracket in the code before the reported line.
â hoefling
May 10 at 7:58
Thanks all for your response, I have modified the code to run on python3.5, now the error got fixed. :)
â Jith
May 10 at 8:10
4
4
This would be more on-topic on stackoverflow, but to get a useful answer either there or anywhere else, you'll need to show the full code you're trying to run. (I can tell it isn't, since the error refers to
line 6, and yours only has one.) If the script is long, reduce it to the smallest one that you can, while still producing the error.â ilkkachu
May 9 at 19:59
This would be more on-topic on stackoverflow, but to get a useful answer either there or anywhere else, you'll need to show the full code you're trying to run. (I can tell it isn't, since the error refers to
line 6, and yours only has one.) If the script is long, reduce it to the smallest one that you can, while still producing the error.â ilkkachu
May 9 at 19:59
4
4
How do you run the script and what does the script's
#!-line say? That error looks like it's from a shell interpreter, not Python.â Kusalananda
May 9 at 20:01
How do you run the script and what does the script's
#!-line say? That error looks like it's from a shell interpreter, not Python.â Kusalananda
May 9 at 20:01
Or it's a missing bracket in the code before the reported line.
â hoefling
May 10 at 7:58
Or it's a missing bracket in the code before the reported line.
â hoefling
May 10 at 7:58
Thanks all for your response, I have modified the code to run on python3.5, now the error got fixed. :)
â Jith
May 10 at 8:10
Thanks all for your response, I have modified the code to run on python3.5, now the error got fixed. :)
â Jith
May 10 at 8:10
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Â
draft saved
draft discarded
Â
draft saved
draft discarded
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442851%2fpython-script-and-the-socket-syntax-error%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
4
This would be more on-topic on stackoverflow, but to get a useful answer either there or anywhere else, you'll need to show the full code you're trying to run. (I can tell it isn't, since the error refers to
line 6, and yours only has one.) If the script is long, reduce it to the smallest one that you can, while still producing the error.â ilkkachu
May 9 at 19:59
4
How do you run the script and what does the script's
#!-line say? That error looks like it's from a shell interpreter, not Python.â Kusalananda
May 9 at 20:01
Or it's a missing bracket in the code before the reported line.
â hoefling
May 10 at 7:58
Thanks all for your response, I have modified the code to run on python3.5, now the error got fixed. :)
â Jith
May 10 at 8:10