[Tutor] Beginners Book, Python and PyScripter

James Stapleton-Cotton jstapcot at gmail.com
Tue Dec 4 18:52:47 EST 2018


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 <adameyring at gmail.com> 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 <jstapcot at gmail.com>
> 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 <mats at wichmann.us> 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 at python.org
>> > To unsubscribe or change subscription options:
>> > https://mail.python.org/mailman/listinfo/tutor
>> >
>> _______________________________________________
>> Tutor maillist  -  Tutor at python.org
>> To unsubscribe or change subscription options:
>> https://mail.python.org/mailman/listinfo/tutor
>>
>


More information about the Tutor mailing list