python保存save任意格式_Pythonconfig.save⽅法代码⽰例本⽂整理汇总了Python中config.save⽅法的典型⽤法代码⽰例。如果您正苦于以下问题:Python config.save⽅法的具体⽤法?Python config.save怎么⽤?Python config.save使⽤的例⼦?那么恭喜您, 这⾥精选的⽅法代码⽰例或许可以为您提供帮助。您也可以进⼀步了解该⽅法所在模块config的⽤法⽰例。
在下⽂中⼀共展⽰了config.save⽅法的22个代码⽰例,这些例⼦默认根据受欢迎程度排序。您可以为喜欢或者感觉有⽤的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码⽰例。
⽰例1: ask_user
点赞 3
# 需要导⼊模块: import config [as 别名]
# 或者: from config import save [as 别名]
def ask_user(preferences = {}):
def add_argument(name, help, **kwargs):
kwargs['required'] = ('required', not (name in preferences))
kwargs['default'] = ('default', (name, None))
parser.add_argument('--' + name, help=help, **kwargs)
parser = argparse.ArgumentParser(description="Access MeuAlelo system to extract this month's operations")
add_argument('cpf', "CPF with only numbers")
add_argument('password', "Password used to access the system")
add_argument('card', "Which card from the list we want to access", type=int, default=0)
add_argument('save', "If present saves the provided configurations in an init file",
required=False, action="store_true")
add_argument('month', "Specify for which month transactions must be converted",
required=False, type=int)
return vars(parser.parse_args())
开发者ID:dantas,项⽬名称:alelo_ofx,代码⾏数:19,
⽰例2: handleKlok
点赞 3
# 需要导⼊模块: import config [as 别名]
# 或者: from config import save [as 别名]
def handleKlok(self):
neo =
if config.dirty:
self.updateFromConfig()
config.save()
now = time.localtime()
hour = (now[3] + ("timeoffset",1) ) % 12 h = hour * 5 + (now[4] + 6)/12;
h = int (h % 60)
neo.clearBuffer()
neo.setPixel(29, self.stateColor)
neo.setPixel(31, self.stateColor)
neo.setPixel( 0, self.qColor);
neo.setPixel( 15, self.qColor);
neo.setPixel( 30, self.qColor);
neo.setPixel( 45, self.qColor);
neo.addPixel(now[5] , self.sColor)
neo.addPixel(now[4], self.mColor)
neo.addPixel(h, self.hColor)
neo.writeBuffer()
开发者ID:smeenka,项⽬名称:esp32,代码⾏数:23,⽰例3: startap
点赞 3
# 需要导⼊模块: import config [as 别名]
# 或者: from config import save [as 别名]
def startap(ssid = None,pw = None):
if ssid:
config.put("ap_ssid",ssid)
ssid = ("ap_ssid","micropython2")
if pw:
config.put("ap_pw",pw)
pw = ("ap_pw","12345678")
config.save()
log.info("Starting AP with ssid:%s",ssid)
ap.active(False)
time.sleep_ms(100)
ap.active(True)
time.sleep_ms(100)
开发者ID:smeenka,项⽬名称:esp32,代码⾏数:19,
⽰例4: save_config
点赞 3
# 需要导⼊模块: import config [as 别名]
# 或者: from config import save [as 别名]
def save_config(self, *args):
header = "save_config(): "
print header," "
sys.stdout.flush()
# read parameters from GUI first!
<_param()
config.save(self.param)
print header," done!"
sys.stdout.flush()
return
# ------------------------------------------------------------------
开发者ID:sid5432,项⽬名称:pm-fiber-birefringence,代码⾏数:19,
⽰例5: main
点赞 3
# 需要导⼊模块: import config [as 别名]
# 或者: from config import save [as 别名]
def main():
PiCamera.set(posure, solution) solution = Resolution()
config.degPerPxl = np.divide(config.nativeAngle, solution)
if not config.edited:
GripRunner.editCode()
frameNum = 1
while True:
image = Image()
contours = GripRunner.run(image)
targets = filterContoursFancy(contours, image=image)
isVisible, angleToGoal, distance = findSpike(targets)
if config.debug:
Printing.printResults(contours=contours, distance=distance, angleToGoal=angleToGoal, isVisible=isVisible)
if config.save:
Printing.drawImage(image, contours, targets, center)
Printing.save(image)
try:
NetworkTabling.publishToTables(isVisible=isVisible, angleToGoal=angleToGoal, distance=distance, frameNum=frameNum) except Exception as error:
if config.debug:
print error
frameNum += 1
开发者ID:RoboticsTeam4904,项⽬名称:2017-Vision,代码⾏数:25,
⽰例6: save_if_necessary
点赞 2
# 需要导⼊模块: import config [as 别名]
# 或者: from config import save [as 别名]
def save_if_necessary(preferences):
if preferences['save']:
del preferences['save']
del preferences['month']
config.save(preferences)
开发者ID:dantas,项⽬名称:alelo_ofx,代码⾏数:7,
⽰例7: load_preferences
点赞 2
# 需要导⼊模块: import config [as 别名]
# 或者: from config import save [as 别名]
def load_preferences():
preferences = ad()
preferences['month'] = None
preferences['card'] = ('card', 0))
preferences['save'] = False
return preferences
开发者ID:dantas,项⽬名称:alelo_ofx,代码⾏数:8,
⽰例8: train
点赞 2
# 需要导⼊模块: import config [as 别名]
# 或者: from config import save [as 别名]
def train():
cleanup.cleanup()
c.save(c.work_dir)
data_loader = TextLoader(c.work_dir, c.batch_size, c.seq_length)
with open(os.path.join(c.work_dir, 'chars_vocab.pkl'), 'wb') as f:
cPickle.dump((data_loader.chars, data_loader.vocab), f)
model = _size, c.num_layers, len(data_loader.chars), c.grad_clip, c.batch_size, c.seq_length) with tf.Session() as sess:
tf.initialize_all_variables().run()
saver = tf.train.Saver(tf.all_variables())
for e in range(c.num_epochs):
sess.run(tf.assign(model.lr, c.learning_rate * (c.decay_rate ** e)))
set_batch_pointer()
state = model.initial_state.eval()
for b in range(data_loader.num_batches):
start = time.time()
x, y = _batch()
python新手代码图案如何保存feed = {model.input_data: x, model.targets: y, model.initial_state: state}
train_loss, state, _ = sess.run([st, model.final_state, ain_op], feed)
end = time.time()
print("{}/{} (epoch {}), train_loss = {:.3f}, time/batch = {:.3f}"
.format(e * data_loader.num_batches + b,
c.num_epochs * data_loader.num_batches,
e, train_loss, end - start))
if (e * data_loader.num_batches + b) % c.save_every == 0:

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。