Does anyone have successful experience reading binary Matlab .mat files in Python?
(I've seen that scipy has alleged support for reading .mat files, but I'm unsuccessful with it. I installed scipy version 0.7.0, and I can't find the loadmat() method)
...
Hello, how can i check admin-privileges for my script during running?
...
Hello, how can I make setup.py file for my own script? I have to make my script global.
(add it to /usr/bin) so I could run it from console just type: scriptName arguments.
OS: Linux.
EDIT:
Now my script is installable, but how can i make it global? So that i could run it from console just name typing.
...
I have a module which starts a wxPython app, which loads a wx.Bitmap from file for use as a toolbar button. It looks like this: wx.Bitmap("images\\new.png", wx.BITMAP_TYPE_ANY). All works well when I run that module by itself, but when I try to import and run it from a different module which is in a different directory, wxPython raises a...
IDLE's subprocess didn't make
connection. Either IDLE can't start a
subprocess or personal firewall
software is blocking the connection.
Don't think this has been asked-how come this comes up occasionally when running very simple programs-I then have to go to Task Manager & stop all Pythonw processes to get it to work again?
...
I'd like to use the subprocess module in the following way:
create a new process that potentially takes a long time to execute.
capture stdout (or stderr, or potentially both, either together or separately)
Process data from the subprocess as it comes in, perhaps firing events on every line recieved (in wxPython say) or simply print...
I'm sorry for the verbal description.
I have a wxPython app in a file called applicationwindow.py that resides in a package called garlicsimwx. When I launch the app by launching the aforementioned file, it all works well. However, I have created a file rundemo.py in a folder which contains the garlicsimwx package, which runs the app as...
I'm onto problem 245 now but have hit some problems. I've done some work on it already but don't feel I've made any real steps towards solving it. Here's what I've got so far:
We need to find n=ab with a and b positive integers. We can also assume gcd(a, b) = 1 without loss of generality and thus phi(n) = phi(ab) = phi(a)phi(b).
We are...
I'm reading 16 bit integers from a piece of hardware over the serial port.
Using python, how can I get the LSB and MSB right, and make python understand that it is a 16 bit signed integer I'm fiddling with, and not just two bytes of data?
...
I have written a class in python that implements __str__(self) but when I use print on a list containing instances of this class, I just get the default output <__main__.DSequence instance at 0x4b8c10>. Is there another magic function I need to implement to get this to work, or do I have to write a custom print function?
Here's the clas...
Are there regular expression equivalents for searching and modifying tree structures? Concise mini-languages (like perl regex) are what I am looking for.
Here is an example that might clarify what I am looking for.
<root>
<node name="1">
subtrees ....
</node>
<node name="2">
<node name="2.1">
data
</node>
oth...
When I try to put a zlibbed string in models.TextField
>>> f = VCFile(head = 'blahblah'.encode('zlib'))
>>> f.save()
it fails:
...
raise DjangoUnicodeDecodeError(s, *e.args)
DjangoUnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 1: unexpected code byte. You passed in 'x\x9cK\xcaI\xccH\x02b\x00\x0eP\x03/' (<type...
Hello,
I am not very familiar with the way of creating a daemon in Python, therefore wheb trying to install and run a third party open source TeX Python Wrapper i got bite by an error i do nor really understand.
I added some print to help debugging.
The faulty one is called texdp.py
When i run mathrand which calls texdp server start,...
I'm looking for a simple solution using Python to store data as a flat file, such that each line is a string representation of an array that can be easily parsed.
I'm sure python has library for doing such a task easily but so far all the approaches I have found seemed like it would have been sloppy to get it to work and I'm sure there ...
Does map() iterate through the list like "for" would? Is there a value in using map vs for?
If so, right now my code looks like this:
for item in items:
item.my_func()
If it makes sense, I would like to make it map(). Is that possible? What is an example like?
...
Python does not print traceback messages from exceptions raised in daemon threads.
For example, this code creates a daemonic thread and raises an exception in the new thread:
def error_raiser():
raise Exception
import threading
thread = threading.Thread(target=error_raiser)
thread.daemon = True
thread.start()
but does not print ...
Hi, i have a wav file
and between each word in the wav file I have full silence (I checked with Hex workshop and silence is represented with 0's)
how can I cut the non-silence sound ?
I'm programming using python
thanks
...
I program Django/Python in emacs, and I would like things like {% comment %} FOO {% endcomment %} to turn orange.
How can I set up some colors for important Django template tags?
...
ZODB provides a PersistentList and a PersistentMapping, but I'd like a PersistentSet. I wrote a quick class that mirrors the ancient PersistentList from ZODB 2. Because there's no UserSet in Python, I had to extend from the C-based built-in set.
class PersistentSet(UserSet, Persistent):
def __iand__(self, other):
set.__iand__(other...
Hi everyone,
There's not much documentation surrounding the python-fastcgi C library, so I'm wondering if someone could provide a simple example on how to make a simple FastCGI server with it. A "Hello World" example would be great.
...