Пример #1
0
def ConditionCompile( fname ) :
	# читаем в список
	list_lines = _cb_type_reader_src( fname )
	#tmp_list = list()
	#for at in list_lines:
	#	tmp = at.replace('\r',' ')
	#	tmp = at.replace(u'\n','')
		#if tmp != u'\r' and tmp != u'' and tmp != u';\r':
	#	tmp_list.append(tmp)
		#print [tmp]
	# пропускаем через препроцессор
	splitter = '#%&'
	purged_list_lines = _purgeList( list_lines )
	string = splitter.join( purged_list_lines )
	string = string.replace(u'\r\n', '')
	#string = string.replace(u'\t\n', '')
	string = string.replace(u'\n', '')
	purged_list_lines = string.split(splitter)
	
	for at in purged_list_lines:
		print [at]
	
	# ищем закомментированные строки и пишем незак. в файл
	sets = { 'name' :  fname, 'howOpen' : 'wb',  'coding' : _wr_enc }
	iow.list2file(sets, purged_list_lines )
Пример #2
0
def linInterpolAirCurve(x, y):
	# Линейная
	f = interp1d(x, y)

	# Новая ось
	xDataSrc = numpy.linspace(1, x[-1], x[-1])
	yDataSrc = f(xDataSrc)
	
	# htp
	rpt = rptCureve(xDataSrc, yDataSrc)
	fname = 'curve.txt'
		
	sets = { 'name': 'curve.txt', 'howOpen': 'w', 'coding': 'cp1251'}
	sensorSettings = iow.list2file( sets, rpt.split('\n') )
	
	#os_w.printStrToNamedFile(rpt, fname)
	
	# выводим данные
	return rpt