我已经编写了这段代码来在csv
文件(excel表)中写日期代码没有错误但是excel中没有显示日期我需要读取功能但是我没有知道如何以及在代码中使用它。
date=["16.02.2018", "blah"]
CSVreport = open('indata.csv', 'wb')
wr = csv.writer(CSVreport)
with open('indata.csv', 'w+') as CSVreport:
wr = csv.writer(CSVreport)
wr.writerow(date)
CSVreport.close()
任何人都可以帮助我吗?
答案 0 :(得分:1)
node <- querySelector "#canvas"
--addEventListener canvas "mousedown" mouseDown
for_ node $ addEventListener "mousedown" $ void do
modifyRef drag \d -> true
-- x <- pageX onMouseMove
x <- liftEff $ Window.screenX =<< window
y <- liftEff $ Window.screenX =<< window
modifyRef old_x \ox -> toNumber x
modifyRef old_y \oy -> toNumber y
log (show y)
for_ node $ addEventListener "mouseup" $ void do
modifyRef drag \d -> false
for_ node $ addEventListener "mouseout" $ void do
modifyRef drag \d -> false
for_ node $ addEventListener "mousemove" $ void do
--log "Mouse Moved!"
x <- liftEff $ Window.screenX =<< window
y <- liftEff $ Window.screenX =<< window
ox <- readRef old_x
oy <- readRef old_y
modifyRef dX \dx -> (toNumber x - ox) * 2.0 * pi / 600.0
modifyRef dY \dy -> (toNumber y - oy) * 2.0 * pi / 650.0
dx <- readRef dX
dy <- readRef dY
dg <- readRef drag
if dg == true then do
modifyRef alpha \al -> al + dx
modifyRef beta \bt -> bt + dy
modifyRef old_x \ox -> toNumber x
modifyRef old_y \oy -> toNumber y
--modifyRef gamma \ga -> ga + 3.0 * pi/180.0
else
pure unit
语法是with open...
的替换。
此外,您的代码缩进错误。试试这个:
open(...); close()