<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-2">
<META content="MSHTML 6.00.2800.1226" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>
<DIV><FONT face=Arial size=2>Hello ...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><STRONG>1.)</STRONG> I noticed, that after I have
imported some random module (in this case, module I made) there appear an
additional file in Python\Saves directory, where my modules are stored
...</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>The module I imported was
<STRONG>Sample9.py</STRONG> (green icon), process it. and just after last line
the new file <STRONG>Sample9.pyc</STRONG> appeared (more or less red icon)
...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>It has also different content compare to "original"
file, some sort of "program language" I do not recognize ...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><STRONG>Sample9.py</STRONG></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>print "tadej"<BR>multiplier = input("Which
multiplier do you want? Pick a number ")<BR>for j in
range(1,13):<BR> print "%d x %d = %d" % (j, multiplier, j *
multiplier)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><STRONG>Sample9.pyc</STRONG></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial
size=2>;ò<BR>~æ²?c
@ sE d GHe d ƒ Z x- e d d ƒ D] Z d
e e e e f GHq! Wd S( s tadejs,
Which multiplier do you want? Pick a number i i<BR> s
%d x %d = %dN( s inputs<BR>
multipliers ranges j( s
js<BR> multiplier( (
s/ D:\Program Files\Python\Lib\idlelib\Saves\gg.pys
? s </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>What is that *.pyc file is
??</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>What is it used for (just assuming something has changed in it during
processing, compare to "original" .py file) ??</DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><STRONG>2.)</STRONG> Just before writting this
mail, when I was trying to make some more complex "read/write" file operatons, I
always get an error:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>IOError [Errno 2] No such file or directory:
'Sample.py'</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>A also tryed with
sys.path.append("D:\\PROGRAM~1\Python) function, which worked fine previous
time, when Python didn't "know" the right path, and there was IOError
again. Further, to be more certain I also tryed</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2> sys.path.append("D:\\PROGRAM~1\Lib\idlelib\Saves\) - the directory,
where I store my sample files, </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>... and there was the same error again. Please tell
me, what am I doing wrong ??</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><STRONG>3.)</STRONG> And only one question directly
releated to programming:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I finished with Alan Gauld's tutorial (than you
again, Alan - it's really the best option for non-programmer to start
with), so to continue, I am learning from 4 new tutorials (not at the same
time), one from techiwarehouse.com, second is Dive into Python, third
is <FONT size=6><FONT size=2>"An Informal Introduction to Python</FONT><FONT
size=2>" from <A href="http://www.python.org">www.python.org</A> and fourth
is Josh Cogliati's "Python for Non-Programmers"</FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT size=6><FONT
size=2></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial size=2><FONT size=6><FONT size=2>So in the one from
techiwarehouse.com, there is an explanation of so-called Logical operators:
and, or, and not. I do not understand explanation of <STRONG>and</STRONG>
operator:</FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT size=6><FONT
size=2></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial size=2><FONT size=6><FONT size=2>Firts it
says:</FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT size=6><FONT
size=2></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial size=2><FONT size=6><FONT size=2>For example, x > 0 and
x < 10 is true only if x is greater than 0 and less than 10.
</FONT></FONT></FONT></DIV><FONT face=Arial size=2><FONT size=6><FONT
size=2></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT size=6><FONT
size=2></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial size=2><FONT size=6><FONT
size=2></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial size=2><FONT size=6><FONT size=2>and
then:</FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT size=6><FONT
size=2></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial size=2><FONT size=6><FONT size=2>
<P>Strictly speaking, the operands of the logical operators should be boolean
expressions, but Python is not very strict. Any nonzero number is interpreted as
"true."</P>
<DIV>>>> x = 5</DIV>
<DIV>>>> x and 1</DIV>
<DIV>1</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>>>> y = 0</DIV>
<DIV>>>> y and 1</DIV>
<DIV>0</DIV>
<DIV> </DIV>
<DIV> </DIV></DIV>
<DIV>So, how do we get 1 and 0 here ??</DIV>
<DIV>Probably they are not meaning "true" or "false", cause when I typed
...</DIV>
<DIV> </DIV>
<DIV>>>> x = 1</DIV>
<DIV>>>> x and 2</DIV>
<DIV>2</DIV>
<DIV>... it gives value 2 !!</DIV>
<DIV> </DIV>
<DIV><BR>I assume it is releated to "Any nonzero number is interpreted as
"true.", but I can't get it 100 % ...</FONT></DIV></FONT></FONT>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks for any answer,
Tadey</FONT></DIV></BODY></HTML>