Hi,
I am looking for a python SOAP 1.2 client but it seems that it does not exist . All of the existing clients are either not maintainted or only compatible with SOAP 1.1:
suds
SOAPpy
ZSI
Cant download any pyhton windows modules and install. I wanted to experiment with scrapy framework and stackless but unable to install due to error "Python veIrsion 2.6 required, which was not found in the registry".
Trying to install it to
Windows 7, 64 bit machine
Windows XP, Python 2.5:
hash('http://stackoverflow.com') Result: 1934711907
Google App Engine (http://shell.appspot.com/):
hash('http://stackoverflow.com') Result: -5768830964305142685
Why is that? How can I have a hash function which will give me same results across different platforms (Windows, Linux, Mac)?
I am using Python with PLY to parse LISP-like S-Expressions and when parsing a function call there can be zero or more arguments. How can I put this into the yacc code. This is my function so far:
def p_EXPR(p):
'''EXPR : NUMBER
| STRING
| LPAREN funcname [EXPR] RPAREN'''
if len(p) == 2:
p[0] = p[1]
else:
p[0] = ("Call", p[2], p[3:-1])
I need to replace "[EXPR]" with something that allows zero or more EXPR's. How can I do this?
I'm writing a Python application, that I want to later migrate to GAE.
The new "Task Queues" API fulfills a requirement of my app, and I want to simulate it locally until I have the time to migrate the whole thing to GAE.
Does anyone know of a compatible module I can run locally?
how to traverse a binary decision tree using python language.
given a tree,i want know how can we travesre from root to required leaf
the feature of the required leaf are given in an dictionary form assume and have to traverse from root to leaf answering the questions at each node with the details given in feature list..
the decision tree node has format ((question)(left tree)(right tree))
while traversing it should answer question at each node and an choose left or right and traverse till leaf?
Using python and wsgiref.handlers, I can get a single variable from a form with self.handler.request.get(var_name), but how do I iterate through all form variables, be they from GET and POST? Is it something like this?
for field in self.handler.request.fields:
value = self.handler.request.get(field)
Again, it should include both fields included in the POST and fields from the query string, as in a GET request.
Thanks in advance folks...
Hi,
I was going over some pages from WikiVS, that I quote from:
because lambdas in Python are restricted to expressions and cannot contain statements
I would like to know what would be a good example (or more) where this restriction would be, preferably compared to the Ruby language.
Thank you for your answers, comments and feedback!
I have
stringA = "xxxxxxFoundAaaaaaaaaaaaaaaFoundBxxxxxxx"
stringB = "FoundA"
stringC = "FoundB"
How do I do a regular expression in python in order to return aaaaaaaaaaaaaa?
Please help.
Thanks in advance.
I wrote PyQt application. After it's start I close it (GUI), but timer don't stops and Python sometimes freezes. Only thing to unfreeze it - Ctrl-C, after which following message appears:
Traceback (most recent call last):
File "", line 262, in timerEvent
KeyboardInterrupt
timer don't stops again, and CPython works very slowly. How to avoid this problem?
how can I use wild cars like '*' when getting a list of files inside a directory in Python? for example, I want something like:
os.listdir('foo/*bar*/*.txt')
which would return a list of all the files ending in .txt in directories that have bar in their name inside of the foo parent directory.
how can I do this?
thanks.
Hi there,
I'm trying to find information on different ways to traverse an object tree in python.
I don't know much about the language in general yet, so any suggestions/techniques would be welcome.
Thanks so much
jml
im trying to build android from source on ubuntu 10.04. when i enter the repo command:
repo init -u git://android.git.kernel.org/platform/manifest.git -b eclair
it get this error back
exec: 23: python: not found
any ideas.
I have two floats in Python that I'd like to subtract, i.e.
v1 = float(value1)
v2 = float(value2)
diff = v1 - v2
I want "diff" to be computed upto two significant figures, that is compute it using %.2f of v1 and %.2f of v2. How can I do this? I know how to print v1 and v2 up to two decimals, but not how to do arithmetic like that.
thanks.
Can we initialize python objects with statement like this:
a = b = c = None
it seems to me when I did a = b = c = list() will cause circular reference count issue.
Please give your expert advice.
Let's say that I have the following text:
in = "one aaa two bbbb three cccc"
I would like to parse this into a group of variables that contain
notworking = ["one", "two", "three"]
v1,v2,v3 = in.split(notworking)
I know that the example above won't work, but is there some utility in python that would allow me to use this sort of approach? I know what the identifiers will be in advance, so I would think that there has got to be a way to do this...
Thanks for any help,
jml
I'm using the following code to hide stderr on Linux/OSX for a Python library I do not control that writes to stderr by default:
f = open("/dev/null","w")
zookeeper.set_log_stream(f)
Is there an easy cross platform alternative to /dev/null? Ideally it would not consume memory since this is a long running process.
Hi
I have a list of points as shown below
points=[ [x0,y0,v0], [x1,y1,v1], [x2,y2,v2].......... [xn,yn,vn]]
Some of the points have duplicate x,y values. What I want to do is to extract the unique maximum value x,y points
For example, if I have points [1,2,5] [1,1,3] [1,2,7] [1,7,3]
I would like to obtain the list [1,1,3] [1,2,7] [1,7,3]
How can I do this in python
Thanks
I am running a multithreaded application(Python2.7.3) in a Intel(R) Core(TM)2 Duo CPU E7500 @ 2.93GHz. I thought it would be using only one core but using the "top" command I see that the python processes are constantly changing the core no. Enabling "SHOW THREADS" in the top command shows diffrent thread processes working on different cores.
Can anyone please explain this? It is bothering me as I know from theory that multithreading is executed on a single core.
Can somebody explain to me why this works (in Python 2.5) :
class Foo(object):
pass
class Bar(Foo):
pass
print(Foo.__subclasses__())
but this doesn't :
class Foo():
pass
class Bar(Foo):
pass
print(Foo.__subclasses__())
The latter returns "AttributeError: class Foo has no attribute '__subclasses__'" but i'm not sure why. I know this is related to old-style vs. new-style classes but i'm not clear on why that would make this functionality unavailable.
I have a string which is like this:
this is "a test"
I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is:
['this','is','a test']
PS. I know you are going to ask "what happens if there are quotes within the quotes, well, in my application, that will never happen.
It is recommended to not to use import * in python. Can anyone please share the reason for that, so that I can avoid it doing next time.
Thanks and Regards
Hi! I was wondering how to make a simple Clipboard Monitor in python, for GUI I'm using PyGTK.
I found gtk.clipboard class and all that but I couldn't find any solution to get the "signals" to trigger the event when the clipboard content has changed :(
Any ideas?
Thanks you! :)
In the effort to learn python and/or ruby, I was wondering how a file shredder would be implemented? I would like it to take in a file as an argument and then employ an algorithm to make that file unrecoverable. Would possibly add the support for multiple files or even whole directories later.