Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to short the string variable ?

Hi folks,

When I use this:

filename = os.path.basename(savecases)

I get something like "summerlight.sav"; the extension comes as well. Please, is there a python code to shorten it to "summerlight" only, I mean, to get rid of the extension ?

Thanks a lot, Andre

click to hide/show revision 2
code highlighting

How to short the string variable ?

Hi folks,

When I use this:

filename = os.path.basename(savecases)

os.path.basename(savecases)

I get something like "summerlight.sav"; "summer_light.sav"; the extension comes as well. Please, is there a python code to shorten it to "summerlight" "summer_light" only, I mean, to get rid of the extension ?

Thanks a lot, Andre

click to hide/show revision 3
retagged

How to short the string variable ?

Hi folks,

When I use this:

filename = os.path.basename(savecases)

I get something like "summer_light.sav"; the extension comes as well. Please, is there a python code to shorten it to "summer_light" only, I mean, to get rid of the extension ?

Thanks a lot, Andre