[Tutor] Help with python-gnupg

Becky Mcquilling ladymcse2000 at gmail.com
Sun Mar 13 08:43:58 CET 2011


Thanks, everyone:

Your suggestions worked.  I will make sure to include full information next
time.

Becky

On Sat, Mar 12, 2011 at 12:14 AM, Steven D'Aprano <steve at pearwood.info>wrote:

> Becky Mcquilling wrote:
>
>> If anyone is familiar with python-gnupg, I am having some difficulty with
>> the syntax.  I've tried the following:
>>
>
> When dealing with third party packages, unless it is an extremely
> well-known package like numpy or nltk, it is usually a good idea to link to
> the project's home page. Do you mean this project?
>
> http://packages.python.org/python-gnupg/
>
> Reading the documentation, I think either of these should work:
>
>
> #1 encrypt data in a file
> input_file = open('c:/test/filename.txt', 'r')
> # notice that you open the file, but do not read from it.
> encrypted_data = gpg.encrypt_file(input_file, 'ladymcse at gmail.com',
>    output='c:/gpg_test/data.gpg2')
>
>
> #2 encrypt data from a string
> data = open('c:/test/filename.txt', 'r').read()
> encrypted_data = gpg.encrypt_file(data, 'ladymcse at gmail.com',
>    output='c:/gpg_test/data.gpg2')
>
> It looks like the problem you have is that you are passing the output file
> object, instead of just the file name.
>
>
> If this doesn't solve your problem, please post the exact error message in
> full, including the traceback, with the exact code you are using.
>
>
>
>
> --
> Steven
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110312/14e728b5/attachment.html>


More information about the Tutor mailing list