background preloader

Py: Dev

Facebook Twitter

Adding Geanypy to geany-plugins by elextr · Pull Request #107 · geany/geany-plugins. See(), an alternative to Python's dir() See() The see module for Python works as a somewhat more programmer-friendly version of Python's dir() built-in.

see(), an alternative to Python's dir()

One example of how see() is useful: it does not show all the standard / built-in attributes (including many with double underscores in the name) that are present in the global namespace, when all you do is this: dir([]) , i.e. when you call dir() on a list. So it has less cluttered output. dir() shows all those attributes, e.g ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', ... Another example of using see(): >>> foo = 'bar' >>> see(foo, '.is*') .isalnum() .isalpha() .isdigit () .islower() .isspace() .istitle() .isupper() from which you can see (pun intended:) that it can also show all (and only) the attributes of foo (a string) that start with the letters "is". For a lot more on the subject, see this Guide to Python introspection by Patrick O'Brien - an article on IBM developerWorks: It is a bit dated (2002) but still interesting and useful.

Tornando o Vim uma IDE amigável pra Python. Em um post anterior eu falei sobre como habilitar o auto-complete no vim pra código em python.

Tornando o Vim uma IDE amigável pra Python

Recentemente encontrei um post num blog com dicas mostrando como tornar o vim numa IDE completa pra Python. Testei algumas funcionalidades que tornaram o vim bem amigável pra programar e gerenciar código. Fiz todos os testes no Ubuntu, em outros sistemas Linux deve ser similar. Neste post vou passar essa experiência que tive configurando e usando o vim para criar código python. Antes de tudo, instale os pacotes vim-full e vim-python se estiverem disponíveis nos repositórios do seu sistema. Destaque de código Para habilitar highlighting (destaque do código) no vim adicione a seguinte linha no arquivo vimrc: No seu arquivo vimrc pode ser que esta linha venha comentada e acompanhada das seguintes linhas: Basta descomentar estas linhas que o highlighting ficará disponível.

Indentação Número de linhas Para exibir o número das linhas no vim adicione o seguinte no vimrc: Navegação pelo código Ocultar Código. Python - Bottle framework and OOP, using method instead of function. Continuous Deployment to dotCloud with Codeship. Set up Continuous Deployment to dotCloud for your Python applications with Codeship We are proud to announce a new member in our Codeship deployments family: dotCloud! A lot of our customers have asked for better Python deployment support on our service. dotCloud is a cloud hosting platform for your web applications.

They support Python, Java, PHP and many other platforms. Getting started is easy: Just create an account and you’re all set within a few minutes. Deploying to dotCloud with the Codeship You can deploy your GitHub and BitBucket projects with the Codeship. All you have to do is Retrieve your dotCloud API token from your account pageFill in the API tokenChoose a name for your application As soon as you’ve configured your deployment, the Codeship will deploy your application to dotCloud with every build.

Note that you might need to prepare your application to run on dotCloud. If you want to share this news click here to tweet. Further Information: [Python-Dev] Python hash function. Some Python projects worth looking at. Hi there guys.

Some Python projects worth looking at

So a lot has happened while I was away. It has been only a few weeks and a whole ton of great python project have emerged. In this post I will share a list of some of the excellent projects I saw in the past few days. So lets take a look at them without wasting any more time. Lans.py This project is interesting mostly for those who are into network security.

CherryMusic CherryMusic is not a new project but it recently got a new release. Python Wheels Wheels are the new standard of python distribution and are intended to replace eggs. Supercharge Your Python Developers. After a recent reorganization at work, I became the technical lead on a project to rewrite an existing PHP application that consisted of tens of thousands of lines of code.

Supercharge Your Python Developers

My team of five decided that Python and Flask would be a good implementation choice as it would allow us to see results quickly. The group ranged from complete Python novices to Python journeymen. They quickly became rockstars. How did this happen? How was it possible that, in less than a month from the project's inception, these python beginners were writing beautiful, idiomatic code? Enabling Your Developers Continuous integration with deep integration with Python testing and static analysis tools, along with simple scripts to aid developers has been the key to the amazing productivity of the team. Why did I put so much emphasis on the build process and developer tools?