Search Results

Search found 13693 results on 548 pages for 'python metaprogramming'.

Page 81/548 | < Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >

  • Get parent directory in Python

    - by Mridang Agarwalla
    Hi, Could someone tell me how to get the parent directory of a path in Python in a cross platform way. E.g. C:\Program Files --- C:\ and C:\ --- C:\ If the directory doesn't have a parent directory, it returns the directory itself. The question might seem simple but I couldn't dig it up through Google. Thanks.

    Read the article

  • Problems with umlauts in python appdata environvent variable

    - by Heike
    Hi, I can't find a correct way to get the environment variable for the appdata path in python. The problem is that my user name includes special characters (the german ae and ue). I made a workaround wit PyQt for Vista and Windows 7 but it doesn't work for XP Systems. Does anybody know the correct encoding of these environment variables or another solution for this problem? Greetz

    Read the article

  • Searching for specific HTML string using Python

    - by Morpheous
    What modules would be the best to write a python program that searches through hundreds of html documents and deletes a certain string of html that is given. For instance, if I have an html doc that has <a href="test.html">Test</a> and I want to delete this out of every html page that has it. Any help is much appreciated, and I don't need someone to write the program for me, just a helpful point in the right direction.

    Read the article

  • Code a timer in a python GUI in TKinter

    - by Diego Castro
    I need to code a program with GUI in python (I'm thinking of using TKinter, 'cause it's easy, but I'm open to suggestions). My major problem is that I don't know how to code a timer (like a clock... like 00:00:00,00 hh:mm:ss,00 ) I need it to update it self (that's what I don't know how to do) Another question is how do I put a program in the system tray (I don't think it's called like that in Linux) for UBUNTU.

    Read the article

  • Detect marker with opencv and python

    - by Mitch
    Hi im trying to detect a marker in a webcam video feed and overlay it with a 3d object - pretty much exactly like this: http://www.morethantechnical.com/2009/06/28/augmented-reality-with-nyartoolkit-opencv-opengl/ i know artoolkit is the best module for this, but i was hoping to just use opencv in python since i dont know nearly enough c/c++ to be able to use artoolkit. im hoping someone will be able to get me on the right track towards detecting the marker and determining its location and orientation etc since i have no idea how best to go about this or what functions i should be using thanks mitch

    Read the article

  • running a python script where dependencies are not avail: distributed computing

    - by sadhu_
    Hi, I have access to a grid (running condor) that would (potentially) allow to very substantially reduce how long by nltk based nlp tasks take. unfortunately, i dont have root access on the cluster so cannot install new packages, only run whatever is available on the linux boxes. python is of course available, but nltk isnt - i was wondering however, if there might be a way around this somehow ? is there a way i can somehow still distribute the task in a self-contained 'package' of some sort? Thanks for your hel

    Read the article

  • Should I worry about circular references in Python?

    - by bodacydo
    Suppose I have code that maintains parent/children structure. In such a structure I get circular references, where child points to parent and parent points to child. Should I worry about them? I'm using Python 2.5. I am concerned that they will not be garbage collected and the application will eventually consume all memory. Thanks, Boda Cydo.

    Read the article

  • Populate a list from xml using python

    - by Sam
    I have an xml file in the following format: <food> <desert> cake <desert> </food> <history> currently in my belly </history> I want to create two list, food and text populated with cake and history in string format. Is there an easy way to do it in python?

    Read the article

  • Fastest python/C++ multimedia library

    - by Matthew Mitchell
    I'm using pyglet for my OpenGL based game but is it the fastest library out there which has a python wrapper? I could create a C++ extension and use any C++ multimedia library. Are there any C++ libraries that are worth investing time into or is it not worth the extra work? Thank you.

    Read the article

  • Easiest ways to generate graphs from Python?

    - by Noah Weiss
    I'm using Python to process CSV files filled with data that I want to run calculations on, and then graph. I'm looking for a library to use that I can send processed CSV information to, or a dict of some sort, and then choose different graphing styles with. Does anyone have any recommendations?

    Read the article

  • Can't import obj in Python on OS X 10.6.3 Snow Leopard - libiconv.2.dylib?

    - by James
    on OS X 10.6.3 Snow Leopard % python Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. import objc Traceback (most recent call last): File "", line 1, in File "/Library/Python/2.6/site-packages/pyobjc_core-2.2-py2.6-macosx-10.6-universal.egg/objc/__init__.py", line 22, in _update() File "/Library/Python/2.6/site-packages/pyobjc_core-2.2-py2.6-macosx-10.6-universal.egg/objc/__init__.py", line 19, in _update import _objc ImportError: dlopen(/Library/Python/2.6/site-packages/pyobjc_core-2.2-py2.6-macosx-10.6-universal.egg/objc/_objc.so, 2): Library not loaded: /opt/local/lib/libiconv.2.dylib Referenced from: /Library/Python/2.6/site-packages/pyobjc_core-2.2-py2.6-macosx-10.6-universal.egg/objc/_objc.so Reason: Incompatible library version: _objc.so requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0 -- what do I need to do?

    Read the article

  • Get Element value with minidom, Python

    - by Eef
    Hi Guys, I am creating a GUI frontend for the Eve Online API in Python. I have successfully pulled the XML data from their server. I am trying to grab the value from a node called "name" from xml.dom.minidom import parse dom = parse("C:\\eve.xml") name = dom.getElementsByTagName('name') print name This seems to find the node ok but the output is below: [<DOM Element: name at 0x11e6d28>] How could I get it to print the value of the node? Cheers

    Read the article

  • Attribute References in Python

    - by Jeune
    I do Java programming and recently started learning Python via the official documentation. I see that we can dynamically add data attributes to an instance object unlike in Java: class House: pass my_house = House() my_house.number = 40 my_house.rooms = 8 my_house.garden = 1 My question is, in what situations is this feature used? What are the advantages and disadvantages compared to the way it is done in Java?

    Read the article

  • Python - doctest vs. unittest

    - by Sean
    I'm trying to get started with unit testing in Python and I was wondering if someone could inform me of the advantages and disadvantages of doctest and unittest. What conditions would you use each for?

    Read the article

  • Parsing a file with hierarchical structure in Python

    - by Kevin Stargel
    I'm trying to parse the output from a tool into a data structure but I'm having some difficulty getting things right. The file looks like this: Fruits Apple Auxiliary Core Extras Banana Something Coconut Vegetables Eggplant Rutabaga You can see that top-level items are indented by one space, and items beneath that are indented by two spaces for each level. The items are also in alphabetical order. How do I turn the file into a Python list that's something like ["Fruits", "Fruits/Apple", "Fruits/Banana", ..., "Vegetables", "Vegetables/Eggplant", "Vegetables/Rutabaga"]?

    Read the article

  • appscript on OSX 10.6.3 / Python 2.6.1

    - by jldupont
    I am having some trouble getting appscript installed on OS/X 10.6.3 / Python 2.6.1. When I issue sudo easy_install appscript I get "unable to execute gcc-4.2: No such file or directory". Even when I do export CC=/Developer/usr/bin/gcc-4.2 (a valid gcc-4.2 executable), easy_install barks. What could be the issue? Disclaimer: OS/X newbie at the helm...

    Read the article

  • convert RGB values to equivalent HSV values using python

    - by sree01
    Hi, I want to convert RGB values to HSV using python. I got some code samples, which gave the result with the S and V values greater than 100. (example : http://code.activestate.com/recipes/576554-covert-color-space-from-hsv-to-rgb-and-rgb-to-hsv/ ) . anybody got a better code which convert RGB to HSV and vice versa thanks

    Read the article

  • When to use Python special methods?

    - by bodacydo
    I know that classes can implement various special methods, such as __iter__, __setitem__, __len__, __setattr__, and many others. But when should I use them? Can anyone describe typical scenarios when I would want to implement them and they would simplify programming in Python? Thanks, Boda Cydo.

    Read the article

  • Cost of exception handlers in Python

    - by Thilo
    In another question, the accepted answer suggested replacing a (very cheap) if statement in Python code with a try/except block to improve performance. Coding style issues aside, and assuming that the exception is never triggered, how much difference does it make (performance-wise) to have an exception handler, versus not having one, versus having a compare-to-zero if-statement?

    Read the article

  • Best deployment strategy for Python google app engine

    - by sushant
    I wonder if there are any best practices/patterns for deploying python apps on Google app engine specifically Django. The best practice should be combination of existing best practices viz. Fabric, Paver, Buildout etc. Also please share best practice patterns for developing (I could not get virtualenv running with Django and Django App engine helper)

    Read the article

< Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >