本文整理汇总了Python中GUI.GUI属性的典型用法代码示例。如果您正苦于以下问题:Python GUI.GUI属性的具体用法?Python GUI.GUI怎么用?Python GUI.GUI使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类GUI
的用法示例。
在下文中一共展示了GUI.GUI属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parse_args
# 需要导入模块: import GUI [as 别名]
# 或者: from GUI import GUI [as 别名]
def parse_args():
parser = argparse.ArgumentParser(formatter_class=RawTextHelpFormatter, description= \
"Usage: python passmaker.py <OPTIONS> \n")
menu_group = parser.add_argument_group('Menu Options')
menu_group.add_argument('-o', '--output', help="password dict file", default=None)
menu_group.add_argument('-i', '--interactive', help="interactive mode",action='store_true',default=False)
menu_group.add_argument('-g', '--gui', help="GUI mode", action='store_true', default=False)
argcomplete.autocomplete(parser)
args = parser.parse_args()
return args
示例2: simulate
# 需要导入模块: import GUI [as 别名]
# 或者: from GUI import GUI [as 别名]
def simulate():
# Get all the necessary data
t = gen.time_vector()
y = vco.z_component(t)
# Store old values
[t, y] = ops.get_sample_above_limit(y, t)
n = len(y)
# Generate random data
perts = gen.pertubations(n)
uncerts = gen.uncertanties(n)
# Abracadabra !
yt = ops.add_pertubations(y, perts)
z = ops.get_normalized_v(yt, uncerts)
X = ops.get_design_matrix(t, uncerts)
B = ops.get_least_squares(z, X)
fit = ops.get_max_likelihood(B, t)
Q = ops.get_min_chisquared(z, X, B)
cov = ops.get_covariance(X)
P = ops.get_pearson_correlation(cov)
[B1, B2, B3] = ops.read_beta_hats("beta");
# Plot results
graphics = GUI([t, y, perts, uncerts, yt, z, X, B, fit, Q]);
graphics.plot_data();
graphics.scatter_plot(B1, B2, B3);
graphics.plot_ellipsoid();
示例3: main
# 需要导入模块: import GUI [as 别名]
# 或者: from GUI import GUI [as 别名]
def main(_):
pp.pprint(flags.FLAGS.__flags)
'''
if not os.path.exists(FLAGS.checkpoint_dir):
os.makedirs(FLAGS.checkpoint_dir)
if not os.path.exists(FLAGS.sample_dir):
os.makedirs(FLAGS.sample_dir)
'''
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
#config.gpu_options.per_process_gpu_memory_fraction = 0.6
with tf.Session(config=config) as sess:
dcgan1=DCGAN(sess,
image_size=FLAGS.image_size,
batch_size=FLAGS.batch_size,
output_size=FLAGS.output_size,
y_dim=None,
embedding_dim=FLAGS.embedding_dim,
c_dim=FLAGS.c_dim,
Lambda=FLAGS.Lambda,
dataset_name='wikiart',
is_crop=FLAGS.is_crop,
checkpoint_dir=FLAGS.checkpoint_dir,
sample_dir=FLAGS.sample_dir,
model_name='dcgan1')
dcgan0 = DCGAN(sess,
image_size=FLAGS.image_size,
batch_size=FLAGS.batch_size,
output_size=FLAGS.output_size,
y_dim=FLAGS.y_dim,
embedding_dim=FLAGS.embedding_dim,
c_dim=FLAGS.c_dim,
Lambda=FLAGS.Lambda,
dataset_name='coco',
is_crop=FLAGS.is_crop,
checkpoint_dir=FLAGS.checkpoint_dir,
sample_dir=FLAGS.sample_dir,
model_name='dcgan0')
init=tf.global_variables_initializer()
sess.run(init)
#all_vars=tf.trainable_variables()
dcgan0.load(FLAGS.checkpoint_dir)
dcgan1.load(FLAGS.checkpoint_dir)
if FLAGS.is_GUI:
root = Tk()
myGUI = GUI(root, dcgan0,dcgan1)
root.mainloop()