Is there a documentation for Python 'gnomekeyring' lib somewhere in the Web?
There is the reference for the C library which the Python package uses. Most function names are identical (except for the "gnome_keyring_" prefix). The Bending Gnome Keyring with Python blog series should give you a good start as well.
And as the keyring package was already mentioned: If I remember correctly, that package supports gnome-keyring as a backend, so you can look at its source code to find out how to use gnome-keyring.
Apparently not. But this one is documented, maybe that's an option?
http://pypi.python.org/pypi/keyring
If not, maybe you can figure out how to use gnomekeyring from reading the source of keyring. :)
Related
I am looking at using the Windows CryptoAPI from Python, but I can't find any existing modules for it - the win32crypt module that comes as part of the win32all suite only exposes a couple of high level functions that are of no use to me.
Are there any existing modules that wrap the CryptoAPI? Searching PyPi has come up with zip. Failing that example code on calling the API from ctypes, cython etc would be useful.
This :
How can I use a DLL file from Python?
+ Getting the addresses of the functions you need from Crypt32.dll should work.
I was looking for something similar to perl's Dumper functionality in python. So after googling I found one which serves me well # https://gist.github.com/1071857#file_dumper.pyamazon
So I downloaded and installed it and it works fine.
But then I came accross PyPI: http://pypi.python.org/pypi which looks like CPAN equivalent for python.
So I searched for the Dumper module there and I could not find it there. I was hoping that this seems like a very basic module and should have been listed in PyPI.
So my question is, if I have to install a python module, then should I search in PyPI first and if i do not find then look other places on google?
OR is there any other Python Module repository apart from PyPI?
I am learning python and hence this question.
thanks.
If you are using pip, pip search package_name would help you do the same as searching on the web interface provided by PyPi.
Once located, installing a python package is of course as easy as
pip install package_name
Some python libraries may be in development stage and may not directly be available on PyPi OR you may want a specific commit has (git) of that library and if you can find that library's source on github.com or on bitbucket.com for example, you can do
pip install -e git+git://github.com/the/repo/url.git#egg=package_name
And regarding your question about perl Dumper, perl's Dumper has two main uses iirc -
data persistence
debugging and inspecting objects.
As far as I know, there's no exact equivalent of perl's Dumper in python.
However, I use pickle for data persistence.
And pprint is useful for visually inspecting objects/debug.
Both of which are standard, built-in modules in Python. There's no necessity for 3rd party libraries for these functionalities.
If you want to use what is here - https://gist.github.com/1071857#file_dumper.pyamazon.
What you need to do is to copy the code and place it in a local file in your project directory. You can name the file something like pydumper.py. Or any name you prefer really, but end it with suffix .py.
In your project, you can import the functions and classes defined in pydumper.py by doing
from pydumper import *
or if you want to be specific (which is preferred. it's better to be explicit about what you are importing.)
from pydumper import Dumper
and you can start using the Dumper class in your own code.
Are you looking for something like easy_install from setuptools? I might have misunderstood your question as I don't use perl.
From the Scripts directory in the python installation directory ("c:/python27/Scripts" on my machine), you can install modules from the command line like so:
easy_install modulename
Makes life alot easier if you set the Scripts directory to your PATH variable.
I am trying to use VTK from python. I tried to find and could not realy find anything on the web which can be used for documentation. I tried looking at the c++ documentation but the methods are very different.
Thanks a lot
You could see the python examples at VTK's wiki. There is another resource by going to the official nightly documentation and looking for a particular class; in the section examples for many (not all) classes you can find implementations in python (also in c++ and tcl). A third option is to go to the source folder of your last downloaded release of VTK; look for the folder "Examples", there you will also find different VTK implementations in python (besides C++ and tcl)
I recommend you use Mayavi and TVTK from Enthought, the API is much pythonic:
http://code.enthought.com/projects/mayavi/
On the VTK website you can find the VTK User's Guide. It is pretty thorough.
For my project I would be using the argparse library. My question is, how do I distribute it with my project. I am asking this because of the technicalities and legalities involved.
Do I just:
Put the argparse.py file along with
my project. That is, in the tar file for my project.
Create a package for it for my
distro?
Tell the user to install it himself?
What's your target Python version? It appears that argparse is included from version 2.7.
If you're building a small library with minimal dependencies, I would consider removing the dependency on an external module and only use facilities offered by the standard Python library. You can access command line parameters with sys.argv and parse them yourself, it's usually not that hard to do. Your users will definitely appreciate not having to install yet another third party module just to use your code.
It would be best for the user to install it so that only one copy is present on the system and so that it can be updated if there are any issues, but including it with your project is a viable option if you abide by all requirements specified in the license.
Try to import it from the public location, and if that fails then resort to using the included module.
You could go with Ignacio's suggestion.
But... For what it is worth, there's another library for argument parsing built into Python, which is quite powerful. Have you tried optparse? It belongs to the base Python distribution and has been there for a while...
Good luck!
I'm looking for a way to interact with the GNU libparted library from Python, but so far what I've found, a GSOC project from 2005 and an Ubuntu/debian package that's been dropped from the archive, have been disheartening.
Is there something I'm missing, or should I just get used to manipulating libparted from the command line / trying to fix the bitrot that's occurred in the other packages?
You mean like the pyparted library?
The reason debian dropped the package is lack of a maintainer. If you are willing (and able) to maintain the existing package and become their maintainer that would be a great contribution to FOSS.
You can try using SIP to generate a Python binding for it. It works for QT so it may work for libparted.
Old thread, but you can also checkout reparted, it's a ctypes python binding.