使用word优雅的添加代码并上传到博客园

使用Ctrl+c/v从word到博客园,发现会很乱,后来发现word竟然可以上传到博客,恩6的一批,but!!!!为毛上传之后格式被狗吃了?!!!!

 

现在教大家优雅的插入代码,和上传的博客园,恩,其实网上资料还是蛮多的,两个结合到一块的.好像没看到啊

 

一:插入代码

访问这个网站: http://www.planetb.ca/syntax-highlight-word

点击Show Highlighted

跳转到新的连接,恩复制粘贴到word就好了

  1. import configparser  
  2.     
  3. 读取配置文件信息  
  4. conf = configparser.ConfigParser()  获得一个configparser.ConfigParser对象  
  5. conf.read('example.ini')  将内容读到对象中,而不是给出返回值,返回值为 ['example.ini']  
  6. conf.sections()  # ['bitbucket.org', 'topsecret.server.com']  
  7.     
  8. conf.set('bitbucket.org''compression'"asdsfasd")  修改值  
  9. conf['bitbucket.org']['compression'] = "asdfa"  修改值  
  10. conf.get('DEFAULT''compression')  只能拿到值  
  11. with open("2333.ini""w")as f:  
  12.     conf.write(f)  

二上传到博客园:

1.点文件

2.选择共享—发布至博客---发布至博客

3.他会让你选择一个,因为我这已经设置过了,就没有让设置

 

 

如果跳到这个页面

选择账户管理:

 

下一步:

其中1处输入:

http://www.cnblogs.com/修改成自己的博客名/services/metablogapi.aspx

 

 

还可以选择类别

最后点击发布就好了:会显示发布的时间,

 

原文地址:https://www.cnblogs.com/twotigers/p/7744393.html