I would really like to highlight something Tal has already said: Python
strings are immutable. That means if you construct a string object, you
don't have to worry about someone else going in and changing that
object. What might happen, however, is that someone might reassign a
variable you have wh
Hans wrote:
> I want to define a couple of constant strings, like in C:
> #define mystring "This is my string"
> or using a const char construction.
>
> Is this really not possible in Python?
No, this is not really not possible in Python:
$ ls
preprocess.pyp
$ cat preprocess.pyp
#define MYSTRIN
Hans wrote:
> Hi,
>
> I want to define a couple of constant strings, like in C:
> #define mystring "This is my string"
> or using a const char construction.
>
> Is this really not possible in Python?
>
> Hans
One last note:
If you truly insist on having constant variables, you could write a
class
Hans wrote:
> Hi,
>
> I want to define a couple of constant strings, like in C:
> #define mystring "This is my string"
> or using a const char construction.
>
> Is this really not possible in Python?
>
> Hans
It is really not possible.
The Pythonic way (as far as I have come to know it) is to st