are there internal functions for these ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • black

    #1

    are there internal functions for these ?

    hi all~

    i wrote some functions for copying and moving files caz' i didnt find
    concret functions within the doc. but i think these operations are
    simple and important so there may be some internal ones i didnt know.
    anyone could figure me out ?

    tks~

  • jepler@unpythonic.net

    #2
    Re: are there internal functions for these ?

    there's 'os.rename' for moving (single) files, and several functions in
    'shutil' for moving and copying trees of files.

    Jeff

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.1 (GNU/Linux)

    iD8DBQFDTG6EJd0 1MZaTXX0RAvedAJ 97gFhW1/CPaWnVbtgoBZyZ2 vi4hwCfa1hp
    9GuyNsDSTlXqzD6 jMcNUw60=
    =CLIp
    -----END PGP SIGNATURE-----

    Comment

    • Robert Kern

      #3
      Re: are there internal functions for these ?

      black wrote:[color=blue]
      > hi all~
      >
      > i wrote some functions for copying and moving files caz' i didnt find
      > concret functions within the doc. but i think these operations are
      > simple and important so there may be some internal ones i didnt know.
      > anyone could figure me out ?[/color]

      Source code: Lib/shutil.py The shutil module offers a number of high-level operations on files and collections of files. In particular, functions are provided which support file copying and removal...


      This is the second hit for the google search:

      site:docs.pytho n.org copy

      --
      Robert Kern
      rkern@ucsd.edu

      "In the fields of hell where the grass grows high
      Are the graves of dreams allowed to die."
      -- Richard Harter

      Comment

      • Kent Johnson

        #4
        Re: are there internal functions for these ?

        black wrote:[color=blue]
        > hi all~
        >
        > i wrote some functions for copying and moving files caz' i didnt find
        > concret functions within the doc. but i think these operations are
        > simple and important so there may be some internal ones i didnt know.
        > anyone could figure me out ?[/color]

        See the os, os.path and shutil modules for many file operations including copy and move.

        Kent

        Comment

        • Steven D'Aprano

          #5
          Re: are there internal functions for these ?

          black wrote:
          [color=blue]
          > anyone could figure me out ?[/color]

          No, I suspect people would have to be a trained
          psychologist to figure you out.

          *wink*

          --
          Steven.

          Comment

          • Grant Edwards

            #6
            Re: are there internal functions for these ?

            On 2005-10-12, black <quiteblack@gma il.com> wrote:
            [color=blue]
            > i wrote some functions for copying and moving files caz' i didnt find
            > concret functions within the doc. but i think these operations are
            > simple and important so there may be some internal ones i didnt know.[/color]



            It's the very first link.
            [color=blue]
            > anyone could figure me out ?[/color]

            I'm afraid so.

            --
            Grant Edwards grante Yow! Is this TERMINAL fun?
            at
            visi.com

            Comment

            Working...