[Tutor] how to change the command "string" on a tkinter Button?

Alan Gauld alan.gauld at yahoo.co.uk
Sun Jul 1 18:34:32 EDT 2018


On 01/07/18 11:33, Chris Roy-Smith wrote:

>> Even better would be to learn a form of VCS (version control system)

> I don't know anything about these tools, 

VCS store versions of a file. You can check for differences between
versions, restore previous versions, even merge different versions.
Modst also allow you to freeze a collection of file versions for a
release so that you can restore a previous version of your project.
They are what all professional programmers use on big projects.

One of the oldest and simplest VCS tools is RCS (Revision Control
System). It basically has 2 commands:
ci - checkin a file.
co - check out a version.

So you create a file and get it working.
Create a folder in your project folder called RCS
Check it in and keep a copy for editing

ci -l myfile.py


Now make changes until you have a new version
check it in
ci -l myfile.py

Realize that you made a mistake, get the original
version back

co -l -v1.1 myfile.py

and so on.
At each check in the system will ask you to
describe your changes

There are other commands you can use to query the
versions etc. The system only stores the differences
between versions so doesn't use a huge amount of storage.

https://www.gnu.org/software/rcs/

More recent systems work on servers across a network
and tend to operate at the project/folder level rather
than individual files, but the basic ideas remain
the same. Steven mentioned Mercurial and Git, there
is also Subversion(SVN) and CVS(based on RCS and
by the same team). There are also commercial tools,
some costing up to $1000 per seat! Its big business.
One of the best is ClearCase (now owned by IBM?),
nearly magical in its capabilities but very expensive!

Some editors will have menu commands to automatically
do the check in/out operations for you once you configure
the tool and paths in the properties.

> I use Kate as my editor 

Perfectly fine tool, no need to change unless you want
to.

> ...Idle only looks useful for CLI stuff.

Not at all it has a full file editor and integrated
interpreter so you can save your file and hit F5 to
run the code with the output in the "shell window"
(which is what appears at startup)

Even better is IDLEX which has a lot of extra features
such as tabbed editing windows, code folding,  line numbering,
intelligent paste from the shell, etc etc...

Many IDLEX features are planned for future IDLE releases,
but the approval process takes time. Meanwhile IDLEX
is available here:

http://idlex.sourceforge.net/features.html

And all written in Python/Tkinter so a great place
to learn Tkinter tricks!

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list