I've created two wave files using Audacity. Both have 44100hz sample rate, 32-bit float samples, were saved as WAV (Microsoft) 16-bit signed and contain 1s of silence (according to Audacity). The difference is that one file contains one channel, while the other have two (stereo). When reading the one channel file I got frames like this:
...
I recently found out about the awesomeness of the iTunes COM for Windows SDK. I am using Python with win32com to talk to my iTunes library. Needless to say, my head is in the process of exploding. This API rocks.
I have one issue though, how do I access the Media Kind attribute of the track? I looked through the help file provided in t...
I wonder if it is better add an element by opening file, search 'good place' and add string which contains xml code.
Or use some library... i have no idea. I know how can i get nodes and properties from xml through for example lxml but what's the simpliest and the best way to add?
...
Hi, i already saw a post saying that it was possible for the X10.. But does anyone know how to? I found a guide but it is quite troublesome..
Thanks for any help.
Jake
...
I've implemented a UserProfile model (as the Django 1.2 docs say is the proper way to save additional data about a User) which has a 'remaining_vacation_hours' field.
In our current system, when a user fills out a Time Off Request, the remaining hours available should be checked to see that they have enough vacation to use, or otherwis...
I'm trying to automate construction of an Excel 2007 spreadsheet that uses the Bloomberg plugin to pull down live prices. The problem is that when I open Excel through win32com the Bloomberg plugin does not load (so all of the formulas end up with "#NAME?" errors).
Manually uninstalling and reinstalling the plugin works, but copying the...
So basically, I've got a rather large Django project going. It's a private web portal that allows users to manage various phone-related tasks.
Several pages of the portal provide a listing of Model objects to users, and list all of their attributes in a HTML table (so that users can visually look through a list of these items).
The pro...
I'm getting an error when trying to open a website url with Python 3.1, urllib & json
urllib.error.URLError:
Here's the code. The first website loads fine. The second one
import json
import urllib.request
import urllib.parse
import util
# This one works fine
response = urllib.request.urlopen('http://python.org/')
html = response....
Is there an application similar to Java's Checkstyle for Python?
By which I mean, I tool that analyzes Python code, and can be run as part of continuous integration (e.g. CruiseControl or Hudson). After analyzing it should produce an online accessible report which outlines any problems found in the code.
Thank you,
...
hi all, I'm looking to take an html page and just extract the pure text on that page. Anyone know of a good way to do that in python?
I want to strip out literally everything and be left with just the text of the articles and what ever other text is between tags. JS, css, etc... gone
thanks!
...
Possible Duplicate:
Substitute multiple whitespace with single whitespace in Python
trying to figure out how to write a regex that given the string:
"hi this is a test"
I can turn it into
"hi this is a test"
where the whitespace is normalized to just one space
any ideas? thanks so much
...
i wonder if there is open source cms coded in python that is as big as drupal (joomla or wordpress)?
thanks
...
"Make things as simple as possible, but no simpler."
Can we find the solution/s that fix the Python database world?
Update: A 'lustdb' prototype has been written by Alex Martelli - if you know any somewhat lightweight, high-level database libraries with multiple backends we could wrap in syntax sugar honey, please weigh in!
from some...
I've the following robots.txt
User-agent: *
Disallow: /images/
Sitemap: http://www.example.com/sitemap.xml
and the following robotparser
def init_robot_parser(URL):
robot_parser = robotparser.RobotFileParser()
robot_parser.set_url(urlparse.urljoin(URL, "robots.txt"))
robot_parser.read()
return robot_parser
But when...
Hi,
I am writing a small site decorator to make my local airport site work with standard HTML.
On my local computer, I use Python's mechanize and BeautifulSoup packages to scrape and parse the site contents, and everything seems to work just fine. I have installed these packages via apt-get.
On my shared hosting site (at DreamHost) I ...
how can I do a hierarchical clustering (in this case for gene expression data) in Python in a way that shows the matrix of gene expression values along with the dendrogram? What I mean is like the example here:
http://www.mathworks.cn/access/helpdesk/help/toolbox/bioinfo/ug/a1060813239b1.html
shown after bullet point 6 (Figure 1), whe...
(sorry if this is a dumb question, I'm still learning)
I'm making a program that, for part of the prog, rolls four dice and subtracts the lowest dice from the outcome. The code I'm using is
die1 = random.randrange(6) + 1
die2 = random.randrange(6) + 1
die3 = random.randrange(6) + 1
die4 = random.randrange(6) + 1
if die1 <= die2 and die...
in Python, given an n x p matrix, e.g. 4 x 4, how can I return a matrix that's 4 x 2 that simply averages the first two columns and the last two columns for all 4 rows of the matrix?
e.g. given:
a = array([[1, 2, 3, 4],
[5, 6, 7, 8],
[9, 10, 11, 12],
[13, 14, 15, 16]])
return a matrix that has the aver...
I'm trying to do this:
commands = { 'py': 'python %s', 'md': 'markdown "%s" > "%s.html"; gnome-open "%s.html"', }
commands['md'] % 'file.md'
But like you see, the commmands['md'] uses the parameter 3 times, but the commands['py'] just use once. How can I repeat the parameter without changing the last line (so, just passing the...
Suppose I've got a custom form label with some HTML on it like so:
SafeUnicode('<span class="superscript">™</span>')
Why would Django 1.2 have a function mark_safe if this exist? What are the differences if any?
Thanks for the help!
...