Detailed explanation about Python's "freeze" - python

Is there anywhere a detailed explanation about Python's "freeze" thing? I saw the PyPi page, but I don't think it's comprehensive enough.

There is documentation about freeze on the wiki and the source docstring is pretty good.. There is an alternative, cx_Freeze. For windows there is py2exe. For Macs, py2app.
Unless you are trying to make a single-download type program for windows, it is often easier to rely on eggs or source packages installed via setup.py/setuptools/distribute/pip.

Related

Can the LibreOffice LightProof grammar library be used externally?

LibreOffice 3.5 includes a grammar checker, called (or maybe based on) LightProof. From what I have read, LightProof seems to be a Python library that can be used to check for custom grammar rules. But I can not for the life of me find a project page for LightProof.
The closest I got was http://cgit.freedesktop.org/libreoffice/lightproof/tree/, which seems to be the code for the LibreOffice extension, not LightProof itself.
So is LightProof actually a library that can be implemented in other applications, or is it just a code word for a LibreOffice feature?
LightProof has been superseded by LanguageTool, the source of which is available on GitHub.
It's not possible yet, but: "we will be able to make a stand-alone version of Lightproof/Grammalecte as it won’t be necessary to use Hunspell anymore" - see Olivier R.'s post to the LibreOffice mailing list.

PyGObject in Python 3 on windows

Does anyone know if its possible to install PyGObject/Gtk+3 on windows for Python 3? I have found installers on gnome's website for Python 2 (here), and several statements that it works with Python 3 (e.g. here), but no installer. The compilation instructions all seem to use jhbuild, which from what I can make out is a linux tool. Do I need to compile PyGObject to get it working, and if so, how? Or is there an easier way? What would be great is a guide or howto, but such a ting doesn't seem to exist.
Since this is the most rated question in the topic, I'd like to update the answer. Here is available installer for windows 32bit:
It contain complete SDK-like package. And complete libraries collection too. http://sourceforge.net/projects/pygobjectwin32/files/pygi-aio-3.10.2-win32_rev10-setup.exe/download
I searched for the same thing not so long ago. I couldn't really find much information but this other post
I ended up giving up on GTK+ and switch to xwpython which is really os independant
did you try the offical pypi page https://pygobject.readthedocs.io/en/latest/getting_started.html
I was able to install GTK

Where is there a good discussion of using python packages?

Is there a good discussion of setup.py and python packages from the package user perspective? Then maybe also from the package developer viewpoint too?
The Hitchhiker's Guide to Packaging is a good read. Covers everything from creating your own packaging to finding packages, installation, virtualenvs, etc.
Strictly speaking, the valid (though subjective) answer for your question would be "yes".
But I think you need the links. Well, from the package developer viewpoint, I had the very same question. In Python world, package management appears to be a bit of a mess at the moment. Here are some resources that I found useful:
First, James Bennet's (django dev) ‘On packaging’
Ian Bicking's ‘Corrections To “On Packaging”’—very useful read, made finally clear for me the complicated relationship between distribute and setuptools, as well as many other things
Occasionally, Building and Distributing Packages with Distribute
setup.py files from different projects
(Though I also think it would be better if you tell us what exactly do you want to learn.)

Python Code Completion

After using C# for long time I finally decided to switch to Python.
The question I am facing for the moment has to do about auto-complete.
I guess I am spoiled by C# and especially from resharper and I was expecting something similar to exist for Python.
My editor of choice is emacs and after doing some research I found autocomplete.pl, yasnippet and rope although it is not clear to me if and how they can be installed in a cygwin based system which is what I use since all the related documentation appears to be linux specific...
The version of emacs I currently use is 23.2.1 which bundles the python mode that although useful is far behind from whatever research has to offer.
My question to python users has to do about how common is autocomplete vs manual typing (using M-/ where possible) ?
I am thinking about just memorizing python build-in functions like len, append, extend etc. and revert close to a pre-autocomplete editing mode. How different such an approach is from what other pythonistas are doing?
I found this post
My Emacs Python environment
to be the most useful and comprehensive list of instructions and references on how to setup a decent Python development environment in Emacs regardless of OS platform. It is still a bit of work to setup but at least it covers the popular packages and components generally recommended for Python in Emacs that provide auto-completion functionality.
I loosely used this post as a guide to do the setup on my Windows machine with Emacs 23.2.1 and Python 2.6.5. Although, I also have Cygwin installed in some cases instead of running the *nix shell commands mentioned in the post, I just download the packages via a web browser, unzip them with 7zip, and copy them to my Emacs' plugin directory.
Also, to install Pymacs, Rope, and Ropemacs, I used Python's EasyInstall package manager. To use it, I downloaded and installed the setuptools package using the Windows install version. Once installed, at the command line, cd to their respective download locations and run the command
easy_install .
instead of the shell commands shown in the post.
Generally, I saved any *.el files in my ~\.emacs.d\plugins (e.g. in %USERPROFILE%\Application Data\.emacs.d\) and then updated my .emacs file to reference them as documented in the post.
Despite all this, on occasion, I've used DreamPie since it does have overall better auto-completion out of the box than my Emacs setup.
I'm spoiled by Intellisense too. The PyDev extensions for Eclipse offer a pretty good auto-complete substitute.
I find that PyDev + Eclipse can meet most of my needs. There is also PyCharm from the Intellij team. PyCharm has the added advantage of smooth integration with git.
I've been using PyScripter, an IDE for Windows, for a while now, and have found it very good. It has autocompletion among many other features. It's written in Delphi -- not that there's anything wrong with that -- it just bothers me a bit, though...
Take a look at Spyderlib, support most of the features including code completion
IMO, by far the easiest way to take advantage of the python tools available for emacs is to take advantage of the defaults that are all set up at:
https://github.com/gabrielelanaro/emacs-for-python
I actually took the time to get pymacs and ropemacs and python-mode all working independently before finding that little gem, and now I rely on it entirely for all my python based customizations. If you are new, I would definitely start there.

Deploying python app to Mac and Windows users

I've written an app in python that depends on wxPython and some other python libraries. I know about pyexe for making python scripts executable on Windows, but what would be the easiest way to share this with my Mac using friends who wouldn't know how to install the required dependencies? One option would be to bundle my dependencies in the same package, but that seems kind of clunky. How do people usually deploy such apps? For once I miss Java...
You could check out py2app, which is similar to py2exe
How do people usually deploy such apps?
2 choices.
With instructions.
All bundled up.
You write simple instructions like this. Folks can follow these pretty reliably, unless they don't have enough privileges. Sometimes they need to sudo in linux environments.
Download easy_install (or pip)
easy_install this, easy_install that (or pip this, pip that)
easy_install whatever package you wrote.
It works really well. If you download some Python packages you'll see this in action.
Sphinx requires docutils. Django requires docutils and PIL. It works out really well to simply document the dependencies. Other folks seem to do it without serious problems. Follow their lead.
Bundling things up means you have to
(a) provide the entire original distribution (as required by most open source licenses)
(b) provide a compatible open source license with the licenses of the things you bundled. This can be easy if you depend on things that all of the same license. Otherwise, you basically can't redistribute them and have to resort to installation instructions.

Categories

Resources