您的位置:365bet体育备用网址器 > 应用 > monkeyrunner运转报错如下,但java要写100行代码的功

monkeyrunner运转报错如下,但java要写100行代码的功

2019-12-26 18:32

<第一天>--Python学习_01,--python_01

1、python介绍
(1)、linux系统自带python.
(2)、python有自己的库.
(3)、java运行效率比python高,但java要写100行代码的功能,而python用10行代码即可完成.
(4)、GO语言的网络请求最好,但在正则方面比较弱.
2、python与C的运行机制
(1)、C语言:直接转为机器码交给计算机进行运行。
(2)、其它语言:字节码--->机器码--->交给计算机运行。
3、python种类
(1)、CPython:--->解释型,编译一行运行一行。
(2)、Pypy:一次性把全部代码编译为机器码-->一次性运行。
(3)、其它python:代码-->其它语言的字节码-->机器码运行。
4、python编码
(1)、ASCIL码:256位(英文),一个字节8位。
(2)、万国码:两个字节,至少16位。
(3)、UTF-8:三个字节,24位。
(4)、GBK:两个字节,16位。
5、python生命变量方式
(1)、字母。
(2)、数字(不能用作开头)。
(3)、下划线(可做分割使用)。
(4)、不可以用作关键字。
列:《1》
import  getpass   # 引入加密模块
pwd = getpass.getpass('请输入密码:')
name = input('请输入名字:')
print(pwd)
print(name)
6、if...else...判断语句
语法1:
if (条件判断):
   print('条件正确,走这里')
else:
   print('否则走这里')
列:《1》
username = input('>>>:')
if username == 'zhaosj':
   print('普通管理员')
elif username == 'oldboy':
   print('超级管理员')
elif username == '郭少龙':
   print('人')
elif username == '六一':
   print('装逼犯')
else:
   print('再见')
列:《2》---嵌套if语句
user_type = input('请输入用户类型:')
if user_type == '管理员':
   username = input('输入用户名:')
   if username == 'alex':
      print('ow')
else:
      print('low 鸡')
语法2:
if xxx in xxxooo:
   print('xxx在xxxooo里')
else:
   print('xxx不在xxxooo里')
列:《1》
content = '我们都是好孩子'
if '都好' in content:
   print('包含敏感字符')
else:
   print('都好不在content中')
列:《2》
content = '我们都好孩子'
if '他的' not in content:
   print ('包含敏感字符')
else:
   print (content)
7、while循环语句(while:当)
列:《1》
while True   # 当为真时
        user = input('输入用户名:')
        pwd = input('输入密码:')
        if user == 'zhaosj' and pwd == 'ow':
           print('登陆成功')
           break  # 跳出循环终止循环
        else:
           print('用户名或密码错误,请想想...')
print('end')
列:《2》
--利用while循环,两种方法输出1,2,3,4,5,6,8,9,10
第一种方法:
i = 1
while True:
      if i == 7:
         pass  #占位符,什么都不做
      else:
         print(i)
      i = i+1
      if i == 11
         break  # 跳出循环结束循环

<-------------------------------------------------->
第二种方法:
i = 1
while True:
     if i == 7:
        i = i+1
     continue  # 跳出本次循环,开始下次循环
     print(i)
        i = i+1
        if i == 11:
          break      # 结束所有循环
列:《3》
---while循环,计算1--100的和
value = 0 # 初始值为0
i = 1
while i < 101:   # i 从1开始,小于101为止。
i = i+1 # 每次循环i就加1
print(value)
列:《4》
---while循环,打印出1--100[余数=0为偶数,余数=1为奇数]
i = 1
while i<101:
       if i % 2 == 1:
          print(i)
       i = i+1
列:《5》
---while循环+if判断,用户登录操作只有三次机会
i = 0
while i < 3
       user = input('请输入用户名>>>:')
       pwd = input('请输入密码>>>:')
       if user == 'zhaosj' and pwd == 'ow':
            print('登录成功')
            break
       else:
            print('登录失败')
            i +=1

