Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80941

Re: import os

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <drsalists@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.012
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; '16,': 0.03; 'interfaces': 0.04; 'importing': 0.05; 'cc:addr:python-list': 0.11; 'language.': 0.14; 'mostly': 0.14; 'equivalents': 0.16; 'subject:import': 0.16; 'wrote:': 0.18; 'module': 0.19; 'dependent': 0.19; 'meant': 0.20; 'example': 0.22; 'cc:addr:gmail.com': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**1': 0.23; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; 'reply.': 0.31; 'breaking': 0.31; 'os,': 0.31; 'file': 0.32; 'probably': 0.32; 'another': 0.32; 'open': 0.33; 'operations': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'module.': 0.36; "didn't": 0.36; 'thanks': 0.36; 'operating': 0.37; 'level': 0.37; 'sometimes': 0.38; 'nov': 0.38; 'pm,': 0.38; 'anything': 0.39; 'does': 0.39; 'bad': 0.39; 'worry': 0.60; 'lower': 0.61; 'skip:o 30': 0.61; "you're": 0.61; 'more': 0.64; 'to:addr:gmail.com': 0.65
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=A8boAQoh/iSElsE5H5IlmLKaDL5z0mXloydQ4/JomnI=; b=q1b9MtJAn1LsiqKSej4DUBSznmIVYPQkURd2y/3whdVl8ZinsmmlevHmIfECiK1O3U FjyxE/Uukto1Zbx2vq0mk/Fnz5nkLwyjVm7BrN0boiBhX9vR3eh3pBpJ+XMQntx3veQ/ x/OZJLVGgM83AZHIkqOnyeXS92bGS/3PC2E0UMfijthCNa11d1UGEJDZWSeZcQi8buqg F9I/DEcllb7fEpSKa9Pv+YHf9j7GTWy+uR0RlThGhmzDCXIqg6t+y9GUDRiaVXwFu4Hu YvmcfitMk6d52rsAD6rj9aC8Sx1hZAjPHripAtIWlsWT2Z7XfflkyicSkDVPW8oywjd8 /u8A==
MIME-Version 1.0
X-Received by 10.152.22.194 with SMTP id g2mr23720562laf.33.1416186933382; Sun, 16 Nov 2014 17:15:33 -0800 (PST)
In-Reply-To <CAA+hu4Ve2iy7YwL2yFYW4eZY7U5sHrNZfoFWccJ_HxaAgcY86Q@mail.gmail.com>
References <CAA+hu4U97wO7G00Kdc917XJqJadGCVQEuLJgrO8SPH-NEvjpxQ@mail.gmail.com> <CAPTjJmrit1=EyBbD9tisf=vphmfxOFq8AFkXx7_Fqivqo4a2=g@mail.gmail.com> <CAA+hu4Ve2iy7YwL2yFYW4eZY7U5sHrNZfoFWccJ_HxaAgcY86Q@mail.gmail.com>
Date Sun, 16 Nov 2014 17:15:33 -0800
Subject Re: import os
From Dan Stromberg <drsalists@gmail.com>
To Abdul Abdul <abdul.sw84@gmail.com>
Content-Type text/plain; charset=UTF-8
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.15930.1416186941.18130.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1416186941 news.xs4all.nl 2860 [2001:888:2000:d::a6]:57611
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:80941

Show key headers only | View raw


On Sun, Nov 16, 2014 at 5:10 PM, Abdul Abdul <abdul.sw84@gmail.com> wrote:
> Thanks for your reply. Yes, I came across this page, but didn't understand
> what is meant by the operating system dependent functionality. What does
> that mean? Is importing that module that serious?

The os module has mostly lower level OS interfaces;  there are
sometimes higher level equivalents elsewhere in the language.

It's not bad to use os, but for EG, file operations
os.open/os.read/os.write/os.close, it's better to use "with open as
file_", file_.read, file_.write.

Another example is os.fork() - you can use it, but you're probably
better off with the subprocess module or the multiprocessing module.

You don't really have to worry about breaking anything by using the os
module - at least, not particularly more than the higher level
interfaces for the same thing.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: import os Dan Stromberg <drsalists@gmail.com> - 2014-11-16 17:15 -0800

csiph-web