簡體   English   中英

使用 Python 將包含一行的文本文件讀入數組

[英]Reading a text file with one line into an array using Python

我有一個格式如下的單行文本文件:

["De", ["2", "9", "5e"], "Kh", ["3", "6", "7e", "0e"], ...]

到目前為止,我試圖簡單地使用:

read = open("text.txt", "r")
var = read.read()

但這沒有用。

我有一個格式如下的單行文本文件:

["De", ["2", "9", "5e"], "Kh", ["3", "6", "7e", "0e"], ...]

到目前為止,我試圖簡單地使用:

read = open("text.txt", "r")
var = read.read()

但這沒有用。

我有一個格式如下的單行文本文件:

["De", ["2", "9", "5e"], "Kh", ["3", "6", "7e", "0e"], ...]

到目前為止,我試圖簡單地使用:

read = open("text.txt", "r")
var = read.read()

但這沒有用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM