Re: [Tutor] Design question: Web-based vs. desktop-based vs. desktop-based with data backed up to web server with a tablet thrown in for all cases?

2015-07-18 Thread Steven D'Aprano
On Sun, Jul 19, 2015 at 12:49:50AM -0500, boB Stepp wrote:

> In this thread, I kept it very general on purpose.  I was probing this
> community for their thoughts on two things:  1)  Should I make the
> software web-based or desktop-based?  2) What would be the best way of
> handling the data involved, particularly the data that impinges on
> student privacy concerns.

Not to be a wet blanket, but this is way off-topic for this mailing 
list. However, you're a regular in good standing, and we don't have a 
strict rule about staying on-topic (such rules are tiresome and annoying 
if they allow for no exceptions), so let's go with it.

I would start with the simplest thing that can work. With an initial 
user-base of one person, especially one who is quite computer 
literate, you don't have to worry about backwards compatibility and can 
feel free to experiment and expand the software as needed.

So I would start with something that just runs on the local machine. 
Since your missus intends to use a tablet, you may want to investigate 
Kivy for your GUI needs.

http://kivy.org/

I'm not sure if it runs on Macs, but it should work on Android, Windows, 
and Linux, and of course it is entire Python-based.

Once you have a proof-of-concept working for your one user, then you can 
consider how to expand on it by moving the data to a server and possibly 
giving access to others.

In the meantime, keep everything on the local machine. Take backups of 
the data by exporting to some sort of regular file which can be zipped 
up and copied onto a USB stick and locked in a safe. You might consider 
an encrypted file system if the data is particularly sensitive. But 
that's a separate issue from the application itself.

If you use SQLite for the data storage, it should have a simple "dump" 
function that would let you export the database to a standard SQL dump 
format, and reconstruct the database from said dump if needed. Otherwise 
you would have to write your own export/import routines.

If you make the decision to provide multi-user access, then you have a 
large number of problems to deal with:

- security of the database server;
- access to the database itself;
- what to do if the link between the app and the database goes down?
- user authentication and permissions (you don't want little Freddy
  changing his grades, or accessing other people's records);

etc. Why deal with those things from Day One if you only have one user? 
You don't even know if this application is going to be useful. Start 
with a proof of concept to prove that it is worth the extra effort. 
Perhaps your wife will decide that the application isn't useful at all, 
or that it is useful, but it can remain a single person app and no 
shared database is needed. But you won't know until you have something 
to actually experiment with.



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


Re: [Tutor] Design question: Web-based vs. desktop-based vs. desktop-based with data backed up to web server with a tablet thrown in for all cases?

2015-07-18 Thread boB Stepp
On Sat, Jul 18, 2015 at 4:58 PM, Brandon McCaig  wrote:

> Rather than worrying about technology, frameworks, peripherals,
> and protocols you need to focus on the real problem. Have her
> describe exactly what she'll do with it. Try to get her to put it
> into context of what she does NOW without the software so that
> you can compare. I'm 29 years old so I've been away from school
> for a long time. I don't know what teachers are using computers
> for these days, but I cannot imagine it being useful to walk
> around the classroom with a tablet (if anything I don't think I'd
> want my children's teachers having such a distraction). At least,
> not so useful as to commission the development of custom
> software. I'm also not familiar with what a Montessori teacher
> does, but it sounds even less likely that custom software will be
> useful since it sounds like the students' learning is much less
> organized than in a traditional school.

The Montessori philosophy of teaching is quite non-traditional.  Two
or more different grades of children are taught in the same classroom,
usually with just one teacher, who may or may not have any helpers.
My wife often does not have help, or, if she does, it has not been as
helpful as it might.  She has 7th, 8th and 9th graders in her class.
This coming school year she will have approximately 20 students.  At
any moment during the school day, all of the students are NOT doing
the same thing.  Some may be working in small groups.  Others will be
doing individual work, where it is quite likely that none of these
students are doing the same assignment.  Each student often has an
individualized learning plan.  The initial assessment project is quite
needful.  In the past my wife has wandered about the classroom
assessing her students with either a clipboard in hand or trusting her
memory until she got back to her desk and able to write down her
assessment notes for each student.  Note that students do not get
traditional grades.  Instead, they have a detailed list of skills that
they are working towards mastery in.  Her assessments will notate each
student's progress towards mastery in light of whatever assignments
they might be working on.  When it comes time to interact with each
student's parents, my wife needs to combine all of this assessment
data into a report of the student's progress in each skill area to
share with the parents.  This is quite burdensome to do entirely by
hand.

The Montessori method of teaching is most frequently associated with
children of age three up through sixth grade.  There are relatively
few examples of junior high/high school Montessori programs and there
does not seem to be a good consensus of how to apply the Montessori
methods to secondary education.  So the main reasons why my wife does
not have detailed requirements for what she would like me to program
is that she has been working out what is and is not appropriate on her
own.  After several years of developing her program, she feels she is
at the point where software can be a real help for her.  BTW, she is
very computer literate.  She has done programming before when she was
a university student and sporadically since then.  So she is well
aware of what is possible and what can be useful.

I have not given you a good idea of what a Montessori education is all
about.  If you are curious I encourage you to do the usual online
searching.

In this thread, I kept it very general on purpose.  I was probing this
community for their thoughts on two things:  1)  Should I make the
software web-based or desktop-based?  2) What would be the best way of
handling the data involved, particularly the data that impinges on
student privacy concerns.  As I said in the initial thread, some
software would be strictly for the teacher's use.  Some would be used
by the students and the teacher with the potential that the students
might have to access that software in their homes (homework).  And
finally in addition to the students and teachers, some things might be
desirable for the parents to be able to monitor their student's
progress from home.

