#define equivalents and config files

Rich Salz r.salz at verizon.net
Wed Mar 20 23:38:13 EST 2002


> Is there a pythonic way of doing something similiar to Cs #define?
 >... are globals the only way to go?

You can at least make them class attributes
	class constants:
		pi = 3.14159
		e = 2.71828
adding your own setattr can serve to make them read-only.
	/r$

	




More information about the Python-list mailing list