本文整理汇总了Python中py4j.java_gateway.JavaGateway.help方法的典型用法代码示例。如果您正苦于以下问题:Python JavaGateway.help方法的具体用法?Python JavaGateway.help怎么用?Python JavaGateway.help使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类py4j.java_gateway.JavaGateway
的用法示例。
在下文中一共展示了JavaGateway.help方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: HelpTest
# 需要导入模块: from py4j.java_gateway import JavaGateway [as 别名]
# 或者: from py4j.java_gateway.JavaGateway import help [as 别名]
class HelpTest(unittest.TestCase):
def setUp(self):
self.p = start_example_app_process()
self.gateway = JavaGateway()
def tearDown(self):
safe_shutdown(self)
self.p.join()
def testHelpObject(self):
ex = self.gateway.getNewExample()
help_page = self.gateway.help(ex, short_name=True, display=False)
self.assertGreater(len(help_page), 1)
def testHelpObjectWithPattern(self):
ex = self.gateway.getNewExample()
help_page = self.gateway.help(
ex, pattern="m*", short_name=True, display=False)
self.assertGreater(len(help_page), 1)
def testHelpClass(self):
String = self.gateway.jvm.java.lang.String
help_page = self.gateway.help(String, short_name=False, display=False)
self.assertGreater(len(help_page), 1)
self.assertIn("String", help_page)
示例2: HelpTest
# 需要导入模块: from py4j.java_gateway import JavaGateway [as 别名]
# 或者: from py4j.java_gateway.JavaGateway import help [as 别名]
class HelpTest(unittest.TestCase):
def setUp(self):
self.p = start_example_app_process()
# This is to ensure that the server is started before connecting to it!
time.sleep(1)
self.gateway = JavaGateway()
def tearDown(self):
safe_shutdown(self)
self.p.join()
def testHelpObject(self):
ex = self.gateway.getNewExample()
help_page = self.gateway.help(ex, short_name=True, display=False)
print(help_page)
self.assertEqual(939, len(help_page))
def testHelpObjectWithPattern(self):
ex = self.gateway.getNewExample()
help_page = self.gateway.help(ex, pattern='m*', short_name=True,
display=False)
print(help_page)
self.assertEqual(644, len(help_page))
def testHelpClass(self):
String = self.gateway.jvm.java.lang.String
help_page = self.gateway.help(String, short_name=False, display=False)
print(help_page)
self.assertEqual(3439, len(help_page))
示例3: JavaGateway
# 需要导入模块: from py4j.java_gateway import JavaGateway [as 别名]
# 或者: from py4j.java_gateway.JavaGateway import help [as 别名]
from py4j.java_gateway import JavaGateway
gateway = JavaGateway()
instance = gateway.entry_point.getInstance()
gateway.help(instance)
c = instance.queryUnsettled()
print type(c)
# print c.encode('big5')
list = c.split()
num_items = len(list)/13
summary = list[0:13]
print num_items
print summary
print list