<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Here’s my problem; my code snippet reads a file(presumably an _io.readline, I’ll question this later), with the file.readline(). The output shows individual characters being read and printed out followed by the “here” being printed. Also, see below…<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Source data file:<o:p></o:p></p><p class=MsoNormal><!-- saved from url=(0040)https://finance.yahoo.com/portfolio/pf_2 --><o:p></o:p></p><p class=MsoNormal>html class="yui3-js-enabled" id="yui_3_10_3_4_1412203661632_7637"><div id="yui3-css-stamp" style="position: absolute !important; visibility: hidden !important" class=""></div><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Code snippet:<o:p></o:p></p><p class=MsoNormal>import re, os<o:p></o:p></p><p class=MsoNormal>for line_in in file.readline():<o:p></o:p></p><p class=MsoNormal> print( line_in )<o:p></o:p></p><p class=MsoNormal> print("here")<o:p></o:p></p><p class=MsoNormal> continue<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Output:<o:p></o:p></p><p class=MsoNormal><<o:p> </o:p></p><p class=MsoNormal>here<o:p></o:p></p><p class=MsoNormal>!<o:p></o:p></p><p class=MsoNormal>here<o:p></o:p></p><p class=MsoNormal>-<o:p></o:p></p><p class=MsoNormal>here<o:p></o:p></p><p class=MsoNormal>-<o:p></o:p></p><p class=MsoNormal>here<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>here<o:p></o:p></p><p class=MsoNormal>s<o:p></o:p></p><p class=MsoNormal>here<o:p></o:p></p><p class=MsoNormal>a<o:p></o:p></p><p class=MsoNormal>here<o:p></o:p></p><p class=MsoNormal>v<o:p></o:p></p><p class=MsoNormal>here<o:p></o:p></p><p class=MsoNormal>e<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Why the individual characters and not the full line? Also, it is very unclear to me which readline I am using. I have imported os. I am using pycharm IDE and supposedly it will show me where readline is coming from by right clicking and choosing find usages. However, it brings up three readlines which are place holders. It doesn’t bring up the os.readline. I am getting really tired of trying to figure out which function is being used!<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>So, what is happening that I am missing?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>TIA,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Clayton<o:p></o:p></p></div></body></html>