[問題] python3.6版本的 f string

看板Python作者 (math mad)時間8年前 (2017/08/12 03:39), 編輯推噓0(006)
留言6則, 4人參與, 最新討論串1/1
小弟我的環境是3.5,看到3.6版本新加的 f strings 覺得還滿不錯用的,可是在3.5的環境中無法通過 下面是官網的說明 https://www.python.org/dev/peps/pep-0498/#examples-from-python-s-source-code 我知道有 from__future__的方法,但是在這邊我不知道該怎麼用 想請問如何解決 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.253.33 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1502480390.A.B31.html

08/12 07:11, , 1F
__future__ 是給 py2 用的
08/12 07:11, 1F

08/12 07:50, , 2F
看到3.6版本”新”加的 f strings
08/12 07:50, 2F

08/12 07:51, , 3F
可是在”3.5”的環境中無法通過 ???
08/12 07:51, 3F

08/12 07:52, , 4F
你的問題敘述是正確的嗎…
08/12 07:52, 4F

08/12 09:52, , 5F
3.6 > 3.5喔
08/12 09:52, 5F

08/12 10:28, , 6F
3.6才加的功能3.5怎麼會有......官方又沒有backport
08/12 10:28, 6F
文章代碼(AID): #1PZWW6in (Python)