I have a python method that returns a Python byte array.array('c').
Now, I want to copy this array using System.Runtime.InteropServices.Marshal.Copy. This method however expects a .NET array.
import array
from System.Runtime.InteropServices import Marshal
bytes = array.array('c')
bytes.append('a')
bytes.append('b')
bytes.append('c')
M...
Looking for a way to simulate nested loops (or a cartesian product) i came across the itertools.product function.
i need a function or piece of code that receive a list of integers as input and returns a specific generator.
example:
input = [3,2,4] -> gen = product(xrange(3),xrange(2),xrange(4))
or
input = [2,4,5,6] -> gen = product(...
I have been working on this project for some time now - it was originally supposed to be a test to see if, using wxPython, I could build a button 'from scratch.' From scratch means: that i would have full control over all the aspects of the button (i.e. controlling the BMP's that are displayed... what the event handlers did... etc.)
I ...
I am using PyQt4's QTextBroswer to display a html link.
Whenever users click on the link, a browser will be used to open the internet page.
My question is, is there a way to set so that our own prefered browser is used to open the url page instead of the preset one?
Thanks in advance.
...
Hi,
Can anyone tell me how i can get the table in a HTML page which has a the most rows? I'm using BeautifulSoup.
There is one little problem though. Sometimes, there seems to be one table nested inside another.
<table>
<tr>
<td>
<table>
<tr>
<td></td>
<t...
Hi guys i got the following syntax error at the following line when i run my program in jython:
except Exception as detail:
SyntaxError: mismatched input 'as' expecting COLON
but on python its ok? What's wrong? I'm trying to use the stanford pos tagger api (java) in my python program.are there other ways?
...
how can i send an xml file on my system to an http server using python standard library??
...
Hello, I have write a small python module with one class and two functions. The skeleton of the module is as following:
#file name: test_module.py
class TestClass:
@classmethod
def method1(cls, param1):
#to do something
pass
def __init__(self, param1):
#to do something
...
def fun1(*params):
#to do something
....
I want get the details of the wave such as its frames into a array of integers.
Using fname.getframes we can ge the properties of the frame and save in list or anything for writing into another wav or anything,but fname.getframes gives information not in integers some thing like a "/xt/x4/0w' etc..
But i want them in integer so that wou...
...or any other method which provide the similar kind of interaction will do.
...
n=[['dgd','sd','gsg'],['fsdsdf','sds','sdf']]
>>> n.remove('sd')
if i have a nested list like above and want to remove 'sd'.how can i doing the above thing is giving an error??
...
Hi all,
I need to optimize the RAM usage of my application.
PLEASE spare me the lectures telling me I shouldn't care about memory when coding Python. I have a memory problem because I use very large default-dictionaries (yes, I also want to be fast). My current memory consumption is 350MB and growing. I already cannot use shared hosting...
i am facing an issue with the apache server, we have written the code, in which if the url entered in the form field is valid it will display an error message, when i run the code through django developement server it works fine, displays the error message, but when running through apache, then does not show the error message just return...
I need a simple graphics library that supports the following functionality:
Ability to draw polygons (not just rectangles!) with RGBA colors (i.e., partially transparent),
Ability to load bitmap images,
Ability to read current color of pixel in a given coordinate.
Ideally using JavaScript or Python.
Seems like HTML 5 Canvas can hand...
Suppose i have a function like this:
def getNeighbors(vertex)
which returns a list of vertices that are neighbors of the given vertex. Now i want to create a list with all the neighbors of the neighbors. I do that like this:
listOfNeighborsNeighbors = []
for neighborVertex in getNeighbors(vertex):
listOfNeighborsNeighbors.append(...
Hi, so I asked here few days ago about C# and its principles. Now, if I may, I have some additional general questions about some languages, because for novice like me, it seems a bit confusing. To be exact I want to ask more about language functions capabilities than syntax and so.
To be honest, its just these special functions that bot...
my stanford tagger ran out of memory. Is it because the text has to be properly formatted? This is because i use it to tag html contents, with the tags stripped, but there may have quite a excessive amount of newlines.
here is the error:
BlockquoWARNING: Untokenizable: ? (char in decimal: 9829)
Exception in thread "main" java.lang...
i want to create a form for users to submit questions in django ..so far the models i have created are
class Question(models.Model):
statement=models.CharField(max_length=100)
class Choice(models.Model):
statement=models.CharField(max_length=100)
value=models.IntegerField()
question=models.ForeignKey(Question)
Now i...
I have a class that represents undirected edges in a graph. Every edge has two members vertex1 and vertex2 representing the vertices it connects. The problem is, that an edge can be specified two directions. My idea was now to define the hash of an edge as the sum of the hashes of its vertices. This way, the direction plays no role anymo...
my PYTHON xml parser fails if there´s a comment at the beginnging of an xml file like::
<?xml version="1.0" encoding="utf-8"?>
<!-- Script version: "1"-->
<!-- Date: "07052010"-->
<component name="abc">
<pp>
....
</pp>
</component>
is it illegal to place a comment like this?
EDIT:
well it´s not throwing an error but the DOM modu...