Search Results

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

Page 112/608 | < Previous Page | 108 109 110 111 112 113 114 115 116 117 118 119  | Next Page >

  • Make OS open directory in Python

    - by Vidar
    I am writing a program in Python, and want to get it to make the OS open the current working directory, making for instance Windows open explorer.exe and navigating to the wanted directory. Any ideas on how to do this? The directory is already given by os.getcwd. Cross platform methods preferred :)

    Read the article

  • How to generate all strings with d-mismatches, python

    - by mr.M
    I have a following string - "AACCGGTTT" (alphabet is ["A","G","C","T"]). I would like to generate all strings that differ from the original in any two positions i.e. GAGCGGTTT ^ ^ TATCGGTTT ^ ^ How can I do it in Python? I have only brute force solution (it is working): generate all strings on a given alphabet with the same length append strings that have 2 mismatches with a given string However, could you suggest more efficient way to do so?

    Read the article

  • Python: Split, strip, and join in one line

    - by PandemoniumSyndicate
    I'm curious if their is some python magic I may not know to accomplish a bit of frivolity given the line: csvData.append(','.join([line.split(":").strip() for x in L])) I'm attempting to split a line on :, trim whitespace around it, and join on , problem is, since the array is returned from line.split(":"), the for x in L #<== L doesn't exist! causes issues since I have no name for the array returned by line.split(":") So I'm curious if there is a sexy piece of syntax I could use to accomplish this in one shot? Cheers!

    Read the article

  • Accessing MySQL server via VPN in python

    - by user210481
    Hi I have a MySQL server that I need access through a VPN. I use MySQLdb package to access MySQL server in Python. When I can access the server without VPN, it works fine, but when I'm at certain locations, I need to connect through VPN. My computer is connected to the VPN and I can access the database through PHPMyAdmin, but MySQLdb gives me an error message: OperationalError: (2003, "Can't connect to MySQL server on 'MY_IP' (10061)") Any ideas on why it's not working? Thanks

    Read the article

  • Get screenshot on Windows with Python?

    - by Zachary Brown
    Hello, I am creating a Beta Testers reporting module so they can send in thier comments on my software, but I would like to have the option to include a screenshot with the report. How do I take a screenshot of the screen with Python on Windows? I have found several examples on Linux, but haven't had much luck on Windows.

    Read the article

  • detect the most used colour in an image using python

    - by sree01
    Hi, I want to find the most used colour in an image using python. for example detect the colour of the object in the following image http://www.shopcrazy.com.ph/wp-content/images/2007/02/shiny-bags-01.jpg. how to detect the base colour from the RGB codes(example - red in the above image).

    Read the article

  • Catching and outputting stderr at the same time with python's subprocess

    - by Mediocre Gopher
    (Using python 3.2 currently) I need to be able to: Run a command using subprocess Both stdout/stderr of that command need be printed to the terminal in real-time (it doesn't matter if they both come out on stdout or stderr or whatever At the same time, I need a way to know if the command printed anything to stderr (and preferably what it printed). I've played around with subprocess pipes as well as doing strange pipe redirects in bash, as well as using tee, but as of yet haven't found anything that would work. Is this something that's possible?

    Read the article

  • Python UTF-8 can't decode byte on 32-bit machine

    - by jsh617
    it works fine on 64 bit machines but for some reason will not work on python 2.4.3 on a 32-bit instance. i get the error 'utf8' codec can't decode bytes in position 76-79: invalid data for the code try: str(sourceresult.sourcename).encode('utf8','replace') except: raise Exception( repr(sourceresult.sourcename ) ) it returns 'kazamidori blog\xf9' i have modified my site.py file to make UTF8 the default encoding, but still doesnt seem to be working.

    Read the article

  • Executing JavaScript with Python without X.

    - by Thomas
    I want to parse a html-page that unfortunately requires JavaScript to show any content. In order to do so I use a small python-script that pulls the html-code of the page, but after that I have to execute the JavaScript in a DOM-context which seems pretty hard. To make it even harder I want to use it in a server environment that has no X11-server. Note: I already read about http://code.google.com/p/pywebkitgtk/ but it seems to need a X-server.

    Read the article

  • How to implement a Mutex in Python when using Gtk with PyGTK

    - by Julian
    Hi, I have an application that starts several threads using gobject.timeout_add(delay, function) Now in my function I want to test and set on some variable, e.g. def function(self): if flag == True: flag = False doSomething() Now to make this threadsafe, I would have to lock the function using some mutex lock. Is this possible with Gtk? Or can I use the Python Lock objects from threading?

    Read the article

  • Python interpreter with Linux Screen

    - by Unknown
    I was working with Python with a Linux terminal screen. When I typed: help(somefunction) It printed the appropriate output, but then my screen was stuck, and at the bottom of the terminal was "(end)". How do I get unstuck? Thanks in advance.

    Read the article

  • How to write a large number of nested records in JSON with Python

    - by jamesmcm
    I want to produce a JSON file, containing some initial parameters and then records of data like this: { "measurement" : 15000, "imi" : 0.5, "times" : 30, "recalibrate" : false, { "colorlist" : [234, 431, 134] "speclist" : [0.34, 0.42, 0.45, 0.34, 0.78] } { "colorlist" : [214, 451, 114] "speclist" : [0.44, 0.32, 0.45, 0.37, 0.53] } ... } How can this be achieved using the Python json module? The data records cannot be added by hand as there are very many.

    Read the article

  • question about python sched schedular.

    - by samy
    I have read about python sched (task schedular), it works like a cron. but I have a question : lets say if i schedule a function to ryn after every 2 hours and in the mean time my system gets shut down, then I again restart the system...did the schedular automatically starts and will run the function after 2 hours? or i have to start that again after shutting down the system? did sched work like a deamon?

    Read the article

  • Exposing members or make them private in Python?

    - by deamon
    Is there a general convention about exposing members in Python classes? I know that this is a case of "it depends", but maybe there is a rule of thumb. Private member: class Node: def __init__(self): self.__childs = [] def add_childs(self, *args): self.__childs += args node = Node() node.add_childs("one", "two") Public member: class Node2: def __init__(self): self.childs = [] node2 = Node2() node2.childs += "one", "two"

    Read the article

  • How are python pages coded and what can the language be compared to? [closed]

    - by avon_verma
    I have a few questions about python I've seen many pages like these on Google http://mail.google.com/support/bin/answer.py?answer=6583 https://www.google.com/adsense/support/bin/topic.py?topic=13488 ...that have .py extensions. 1: Are pages like these built on pure python code, but printing out html like print "<div etc..." or like the typical asp,jsp,php type of pages with html pages and embedded python code like: <html> <% some python code %> </html> 2: What is python mainly used for making? windows apps or web or .. ? 3: Are ruby and perl also similar to python?

    Read the article

  • Python: saving and loading a class definition

    - by Peterstone
    Hi! I am interested in saving and load objects using the pickle module as you can read in a question I asked before: Python: Errors saving and loading objects with pickle module Someone commment: 1, In an other way: the error is raise because pickle wanted to load an instance of the class Fruits and search for the class definition where it was defined, but it didn't find it so it raise the error Now I want to save and load a class definition in order to solve the problem I describe in the question mentioned before. Thank you so much!

    Read the article

  • How can I unshorten a URL using python?

    - by Andrew
    I want to be able to take a shortened or non-shortened URL and return its un-shortened form. How can I make a python program to do this? Additional Clarification: Case 1: shortened -- unshortened Case 2: unshortened -- unshortened e.g. bit.ly/silly in the input array should be google.com in the output array e.g. google.com in the input array should be google.com in the output array Thanks for the help!

    Read the article

  • Time Calculation in Python

    - by user343934
    Hi everyone, I have two python cgi pages (index, display), what i need to do is calculate time frame between the execution. Work flow: Index.py (submit) After submit it redirect to display.py page display.py page has got class with execute(),display() &init_main() functions In init_main() i have created class object which access to above functions I need to calculate time interval between the submit (index.py) to execute() end, so i can show user how much time does different weighted file takes on real time. Hoping to see your suggestions Thanks

    Read the article

  • CAC Client Application Authentication in Python

    - by Präriewolf
    I am building a python application to pull data from a website. The application has to authenticate(HTTPS/SSL) with a CAC card and pin in order to make requests. Am I correct in my assumptions that you can't retrieve the private key from a CAC card, and am therefore stuck using a PKCS #11 Wrapper like PyKCS? Any tips or resources for going about this?

    Read the article

< Previous Page | 108 109 110 111 112 113 114 115 116 117 118 119  | Next Page >