Automatic editor of XML (based on XSD scheme)
Is there any approach to generate editor of an XML file basing on an XSD scheme? (It should be a Java or Python web based editor). ...
Is there any approach to generate editor of an XML file basing on an XSD scheme? (It should be a Java or Python web based editor). ...
Hi there I am saving a image path to my model image field with custom save function. then i realised that I am just saving the path and not an actual object. my question is how to convert that path to a object using PIL. ...
Hi! In GAE (Python), using the webApp Framework, calling self.redirect('some_url') redirects the user to that URL via the GET method. Is it possible to do a (redirect) via the POST method with some parameters as well? If possible, how? Thanks! ...
Im having trouble using the telnetlib in python, when Im doing a telnet call from the shell, everything works ok but when I do it from python, the server(that is a virtual machine) crashes. The question is: what is the different between the python telnet call and the shell telnet call? #!/usr/bin/python import telnetlib import socket i...
Hello all. I want to generate a Python class via a file. This is a very simple file, named testy.py: def __init__(self,var): print (var) When I try to instantiate it I get: >>> import testy >>> testy('1') Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'module' object is not callable Then , I t...
I'm new to Python so please be patient with me. Basically my script should run like this: 1) Load an image and split it into R, G, B channels 2) Mark an area of that image with an existing path saved as a svg file and 3) perform some calculations with the R,G,B values of this area. (further send the the image either to folder A or B, ...
Hi! I'm trying to write a SOAPpy client to my C# WebService. It is arriving as null :( How can I get any debug from the C# SOAP parser that WebService uses? This is what Python sends: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://...
I always wondered why the syntax for importing specific objects from a module is from module import x, y, z instead of import x, y, z from module. I'm not a native speaker, but isn't the latter more correct/natural? So what's the reason to put the from first? Is it merely to simplyfy the grammer (require less lookahead)? Is it an attemp...
I want to access a web service over HTTPS. I have been given a client certificate (p12 file) in order to access it. Previously we were using basic authentication. Using python I am unsure how to access it. I want to use httplib2 h = Http() #h.add_credentials("testuser", "testpass") #h.add_certificate(keyfile, certfile, '') resp, cont...
Hi folks, I'm wondering if I can extract a sequence of musical notes from a recorded sound using Python. It is the first time I'm considering using Python for this. Help would be truly awesome :) ...
I have to check a lot of worlds if they are in string... code looks like: if "string_1" in var_string or "string_2" in var_string or "string_3" in var_string or "string_n" in var_string: do_something() how to make it more readable and more clear? ...
I've got a problem trying to build a easy backup/upgrade database script. The error is in the mysqldump call using subprocess: cmdL = ["mysqldump", "--user=" + db_user, "--password=" + db_pass, domaindb + "|", "gzip", ">", databases_path + "/" + domaindb + ".sql.gz"] print "%s: backup database %s \n\t[%s]" % (domain, domaindb, ' '.join...
Hi all, I have directed graph stored in the following format in the database {STARTNODE, ENDNODE}. Therefore, {5,3} means there is an arrow from node 5 to node 3. Now I need to calculate the distance between two random nodes. What is the most efficient way? By the way, the graph is has loops. Thanks a lot! ...
Hello! I'm planning to develop a GUI application that uses curses. The idea is to provide an extra interface for a web interface, so that everything on the web site could also be done via the UI. Basically, it should be platform independent: the user would have to SSH to the server after which the UI would automatically take over. Fi...
I try to parse a secondary page with form . I use example code source from this link : http://blog.ianbicking.org/2007/09/24/lxmlhtml/ On my test i use this url: http://www.infofer.ro/ Like on example , I use this values : >>> pprint(form.form_values()) [('cboData', '8/30/2010'), ('txtPlecare', 'Bucuresti Nord'), ('txtSosire', 'Const...
I want to get the size of an http://.. file before I download it. I don't know how to use http request. Thanks! ...
I have a python dictionary that contains iterables, some of which are lists, but most of which are other dictionaries. I'd like to do glob-style assignment similar to the following: myiter['*']['*.txt']['name'] = 'Woot' That is, for each element in myiter, look up all elements with keys ending in '.txt' and then set their 'name' item ...
Hi! I have a such text to load: https://sites.google.com/site/iminside1/paste I'd prefer to create a python dictionary from it, but any object is OK. I tried pickle, json and eval, but didn't succeeded. Can you help me with this? Thanks! The results: a = open("the_file", "r").read() json.loads(a) ValueError: Expecting property name: li...
There must be a simpler, more pythonic way of doing this. Given this list of pairs: pp = [('a',1),('b',1),('c',1),('d',2),('e',2)] How do I most easily find the first item in adjacent pairs where the second item changes (here, from 1 to 2). Thus I'm looking for ['c','d']. Assume there will only be one change in pair[1] for the entir...
I have a package mypack with modules mod_a and mod_b in it. I intend the first two to be imported freely: import mypack import mypack.mod_a However, I'd like to keep mod_b for the exclusive use of mypack. That's because it exists merely to organize the latter's internal code. My first question is, is this -- 'private' modules -- an ...