1、python介绍 (1)、linux系统自带python.(2)、python有自己的库.(3)、java运行效率比python高,但java要写100行代码的功...

monkeyrunner运行报错如下
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] Script terminated due to an exception
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]Traceback (most recent call last):
File "E:AppiumToolsAndroidAndroid-sdkandroid-sdk-windowstoolslibLibencodings__init__.py", line 31, in
import codecs
File "E:AppiumToolsAndroidAndroid-sdkandroid-sdk-windowstoolslibLibcodecs.py", line 16
except ImportError as why:
^
SyntaxError: mismatched input 'as' expecting COLON

181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.ParserFacade.fixParseError(ParserFacade.java:92)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.ParserFacade.parse(ParserFacade.java:184)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.imp.compileSource(imp.java:326)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.imp.createFromSource(imp.java:348)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.imp.loadFromSource(imp.java:581)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.imp.find_module(imp.java:478)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.imp.import_next(imp.java:718)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.imp.import_first(imp.java:748)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.imp.import_module_level(imp.java:837)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.imp.importName(imp.java:917)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.ImportFunction.__call__(__builtin__.java:1220)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.PyObject.__call__(PyObject.java:357)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.__builtin__.__import__(__builtin__.java:1173)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.imp.importOne(imp.java:936)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at encodings$py.f$0(E:AppiumToolsAndroidAndroid-sdkandroid-sdk-windowstoolslibLibencodings__init__.py:152)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at encodings$py.call_function(E:AppiumToolsAndroidAndroid-sdkandroid-sdk-windowstoolslibLibencodings__init__.py)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.PyTableCode.call(PyTableCode.java:165)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.PyCode.call(PyCode.java:18)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.imp.createFromCode(imp.java:391)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.imp.createFromPyClass(imp.java:209)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.imp.loadFromSource(imp.java:572)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.imp.find_module(imp.java:478)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.imp.import_next(imp.java:718)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.imp.import_first(imp.java:739)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]365bet在线官网, at org.python.core.imp.load(imp.java:631)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.codecs.import_encodings(codecs.java:109)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.codecs.registry_init(codecs.java:405)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.codecs.lookup(codecs.java:74)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.codecs.encode(codecs.java:192)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.PyString.str_encode(PyString.java:2458)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.PyString.encode(PyString.java:2449)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.GrammarActions.extractString(GrammarActions.java:472)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.GrammarActions.extractStrings(GrammarActions.java:428)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.atom(PythonParser.java:10896)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.power(PythonParser.java:10215)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.factor(PythonParser.java:10142)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.term(PythonParser.java:9696)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.arith_expr(PythonParser.java:9422)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.shift_expr(PythonParser.java:9149)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.and_expr(PythonParser.java:8982)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.xor_expr(PythonParser.java:8819)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.expr(PythonParser.java:8655)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.comparison(PythonParser.java:8201)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.not_test(PythonParser.java:8128)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.and_test(PythonParser.java:7920)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.or_test(PythonParser.java:7758)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.test(PythonParser.java:7618)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.testlist(PythonParser.java:12581)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.expr_stmt(PythonParser.java:3032)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.small_stmt(PythonParser.java:2584)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.simple_stmt(PythonParser.java:2433)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.stmt(PythonParser.java:2347)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.PythonParser.file_input(PythonParser.java:641)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.antlr.BaseParser.parseModule(BaseParser.java:78)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.CompileMode$3.dispatch(CompileMode.java:22)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.ParserFacade.parse(ParserFacade.java:152)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.ParserFacade.parse(ParserFacade.java:182)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.Py.compile_flags(Py.java:1731)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.__builtin__.execfile_flags(__builtin__.java:514)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:225)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at com.android.monkeyrunner.ScriptRunner.run(ScriptRunner.java:116)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at com.android.monkeyrunner.MonkeyRunnerStarter.run(MonkeyRunnerStarter.java:77)
181031 16:29:52.035:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter.java:189)

本文由365bet体育备用网址器发布于应用,转载请注明出处:monkeyrunner运转报错如下,但java要写100行代码的功

关键词: