Search Results

Search found 15187 results on 608 pages for 'boost python'.

Page 51/608 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • Post HTML data via XMLRPC in Python ?

    - by mrblue
    Hi all, I am writing a small script by Python to connect and post content to my WordPress blog. It's pretty straightforward with https://github.com/maxcutler/python-wordpress-xmlrpc However, when i tried to input a HTML data, for example: <b>Hello</b> It appears exactly in the WordPress post (I watch it from the visual editor, and I need to re-format it by copying the data to HTML mode to have the expected result. What should I do with my python script ? Thank you very much

    Read the article

  • boost::Spirit Grammar for unsorted schema

    - by Hassan Syed
    I have a section of a schema for a model that I need to parse. Lets say it looks like the following. { type = "Standard"; hostname="x.y.z"; port="123"; } The properties are: The elements may appear unordered. All elements that are part of the schema must appear, and no other. All of the elements' synthesised attributes go into a struct. (optional) The schema might in the future depend on the type field -- i.e., different fields based on type -- however I am not concerned about this at the moment.

    Read the article

  • Python encoding for pipe.communicate

    - by Brian M. Hunt
    I'm calling pipe.communicate from Python's subprocess module from Python 2.6. I get the following error from this code: from subprocess import Popen pipe = Popen(cwd) pipe.communicate( data ) For an arbitrary cwd, and where data that contains unicode (specifically 0xE9): Exec. exception: 'ascii' codec can't encode character u'\xe9' in position 507: ordinal not in range(128) Traceback (most recent call last): ... stdout, stderr = pipe.communicate( data ) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 671, in communicate return self._communicate(input) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1177, in _communicate bytes_written = os.write(self.stdin.fileno(), chunk) This is happening, I presume, because pipe.communicate() is expecting ASCII encoded string, but data is unicode. Is this the problem I'm encountering, and i sthere a way to pass unicode to pipe.communicate()? Thank you for reading! Brian

    Read the article

  • Is Matlab faster than Python?

    - by kame
    I want to compute magnetic fields of some conductors using the biot-savart-law and I want to use a 1000x1000x1000 matrix. Before I use Matlab, but now I want to use Python. Is Python slower than Matlab? How can I make Python faster? EDIT: Maybe the best way is to compute the big array with c/c++ and then transfering them to python. I want to visualise then with VPython. EDIT2: Could somebody give an advice for which is better in my case: C or C++?

    Read the article

  • I want to create adjacency matrix using python

    - by A A
    I have very large data set it is almost 450000 lines and two rows, i want to compute adjacency matrix using python, because previously i have tried to do it in matlab, and it shows memory error because of large data values. my data values also start from 100 and goes upto 450000, Anyone can help me in this issue, as i am new to python. I have to first import the file into python using excel sheet or notepad and then compute the adjacency matrix

    Read the article

  • Critiquing my first Python script

    - by tipu
    A little bit of background: I'm building an inverted index for a search engine. I was originally using PHP, but because of the amount of times I needed to write to disk, I wanted to make a threaded indexer. There's a problem with that because PHP is not thread safe. I then tried Java, but I ended up with at least 20 try catch blocks because of the JSON data structure I was using and working with files. The code was just too big and ugly. Then I figured I should pick up some Python because it's flexible like PHP but also thread safe. Though I'm open to all criticism, what I'd like to learn is the shortcuts that the Python language/library provides that I skipped over. This is a PHP-afide Python script because all I really did was translate the PHP script line by line to what I thought was it's Python equivalent. Thanks. http://pastebin.com/xrg7rf9w

    Read the article

  • return sql query in xml format in python

    - by Ramy
    When I first started working at the company that i work at now, I created a java application that would run batches of jasper-reports. In order to determine which parameters to use for each report in the set of reports, I run a sql query (on sqlserver). I wrote the application to take an xml file with a set of parameters for each report to be generated in the set. so, my process has become, effectively, three steps: run the sql query and return the results in XML format (using 'for XML auto') run the results of the sql query through an XSLT transformation so the xml is formatted in such a way that is friendly with the java application i wrote. run the java application with that final xml file As you can imagine, what I'd like to do is accomplish these steps in python, but i'm not quite sure how to get started. I know how to run an SQL query in Python. I see plenty of documentation about how to write your own xml document with Python. I even see documentation for xsl transformations in python. the big question is how to get the results of the sql query in XML through python. Any and all pointers would be very valuable. Thanks, _Ramy

    Read the article

  • Simple Python Challenge: Fastest Bitwise XOR on Data Buffers

    - by user213060
    Challenge: Perform a bitwise XOR on two equal sized buffers. The buffers will be required to be the python str type since this is traditionally the type for data buffers in python. Return the resultant value as a str. Do this as fast as possible. The inputs are two 1 megabyte (2**20 byte) strings. The challenge is to substantially beat my inefficient algorithm using python or existing third party python modules (relaxed rules: or create your own module.) Marginal increases are useless. from os import urandom from numpy import frombuffer,bitwise_xor,byte def slow_xor(aa,bb): a=frombuffer(aa,dtype=byte) b=frombuffer(bb,dtype=byte) c=bitwise_xor(a,b) r=c.tostring() return r aa=urandom(2**20) bb=urandom(2**20) def test_it(): for x in xrange(1000): slow_xor(aa,bb)

    Read the article

  • Can a native-looking GUI be made with Python

    - by Matt
    I haven't gotten far enough into Python to make GUIs yet, so I thought I'd ask here. Can a python app be made with the windows default style GUI, or will it have its own style? The only screenshots I've seen of a python app running with a GUI had this ugly win95 look to it.

    Read the article

  • Calling Python from Ruby

    - by Yktula
    Would it be possible to integrate Python and Ruby with some degree of transparency? I've looked at http://www.goto.info.waseda.ac.jp/~fukusima/ruby/python/doc/ , but it seems rather outdated. Perhaps this is not an appropriate approach, but would it be possible to generate a Ruby interface for Python's C API?

    Read the article

  • Use different Python version with virtualenv

    - by Ulf
    I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtualenv with a different version of Python? I compiled Python 2.6.2 and would like to use it with some virtualenv. Is it enough to overwrite the binary file? Or do I have to change something in respect to the libraries?

    Read the article

  • Python run command line (time)

    - by pns
    Hi, I want to run the 'time' unix command from a Python script, to time the execution of a non Python app. I would use the os.system method. Is there any way to save the output of this in Python? My goal is to run the app several times, save their execution times and then do some statistics on them. Thank You

    Read the article

  • Writing a DBMS in Python

    - by Matt Luongo
    Hey guys, I'm working on a basic DBMS as a pet project and planning to prototype in Python. I figure there's a reason there are only a few Python databases, and my gut agrees that my favorite language will be too slow to act as an honest performing database, but I'm looking forward to using it to learn what I need quickly. Would someone please contradict me? Is Python as ill-suited right now for this sort of thing as I think?

    Read the article

  • Stop execution of python script when parent Bash shell script is killed

    - by jrdioko
    I'm working on a Bash shell script that runs several Python scripts like so: cd ${SCRIPT_PATH} python -u ${SCRIPT_NAME} ${SCRIPT_ARGS} >> $JOBLOG 2>&1 At one point, I killed the shell script (using kill PID), but the Python script continued running, even after the script terminated. I thought these would die as soon as the main script died. What am I misunderstanding about Bash scripting, and what can I do to get the functionality I'm looking for? Thanks in advance!

    Read the article

  • How to Learn Python

    - by Brett Veenstra
    For a beginner's perspective, can you answer the following: Best Tool(s) for Python development (e.g. NotePad, Vim) Best Book to get Started Best Website for Python beginner Best Problem Domain to do a sample project (what is Python-based solutions best suited for?)

    Read the article

  • Installing Python in Windows XP

    - by Sam
    My work PC has restrictions that stop me from adding programs to the start menu so when I try to install Python using the Python 2.6.5 Windows installer it can't complete as it tries to add a shortcut to my start menu. Is there a way around this? I.e another way of installing without the need for a shortcut? Edit: I'll also need to install NumPy which I can't do on the Portable version of Python.

    Read the article

  • Using python code in ASP.NET Web forms app

    - by DotnetDude
    I would like to use some code written in python (it uses built in modules) in a regular ASP.NET/C# web application. I am a newbie in python and have heard of IronPython and how ASP.NET now allows us to create IronPython apps. Any thoughts on which way I should proceed? The python code is the on here

    Read the article

  • module compiled with swig not found by python

    - by openbas
    Hello, I've a problem with SWIG and python. I've a c-class that compiles correctly, but the python script says it can't find the module. I compile with: swig -c++ -python codes/codes.i g++ -c -Wall -O4 -fPIC -pedantic codes/*.cc g++ -I/usr/include/python2.6 -shared codes/codes_wrap.cxx *.o -o _codes.so This gives me a _codes.so file, as I would expect, but then I have this python file: import sys import codes (rest of the code omitted) It gives me: Traceback (most recent call last): File "script.py", line 3, in <module> import codes ImportError: No module named codes According to http://www.swig.org/Doc1.3/Introduction.html#Introduction_nn8 this is all I should have to do... The files are in the same directory, so the path should not be a problem ?

    Read the article

  • Best way to save complex Python data structures across program sessions (pickle, json, xml, database

    - by Malcolm
    Looking for advice on the best technique for saving complex Python data structures across program sessions. Here's a list of techniques I've come up with so far: pickle/cpickle json jsonpickle xml database (like SQLite) Pickle is the easiest and fastest technique, but my understanding is that there is no guarantee that pickle output will work across various versions of Python 2.x/3.x or across 32 and 64 bit implementations of Python. Json only works for simple data structures. Jsonpickle seems to correct this AND seems to be written to work across different versions of Python. Serializing to XML or to a database is possible, but represents extra effort since we would have to do the serialization ourselves manually. Thank you, Malcolm

    Read the article

  • Cross-compiling a Python script on Linux into a Windows executable

    - by Chinmay Kanchi
    I have a Python script that I'd like to compile into a Windows executable. Now, py2exe works fine from Windows, but I'd like to be able to run this from Linux. I do have Windows on my development machine, but Linux is my primary dev platform and I'm getting kind of sick of rebooting into Windows just to create the .exe. Any ideas? PS: I am aware that py2exe doesn't exactly compile the python file as much as package your script with the Python interpreter. But either way, the result is that you don't need Python installed to run the script.

    Read the article

  • Python and Plone help

    - by Grenko
    Im using the plone cms and am having trouble with a python script. I get a name error "the global name 'open' is not defined". When i put the code in a seperate python script it works fine and the information is being passed to the python script becuase i can print the query. Code is below: #Import a standard function, and get the HTML request and response objects. from Products.PythonScripts.standard import html_quote request = container.REQUEST RESPONSE = request.RESPONSE # Insert data that was passed from the form query=request.query #print query f = open("blast_query.txt","w") for i in query: f.write(i) return printed I also have a second question, can i tell python to open a file in in a certain directory for example, If the script is in a certain loaction i.e. home folder, but i want the script to open a file at home/some_directory/some_directory can it be done?

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >