Search Results

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

Page 96/608 | < Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >

  • python numpy roll with padding

    - by Marshall Ward
    I'd like to roll a 2D numpy in python, except that I'd like pad the ends with zeros rather than roll the data as if its periodic. Specifically, the following code import numpy as np x = np.array([[1, 2, 3],[4, 5, 6]]) np.roll(x,1,axis=1) returns array([[3, 1, 2],[6, 4, 5]]) but what I would prefer is array([[0, 1, 2], [0, 4, 5]]) I could do this with a few awkward touchups, but I'm hoping that there's a way to do it with fast built-in commands. Thanks

    Read the article

  • Code a timer in a GUI python 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

  • Python: Socket set source port number

    - by beratch
    Hi all, I'd like to send a specific UDP broadcast packet.. unfortunatly i need to send the udp packet from a very specific port for all packet I send. Let say I broadcast via UDP "BLABLAH", the server will only answer if my incoming packet source port was 1444, if not the packet is discarded. My broadcast socket setup look like this : s = socket(AF_INET,SOCK_DGRAM) s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1) How can i do that (set the source port) in python ? Thanks!

    Read the article

  • How to synchronize a python dict with multiprocessing

    - by Peter Smit
    I am using Python 2.6 and the multiprocessing module for multi-threading. Now I would like to have a synchronized dict (where the only atomic operation I really need is the += operator on a value). Should I wrap the dict with a multiprocessing.sharedctypes.synchronized() call? Or is another way the way to go?

    Read the article

  • Indexing CSV file contents in Python

    - by Hossein
    Hi, I have a very large CSV file contaning only two fields (id,url). I want to do some indexing on the url field with python, I know that there are some tools like Whoosh or Pylucene. but I can't get the examples to work. can someone help me with this?

    Read the article

  • entity set expansion python

    - by Nicolas M.
    Do you know of any existing implementation in any language (preferably python) of any entity set expansion algorithms, such that the one from Google sets ? ( http://labs.google.com/sets ) I couldn't find any library implementing such algorithms and I'd like to play with some of those to see how they would perform on some specific task I would like to implement. Any help is welcome ! Thanks a lot for your help, Regards, Nicolas.

    Read the article

  • working python xml

    - by ricardo
    hello all, my question is the following, which is the best way of working XML (kml) with python?, especially script serializable. thanks for your attention and answers

    Read the article

  • Python error with IndentationError: unindent does not match any outer indentation level

    - by Vikrant Cornelio
    from tweepy import Stream from tweepy import OAuthHandler from tweepy.streaming import StreamListener ckey='W1VPPrau42ENAWP1EnDGpQ' csecret='qxtY2rYNN0QT0Ndl1L4PJhHcHuWRJWlEuVnHFDRSE' atoken='1577208120-B8vGWIquxbmscb9xdu5AUzENv09kGAJUCddJXAO' asecret='tc9Or4XoOugeLPhwmCLwR4XK8oUXQHqnl10VnQpTBzdNR' class listener(StreamListener): def on_data(self,data): print data return True def on_error(self,status): print status auth=OAuthHandler(ckey,csecret) auth.set_access_token(atoken,asecret) twitterStream=Stream(auth,listener()) twitterStream.filter(track=["car"]) I typed this in my Python shell i got an error...the error was IndentationError: unindent does not match any outer indentation level..Please help me!!!!!!!!!!!

    Read the article

  • monkey patching time.time() in python

    - by user84584
    Hello guys, I've an application where, for testing, I need to replace the time.time() call with a specific timestamp, I've done that in the past using ruby (code available here: http://github.com/zemariamm/Back-to-Future/blob/master/back_to_future.rb ) However I do not know how to do this using Python. Any hints ? Cheers, Ze Maria

    Read the article

  • Python - Execute Process -> Block till it exits & Supress Output

    - by Jason
    Hi, I'm using the following to execute a process and hide its output from Python. It's in a loop though, and I need a way to block until the sub process has terminated before moving to the next iteration. subprocess.Popen(["scanx", "--udp", host], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) Thanks for any help.

    Read the article

  • WebService client libraries for Python and Perl

    - by Dmitry
    I want to access web service in Python or/and Perl scripts. What are the most popular and reliable libraries today? I read this question, and I know about SOAPpy and ZSI. Can anybody say something about this libraries? Are they reliable enough for use in production?

    Read the article

  • python simpleftpserver module ftp

    - by iamrohitbanga
    i need a simple implementation of ftp that i can setup quickly for some experiments. is there an equivalent of python -m SimpleHTTPServer for ftp. Google sarch didn't help. i just need a simple implentation of ftp that is easy to setup. (so i don't have to go through the installation trouble for a lot of PC's).

    Read the article

  • Using a Unicode format for Python's `time.strftime()`

    - by Hosam Aly
    I am trying to call Python's time.strftime() function using a Unicode format string: u'%d\u200f/%m\u200f/%Y %H:%M:%S' (\u200f is the "Right-To-Left Mark" (RLM).) However, I am getting an exception that the RLM character cannot be encoded into ascii: UnicodeEncodeError: 'ascii' codec can't encode character u'\u200f' in position 2: ordinal not in range(128) I have tried searching for an alternative but could not find a reasonable one. Is there an alternative to this function, or a way to make it work with Unicode characters?

    Read the article

  • Calling gawk from python

    - by chavanak
    Hi, I am trying to call gawk from python in this manner. import os import string import codecs ligand_file=open( "2WTKA_ab.txt", "r" ) #Open the receptor.txt file ligand_lines=ligand_file.readlines() # Read all the lines into the array ligand_lines=map( string.strip, ligand_lines ) ligand_file.close() for i in ligand_lines: os.system ( " gawk %s %s"%( "'{if ($2==""i"") print $0}'", 'unique_count_a_from_ac.txt' ) ) My problem is that "i" is not being replaced by the value it represent. The value "i" represents is an integer and not a string. Can anyone help me out? Cheers, Chavanak

    Read the article

  • Start Python from Twisted

    - by SpawnCxy
    Hi all, I have learnt Python for about a month as a one year's PHPer.And I started from Twisted as I'm working in a corporation supplying webservice.I have finished some simple application such as data transferring service,page images-fetch service etc.But the problem is ,I don't understand the struture of codes I wrote in the programs quite well .Every time I have to write codes by watching an example.And my question is ,should I just try to remember the example code's strutures?Or try to understand them?Suggestions would be very appreciated. Regards

    Read the article

  • python on usb stick

    - by oren
    is there any option free and opensource to run python from usb stick on windows system (i,e pyhon installed on usb stick ) and can run on every windows sytsem just by pluging the usb stick ?

    Read the article

< Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >