首頁  >  文章  >  後端開發  >  使用 AWS 學習 Python - 第 1 天

使用 AWS 學習 Python - 第 1 天

WBOY
WBOY原創
2024-08-08 17:18:29822瀏覽

在我的上一篇文章中,我提到了一個與 Python 相關的 AWS 研討會,即在 AWS 研討會上學習 Python。

想要建立一系列帖子,展示所有實驗室實作和針對初學者的 Python 教學。

第 1 步 - 登入您的 AWS 控制台並確保您有 Cloud9 IDE
Learn Python with AWS - Day 1

Learn Python with AWS - Day 1

設定環境時請按照 cloud9 部分中提到的步驟進行操作

Learn Python with AWS - Day 1

開啟 Cloud9 IDE 後,先在 IDE 中輸入 python 檢查 Python 版本,您將會看到這個

Learn Python with AWS - Day 1

ec2-user:~/environment $ python
Python 3.8.16 (default, May 21 2024, 18:54:47) 
[GCC 7.3.1 20180712 (Red Hat 7.3.1-17)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

專業提示:如果您在平台下拉清單中選擇 Amazon Linux 2 以外的其他版本並建立環境,那麼您可能無法取得 python 環境。

*互動模式
*

這是互動式Python環境。您可以直接在其中輸入 python 命令,它們將作為 python 運行。這是一個快速測試 python 命令的好工具。

現在用一個例子來嘗試。在>>
之後鍵入或複製以下內容到python互動環境中

some_string = "Hello Python"
print(some_string)

這應該會回傳以下內容:

some_string = "Hello Python"
print(some_string)
Hello Python

恭喜你!

您剛剛建立了第一個名為 some_string 的 Python 變量,並為其指定了值「Hello Python」。

然後,您使用內建的列印函數列印變數的值。

退出互動模式

要退出 python 環境,請使用 crtl + d 或輸入 exit()。

休息一下,我們將在第二天和下一篇文章中學習。

以上是使用 AWS 學習 Python - 第 1 天的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn