[CODE] - Python Newcomer Starting with Coding

Discussion in 'Python' started by Ilias Lazaridis, Mar 21, 2006.

  1. Where can I find practical coding examples for real life coding problems?

    Something like a categorized solution guide?

    -

    My current problem:

    * create a folder
    * seems to be: os.mkdir(path)

    * obtain the path of a python package

    * copy the content of the package folder to the created folder

    alternatively (which would possibly preserve the file-attributes)

    * obtain the path of a python package

    * copy the content of the package folder to the destination folder,
    whlist giving a new name.

    I've looked in the Python 2.4 documentation, but the resulting
    possibilities are too much.

    Any suggestions welcome.

    ..
     
    Ilias Lazaridis, Mar 21, 2006
    #1
    1. Advertisements

  2. Probably in real life code ?-)
    Look for the Python cookbook (google is your friend).
    I wouldn't even count this as a coding problem, except perhaps for a
    total CS newbie.
    import package
    print package.__file__
    import shutil
    help(shutil.copytree)

    (snip)
    ???
     
    bruno at modulix, Mar 21, 2006
    #2
    1. Advertisements

  3. Ilias Lazaridis

    Ed Singleton Guest

    This sounds quite a lot like PLEAC. It certainly contains a lot that
    you would find useful.

    http://pleac.sourceforge.net/pleac_python/index.html

    Also, try using the python-tutor list. It's a lot more helpful for
    questions like these.
    Try using the Path module. It makes all that stuff much easier:

    http://www.jorendorff.com/articles/python/path/

    Ed
     
    Ed Singleton, Mar 21, 2006
    #3
  4. ....

    http://www.oreilly.com/catalog/pythoncook/

    sorry, I've not clarified that I mean an free internet resource.
    ....

    this one was helpfull.

    thanks a lot.

    ..
     
    Ilias Lazaridis, Mar 21, 2006
    #4
  5. yes, this looks like the resource I was looking for.
    I've subscribed via gmane's nntp:

    news://news.gmane.org:119/gmane.comp.python.tutor

    will take a close look to this list.
    looks very intresting.

    for now I am limited to the standard library.

    but I will for sure take a deeper look in near future.

    ..
     
    Ilias Lazaridis, Mar 21, 2006
    #5
  6. Ilias Lazaridis

    Dave Hansen Guest

    Dave Hansen, Mar 21, 2006
    #6
  7. Ilias Lazaridis

    Chris Lasher Guest

    Chris Lasher, Mar 21, 2006
    #7
  8. Are you sure this is what you want to do? It seems an odd objective for
    a preliminary effort.

    Forgive me if I am reading this wrong, but I am concerned that you
    think you need to do all this work to use the package. If so, you are
    asking the wrong questions. Please look into the PYTHONPATH environment
    variable and the sys.path list within Python.

    mt
     
    Michael Tobis, Mar 21, 2006
    #8
  9. Ilias Lazaridis

    John Salerno Guest

    Reading that now...definitely not for a newbie.
     
    John Salerno, Mar 21, 2006
    #9
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.