> For the complete documentation index, see [llms.txt](https://jen-hsuan-hsieh.gitbook.io/python/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jen-hsuan-hsieh.gitbook.io/python/chapter1notes-from-research/chapter-2-write-python-code/1hello-pyhon.md).

# 3.1.Hello Python

* 要寫一段簡單可執行的code有三種作法
  * 1.Console
  * 2.Execute from script file (module)
  * 3.IPython notebook
* 1.Console:

  * Open console and type

    ```
            print "Hello python"
    ```
  * check print message:

  ![](https://github.com/jenhsuan/python/tree/8fc9c0b8df4ccd709d3078c2d8842af0932de09d/assets/未命名33.jpg)

  * Type **exit()** to exit from python environment
* 2.Execute from script file (module):

  * write the following code and save file as \*.py

  ![](https://github.com/jenhsuan/python/tree/8fc9c0b8df4ccd709d3078c2d8842af0932de09d/assets/未命名34.jpg)

  * go to the folder which contained that script file, and type file name assumed that you have set Python path to system environment. &#x20;

  ![](https://github.com/jenhsuan/python/tree/8fc9c0b8df4ccd709d3078c2d8842af0932de09d/assets/未命名35.jpg)
* 3.IPython notebook
