coding

part1

匿名 (未验证) 提交于 2019-12-03 00:41:02
明确的指出 hello.py 脚本由 python 解释器来执行。coding:utf-8处理脚本中的中文 # !/usr/bin/env python # _*_ coding:utf-8 _*_ print " hello.world " # !/usr/bin/env python # _*_ coding:utf-8 _*_ print " 呜呜大人 " 变量的赋值 # !/usr/bin/env python # _*_ coding:utf-8 _*_ name = " Alex Li " name2 = name print (name,name2) name = " Jack " print ( " What is the value of name2 now? " ) 运行结果 单行注视:# 被注释内容 多行注释:""" 被注释内容 """ 用户输入 未加str会报错,采用raw_input则可以随意输入 模块初识, sys 列表第一个是文件名,其次是脚本后面的输入参数,如python demo1.py hello world 则输出为 [ ‘demo1.py‘ , ‘helo‘ , ‘world‘ ] os 以上两个模块结合 # !/usr/bin/env python # _*_ coding:utf-8 _*_ import os,sys os.system

连接coding以及恢复之前的版本

匿名 (未验证) 提交于 2019-12-03 00:32:02
Coding使用方法 首先在 码市coding.net 上创建账号 基础配置 1. 首先,下载安装git客户端和tortoisegit(就是小乌龟,本地右键使用的,跟SVN一样的那个小乌龟)。 git下载官网: https://git-for-windows.github.io/ tortoisegit官网: https://tortoisegit.org/download/ (如果英语不好,可以在下面选择语言包下载,安装很简单,可以度娘) 已经下载好的软件百度云链接: 链接: http://pan.baidu.com/s/1gf0w8SF 密码: 24rk 2. 然后你需要登录coding,注册账号步骤同一般网站,此处不再赘述; 之后点击左上方的小猴子(应该是猴子吧。。。),进入个人界面如下图。选择"账户"――"SSH公钥",到此时,前置条件都准备好了,下面可以开启本地配置了 3. 首先鼠标点击右键,选择"Git Bash Here",进入黑窗口,如下图 4. 然后输入下面两行代码 git config --global user.name "yourname" git config --global user.email "xxx@xxx.com " //此处一定是你github网站上注册的邮箱 5. 会发现在你"C:\Users\用户名"文件夹下出现了".gitconfig

addpath(),genpath()

匿名 (未验证) 提交于 2019-12-03 00:09:02
  clear all;clear clc;   addpath():   打开不在同一目录下的文件   addpath('sparse-coding');%sparse-coding,SIFT均表示路径,此目录下的两个文件夹   addpath('SIFT');   genpath('BP'):   结果产生包含BP,以及BP文件夹下所有的文件夹的路径         来源:博客园 作者: 爽歪歪666 链接:https://www.cnblogs.com/shuangcao/p/11555067.html

第一次个人编程作业

匿名 (未验证) 提交于 2019-12-03 00:08:02
天枢星v2.1自动化评测系统 PSP2.1 Personal Software Process Stages 预估耗时(分钟) 实际耗时(分钟) Planning 计划 Estimate 估计这个任务需要多少时间 Development 开发 Analysis 需求分析(包括学习新技术) Design Spec 生成设计文档 Design Review 设计复审 Coding Standard 代码规范(为开发制定合适的规范) Design 具体设计 Coding 具体编码 Code Review 代码复审 Test 测试(自我测试,修改,提交修改) Reporting 报告 Test Report 测试报告 Size Measurement 计算工作量 Postmortem & Process Improvement Plan 事后总结并提出过程改进计划 来源:博客园 作者: 缘起性空wadx 链接:https://www.cnblogs.com/wadx2019/p/11538157.html

coding++:解决Not allowed to load local resource错误-SpringBoot配置虚拟路径

