mailr28179 - /trunk/lib/system.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by tlinnet on April 02, 2016 - 14:12:
Author: tlinnet
Date: Sat Apr  2 14:12:25 2016
New Revision: 28179

URL: http://svn.gna.org/viewcvs/relax?rev=28179&view=rev
Log:
Adding a new lib.system,.pwd() function, to print and return the current 
working directory.

Modified:
    trunk/lib/system.py

Modified: trunk/lib/system.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/system.py?rev=28179&r1=28178&r2=28179&view=diff
==============================================================================
--- trunk/lib/system.py (original)
+++ trunk/lib/system.py Sat Apr  2 14:12:25 2016
@@ -50,3 +50,19 @@
 
     # Print current working directory.
     print("The current working directory is now changed to: %s"%getcwd())
+
+
+def pwd():
+    """Print and return string of the current working directory.  Equivalent 
of python module os.getcwd(). 
+
+    @return:            Path to the current working directory.
+    @rtype:             str
+    """
+
+    # Get the current working directory.
+    cwd = getcwd()
+
+    # Print previous current working directory.
+    print("The current working directory is: %s"%cwd)
+
+    return cwd




Related Messages


Powered by MHonArc, Updated Sat Apr 02 14:20:07 2016