Re: [Tutor] Beginners Book, Python and PyScripter

2018-12-05 Thread Steven D'Aprano
On Wed, Dec 05, 2018 at 08:44:14AM +, Alan Gauld via Tutor wrote:
> On 04/12/2018 23:52, James Stapleton-Cotton wrote:
> 
> > USERs-MacBook-Pro:~ user$ python hello.py
> > python: can't open file 'hello.py': [Errno 2] No such file or directory
> 
> You need to provide the full path to the Python file.
> 
> > I previously created a python file called 'hello.py' using the PyCharmEdu
> > editor (as instructed). This file is saved in my 'Documents' in a folder
> > called 'Pycharm Projects' 
> 
> So you would have needed to type
> 
> user$ python "~/Documents/Pycharm Projects/hello.py"

To be absolutely clear here, the "user$" part is the prompt, you don't 
type that.



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


Re: [Tutor] Beginners Book, Python and PyScripter

2018-12-05 Thread Alan Gauld via Tutor
On 04/12/2018 23:52, James Stapleton-Cotton wrote:

> USERs-MacBook-Pro:~ user$ python hello.py
> python: can't open file 'hello.py': [Errno 2] No such file or directory

You need to provide the full path to the Python file.

> I previously created a python file called 'hello.py' using the PyCharmEdu
> editor (as instructed). This file is saved in my 'Documents' in a folder
> called 'Pycharm Projects' 

So you would have needed to type

user$ python "~/Documents/Pycharm Projects/hello.py"

> to the original, 'PycharmProjects'.]

Note that here you omit the space.
The OS is very particular about such details, you need
to get it exactly right. (Although in bash using the
tab key will usually fill things in the way you need it)

> 'hello.py' file into the tmp folder and attempted the above process of
> 'running' the 'python hello.py' file from the terminal, however the same
> result occurred.

Again you needthe patg:

user$ python /tmp/py/hello.py

The other option is to change directory to where the code is and then
just specify the name:

user$ cd /tmp/py
user$ python hello.py

Should work too.

-- 
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] Beginners Book, Python and PyScripter

2018-12-05 Thread James Stapleton-Cotton
Thank you Adam.
I am currently going through the book, 'A Byte of Python' - found here -
https://python.swaroopch.com.
On pages 29-30 it writes about 'Using A Source File', creating a file
called '/tmp/py' on a Mac OS using the 'bash-terminal' and running the
saved PyCharm file, 'hello.py'. I type 'mkdir /tmp/py' into the terminal
and press return. This supposedly creates a new folder. I type 'mkdir
/tmp/py' a second time and press return as so:

USERs-MacBook-Pro:~ user$ mkdir /tmp/py

mkdir: /tmp/py: File exists


This shows that the file is indeed created and 'exists'. In the next
instructed step (typing 'python hello.py' into the terminal) there shows an
error as such:

USERs-MacBook-Pro:~ user$ mkdir /tmp/py

mkdir: /tmp/py: File exists

USERs-MacBook-Pro:~ user$ python hello.py
python: can't open file 'hello.py': [Errno 2] No such file or directory

I previously created a python file called 'hello.py' using the PyCharmEdu
editor (as instructed). This file is saved in my 'Documents' in a folder
called 'Pycharm Projects' [I tried changing the location of the file to
'/tmp/py', however this created an error during my 'print' function -
print("hello world") - in the editor, therefore I changed the location back
to the original, 'PycharmProjects'.]

I have found the /tmp/py folder within my 'Users' folder. I dragged the
'hello.py' file into the tmp folder and attempted the above process of
'running' the 'python hello.py' file from the terminal, however the same
result occurred.

Could you please help clarify where I am going wrong in the instructed
process given by the book mentioned above.

Regards

On Tue, Dec 4, 2018 at 9:16 PM Adam Eyring  wrote:

> I haven't gone through many python books, but have been using a copy of
> Automating the Boring Stuff with Python. It covers lists, dictionaries,
> scraping data from websites, etc.
> https://automatetheboringstuff.com/
> The PDF is free.
>
> Adam
>
> On Tue, Dec 4, 2018 at 1:09 PM James Stapleton-Cotton 
> wrote:
>
>> Thank you Mats and Steven. I'm back on track now with a different tutorial
>> which has lead to me to the relevant coding tools.
>> https://wiki.python.org/moin/BeginnersGuide/NonProgrammers
>> https://python.swaroopch.com
>>
>> On Mon, Dec 3, 2018 at 4:04 PM Mats Wichmann  wrote:
>>
>> > On 12/3/18 3:35 AM, James Stapleton-Cotton wrote:
>> > > Hello,
>> > >
>> > > On this page (
>> > >
>> >
>> http://openbookproject.net/thinkcs/python/english3e/way_of_the_program.html
>> > )
>> > > - a book for learning Computer Science using Python - I am directed
>> to (
>> > > http://code.google.com/p/pyscripter) in order to access the
>> appropriate
>> > > program development environment, PyScripter. I have downloaded the
>> latest
>> > > version of Python from Python.org and PyScripter from a site that I am
>> > > directed to from the original site mentioned in the beginning of this
>> > email
>> > > - (https://sourceforge.net/projects/pyscripter/files/), however I
>> can't
>> > > seem to be able to run PyScripter on my Mac.
>> >
>> > it looks like from the project's own description that PyScripter is
>> > intended solely for the Windows environment.
>> >
>> > But there are a TON of other IDE products, free and commercial, out
>> > there, many of which do run on the Mac.
>> >
>> > This may be information overload, but try looking here:
>> >
>> > https://wiki.python.org/moin/IntegratedDevelopmentEnvironments
>> >
>> >
>> > ___
>> > Tutor maillist  -  Tutor@python.org
>> > To unsubscribe or change subscription options:
>> > https://mail.python.org/mailman/listinfo/tutor
>> >
>> ___
>> Tutor maillist  -  Tutor@python.org
>> To unsubscribe or change subscription options:
>> https://mail.python.org/mailman/listinfo/tutor
>>
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Beginners Book, Python and PyScripter

2018-12-04 Thread Adam Eyring
I haven't gone through many python books, but have been using a copy of
Automating the Boring Stuff with Python. It covers lists, dictionaries,
scraping data from websites, etc.
https://automatetheboringstuff.com/
The PDF is free.

Adam

On Tue, Dec 4, 2018 at 1:09 PM James Stapleton-Cotton 
wrote:

> Thank you Mats and Steven. I'm back on track now with a different tutorial
> which has lead to me to the relevant coding tools.
> https://wiki.python.org/moin/BeginnersGuide/NonProgrammers
> https://python.swaroopch.com
>
> On Mon, Dec 3, 2018 at 4:04 PM Mats Wichmann  wrote:
>
> > On 12/3/18 3:35 AM, James Stapleton-Cotton wrote:
> > > Hello,
> > >
> > > On this page (
> > >
> >
> http://openbookproject.net/thinkcs/python/english3e/way_of_the_program.html
> > )
> > > - a book for learning Computer Science using Python - I am directed to
> (
> > > http://code.google.com/p/pyscripter) in order to access the
> appropriate
> > > program development environment, PyScripter. I have downloaded the
> latest
> > > version of Python from Python.org and PyScripter from a site that I am
> > > directed to from the original site mentioned in the beginning of this
> > email
> > > - (https://sourceforge.net/projects/pyscripter/files/), however I
> can't
> > > seem to be able to run PyScripter on my Mac.
> >
> > it looks like from the project's own description that PyScripter is
> > intended solely for the Windows environment.
> >
> > But there are a TON of other IDE products, free and commercial, out
> > there, many of which do run on the Mac.
> >
> > This may be information overload, but try looking here:
> >
> > https://wiki.python.org/moin/IntegratedDevelopmentEnvironments
> >
> >
> > ___
> > Tutor maillist  -  Tutor@python.org
> > To unsubscribe or change subscription options:
> > https://mail.python.org/mailman/listinfo/tutor
> >
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Beginners Book, Python and PyScripter

2018-12-04 Thread James Stapleton-Cotton
Thank you Mats and Steven. I'm back on track now with a different tutorial
which has lead to me to the relevant coding tools.
https://wiki.python.org/moin/BeginnersGuide/NonProgrammers
https://python.swaroopch.com

On Mon, Dec 3, 2018 at 4:04 PM Mats Wichmann  wrote:

> On 12/3/18 3:35 AM, James Stapleton-Cotton wrote:
> > Hello,
> >
> > On this page (
> >
> http://openbookproject.net/thinkcs/python/english3e/way_of_the_program.html
> )
> > - a book for learning Computer Science using Python - I am directed to (
> > http://code.google.com/p/pyscripter) in order to access the appropriate
> > program development environment, PyScripter. I have downloaded the latest
> > version of Python from Python.org and PyScripter from a site that I am
> > directed to from the original site mentioned in the beginning of this
> email
> > - (https://sourceforge.net/projects/pyscripter/files/), however I can't
> > seem to be able to run PyScripter on my Mac.
>
> it looks like from the project's own description that PyScripter is
> intended solely for the Windows environment.
>
> But there are a TON of other IDE products, free and commercial, out
> there, many of which do run on the Mac.
>
> This may be information overload, but try looking here:
>
> https://wiki.python.org/moin/IntegratedDevelopmentEnvironments
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Beginners Book, Python and PyScripter

2018-12-03 Thread Mats Wichmann
On 12/3/18 3:35 AM, James Stapleton-Cotton wrote:
> Hello,
> 
> On this page (
> http://openbookproject.net/thinkcs/python/english3e/way_of_the_program.html)
> - a book for learning Computer Science using Python - I am directed to (
> http://code.google.com/p/pyscripter) in order to access the appropriate
> program development environment, PyScripter. I have downloaded the latest
> version of Python from Python.org and PyScripter from a site that I am
> directed to from the original site mentioned in the beginning of this email
> - (https://sourceforge.net/projects/pyscripter/files/), however I can't
> seem to be able to run PyScripter on my Mac.

it looks like from the project's own description that PyScripter is
intended solely for the Windows environment.

But there are a TON of other IDE products, free and commercial, out
there, many of which do run on the Mac.

This may be information overload, but try looking here:

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


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


Re: [Tutor] Beginners Book, Python and PyScripter

2018-12-03 Thread Steven D'Aprano
Hi James, and welcome.

On Mon, Dec 03, 2018 at 12:35:29PM +0200, James Stapleton-Cotton wrote:
[...]
> I have downloaded the latest
> version of Python from Python.org and PyScripter from a site that I am
> directed to from the original site mentioned in the beginning of this email
> - (https://sourceforge.net/projects/pyscripter/files/), however I can't
> seem to be able to run PyScripter on my Mac.
> The only file that opens is the Python Shell. I am really confused as to
> whether or not PyScripter works on Mac OS or if I'm missing a step in the
> installation process?

I don't think there are a lot of Mac experts here, but let's see what we 
can do...

You say "the only file that opens is the Python Shell", but you don't 
tell us *precisely* what you did to get it to open. Go through it step 
by step, e.g. if you were a Windows user you might say:

"I clicked on the Start Menu, click on PyScripter, the shell opens"

"I right-clicked on a .py file and choose Open from the menu"

"I double-clicked a .py file on the desktop"

etc. If any of the steps are Mac-specific, you might need to go into a 
bit more detail, but we generally understand things like double- 
clicking, control-click to get the context menu, etc.

When you say "the Python Shell", you are probably seeing a text-based 
console that starts with something similar to this:

Python 3.5.2 (default, Oct 12 2016, 10:47:40)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-55)] on linux
Type "help", "copyright", "credits" or "license" for more information.


(the details will be different, of course) and then presents you with a 
prompt >>> where you can type commands. Is this correct?

If not, please explain what you get.

Don't bother with a screen shot at this stage: they're not helpful to 
those who are visually impaired or blind (screen readers can't work with 
them) and this mailing list will strip them out of your email. You ought 
to be able to copy any visible text in the shell and paste it into your 
email, if necessary.

Another test you can do is to open the Terminal from Mac OS (I think it 
is found under Applications → Utilities → Terminal) and then enter the 
command "pyscripter" (without the quotes) at the $ or % prompt. What 
happens?

(If you get an error, please copy and paste the entire error, including 
the command you entered. Don't try to summarise it or retype it from 
memory.)


P.S. when replying, reply to the list, not to me personally.


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