Python:并非所有参数都在字符串格式化期间转换 导入日期时间 now=datetime.date.today() now=str(now) index=open('/var/www/index.html','a') index.write('$s',%now) index.close()
我不断收到错误。您需要使用正确的格式:Python:并非所有参数都在字符串格式化期间转换 导入日期时间 now=datetime.date.today() now=str(now) index=open('/var/www/index.html','a') index.write('$s',%now) index.close(),python,html,string,raspberry-pi,Python,Html,String,Raspberry Pi,我不断收到错误。您需要使用正确的格式: import datetime now = datetime.date.today() now = str(now) index = open('/var/www/index.html', 'a') index.write('<br> $s,' %now) index.close() index.write('%s',%now) 这是%s,而不是$s您需要使用正确的格式: import datetime now = datetime.d
import datetime
now = datetime.date.today()
now = str(now)
index = open('/var/www/index.html', 'a')
index.write('<br> $s,' %now)
index.close()
index.write('
%s',%now)
这是
%s
,而不是$s
您需要使用正确的格式:
import datetime
now = datetime.date.today()
now = str(now)
index = open('/var/www/index.html', 'a')
index.write('<br> $s,' %now)
index.close()
index.write('<br> %s,' %now)
index.write('
%s',%now)
这是
%s
,而不是$s
您需要使用正确的格式:
import datetime
now = datetime.date.today()
now = str(now)
index = open('/var/www/index.html', 'a')
index.write('<br> $s,' %now)
index.close()
index.write('<br> %s,' %now)
index.write('
%s',%now)
这是
%s
,而不是$s
您需要使用正确的格式:
import datetime
now = datetime.date.today()
now = str(now)
index = open('/var/www/index.html', 'a')
index.write('<br> $s,' %now)
index.close()
index.write('<br> %s,' %now)
index.write('
%s',%now)
这是%s
,而不是$s
索引.write(“
{now},”.format(now=now))
index.write('<br> %s,' %now)
.format
比字符串格式好得多
请参见index.write(“
{now},”.format(now=now))
.format
比字符串格式好得多
请参见index.write(“
{now},”.format(now=now))
.format
比字符串格式好得多
请参见index.write(“
{now},”.format(now=now))
.format
比字符串格式好得多
请参见