Search Results

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

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

  • in Python find number of same elements in 2 lists

    - by John
    Hi, In Python if I have 2 lists say: l1 = ['a', 'b', 'c', 'd'] l2 = ['c', 'd', 'e'] is there a way to find out how many elements they have the same. In the case about it would be 2 (c and d) I know I could just do a nested loop but is there not a built in function like in php with the array_intersect function Thanks

    Read the article

  • Sanitising user input using Python

    - by Steve
    What's the best way to sanitise user input for a Python-based web application? Is there a single function to remove HTML characters and any other necessary characters combinations to ensure that an XSS or SQL injection attack isn't possible?

    Read the article

  • Creating a sliding frame containing widgets in tkinter in python

    - by Buki
    I am trying really hard to make a sliding frame containing widgets in tkinter in python. There is this frame inside a big window with different widgets. And as soon as i click on the next button on that frame the frame should slowly slide towards the left and vanish ultimately. As soon as it vanishes, i want new frame with widgets to come sliding towards right. What should i do? Anticipating your suggestions and ideas.

    Read the article

  • Python equivalent of C++ getline()

    - by Arnab Sen Gupta
    In C++ we can enter multiple lines by giving our own choice of delimiting character in the getline() function.. however I am not able to do the same in Python!! it has only raw_input() and sys.stdin.readline() methods that read till I press enter. Is there any way to customize this so that I can specify my own delimiter?

    Read the article

  • Python style: multiple-line conditions in IFs

    - by Eli Bendersky
    Hello, Sometimes I break long conditions in IFs to several lines. The most obvious way to do this is: if (cond1 == 'val1' and cond2 == 'val2' and cond3 == 'val3' and cond4 == 'val4'): do_something Isn't very very appealing visually, because the action blends with the conditions. However, it is the natural way using correct Python indentation of 4 spaces. Edit: By the way, for the moment I'm using: if ( cond1 == 'val1' and cond2 == 'val2' and cond3 == 'val3' and cond4 == 'val4'): do_something Not very pretty, I know :-) Can you recommend an alternative way ?

    Read the article

  • how to delete lowercase words from a string in python

    - by gaggina
    I'm new in python and I'm having some issues doing a simple thing. I've an array (or list as it's said in pyton) like this: list = [ 'NICE dog' , 'blue FLOWER' , 'GOOD cat' , 'YELLOW caw'] As you see each element of this array contains some words. These words is both lowercase and uppercase. How I can delete from this array each lowercase words? For example I'd like to have as result this list: list = [ 'NICE' , 'FLOWER' , 'GOOD' , 'YELLOW']

    Read the article

  • POST request from Python to PHP

    - by RainbowHat
    Python params = urllib.parse.urlencode({'spam': '1', 'eggs': '2', 'bacon': '3'}) binary_data = params.encode('utf-8') reg = urllib.request.Request("http://www.abc.com/abc/smart/ap/request/",binary_data) reg.add_header('Content-Type','application/x-www-form-urlencoded') f = urllib.request.urlopen(reg) print(f.read()) PHP if($_SERVER['REQUEST_METHOD'] == 'POST') { //parse_str($_SERVER['QUERY_STRING']); var_dump($_SERVER['QUERY_STRING']); } When i try print binary_data , it does show the parameter but by the time it reaches the PHP , i see nothing. Any idea?

    Read the article

  • Python integer incrementing with ++

    - by Znarkus
    I've always laughed to myself when I looked back at my VB6 days, "What modern language doesn't allow incrementing with double plus signs?": number++ To my surprise I can't find anything about this in the Python docs. Must I really subject myself to number = number + 1? Doesn't people use the ++/-- notation? :-(

    Read the article

  • Backup of folder + database - Python

    - by RadiantHex
    Hi there, I feel like this is quite delicate, I have various folders whith projects I would like to backup into a zip/tar file, but would like to avoid backing up files such as pyc files and temporary files. I also have a Postgres db I need to backup. Any tips for running this operation as a python script? Also, would there be anyway to stop the process from hogging resources in the process? Help would be very much appreciated.

    Read the article

  • Write easily readable XML in Python

    - by dutch
    Is there any way other than creating a method myself to write XML using python which are easily readable? xMLFile.write(xmlDom.toxml()) does create proper xml but reading them is pretty difficult. I tried toprettyxml but doesn't seem like it does much. e.g. following is what I would consider a human readable xml:

    Read the article

  • writing python to extract data from a file

    - by user297003
    Hi i am new to python i am trying to extract the text between that has specific text file ---- data1 data1 data1 extractme ---- data2 data2 data2 ---- data3 data3 extractme ---- and then dump it to text file so that ---- data1 data1 data1 extractme --- data3 data3 extractme --- thanks for the help data1 data1

    Read the article

  • Automatically Generate a FlowChart in Python

    - by fayce
    Dear All, I would like to automatically generate a flowchart similar to this one ( http://en.wikipedia.org/wiki/File:%281%29_2008-04-07_Information_Management-_Help_Desk.jpg ) with Python. Do you have any advice regarding the library I should use to draw boxes, arrows (with the shortest path), text and some colors. Many thanks in advance !

    Read the article

  • Starting python debugger automatically on error

    - by jeremy
    This is a question I have wondered about for quite some time, yet I have never found a suitable solution. If I run a script and I come across, let's say an IndexError, python prints the line, location and quick description of the error and exits. Is it possible to automatically start pdb when an error is encountered? I am not against having an extra import statement at the top of the file, nor a few extra lines of code.

    Read the article

  • Making Noise with Python

    - by Elliot
    I am trying to get python to make noise when certain things happen. Preferably, i would like to play music of some kind, however some kind of distinctive beeping would be sufficient, like an electronic timer going off. I have thus far only been able to make the system speaker chime using pywin32's Beep, however this simply does not have the volume for my application. Any ideas on how I can do this?

    Read the article

  • Bipartite matching in Python

    - by vailen
    Does anybody know any module in Python that computes the best bipartite matching? I have tried the following two: munkres hungarian However, in my case, I have to deal with non-complete graph (i.e., there might not be an edge between two nodes), and therefore, there might not be a match if the node has no edge. The above two packages seem not to be able to deal with this. Any advice?

    Read the article

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