~ after script filename?

Benjamin Niemann pink at odahoda.de
Wed Sep 7 06:17:56 EDT 2005


presentt wrote:

> Hello all,
> 
> I just wrote a really simple script and named it helloworld.py.  Inside
> was only:
> 
> #!/usr/bin/env
> print "Hello, world"
> 
> I used chmod to set the permissions, and ran it to see what happened (I
> just started learning Python, if you couldn't guess)
> 
> Then, I typed ls in the directory to see what was there, and I noticed
> a new file, namely helloworld.py~ .  What is that file (its contents
> are identicle to helloworld.py)?  Why the ~?
> 
> Thanks a lot.  I'm using Ubuntu Linux 5.04 (Hoary), and wrote the
> script with gedit.
> 
> ~~Ted Present

As others have already said: this is not a python issue.

A ~ suffix is commonly used by editors for backup file. If you save a file
from the editor, and the file already exists (so it doesn't happen the
first time you save a new file), the existing version is renamed with the ~
suffix.

After some time, you will learn to simply ignore these files ;)
Many file managers have already learnt this lesson and have options to hide
such backup files.

-- 
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/



More information about the Python-list mailing list