<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div><div>Hello, </div><div><br></div><div>I'm starting with Python and I'm trying to work with "import" but I'm having a problem.</div><div><br></div><div>I have the file c.py (that works when executed) with a function performing a multiplication:</div><div><br></div><div>def mult(a,x):</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>resul=a*x</div><div>        return(resul)</div><div>print 'test print'</div><div>ent1=2</div><div>ent3=3</div><div>dedo=mult(ent1,ent3)</div><div>print 'result: ',dedo</div><div><br></div><div><br></div><div>and I have the file b.py that calls c.py but should only print a sentence, without use the function in c.py (I tried to use the code without the comment part but got the problem, my goal is to use b.py with the commented part being part of the code):</div><div><br></div><div>import c</div><div><br></div><div>ent1=2</div><div>ent2=7</div><div>print 'testing b.py without any operation'</div><div><br></div><div>#saida=c.mult(ent1,ent2)</div><div>#print 'the output is:',saida</div><div><br></div><div><br></div><div><br></div><div><br></div><div>My problem is when I execute b.py, it executes c.py before b.py:</div><div><br></div><div>$ python b.py </div><div>test print</div><div>result:  6</div><div>testing b.py without any operation</div><div><br></div><div><br></div><div><br></div><div><br></div><div>How should I work with this? What I want is use the function defined in c.py inside b.py</div><div><br></div><div><br></div><div>Regards,</div><div>Felipe</div></div>                                        </div></body>
</html>