Projet

Général

Profil

Anomalie #144 » EcrireChampTemp.py

Frank Petitjean, 12/07/2017 17:09

 
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 26 11:34:35 2017

@author: Frank
"""

import sys
import numpy as np

nombre_noeuds = 121
nom_fichier = 'champTemp.txt'

val_temp = 10

temp_inf = 10
temp_sup = 20

texte = 'N_to champ_de:\n'
for i in range(nombre_noeuds):
# temp = val_temp
temp = np.random.random_sample()*(temp_sup-temp_inf) + temp_inf
texte += ''' ' TEMP= {:.0f} ' # noeud {:4d}\n'''.format(temp, i+1)
texte+= 'fin_champ_de_ \n\n'


# Ecriture du fichier de température
with open(nom_fichier,'w') as fichier:
fichier.write(texte)
(1-1/7)
Redmine Appliance - Powered by TurnKey Linux