Search Results

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

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

  • Running Subprocess from Python

    - by Rohit
    I want to run a cmd exe using a python script. I have the following code: def run_command(command): p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) return p.communicate() then i use: run_command(r"C:\Users\user\Desktop\application\uploader.exe") this returns the option menu where i need to specify additional parameter for the cmd exe to run. So i pass additional parameters for the cmd exe to run. How do i accomplish this. I've looked at subprocess.communicate but i was unable to understand it

    Read the article

  • How to condense a path in C++ using Boost?

    - by pdillon3
    Does Boost offer a simple way to condense a path such as /foo/bar/../bar or /foo/../. into the absolute path it refers to. /foo/bar/../bar -- /foo/bar /foo/../. -- / The goal is to combine base_path and rel_path with boost::filesystem::complete(rel_path, base_path) into a path into /foo/bar/with/no/dots. thanks

    Read the article

  • Python shortcuts

    - by lyrae
    Python is filled with little neat shortcuts. For example: self.data = map(lambda x: list(x), data) and (although not so pretty) tuple(t[0] for t in self.result if t[0] != 'mysql' and t[0] != 'information_schema') among countless others. In the irc channel, they said "too many to know them all". I think we should list some here, as i love using these shortcuts to shorten & refctor my code. I'm sure this would benefit many.

    Read the article

  • Constructing an if statement from the client data in python

    - by Vishal
    Hi, I need to construct an if statement from the data coming from the client as below: conditions: condition1, condition2, condition3, condition4 logical operators: lo1, lo2, lo3 (Possible values: "and" "or") Eg. if condition1 lo1 condition2 lo3 condition4: # Do something I can think of eval/exec but not sure how safe they are! Any better approach or alternative? Appreciate your responses :) PS: Client-side: Flex, Server-side: Python, over internet Thanks

    Read the article

  • Python inter-computer communication.

    - by matt1024
    This whole topic is way out of my depth, so forgive my imprecise question, but I have two computers both connected to one LAN. What I want is to be able to communicate one string between the two, by running a python script on the first (the host) where the string will originate, and a second on the client computer to retrieve the string. What is the most efficient way for an inexperienced programmer like me to achieve this?

    Read the article

  • Python process will not exit

    - by oneself
    Hi, I'm use nosetests to run some tests. However, after the tests have finished running, the nosetests process just sits there, and will not exit. Is there anyway to diagnose this? Does Python have a facility similar to sending Java a kill -QUIT which will print a stack trace?

    Read the article

  • Python : Crating Dynemic Functions

    - by jigar
    I have issue where i want to create Dynamic function which will do some calculation based to values retrieved from database, i am clear with my internal calculation but question in how to create dynamic class: My Structure is something like this : class xyz: def Project(): start = 2011-01-03 def Phase1(): effort = '2d' def Phase2(): effort = '3d' def Phase3(): effort = '4d' Now want to generate those all PhaseX() function dynamically so can any one suggest me how to achieve such thing using Python Code Waiting for Positive reply Regards Thank You

    Read the article

  • String literals in python

    - by kjakeb
    Hello, Is there a way to declare a string variable in python such that everything inside of it is automatically escaped, or has its literal character value? I'm NOT asking how to escape the quotes with slashes, that's obvious. What I'm asking for is a general purpose way for making EVERYTHING in a string literal so that I don't have to manually go through and escape everything for very large strings. Anyone know of a solution? Thanks!

    Read the article

  • Converting a string into a list in Python

    - by Sam
    I have a text document that contains a list of numbers and I want to convert it to a list. Right now I can only get the entire list in the 0th entry of the list, but I want each number to be an element of a list. Does anyone know of an easy way to do this in Python? 1000 2000 3000 4000 to ['1000','2000','3000','4000']

    Read the article

  • How does Python store lists internally?

    - by Mike Cooper
    How are lists in python stored internally? Is it an array? A linked list? Something else? Or does the interpreter guess at the right structure for each instance based on length, etc. If the question is implementation dependent, what about the classic CPython?

    Read the article

  • viewing files in python?

    - by Galilsnap
    I am creating a sort of "Command line" in Python. I already added a few functions, such as changing login/password, executing, etc., But is it possible to browse files in the directory that the main file is in with a command/module, or will I have to make the module myself and use the import command? Same thing with changing directories to view, too.

    Read the article

  • Why does this python code work?

    - by Int-0
    I have written a simple python module, it has this code: _log = logging.getLogger("mymodule") _started = False def set_log_level(level): _log.setLevel(level) if not _started: _hdlr = logging.FileHandler('mymodule.log') When I call set_log_level() program fails because symbol _started is not found. It is normal because global _started is missing in the method. But my question is: symbol _log has the same visibility as _started, so why does this symbol can be found? BR, // Toby

    Read the article

  • python tracing a segmentation fault

    - by pygabriel
    Hi, I'm developing C extensions from python ad I obtain some segfaults (inevitable during the development...). I'm searching a way to display at which line of code the segfault happens (an idea is like tracing every single line of code), how I can do that?

    Read the article

  • Pure python implementation of greenlet API

    - by Tristan
    The greenlet package is used by gevent and eventlet for asynchronous IO. It is written as a C-extension and therefore doesn't work with Jython or IronPython. If performance is of no concern, what is the easiest approach to implementing the greenlet API in pure Python. A simple example: def test1(): print 12 gr2.switch() print 34 def test2(): print 56 gr1.switch() print 78 gr1 = greenlet(test1) gr2 = greenlet(test2) gr1.switch() Should print 12, 56, 34 (and not 78).

    Read the article

  • Clarification needed about Python CSV file format parsing

    - by HH
    Format is like: CHINA;2002-06-25 00:00:00.000;5,60 CHINA;2002-06-26 00:00:00.000;5,32 CHINA;2002-06-27 00:00:00.000;5,31 and I try to use Python's CSV tools to parse it but cannot understand the paragraph, source: And while the module doesn’t directly support parsing strings, it can easily be done: import csv for row in csv.reader(['one,two,three']): print row Could someone clarify the line ['one,two,three']? How would you use it with format A;B;C?

    Read the article

  • python how to find the median of a list

    - by user3450574
    I'm trying to write a function named median that takes a list as an input and returns the median value of the list. I'm working with Python 2.7.2 The list can be of any size and the numbers are not guaranteed to be in any particular order. If the list contains an even number of elements, the function should return the average of the middle two. This is the code I'm starting with: def median(list): print(median([7,12,3,1,6,9]))

    Read the article

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