我试图编写一个包含字符串的助手函数,如果该字符串有多个空格,它只会将其转换为一个字符串。以下是代码:
getSpaces :: String -> String
getSpaces index =
if (length index) == 1 then index
else
if isInfixOf " " index then index = " "
else index
当我试图将我的模块加载到GHCI中时,我会得到以下错误:
Prelude> :l Utilities
[1 of 1] Comp
我使用python-docx解析docx文件,然后使用xmlrpc将内容写入odoo res.partner。下面是我的代码:
# -*- coding: utf-8 -*-
from os import listdir
from os.path import isfile, join
from docx import Document
import xmlrpclib
username = 'admin' #the user
pwd = 'password' #the password of the user
dbname = 'odoo