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-19 Thread Alan Gauld

On 19/07/15 07:27, Steven D'Aprano wrote:


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.


SQLite is a single file database so you shouldn't need to dump/load it. 
Just save the file. That's why I suggested Dropbox or similar since you 
get the benefit of a local copy with automated backup to the cloud.


SQLIte provides no login/user access control but the Cloud will provide 
visibility control so only approved users can access the

file. (Of course they can copy it anywhere they want so its not
as good as full server based access but for a few users/devices
it should be sufficient)


--
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] 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-19 Thread Laura Creighton
In a message of Sun, 19 Jul 2015 16:27:13 +1000, Steven D'Aprano writes:
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.

Python 2.7 only on for MacOSX.  Python 3 is coming very soon.

Laura

___
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-19 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-19 Thread boB Stepp
On Sun, Jul 19, 2015 at 5:28 PM, Laura Creighton l...@openend.se wrote:
 In a message of Sun, 19 Jul 2015 18:11:36 -0400, Dave P writes:
On Jul 19, 2015 5:43 AM, Laura Creighton l...@openend.se wrote:

 In a message of Sun, 19 Jul 2015 16:27:13 +1000, Steven D'Aprano writes:
 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.

 Python 2.7 only on for MacOSX.  Python 3 is coming very soon.

 Laura

Hi all,

I can't help thinking we're trying to reinvent the wheel here. I would be
quite surprised if Trello couldn't help in this situation. (I do not work
for Trello.com)

Long story short, it's kanban in the cloud and can be adapted for just
about anything.  It's free, too!  My son's multi-age, non-traditional
school -kids, teachers, and parents alike- use it to track student projects
 goals, plan school events, fundraising, wish lists, supplies lists, and
more.  It's easy to use, share, and collaborate.  It works in the browser
or you can use their mobile apps.  You can set up checklists, attach images
and files, work with due dates, comment and activity streams, etc.  Plus,
using their RESTful API, you could whip up some slick automation and
reporting (using Python, of course!)

I'll be glad to help you and your wife off-list if you'd like some
pointers.

Good luck!

Dave

 boB: this was precisely the sort of solution 'already existing in the
 cloud' I was hoping you could find.  I just didn't know about this one.
 Very cool.  Thank you Dave.

I will forward this to Vonda and see what she thinks.  But from what
she has described thus far, I don't think it will give her the type of
interface she is hoping to get, or make it easy to organize her
information in the way she seems to want.  However, it looks like it
might do some stuff that I have wanted done on my phone that I used to
do on a Palm once upon a time.  I will have to glance at the API docs
and see what else we might do with it.

Thanks!

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


Re: [Tutor] Socket Module

2015-07-19 Thread Nym City via Tutor
Thank you for your response. I gave it another try:
As suggested, first I ran the concept just in the terminal, and it worked fine:
 names =['173.252.120.6', '98.139.183.24']
 import socket
 for name in names:
    socket.gethostbyaddr(name)
    print(name)
  
output:  
('edge-star-shv-12-frc3.facebook.com', [], ['173.252.120.6'])
('ir2.fp.vip.bf1.yahoo.com', [], ['98.139.183.24'])
However, when I run it in a program, from a CSV file, it just outputs the 
content of the CSV file without running it thought socket.gethostbyaddr():
import csv
import socket

domains = []

with open('top500ips.csv', 'r') as f:
    for line in f:
    line = line.strip()
    domains.append(line)

for name in domains:
    socket.gethostbyaddr(name)
    print(name)
output: 
173.252.120.6
98.139.183.24

What am I missing? Thank in advance.
 Thank you. 


 On Saturday, July 18, 2015 7:09 PM, Danny Yoo danny@gmail.com wrote:
   
 

 
On Jul 18, 2015 3:50 PM, Nym City via Tutor tutor@python.org 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] 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-19 Thread Dave P
On Jul 19, 2015 5:43 AM, Laura Creighton l...@openend.se wrote:

 In a message of Sun, 19 Jul 2015 16:27:13 +1000, Steven D'Aprano writes:
 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.

 Python 2.7 only on for MacOSX.  Python 3 is coming very soon.

 Laura

Hi all,

I can't help thinking we're trying to reinvent the wheel here. I would be
quite surprised if Trello couldn't help in this situation. (I do not work
for Trello.com)

Long story short, it's kanban in the cloud and can be adapted for just
about anything.  It's free, too!  My son's multi-age, non-traditional
school -kids, teachers, and parents alike- use it to track student projects
 goals, plan school events, fundraising, wish lists, supplies lists, and
more.  It's easy to use, share, and collaborate.  It works in the browser
or you can use their mobile apps.  You can set up checklists, attach images
and files, work with due dates, comment and activity streams, etc.  Plus,
using their RESTful API, you could whip up some slick automation and
reporting (using Python, of course!)

I'll be glad to help you and your wife off-list if you'd like some
pointers.

Good luck!

Dave
___
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-19 Thread Laura Creighton
In a message of Sun, 19 Jul 2015 18:11:36 -0400, Dave P writes:
On Jul 19, 2015 5:43 AM, Laura Creighton l...@openend.se wrote:

 In a message of Sun, 19 Jul 2015 16:27:13 +1000, Steven D'Aprano writes:
 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.

 Python 2.7 only on for MacOSX.  Python 3 is coming very soon.

 Laura

Hi all,

I can't help thinking we're trying to reinvent the wheel here. I would be
quite surprised if Trello couldn't help in this situation. (I do not work
for Trello.com)

Long story short, it's kanban in the cloud and can be adapted for just
about anything.  It's free, too!  My son's multi-age, non-traditional
school -kids, teachers, and parents alike- use it to track student projects
 goals, plan school events, fundraising, wish lists, supplies lists, and
more.  It's easy to use, share, and collaborate.  It works in the browser
or you can use their mobile apps.  You can set up checklists, attach images
and files, work with due dates, comment and activity streams, etc.  Plus,
using their RESTful API, you could whip up some slick automation and
reporting (using Python, of course!)

I'll be glad to help you and your wife off-list if you'd like some
pointers.

Good luck!

Dave

boB: this was precisely the sort of solution 'already existing in the
cloud' I was hoping you could find.  I just didn't know about this one.
Very cool.  Thank you Dave.

Laura

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


Re: [Tutor] Socket Module

2015-07-19 Thread Danny Yoo
 for name in domains:
 socket.gethostbyaddr(name)
 print(name)

 output:
 173.252.120.6
 98.139.183.24

 What am I missing? Thank in advance.


You have confused yourself a little because the variable names you've
chosen are slightly misleading.  Specifically, name is really an IP
address.  Hence, your loop here really should be:

   for addr in domains:
...

I would also strongly suggest renaming domains to something like
domainAddresses, for similar reasons.

Still, you do want a name at some point, since that's what you care about.

Can you say in human language what the following will return?

socket.gethostbyaddr(addr)

Can you give it a good name?
___
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-19 Thread boB Stepp
On Sun, Jul 19, 2015 at 1:27 AM, Steven D'Aprano st...@pearwood.info wrote:
 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.

Thanks for the pass!  But I actually thought this was on-topic.  I am
preparing to write a Python application.  I have some questions about
how to design it.  Why would this be off-topic?  I get it that program
design applies to all programming languages, but since this list is
targeted to people learning programming, I would think we would all
need help in these areas, too.  Otherwise our Python programs would
not be very well written, however correct the Python syntax might be.

For the rest of your answer, I think that this is exactly how I should
approach this first program.  And after having a discussion with Vonda
today, it is actually her intent--play with this project until it is
in a form that works in her workflow, and then expand upon it.  Laura
suggested kivy, too, and I think it will best do what is needed for
the Slate tablet.  Alan's and your suggestion to use SQLite seems a
good one as well for the prototype.

Thanks to everyone who responded to this thread.  It has really
clarified my thinking on the best way to get productive as quickly as
possible.  Now to find the energy after my regular work and the time
at home which is always being taken up by my two kids and Vonda!

Would it be off-putting later to ask specific questions about
implementing features of kivy on this list?  I imagine that they would
tend to be basic questions that would probably apply to any GUI
development.  But I'm sure there is a kivy list somewhere once I look
for it if I need to go there.

I took Laura's suggestion and asked my original questions that started
this thread on the tkinter list she suggested, but I have yet to
receive an response.  One thing I cherish about this list is it is
both active and enthusiastic in providing help and direction, even if
that help is to suggest other avenues for help.  Much better than
silence!

Thanks!
boB
___
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-19 Thread boB Stepp
On Sun, Jul 19, 2015 at 8:23 PM, boB Stepp robertvst...@gmail.com wrote:
 Would it be off-putting later to ask specific questions about
 implementing features of kivy on this list?  I imagine that they would
 tend to be basic questions that would probably apply to any GUI
 development.  But I'm sure there is a kivy list somewhere once I look
 for it if I need to go there.

I guess I will answer this question myself:  I have just been skimming
through the kivy docs tonight and they look to be quite good.  Also, I
found their Google group and it looks to be quite active.  So unless I
have a GUI question that seems to fit better here, I will direct my
kivy inquiries to their Google group.

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