摘要: 一.下载Android studio https://developer.android.google.cn/studio/ 二.安装 首先移动 弹出下面弹框,直接点击OK 提示无法访问Android SDK,直接cancel 弹出如下界面,直接next 选择标准模式,点击next 接下来弹出ui主 阅读全文
posted @ 2018-11-19 23:02 anobscureretreat 阅读(455) 评论(0) 推荐(0)
摘要: myDict = {'a':1,'b':2,'c':3,'d':4} print(myDict) if 'a' in myDict: del myDict['a'] print(myDict) 阅读全文
posted @ 2018-11-19 20:46 anobscureretreat 阅读(206) 评论(0) 推荐(0)
摘要: def is_vowel(char): all_vowels = 'aeiou' return char in all_vowels print(is_vowel('c')) print(is_vowel('e')) 阅读全文
posted @ 2018-11-19 20:12 anobscureretreat 阅读(2962) 评论(0) 推荐(0)
摘要: # Python program to convert decimal number into binary, octal and hexadecimal number system # Change this line for a different result dec = 344 print("The decimal value of",dec,"is:") print(bin(d... 阅读全文
posted @ 2018-11-19 20:02 anobscureretreat 阅读(181) 评论(0) 推荐(0)
摘要: def convertToBinary(n): """Function to print binary number for the input decimal using recursion""" if n > 1: convertToBinary(n//2) print(n % 2,end = '') # decimal number dec = ... 阅读全文
posted @ 2018-11-19 19:58 anobscureretreat 阅读(1363) 评论(0) 推荐(0)
摘要: # Program to generate a random number between 0 and 9 # import the random module import random print(random.randint(0,9)) 阅读全文
posted @ 2018-11-19 19:54 anobscureretreat 阅读(179) 评论(0) 推荐(0)
摘要: import platform import os print(os.name) print(platform.system()) print(platform.release()) 阅读全文
posted @ 2018-11-19 19:52 anobscureretreat 阅读(259) 评论(0) 推荐(0)
摘要: from datetime import date f_date = date(2014, 7, 2) l_date = date(2014, 7, 11) delta = l_date - f_date print(delta.days) 阅读全文
posted @ 2018-11-19 19:47 anobscureretreat 阅读(1135) 评论(0) 推荐(1)
摘要: # For 32 bit it will return 32 and for 64 bit it will return 64 import struct print(struct.calcsize("P") * 8) 阅读全文
posted @ 2018-11-19 19:43 anobscureretreat 阅读(622) 评论(0) 推荐(0)
摘要: import os # Access all environment variables print('*---------------ENVIRON-------------------*') print(os.environ) print('*----------------HOME------------------*') # Access a particula... 阅读全文
posted @ 2018-11-19 19:41 anobscureretreat 阅读(4634) 评论(0) 推荐(0)
摘要: class Rectangle(): def __init__(self, l, w): self.length = l self.width = w def rectangle_area(self): return self.length*self.width newRectangle =... 阅读全文
posted @ 2018-11-19 19:36 anobscureretreat 阅读(267) 评论(0) 推荐(0)
摘要: 新建test.py 运行 然后查看当前目录的runtest.log,会看到下面的结果 阅读全文
posted @ 2018-11-19 18:29 anobscureretreat 阅读(138) 评论(0) 推荐(0)
摘要: my_dict = {'data1':100,'data2':-54,'data3':247} result=1 for key in my_dict: result=result * my_dict[key] print(result) 阅读全文
posted @ 2018-11-19 10:30 anobscureretreat 阅读(1575) 评论(0) 推荐(0)
摘要: keys = ['red', 'green', 'blue'] values = ['#FF0000','#008000', '#0000FF'] color_dictionary = dict(zip(keys, values)) print(color_dictionary) 阅读全文
posted @ 2018-11-19 10:27 anobscureretreat 阅读(701) 评论(0) 推荐(0)
摘要: d = {'x': 10, 'y': 20, 'z': 30} for dict_key, dict_value in d.items(): print(dict_key,'->',dict_value) 阅读全文
posted @ 2018-11-19 10:25 anobscureretreat 阅读(8286) 评论(0) 推荐(0)
摘要: my_dict = {'x':500, 'y':5874, 'z': 560} key_max = max(my_dict.keys(), key=(lambda k: my_dict[k])) key_min = min(my_dict.keys(), key=(lambda k: my_dict[k])) print('Maximum Value: ',my_di... 阅读全文
posted @ 2018-11-19 10:23 anobscureretreat 阅读(2589) 评论(0) 推荐(0)
摘要: dic1={1:10, 2:20} dic2={3:30, 4:40} dic3={5:50,6:60} dic4 = {} for d in (dic1, dic2, dic3): dic4.update(d) print(dic4) 阅读全文
posted @ 2018-11-19 10:16 anobscureretreat 阅读(192) 评论(0) 推荐(0)
摘要: d = {1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60} def is_key_present(x): if x in d: print('Key is present in the dictionary') else: print('Key is not present in the dictionar... 阅读全文
posted @ 2018-11-19 10:15 anobscureretreat 阅读(1961) 评论(0) 推荐(0)
摘要: my_dict = {} if not bool(my_dict): print("Dictionary is empty") 阅读全文
posted @ 2018-11-19 10:12 anobscureretreat 阅读(25569) 评论(0) 推荐(1)
摘要: d = {0:10, 1:20} print(d) d.update({2:30}) print(d) 阅读全文
posted @ 2018-11-19 10:11 anobscureretreat 阅读(851) 评论(0) 推荐(0)
摘要: class dictObj(object): def __init__(self): self.x = 'red' self.y = 'Yellow' self.z = 'Green' def do_nothing(self): pass test = dictObj() ... 阅读全文
posted @ 2018-11-19 10:04 anobscureretreat 阅读(3287) 评论(0) 推荐(0)
摘要: 数组,就是相同数据类型的元素按一定顺序排列的集合,可以是一维数组和多维数组 一维数组 实例 输出 实例 输出 多维数组 实例 输出 实例 输出 阅读全文
posted @ 2018-11-19 00:49 anobscureretreat 阅读(956) 评论(0) 推荐(0)
摘要: 打开调试工具,刷新,可以看到脚本被暂停 阅读全文
posted @ 2018-11-19 00:43 anobscureretreat 阅读(174) 评论(0) 推荐(0)
摘要: 字符串或串(String)是由数字、字母、下划线组成的一串字符。 Lua 语言中字符串可以使用以下三种方式来表示: 单引号间的一串字符。 双引号间的一串字符。 [[和]]间的一串字符。 实例 输出 阅读全文
posted @ 2018-11-19 00:42 anobscureretreat 阅读(173) 评论(0) 推荐(0)
摘要: lua中不能使用nil,特别是#取长度的时候 阅读全文
posted @ 2018-11-19 00:23 anobscureretreat 阅读(190) 评论(0) 推荐(0)
摘要: -- table.getn(tableName) 得到一个table的大小,等同于操作符# -- 要注意的是:该table的key必须是有序的,索引是从1开始的。 --例如有序的 local xiang = {10,22,34,42,51} print("xiang length ==",table.getn(xiang)) --结果为:[LUA-print] xiang lengt... 阅读全文
posted @ 2018-11-19 00:18 anobscureretreat 阅读(3103) 评论(0) 推荐(0)