'Python for Everybody' Chapter 12 - Networked programs (Solved Exercises)

preview_player
Показать описание

Here is the missing exercise 5:

Here is the code for the solutions:

Make sure to check out my other tutorial series on Django:

Follow me on
Рекомендации по теме
Комментарии
Автор

Thank you so much for this clear explanation! This helped me A LOT. I am actually a professional conductor/pianist, just started programming for the first time in my life lol. REALLY appreciate your channel! Looking forward to more. yours, Lynn

LynnKao_SimplyDiamond
Автор

super helpful - no issues working through the book until this chapter. Then my brain decided to come to a screeching halt. :) Thanks, subbed.

BwellsTrumpetBasics
Автор

Finally i got a video that's solve exercises on Python for everybody book
thank You

yoyoahly
Автор

Thank you for your videos. I have started watching your videos since the first exercise. I enjoyed it so far. Lastly, Hi from Malaysia ^^

yongzhi
Автор

thanks man.
appreciate it.
btw in my book there is an exercise 5 for this chapter.

Khanarmaanrokz
Автор

Thank's so much for your video man!

chdkz
Автор

Hi there, thanks for the video.

I am confused as to why " + url + " is needed to summon a variable into the 'cmd = ' expression.
When I tried this exercise, I didn't know that was a thing- so instead, I just wrote:
cmd = ' GET website HTTP/1.0\r\n\r\n.encode()
where website is the user's input stored as a string, and this still did not work.


can you explain why + _ + is necessary here, and from where in the lesson plan you learned this ?

as well, why do we need to take .encode() from the end of our ' cmd = '
expression and make a new line with it?

Thanks in advance, good video.

edit: is it because cmd = ' GET HTTP/1.0\r\n\r\n.encode()' is a literal string, so instead of substituting my variable for and sending, it just sends GET Yes? Ah. blegh.

edit2: you moved encode() to a new line because it was less complicated than reformatting the ' cmd = ' expression so that the concatenation of string + variable + string produced a final string which was then operated on by the .encode(). I made mine work by just adding brackets:
cmd = ('GET' + website + ' HTTP/1.0\r\n\r\n').encode()

In the other case where I wrote:
cmd = 'GET' + website + 'HTTP/1.0\r\n\r\n'.encode()
without the brackets, HTTP/1.0\r\n\r\n got encoded before being concatenated

xD SHIT

bigbiyyy
Автор

@07:30 On the 2nd assignment I thought the programm should cut the connection after it received 3000 characters. So I coded following:

counter = 0
while True:
data = mysock.recv(1)
if len(data) < 1: break
print(data.decode())
counter = counter + 1
if counter > 3000: break
print("Letters:", counter)
mysock.close()

Anyone else thinking too complicated? :D

Anyways, thanks for your tutorials!

mrtruthan
Автор

I think there might be a mistake in the last exercise. there are more than 7 paragraphs startting with <p> and ending with </p>. I got 23 by doing this:
count = 0
for tag in tags:
print(tag)
count+=1
print(count)

karolinasylwester
Автор

How did you run the program? I am using atom text editor, Can u temme how to run in atom?

akhilrahmathullah
Автор

It's been a couple of years and it looks like Dr. Chuck changed some of the lessons for chapter 12. He has exercises regarding BeautifulSoup that aksonai doesn't cover.

biggestnoob
Автор

Please what data editor are you using?

hakeemagbaje
Автор

What is the purpose of adding '+' at the front and back of url in line 16 ?

shashankgautam
Автор

Is it only me that is confused or is it pretty common

canaanyamashita