continue with the second tutorial python
In the first tutorial we did the hello world example, but nothing else using the console, now we will work in a script.
doing so on the console or command executing command loose, but it was not if it was programmed in python.
To make a Python script to do the following:
Open PythonWin
·
new File (Ctrl + N)
Python Script and then select OK
By doing the above we aparace a window with the title of Script 1
In this window we can write all the code to be executed.
write the same code 1 chapter
message = 'Hello World' <=inicio-1; contador++)
print message
<=numero-1; linea++)
<=inicio-1;contador++)
<=fin; contador += 2)
We keep it as holaMundo.py
To run the script
<=fin; contador += 2)
Click on the icon that is within a rectangle and a window that says "Run Script" pressed OK.
<=ancho-1; linea++)
<=inicio-1; contador++)
<=fin; contador +=2)
In the interactive window print our message.
<=inicio - 1; contador++)
If you look in the directory where we store our script and execute it, you see the prompt window and disappears without seeing our message, to avoid closing automatically add the following line.
Input ("Press enter to exit")
This happens
When executed, the window does not close automatically, until you press enter.
0 comments:
Post a Comment