Re: [Tutor] Tutor Digest, Vol 163, Issue 28

2017-09-19 Thread Alan Gauld via Tutor
On 19/09/17 15:45, Saahndong Ransom wrote:
> What are the uses of python?
> What are easy way to learn python?

Python is a general purpose programming language
that can be used to build many kinds of software
applications from computer administration to web
servers to desktop GUI applications.

The Python wiki is the bet place to start, it
provides many different tutorials depending on
your level of existing knowledge about programming.

https://wiki.python.org/moin/BeginnersGuide

If you are a complete beginner you might like my
tutorial, linked below.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Tutor Digest, Vol 163, Issue 28

2017-09-19 Thread Saahndong Ransom
What are the uses of python?
What are easy way to learn python?

On Sep 19, 2017 15:07,  wrote:

Send Tutor mailing list submissions to
tutor@python.org

To subscribe or unsubscribe via the World Wide Web, visit
https://mail.python.org/mailman/listinfo/tutor
or, via email, send a message with subject or body 'help' to
tutor-requ...@python.org

You can reach the person managing the list at
tutor-ow...@python.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Tutor digest..."

Today's Topics:

   1. pip install of subprocess module (Derek Smith)
   2. Re: pip install of subprocess module (Alan Gauld)
   3. Require help for a script (Clara Chua)
   4. Re: Require help for a script (Alan Gauld)
   5. Re: Require help for a script (D.V.N.Sarma ??.??.???.)


-- Forwarded message --
From: Derek Smith 
To: "tutor@python.org" 
Cc:
Bcc:
Date: Mon, 18 Sep 2017 17:59:39 +
Subject: [Tutor] pip install of subprocess module
Hi All,

Thank for the recent replies.  I want to use the subprocess.run module b/c
per the docs os.system is antiquated and cannot use  more than 1 arg in 3.6.
Why am I doing wrong below?  Also couldn't I just copy and paste the
subprocess code from github and create a file, but then how do I tell
python this is a new module called os.system since this py file requires
os.system and os.spawn*
I am on AIX 7.1, python 3.6.2, pip 9.0.1

Thx agn!

# pip install git+https://github.com/python/cpython/blob/3.6/Lib/
subprocess.py -vvv
Collecting git+https://github.com/python/cpython/blob/3.6/Lib/subprocess.py
  Cloning https://github.com/python/cpython/blob/3.6/Lib/subprocess.py to
/tmp/pip-bw8rryo9-build
  Running command git clone -q https://github.com/python/
cpython/blob/3.6/Lib/subprocess.py /tmp/pip-bw8rryo9-build
remote: Not Found
fatal: repository 'https://github.com/python/cpython/blob/3.6/Lib/
subprocess.py/' not found
Cleaning up...
Command "git clone -q https://github.com/python/cpython/blob/3.6/Lib/
subprocess.py /tmp/pip-bw8rryo9-build" failed with error code 128 in None
Exception information:
Traceback (most recent call last):
  File "/opt/freeware/lib/python3.6/site-packages/pip/basecommand.py", line
215, in main
status = self.run(options, args)
  File "/opt/freeware/lib/python3.6/site-packages/pip/commands/install.py",
line 335, in run
wb.build(autobuilding=True)
  File "/opt/freeware/lib/python3.6/site-packages/pip/wheel.py", line 749,
in build
self.requirement_set.prepare_files(self.finder)
  File "/opt/freeware/lib/python3.6/site-packages/pip/req/req_set.py", line
380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
  File "/opt/freeware/lib/python3.6/site-packages/pip/req/req_set.py", line
620, in _prepare_file
session=self.session, hashes=hashes)
  File "/opt/freeware/lib/python3.6/site-packages/pip/download.py", line
805, in unpack_url
unpack_vcs_link(link, location)
  File "/opt/freeware/lib/python3.6/site-packages/pip/download.py", line
479, in unpack_vcs_link
vcs_backend.unpack(location)
  File "/opt/freeware/lib/python3.6/site-packages/pip/vcs/__init__.py",
line 286, in unpack
self.obtain(location)
  File "/opt/freeware/lib/python3.6/site-packages/pip/vcs/git.py", line
142, in obtain
self.run_command(['clone', '-q', url, dest])
  File "/opt/freeware/lib/python3.6/site-packages/pip/vcs/__init__.py",
line 325, in run_command
spinner)
  File "/opt/freeware/lib/python3.6/site-packages/pip/utils/__init__.py",
line 707, in call_subprocess
% (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command "git clone -q
https://github.com/python/cpython/blob/3.6/Lib/subprocess.py
/tmp/pip-bw8rryo9-build" failed with error code 128 in None



Derek Smith  |  Unix/TSM Administrator  | Racksquared Data Centers
::  dereksm...@racksquared.com  *: www.racksquared.com |  www.racksquared.jobs

[cid:image003.png@01D2E9AA.1B9CF8F0]




-- Forwarded message --
From: Alan Gauld 
To: tutor@python.org
Cc:
Bcc:
Date: Mon, 18 Sep 2017 23:24:31 +0100
Subject: Re: [Tutor] pip install of subprocess module
On 18/09/17 18:59, Derek Smith wrote:

> I want to use the subprocess.run module b/c per the> docs os.system is
antiquated

Its not so much antiquated but it is deprecated because
it is severely limited, all you get back is an error code.

> Why am I doing wrong below?

You are trying to install it, but subprocess is part
of the standard library, it should already be installoed.

Just use the >>> prompt and try

>>> import subprocess

If you don't get an error then its already there.

> python this is a new module called os.system

subprocess is its own moduile it is not part of os.

import os
import subprocess

> since this py file requires os.system and os.spawn*

Both of those can be replaced