随笔分类 - Python
人生苦短  我用python
    
摘要:import site; site.getsitepackages()
        阅读全文
                
摘要:1、在cmd输入python -V显示当前python的版本信息,一定是大写的V 2、输入python,进入python解释器里面 3、在解释器中,输入exit()或者quit()会退出,一定要加括号 4、列表
        阅读全文
                
摘要:最近用sublime text写python脚本,在导包是一直显示No module named XXX。 问题描述: 首先文件夹的目录结构如下: count.py文件,代码如下: counttest.py文件,代码如下: 运行之后,显示的结果是: 理论上讲,从model导入count.py文件,是
        阅读全文
                
摘要:1 def break_words(stuff): 2 """This function will break up words for us.""" 3 words = stuff.split(' ') 4 return words 5 6 def sort_words(words): 7 """Sorts the words.""" 8 ...
        阅读全文
                
摘要:1 while True: 2 for i in["/","-","\\","|"]: 3 print "%s\r" %i,
        阅读全文
                
摘要:x写一个计算器的小程序,正在筹备中......钱不够,演员未定,剧本暂无,请稍等
        阅读全文
                
摘要:+ plus 加号 • - minus 减号 • / slash 整除 商 (乘除取余的优先级高于加减)• * asterisk 乘号 • % percent 取余 余数 • < less-than 小于号• > greater-than 大于号• <= less-than-equal 小于等于号•
        阅读全文
                
摘要:#的英文:pound character或者octothorpe python中单行注释用#,多行注释用""",看下面的代码: 结果: 特别说明下: 为什么#coding:utf-8能起作用? 我们参考python的官方文档发现,这是规定好的,一共三种方式,第三种方式运用了正则表达式,有兴趣可以去研
        阅读全文
                
摘要:1、我的环境是windows下,需要安装notepad++,安装Python2,配置环境变量(百度下可以见) 2、打开cmd窗口 输入I: 【输入要在哪个磁盘存储python代码(我的在I:\pyhtonCode)】 输入cd PythonCode 【进入PythonCode文件夹】 3、打开I:\
        阅读全文
                
 
                    
                
 浙公网安备 33010602011771号
浙公网安备 33010602011771号