Environment Variables

Discussion in 'Python' started by Krishna, Apr 25, 2008.

  1. Krishna

    Krishna Guest

    Environment variable set up is the most confusing part for me all the
    time. Please help me with the following questions:

    When I install python in a new system, I will go to environment
    variables (system variables) and set "path" pointing to C:\Python25
    and thats all I do.
    I type python from "cmd" window and its converting to python window
    for python execution. All fine up to this point.
    Now, I want to drag and drop python (.py) files to this window and
    execute it. My python files are located in different directories
    inside C: and outside C:. When I do that, I get errors and the file is
    not found and its not imported. ALso, inside the .py file, if I have a
    command to open a different file, it doesnt see that either. How do I
    overcome these basic difficulties in python. I wish I can open any
    file and work on that using python.


    Thanks for your help!
    Krishna
    Krishna, Apr 25, 2008
    #1
    1. Advertising

  2. On Apr 25, 8:07 am, Krishna <> wrote:
    > Environment variable set up is the most confusing part for me all the
    > time. Please help me with the following questions:
    >
    > When I install python in a new system, I will go to environment
    > variables (system variables) and set "path" pointing to C:\Python25
    > and thats all I do.
    > I type python from "cmd" window and its converting to python window
    > for python execution. All fine up to this point.
    > Now, I want to drag and drop python (.py) files to this window and
    > execute it. My python files are located in different directories
    > inside C: and outside C:. When I do that, I get errors and the file is
    > not found and its not imported. ALso, inside the .py file, if I have a
    > command to open a different file, it doesnt see that either. How do I
    > overcome these basic difficulties in python. I wish I can open any
    > file and work on that using python.
    >
    > Thanks for your help!
    > Krishna


    I'm pretty sure you can't do that in a command window. I tried it on
    my Windows XP machine and all I get in my instance of IDLE is the path
    to the file. It DOES work with PythonWin, which is the ActiveState
    version of Python. The only difference is that it include the win32
    modules and has a more advanced editor.

    You can probably get this to work in other more advanced editors, like
    WingIDE or PyDev too.

    Mike
    Mike Driscoll, Apr 25, 2008
    #2
    1. Advertising

  3. Krishna

    Steve Holden Guest

    Krishna wrote:
    > Environment variable set up is the most confusing part for me all the
    > time. Please help me with the following questions:
    >
    > When I install python in a new system, I will go to environment
    > variables (system variables) and set "path" pointing to C:\Python25
    > and thats all I do.
    > I type python from "cmd" window and its converting to python window
    > for python execution. All fine up to this point.
    > Now, I want to drag and drop python (.py) files to this window and
    > execute it. My python files are located in different directories
    > inside C: and outside C:. When I do that, I get errors and the file is
    > not found and its not imported. ALso, inside the .py file, if I have a
    > command to open a different file, it doesnt see that either. How do I
    > overcome these basic difficulties in python. I wish I can open any
    > file and work on that using python.
    >

    http://www.python.org/doc/faq/windows/#how-do-i-run-a-python-program-under-windows

    regards
    Steve
    --
    Steve Holden +1 571 484 6266 +1 800 494 3119
    Holden Web LLC http://www.holdenweb.com/
    Steve Holden, Apr 25, 2008
    #3
  4. Krishna

    Krishna Guest

    On Apr 25, 9:17 am, Mike Driscoll <> wrote:
    > On Apr 25, 8:07 am, Krishna <> wrote:
    >
    >
    >
    >
    >
    > > Environment variable set up is the most confusing part for me all the
    > > time. Please help me with the following questions:

    >
    > > When I install python in a new system, I will go to environment
    > > variables (system variables) and set "path" pointing to C:\Python25
    > > and thats all I do.
    > > I type python from "cmd" window and its converting to python window
    > > for python execution. All fine up to this point.
    > > Now, I want to drag and drop python (.py) files to this window and
    > > execute it. My python files are located in different directories
    > > inside C: and outside C:. When I do that, I get errors and the file is
    > > not found and its not imported. ALso, inside the .py file, if I have a
    > > command to open a different file, it doesnt see that either. How do I
    > > overcome these basic difficulties in python. I wish I can open any
    > > file and work on that using python.

    >
    > > Thanks for your help!
    > > Krishna

    >
    > I'm pretty sure you can't do that in a command window. I tried it on
    > my Windows XP machine and all I get in my instance of IDLE is the path
    > to the file. It DOES work with PythonWin, which is the ActiveState
    > version of Python. The only difference is that it include the win32
    > modules and has a more advanced editor.
    >
    > You can probably get this to work in other more advanced editors, like
    > WingIDE or PyDev too.
    >
    > Mike- Hide quoted text -
    >
    > - Show quoted text -


    So, how do I get the win32 module and what to do with that? Just
    install it?

    Thanks,
    Krishna
    Krishna, Apr 25, 2008
    #4
  5. On Apr 25, 8:26 am, Krishna <> wrote:
    > On Apr 25, 9:17 am, Mike Driscoll <> wrote:
    >
    >
    >
    > > On Apr 25, 8:07 am, Krishna <> wrote:

    >
    > > > Environment variable set up is the most confusing part for me all the
    > > > time. Please help me with the following questions:

    >
    > > > When I install python in a new system, I will go to environment
    > > > variables (system variables) and set "path" pointing to C:\Python25
    > > > and thats all I do.
    > > > I type python from "cmd" window and its converting to python window
    > > > for python execution. All fine up to this point.
    > > > Now, I want to drag and drop python (.py) files to this window and
    > > > execute it. My python files are located in different directories
    > > > inside C: and outside C:. When I do that, I get errors and the file is
    > > > not found and its not imported. ALso, inside the .py file, if I have a
    > > > command to open a different file, it doesnt see that either. How do I
    > > > overcome these basic difficulties in python. I wish I can open any
    > > > file and work on that using python.

    >
    > > > Thanks for your help!
    > > > Krishna

    >
    > > I'm pretty sure you can't do that in a command window. I tried it on
    > > my Windows XP machine and all I get in my instance of IDLE is the path
    > > to the file. It DOES work with PythonWin, which is the ActiveState
    > > version of Python. The only difference is that it include the win32
    > > modules and has a more advanced editor.

    >
    > > You can probably get this to work in other more advanced editors, like
    > > WingIDE or PyDev too.

    >
    > > Mike- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > So, how do I get the win32 module and what to do with that? Just
    > install it?
    >
    > Thanks,
    > Krishna


    ActivePython can be found on the ActiveState website:

    http://www.activestate.com/Products/activepython/?_x=1

    This will basically just add whatever modules needed if Python is
    already installed and it will also install another editor called
    pythonwin, which you should be able to find in your start menu.

    But be sure to check out that link that Steve gave you. That might
    work for you too.

    Mike
    Mike Driscoll, Apr 25, 2008
    #5
    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. Rick Kasten

    Setting Environment Variables

    Rick Kasten, Jul 7, 2004, in forum: Perl
    Replies:
    2
    Views:
    585
    Howard
    Jul 7, 2004
  2. =?Utf-8?B?YnNmbDQ0?=
    Replies:
    0
    Views:
    477
    =?Utf-8?B?YnNmbDQ0?=
    May 12, 2004
  3. darrel
    Replies:
    1
    Views:
    394
    Scott Allen
    Oct 4, 2004
  4. Replies:
    5
    Views:
    637
  5. Replies:
    9
    Views:
    922
Loading...

Share This Page