Category Archives: Python

USPS Web Tools

I was trying to add the USPS API into osCommerce. I received the following error when adding this shipping module: RateV3 is not a valid API name for this protocol This is because when you create an account for the … Continue reading

Posted in Family, PHP, Python, Z350 | Tagged | Leave a comment

Use Python to Save an FTP Directory List to File

Written for Python 2.6 #!/usr/bin/python   import ftplib   ftp = ftplib.FTP("ftp.server.com") ftp.login("username", "password") ftp.cwd("path/path")   data = []   ftp.dir(data.append)   ftp.quit()   outputFile = open(’dirList.txt’,'wb’)   for line in data: outputFile.write(line + "\n")   outputFile.close()

Posted in Python | Leave a comment

Using Python to replace spaces with underscores in filenames.

Python can be used on Window, Linux and Mac. It just a simple install. download code #!/usr/bin/python   import string import os import re   # task: # loop thur input directory # look for .pdf # replace space with … Continue reading

Posted in Python | Leave a comment