Ways to run a shell script that starts a python script

I have a shell script that is used to launch a python (2.5.1 installed via Fink) script (IDLE). The shell script, the IDLE script, and the python binary are all in /sw/bin as usual. This all has to be done AFTER X11 has been launched. I have to make this easy for my students to use.
In each account's home .xinitrc file, I have the lines
source .profile
vpython2.5 *
and this works, but it calls the vpython2.5 script every time X11 is launched. I've tried adding the vpython2.5 command to the X11 Applications menu, but this works ONLY if I add /sw/bin to the script name. Apparently the menu doesn't "know" about the current PATH setting. The keyboard shortcut I put in the menu neither shows up nor works either. So much for that option.
Now I've discovered Platypus and it looked promising, but I'm obiously not using it correctly and from the documentation, I can't figure out what I'm doing wrong.
So here's the ultimate question. Is there a way to use Platypus to encapsulate the vpython2.5 script, preferably also starting up X11, so students will only have to click on the new app's icon? This is how OpenOffice.org starts up. It seemed simple enough to do in Platypus, but I never saw the IDLE window open up.

I added a shortcut key "j" for the "xman" app in X11, and it seems to work fine. Did you press the command key with the shortcut key? Are you sure the shortcut key you selected does not overlap with others in the menubar?
There should be no problems creating an application with Platypus using a shell script. In my experience, you have to source all necessary files, assuming that the shell script does not recognize your terminal settings. You can also launch X11.app in the shell script with the following command:
command open -a X11
It is a good idea to pause the shell script until X11 finishes launching. To do this, you need a command like,
command sleep 5
Otherwise, if you try to start X11-dependent apps in the shell script while X11 is launching, it will fail. There may be better ways to do this.
Hope this helps.

