help - python can't find file - Linux

This is a discussion on help - python can't find file - Linux ; -learning python with limited knowledge of linux. -get error msg 21 "file or directory does not exist" -running Suse linux 10. -haven't had a problem before - rebooted several times. -python opened in shell/terminal program Konsole window like this user1@linux!~ ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: help - python can't find file

  1. help - python can't find file

    -learning python with limited knowledge of linux.
    -get error msg 21 "file or directory does not exist"
    -running Suse linux 10.
    -haven't had a problem before
    - rebooted several times.
    -python opened in shell/terminal program Konsole window like this
    user1@linux!~ - shell - Konsole
    Sessions View Bookmark Settings Help

    -first line in window gives me a linux prompt:
    user1#linux:~>

    - whereupon I type python and get >>> a command line I think it is
    called or type python pyfilename.py and it runs/interprets/opens
    the file on screen

    - but now I get a error message 21 saying file or directory doesn't
    exist.

    - my py files are created with editor gedit
    - clicking on any py file and linux asks me to open it with what
    program and I choose utilities/editdors/gedit and it works.

    -all my py files contain the following lines at the beginning
    #! /usr/bin/env python
    # -*- coding: utf-8 -*-

    # filename: blankpy.py (for example of a file name)


    - my linux file structure is as follows shown under Konqueror window:
    rootfolder
    bin
    boot
    dev
    etc
    home
    user1
    bin
    desktop
    documents
    lib
    media
    dvdrecorder
    floppy

    - (for example, and continues on, of course)


    - none of my python books or linux books show that I can type
    python /dev/sda/ blankpy.py and get python to open it like in
    windows98 or dos python A:\blankpy.py

    embarrassed and frustrated
    any suggestions to solve my problem would be appreciated.

  2. Re: help - python can't find file


    "enquiring mind" wrote in message
    news:46519496.F8BC0B2D@braindead.com...
    > -learning python with limited knowledge of linux.
    > -get error msg 21 "file or directory does not exist"
    > -running Suse linux 10.
    > -haven't had a problem before
    > - rebooted several times.
    > -python opened in shell/terminal program Konsole window like this
    > user1@linux!~ - shell - Konsole
    > Sessions View Bookmark Settings Help
    >
    > -first line in window gives me a linux prompt:
    > user1#linux:~>
    >
    > - whereupon I type python and get >>> a command line I think it is
    > called or type python pyfilename.py and it runs/interprets/opens
    > the file on screen
    >
    > - but now I get a error message 21 saying file or directory doesn't
    > exist.
    >
    > - my py files are created with editor gedit
    > - clicking on any py file and linux asks me to open it with what
    > program and I choose utilities/editdors/gedit and it works.
    >
    > -all my py files contain the following lines at the beginning
    > #! /usr/bin/env python
    > # -*- coding: utf-8 -*-
    >
    > # filename: blankpy.py (for example of a file name)
    >
    >
    > - my linux file structure is as follows shown under Konqueror window:
    > rootfolder
    > bin
    > boot
    > dev
    > etc
    > home
    > user1
    > bin
    > desktop
    > documents
    > lib
    > media
    > dvdrecorder
    > floppy
    >
    > - (for example, and continues on, of course)
    >
    >
    > - none of my python books or linux books show that I can type
    > python /dev/sda/ blankpy.py and get python to open it like in
    > windows98 or dos python A:\blankpy.py
    >
    > embarrassed and frustrated
    > any suggestions to solve my problem would be appreciated.

    Do you have version 2.5.1 installed and have you tried the online
    documentation? See
    http://www.python.org/doc/ . Update to the latest version if possible
    because just by reinstalling the problem may be fixed. You may want to
    download the full documentation/manual since it could contain the answer to
    your question.



  3. Re: help - python can't find file

    In article <46519496.F8BC0B2D@braindead.com>, enquiring mind
    wrote:

    > -learning python with limited knowledge of linux.
    > -get error msg 21 "file or directory does not exist"
    > -running Suse linux 10.
    > -haven't had a problem before
    > - rebooted several times.
    > -python opened in shell/terminal program Konsole window like this
    > user1@linux!~ - shell - Konsole
    > Sessions View Bookmark Settings Help
    >
    > -first line in window gives me a linux prompt:
    > user1#linux:~>
    >
    > - whereupon I type python and get >>> a command line I think it is
    > called or type python pyfilename.py and it runs/interprets/opens
    > the file on screen
    >
    > - but now I get a error message 21 saying file or directory doesn't
    > exist.
    >
    > - my py files are created with editor gedit
    > - clicking on any py file and linux asks me to open it with what
    > program and I choose utilities/editdors/gedit and it works.
    >
    > -all my py files contain the following lines at the beginning
    > #! /usr/bin/env python
    > # -*- coding: utf-8 -*-
    >
    > # filename: blankpy.py (for example of a file name)
    >
    >
    > - my linux file structure is as follows shown under Konqueror window:
    > rootfolder
    > bin
    > boot
    > dev
    > etc
    > home
    > user1
    > bin
    > desktop
    > documents
    > lib
    > media
    > dvdrecorder
    > floppy
    >
    > - (for example, and continues on, of course)
    >
    >
    > - none of my python books or linux books show that I can type
    > python /dev/sda/ blankpy.py and get python to open it like in
    > windows98 or dos python A:\blankpy.py
    >
    > embarrassed and frustrated
    > any suggestions to solve my problem would be appreciated.


    Check to see if /usr/bin/env python really delivers the path to the python
    executable. Try subtituting /usr/bin/python, or whatever is the direct
    path on your machine.

+ Reply to Thread