String literals: Where do they go?

A common technique is for string literals to be put in “read-only-data” section which gets mapped into the process space as read-only (which is why you can’t change it). It does vary by platform. For example, simpler chip architectures may not support read-only memory segments so the data segment will be writable. Rather than try … Read more

Windows path in Python

you can use always: ‘C:/mydir’ this works both in linux and windows. Other posibility is ‘C:\\mydir’ if you have problems with some names you can also try raw string literals: r’C:\mydir’ however best practice is to use the os.path module functions that always select the correct configuration for your OS: os.path.join(mydir, myfile) From python 3.4 … Read more