Python script and the socket syntax error

The name of the pictureThe name of the pictureThe name of the pictureClash 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)






share|improve this question

















  • 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















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)






share|improve this question

















  • 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













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)






share|improve this question













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)








share|improve this question












share|improve this question




share|improve this question








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 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













  • 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








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
















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















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



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














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













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)