How can I use python3 for profantiy editor mini project?
up vote
0
down vote
favorite
[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
add a comment |
up vote
0
down vote
favorite
[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
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.
– eukaryota
Nov 22 at 3:32
@eukaryota but the url exists.
– Simmy
Nov 23 at 1:56
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
[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
[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
python http http-status-code-404
edited Nov 23 at 2:01
asked Nov 22 at 2:52
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.
– eukaryota
Nov 22 at 3:32
@eukaryota but the url exists.
– Simmy
Nov 23 at 1:56
add a comment |
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.
– eukaryota
Nov 22 at 3:32
@eukaryota but the url exists.
– Simmy
Nov 23 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.
– eukaryota
Nov 22 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.
– eukaryota
Nov 22 at 3:32
@eukaryota but the url exists.
– Simmy
Nov 23 at 1:56
@eukaryota but the url exists.
– Simmy
Nov 23 at 1:56
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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.
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
Required, but never shown
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
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
Required, but never shown
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
Required, but never shown
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
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
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.
– eukaryota
Nov 22 at 3:32
@eukaryota but the url exists.
– Simmy
Nov 23 at 1:56