And then to make things at least a little more concrete I gave a very
broad outline of the first project that she (perhaps foolishly ~(: >)
) hopes to have at the start of her school year.  And I have been
given some great thoughts by this community to help me on my way!

I understand and appreciate your concerns.  If the client was anyone
but my wife, I would not be attempting this for all of the excellent
reasons you gave.  But Vonda is kinda the lone ranger here in what she
is trying to build, and I think I can give her some real help.  And
from my perspective it is another opportunity to learn many cool new
things and push my limits.  I never seem to ever find time to just
read and study a Python (or other programming-related) book from
beginning to end, but when I have a concrete project to do, then at
least I start learning *something* out of sheer necess

Re: [Tutor] Socket Module

2015-07-18 Thread Danny Yoo
On Jul 18, 2015 3:50 PM, "Nym City via Tutor"  wrote:
>
> Thank you all for your responses. I have a follow up question:
>
> So if gethostbyname_ex() takes only a single hostname string, how can I
use it to go through a list of hostnames and get their IP resolution as an
output?
>

Look into loops.  If you have a function that works on a single thing, you
can use a loop to apply that function for each element in a list.  Any good
tutorial should show how to do this.

Let us know if you run into difficulties.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Socket Module

2015-07-18 Thread Nym City via Tutor
Thank you all for your responses. I have a follow up question:

So if gethostbyname_ex() takes only a single hostname string, how can I use it 
to go through a list of hostnames and get their IP resolution as an output? 

This would mean,socket.gethostbyaddr() would also not work for my second 
project.
 Thank you. 


 On Monday, July 13, 2015 2:59 AM, Alan Gauld  
wrote:
   
 

 On 12/07/15 23:36, Nym City via Tutor wrote:

> import csv
> import socket
>
> domains = open('top500domains.csv', 'r')
> for domain in domains:
>      domain = socket.gethostbyname(str(domains))

You are passing your file object to gethostbyname()

>      print(domains + "\n")
> For the code above, I receive the following error on run: socket.gaierror: 
> [Errno -2] Name or service not known.

> Variation 2:
> import csv
> import socketdomains = []

I assume the domains bit is on a separate line?

>
> with open('top500domains.csv', 'r') as f:
>      for line in f:
>          line = line.strip()
>          domains.append(line)
>
> hostbyname_ex = socket.gethostbyname_ex(str(domains))

Again you are passing the entire list to gethostbyname_ex()


-- 
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


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


Re: [Tutor] How to run same lines of code in different order at runtime

2015-07-18 Thread George

On Friday 10 July 2015 02:40 PM, Alan Gauld wrote:

On 10/07/15 01:29, Alan Gauld wrote:


It would be easierv to access the last element directly rather than
looping:

lastCity = route[-1]


Oops. looping -> calculating.



Thank u Steven and Alan,

I am sorry to reply late.  Your replies were insightful and particularly 
Steven's which was more specific to my problem, although i had a slight 
difficulty in understanding them.  I will get back to you with the 
problem on graph with pylab. Although i am also looking into another 
solutions to the same problem (me a Python newbie and programming 
hobbyist). i will do some programming and will get back to you with my 
results.


Thanks again.

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


Re: [Tutor] Design question: Web-based vs. desktop-based vs. desktop-based with data backed up to web server with a tablet thrown in for all cases?

2015-07-18 Thread Alan Gauld

On 18/07/15 04:20, boB Stepp wrote:

My wife (a Montessori teacher


No idea what that is but I'll assume its pretty much
a regular type teacher...


For her most urgent project to be done before school starts in 5 weeks


For the *urgent* project I'd consider using Sqlite for the data and 
store it on a cloud server. That will enable sync between devices, 
provided they don't both make changes at once. Its not super secure
but it does provide some level of access control on the cloud and the 
data isn't in a simple text file so can't be trivially read.


You can migrate to a bigger client/server solution later if needed 
provided you build a data access API from the start. And the more 
extensive security features need to be added later. Treat the 5 week 
project as a semi-throwaway prototype learning experience.


Other than that Laura's advice is pretty much spot on.


I do own server space and a domain name that I have never used, but
should be adequate for my wife's needs.


What software will they allow you to run? The server owners restrictions 
are likely to be a major factor in your choice

of solution. For example do they allow you to install a web
framework like Django? Or do you have to use Wordpress or
similar?

Not all web providers are equal. You may find you are better
off using something like Google or Amazon web services.

Finally, for a really modern feeling web app you are going to
have to use Javascript, possibly quite a lot of it. If you
don't already know it, it will be a steep learning curve, so
you might want to start reading now!

--
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