Re: [Tutor] Import error, no module named app script

2019-03-21 Thread Mats Wichmann
On 3/21/19 5:00 PM, nathan tech wrote:
> Hi guys,
> So I recently begun using Mac to program in python.
> For one of the modules I am going to be using, it calls app script in order 
> to send commands to voiceover, which is a screen reader for the MAC.
> The only problem is, it gives an error about no module named appscript. 
> Indeed, when I go into the python command and try import appscript, it says 
> no module named appscript.
> I tried pip install apscript, but it said requirement already satissfied.
> Hoping someone can help.
> Nate

You seem to have a disagreement in spelling - apscript vs. appscript. We
can't tell if that is just a transcription error on your part.

I'd be a bit discouraged by this page:

http://appscript.sourceforge.net/

which says rather loudly:

Please note that appscript is no longer developed or supported, and its
use is not recommended for new projects.


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


[Tutor] Import error, no module named app script

2019-03-21 Thread nathan tech
Hi guys,
So I recently begun using Mac to program in python.
For one of the modules I am going to be using, it calls app script in order to 
send commands to voiceover, which is a screen reader for the MAC.
The only problem is, it gives an error about no module named appscript. Indeed, 
when I go into the python command and try import appscript, it says no module 
named appscript.
I tried pip install apscript, but it said requirement already satissfied.
Hoping someone can help.
Nate
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] LPTHW ex15 question

2019-03-21 Thread Mats Wichmann
On 3/21/19 2:42 PM, Alan Gauld via Tutor wrote:
> On 21/03/19 12:43, Jones, Kayla wrote:
>> ...getting an error message in powershell that I can't figure out. >
>> I've attached a screenshot to help.  Any suggestions would be 
> appreciated.
> 
> First suggestion is not to send images as attachments since
> the server strips them out as potential security risks.
> 
> Instead copy and paste the text into the mail message.
> 
> Also don't assume we know what the book or exercise are about.
> You need to tell us.

I presume the acronym is Learn Python The Hard Way, which many of us
don't have (I do not)
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] LPTHW ex15 question

2019-03-21 Thread DL Neil

Kayla,

On 22/03/19 1:43 AM, Jones, Kayla wrote:

I am working through excersise 15 of LPTHW and am getting an error message in 
powershell that I can't figure out. I've attached a screenshot to help.  Any 
suggestions would be appreciated.



Attachments don't seem to work on the mailing list.

Plus, if you copy-paste code (and errmsgs) then we can do the same!
(to reproduce the problem/save time coding a fix)


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


Re: [Tutor] LPTHW ex15 question

2019-03-21 Thread Alan Gauld via Tutor

On 21/03/19 12:43, Jones, Kayla wrote:
...getting an error message in powershell that I can't figure out. > I've attached a screenshot to help.  Any suggestions would be 

appreciated.

First suggestion is not to send images as attachments since
the server strips them out as potential security risks.

Instead copy and paste the text into the mail message.

Also don't assume we know what the book or exercise are about.
You need to tell us.

Alan G.

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


Re: [Tutor] is there a graphics library for common tkinter Button functions?

2019-03-21 Thread Albert-Jan Roskam



On 21 Mar 2019 12:11, Alan Gauld via Tutor  wrote:

On 21/03/19 00:28, Chris Roy-Smith wrote:

> Yes I knew that buttons need a function to do anything.
>
> I was hoping that the wheel didn't need re-inventing.

===>> A few are available: 
https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/bitmaps.html. But you 
could use Material Design: https://material.io/tools/icons/?style=baseline



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


[Tutor] LPTHW ex15 question

2019-03-21 Thread Jones, Kayla
I am working through excersise 15 of LPTHW and am getting an error message in 
powershell that I can't figure out. I've attached a screenshot to help.  Any 
suggestions would be appreciated.


Kayla J.





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


Re: [Tutor] error message

2019-03-21 Thread Alan Gauld via Tutor

On 21/03/19 05:13, Glenn Dickerson wrote:

