How to export an environment variable from command line ?

Hello,
I have build a python application which run some processes(or executable or other python scripts) using subprocess.
i.e.
subprocess.call(["xyz.py"], shell=True, stdout=log_file, stderr=log_file)
Above call throws an error as "xyz.py is not recognized as an internal or external command." I added the location of xyz.py into path variable inside a batch script which I used to run before running the script.
 set PATH=D:\path of xyz:%PATH%
But As subprocess executes a script into anther child shell, This setting is not available in child shell (or sub-shell) used by python script.
How can I make this PATH setting available to sub-shell also ?

Rather than going into much details I have used explicit path by referring only one environment variable of the shell where application is running.
i.e.  As xyz.py will be in a specific location of my repository, I am setting path of root_dir:
      set root_dir=<path_of_root_dir>
      And then,
      subprocess.call([os.path.join(os.environ['roo_dir'], 'dir', 'xyz.py')], ...)

Similar Messages

  • How to export and import database from command line?

    I am trying to export my old database into new server.
    However, I want to export and import that database from command line.
    Is it possible?
    Thanks.
    SZ

    I used this command
    exp username/password@database full=y
    my export log file is as follwing:
    Connected to: Oracle8i Enterprise Edition Release 8.1.5.0.0 - Production
    With the Partitioning and Java options
    PL/SQL Release 8.1.5.0.0 - Production
    EXP-00037: Export views not compatible with database version
    EXP-00000: Export terminated unsuccessfully

  • How to get an environment variable from OS in class ?

    Hello,
    How to get an environment variable from OS in class ?
    Thanks !

    An example of a Java application that does this is Ant, when you add a line like this in your build.xml:
    <!-- Import environment variables -->
    <property environment="env"/>
    I have looked at the source code of Ant 1.3, especially the file src/main/org/apache/tools/ant/taskdefs/Execute.java. Look at the methods getProcEnvironment() and getProcEnvCommand(). Ant uses an OS-dependent trick to get the environment variables.
    You can download the Ant source code from http://jakarta.apache.org/ant
    Jesper

  • How to run a 10g report from command line ?

    Good Afternoon,
    Please advise if there is a way to run a 10g report from command line.
    We use 6i right now and our job scheduler runs reports using "D:\ORADEV6I\BIN\RWRUN60.EXE ..." executable in batch mode on a separate server. We plan to migrate to 10g Database, Forms, Reports. Is there a way to keep this functionality and create a "command" to address an report server and run a report?
    Thank you,
    Dmitri

    Steps to take.
    (1.) In command prompt type RWSERVER SERVER=repserver1 to star the rep server.
    (2.) If you get "Javaw.exe The procedure entry point psoasyn could not be located in the dynamic link library orapls10.dll." error do one of the following
            (a.) Type the full name for the server. D:\OracleDevR2\bin\rwserver SERVER=repserver1
                   or, if it does not work
            (b.) Add D:\OracleDevR2\bin to the system env. variable PATH
    (3.) Start OC4j
    (4.) Now you can access the jobs using URL like:
        http://192.161.11.143:8890/reports/rwservlet/showjobs?server=repserver1
          where 192.161.11.143 is your machine's IP address.

  • How to open an online pdf from command-line

    Hi,
    I'm trying to get my application to open a pdf file from an url like http://xxxx.dk/xxx.aspx?CID=xxx
    it work from inside adobe reader so the pdf file is a functionel file, but when i try to open it from command line like: AcroRd32.exe /n /A "pagemode=none" "http://xxxx.dk/xxx.aspx?CID=xxx" i keep getting an error telling me "There was an error opening this document. The filename, directory name, or volume label syntax is incorrect"
    does anyone have an idea of what i need to do? i could also make a public test if someone needs to see the issue "live"

    it works with the browser, so no problems there.. i just wanted the pdf file to open in adobe reader instead of browser window, as it opens from a windows application.. but perhaps i need to look more into merging a embedded pdf viewer in the application instead..

  • How to run Report Builder Report from Command line

    Hello,
    Can Oracle Report Builder Report (run time report) run from Command line ( SQL prompt or Shell script).
    Quick response will be appreciated.
    Thanks,
    Atif

    Hi Atif,
    please see Note 74648.1 on Metalink.
    Monica

  • How to execute an ODI package from Command Line

    Please can anyone help me to know how to execute an ODI package from the command line without creating a scenario from the package.
    Appreciate your help.
    Thanks
    B

    You can't. Create a scenario and then execute that from the command line.

  • How to run executable Java app from command line: No Main( ) method

    This is the opposite question from what most users ask. I have the Java source code and a running Java executable version of the program in a windows environment. I don't want to run it in the normal way by double-clicking on it or using the executable. I need to be able to run the same application from the command line. If I can do this, I can then compile and run the code on my Mac, too, which is what I am ultimately trying to accomplish.
    Normally, this would be easy. I would look for a Main method, normally public static void main (String[] args ) or some variation. I cannot find a main() anything, anywhere when searching the files. There must be some windows executable that links to the Java classes. It's very clever, no doubt, but that's not helping me.
    I am trying to run what I can determine as the Main class, with a standard command line call, but that is not working either.
    It is a Java graphics program, so mostly Swing container stuff.
    I am not finding a manifest.txt file, telling me where a main method is, nor anything about the Main Class. There is no readme file for the program.
    Any insight that would point me in the right direction? What should I be looking for?
    Thanks in advance, Bloozman

    It's possible there's a clever Windows executable that runs the class. But if it's a plain old Java class then there's a good chance there's a constructor. Look for that; it's possible you may be able to start by writing another Java class that creates an instance of your mystery class.
    When you have that done, try running it. It's possible that just creating an instance might be sufficient to run it. Swing programs are sometimes written like that. If not, then start looking for methods with names like "run" or "go" or "start" that your little controller program can call.

  • How to send e-mail attatchement from command line

    Hi,
    Is it possible to send an e-mail with some attatchment like a .zip file through command line in iPlanet messaging Server 5.2.
    Please let me know the procedure.,
    Thanks
    Rajeev

    I suggest you try blat.exe from www.blat.net
    I use it regularly to send myself statistics and logfiles from servers without any client. Can be automated in a script.
    Eli

  • How to start OracleOraDb10g_home1iSQL*Plus service from command line (PC)

    After installing 10G, I now have a service with this name: OracleOraDb10g_home1iSQL*Plus
    I need to be able to start/stop the service from windows 2000 command line,
    BUT "net start OracleOraDb10g_home1iSQL*Plus" DOES NOT WORK.
    Adding quotes around the service name does not solve the problem either.
    Both attempts give "The service name is invalid" errors.
    Can anyone provide a solution?
    THANKS!

    Sorry, but none of the suggestions works. Thanks for trying though.
    1) Renaming the service only changes the display name, and then when you use "net start", it errors with: "The service name is invalid"
    2) call isqlplus start errors with "isqlplus is not recognized as an internal or external command..."
    3) You cannot execute isqlplussvc.exe directly either.
    Any more suggestions?

  • How can i change printer settings from command line

    hello 
    i want to use command that changes printer to print grayscale or color 
    the best i find is to use: rundll32 printui.dll,PrintUIEntry
    but i cant find color settings there 
    i would like your help with that 
    thanks alot !

    We may have to wait for an update.  Aside from changing the country, I'm not sucre this can be done.  There is no Health App in the System preferences and no  way to modify from within the app.  Weird.
    If you go to Language & Region under general settings and choose any other country, you will get Metric.  I have the opposite problem.  I live in a Metric country and want my health app to be in lbs and inches which is what I am used to.

  • How to execute My Javascript code from command line or through perl or VB

    Hi Forum,
    I am a new bie, just 2 days old to acrobat and javascript, and I am basically a perl developer
    Here with I have created a small script to merge two pdf
    // Create a new PDF document:
    var newDoc = app.newDoc();
    // Insert doc1.pdf:
    newDoc.insertPages({
    nPage : -1,
    cPath : "/d/sathish/1.pdf",
    // Insert doc2.pdf:
    newDoc.insertPages({
    nPage : newDoc.numPages-1,
    cPath : "/d/sathish/2.pdf",
    // Save the new document:
    newDoc.saveAs("/d/sathish/myNewDoc.pdf");
    My code is working fine and merging properly,
    Is there any way to execute this script through commandline or using some other scripting languages like perl or through VB
    My objective is to automate the merging process without any manual intervention, I don't want to open acrobat manually to execute this javacript, i want to automate that process too,
    Please suggest me which will be very helpful to me,
    Thanks in advance
    Thanks & Regards
    Sathish V.

    Hi Sathish,
    did you find a solution for this? I am looking for the same thing. I want to write a program(perl, batch script, etc.) which could automatically convert pdf to excel without any manual intervention.
    I have the acrobat javascript which could achieve this, but it can only be executed in arobat consolt.  I need it to be able to get executed in a script to automate the processing.
    thanks
    Warren

  • How to access environment variables from Oracle Forms

    Hi,
    Any idea how to use the Environment variables from Oracle Forms.
    My basic problem is that from Oracle form I am calling Batch file which calls excel file with a macro.
    So i want to check whether the macro was successful or not.
    So in my batch file i will set %errorlevel% which I should be able to read from Oracle Forms.
    I am able to read the registry from oracle forms, so is there anyway to read environment variable as well?
    Thanks!
    Avinash.

    Hello,
    Use the TOOL_ENV.Getvar() built-in
    Francois

  • Running Oracle Scripts from Command Line

    Hi,
    How can i run Oracle scripts from command line.
    Actually i need to run these scripts from MSBuild before running Unit test projects

    C:\>sqlplus @myscript
    That would be the easiest variation
    C:\>sqlplus user/passwd@tns_alias @myscript
    would be an often used variation
    And then there is of course the version with parameter passing:
    C:\>sqlplus user/passwd@tns_alias @myscript param1 ... paramx
    Dunno about MSBuild

  • How to access environment variables from pluggable destination?

    Hi,
    I'm trying to create a java puggable destination for reports. Everything is working fine.
    I want to access reports environment variables from the java code (like REPORTS_PATH and other new variables that I want to create), but I can't find anything about this in the java API documentation.
    I want to use environment variables instead of destination properties (those I can easily access), because I want to be able to change context using env_id.
    Any ideas?
    Thanks,
    Luis

    I'm using Oracle Application Server Version 10.1.2.0.2
    Thanks

Maybe you are looking for

  • Why is my icloud storage full, when I've disabled all apps from being backed up?

    I saw my icloud storage was full, so i went into "manage storage" and turned off almost every app so it wouldn't back up to icloud.  it still shows that it's full.  how/why?!

  • Windows 7 installation error: "Apple Mobile Device" failed to start.

    Towards end of recent iTunes software update on Windows 7, I had an installation error within starting services "Apple Mobile Device" failed to start, etc. Pressed IGNORE option. Appears to install but fails to load saying msvcr80.dll missing. Any id

  • How to read compression quality ?

    Hi, On ImageWriteParam, there is a getCompressionQuality(). I should want to read this property on an existing image file, but there is no getCompressionQuality on a ImageReadParam. How is it possible to read this compression quality from an image fi

  • Can XML Update more than One Table in one call?

    Hello, I had a quick question. I have a client who is using both Oracle and SQL. They have an app developed in C sharp with XML whichs runs against SQL and want to port to Oracle. In SQL one XML statment can update multiple Tables. Can we do that in

  • SCOM 2012 Agent Deployment query

    Hello, I have tried to deploy the agent remotely to a Windows Storage Server Standard - SP1 server but it failed, I have checked the compatible OS list and it makes reference to Server 2008 SP2 but not Storage Server. If I upgrade to SP2 will the a