有没有办法在dis.dis()没有重定向的情况下获得输出sys.stdout?我试过了:
out=str(dis.dis())
Run Code Online (Sandbox Code Playgroud)
和
out=""""""
out+=str(dis.dis())
Run Code Online (Sandbox Code Playgroud)
但是我很快发现它又回来了None.有没有什么办法解决这一问题?
如何在特定方法中调用其他类的方法?
例
方法getItem1()
public String getItem1() throws UnsupportedEncodingException{
String a = "2";
a.getBytes();
a.getBytes("we");
System.out.println(a);
int t = Integer.parseInt(a);
return a;
}
Run Code Online (Sandbox Code Playgroud)
调用的方法getItem1()是:
String.getBytes()String.getBytes(String)PrintStream.println(String)Integer.parseInt(String)