[Tutor] a par2 creator and verification program

2019-07-23 Thread Adam Gold
Hello everyone. I'm thinking through a short program I want to write that will 'par2'/generate ECCs for all of my work files which branch out from a single directory and number approximately 15,000. Specifically: 1) day one: - create a mirror copy of the directory tree empty of all files (the

[Tutor] pexpect interactive password entry for luks device

2014-11-24 Thread Adam Gold
I'm trying to do something really simply (I think) with pexpect but must be missing an obvious step. I want to ssh from host to guest, establish a CIFS connection on the guest to a share somewhere else on the local network, open a luks loop device on the share by entering the password (I don't wan

Re: [Tutor] code review

2014-06-13 Thread Adam Gold
On 12/06/14 00:38, Alan Gauld wrote: > > HTH Thanks Alan and Lukáš for your very helpful comments. I will attempt to revise the script in light of them and will revert if I hit any brick walls :) ___ Tutor maillist - Tutor@python.org To unsubscribe

Re: [Tutor] code review

2014-06-11 Thread Adam Gold
think some of the comments have been wrapped onto more than one line by my email client, I hope this doesn't cause too much inconvenience. ==== #!/usr/bin/python3 ## XEN VIRTUAL MACHINE BACKUP SCRIPT ## ## Copyright (C) 2014 Ada

Re: [Tutor] code review

2014-06-11 Thread Adam Gold
On 11/06/14 00:04, Steven D'Aprano wrote: > On Tue, Jun 10, 2014 at 04:51:20PM +0100, Adam Gold wrote: >> Hi there. I've been writing a script that is now finished and working >> (thanks, in part, to some helpful input from this board). What I'd >> really lik

[Tutor] code review

2014-06-10 Thread Adam Gold
Hi there. I've been writing a script that is now finished and working (thanks, in part, to some helpful input from this board). What I'd really like to do now is go through it with an 'expert' who can point out ways I may have been able to code more efficiently/effectively. I don't think it woul

Re: [Tutor] gnupg within a for loop

2014-06-02 Thread Adam Gold
On 02/06/14 01:35, Danny Yoo wrote: >> Thanks Danny, that was spot on. I actually used os.chdir to change to >> the base directory (which I assigned to a variable) just before the open >> statement. I don't know if that's 'pythonically' correct but it seemed >> like a simple way to do it. Again,

Re: [Tutor] gnupg within a for loop

2014-06-02 Thread Adam Gold
On 01/06/14 18:28, Danny Yoo wrote: > Hi Adam, > > Ah; I've seen this before. Make sure the file name is either relative > to current working directory, or make the file name absolute. What's > happening is that os.listdir() is giving you file names that are > relative to the base directory you

[Tutor] gnupg within a for loop

2014-06-01 Thread Adam Gold
Hi there. I'm trying to do the following using python 3: create a list from all files in a particular directory, then loop over that list symmetrically encrypting each file using the gnupg module (note, for the moment I'm embedding the passphrase in the code while obviously in practice it would ha

Re: [Tutor] pipes and redirecting

2014-05-28 Thread Adam Gold
> On 27/05/14 21:01, Adam Gold wrote: > >> "dd if=/home/adam/1 bs=4k conv=noerror,notrunc,sync | pbzip2 > 1.img.bz2" >> >> The first thing I do is break it into two assignments > > And that's the start of the problem because it should be three:

[Tutor] pipes and redirecting

2014-05-27 Thread Adam Gold
I'm trying to run the following unix command from within Python as opposed to calling an external Bash script (the reason being I'm doing it multiple times within a for loop which is running through a list): "dd if=/home/adam/1 bs=4k conv=noerror,notrunc,sync | pbzip2 > 1.img.bz2" The first thing

Re: [Tutor] ssh socks proxy

2012-05-17 Thread Adam Gold
me script would look like if one used paramiko? On 17 May 2012, at 04:01, kushal.kumaran+pyt...@gmail.com wrote: kushal.kumaran+pyt...@gmail.com wrote: > Adam Gold wrote: > >> I'm trying to write a 'simple' script that will set up a socks proxy >> ove

[Tutor] ssh socks proxy

2012-05-16 Thread Adam Gold
I'm trying to write a 'simple' script that will set up a socks proxy over ssh and maintain the connection until manually terminated. It's not possible to use key-based authentication so a password will need to be supplied. Also, note, the user is presented with a list of servers to choose fro

Re: [Tutor] different behaviour in Idle shell vs Mac terminal

2012-01-09 Thread Adam Gold
> Date: Sun, 8 Jan 2012 23:34:15 + > From: Adam Gold > To: > Subject: [Tutor] different behaviour in Idle shell vs Mac terminal > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > > I have short piece of code I'm using to print a

[Tutor] different behaviour in Idle shell vs Mac terminal

2012-01-08 Thread Adam Gold
I have short piece of code I'm using to print a string to the terminal one letter at a time.  It works fine when I invoke the script from within Idle; each letter appears after the preceding one according to the designated time interval.  However if I run it in the Mac terminal ('python3 ./scri