Search Results

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

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

  • Copy an entity in Google App Engine datastore in Python

    - by Gordon Worley
    In a Python Google App Engine app I'm writing, I have an entity stored in the datastore that I need to retrieve, make an exact copy of it (with the exception of the key), and then put this entity back in. How should I do this? In particular, are there any caveats or tricks I need to be aware of when doing this so that I get a copy of the sort I expect and not something else.

    Read the article

  • Problem with list slice syntax in python

    - by Dingle
    The extended indexing syntax is mentioned in python's doc. slice([start], stop[, step]) Slice objects are also generated when extended indexing syntax is used. For example: a[start:stop:step] or a[start:stop, i]. See itertools.islice() for an alternate version that returns an iterator. a[start:stop:step] works as described. But what about the second one? How is it used?

    Read the article

  • python: sending information between two scripts

    - by Peter
    I have two Python scripts in two different locations and cannot be moved. What is the best way to send information between the two scripts? say for example in script1.py i had a string e.g. x = 'teststring' then i need variable 'x' passed to script2.py, which saves the variable 'x' to a text file? Any ideas?

    Read the article

  • Start app from within python

    - by Aaron Hoffman
    Hello, I'm trying to start an application using Python. I've seen that some people use startfile but I also read that it only works with Windows. I'm using Mac systems and hoping for it to work with them. Thanks, Aaron

    Read the article

  • symbols in command line argument.. python, bash

    - by Idlecool
    Hi, I am writing a python script on Linux for twitter post using API, Is it possible to pass symbols like "(" ")" etc in clear text without apostrophes.... % ./twitterupdate this is me #works fine % ./twitterupdate this is bad :(( #this leaves a error on bash. Is the only alternative is to enclose the text into -- "" ?? like.. % ./twitterupdate "this is bad :((" #this will reduce the ease of use for the script Is there any workaround?

    Read the article

  • Determine precision and scale of particular number in Python

    - by jrdioko
    I have a variable in Python containing a floating point number (e.g. num = 24654.123), and I'd like to determine the number's precision and scale values (in the Oracle sense), so 123.45678 should give me (8,5), 12.76 should give me (4,2), etc. I was first thinking about using the string representation (via str or repr), but those fail for large numbers: >>> num = 1234567890.0987654321 >>> str(num) = 1234567890.1 >>> repr(num) = 1234567890.0987654

    Read the article

  • Proper indentation for Python multiline strings

    - by ensnare
    What is the proper indentation for Python multiline strings within a function? def method: string = """line one line two line three""" or def method: string = """line one line two line three""" or something else? It looks kind of weird to have the string hanging outside the function in the first example. Thanks.

    Read the article

  • Python tkInter text entry validation

    - by meade
    I'm trying to validate the entry of text using Python/tkInter def validate_text(): return False text = Entry(textframe, validate="focusout", validatecommand=validate_text) where validate_text is the function - I've tried always returning False and always returning True and there's no difference in the outcome..? Is there a set of arguments in the function that I need to include? Edit - changed from NONE to focusout...still not working

    Read the article

  • python command line yes/no input

    - by h3
    Is there any short way to achieve what APT does in Python ? I mean, when the package manager prompts a yes/no question followed by "[Yes/no]". The scripts accepts YES/Y/yes/y or "enter" (defaults to Yes as hinted by the capital) The only thing I find in the official doc is input/raw_input.. I know it's not that hard to emulate, but it's annoying to rewrite :|

    Read the article

  • Abstract attributes in Python

    - by deamon
    What is the shortest / most elegant way to implement the following Scala code with an abstract attribute in Python? abstract class Controller { val path: String } A subclass of Controller is enforced to define "path" by the Scala compiler. A subclass would look like this: class MyController extends Controller { override val path = "/home" }

    Read the article

  • What's the logical value of "string" in python?

    - by Kamran
    I erroneously wrote this code in python: name = input("what is your name?") if name == "Kamran" or "Samaneh": print("That is a nice name") else: print("You have a boring name ;)") It always prints out "That is a nice name" even when the input is neither "Kamran" nor "Samaneh". Am I correct in saying that it considers "Samaneh" as a true? why? By the way, I already noticed my mistake. The correct form is: if name == "Kamran" or name == "Samaneh":

    Read the article

  • Print one word from a string in python

    - by Shai
    Hi, How can i print only certain words from a string in python ? lets say i want to print only the 3rd word (which is a number) and the 10th one while the text length may be different each time mystring = "You have 15 new messages and the size is 32000" thanks.

    Read the article

  • python django automated data addition

    - by zubin71
    I have a script which reads data from a csv file. I need to store the data into a database which has already been created as $ python manage.py syncdb so, that automated data entry is possible in an easier manner, as available in the django shell.

    Read the article

  • python - remove string from words in an array

    - by tekknolagi
    #!/usr/bin/python #this looks for words in dictionary that begin with 'in' and the suffix is a real word wordlist = [line.strip() for line in open('/usr/share/dict/words')] newlist = [] for word in wordlist: if word.startswith("in"): newlist.append(word) for word in newlist: word = word.split('in') print newlist how would I get the program to remove the string "in" from all the words that it starts with? right now it does not work

    Read the article

  • Splitting a list in python

    - by blob8108
    Hi, I'm writing a parser in Python. I've converted an input string into a list of tokens, such as: ['(', '2', '.', 'x', '.', '(', '3', '-', '1', ')', '+', '4', ')', '/', '3', '.', 'x', '^', '2'] I want to be able to split the list into multiple lists, like the str.split('+') function. But there doesn't seem to be a way to do my_list.split('+'). Any ideas? Thanks!

    Read the article

  • installing opencv for python issues

    - by vlad
    I'm running OS X Leopard. I followed this site to install it. Trying to run any demo script, I now get "No module named opencv.cv", which is obviously stopping me from doing any programming. I am running python 2.5.1 (yes, I know it's kind of old). Why would this be, and how can I solve it? Thanks

    Read the article

  • Customized command line parsing in Python

    - by Moshe
    I'm writing a shell for a project of mine, which by design parses commands that looks like this: COMMAND_NAME ARG1="Long Value" ARG2=123 [email protected] My problem is that Python's command line parsing libraries (getopt and optparse) forces me to use '-' or '--' in front of the arguments. This behavior doesn't match my requirements. Any ideas how can this be solved? Any existing library for this?

    Read the article

  • why is there {Raw,Safe,}Configparser in Python 3

    - by Tshepang
    Am surprised there's 3 different forms: RawConfigParser, SafeConfigParser and ConfigParser. I read the differences but why isn't everyone using SafeConfigParser, since it seems, well, safe? I can understand that in the case for Python 2 that the other two were kept for backward compatibility.

    Read the article

  • Run python in a separate process

    - by Bialecki
    I'm looking for a quick bash script or program that will allow me to kick off a python script in a separate process. What's the best way to do this? I know this is incredibly simple, just curious if there's a preferred way to do it.

    Read the article

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