Description:
The Python computer language.
|
|
|
help in obtaining binary equivalent of a decimal number in python
|
| |
i need to get 32 bit binary equivalent of a decimal and need to change the 0's to 1's and 1's to 0's
For Example
if the input is 2 Output should be:
the 32bit equivalent of 2 :0000 0000 0000 0000 0000 0000 0000 0010
and the 1's compliment is:1111 1111 1111 1111 1111 1111 1111 1101
is there any pre-defined function to get the above results in python??... more »
|
|
serialize a class to XML and back
|
| |
Hi list,
how can I serialize a python class to XML? Plus a way to get the class back from the XML?
My aim is to store instances of this class in a database.
bg,
Johannes
-- GLOBE Development GmbH
Königsberger Strasse 260
48157 MünsterGLOBE Development GmbH
Königsberger Strasse 260... more »
|
|
Scope of a class..help???
|
| |
i had written the following code i am unable to create the instance of the class "Node" in the method "number_to_LinkedList" can any one help me how to do ??
and what is the error??
class Node:
def __init__(self, value=None):
self.value = value
self.next = None
def number_to_LinkedList(numbers):... more »
|
|
newbie question about subprocess.Popen() arguments
|
| |
Hello,
I'm trying to call new process with some parameters. The problem is that
the last parameter is a "string" that has a lot of spaces and different
symbols like slash and so on. I can save it in file and use name of this
file as parameter, but my question is: how to make it without additional... more »
|
|
Ordered dictionaries compared
|
| |
What kind of ordered dictionaries? Sorted by key.
I've redone the previous comparison, this time with a better red-black tree
implementation courtesy of Duncan G. Smith.
The comparison is at
[link]
The Red-Black tree gave a much better showing this time, but it gave just... more »
|
|
file I/O and arithmetic calculation
|
| |
Dear all,
I would appreciate if someone could write a simple python code for the
purpose below:
I have five text files each of 10 columns by 10 rows as follows:
file_one = 'C:/test/1.txt'
file_two = 'C:/test/2.txt' . . .
file_five = 'C:/test/5.txt'
I want to calculate the mean of first row (10 elements) for each file (5... more »
|
|
subclassing from unittest
|
| |
Hi,
I'd like to subclass from unittest.TestCase. I observed something
interesting and wonder if anyone can explain what's going on... some
subclasses create null tests.
I can create this subclass and the test works:
class StdTestCase (unittest.TestCase):
blahblah
and I can create this subsubclass and the test works:... more »
|
|
Python Windows release and encoding
|
| |
Hi, I am working on Linux; a friend of mine sends to me python files from
his Windows release. He uses the editor coming with the release; he runs
his code from the editor by using a menu (or some F5 key I think).
He doesn't declare any encoding in his source file; when I want to try
his code, I have an error since he obviously uses non-ascii characters.... more »
|
|
Diagnosing socket "Connection reset by peer"
|
| |
I have a sockets client that is connecting to a printer and occassionally getting the error "104 Connection reset by peer"
I have not been able to diagnose what is causing this. Is there any additional traceing I can do(either within my python code or on the network) to establish what is causing this error?... more »
|
|
|