官术网_书友最值得收藏!

  • Practical Data Wrangling
  • Allan Visochek
  • 201字
  • 2021-07-02 15:16:07

Running the Hello World program

In the following steps, I will walk through how to run a program using the terminal.

1. In your Terminal program, go ahead and change the working directory to the directory containing your hello_world.py program:

$ cd <relative/path/to/directory>

2. Verify that you are in the correct directory by using the appropriate command for your operating system. Once you have verified that you are in the correct directory, run the program by entering either of the following, depending on your setup:

$ python hello_world.py 
$ python3 hello_world.py
Some operating systems will include a Python2 installation as   Python  and a Python3 installation as   python3. There may be additional variations of the python command that are used by default. See the installation instructions in the external resources for more details.
  1. Once you run the program, you should see printed out in your Terminal the words Hello World!. If you did, congratulations! You successfully ran your first program in Python:
This is what running the Hello World program looks like on my machine. Yours might be slightly different, so use the previous instructions, and not this, as a reference to run your program.
主站蜘蛛池模板: 汉沽区| 额济纳旗| 西乡县| 塔城市| 丹棱县| 绥德县| 江陵县| 石阡县| 阳原县| 辛集市| 延津县| 茂名市| 永济市| 嘉定区| 美姑县| 云安县| 赞皇县| 开远市| 天津市| 台北县| 黎平县| 黎城县| 台州市| 凯里市| 甘肃省| 化州市| 搜索| 呼和浩特市| 清原| 金堂县| 临城县| 新巴尔虎右旗| 咸宁市| 琼结县| 陇南市| 巴青县| 连州市| 云龙县| 自治县| 伊吾县| 屏山县|