サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
アメリカ大統領選
www.voidspace.org.uk
Voidspace The website, technical blog and projects of Michael Foord Porting mock to Python 3 One of the nice new features in mock 0.7 is that it works with both Python 2 & 3. The mock module itself, even with all the freshly added docstrings, weighs in at less than 800 lines of code so compatibility is maintained with a single source base rather than the more recommended 2to3 approach. There are h
Python Programming, news on the Voidspace Python Projects and all things techie. Mocking patterns: chained calls, partial mocking and open as context manager In recent weeks I've received two requests for help with mocking (and testing) chained calls. The mock library makes this easy, but I'm guessing that it isn't immediately obvious. At the same time I had a use case today for partially mocking
1 Introduction Validation is used to check that supplied values conform to a specification. The value can be supplied as a string, e.g. from a config file. In this case the check will also convert the value to the required type. This allows you to add validation as a transparent layer to access data stored as strings. The validation checks that the data is correct and converts it to the expected
This is a series of articles and code examples for using IronPython with Silverlight. For more details on working with IronPython and Silverlight, you need IronPython in Action. IronPython & Silverlight These articles will take you through everything you need to know to get started writing Silverlight applications with IronPython: Introduction to IronPython & Silverlight The Structure and Contents
Voidspace The website, technical blog and projects of Michael Foord Introduction This was originally posted as a blog entry in April 2006, just before I lost my amateur status and became a professional software developer. I recently saw it referred to in a newsgroup posting and revisited it. After nearly two years my programming style tastes have changed surprisingly little. This of course is part
Voidspace The website, technical blog and projects of Michael Foord Note This article describes one way to use CPython extensions from IronPython / .NET by embedding CPython itself via Python.NET. Since this article was written a much more practical approach has been implemented as an Open Source project by Resolver Systems. This project fakes Python25.dll and has a large subset of the Python C AP
The Mock LibraryA Simple Class for Mocking in Unit Tests Version 1.0.0 7th October 2012 mock provides a core Mock class that is intended to reduce the need to create a host of trivial stubs throughout your test suite. After performing an action, you can make assertions about which methods / attributes were used and arguments they were called with. You can also specify return values and set needed
rest2web - The Website Builder Maintaining websites or project documentation in HTML is a pain. rest2web takes out the pain, and brings back the joy. rest2web is a simple tool that lets you build your website from a single template (or as many as you want), and keep the contents in ReStructured Text [1]. (You can still keep pages in HTML if needed.) It can also aid in having multiple translations
Note This class is available only on computers running the Windows XP SP2 or Windows Server 2003 operating systems. If you attempt to create an HttpListener object on a computer that is running an earlier operating system, the constructor throws a PlatformNotSupportedException exception. This class probably won't scale to writing a production webserver or application server (at least, why would yo
Embedding the Dynamic Language Runtime Articles, Tutorials and Examples Note For a much more in depth introduction to hosting and interacting with dynamic languages from .NET applications see chapters 14 & 15 of IronPython in Action. The examples that go with these articles are maintained in a subversion repository (thanks to Google Code): IronPython Examples Project Page The DLR Hosting API An ex
Voidspace The website, technical blog and projects of Michael Foord Introduction Python metaclasses have a reputation for being deep black magic. Like many aspects of Python, once you get them they're really quite straightforward. Metaclasses aren't often useful, but when they are they can simplify complex code. This article explains the basics of metaclasses by creating a metaclass that applies a
Python Search A Python Programming Specific Search Engine Search the internet for results relevant to python programming. Because of the way this search works, you may get more results with more specific search terms. The term Python will automatically be included in your query.
Voidspace The website, technical blog and projects of Michael Foord Introduction The previous article, CGI Web Applications with Python, Part One, explained the workings of the Common Gateway Interface (CGI), demonstrated how HTML forms are processed, and described a Python library you can use to make development of Python CGI web applications a snap. This time, let's build on that expertise, look
Note The best introduction to working with ConfigObj, including the powerful configuration validation system, is the article: An Introduction to ConfigObj 1 Introduction ConfigObj is a simple but powerful config file reader and writer: an ini file round tripper. Its main feature is that it is very easy to use, with a straightforward programmer's interface and a simple syntax for config files. It
Caution! A lot of what of written here has some exceptions - but it's basically true. It could be hedged around with all sorts of caveats - but as far as I can see none of it is actually going to mislead you. Python is dynamically but strongly typed. The fact that the two halves of that statement fit together can confuse those who come from a static language type background. In Python it is perfec
Quotes Movable Python has the potential to affect your programming life even more than Microsoft's embrace. Yes, it's that important. -- Cameron Laird Zope on a rope! Movable Python allows me to carry Zope3.2 and my development environment everywhere I go. It's a great product, I love it. -- Kevin Smith Pages Movable Python Use Cases Movable Python - Python on a Stick Movable Python Distributions
Introduction Related Articles You may also find useful the following articles on fetching web resources with Python : Basic Authentication A tutorial on Basic Authentication, with examples in Python. cookielib and ClientCookie How to handle cookies when fetching web-pages with urllib2. urllib2 is a Python module for fetching URLs (Uniform Resource Locators). It offers a very simple interface, in t
Introduction This tutorial aims to explain and illustrate what basic authentication is, and how to deal with it from Python. You can download the code from this tutorial from the Voidspace Python Recipebook. The first example, So Let's Do It, shows how to do it manually. This illustrates how authentication works. The second example, Doing it Properly, shows how to handle it automatically - with a
このページを最初にブックマークしてみませんか?
『Welcome to Voidspace by Michael Foord』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く