How can I use python3 for profantiy editor mini project?












0















[This is the error output.][1]I've tried using urllib.parse also to parse the value but nothing helps.Please help me out. I'm a beginner in Python.

import urllib.request

def text_finder():
songs=open("C:song.txt")
contents=songs.read()
songs.close()
profanity(contents)

def profanity(text_to_check):
connection=urllib.request.urlopen("http://www.wdylike.appspot.com/?q="+text_to_check)
output=connection.read()
connection.close()
if "true" in output:
print("No curse word in text.")
elif "false" in output:
print("There is curse word in your text!")
else:
print("Something went wrong!")

text_finder()


This is the error message output.
Please help me out.
RESTART: C:UserssimraAppDataLocalProgramsPythonPython37-32profanityeditor.py
Traceback (most recent call last):
File "C:UserssimraAppDataLocalProgramsPythonPython37-32profanityeditor.py", line 18, in
text_finder()
File "C:UserssimraAppDataLocalProgramsPythonPython37-32profanityeditor.py", line 6, in text_finder
profanity(contents)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32profanityeditor.py", line 9, in profanity
connection=urllib.request.urlopen("http://www.wdylike.appspot.com/?q="+text_to_check)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 531, in open
response = meth(req, response)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 569, in error
return self._call_chain(*args)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 503, in _call_chain
result = func(*args)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found










share|improve this question




















  • 2





    Please post error messages as text, not images. This particular error message is a HTTP error code telling you that the URL you request does not exist.

    – user10605163
    Nov 22 '18 at 3:32











  • @eukaryota but the url exists.

    – Simmy
    Nov 23 '18 at 1:56
















0















[This is the error output.][1]I've tried using urllib.parse also to parse the value but nothing helps.Please help me out. I'm a beginner in Python.

import urllib.request

def text_finder():
songs=open("C:song.txt")
contents=songs.read()
songs.close()
profanity(contents)

def profanity(text_to_check):
connection=urllib.request.urlopen("http://www.wdylike.appspot.com/?q="+text_to_check)
output=connection.read()
connection.close()
if "true" in output:
print("No curse word in text.")
elif "false" in output:
print("There is curse word in your text!")
else:
print("Something went wrong!")

text_finder()


This is the error message output.
Please help me out.
RESTART: C:UserssimraAppDataLocalProgramsPythonPython37-32profanityeditor.py
Traceback (most recent call last):
File "C:UserssimraAppDataLocalProgramsPythonPython37-32profanityeditor.py", line 18, in
text_finder()
File "C:UserssimraAppDataLocalProgramsPythonPython37-32profanityeditor.py", line 6, in text_finder
profanity(contents)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32profanityeditor.py", line 9, in profanity
connection=urllib.request.urlopen("http://www.wdylike.appspot.com/?q="+text_to_check)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 531, in open
response = meth(req, response)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 569, in error
return self._call_chain(*args)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 503, in _call_chain
result = func(*args)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found










share|improve this question




















  • 2





    Please post error messages as text, not images. This particular error message is a HTTP error code telling you that the URL you request does not exist.

    – user10605163
    Nov 22 '18 at 3:32











  • @eukaryota but the url exists.

    – Simmy
    Nov 23 '18 at 1:56














0












0








0








[This is the error output.][1]I've tried using urllib.parse also to parse the value but nothing helps.Please help me out. I'm a beginner in Python.

import urllib.request

def text_finder():
songs=open("C:song.txt")
contents=songs.read()
songs.close()
profanity(contents)

def profanity(text_to_check):
connection=urllib.request.urlopen("http://www.wdylike.appspot.com/?q="+text_to_check)
output=connection.read()
connection.close()
if "true" in output:
print("No curse word in text.")
elif "false" in output:
print("There is curse word in your text!")
else:
print("Something went wrong!")

text_finder()


This is the error message output.
Please help me out.
RESTART: C:UserssimraAppDataLocalProgramsPythonPython37-32profanityeditor.py
Traceback (most recent call last):
File "C:UserssimraAppDataLocalProgramsPythonPython37-32profanityeditor.py", line 18, in
text_finder()
File "C:UserssimraAppDataLocalProgramsPythonPython37-32profanityeditor.py", line 6, in text_finder
profanity(contents)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32profanityeditor.py", line 9, in profanity
connection=urllib.request.urlopen("http://www.wdylike.appspot.com/?q="+text_to_check)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 531, in open
response = meth(req, response)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 569, in error
return self._call_chain(*args)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 503, in _call_chain
result = func(*args)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found










share|improve this question
















[This is the error output.][1]I've tried using urllib.parse also to parse the value but nothing helps.Please help me out. I'm a beginner in Python.

import urllib.request

def text_finder():
songs=open("C:song.txt")
contents=songs.read()
songs.close()
profanity(contents)

def profanity(text_to_check):
connection=urllib.request.urlopen("http://www.wdylike.appspot.com/?q="+text_to_check)
output=connection.read()
connection.close()
if "true" in output:
print("No curse word in text.")
elif "false" in output:
print("There is curse word in your text!")
else:
print("Something went wrong!")

text_finder()


This is the error message output.
Please help me out.
RESTART: C:UserssimraAppDataLocalProgramsPythonPython37-32profanityeditor.py
Traceback (most recent call last):
File "C:UserssimraAppDataLocalProgramsPythonPython37-32profanityeditor.py", line 18, in
text_finder()
File "C:UserssimraAppDataLocalProgramsPythonPython37-32profanityeditor.py", line 6, in text_finder
profanity(contents)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32profanityeditor.py", line 9, in profanity
connection=urllib.request.urlopen("http://www.wdylike.appspot.com/?q="+text_to_check)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 531, in open
response = meth(req, response)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 569, in error
return self._call_chain(*args)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 503, in _call_chain
result = func(*args)
File "C:UserssimraAppDataLocalProgramsPythonPython37-32liburllibrequest.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found







python http http-status-code-404






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '18 at 2:01







Simmy

















asked Nov 22 '18 at 2:52









Simmy Simmy

12




12








  • 2





    Please post error messages as text, not images. This particular error message is a HTTP error code telling you that the URL you request does not exist.

    – user10605163
    Nov 22 '18 at 3:32











  • @eukaryota but the url exists.

    – Simmy
    Nov 23 '18 at 1:56














  • 2





    Please post error messages as text, not images. This particular error message is a HTTP error code telling you that the URL you request does not exist.

    – user10605163
    Nov 22 '18 at 3:32











  • @eukaryota but the url exists.

    – Simmy
    Nov 23 '18 at 1:56








2




2





Please post error messages as text, not images. This particular error message is a HTTP error code telling you that the URL you request does not exist.

– user10605163
Nov 22 '18 at 3:32





Please post error messages as text, not images. This particular error message is a HTTP error code telling you that the URL you request does not exist.

– user10605163
Nov 22 '18 at 3:32













@eukaryota but the url exists.

– Simmy
Nov 23 '18 at 1:56





@eukaryota but the url exists.

– Simmy
Nov 23 '18 at 1:56












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
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',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53423216%2fhow-can-i-use-python3-for-profantiy-editor-mini-project%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53423216%2fhow-can-i-use-python3-for-profantiy-editor-mini-project%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

To store a contact into the json file from server.js file using a class in NodeJS

Redirect URL with Chrome Remote Debugging Android Devices

Dieringhausen