[Tutor] subprocess.call not formatting date

Bob Williams linux at barrowhillfarm.org.uk
Tue Jul 8 20:23:14 CEST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/07/14 18:12, Peter Otten wrote:
> I suggest that you calculate the folder name in Python instead:
> 
> # untested name =
> datetime.datetime.now().strftime("%y-%m-%d_%H-%M") destpath =
> os.path.join("/home/bob/A3/docsnaps", name) subprocess.call( 
> ["btrfs", "subvolume", "snapshot", "/home/bob/A3/documents",
> destpath])

Thank you. That worked perfectly. Once it's pointed out it is obvious
to use the python solution, but my brain is becoming less agile as I
collect more birthdays!

Bob
- -- 
Bob Williams
System:  Linux 3.11.10-17-desktop
Distro:  openSUSE 13.1 (x86_64) with KDE Development Platform: 4.13.2
Uptime:  06:00am up 2 days 9:43, 5 users, load average: 0.00, 0.02, 0.05
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlO8Nw8ACgkQ0Sr7eZJrmU6HVwCaAkT+nqxn818s1Di8mgqc9U1a
qksAni7exn27xTGgDV2O6vSNtg8FbgMK
=9I7G
-----END PGP SIGNATURE-----


More information about the Tutor mailing list