python

Is there a HAML implementation for use with Python and Django

I happened to stumble across HAML, an interesting and beautiful way to mark up contents and write templates for HTML. Since I use Python and Django for my web developing need, I would like to see if there is a Python implementation of HAML (or some similar concepts -- need not be exactly identical) that can be used to replace the Django...

Good Sound processing/Analysis/Capturing Modules

We are working on Sound processing and Analysis where we need to extract frequencies, pitches, octaves and other parameters of sound including dBPowerSpectrum Analysis. We also need to do this irrespective of the file formats or do the conversion between quite a file format(though conversion is not a very critical requirement if those pa...

Cross-platform gui toolkit for deploying Python applications

Building on: http://www.reddit.com/r/Python/comments/7v5ra/whats_your_favorite_gui_toolkit_and_why/ Merits: 1 - ease of design / integration - learning curve 2 - support / availability for *nix, Windows, Mac, extra points for native l&f, support for mobile or web 3 - pythonic API 4 - quality of documentation - I want to do something...

What's the cleanest way to extract URLs from a string using Python?

Hi all Although I know I could use some hugeass regex such as the one posted here I'm wondering if there is some tweaky as hell way to do this either with a standard module or perhaps some third-party add-on? Simple question, but nothing jumped out on Google (or Stackoverflow). Look forward to seeing how y'all do this! Jamie ...

Python "property object has no attribute" Exception

Hi guys, confirmation = property(_get_confirmation, _set_confirmation) confirmation.short_description = "Confirmation" When I try the above I get an Exception I don't quite understand: AttributeError: 'property' object has no attribute 'short_description' This was an answer to another question on here but I couldn't comment on it a...

Where is Python used? I read about it a lot on Reddit.

I have downloaded the Pyscripter and learning Python. But I have no Idea if it has any job value , especially in India. I am learning Python as a Hobby. But it would be comforting to know if Python programmers are in demand in India. ...

Search Files& Dirs on Website

Hi im coding to code a Tool that searchs for Dirs and files. have done so the tool searchs for dirs, but need help to make it search for files on websites. Any idea how it can be in python? ...

Event handling with Jython & Swing

I'm making a GUI by using Swing from Jython. Event handling seems to be particularly elegant from Jython, just set JButton("Push me", actionPerformed = nameOfFunctionToCall) However, trying same thing inside a class gets difficult. Naively trying JButton("Push me", actionPerformed = nameOfMethodToCall) or JButton("Push me", action...

Has anyone installed MySQLDB for Python on Cygwin?

Hi, I'm trying to install MySQLDB for python on Cygwin. Unfortunately, when I run python setup.py build, I get the following error: $ python setup.py build /bin/sh: /usr/local/bin/mysql_config: No such file or directory Traceback (most recent call last): File "setup.py", line 16, in <module> metadata, options = get_config() Fil...

How to convert a list of number to html in Python?

hey guys, my last problem ^^ say i have a string which contains html, like html = '<td class="p11_666699"><strong>100</strong></td>' and a list like numbers = [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 13...

pagination with the python cmd module

I'm prototyping a Python app with the cmd module. Some messages to the user will be quite long and I'd like to paginate them. The first 10 (or a configurable number) lines of the message would appear, and pressing the SPACE bar would display the next page, until the end of the message. I don't want to reinvent something here, is there ...

Further Processing of Output of Undefined Methods (Python)

How do I write a Python class that handles calls on undefined methods by first, getting the output of a function of the same name from a given module, and then, doing something further with that output? For example, given add(x, y), doublerInstance.add(1, 1) should return 4. I know _ _ getattr _ _() intercepts calls on undefined method...

Python loops with multiple lists?

<edit> Thanks to everyone who has answered so far. The zip and os.path.join are really helpful. Any suggestions on ways to list the counter in front, without doing something like this: zip(range(len(files)), files, directories) </edit> Hi, I'm in the process of learning Python, but I come from a background where the following pseudo...

How does one parse simple inline markup (i.e. *bold*), in Python?

How does one implement a parser (in Python) for a subset of wikitext that modifies text, namely: *bold*, /italics/, _underline_ I'm converting it to LaTeX, so the conversion is from: Hello, *world*! Let's /go/. to: Hello \textbf{world}! Let's \textit{go}. Though there's nothing specific about it being a conversion to LaTeX (nota...

Why True/False is capitalized in Python?

All members are camel case, right? Why True/False but not true/false, which is more relaxed? ...

How to get the concrete class name as a string in Python

I want to avoid calling a lot of isinstance() functions, so I'm looking for a way to get the concrete class' name for an instance variable as a string. Any ideas? ...

Comparison function in Python using Lambdas

I am trying to understand lambdas and I get the idea but how do I define multiple conditions for a Point2 [x,y] comparison, so something like: if x1 < x2: -1 if x1 == x2: 0 if x1 > x2: 1 ...

How do i get python's pprint to return a string instead of printing?

In other words, what's the sprintf equivalent to pprint? ...

What is the best way to write HTML from Python?

I have figured out how to extract the information I need from a PDF file using PDFMiner in Python, and now I need to write out a modified version of the document with only the information that's needed as an HTML file. The new version will be archived online to a repository, and a printed copy shipped with the unit. What is the best wa...

Initializing a list to a known number of elements in Python

Right now I am using a list, and was expecting something like: verts = list (1000) Should I use array instead? ...