| 
									
										
										
										
											2021-06-15 00:49:18 -07:00
										 |  |  | --- | 
					
						
							|  |  |  | id: 5e7b9f0d0b6c005b0e76f075 | 
					
						
							| 
									
										
										
										
											2021-07-22 21:31:38 +05:30
										 |  |  | title: 'Rede: usando urllib em Python' | 
					
						
							| 
									
										
										
										
											2021-06-15 00:49:18 -07:00
										 |  |  | challengeType: 11 | 
					
						
							|  |  |  | videoId: 7lFM1T_CxBs | 
					
						
							| 
									
										
										
										
											2021-10-03 12:24:27 -07:00
										 |  |  | bilibiliIds: | 
					
						
							|  |  |  |   aid: 546908270 | 
					
						
							|  |  |  |   bvid: BV1Xq4y1H7e6 | 
					
						
							|  |  |  |   cid: 377331524 | 
					
						
							| 
									
										
										
										
											2021-06-15 00:49:18 -07:00
										 |  |  | dashedName: networking-using-urllib-in-python | 
					
						
							|  |  |  | --- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # --question--
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## --text--
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-22 21:31:38 +05:30
										 |  |  | Como será a saída do seguinte código?: | 
					
						
							| 
									
										
										
										
											2021-06-15 00:49:18 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | ```python | 
					
						
							|  |  |  | import urllib.request | 
					
						
							|  |  |  | fhand = urllib.request.urlopen('http://data.pr4e.org/romeo.txt') | 
					
						
							|  |  |  | for line in fhand: | 
					
						
							|  |  |  |     print(line.decode().strip()) | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## --answers--
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-22 21:31:38 +05:30
										 |  |  | Apenas o conteúdo de "romeo.txt". | 
					
						
							| 
									
										
										
										
											2021-06-15 00:49:18 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | --- | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-22 21:31:38 +05:30
										 |  |  | Um header e o conteúdo de "romeo.txt". | 
					
						
							| 
									
										
										
										
											2021-06-15 00:49:18 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | --- | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-22 21:31:38 +05:30
										 |  |  | Um header, um footer e o conteúdo de "romeo.txt". | 
					
						
							| 
									
										
										
										
											2021-06-15 00:49:18 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | ## --video-solution--
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 1 | 
					
						
							|  |  |  | 
 |