Search Results

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

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

  • 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

  • Which logging library to use for cross-language (Java, C++, Python) system

    - by recipriversexclusion
    I have a system where a central Java controller launches analysis processes, which may be written in C++, Java, or Python (mostly they are C++). All these processes currently run on the same server. What are you suggestions to Create a central log to which all processes can write to What if in the future I push some processes to another server. How can I support distributed logging? Thanks!

    Read the article

  • Parsing timestamp with retarded Python

    - by jellybean
    I want to parse a timestamp from a log file that has been written via datetime.datetime.now().strftime('%Y%m%d%H%M%S') and then compute the number of seconds that have passed since this timestamp. I know I could do it with datetime.datetime.strptime to get back a datetime object and then compute a timedelta. Problem is, the strptime function has been introduced with Python 2.5 and I'm using Python2.4.4 (an upgrade is not possible in my context). Any easy way to do this?

    Read the article

  • How to create temporary files in memory visible for other process, using python

    - by LazyMiha
    Hello! I`m trying to write simple batch file generator in python. Batch file consist of about 30-50 lines of text and is passed to other applications. During the execution of script there a lot of calls to external applications. I want to create file in memory (like named pipes in win32). Is there any platform independ way? p.s. sorry for possible mistakes in text, I'm still learning English

    Read the article

  • Are classes in Python in different files?

    - by Asaf
    Much like Java (or php), I'm use to seperating the classes to files. Is it the same deal in Python? plus, how should I name the file? Lowercase like classname.py or the same like ClassName.py? Do I need to do something special if I want to create an object from this class or does the fact that it's in the same "project" (netbeans) makes it ok to create an object from it?

    Read the article

  • converting python list of strings to their type

    - by user248237
    given a list of python strings, how can I automatically convert them to their correct type? Meaning, if I have: ["hello", "3", "3.64", "-1"] I'd like this to be converted to the list ["hello", 3, 3.64, -1] where the first element is a stirng, the second an int, the third a float and the fourth an int. how can I do this? thanks.

    Read the article

  • Python: Streaming Input with Subprocesses

    - by beary605
    Since input and raw_input() stop the program from running anymore, I want to use a subprocess to run this program... while True: print raw_input() and get its output. This is what I have as my reading program: import subprocess process = subprocess.Popen('python subinput.py', stdout=subprocess.PIPE, stderr=subprocess.PIPE) while True: output=process.stdout.read(12) if output=='' and process.poll()!=None: break if output!='': sys.stdout.write(output) sys.stdout.flush() When I run this, the subprocess exits almost as fast as it started. How can I fix this?

    Read the article

  • change file descriptor for socket in python

    - by Dani
    Hello everybody I'm trying to manually create the file descriptor associated with a socket in python and then loaded directly into memory with mmap. Create a file into memory with mmap is simple, but I can not find a way to associate the file with a socket. Anyone know how? thank you very much.

    Read the article

  • Bi-partitle matching in Python

    - by vailen
    Does anybody know any module in Python that computes the best bi-partite 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 be able to deal with this. Any advise?

    Read the article

  • Python - Timezones

    - by Adam
    Hey Is it possible with python to set the timezone just like this in php: date_default_timezone_set("Europe/London"); $Year = date('y'); $Month = date('m'); $Day = date('d'); $Hour = date('H'); $Minute = date('i'); I can't really install any other modules etc as I'm using shared web hosting. Any ideas?

    Read the article

  • Python style: if statements vs. boolean evaluation

    - by mkscrg
    One of the ideas of Python's design philosophy is "There should be one ... obvious way to do it." (PEP 20), but that can't always be true. I'm specifically referring to (simple) if statements versus boolean evaluation. Consider the following: if words: self.words = words else: self.words = {} versus self.words = words or {} With such a simple situation, which is preferable, stylistically speaking? With more complicated situations one would choose the if statement for readability, right?

    Read the article

  • Python - How is this snippet working?

    - by orokusaki
    For some reason this function confused me: def protocol(port): return port == "443" and "https://" or "http://" Can somebody explain the order of what's happening behind the scenes to make this work the way it does. I understood it as this until I tried it: Either A) def protocol(port): if port == "443": if bool("https://"): return True elif bool("http://"): return True return False Or B) def protocol(port): if port == "443": return True + "https://" else: return True + "http://" Is this some sort of special case in Python, or am I completely misunderstanding how statements work?

    Read the article

  • python objects confusion

    - by james
    wow i thought i knew python untill tonight.. what is the correct way to do something like this.. heres my code a = ["one", "two", "three"] b = a #here i want a complete copy that when b is changed, has absolutely no effect on a b.append["four"] print a #a now has "four" in it.. so basically i want to know, instead of the b = a step, how would i correctly make a copy of a list or dictionary so that when b is changed a does not change along with it.. thanks guys

    Read the article

  • python truncate a long string

    - by Hulk
    How to truncate sthe string to 75 characters only in python This is how it was done in javascript var data="saddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddsaddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddsadddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" var info = (data.length > 75) ? data.substring[0,75] + '..' : data;

    Read the article

  • What are my alternatives to manage Python packages for clients?

    - by c00kiemonster
    So the setup is a slew of proprietary server/client Python applications running on one Linux box (the server) and a set of Windows 7 workstations (the clients). Everything is running smoothly until any of the proprietary Python packages needs updating. For now I am using distutils eggs which are very easily updated with easy_install, but it is still a manual process which quickly becomes tedious as the number of applications and client workstations grow. The ideal setup IMHO is to have the Python packages on the server so when a client application is launched on a workstation the client application can check to see whether its current Python packages are up-to-date. If not, the client application should download the newer Python package from the server, install it, and then launch as per normal. Does this sounds familiar to anyone? I have tried to find alternatives myself, but as far as I can see there is no Python module offering this functionality. Does anyone have any home made solutions for this?

    Read the article

  • python interpreter waits for child process to die

    - by Moulik Kallupalam
    Contents of check.py: from multiprocessing import Process import time import sys def slp(): time.sleep(30) f=open("yeah.txt","w") f.close() if __name__=="__main__" : x=Process(target=slp) x.start() sys.exit() In windows 7, from cmd, if I call python check.py, it doesn't immediately exit, but instead waits for 30 seconds. And if I kill cmd, the child dies too- no "yeah.txt" is created. How do I make ensure the child continues to run even if parent is killed and also that the parent doesn't wait for child process to end?

    Read the article

  • reading and extracting data from file using python

    - by parijat24
    hello , i am new to python , and I want to extract the data from this format FBpp0143497 5 151 5 157 PF00339.22 Arrestin_N Domain 1 135 149 83.4 1.1e-23 1 CL0135 FBpp0143497 183 323 183 324 PF02752.15 Arrestin_C Domain 1 137 138 58.5 6e-16 1 CL0135 FBpp0131987 60 280 51 280 PF00089.19 Trypsin Domain 14 219 219 127.7 3.7e-37 1 CL0124 to this format FBpp0143497 5 151 Arrestin_N 1.1e-23 FBpp0143497 183 323 Arrestin_C 6e-16

    Read the article

  • Python command line - add PYTHONPATH during module run

    - by orokusaki
    I want to run: python somescript.py somecommand But, when I run this I need PYTHONPATH to include a certain directory. I can't just add it to my environment variables because the directory I want to add changes based on what project I'm running. Is there a way to alter PYTHONPATH while running a script? Note: I don't even have a PYTHONPATH variable, so I don't need to worry about appending to it vs overriding it during running of this script.

    Read the article

  • Amazon API library for Python?

    - by Kevin
    What Python libraries do folks use for querying Amazon product data? (Amazon Associates Web Service - used to be called E-Commerce API, or something along those lines). Based on my research, PyAWS (http://pyaws.sourceforge.net/) seems okay, but still pretty raw (and hasn't been updated in a while). Wondering if there's an obvious canonical library that I'm just missing.

    Read the article

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