Search Results

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

Page 41/580 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • CURL alternative in Python

    - by Gaurav
    I have a cURL call that I use in PHP: curl -i -H 'Accept: application/xml' -u login:key "https://app.streamsend.com/emails" I need a way to do the same thing in Python. Is there an alternative to cURL in Python. I know of urllib but I'm a Python noob and have no idea how to use it.

    Read the article

  • python: where to put application data that can be edited by computer users

    - by Jason S
    I'm working on a really simple python package for our internal use, and want to package it as a .egg file, and when it's installed/used I want it to access a text file that is placed in an appropriate place on the computer. So where is the best place to put application data in python? (that is meant to be edited by users) How do I get my python package to automatically install a default file there?

    Read the article

  • Java/Python: Integration, problem with looping updating text

    - by Jivings
    Hello! Basically I have a script in Python that grabs the text from an open window using getWindowText() and outputs it to the screen. The python loops so as the text in the window changes, it outputs the changes, so the output of the python will always be up to date with the window text. I'm trying to access this text in my Java program by executing the python script as a process and reading the text it outputs using a buffered reader. For some reason this works fine for the first block of text, but will not read any more after this, it wont read any updates to the text as the python outputs it. Can someone shed some light on this? I'm about to try and use Jython, but I'd really like to know what the problem is here... try { Runtime r = Runtime.getRuntime(); Process p = r.exec("cmd /c getText.py"); BufferedReader br = new BufferedReader( new InputStreamReader(p.getInputStream())); int line; while (true) { line = br.read(); System.out.print((char) line); } } catch (Exception e) { e.printStackTrace(); }

    Read the article

  • Controlling rsync with Python?

    - by Cheesemold
    I've been wanting to write a python script that would run several instances of rsync in sequence for backing up data to a different computer. At the moment I just have this text file with the commands I use and I've just been copy-pasting them into the terminal, and it seems kinda silly. I want to be able to use python to do this for me. I know very vaguely how to use subprocess.popen, but I have no clue how to get python to interact with rsync directly, like for entering my password for me. Can python do that? Something like: if theProccess.proccessResponse == "Password:" : theProccess.respond(string) Or is the best that I can do is just have it, or even a bash script, just run the rsyncs in sequence and have to type my password in over and over again? Thanks in advance.

    Read the article

  • Save the output of a command in a string in linux using python

    - by user1657901
    I am using Fedora 17 xfce and I am programming in Python 2.7.3. Fedora uses a package manager called yum. I have a python script that searches for packages like this: import os package = raw_input("Enter package name to search: ") os.system("yum list " + package) So I want python to check if in the output of this command exists the words "No matching packages to list". I checked a similar question and I tried some methods [http://stackoverflow.com/questions/2502833/python-store-output-of-subprocess-call-in-a-string][1] but the string contained only the first line of the output. Thanks in advance

    Read the article

  • syntax difference between ruby and python?

    - by fayer
    i wonder if there are tutorials that go through the syntax differences for ruby and python? i have seen a comparison between ruby and php but not between ruby and python. i have looked at both ruby and python but it would be very useful with this side-by-side comparison for deciding which one to choose. thanks

    Read the article

  • Making swedish characthers show properly in Windows Command Prompt using Python in Notepad++

    - by Alex
    The title explains it well. I have set up Notepad++ to open the python script in the command prompt when I press F8 but all Swedish characters looks messed up when opening in CMD but perfectly fine in e.g IDLE. This simple example code: #!/usr/bin/env python #-*- coding: UTF-8 -*- print "åäö" Looks like this. As you can see the output of the bath file I use to open Python in cmd below shows the characthers correctly but not the python script above it. How do i fic this?

    Read the article

  • Micropython or minimal python installation

    - by reshefm
    I once read about minimal python installation without a lot of the libraries that come with the python default installation but could not find it on the web... What I want to do is to just pack a script with the python stuff required to execute it and make portable. Does any one know about something like that? Thanks

    Read the article

  • How to install Python newt or snack in Mac OS X for byobu

    - by caleban
    I've installed byobu in Mac OS X 10.6.5. It will start, (i.e. it will start a screen session) but in order to run byobu-config and probably in order to do some other things I need a module called snack which apparently is part of python newt. pip search newt and pip search snack return no results. newt and snack aren't in MacPorts or Brew either. I haven't found anything online in my searching with respect to installing newt on Mac OS X. Has anyone else been able to install byobu and newt in Mac OS X?

    Read the article

  • How can i remove some installed python modules in centos

    - by user1513613
    I am getting ths error Python 2.7.5 (default, Jul 2 2013, 13:33:13) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import MySQLdb Traceback (most recent call last): File "<stdin>", line 1, in <module> File "MySQLdb/__init__.py", line 23, in <module> (version_info, _mysql.version_info)) ImportError: this is MySQLdb version (1, 2, 4, 'final', 1), but _mysql is version (1, 2, 3, 'final', 0) >>> Now i dont know how i have installed that. i treid so many things like yum , pip easy, install etc. how can i remove all versions of MysqlDB FROM THERE

    Read the article

  • Python installation in OSX not updating

    - by ElendilTheTall
    I've recently got into Python programming and so downloaded the latest version (3.2.3) to install on my Mac running Snow Leopard. I used the installer package. I have run the shell profile update script, but Terminal is still using 2.6.1 to run my programs. I have tried changing the paths with sudo nano as per this post but it makes no difference - it still uses 2.6.1 Any ideas, oh mighty Super Users? I am a complete noob when it comes to Terminal commands.

    Read the article

  • How to Install Python 2.6 on Fedora 8?

    - by Apreche
    I don't want to use Fedora 8. I would be very happy to use the newest version, but there is no choice. My problem is that 8 comes with python 2.5. I am trying to upgrade it to 2.6, but with no luck. The only caveat is that I don't want to just install directly from source. I want to do it through the package manager using an rpm. I have tried building my own rpm from source using rpmbuild. I have tried using src rpms from newer versions of Fedora. I've tried these CentOS instructions. Nothing seems to actually result in an rpm file that installs successfully. I have also tried extensive Google searching, and have been unsurprisingly unable to find any rpms that work, or working instructions to build my own rpm.

    Read the article

  • Redirect output of Python program to /dev/null

    - by STM
    I have a Python executable, written and compiled by somebody else, that I simply need to run once halfway down my own bash script. The program uses a text-based UI, therefore waits for input before proceeding, but the key operations it performs when starting are required in my bash script. A messy (and strange) procedure I know, but unfortunately I haven't got any other options. I've gotten around forcefully closing the program with a kill signal, but the program's TUI insists on outputting to wherever it's run. I've tried redirecting both stdout and stderr to /dev/null and running the program in the background by suffixing an ampersand, but simply can't get it to play ball. I believe the cause is the program spawns other processes, and the output redirection of the parent process doesn't affect them. Is there any trick I can utilise to redirect all output from child processes too?

    Read the article

  • Difference between sending data via UDP in Bash and with a Python script

    - by Kevin Burke
    I'm on a Centos box, trying to send a UDP packet to port 8125 on localhost. When I run this Python script: import socket sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.sendto('blah', ("127.0.0.1", 8125)) The data appears where it should on port 8125. However when I send the data like this: echo "blah" | nc -4u -w1 127.0.0.1 8125 Or like this: echo "blah" > /dev/udp/127.0.0.1/8125 The data does not appear in the backend. I know this is horribly vague but it's UDP and it's hard to determine why one packet is being sent and the other is not. Do you have any ideas about how to debug this issue further? I'm on a Centos machine.

    Read the article

  • Run shell command with variable in filename via Python

    - by rajitha
    I have files with naming convention st009_out.abc1.dat st009_out.abc2.dat st009_out.abc3.dat .................. .................. I am writing Python code where I want to use data from the file to perform a math function and need to extract the second column from the file. I have tried it this way: for k in range(1,10): file1=open('st009_out.abc'+str(k)+'.dat','r') ........... os.system("awk '{print $2}' st009_out.abc${k}.pmf > raj.dat") but this is not working as it is not taking the value of k in the shell command. How do I progress?

    Read the article

  • Python - How to remove/unimport libs was imported before

    - by Marslo
    As we know that, in python 2.x, integer would be got if we divide two integer values. However, if using the furture (it's might be a lib or something like that), just like from __future__ import division, we can get float value. E.g.: >>> 3/2 1 >>> from __future__ import division >>> 3/2 1.5 >>> >>> >>> 3//2 1 >>> 4/3 1.3333333333333333 >>> So, '//' instead of '/' should be used if getting integer after imported division, but I want to know how to using '/' to get integer again. That is mean, whether there is some way to un-import or remove the libs which was imported before.

    Read the article

  • How to delete a folder in python when [Error 32] is present

    - by harish
    I am using python 2.7. I want to delete a folder which may or may not be empty. The folder is handled by thread for file-monitoring. I am not able to kill thread but wanted to delete this folder any how. I tried with os.rmdir(Location) shutil.rmtree(Location) os.unlink(Location) But, it didn't work. It is showing error as [Error 32] The process cannot access the file because it is being used by another process: 'c:\\users\\cipher~1\\appdata\\local\\temp\\fis\\a0c433973524de528420bbd56f8ede609e6ea700' I want to delete folder a0c433973524de528420bbd56f8ede609e6ea700 or delete whole path will also suffice.

    Read the article

  • Hi, I want to write a python script to do some things in excel [closed]

    - by MEOWER
    I want to write a python script that will open up this one excel file, "refresh" on the Bloomberg tab (with the Bloomberg add-in), and export all the individual sheets as csv? How can I do this? What are the basic things I should know and is there any reference script that I can use? I'm using Excel 2010 with the bloomberg plugin. Not sure if this is the correct forum to use but pls move this to another forum if it's more appropriate there. Thanks.

    Read the article

  • Does it make sense to develop open source python library for database inspection?

    - by gruszczy
    Some time ago I came up with an idea for a library for database inspection. I started developing it and got some very basic functionality, just to check if that's possible. Recently however, I get second thoughts, whether such project would really be useful. I am actually planning to develop following software suite: library for python, that would provide easy interface to inspect database structure, desktop application in PyQt that would use the interface to provide graphical database inspection, web application in Django that would use the interface to provide database inspection through the browser. Do you think such suite would be useful for other developers/database administrators/analysts? I know, that there is pgadmin for PostgreSQL and some tool for sqlite3 and that there is Java tool called DBInspect. Usually I would be against creating new tool and rather join existing project, but I am not Java programmer (and I would rather stick to python or C, which I like) and none of these projects provide a library for database inspection. Anyway I would like to hear some opinions from fellow developers, whether such project make sense or I should try to spend my free time on developing something else.

    Read the article

  • Does this syntax for specifying Django conditional form display align with python/django convention?

    - by andy
    I asked a similar question on Stackoverflow and was told it was better asked here. So I'll ask it slightly rephrased. I am working on a Django project, part of which will become a distributable plugin that allows the python/django developer to specify conditional form field display logic in the form class or model class. I am trying to decide how the developer must specify that logic. Here's an example: class MyModel(models.Model): #these are some django model fields which will be used in a form yes_or_no = models.SomeField...choices are yes or no... why = models.SomeField...text, but only relevant if yes_or_no == yes... elaborate_even_more = models.SomeField...more text, just here so we can have multiple conditions #here i am inventing some syntax...i am looking for suggestions!! #this is one possibility why.show_if = ('yes_or_no','==','yes') elaborate_even_more.show_if = (('yes_or_no','==','yes'),('why','is not','None')) #help me choose a syntax that is *easy*...and Pythonic and...Djangonic...and that makes your fingers happy to type! #another alternative... conditions = {'why': ('yes_or_no','==','yes'), 'elaborate_even_more': (('yes_or_no','==','yes'),('why','is not','None')) } #or another alternative... """Showe the field whiche hath the name *why* only under that circumstance in whiche the field whiche hath the name *yes_or_no* hath the value *yes*, in strictest equality.""" etc... Those conditions will be eventually passed via django templates to some javascript that will show or hide form fields accordingly. Which of those options (or please propose a better option) aligns better with conventions such that it will be easiest for the python/django developer to use? Also are there other considerations that should impact what syntax I choose?

    Read the article

  • Is ZeroMQ a good choice to make a Python app and a C# managed assembly work together?

    - by Alex Bausk
    I have a task that involves talking to a .NET-based API (namely AutoCAD) to retrieve data, send commands, and react to events. I want to separate the API operations and the proper program logic (largely already implemented in Python) by using natural tools for both: a C# DLL for the former and a Python app for the latter. To connect these two pieces, I began exchanging JSON in ZeroMQ messages. I'm at early development stages but having recently discovered that ZeroMQ does not guarantee message delivery/order, I have reservations about whether this is a feasible way to go. Right now my app is a very basic REQ/REP pair and I plan to handle reacting to events and executing different commands by adding some sort of 'recipient-function' field to my message format. The reason that I want to use ZMQ is that I might be able to scale the software into a larger, multi-user, distributed solution sometime. I am a lay programmer so I would ask for your advice about this architecture. Should I just go ahead with it and plan to deal with message reliability/ordering when problems appear? Should I consider developing some kind of a REST wrapper around ZMQ?

    Read the article

  • Is it conceivable to have millions of lists of data in memory in Python?

    - by Codemonkey
    I have over the last 30 days been developing a Python application that utilizes a MySQL database of information (specifically about Norwegian addresses) to perform address validation and correction. The database contains approximately 2.1 million rows (43 columns) of data and occupies 640MB of disk space. I'm thinking about speed optimizations, and I've got to assume that when validating 10,000+ addresses, each validation running up to 20 queries to the database, networking is a speed bottleneck. I haven't done any measuring or timing yet, and I'm sure there are simpler ways of speed optimizing the application at the moment, but I just want to get the experts' opinions on how realistic it is to load this amount of data into a row-of-rows structure in Python. Also, would it even be any faster? Surely MySQL is optimized for looking up records among vast amounts of data, so how much help would it even be to remove the networking step? Can you imagine any other viable methods of removing the networking step? The location of the MySQL server will vary, as the application might well be run from a laptop at home or at the office, where the server would be local.

    Read the article

  • Language Design: Are languages like Python and CoffeeScript really more comprehensible?

    - by kittensatplay
    The "Verbally Readable !== Quicker Comprehension" argument on http://ryanflorence.com/2011/case-against-coffeescript/ is really potent and interesting. I and I'm sure others would be very interested in evidence arguing against this. There's clear evidence for this and I believe it. People naturally think in images, not words, so we should be designing languages that aren't similar to human language like English, French, whatever. Being "readable" is quicker comprehension. Most articles on Wikipedia are not readable as they are long, boring, dry, sluggish and very very wordy. Because Wikipedia documents a ton of info, it is not especially helpful when compared to sites with more practical, useful and relevant info. Languages like Python and CoffeScript are "verbally readable" in that they are closer to English syntax. Having programmed firstly and mainly in Python, I'm not so sure this is really a good thing. The second interesting argument is that CoffeeScript is an intermediator, a step between two ends, which may increase the chance of bugs. While CoffeeScript has other practical benefits, this question specifically requests evidence showing support for the counter-case of language "readability"

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >