Python Forum

Full Version: getting started, again
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Ok, following on from my intro post/s, as suggested to try the following
Quote:Welcome bluedoor5.
We have several tutorial on this forum that is updated and can help you on the way.
Python 3.6/3.7 and pip installation under Windows
Web-Scraping part-1
bluedoor5 Wrote:
I now have uninstalled everything, again. The last uninstall was the anaconda way.
Just as info you can have both Anaconda(my tutorial) and Python eg python.org Python 3.7 installed at same time the do not interfere.
I just answer a question about here.
"bluedoor5 Wrote:
I WILL PAY SOMEONE WHO UNDERTANDS WHAT RTFM IS, AND SET UP MY PC TO RUN A PYTHON SCRIPT",
No need to pay for answer(private) use the forum it's free as it always will be.
Try link i posted,have problems make a new Thread.

And

Quote:IDLE is still available, and still not very good. There are many IDE's available that are free and very good. VSCode and PyCharm are two of the better ones. If interested in VSCode, see https://code.visualstudio.com/
and : https://visualstudiomagazine.com/article...ython.aspx
It will run on any platform, and is very good
I used PyCharm for a long time and really liked it. I had some trouble using with virtual environment, but no problem with VS Code. Now myself, snippsat and others use VSCode.

See also snippsat's writeup here: https://python-forum.io/Thread-Need-some...telliSense

So I will get back to you when I have read everything, but after a clean up on the PC, I was left with various versions of Python, will post those version numbers soon, to use same or file away.

But hope this will be my own "get started from scratch" thread, hope others to may benefit.
Any further suggestions most welcomed

Thanks

Current versions of Python install for win 7 are

2 of
python-3.6.5

1 of
IDLE Lif 1.1-Py26

1 of
beautifulsoup4-4.6.0.tar
but seems corrupted, opens in word.doc only.

1 folder named:
dist
inside that folder a file named :
beautifulsoup4-4.6.0

and finally a pdf file named

conda-cheatsheet

They all did my head in !
Ok, have downloaded and installed the latest version
python-3.7.0 ( win 7 pro )

IDLE is on task bar, it will open a current .py file.
But the .py files on their menu bar don't associate Open With IDLE,
it's not there.

Secondly, I think it may not be installed right, directory to install was changed to C:\
Maybe I should have created a folder and installed inside that folder ?
C:\folder_name\ Python installed here ?
(Jul-13-2018, 09:06 AM)bluedoor5 Wrote: [ -> ]C:\folder_name\ Python installed here ?
You can choose folder like C:\python37 in follow Python 3.6/3.7 and pip installation under Windows

(Jul-13-2018, 05:32 AM)bluedoor5 Wrote: [ -> ]beautifulsoup4-4.6.0.tar
but seems corrupted, opens in word.doc only.
You use pip to install all Python modules/libraries.
That's why is important that you follow link over,and do test that pip work from anywhere in cmd.
cmd:
C:\>python -V
Python 3.7.0

C:\>pip -V
pip 10.0.1 from c:\python37\lib\site-packages\pip (python 3.7)

# Install BeautifulSoup 
C:\>pip install beautifulsoup4
Requirement already satisfied: beautifulsoup4 in c:\python37\lib\site-packages (4.6.0)

# Test that it work
C:\>python
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import bs4
>>> bs4.__version__
'4.6.0'
>>> 
Quote:1 of
IDLE Lif 1.1-Py26
IDLE is not good at all.

I will suggest maybe the easiest editors/IDE just to get started like PyScripter or Thonny.
Then later you should look at editors like VS Code(Free), PyCharm(free communty edtion).
My quick review a while back of VS Code.

Demo PyScripter you can just write code and Push run button,not even need to save.
Then in bottom you hav much better IDLE,where output will be and further testing can be done.
[Image: T4pDpR.jpg]
snippsat
Quote:You can choose folder like C:\python37 in follow Python 3.6/3.7 and pip installation under Windows

Yeah I missed that bit,
ok...Thanks
I been reading and practicing some stuff, but starting to see a bigger picture.

On the question of Librarys, I started to look into a few of them, there seems to be thousands complimented by their authors or script writers. So basically the way I'm starting to see it, instead of writing the same ol same ol scripts, just call a script from the library, right ?

