Search Results

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

Page 115/608 | < Previous Page | 111 112 113 114 115 116 117 118 119 120 121 122  | Next Page >

  • Python + PyQt program freezes

    - by DSblizzard
    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?

    Read the article

  • Python PLY zero or more occurrences of a parsing item

    - by None
    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?

    Read the article

  • installing a package with xml based configuration in python

    - by saminny
    Hi, I am planning to write a generic python module for installing a package. This script should retrieve the module from a remote machine or locally and install it on a given host and user. However, there needs to be changes made to the package files based on the host, user and given environment. My approach is to use XML to describe changes to be made to package files based on environment. It will first extract the package to the user directory and then using an xml configuration file, it should replace the file values in the package directory. The xml would look something like this: <package version="1.3.3"> <environment type="prod"> <file dir="d1/d2" name="f1"> <var id="RECV_HOST" value="santo"> <var id="RECV_PORT" value="RECV_PORT_SERVICE" type="service"> <var id="JEPL_SERVICE_NAME" value="val_omgact"> </file> <var dir="d4/d3/s2" name="f2"> <var id="PRECISION" value="true"> <var id="SEND_STATUS_CODE" value="323"> <var id="JEPL_SERVICE_NAME" value="val_omgact"> </file> </environment> <environment type="qa"> <file dir="d1/d2" name="f1"> <var id="RECV_HOST" value="test"> <var id="RECV_PORT" value="1444"> <var id="JEPL_SERVICE_NAME" value="val_tsdd"> </file> <file dir="d4/d3/s2" name="f2"> <var id="PRECISION" value="false"> <var id="SEND_STATUS_CODE" value="323"> <var id="JEPL_SERVICE_NAME" value="val_dsd"> </file> </environment> </package> What are your thoughts on this approach? Is there an existing python module, package or script that I could use for this purpose since this seems fairly generic and can be used for any installation. Thanks! Sam

    Read the article

  • In google app engine, how to iterate through form fields (python, wsgiref.handlers)

    - by MarcoB
    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...

    Read the article

  • Restrictons of Python compared to Ruby: lambda's

    - by Shyam
    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!

    Read the article

  • [python] parsing a string based on specified identifiers

    - by jml
    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

    Read the article

  • doing arithmetic upto two significant figures in Python?

    - by user248237
    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.

    Read the article

  • [python] traversing an object tree

    - by jml
    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

    Read the article

  • using wild card when listing directories in python

    - by user248237
    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.

    Read the article

  • Cross platform /dev/null in Python

    - by Tristan
    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.

    Read the article

  • Finding unique maximum values in a list using python

    - by mikip
    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

    Read the article

  • Python new-style classes and __subclasses__ function

    - by Fraser Graham
    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.

    Read the article

  • Emacs bulk indent for Python

    - by Vernon
    Working with Python in Emacs if I want to add a try/catch to a block of code, I often find that I am having to indent the whole block, line by line. In Emacs, how do you indent the whole block at once. I am not an experienced Emacs user, but just find it is the best tool for working through ssh. I am using Emacs on the command line(Ubuntu), not as a gui, if that makes any difference.

    Read the article

  • Writing a file shredder in python or ruby?

    - by pmilb21
    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.

    Read the article

  • Safest python code running

    - by Oduvan
    How can I protect my web server, if I run custom users code on server. If any user can submit his python source on my server and run it. Maybe some modules or linux tools for close any network and hardware activity for this script. Thank's all for help!

    Read the article

  • Python multithreading, How is it using multiple Cores?

    - by Sabirul Mostofa
    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.

    Read the article

< Previous Page | 111 112 113 114 115 116 117 118 119 120 121 122  | Next Page >