A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/337064.html below:

help in simplification of code [string manipulation]

help in simplification of code [string manipulation] help in simplification of code [string manipulation]Kent Johnson kent37 at tds.net
Tue Sep 13 11:27:01 EDT 2005
John wrote:
> How could I simplify the code to get libs out of LDFLAGS
> or vice versa automatically in the following python/scons code?
> 
> if sys.platform[:5] == 'linux':
> 	env.Append (CPPFLAGS = '-D__LINUX')
> 	env.Append (LDFLAGS  = '-lglut -lGLU -lGL -lm')
> 	env.Append(CPPPATH=['include', 'include/trackball'])
> 	libs = ['glut', 
> 		'GLU',
> 		'GL',
> 		'm',]

 >>> LDFLAGS  = '-lglut -lGLU -lGL -lm'
 >>> libs = [flag[2:] for flag in LDFLAGS.split()]
 >>> libs
['glut', 'GLU', 'GL', 'm']

Kent

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4