INNER CODE UNIT · Python

remove_all_assignments_from_file

tanersener/mobile-ffmpeg · src/libsndfile/make_lite.py:144

def remove_all_assignments_from_file (filename, var_list):
	source_code = open (filename, 'r').read ()

	for var in var_list:
		source_code = remove_all_assignments (source_code, var) ;
	open (filename, 'w').write (source_code)

def remove_comment_start_end (filename, start_comment, end_comment):
	source_code = open (filename, 'r').read ()

	while 1:
		start_index = string.find (source_code, start_comment)
		end_index = string.find (source_code, end_comment)
		if start_index < 0 or end_index < start_index:
			break
		end_index += len (end_comment)
		source_code = source_code [:start_index-1] + source_code [end_index:] ;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…