Search Results

Search found 14486 results on 580 pages for 'python idle'.

Page 93/580 | < Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >

  • creation of folders in python

    - by beena shamsudeen
    i want to create folders with the name of a pdf file for eg,abc.if it does not exists,i should create a folder with name abc_1...if abc_1 exists,i shud create abc_2.if both exxists,abc_3 and so on...the scripting is in python..can u help me??

    Read the article

  • Change array that might contain None to an array that contains "" in python

    - by vy32
    I have a python function that gets an array called row. Typically row contains things like: ["Hello","goodbye","green"] And I print it with: print "\t".join(row) Unfortunately, sometimes it contains: ["Hello",None,"green"] Which generates this error: TypeError: sequence item 2: expected string or Unicode, NoneType found Is there an easy way to replace any None elements with ""?

    Read the article

  • Accessing relative path in Python

    - by Aaron Hoffman
    Hi, I'm running a Mac OS X environment and am used to using ~/ to provide the access to the current user's directory. For example, in my python script I'm just trying to use os.chdir("/Users/aaron/Desktop/testdir/") But would like to use os.chdir("~/Desktop/testdir/") I'm getting a no such file or directory error when trying to run this. Any ideas?

    Read the article

  • Python pattern search in a string

    - by Hulk
    In python if a string contains the following, print valid_str The output of this is Record is positive in tone: It emphasizes "what a child can do and his or her achievements, as opposed to what he or she cannot do," explains the It is useful for progress and achievements during office conferences How to search for the pattern It is useful in the above string and if not found return something. Thanks..

    Read the article

  • python set difference

    - by user1311992
    I'm doing a set difference operation in Python: from sets import Set from mongokit import ObjectId x = [ObjectId("4f7aba8a43f1e51544000006"), ObjectId("4f7abaa043f1e51544000007"), ObjectId("4f7ac02543f1e51a44000001")] y = [ObjectId("4f7acde943f1e51fb6000003")] print list(Set(x).difference(Set(y))) I'm getting: [ObjectId('4f7abaa043f1e51544000007'), ObjectId('4f7ac02543f1e51a44000001'), ObjectId('4f7aba8a43f1e51544000006')] I need to get the first element for next operation which is important. How can I retain the list x in original format?

    Read the article

  • Running a batch file with parameters in python OR F#

    - by Ramy
    I searched the site but didn't see anything quite matching what I was looking for. I created a stand alone application that uses a web service I created. To run the client I use: c:/scriptsdirecotry "run-client.bat" param1 param2 param3 param4 how would I go about coding this in python or F#. seems like it should be pretty simple but I haven't seen anything online that quite matches what i'm looking for. Thanks in advance.

    Read the article

  • Python - Launch a Long Running Process from a Web App

    - by Greg
    I have a python web application that needs to launch a long running process. The catch is I don't want it to wait around for the process to finish. Just launch and finish. I'm running on windows XP, and the web app is running under IIS (if that matters). So far I tried popen but that didn't seem to work.

    Read the article

  • Python: Pass parameter one time, but use more times

    - by Gabriel L. Oliveira
    I'm trying to do this: commands = { 'py': 'python %s', 'md': 'markdown "%s" "%s.html"; gnome-open "%s.html"', } commands['md'] % 'file.md' But like you see, the commmands['md'] uses the parameter 3 times, but the commands['py'] just use once. How can I repeat the parameter without changing the last line (so, just passing the parameter one time?)

    Read the article

  • 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

  • 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

  • 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

  • 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

  • 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

< Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >