>>>>>>> def main(): print("Backing up ", src_path,
>>>>>>> "/Documents\n", sep='') do_sync(doc_srcpath,
>>>>>>> doc_syncpath) create_snaps(doc_syncpath, doc_snappath)
>>>>>>> print("
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 05/02/15 14:59, DaveA wrote:
>
>
> On February 5, 2015 8:27:29 AM EST, Bob Williams
> wrote:
>> Hi,
>>
>> My script is running under Python 3.4.1 on a 64bit openSUSE
>> linux system. It is a backup scrip
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 05/02/15 13:57, Mark Lawrence wrote:
> On 05/02/2015 13:27, Bob Williams wrote:
>
>>
>> I would like to reduce all those repeated calls to do_sync() in
>> main(), for example, to one by putting the *_srcpath and
>&
n)
print("\nAll backups completed.")
print("\nUnmounting backup drive.\n")
subprocess.call(['umount', mnt_path])
print("\n>>> Please power down the Quad external drive enclosure <<<\n")
if __name__ == "__main__":
t;/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 les
ell=True)
File "/usr/lib64/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib64/python2.7/subprocess.py", line 658, in __init__
raise TypeError("bufsize must be an integer")
TypeError: bufsize must be an i
ge, ShowMeDo etc.
>
> But I thought the tutor list readers might be an interesting source
> of alternatives that I hadn't thought of, or even heard of.
>
> All contributions considered :-)
>
Python Module of the Week <http://pymotw.com/2/>
Bob
- --
Bob Williams
System: L
benefit. Others can ignore the thread if they wish.
Bob
- --
Bob Williams
System: Linux 3.11.10-11-desktop
Distro: openSUSE 13.1 (x86_64) with KDE Development Platform: 4.13.1
Uptime: 06:00am up 3 days 11:36, 3 users, load average: 0.05, 0.03, 0.05
-BEGIN PGP SIGNATURE-
Version:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi Steven,
On 03/05/14 02:53, Steven D'Aprano wrote:
> Hi Bob, and welcome!
>
> My responses interleaved with yours, below.
>
> On Fri, May 02, 2014 at 11:19:26PM +0100, Bob Williams wrote:
>> -BEGIN PGP SIGNED MESSAGE
ests that the first 'if' clause (matching the first 10
characters of the last line) is satisfied, but the second one isn't,
as the flow jumps to the second 'else' clause.
As the script runs without complaint, this is presumably a logical
error rather than a syntax error,
My first
> guess was that standard slice notation on the first index would do it,
> but it doesn't! Instead, we get the rows again:
>
> In [6]: l[:][0]
> Out[6]: [11, 12, 13]
>
> In [7]: l[:][1]
> Out[7]: [21, 22, 23]
>
Jose,
Just for clarity, are you trying to acces
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 26/02/14 15:41, Bob Williams wrote:
On 26/02/14 05:31, Cameron Simpson wrote:
>>> linkName1 = pathList[j][0:-3] + "mp3"
>>>
>>> Isn't this exactly the same as pathList[j] ?
>>>
> Actually
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 26/02/14 17:29, Ben Finney wrote:
> Bob Williams writes:
>
>> In [3]: print metadata["artist"] [u'The Incredible String Band']
>>
>> I now want to pass that string to another program, but I want to
&
gs[key]
File "/usr/lib/python2.7/site-packages/mutagen/_vorbis.py", line
184, in __getitem__
if not values: raise KeyError, key
KeyError: 'date'
If it's possible to edit the string value that gets passed to
subprocess.call('lame'...) - see problem #1 above, wou
05:31, Cameron Simpson wrote:
> Hi Bob,
>
[...]
>
> The other things are just script remarks, not directly related to
> your problem:
>
> On 24Feb2014 16:07, Bob Williams
> wrote:
>> if pathList[j][-3:] == "mp3":
>
> This is often written (I'
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 24/02/14 16:56, Mark Lawrence wrote:
> On 24/02/2014 16:36, Peter Otten wrote:
>> Bob Williams wrote:
>>
[...]
>>> Thanks,
>>
>> os.symlink(existing_file, symlink_to_create)
>>
>> fails with that e
>
Peter,
Many thanks. I was fixating on the existing_file, not realising I had
to create a home for the symlink first.
> try: os.makedirs(os.path.dirname(symlink_to_create)) except OSError
> as err: # Assume the directory exists. # A thorough coder would
> check the errno here pass
Rega
paths in manually.
I have tried escaping the spaces with '\', but the same error is
generated.
The file "/home/bob/music/artists/Death in June/1995 Rose Clouds Of
Holocaust/10 Lifebooks.mp3" definitely exists.
Thanks,
Bob
- --
Bob Williams
System: Linux 3.11.10-7-desktop
Distr
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 12/02/14 00:58, Dave Angel wrote:
> Bob Williams Wrote in message:
>
>
>> to slice those lines to get the artist and album names into a
>> list.
>>
>> So far, so good but my output contains duplicates, so my fi
m
names into a list.
So far, so good but my output contains duplicates, so my final task is
to work out how to get rid of them.
You may find me popping up here again in a few days ;-)
Good luck.
Bob
- --
Bob Williams
System: Linux 3.11.10-7-desktop
Distro: openSUSE 13.1 (x86_64) with KDE Developme
20 matches
Mail list logo