Code Monkey home page Code Monkey logo

Comments (4)

howie6879 avatar howie6879 commented on August 26, 2024

可能是你输入的原因吧 造成docopt 报错 你可以直接运行下insertData.py

from importdata.

yuhe520521 avatar yuhe520521 commented on August 26, 2024

非常感谢您的 回答 我已经解决 是因为我把 注释文档改了 导致 docopt 有了问题
已经开始导入了 但是又报了个错 好像是说编码问题 是不是 我的excel 里面的编码出了问题?
Traceback (most recent call last):
File "saveSql.py", line 28, in
cli()
File "saveSql.py", line 22, in cli
insertData(**kwargs)
File "/Users/yichaozhao/Downloads/gitTestDemo/importData/insertData.py", line 31, in init
self.judge(self.verFile(allStyle))
File "/Users/yichaozhao/Downloads/gitTestDemo/importData/insertData.py", line 50, in judge
self.saveExcel(file)
File "/Users/yichaozhao/Downloads/gitTestDemo/importData/insertData.py", line 62, in saveExcel
self.saveData(df)
File "/Users/yichaozhao/Downloads/gitTestDemo/importData/insertData.py", line 71, in saveData
row = ','.join(list(map(lambda x: self.db.conn.escape(str(x).strip()), df.values[num])))
File "/Users/yichaozhao/Downloads/gitTestDemo/importData/insertData.py", line 71, in
row = ','.join(list(map(lambda x: self.db.conn.escape(str(x).strip()), df.values[num])))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)

from importdata.

yuhe520521 avatar yuhe520521 commented on August 26, 2024

我再 savesql.py 的开头加了

--coding:utf-8--

如果不加 会报错
File "saveSql.py", line 7
SyntaxError: Non-ASCII character '\xe6' in file saveSql.py on line 8, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

from importdata.

howie6879 avatar howie6879 commented on August 26, 2024

那就行

from importdata.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.