Pascal Triangle Generator in Python, and then in Haskell – The Gubatron Method

Here’s in python, imperatively, and then in functional style without the need for loops. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters def pascal(n): […]

Python: How to debug HTTP while using urllib2

… import urllib import urllib2 #this is just to prepare a dynamic uri (this is actual code from a system I’m building, sorry) fileDownloadServiceURL = ‘%s://%s:%s/%s’ % (transport,server,port,pathToController) postData = {‘URI’:fileUri} #add more post stuff here postData = urllib.urlencode(postData) #make sure you encode your post data #add some custom headers if you need them headers={“Host”: […]