Re: python on Linux

2014-10-10 Thread Chris Angelico
On Sat, Oct 11, 2014 at 2:44 AM, Peter Pearson wrote: > On Fri, 10 Oct 2014 08:31:04 +0200, Irmen de Jong wrote: >> On 10-10-2014 6:21, Igor Korot wrote: > >>> When I am on Windows, I can write something like this: >>> >>> sys.path.append('C:\Users\Igor\Documents\MyLib') >> >> While this might wor

Re: python on Linux

2014-10-10 Thread Ian Kelly
On Fri, Oct 10, 2014 at 12:31 AM, Irmen de Jong wrote: > - you need to escape the backslashes (or just use forward slashes, they work > on windows too) Or use a raw string. There is usually no reason to have escape sequences at all in a file system path. -- https://mail.python.org/mailman/listi

Re: python on Linux

2014-10-10 Thread Peter Pearson
On Fri, 10 Oct 2014 08:31:04 +0200, Irmen de Jong wrote: > On 10-10-2014 6:21, Igor Korot wrote: >> When I am on Windows, I can write something like this: >> >> sys.path.append('C:\Users\Igor\Documents\MyLib') > > While this might work on your system, it may not work on others. > > - you need to

Re: python on Linux

2014-10-10 Thread Irmen de Jong
On 10-10-2014 8:58, Chris Angelico wrote: > AIUI you can use os.path.expanduser() on Windows as well, and it'll > take care of USERPROFILE. Nice, didn't know that! I've been using the appdirs module (https://pypi.python.org/pypi/appdirs/) as well to avoid constructing paths manually altogether.

Re: python on Linux

2014-10-10 Thread Chris Angelico
On Fri, Oct 10, 2014 at 5:31 PM, Irmen de Jong wrote: > On 10-10-2014 6:21, Igor Korot wrote: >> Hi, ALL, >> When I am on Windows, I can write something like this: >> >> sys.path.append('C:\Users\Igor\Documents\MyLib') > > While this might work on your system, it may not work on others. > > - you

Re: python on Linux

2014-10-09 Thread Irmen de Jong
On 10-10-2014 6:21, Igor Korot wrote: > Hi, ALL, > When I am on Windows, I can write something like this: > > sys.path.append('C:\Users\Igor\Documents\MyLib') While this might work on your system, it may not work on others. - you need to escape the backslashes (or just use forward slashes, they

Re: python on Linux

2014-10-09 Thread John Gordon
In Igor Korot writes: > sys.path.append('~/MyLib') > I.e., will '~' sign be expanded correctly? Not as written. Use os.path.expanduser() to get user's home directories. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a

Re: python on Linux

2014-10-09 Thread Dan Stromberg
Try: sys.path.append(os.path.expanduser('~/MyLib')) On Thu, Oct 9, 2014 at 9:21 PM, Igor Korot wrote: > Hi, ALL, > When I am on Windows, I can write something like this: > > sys.path.append('C:\Users\Igor\Documents\MyLib') > > Now, when I'm on Linux, can I do this: > > sys.path.append('~/MyLib')

Re: Python on linux

2005-11-18 Thread Sybren Stuvel
John Abel enlightened us with: > Here's one I used a while back. Returns a dict containing details per > partition This only gives information about actually mounted partitions. It could be improved by checking /proc/partitions as well. Sybren -- The problem with the world is stupidity. Not sa

Re: Python on linux

2005-11-18 Thread [EMAIL PROTECTED]
Partitioning a hard disk on linux can be done with parted, see http://www.gnu.org/software/parted/parted.html - I don't know how good the python-pated interface is, and what it's capable of -- http://mail.python.org/mailman/listinfo/python-list

Re: Python on linux

2005-11-18 Thread John Abel
Here's one I used a while back. Returns a dict containing details per partition def _getAvailPartitions(): validTypes = [ 'ufs', 'nfs', 'reiserfs' ] mntTab = file( '/etc/mtab', 'r' ) drvDetails = {} for mntLine in mntTab: splitLine = mntLine.split()

Re: Python on linux

2005-11-18 Thread Lars Kellogg-Stedman
> Hi i wanted to know how can i find disk size on linux platform using > python. You could use python to drive the 'sfdisk' command through a pipe, which will probably do much of what you want. -- Lars -- Lars Kellogg-Stedman <[EMAIL PROTECTED]> This email address will expire on 2005-11-23. --

Re: Python on Linux

2004-12-28 Thread Tim Roberts
"Austin" <[EMAIL PROTECTED]> wrote: > >On Red Hat 9, Python is installed by default and it's version is 2.2.2 >If I want to upgrade Python to 2.3.4(newer version), how could I do? >If I compile source code of Python, how do I uninstall the old version? You don't want to uninstall the old version.

Re: Python on Linux

2004-12-27 Thread Philippe C. Martin
>> On Red Hat 9, Python is installed by default and it's version is 2.2.2 >> If I want to upgrade Python to 2.3.4(newer version), how could I do? >> If I compile source code of Python, how do I uninstall the old version? >> I tried rpm packages but failed with dependence. >I didn't try the rpm's.

Re: Python on Linux

2004-12-26 Thread Nick Coghlan
Paul Rubin wrote: "Austin" <[EMAIL PROTECTED]> writes: On Red Hat 9, Python is installed by default and it's version is 2.2.2 If I want to upgrade Python to 2.3.4(newer version), how could I do? If I compile source code of Python, how do I uninstall the old version? I tried rpm packages but failed

Re: Python on Linux

2004-12-26 Thread Paul Rubin
"Austin" <[EMAIL PROTECTED]> writes: > On Red Hat 9, Python is installed by default and it's version is 2.2.2 > If I want to upgrade Python to 2.3.4(newer version), how could I do? > If I compile source code of Python, how do I uninstall the old version? > I tried rpm packages but failed with depen

Re: Python on Linux Cluster

2004-12-23 Thread Irmen de Jong
Gurpreet Sachdeva wrote: I have shifted my python script on a 4 node open ssi cluster. Please guide me what changes do I have to do in my python scripts to fully utilize the cluster. How do we introduce parralel processing in python??? There was a very recent thread about this subject: http://tinyu