Similar Messages

  • How to use OLE to start a Diadem vbs Script, that starts the Measurement

    Hi there,
    i try to use OLE to start a Diadem Script that start my measurement. I always get the Error-Message "The Measurement can only be startet in the first instance". How can i make this work? At this time i use DDE to start my Scripts and i want to use OLE to get direct Channel Access and to prevent the lousy dde-timeouts.
    IDIACommand = CreateObject("diadem.tocommand")
    command="Scriptstart  etc
    IDIACommand.CmdExecuteASync(command)
    Thanks
    Diademi

    Hello diademi!
    Depending on a registry setting DIAdem will treat the interface creation in two different ways:
    Starting always a new instance of DIAdem and connect to this
    Start a new DIAdem if there is no DIAdem already running. Then connect to the started or the already running DIAdem
    The second mode will be right for your use case. Have a look at the key 'HKEY_CLASSES_ROOT\CLSID\{285E4FB2-F633-11D1-85DC-008048D9A408}\StartParameter' in the registry. The value 'Intancing' defines the behavior. Search the DIAdem help to get the definition (don't use the help index, it is missing there!).
    Matthias
    Matthias Alleweldt
    Project Engineer / Projektingenieur
    Twigeater?  

  • A ksh script that generates a ksh script

    I am writing a ksh script to generate a ksh script. A snippet of the first script is shown below. The output that is generated is shown following that.
    First script:
    StartScript()
    echo $*
    StartScript log\(\)
    StartScript {
    StartScript 'echo $* >>$LOGGGGGGFILE'
    StartScript }
    This is the output that is produced:
    log()
    echo $LOGFILE
    $LOGGGGGGFILE}
    I can't figure out where the $LOGFILE is coming from....it should be $*. I've tried various permutations of quoting and backslashing, but nothing works.
    This is really strange, does anyone have any suggestions on how to do this?
    Thanks in advance
    Al

    The single or 'hard' quote around this line:
    StartScript 'echo $ >>$LOGGGGGGFILE'prevents the shell from interpreting the $ as a "value-of" operator. Use double quotes ("soft" quotes) and it should be fine.

  • How to get name of batch file/shell script that starts program?

    I don't think there's a way to do it, but I'm asking the question anyway...
    of course, the startup script could pass its name as a parameter to the Java program, but I was wondering if the information could be determined "directly," via Java code. The idea is to allow your Java program to modify the startup configuration specified by your startup shell script.
    For example, a "startup configuration" menu item would pop up a dialog box that would display- and allow you to change- the startup parameters, and then let you write the changes back to the script file.

    There are always some ways to do things.
    I guess for your case, you need to go through JNI and have a native program to back track the Process ID of who started who. Never done that but I guess should work.
    But a more natural way to do this is to have your startup configuration stored in an xml file or a properties file inside your classpath.
    --lichu                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • [SOLVED] How to create script that start serveral programs

    If i wrote to file
    firefox
    thunderbird
    i will make it executable
    if i run it then it will run firefox, after i close firefox then will run thunderbird,
    how i write this to run paralel thunderbird and firefox?
    Last edited by vito45 (2010-04-09 09:25:13)

    firefox&
    thunderbird&

  • Java Web Start and Remote Scripting Incompatibility?

    I recently installed the Java Web Start plugin to Internet Explorer, in order to run Sun's version of the Java Virtual Machine.
    After the install, I am receiving errors when trying to run a web application that uses the Remote Scripting technology for client-server communication.
    I think this might be related to the Java 2 security model, which requires all Java applets to be signed. The Remote Scripting client-side component seems to be unsigned, so that may be causing my problem.
    Does anyone have a solution for this problem?
    Any help is greatly appreciated.
    Best Regards,
    Nicole Roberts

    Hi,
    I had the same problem on a unix server!
    The new build of IE on Windows 2003 from Microsoft that excludes the JVM (Java Virtual Machine), works fine with the JVM coming from Sun, except for the following.
    We are experiencing problems, that if we are not logged in as Domain administrator, we get an Apache security prompt to log on, as soon as the RSProxy class is used. It seems that the Class is not picking up the current session, but tried to create another session, without a userid, and then prompts you for your login details.
    We still cannot figure out, why it does not do it with the Domain Administrator account.
    Can someone please have a look into this.
    I think there is a simple configuration problem somewhere, that will allow seamless integration with Sun's JVM.
    I could resolve it so far by loading the Microsoft JVM back into Win2k3 theough the Visual Studion 6 Cd's, but I don't like the idea of that!

  • Automator workflow hangs indefinitely after running Python script

    Hello,
    I have an Automator workflow set up to use a one-line shell script to launch a Python script. The Python script has a GUI and stays open for the user to interact with it. It launches fine, but I've noticed that my Automator workflow hangs and the spinning workflow cursor won't disappear from the menu bar unless I manually kill the workflow or quit the Python app. Not a huge deal to kill it manually, but annoying.
    I saw someone posted a way to kill an Automator workflow using an AppleScript or shell script embedded within the workflow, but adding that as a second step doesn't work for me—the Automator workflow never gets to that step, presumably because it's waiting for my Python app to close. Anyone know a way to make the Automator workflow kill itself after launching a Python script?

    By default, AppleScript (and, by extension, Automator) will wait for theshell process to exit before continuing the workflow (or exiting if the shell script action is the last step.
    This can be overcome by launching the shell process as a background process, which returns control to AppleScript/Automator, and allows your workflow to continue (or end).
    Just append:
    &> /dev/null
    after your shell command to launch it in the background, e.g.:
    /usr/bin/python /path/to/your.py &> /dev/null
    and you should get what you expect.

  • Run a shell command using Pl/Sql

    hi all
    i wonder if anyone knows a way to run a shell command using pl/sql
    other than java stored procedure
    as it seems not to be working in my case
    thanx in advance,
    Rasha

    ofcourse not
    i sent it once then i've got disconnected from interent then i reconnected
    and resend my question so it was sent twice
    now i hope you can answer my question !!!
    Do you really think when asking twice or more often you will get a quicker answer?

  • How to call Python Scripts throght Labview

    Hi all,
    I am new to this community. Need some inputs  for following Questions
    Questions:
    1)  How can I call python script from LabView?
     (Basically this python script calls some other DLL and print some message, to run the script using Python net in my application .To run my script in python net using following commands: import python script name )
    2)  In how many ways we can call Python scripts from labview?
    I have tried with this option "System Exec.vi "in labview , able to calling pythonnet but unable to send commands and arguments to run python script(i.e  import python script name ). 
     If anyone have samples".VI " please send to me. If you people want any information and clarification  from my side please let me know. Thanks in advance.
    Regards,
    Sambasivareddy

    One way is to create a client server app and to send arguments to python (and back) over TCP/IP. This work very well.
    There is an example on the old OpenG Website about this. Look it up.
    Python client to LabVIEW Server.
    PJM
    Message Edited by PJM_Labview on 03-12-2008 09:00 AM
    Got EasyXML?
    JKI.VIPM.EasyXML.OpenG.LAVA.Builder.blog

  • Run a shell script at login?

    I would like to run a simple shell script each time a user logs in. Currently, I have it wrapped in an Automator executable that is included in "Login Items", but figured there must be a more elegant way? Thanks.
    More info:
    The problem I'm trying to solve is that of file permissions when sharing one iTunes and one iPhoto library between multiple users on one computer. The libraries are located in /Users/Shared and the apps were pointed to the relocated libraries by holding down 'Option' on startup. The problem is that work done by each user in the iTunes or iPhoto library inherits the default permission settings of that user, making any new additions to the libraries, read-only to the other users. I'm using `chmod` on login to fix it. Let me know if you know of a better way to address this. Thanks again.

    I wrote a simple shell script that executes each time a user logs in (well, actually, each time I log in, coz' it's not really applicable to other users). It syncs my work and home addressbooks and iCal calendars to one another.
    I named it "sync". Then I read somewhere that if you wanted to make it double-clickable (to launch it from the Finder), I appended a ".command" filename extension (so it's now named "sync.command"). I also did a chmod 755 to that file so that it had execute privileges. Depending on whether you give each user their own copy of this thing, or keep a single copy in, say, the /Users/Shared directory, you may have to play around with chmod. Whatever, just so long as the user that has just logged in has execute permissions to the file, and to the entire path to the file, you should be good.
    Then, in SysPrefs > Accounts > Login Items, I added that "sync.command" file to the list. So, really the only difference is I'm not wrapping mine inside an Automator script like you are.
    I had tried adding it to ~/Library/LaunchAgents and make a launchd plist for it, that would kick it off at login. But I didn't get that to work. Don't know why. But just adding the double-clickable executable unix script to the Login Items list did the trick. Whether the plist has to hang out there with it, I don't know. I still have it there, though, in case I ever get motivated to figure out what's wrong with my launchd plist file. So, if just adding it to the Login Items list doesn't do it for you, you could try making a (functional?) launchd plist for it and plopping them both in ~/Library/LaunchAgents, too. That's how I am now, and, like I said, it launches at user login as that user's process (not as a root process like the above referenced article said how login hooks worked -- although, you may want it to run as root since you want this to work with multiple users...in which case, you might want to listen to Cole and not me...).

  • How do I run a shell script via AppleScript?

    Seems obvious, "do shell script" but that doesn't work for me.
    I have an Automator app which runs a shell script, I'd like to take that into an AppleScript. My AS doesn't run the shell script. Perhaps "do shell script' is expecting the script to be located elsewhere? The rest of my AS runs fine, but the shell script doesn't.
    repeat with i from 1 to count of items in exportFolder
      do shell script
              "exiftool -overwrite_original -Photoshop:CopyrightFlag='True'"
      done
    end repeat
    As I say this works within an Automator app, what changes do I need to make it work in AppleScript?
    Thanks!

    Camelot wrote:
    repeat with i from 1 to count of items in exportFolder
    What is 'exportFolder'? Where is it defined?
    Thanks, 'exportFolder' is defined earlier in the script. The purpose of the script - which is run from within Aperture - is to rename the selected images, export them (to the 'exportFolder'), reset the version name and, using ExifTool, add metadata which Aperture does not write to exported JPEGs.
    I have a version of this which works in Automator but I couldn't see any clues there on setting the path to ExifTool.
    Here's the full (modified) script. Currently it returns an error
    Result:
    error "No file specified" number 1
    so I now need to understand if I can use 'exportFolder' (defined at the start) to tell Finder which folder to use.
    -- Creating filenames by making Version Name  from the IPTC Headline and Filename (with hypens where spaces exist). The Aperture Version Name is used to create the file's name on export. Once exported the Aperture Version Name is reset to its original.
    tell application "System Events"
              set exportFolder to (choose folder with prompt "Choose an export folder")
    end tell
    tell application "Aperture"
              set theSel to (get selection)
              if theSel is {} then
                        error "Please select an image or two!."
              else
                        repeat with theImg in theSel
      -- Creating a new Aperture Version Name which will become the exported file's filename.
                                  tell theImg
                                            set headline to (get value of IPTC tag "Headline" of theImg)
                                            set AppleScript's text item delimiters to " "
                                            set theTextItems to text items of headline
                                            set AppleScript's text item delimiters to "-"
                                            set headline to theTextItems as string
                                            set AppleScript's text item delimiters to {""}
                                            set objectName to (get value of IPTC tag "ObjectName" of theImg)
                                            set newVersion to (headline & "-" & objectName) as string
                                            set name of theImg to newVersion
                                  end tell
                        end repeat
      -- Exporting the files as JPEGs to chosen folder/Project Name using the Version Name as a filename
                        export theSel using export setting "JPEG - Original Size" to exportFolder
      -- Resetting the Aperture Version Name back to filename using IPTC Title (which should be the file's filename without suffex).
                        repeat with theImg in theSel
                                  tell theImg
                                            set title to (get value of IPTC tag "ObjectName" of theImg)
                                            set name of theImg to title
                                  end tell
                        end repeat
              end if
    end tell
    --Using ExifTool to set Photoshop Copyright Status etc
    tell application "Finder" to set theFiles to files of exportFolder as alias list
    repeat with eachFile in theFiles
              do shell script "/usr/bin/exiftool -overwrite_original -Photoshop:CopyrightFlag='True' -Photoshop:URL='http://davidgordon.co.uk/'" & quoted form of POSIX path of eachFile
    end repeat
    display dialog "Done that!" with icon note buttons "OK" default button 1 giving up after 10

  • A way to run bundle tests scripts with EBS 11.5.10.2

    Hi,
    looking for a way to run bundle tests scripts with EBS 11.5.10.2. We prepare our tests scenarios and run them manually now but would rather job them and verify results of testing on logs created by the automatic execution of these scripts.
    We use UPK for preparing and supporting our training activities and I read that UPK features a way to prepare and run bundle tests scipts. Does anybody from the community knows something about that? I haven't found a guide to explain how to do it.
    Hoping someone to lead me to the topic I'm looking for. Does any release of UPK can do this and how or the community uses another tool to do so
    Alain

    UPK allows you to create manual test scripts which can be imported into a variety of testing suites. UPK does not provide automated test scripts. In the current release, the name of the publishing style is "HP Quality Center". This will create a spreadsheet document that can then be imported into a variety of testing suites as a test script. The product documentation should give you all the information you need to start using the HP Quality Center output. If not, here is a blog post describing how to use UPK to create an output for IBM Rational Quality Manager, which may help describe how this process works:
    http://blogs.oracle.com/UPK/2010/05/upk_and_rqm.html
    I hope this helps.
    Best regards,
    Marc

  • Run Unix command / Run Unix shell script from Forms9i

    Hi,
    I have a requirement to run Unix command and Unix shell scripts from Forms9i.
    I know HOST command cannot be used directly. I also know we can create some JAVA stored procedure to perform the task, but I don't want to create any JAVA stored procedure as there are some security concerns.
    Please point me towards any other way to achieve the same.
    I would really appreciate your help.
    Thanks,
    Kumar

    There is no reason why HOST can't be used. This is what it is for. As for using Java, it is not a stored procedure that you would be using, it would be imported Java (imported into the form).
    The best way to use the HOST command is to call a script (.sh) rather than calling a Unix command directly. This is because HOST will not pick up environment variables set at the system level. So the script would first need to set the necessary environment variables then call the desired commands.

  • Secure login to remote UNIX host and run a shell script

    Hi I am new to JAVA. I want to login to remote UNIX host from my application secure login (SSH) and run a shell script reside that remote host. Can any one let me know the way how to do it. If possible provide the code example.

    Runtime.exec with an ssh command (not really recommended).
    Much better, an SSH API (JSch, which needs JZlib, from http://www.jcraft.com/ is a good one).

  • Run a shell script from FORM

    Hi,
    Is there a way that we can run a shell script on UNIX box from ORACLE FORMS 4.5 running on client PC (OS=windows on client,
    DB on unix).
    Thanks in advance for help

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Anton Weindl ([email protected]):
    You can either use rsh or rexec (both available on windows). You will have to edit the .rhosts in the home directory of the unix user the script will be run under:
    <Client-Hostname> <USER>
    <USER> must match the Windows-User exactly.
    You can then execute the Shell-Script with
    host('rsh <HOST> -l <USER> sh <SCRIPT>',NO_SCREEN)
    Hope that helps
    Anton Weindl
    <HR></BLOCKQUOTE>
    Thank You Anton Weindl,
    It seems like the thing I want to use instead of the dbms_pipe.
    I tried to use rsh and gives me the following message
    command: "rsh taurus -l nileshs test.sh"
    where taurus is hostname and
    guest is unix username
    I am logged on windows 2000 with this name.
    "taurus permission denied:"
    "rsh can't establish connection"
    Let me know if I am missing anything.
    Thanks.
    null

Maybe you are looking for