Thank you for all of your responses to:

class Student():
 def__init__(self, name, major, gpa, is_on_probation):
 self.name = name
 self.major = major
 self.gpa = gpa
 self.is_on_probation = is_on_probation



Presumably the lines above ar in a separate file called Student.py?

And the lines below are in another file  called app.py?

If so thats a good start.
Steve (and others have already pointed out the need for a space after 
def (otherwise python looks for a function called def__init__() and 
wonderswhy yu have a colon after its  invocation)


But that will only lead you to the next error.


import Student
student1 = Student('Jim', 'Business', 3.1, False)


When accessing an object in an imported module you must precede
the object's name with the module:

student1 = Student.Student() # Student class in the Student module

Alternatively you can explicitly import the Student class (and nothing 
else!) from Student with:


from Student import Student

I which case you can use it as you do in your code.
In your case it doesn't really matter which of the two styles
you choose. In more complex programs explicit module naming
might make your code clearer (eg. if you have many modules).
Alternatively, pulling in the specific object might save
you some typing if you reference the object several times.
You need to choose which is most appropriate based on your code.

HTH

Alan G.

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


Re: [Tutor] is there a graphics library for common tkinter Button functions?

2019-03-21 Thread Alan Gauld via Tutor

On 21/03/19 00:28, Chris Roy-Smith wrote:


Yes I knew that buttons need a function to do anything.

I was hoping that the wheel didn't need re-inventing.


So far as the button images go a Google search should
throw up lots of free icons you can use and a program


like ImageMagick can resize and change format as needed.

As for assigning them its trivial:

bmps = "/path/to/your/images/"

bUp = tk.Button(parent, image=bmps+"up.bmp", command=doUp)


HTH

Alan G.

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


Re: [Tutor] error message

2019-03-21 Thread Steven D'Aprano
> I don't understand this error message. Thank you so much, Glenn Dickerson
> 
> Traceback (most recent call last):
>   File "/home/glen/app.py", line 1, in 
> import Student
>   File "/home/glen/Student.py", line 2
> def__init__(self, name, major, gpa, is_on_probation):
> ^
> SyntaxError: invalid syntax


Syntax errors are sometimes the hardest to decipher, because the message 
is usually pretty generic and uninformative, and the caret ^ will appear 
where the interpreter *notices* the problem, not where the problem 
*starts*.

In this case, the problem is you are missing a space between the "def" 
keyword and the "__init__" method name.


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


[Tutor] error message

2019-03-21 Thread Glenn Dickerson
Thank you for all of your responses to:

class Student():
def__init__(self, name, major, gpa, is_on_probation):
self.name = name
self.major = major
self.gpa = gpa
self.is_on_probation = is_on_probation


import Student
student1 = Student('Jim', 'Business', 3.1, False)
print(student1.name)

I don't understand this error message. Thank you so much, Glenn Dickerson

Traceback (most recent call last):
  File "/home/glen/app.py", line 1, in 
import Student
  File "/home/glen/Student.py", line 2
def__init__(self, name, major, gpa, is_on_probation):
^
SyntaxError: invalid syntax
>>>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] my gmail of 5 minutes ago

2019-03-21 Thread Glenn Dickerson
I am using Linux Mint 18.3 and Python 3.5.
Thank you, Glenn Dickerson
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] is there a graphics library for common tkinter Button functions?

2019-03-21 Thread Chris Roy-Smith

On 21/3/19 10:19 am, Alan Gauld via Tutor wrote:

On 20/03/19 22:43, Chris Roy-Smith wrote:
Is there a "graphics library" of common button uses? that is things 
like forward record, back record, 1st record, last record, printer, 
save and the likes.


The short answer is no. But you can assign any bitmap image
to a button. (You can use other formats too but bitmaps are
easiest in my experience!)

But putting an image on the button does not give it any
functionality. You need to program that yourself.

HTH,

Alan G.

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


Thanks Alan,

Yes I knew that buttons need a function to do anything.

I was hoping that the wheel didn't need re-inventing.

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