You can get a specified version of a file without checking out the corresponding commit using git show. For example:
git show git_hash:./file.py
will print the contents of file.py as of the specified commit to standard output. (Presumably the Git Python interface, which I haven't used, provides similar functionality.) The leading ./ avoids path resolution problems in some cases (I don't remember the details).
I've written a Perl script that does this kind of thing for several different version control systems (most of which I no longer use): https://github.com/Keith-S-Thompson/get-versions (no warranties).
As requested, here's an example of running get-versions on a copy of its own repo:
$ ls -l
total 56
-rw-r--r-- 1 kst kst 18092 Aug 9 2015 COPYING
-rw-r--r-- 1 kst kst 6234 Apr 16 2018 README.md
-rw-r--r-- 1 kst kst 940 Apr 25 2018 TODO.md
-rwxr-xr-x 1 kst kst 20977 Apr 16 2018 get-versions
$ get-versions -pad 3 -last 3 get-versions
$ ls -l
total 128
-rw-r--r-- 1 kst kst 18092 Aug 9 2015 COPYING
-rw-r--r-- 1 kst kst 6234 Apr 16 2018 README.md
-rw-r--r-- 1 kst kst 940 Apr 25 2018 TODO.md
-rwxr-xr-x 1 kst kst 20977 Apr 16 2018 get-versions
-r--r--r-- 1 kst kst 20752 Mar 2 10:54 get-versions,012
-r--r--r-- 1 kst kst 20766 Mar 2 10:54 get-versions,013
-r--r--r-- 1 kst kst 20977 Mar 2 10:54 get-versions,014
$
get-versions -help prints an entirely too verbose usage message. (Adding a man page is on my TODO list, as is preserving execute permissions.)
git checkout <git_hash> -- file1.py. However I don't think git was designed to work back and forth like this. Is there a reason you can't create 3 branchesv1/v2/v3and switch between them? Or use a masterfile.pyto swtich betweenfile1/2/3on some condition? Are other files being changed around this one?