Unique Culture

31 Aug, 2010

On-campus Radio iPhone Application

Posted by: Sergei Izvorean In: Design

Just to expand my skills portfolio I decided to design and develop and iPhone application for Penn State Greater Allegheny on-campus radio. Bellow is a initial design of the app:

WMKP Radio iPhone App

03 Jun, 2009

How to serve Excel files on Google App Engine

Posted by: Sergei Izvorean In: Coding

Google App Engine is a hosting service for your Python and, lately, Java applications. In this case I’m going to talk about Python. Since an application cannot save files it might seem hard to serve an Excel file. Thankfully a great library pyExcelerator is very flexibile and instead of saving a file you can offer a user to download the dynamically generated Excel file. Here is what you do:

from pyExcelerator import *
 
class MainPage(webapp.RequestHandler):
    def get(self):
        wb = Workbook()
        ws0 = wb.add_sheet('Sheet 1')
        # Rows and columns count starts from 0
        for x in range(10):
            for y in range(10):
                # writing to a specific x,y
                ws0.write(x, y, "this is cell %s, %s" % (x,y))
 
        # HTTP headers to force file download
        self.response.headers['Content-Type'] = 'application/ms-excel'
        self.response.headers['Content-Transfer-Encoding'] = 'Binary'
        self.response.headers['Content-disposition'] = 'attachment; filename="workbook.xls"'
 
        # output to user
        wb.save(self.response.out)

Happy coding!

Categories


  • Jeremy Wallez: Nice post ! For those who needs same functionalities using Java, take a look at http://blog.z80.fr/2010/03/30/google-app-engine/how-to-generate-excel-
  • John Machin: You may like to consider xlwt, a fork of pyExcelerator with bug-fixes and on-going enhancements. See http://pypi.python.org/pypi/xlwt

Flickr PhotoStream

  • the rainbow piano
  • الله البادي ثم اسم بلادي Saudi Malek
  • Tehuanita convertible skirt Vintage Mexican hand embroidery work
  • Florecitas Mexican embroidered belt

About

Web developer @ Eyeflow and Penn State student.