匿名 (未验证) 提交于 2019-12-02 23:55:01
1、在SpringBoot里上传图片后返回了绝对路径,发现本地读取的环节上面出现了错误( Not allowed to load local resource ),一开始用的是直接本地路径。 但是在页面上调试的出现了下面的错误,他的路径还是相对路径,那么解决这个问题,我们可以用虚拟路径,这篇文章就是说SpringBoot如何配置虚拟路径来解决这个问题。 我们只要添加一个配置文件就行: package com . editors . kindeditor . config ; import org . springframework . context . annotation . Configuration ; import org . springframework . web . servlet . config . annotation . ResourceHandlerRegistry ; import org . springframework . web . servlet . config . annotation . WebMvcConfigurerAdapter ; @Configuration public class MyWebAppConfiguration extends WebMvcConfigurerAdapter { /** *

在Model中使用中文

匿名 (未验证) 提交于 2019-12-02 23:49:02
原文链接: http://www.cnblogs.com/wj110reg/archive/2009/07/23/1529621.html 要达到如下效果: CharField('姓名', max_length=200) 须在models.py第一行添加 #coding=utf-8 保存文件后,重启服务器。不重启的话可能会出错。 转载于:https://www.cnblogs.com/wj110reg/archive/2009/07/23/1529621.html 文章来源: https://blog.csdn.net/weixin_30609331/article/details/96704286

汇编语言学习:使用王爽写的《汇编语言》第三版(编程环境配置)

匿名 (未验证) 提交于 2019-12-02 23:43:01
汇编语言学习 参考书: 使用王爽写的《汇编语言》第三版 学习工具(win7 x64): 另外需要一款编辑器,用来编辑源程序,推荐sublime text。需要到这里下载支持汇编语法高亮的插件: https://github.com/Nessphoro/sublimeassembly 目录介绍 学习工具 :包含win7 64位下需要的工具:DOSBox 0.74安装包、masm.exe、link.exe、debug.exe experiment.asm :参考书上面的练习与实验(不全,但需要的代码都在里面) 64位windows7下DOSBox使用方法: step1: 新建文件夹(下面以 C:\coding\assembly-language-learning 为例) step2: 将 debug.exe 、 masm.exe 、 link.exe 放到 C:\coding\assembly-language-learning 文件夹下 step3: 打开DOSBox。这里可以看到Z:\DOSBox里的虚拟盘,我们采用mount命令将其转变到 C:\coding\assembly-language-learning 目录下,如果只是用这一次,可以直接在命令行中输入如下命令: Z:\> mount d C:\coding\assembly-language-learning Z:\>

coding新建文件命令提示记录

匿名 (未验证) 提交于 2019-12-02 23:38:02
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wwwtotoro/article/details/91042355 快速设置 - 如果你以前做过这种事情 ...或在命令行上创建一个新的存储库: ...或从命令行推送现有空的存储库: ...或从命令行推送已有存储库: 文章来源: https://blog.csdn.net/wwwtotoro/article/details/91042355

python-写入文件

亡梦爱人 提交于 2019-12-02 23:07:16
一、写入空文件(覆盖) # coding=UTF-8 filename = 'test_text.txt' with open(filename, 'w') as file_object: file_object.write("Add a word") 如果写入文件不存在,open()将自动创建它 如果文件已存在已有内容,会清空再写入 写入多行 # coding=UTF-8 filename = 'test_text.txt' with open(filename, 'w') as file_object: file_object.write("Add a word") file_object.write("Add two words") 加换行符 # coding=UTF-8 filename = 'test_text.txt' with open(filename, 'w') as file_object: file_object.write("Add a word\n") file_object.write("Add two words\n") 二、在原有文件上添加内容 用‘a’ # coding=UTF-8 filename = 'test_text.txt' with open(filename, 'a') as file_object: file_object

graphite custom functions

匿名 (未验证) 提交于 2019-12-02 23:05:13
http://www.cnblogs.com/txwsqk/p/6522854.html # Function plugins FUNCTION_PLUGINS = ['linkedme.aliasByMap',] /opt/graphite/webapp/graphite/functions/custom# ls __init__.py __init__.pyc linkedme.py linkedme.pyc #coding:utf-8 from graphite.functions.params import Param, ParamTypes def aliasByMap(requestContext, seriesList): kv = { '4000054':'你想展示的内容', } for series in seriesList: series.name = kv[series.name] return seriesList aliasByMap.group = 'Alias' aliasByMap.params = [ Param('seriesList', ParamTypes.seriesList, required=True), ] SeriesFunctions = { 'aliasByMap': aliasByMap, } 这样 grafana