python logging alternatives
The Python logging module is cumbersome to use. Is there a more elegant alternative? Integration with desktop notifications would be a plus. ...
The Python logging module is cumbersome to use. Is there a more elegant alternative? Integration with desktop notifications would be a plus. ...
I have been unable to find this function in any of the standard packages, so I wrote the one below. Before throwing it toward the Cheeseshop, however, does anyone know of an already published version? Alternatively, please suggest any improvements. Thanks. def fivenum(v): """Returns Tukey's five number summary (minimum, lower-hinge...
Hi! I'm trying to scrape a website where the URL is redirected, however programmatically trying this gives me an 403 Error code (Forbidden). I can place the URL in the browser and the browser will properly follow the url though... to show a simple example i'm trying to go to : http://en.wikipedia.org/w/index.php?title=Mike_tyson I've...
A pretty basic Python question: I understand that when you import a module, that file is compiled into a pyc file to make it faster..? Why is the main file not also compiled to a pyc? Does this slow things down? Would it be better to keep the main file as small as possible then, or does it not matter? Thanks ...
I want to replace repeated instances of the "*" character within a string with a single instance of "*". For example if the string is "***abc**de*fg******h", I want it to get converted to "*abc*de*fg*h". I'm pretty new to python (and programming in general) and tried to use regular expressions and string.replace() like: import re p...
If I write a python script using only python standard libraries, using Python 2.6 will it work on all Operating Systems as long as python 2.6 is installed? ...
Hi, I need to develop a file indexing application in python and wanted to know which embedded database is the best one to use for indexing. Any help on this topic is appreciated. Thanks, Rajesh ...
WHen specifying library_dirs in a Python distutils.core.Extension I get this error when trying to build: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py:263: UserWarning: Unknown distribution option: 'library_dirs' warnings.warn(msg) Why is this? I am using Python 2.5 on Mac OS X. ...
How do I generate a list of lines to draw if I have pixel data for an image, so I don't have to draw every pixel? Any language will do, although I listed what I have a working knowledge for. C is ok as well. There was a limit to how many tags I could choose. Also, you can just point me toward an algorithm. ...
Okay, so this is really messed. I've setup a script to download an mp3 using urllib2 in Python. url = 'example.com' req2 = urllib2.Request(url) response = urllib2.urlopen(req2) #grab the data data = response.read() mp3Name = "song.mp3" song = open(mp3Name, "w") song.write(data2) song.close() Turns out it was somehow related to me do...
i download many html store in os,now get their content ,and extract data what i need to persistence to mysql, i use the traditional load file one by one ,it's not efficant cost nealy 8 mins. any advice is welcome g_fields=[ 'name', 'price', 'productid', 'site', 'link', 'smallImage', 'bigImage', 'description', 'createdOn', 'mo...
Please help me to solve this error C:\Python26\Lib\site-packages\pyqrcode\encoder>python setup.py install running install running bdist_egg running egg_info writing qrcode.egg-info\PKG-INFO writing top-level names to qrcode.egg-info\top_level.txt writing dependency_links to qrcode.egg-info\dependency_links.txt package init file 'qrcode\...
I want to server an image file but accept some attributes for processing before hand using Python and google app engine. Where I would normally have 'http://www.domain.com/image/desiredImage.jpg' as the image to server. I want to be able to add some tracking to it so I can do something similar to 'http://www.domain.com/image/desired...
Hello ! One more question about Django concerning localization of javascript files. Django provides a small and convenient javascript library which is used like gettext to internationalize strings in javascript files. I set it up successfully (at least the interpolate function works) and I could generate the po file for the French lang...
Is there a library which allows determining whether a given content type is binary or text-based? Obviously text/* is always textual, but for things like application/json, image/svg+xml or even application/x-latex it's rather tricky without inspecting the actual data. ...
I have a simple code that finds paths using a graph stored in a dictionary. The code is exactly: def find_path(dct, init, depth, path=[]): if depth == 0: return path next_ = dct[init] depth-=1 find_path(dct, next_, depth) If I print the path right before return path it prints to screen the correct path (after an init...
I have two questions: 1) I have a regular expression ([A-Z][a-z]{0,2})(\d*) and I am using Python's re.finditer() to match appropriate strings. My problem is, that I want to match only strings that contain no extra characters, otherwise I want to raise an exception. I want to catch a following pattern: - capital letter, followed by 0,...
How come I hit this webpage, I get HTML text: http://itunes.apple.com/us/app/mobile/id381057839 But when I hit this webpage, I get garbled junk? http://itunes.apple.com/us/app/mobile/id375562663 I use the same download() function in python, which is here: def download(source_url): try: socket.setdefaulttimeout(10) ...
Hi All, We're programming classic ASP for a big (legacy) web application. This works quite well using WSC (Windows script components) to separate GUI from business logic; the WSCs contain the business logic, classic asp is used for displaying returned information. The WSC's return stringvalues, ADO recordsets and in some cases vbscript...
Hi, guys, I am rather new to python and learning it to build a gui application (with wypython). I have a question related with object destruction in python. e.g. in myFrame I have onNew (create a new document) and onOpen (open a file) method. briefly, it looks like this. def onNew self.data=DataModel() self.viewwindow=ViewWind...