本文整理匯總了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()