Re: can python do this?

Discussion in 'Python' started by Rounak, Dec 2, 2009.

  1. Rounak

    Rounak Guest


    > Python can do anything Applescript can do with the appscript module -
    > see <http://appscript.sourceforge.net/py-appscript/index.html>. And,
    > naturally, very much more.


    wait, sorry, i forgot to mention. I am now on Linux. I want to know what python can do in Linux. On Mac, I am glad to use applescript.
    Rounak, Dec 2, 2009
    #1
    1. Advertising

  2. Rounak wrote:

    >
    >> Python can do anything Applescript can do with the appscript module -
    >> see <http://appscript.sourceforge.net/py-appscript/index.html>. And,
    >> naturally, very much more.

    >
    > wait, sorry, i forgot to mention. I am now on Linux. I want to know what
    > python can do in Linux. On Mac, I am glad to use applescript.


    This question is not so easy to answer. Because such functionality heavily
    depends on your actual desktop environment - KDE, Gnome, or something
    entirely different.

    However, I'd say that using python you have a good chance of exploiting the
    services that are actually available to you.

    For example, taking a screenshot:


    http://stackoverflow.com/questions/69645/take-a-screenshot-via-a-python-script-linux


    Uploading that to dropbox is simple python urllib stuff.

    And there seem to be ways to insert things into the clipboard as well:

    http://arminstraub.com/bits-and-bytes/kde-clipboard-on-the-command-line

    Diez
    Diez B. Roggisch, Dec 2, 2009
    #2
    1. Advertising

  3. On 2009-12-02, Rounak <> wrote:
    >
    >> Python can do anything Applescript can do with the appscript module -
    >> see <http://appscript.sourceforge.net/py-appscript/index.html>. And,
    >> naturally, very much more.

    >
    > wait, sorry, i forgot to mention. I am now on Linux. I want to
    > know what python can do in Linux.


    Python can do pretty much anything except kernel modules.

    --
    Grant Edwards grante Yow! I want you to MEMORIZE
    at the collected poems of
    visi.com EDNA ST VINCENT MILLAY
    ... BACKWARDS!!
    Grant Edwards, Dec 2, 2009
    #3
  4. Rounak

    Rounak Guest

    Rounak, Dec 2, 2009
    #4
  5. Diez B. Roggisch, Dec 2, 2009
    #5
  6. Rounak a écrit :
    >>
    >> http://stackoverflow.com/questions/69645/take-a-screenshot-via-a-python-script-linux
    >>

    > the first solution in this thread requires python imaging library which
    > I did find here: http://www.pythonware.com/products/pil/faq.htm
    > But i would like to know if there are easier ways to install this
    > instead of compiling it from the source.
    >


    Depends on your linux distro - but PIL is a fairly stable and widely
    used lib, so I fail to imagine any modern distro not having a packaged
    PIL install (rpm, ebuild, whatever).
    Bruno Desthuilliers, Dec 2, 2009
    #6
  7. Rounak

    Rounak Guest

    Thanks Allan, I did find PIL in Synaptic Package Manager and installed
    it successfully. However, I cannot use it. The reason is:
    1. I had installed python3 using sudo apt-get install python3 but python
    2 still remains. And it seems Scite (my python editor) is looking for
    python 2.

    Terminal Output:
    $ python -V
    Python 2.6.4
    $ python3 -V
    Python 3.1.1+

    Output from Scite:
    >python -u "sshot.py"

    Traceback (most recent call last):
    File "sshot.py", line 1, in <module>
    import ImageGrab
    File "/usr/lib/python2.6/dist-packages/PIL/ImageGrab.py", line 34, in
    <module>
    import _grabscreen
    ImportError: No module named _grabscreen
    >Exit code: 1


    How to make Scite use python3 where it will hopefully find the just
    installed PIL.
    Rounak, Dec 2, 2009
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dr. Who
    Replies:
    5
    Views:
    1,598
  2. The Eternal Squire

    can a cut-down Python still be Python?

    The Eternal Squire, Oct 17, 2005, in forum: Python
    Replies:
    5
    Views:
    276
    The Eternal Squire
    Oct 17, 2005
  3. Casey Hawthorne
    Replies:
    1
    Views:
    713
    Arne Vajhøj
    Mar 18, 2009
  4. Bill Felton
    Replies:
    0
    Views:
    213
    Bill Felton
    Jan 6, 2011
  5. óÅÒÇÅÊ ÷ÌÁÄÉÍÉÒÏ×ÉÞ
    Replies:
    0
    Views:
    330
    óÅÒÇÅÊ ÷ÌÁÄÉÍÉÒÏ×ÉÞ
    Feb 2, 2012
Loading...

Share This Page