A File-like Object To True File Object Adapter v1.0

Sometimes you have a file-like object (such as what urllib.urlopen() returns), but you need to pass it to a function/method that insists on receiving a true file object (what the file or open built-in functions give you). This script is like an adapter that turns your file-like object into a true file object.

This is an application of the Adapter Pattern - "When you have an X,and you need a Y." Lesson: Your code will be more flexible if, when possible, you allow functions/methods that take a file object to also take a file-like object.

Related Scripts

  • General Purpose File Iterator Class 1.0
    This script presents a general purpose file object iterator cum file object proxy class.It provides a class that gives several iterator functions...
  • Fix For Activerecord Sql Server Adapter Dates
    The SQL Server adapter for ActiveRecord uses Time objects to cast dates from the db. This fails for dates before 1970, thus some birthdates come back ...
  • Raphael 2.1.0
    It practically creates an HTML5 canvas object on which it draws.The library uses the SVG W3C Recommendation and VML as a base for creating graphics.Th...
  • Com.wis.math.geom.util.transformation
    Implements the behaviours of the Transformation Class. Provides utility methods for the IObj interface based on JS RayTracer2 by John Haggerty. usage:...
  • Xml.haschildnodes
    The following example uses the information from the XML object in a user-defined This method returns true if the specified XML object has child nodes ...
  • Object#subclasses
    Find every subclass of an object. Limit the query to direct descendants by setting direct to true....
  • Iterating Through Large File-like Objects 1.1
    This function provides a simple iterator for the lines of a file-like object. (It also provides a flag for removing/retaining trailing newlines.) I ra...
  • Text File Io For Non-uniform Data
    If you have a program that is outputting a data file with headers and blank lines, and if the exact order and location of those headers and blank line...
  • Ruby Irb Helper Method To Pretty-print Object Meth
    A simple method to print out the methods for an object at run time in a nicely formatted and colorized way. Really useful when using irb.usage:pm obje...
  • .net Icalendar 1.0
    A .Net iCalendar library used to parse,create, manipulate, databind and export iCalendar data in various formats.The iCalendar library is designed to ...
  • Myoodb 3.0.0.8
    MyOODB is an Object-Oriented Database with many features not available in existing database products. MyOODB is one part of a two part SDK solution. T...
  • Moo.form
    This page gives an overview of Ajax.Form object. It is an extension of the Mootools Ajax object, and provides a way to submit a html form via ajax. It...
  • Asp Text Counter
    This simple page counter uses the File System Object to store the page count in a text file located on the server. You must have the use of the File S...
  • Javascript Window Meta-object
    JavaScript Window Meta-object  is a JavaScript object that adds custom functions and properties to the standard JavaScript Window object. With th...
  • Movable Object
    A script that allows an object to move with the arrow keys. Copy and paste to object's actionscript...
  • Image Asp Counter
    This simple image page counter uses the File System Object to store the page count in a text file located on the server. The text file is then read by...
  • Dice3ds 0.12
    The modules are provided for reading, writing, and manipulating 3DS files.3D Studio is a 3D graphics modeling and rendering program that saved it...
  • Dbobj 0.3
    dbobj is an open source object persistence layer for PHP. It may also be called an Object Relation Mapping (ORM) layer or an Active Record implementat...
  • Controlvr
    This component allows you to create 360 degree interactive 3D object from a series of multiple still images. The objects can be created with vertical ...
  • Extensible Object To Xml Converter
    This function generates XML for any Python object through recursive functions. It is easy to add specific handlers for your own object types for more ...
DMCA Notice-Privacy Policy
2004 - 2013 DownScripts. All rights reserved.