If that is the case, looking at my current Excel VBA project that runs OK, eventually I can create my own set of .py Library scripts, and use my own folder to call those scripts ?
The goal is to move away entirely from Excel, even create my own GUI ?

Thanks
(Jul-16-2018, 10:00 PM)bluedoor5 Wrote: [ -> ]On the question of Librarys, I started to look into a few of them, there seems to be thousands complimented by their authors or script writers. So basically the way I'm starting to see it, instead of writing the same ol same ol scripts, just call a script from the library, right ?
Yes there are two main Standard Library(comes with Python) | PyPi(3-party library).

Standard Library:
>>> import math
>>> 
>>> # 8^2 in math
>>> math.pow(8, 2)
64.0
PyPi(here need to us pip to install)
Example Requests
pip install requests
>>> import requests
>>> 
>>> r = requests.get('https://www.python.org/')
>>> r.status_code
200
>>> r.encoding
'utf-8'
>>> r.headers['date']
'Mon, 16 Jul 2018 22:25:42 GMT'

Quote:If that is the case, looking at my current Excel VBA project that runs OK, eventually I can create my own set of .py Library scripts, and use my own folder to call those scripts ?
The goal is to move away entirely from Excel, even create my own GUI ?
Yes can create own small libraries and module/packages,there are som stuff to be learn if want to share with world like on PyPi.

There are many tools for Excel in Python like Pandas, openpyxl, pyexcel.
Pandas with Jupyter notebook is one of the strongest as you get a look similar to excel(can replace Excel all together).
Common Excel Tasks Demonstrated in Pandas
Python Excel Tutorial: The Definitive Guide
Quote:C:\python37>>>> import requests
> was unexpected at this time.

C:\python37>pip install requests
Collecting requests
Downloading https://files.pythonhosted.org/packages/...3db50ed6d8
a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl (9
1kB)
100% |████████████████████████████████| 92kB 738kB/s
Collecting urllib3<1.24,>=1.21.1 (from requests)
Downloading https://files.pythonhosted.org/packages/...071a4a32a5
e7cb78a1d92c53851ef4f56f62a3486e6a7d8ffb/urllib3-1.23-py2.py3-none-any.whl (133k
B)
100% |████████████████████████████████| 143kB 1.6MB/s
Collecting idna<2.8,>=2.5 (from requests)
Downloading https://files.pythonhosted.org/packages/...3caeb8a8c1
af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl (58kB)
100% |████████████████████████████████| 61kB 1.3MB/s
Collecting chardet<3.1.0,>=3.0.2 (from requests)
Downloading https://files.pythonhosted.org/packages/...2e4274b648
7b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133
kB)
100% |████████████████████████████████| 143kB 3.3MB/s
Collecting certifi>=2017.4.17 (from requests)
Downloading https://files.pythonhosted.org/packages/...92d846975f
c916b65f667c7b8c3a32bea7372340bfe9a15fa5/certifi-2018.4.16-py2.py3-none-any.whl
(150kB)
100% |████████████████████████████████| 153kB 2.2MB/s
Installing collected packages: urllib3, idna, chardet, certifi, requests
The script chardetect.exe is installed in 'c:\python37\Scripts' which is not o
n PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warn
ing, use --no-warn-script-location.
Successfully installed certifi-2018.4.16 chardet-3.0.4 idna-2.7 requests-2.19.1
urllib3-1.23

C:\python37>

OK, I un-installed everything, again.
Made new folder as suggested "Python37" and re-installed.
Instructions are a bit different for the 3.7 version only slightly, but ran the first script and copy/paste what is on the CMD screen.

Seems a lot cleaner to make that own folder.

I don't know what this part means though:

Quote:The script chardetect.exe is installed in 'c:\python37\Scripts' which is not o
n PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warn
ing, use --no-warn-script-location.
If you open a terminal, and run the following, what output do you get?
python -c "import requests; print(requests)"
If it's an error, then that might mean you should fix your PATH. If it's not, then you can ignore the PATH warning. That message is letting you know that the Scripts folder isn't on your PATH, and the PATH is how Windows knows where to look for files.
Quote:If you open a terminal, and run the following, what output do you get?

I get;

Quote:C:\python37>python -c "import requests; print(requests)"
<module 'requests' from 'C:\\python37\\lib\\site-packages\\requests\\__init__.py
'>

C:\python37>
Then your PATH is fine, and you can ignore the warning :)
Pages: 1 2