I have two wav files that I want to mix together to form one wav file. They are both the same samples format etc...
Been searching google endlessly.
I would prefer to do it using the wave module in python.
How can this be done?
...
Suppose I have a namedtuple like
>>> Point = namedtuple('Point','x y')
Why is it that I construct a single object via
>>> Point(3,4)
yet when I want to apply Point via map, I have to call
>>> map(Point._make,[(3,4),(5,6)])
I suspect this has something to do with classmethods, perhaps, and am hoping that in figuring this out I'll...
Django, Python: How do I know if users have closed their browser without click logout?
Really seriously question, because I need to analyse the user activities.
...
Is it standard practice or convention in Python to prepend boolean instance variables with is?
For example:
"options.isVerbose"
...
Recently I've been having an issue with the code shown below and it's been bugging me for a while now. I don't know why it's happening, the only thing I know is that the python code brings up a segfault on the line noted and gdb brings up something about memory. Am I doing something wrong or is this a bug? I'd really like to get this wor...
I do not want to use while or for loops, just want to use recursion to return the odd numbers in a given list. Thanks!
...
Has anyone developed an abstraction layer above Amazon Web Services and the Google App Engine? It would be nice to be able to develop a system that could be migrated between either of those two platforms. I am interested in Python.
...
I'm used to writing my own SQL queries and I'm trying to get used to the whole ORM thing that seems to be so popular nowadays.
Here's the query:
SELECT * FROM routes WHERE route_id IN (
SELECT DISTINCT t.route_id FROM stop_times AS st
LEFT JOIN trips AS t ON st.trip_id=t.trip_id
WHERE stop_id = %s
)
where %s is an intege...
I have the need to be able to accurately find the months between two dates in python. I have a solution that works but its not very good (as in elegant) or fast.
dateRange = [datetime.strptime(dateRanges[0], "%Y-%m-%d"), datetime.strptime(dateRanges[1], "%Y-%m-%d")]
months = []
tmpTime = dateRange[0]
oneWeek = timedelta(weeks=1)
tmpT...
Having way too much trouble making this cmd line curl statement work in python script...help! Attempting to use URLLIB.
curl -X POST "http://api.postmarkapp.com/email" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Postmark-Server-Token: abcdef-1234-46cc-b2ab-38e3a208ab2b" \
-v \
-d "{From: 'sender@email....
I have to build a form where I want a drop down menu list, what will be the procedure.
If u can then plz do tell me the stepwise procedur coz I am a beginner in python. example, what code to be written in views.py, forms.py and urls.py etc.
Thanks in advance................Byeee
...
I want python to open up a certain address using the computers default web browser. Is this possible?
...
I have started using Xcode as my main code editor. How might I make Xcode do things like using # instead of // for comments, and otherwise making the IDE friendlier?
...
I am extracting emails from Gmail using the following:
def getMsgs():
try:
conn = imaplib.IMAP4_SSL("imap.gmail.com", 993)
except:
print 'Failed to connect'
print 'Is your internet connection working?'
sys.exit()
try:
conn.login(username, password)
except:
print 'Failed to login'
print 'Is the username...
Nearing what I would like to think is completion on a tool I've been working on. What I've got going on is some code that does essentially this:
open several files and urls which consist of known malware/phishing related websites/domains and create a list for each, Parse the html of a url passed when the method is called, pulling out a...
hi,
I want to communicate with my serial port in python.....i installed pyserial,,,and uspp for linux....still when i run the code..
import serial
ser = serial.Serial('/dev/pts/1', 19200, timeout=1)
print ser.portstr #check which port was really used
ser.write("hello") #write a string
ser.close() #
it gives t...
Hi everyone,
Im working on a a sudoku program for python and i need some help. The program will ask input from the user for 9 rows of numbers that hopefully contain the digits 1-9. Once they input all 9 rows the program should then go through each row and verify and see if it satisfies the conditions of a sudoku game. If it doesnt it w...
Hi,
Is there any good library to calculate linear least squares OLS (Ordinary Least Squares) in python?
Thanks.
Edit:
Thanks for the SciKits and Scipy.
@ars: Can X be a matrix? An example:
y(1) = a(1)*x(11) + a(2)*x(12) + a(3)*x(13)
y(2) = a(1)*x(21) + a(2)*x(22) + a(3)*x(23)
...........................................
y(n) = a(1)...
Just as the question asks - does anyone have a good example of using the Mutagen python ID3 library to write mp3 files?
I'm looking in particular to add disc/track number information, but examples editing the title and artist would be helpful as well.
Cheers,
/YGA
...
I defined a .py file in this format:
foo.py
def foo1(): pass
def foo2(): pass
def foo3(): pass
I import it from another file:
main.py
from foo import *
# or
import foo
Is it possible list all functions name, e.g. ["foo1", "foo2", "foo3"]?
Thanks for your help, I made a class for what I want, pls comment if you have suggestion...