#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    2
    Rep Power
    0

    Pycharm New Directory Console Command


    I am relatively new to Python programming and I am eager to learn more Python programming. I have a Pycharm project with two packages and I want to use the Python console to make new directories and new python files into the directories using a Python command on the console that Pycharm has built in.

    Please could someone tell me the Python console commands to create new directories in the package folders and the commands to create a new Python file for the directories.

    Thank you very much.
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,855
    Rep Power
    481
    In this example I use python to create a directory on my file system.
    Code:
    $ python
    Python 2.7.3 (default, Sep 26 2012, 21:51:14) 
    [GCC 4.7.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import os
    >>> os.mkdir(r'/tmp/delete_this_example_directory')
    >>>
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    2
    Rep Power
    0
    Originally Posted by b49P23TIvg
    In this example I use python to create a directory on my file system.
    Code:
    $ python
    Python 2.7.3 (default, Sep 26 2012, 21:51:14) 
    [GCC 4.7.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import os
    >>> os.mkdir(r'/tmp/delete_this_example_directory')
    >>>
    Thank you, it's greatly appreciated.

IMN logo majestic logo threadwatch logo seochat tools logo