Re: Multiple comparisons in a single statement

2020-03-16 Thread Stephen Tucker
OK. You are right. I was misleading.

I am sorry for wasting your time.

Thanks you for helping me to express myself.

Stephen.




Virus-free.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Fri, Mar 13, 2020 at 7:05 PM Dennis Lee Bieber 
wrote:

> On Fri, 13 Mar 2020 09:34:35 +, Stephen Tucker  >
> declaimed the following:
>
> >
> >*All:  *For the record, I meant that the tuples are all the same. The
>
>
> "all the same" is still ambiguous...
>
> >>> str1 = "A String"
> >>> str2 = "Another String"
> >>> str3 = "A" + " " + "String"
> >>> id(str1), id(str2), id(str3)
> (105461360, 105461296, 105461232)
> >>> tpl1 = (str1, str2)
> >>> tpl2 = (str1, str2)
> >>> tpl3 = (str3, str2)
> >>> id(tpl1), id(tpl2), id(tpl3)
> (90094216, 90094152, 90093576)
> >>> tpl1 == tpl2
> True
> >>> tpl1 == tpl3
> True
> >>> tpl4 = tpl3
> >>> tpl4 == tpl3
> True
> >>> tpl1 is tpl2
> False
> >>> tpl1 is tpl3
> False
> >>> tpl1 is tpl4
> False
> >>> tpl3 is tpl4
> True
> >>>
>
> tpl3 IS THE SAME as tpl4
> tpl1 is NOT THE SAME as tpl2, tpl3, or tpl4
>
> However, the CONTENTS of tpl4 compare as equivalent to tpl1, tpl2, and tpl3
>
>
> --
> Wulfraed Dennis Lee Bieber AF6VN
> wlfr...@ix.netcom.com
> http://wlfraed.microdiversity.freeddns.org/
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Profiler showing path dependency?

2020-03-16 Thread Marco Sulla
https://docs.python.org/3/library/profile.html#pstats.Stats.print_callers

On Sat, 14 Mar 2020 at 00:54, Go Luhng  wrote:

> Consider a simple call graph: `main()` calls `foo()`, which calls
> `bar()`. Then `main()` calls `qux()` which also calls `bar()`, but
> with different parameters.
>
> When you run the above through cProfile and view the result in
> SnakeViz, you will see `main()` calling `foo()` and `qux()`, with each
> of them calling `bar()`. However, if you hover or click on `bar()`,
> you will see the global aggregate statistics for it. For example, the
> number of times it has been called, and their total time cost.
>
> Is there a way to get a path-dependent profiler breakdown for `bar()`?
>  Specifically for this example, statistics for when it is called by
> `foo()`, and separately statistics for when it is called by `qux()`.
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[Mostly OT] Feedback on Python homework using Canvas LMS

2020-03-16 Thread Irv Kalb
This is for anyone who teaches Python and uses the Canvas Learning Management 
System (maybe a small group).

I teach Python at two colleges in Silicon Valley in California.  At both 
schools we use Canvas.  Overall, it works very well.  I use it to post notes, 
sample programs, build tests, post homework, and correct homework assignment.  

However, there is a problem (bug!) when I give feedback on student's homework 
assignments.  I often give feedback by writing small snippets of code to 
explain what a student has done wrong, or how something could be done better.  
The problem is that in the feedback section for homework assignments, Canvas 
eliminates any leading space characters.  So, I might write:

if x == y:
# do thing 1
else:
# do thing 2

but when it gets posted and viewed by the student, it shows up as:

if x == y:
# do thing 1
else:
# do thing 2

Which obviously is very annoying to me, and not as helpful to the student.  

Knowing that this happens, I have started to write feedback using periods for 
indenting:

if x == y:
# do thing 1
else:
# do thing 2

I have posted about this problem on the Canvas board, pointing out the 
importance of leading spaces, but I've had no response.  I also even wrote the 
company through snail mail, and got no response.

Question 1:  Does anyone have any suggestions for indenting besides using 
periods?

Question 2:  Does anyone know any other way to reach the appropriate person(s) 
at Canvas to address this issue.

Thanks,

Irv
-- 
https://mail.python.org/mailman/listinfo/python-list


Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-16 Thread Orges Leka
Dear Python developers,

I am a data scientist and use Python regularly. I have a question:
How difficult is it to write a Python web-app, with the following basic
functionality:

The user writes anonymously without registration where (City, supermarket),
when (Date and Time) he plans to go to the supermarket.
If this is done by a lot of users, the first user gets to see the number of
other buyers at this supermarket and can better plan when to go shopping.
This would reduce the waiting queue at the supermarket and possibly the
contact to other people thus would help a little bit in slowing down the
spread of the Corona virus.
One could also add openstreetmap functionality to this.

As I am not a professional software developer, I can not predict how long
it would take to write such a web-app in python.

If you do not have currently time, but know someone who would possibly be
interested in working at this project, I would be happy if you let me know.

Kind regards,
Orges Leka

-- 
Mit freundlichen Grüßen
Herr Dipl. Math. Orges Leka

Mobil: 015751078391
Email: orges.l...@googlemail.com
Holzheimerstraße 25
65549 Limburg
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Mostly OT] Feedback on Python homework using Canvas LMS

2020-03-16 Thread MRAB

On 2020-03-16 18:31, Irv Kalb wrote:

This is for anyone who teaches Python and uses the Canvas Learning Management 
System (maybe a small group).

I teach Python at two colleges in Silicon Valley in California.  At both 
schools we use Canvas.  Overall, it works very well.  I use it to post notes, 
sample programs, build tests, post homework, and correct homework assignment.

However, there is a problem (bug!) when I give feedback on student's homework 
assignments.  I often give feedback by writing small snippets of code to 
explain what a student has done wrong, or how something could be done better.  
The problem is that in the feedback section for homework assignments, Canvas 
eliminates any leading space characters.  So, I might write:

if x == y:
 # do thing 1
else:
 # do thing 2

but when it gets posted and viewed by the student, it shows up as:

if x == y:
# do thing 1
else:
# do thing 2

Which obviously is very annoying to me, and not as helpful to the student.

Knowing that this happens, I have started to write feedback using periods for 
indenting:

if x == y:
# do thing 1
else:
# do thing 2

I have posted about this problem on the Canvas board, pointing out the 
importance of leading spaces, but I've had no response.  I also even wrote the 
company through snail mail, and got no response.

Question 1:  Does anyone have any suggestions for indenting besides using 
periods?

Question 2:  Does anyone know any other way to reach the appropriate person(s) 
at Canvas to address this issue.

For appearances you could indent with non-breaking spaces, '\xA0'. Just 
be aware that it could be confusing if the user tries to copy and paste 
it, because although they'll look like spaces, they won't be!

--
https://mail.python.org/mailman/listinfo/python-list


Re: Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-16 Thread Chris Angelico
On Tue, Mar 17, 2020 at 6:25 AM Orges Leka  wrote:
>
> Dear Python developers,
>
> I am a data scientist and use Python regularly. I have a question:
> How difficult is it to write a Python web-app, with the following basic
> functionality:
>
> The user writes anonymously without registration where (City, supermarket),
> when (Date and Time) he plans to go to the supermarket.
> If this is done by a lot of users, the first user gets to see the number of
> other buyers at this supermarket and can better plan when to go shopping.
> This would reduce the waiting queue at the supermarket and possibly the
> contact to other people thus would help a little bit in slowing down the
> spread of the Corona virus.
> One could also add openstreetmap functionality to this.
>

It'd be pretty easy to write the app. The hard part would be getting
enough people to use it, since the app can only see how many other
people are also using the app. Since you need it to work with any
specified date/time, it can't simply look at current traffic (even if
that information were available), which means you're basically limited
to information shared by other users.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Mostly OT] Feedback on Python homework using Canvas LMS

2020-03-16 Thread Ethan Furman

On 03/16/2020 11:31 AM, Irv Kalb wrote:


The problem is that in the feedback section for homework assignments, Canvas
 eliminates any leading space characters.  So, I might write:

if x == y:
 # do thing 1
else:
 # do thing 2

but when it gets posted and viewed by the student, it shows up as:

if x == y:
# do thing 1
else:
# do thing 2


Sounds like HTML display -- have you tried enclosing your snippets in  or 
 tags?

If that fails, are embedded spaces retained?  If so, maybe

.if x == y
.# do thing 1
.else:
.# do thing 2

That would make less work after copy pasting, at least.

--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list


Re: Profiler showing path dependency?

2020-03-16 Thread Barry Scott



> On 15 Mar 2020, at 21:05, Marco Sulla  wrote:
> 
> https://docs.python.org/3/library/profile.html#pstats.Stats.print_callers

And also look at print_callees. Between callers and callees you can
usually find some insight.

Barry


> 
> On Sat, 14 Mar 2020 at 00:54, Go Luhng  wrote:
> 
>> Consider a simple call graph: `main()` calls `foo()`, which calls
>> `bar()`. Then `main()` calls `qux()` which also calls `bar()`, but
>> with different parameters.
>> 
>> When you run the above through cProfile and view the result in
>> SnakeViz, you will see `main()` calling `foo()` and `qux()`, with each
>> of them calling `bar()`. However, if you hover or click on `bar()`,
>> you will see the global aggregate statistics for it. For example, the
>> number of times it has been called, and their total time cost.
>> 
>> Is there a way to get a path-dependent profiler breakdown for `bar()`?
>> Specifically for this example, statistics for when it is called by
>> `foo()`, and separately statistics for when it is called by `qux()`.
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

-- 
https://mail.python.org/mailman/listinfo/python-list


Fwd: Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-16 Thread Orges Leka
-- Forwarded message -
Von: Orges Leka 
Date: Mo., 16. März 2020 um 21:13 Uhr
Subject: Re: Reduce waiting queue at supermarket from Corona with
Python-Webapp
To: Chris Angelico 


Thanks for your insight. The date / time could be from a predefined list,
for example:

10:00-11:00
11:00-12:00
...
20:00-21:00

This would work like a calender function. Where each user can register for
example for three distinct time slots, and then he will see, approximately,
the time distribution of other users.

For the getting enough people to use it, I think word-of-mouth should work,
as it would help those who use it, plus it reduces the chance of physical
contact, so there is a win-win situation in using the app.

Maybe if someone from the media promotes the app, this should boost it also.

Kind regards,
Orges

Am Mo., 16. März 2020 um 21:00 Uhr schrieb Chris Angelico :

> On Tue, Mar 17, 2020 at 6:25 AM Orges Leka  wrote:
> >
> > Dear Python developers,
> >
> > I am a data scientist and use Python regularly. I have a question:
> > How difficult is it to write a Python web-app, with the following basic
> > functionality:
> >
> > The user writes anonymously without registration where (City,
> supermarket),
> > when (Date and Time) he plans to go to the supermarket.
> > If this is done by a lot of users, the first user gets to see the number
> of
> > other buyers at this supermarket and can better plan when to go shopping.
> > This would reduce the waiting queue at the supermarket and possibly the
> > contact to other people thus would help a little bit in slowing down the
> > spread of the Corona virus.
> > One could also add openstreetmap functionality to this.
> >
>
> It'd be pretty easy to write the app. The hard part would be getting
> enough people to use it, since the app can only see how many other
> people are also using the app. Since you need it to work with any
> specified date/time, it can't simply look at current traffic (even if
> that information were available), which means you're basically limited
> to information shared by other users.
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 
Mit freundlichen Grüßen
Herr Dipl. Math. Orges Leka

Mobil: 015751078391
Email: orges.l...@googlemail.com
Holzheimerstraße 25
65549 Limburg


-- 
Mit freundlichen Grüßen
Herr Dipl. Math. Orges Leka

Mobil: 015751078391
Email: orges.l...@googlemail.com
Holzheimerstraße 25
65549 Limburg
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-16 Thread Chris Angelico
On Tue, Mar 17, 2020 at 7:21 AM Orges Leka  wrote:
> For the getting enough people to use it, I think word-of-mouth should work,
> as it would help those who use it, plus it reduces the chance of physical
> contact, so there is a win-win situation in using the app.
>
> Maybe if someone from the media promotes the app, this should boost it also.

In order to be usefully able to predict how many people will be at a
location, you'd need an appreciable proportion of them to be using
your app. Let's say you accept a 5% saturation (which is pretty low -
if only 5% of people use the app, there's still a LOT of uncertainty
in the estimated figures). Do you think you'll be able to get to the
point of having 5% of *all shoppers* in an area to start using your
app? That is a HUGE number of people to start using an app, and even
then, it would only give a low degree of confidence.

To the early adopters, your app is close to useless. That means word
of mouth isn't going to be very strong. It's something that depends
entirely on already having lots of users.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-16 Thread Orges Leka
Am Mo., 16. März 2020 um 21:33 Uhr schrieb Chris Angelico :

> On Tue, Mar 17, 2020 at 7:21 AM Orges Leka  wrote:
> > For the getting enough people to use it, I think word-of-mouth should
> work,
> > as it would help those who use it, plus it reduces the chance of physical
> > contact, so there is a win-win situation in using the app.
> >
> > Maybe if someone from the media promotes the app, this should boost it
> also.
>
> In order to be usefully able to predict how many people will be at a
> location, you'd need an appreciable proportion of them to be using
> your app. Let's say you accept a 5% saturation (which is pretty low -
> if only 5% of people use the app, there's still a LOT of uncertainty
> in the estimated figures). Do you think you'll be able to get to the
> point of having 5% of *all shoppers* in an area to start using your
> app? That is a HUGE number of people to start using an app, and even
> then, it would only give a low degree of confidence.
>
> To the early adopters, your app is close to useless. That means word
> of mouth isn't going to be very strong. It's something that depends
> entirely on already having lots of users.
>
>
Following your reasoning, then radar detection apps / wikipedia / facebook,
which crucially depend on user generated content should not work



> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 
Mit freundlichen Grüßen
Herr Dipl. Math. Orges Leka

Mobil: 015751078391
Email: orges.l...@googlemail.com
Holzheimerstraße 25
65549 Limburg
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-16 Thread Barry Scott


> On 16 Mar 2020, at 17:38, Orges Leka  wrote:
> 
> Dear Python developers,
> 
> I am a data scientist and use Python regularly. I have a question:
> How difficult is it to write a Python web-app, with the following basic
> functionality:
> 
> The user writes anonymously without registration where (City, supermarket),
> when (Date and Time) he plans to go to the supermarket.

Without some security the site would be open to abuse.

> If this is done by a lot of users, the first user gets to see the number of
> other buyers at this supermarket and can better plan when to go shopping.
> This would reduce the waiting queue at the supermarket and possibly the
> contact to other people thus would help a little bit in slowing down the
> spread of the Corona virus.
> One could also add openstreetmap functionality to this.
> 
> As I am not a professional software developer, I can not predict how long
> it would take to write such a web-app in python.
> 
> If you do not have currently time, but know someone who would possibly be
> interested in working at this project, I would be happy if you let me know.

If you search google for a shop the right hand panel has a popular times
sections that tells you how busy the store typically is and the current busyness
estimate. Is that what you are after?

Barry

> 
> Kind regards,
> Orges Leka
> 
> -- 
> Mit freundlichen Grüßen
> Herr Dipl. Math. Orges Leka
> 
> Mobil: 015751078391
> Email: orges.l...@googlemail.com
> Holzheimerstraße 25
> 65549 Limburg
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Mostly OT] Feedback on Python homework using Canvas LMS

2020-03-16 Thread Irv Kalb
> On Mar 16, 2020, at 11:31 AM, Irv Kalb  wrote:
> 
> This is for anyone who teaches Python and uses the Canvas Learning Management 
> System (maybe a small group).
> 
> I teach Python at two colleges in Silicon Valley in California.  At both 
> schools we use Canvas.  Overall, it works very well.  I use it to post notes, 
> sample programs, build tests, post homework, and correct homework assignment. 
>  
> 
> However, there is a problem (bug!) when I give feedback on student's homework 
> assignments.  I often give feedback by writing small snippets of code to 
> explain what a student has done wrong, or how something could be done better. 
>  The problem is that in the feedback section for homework assignments, Canvas 
> eliminates any leading space characters.  So, I might write:
> 
> if x == y:
>   # do thing 1
> else:
>   # do thing 2
> 
> but when it gets posted and viewed by the student, it shows up as:
> 
> if x == y:
> # do thing 1
> else:
> # do thing 2
> 
> Which obviously is very annoying to me, and not as helpful to the student.  
> 
> Knowing that this happens, I have started to write feedback using periods for 
> indenting:
> 
> if x == y:
> # do thing 1
> else:
> # do thing 2
> 
> I have posted about this problem on the Canvas board, pointing out the 
> importance of leading spaces, but I've had no response.  I also even wrote 
> the company through snail mail, and got no response.
> 
> Question 1:  Does anyone have any suggestions for indenting besides using 
> periods?
> 
> Question 2:  Does anyone know any other way to reach the appropriate 
> person(s) at Canvas to address this issue.
> 
> Thanks,
> 
> Irv
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

Thanks to MRAB and Ethan for their quick responses.

I like both suggestions, and will probably go with the non-breaking space 
(Option space on my Mac).  I tested that and it works well.

Irv

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-16 Thread Ethan Furman

On 03/16/2020 01:52 PM, Orges Leka wrote:


Following your reasoning, then radar detection apps / wikipedia / facebook,
which crucially depend on user generated content should not work


Those are global apps, and one user's content can be useful in another user's 
country.

Who's shopping at the grocery store 100 miles away from me is useless.

--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list


Re: Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-16 Thread Ethan Furman

On 03/16/2020 01:16 PM, Barry Scott wrote:


If you search google for a shop the right hand panel has a popular times
sections that tells you how busy the store typically is and the current busyness
estimate. Is that what you are after?


I suspect that's the general idea, only in real-time.

--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list


Can you help me solve this?

2020-03-16 Thread Joseph Nail
Hello,
I have one problem. Somehow in my function when I wrote y=x, they are the
same variable and then it also changes age or height (which were x) in the
main program. See more in attached file.
Maybe it is bug or maybe it should run that way.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-16 Thread Chris Angelico
On Tue, Mar 17, 2020 at 7:54 AM Orges Leka  wrote:
>
> Am Mo., 16. März 2020 um 21:33 Uhr schrieb Chris Angelico  >:
>
> > On Tue, Mar 17, 2020 at 7:21 AM Orges Leka  wrote:
> > > For the getting enough people to use it, I think word-of-mouth should
> > work,
> > > as it would help those who use it, plus it reduces the chance of physical
> > > contact, so there is a win-win situation in using the app.
> > >
> > > Maybe if someone from the media promotes the app, this should boost it
> > also.
> >
> > In order to be usefully able to predict how many people will be at a
> > location, you'd need an appreciable proportion of them to be using
> > your app. Let's say you accept a 5% saturation (which is pretty low -
> > if only 5% of people use the app, there's still a LOT of uncertainty
> > in the estimated figures). Do you think you'll be able to get to the
> > point of having 5% of *all shoppers* in an area to start using your
> > app? That is a HUGE number of people to start using an app, and even
> > then, it would only give a low degree of confidence.
> >
> > To the early adopters, your app is close to useless. That means word
> > of mouth isn't going to be very strong. It's something that depends
> > entirely on already having lots of users.
> >
> >
> Following your reasoning, then radar detection apps / wikipedia / facebook,
> which crucially depend on user generated content should not work
>

I don't know very much about radar detection, but I suspect that it
can be useful even if only a very small percentage of people use it.
Same with Wikipedia. (Facebook isn't useful even now, so that doesn't
really count.) But to be able to recognize when a shop is going to be
busy and when it's going to be quiet, you actually need to be able to
predict the movements of a lot of people, which means you need either
a very large proportion of people to be using your app, or some other
source of data.

As an example, consider: Suppose a mere 100 people are using
Wikipedia. Those people can create articles (perhaps lifting content
heavily from other sources, if the licenses are compatible), read
articles, edit them, etc, etc. It's not going to be a huge success,
but it is at least useful. And the 101st person to start using
Wikipedia can see some informative articles and learn from them,
and/or see an inaccuracy and correct it. It has value.

But consider that 100 people are using your app. If each person plans
to go shopping every two weeks (yes, I know a lot of people shop more
frequently than that, but ideally they'll be reducing the number of
trips for the same reason that they're trying to go when it's quiet),
then you have an average of 7-10 shoppers per day. Distribute those
shoppers among a set of time slots, and most likely you'll have
between 0 and 3 registered users in each time slot. Now consider: in
the scale of shop activity, how much can you learn by knowing the
movements of just three people? The entire point of the app is to
change people's actions, so you can't assume that the figures you have
are representative. The app actually has no value whatsoever with just
100 people using it.

In order to be useful, you FIRST have to achieve a significant level
of usage. That's extremely hard for a brand new app, so you would need
to leverage some existing data or usage somewhere.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Can you help me solve this?

2020-03-16 Thread Igor Korot
Hi,

On Mon, Mar 16, 2020 at 4:26 PM Joseph Nail  wrote:
>
> Hello,
> I have one problem. Somehow in my function when I wrote y=x, they are the
> same variable and then it also changes age or height (which were x) in the
> main program. See more in attached file.
> Maybe it is bug or maybe it should run that way.

This is the text only ML -> NO ATTACHMENT.

Please copy and paste the code inside the E-mail body send it out.

Thank you,

> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-16 Thread Barry Scott


> On 16 Mar 2020, at 17:38, Orges Leka  wrote:
> 
> Dear Python developers,
> 
> I am a data scientist and use Python regularly. I have a question:
> How difficult is it to write a Python web-app, with the following basic
> functionality:

Am I right in thinking that you are wondering how to help people visit the 
super market
in a quite time to help with the social distancing for COVID-19 reasons?

This is an interesting idea. I think if it was a app on Android or Apple it
might be easier to get users, but harder to write.

Maybe exploiting something like https://www.ushahidi.com/ 
 is an alternative?

Barry


> 
> The user writes anonymously without registration where (City, supermarket),
> when (Date and Time) he plans to go to the supermarket.
> If this is done by a lot of users, the first user gets to see the number of
> other buyers at this supermarket and can better plan when to go shopping.
> This would reduce the waiting queue at the supermarket and possibly the
> contact to other people thus would help a little bit in slowing down the
> spread of the Corona virus.
> One could also add openstreetmap functionality to this.
> 
> As I am not a professional software developer, I can not predict how long
> it would take to write such a web-app in python.
> 
> If you do not have currently time, but know someone who would possibly be
> interested in working at this project, I would be happy if you let me know.
> 
> Kind regards,
> Orges Leka
> 
> -- 
> Mit freundlichen Grüßen
> Herr Dipl. Math. Orges Leka
> 
> Mobil: 015751078391
> Email: orges.l...@googlemail.com
> Holzheimerstraße 25
> 65549 Limburg
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Mostly OT] Feedback on Python homework using Canvas LMS

2020-03-16 Thread Grant Edwards
On 2020-03-16, Irv Kalb  wrote:

> I like both suggestions, and will probably go with the non-breaking
> space (Option space on my Mac).  I tested that and it works well.

Until somebody tries to cut/paste the snippets you post into a .py
file and run them.  At that point the "distance learning" setup is
definitely good, because you really don't want to hear the names
you'll be called.  ;)




-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Can you help me solve this?

2020-03-16 Thread Pieter van Oostrum
Joseph Nail  writes:

> Hello,
> I have one problem. Somehow in my function when I wrote y=x, they are the
> same variable and then it also changes age or height (which were x) in the
> main program. See more in attached file.
> Maybe it is bug or maybe it should run that way.

If you write y = x, then they are not the same variable, but they point to (the 
proper Python language is they are bound to) the same object.

Now if you say x.age = 20, then y.age will also be 20 (it's the same object).
-- 
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Can you help me solve this?

2020-03-16 Thread Pieter van Oostrum
Pieter van Oostrum  writes:

> Joseph Nail  writes:
>
>> Hello,
>> I have one problem. Somehow in my function when I wrote y=x, they are the
>> same variable and then it also changes age or height (which were x) in the
>> main program. See more in attached file.
>> Maybe it is bug or maybe it should run that way.
>
> If you write y = x, then they are not the same variable, but they point
> to (the proper Python language is they are bound to) the same object.
>
> Now if you say x.age = 20, then y.age will also be 20 (it's the same object).

If you want y to be an independent copy of x (i.e. a new object that has the 
same values), use:

import copy
y = copy.copy(x)

Now you can change x.age and it won't affect y.age
-- 
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-16 Thread Orges Leka
Barry Scott  schrieb am Mo., 16. März 2020, 22:55:

>
>
> On 16 Mar 2020, at 17:38, Orges Leka  wrote:
>
> Dear Python developers,
>
> I am a data scientist and use Python regularly. I have a question:
> How difficult is it to write a Python web-app, with the following basic
> functionality:
>
>
> Am I right in thinking that you are wondering how to help people visit the
> super market
> in a quite time to help with the social distancing for COVID-19 reasons?
>

Yes, that is the intention.


This is an interesting idea. I think if it was a app on Android or Apple it
> might be easier to get users, but harder to write.
>
> Maybe exploiting something like https://www.ushahidi.com/ is an
> alternative?
>
> Barry
>
>
>
> The user writes anonymously without registration where (City, supermarket),
> when (Date and Time) he plans to go to the supermarket.
> If this is done by a lot of users, the first user gets to see the number of
> other buyers at this supermarket and can better plan when to go shopping.
> This would reduce the waiting queue at the supermarket and possibly the
> contact to other people thus would help a little bit in slowing down the
> spread of the Corona virus.
> One could also add openstreetmap functionality to this.
>
> As I am not a professional software developer, I can not predict how long
> it would take to write such a web-app in python.
>
> If you do not have currently time, but know someone who would possibly be
> interested in working at this project, I would be happy if you let me know.
>
> Kind regards,
> Orges Leka
>
> --
> Mit freundlichen Grüßen
> Herr Dipl. Math. Orges Leka
>
> Mobil: 015751078391
> Email: orges.l...@googlemail.com 
> Holzheimerstraße 25
> 65549 Limburg
> --
> https://mail.python.org/mailman/listinfo/python-list
>
>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-16 Thread MRAB

On 2020-03-16 21:55, Barry Scott wrote:




On 16 Mar 2020, at 17:38, Orges Leka  wrote:

Dear Python developers,

I am a data scientist and use Python regularly. I have a question:
How difficult is it to write a Python web-app, with the following basic
functionality:


Am I right in thinking that you are wondering how to help people visit the 
super market
in a quite time to help with the social distancing for COVID-19 reasons?

This is an interesting idea. I think if it was a app on Android or Apple it
might be easier to get users, but harder to write.

Maybe exploiting something like https://www.ushahidi.com/ 
 is an alternative?

Or something like Tinder, except that you're trying _not_ to meet 
people. :-)

--
https://mail.python.org/mailman/listinfo/python-list


Re: Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-16 Thread mm0fmf

On 16/03/2020 21:55, Barry Scott wrote:

Am I right in thinking that you are wondering how to help people visit the 
super market
in a quite time to help with the social distancing for COVID-19 reasons?


In which case all the app needs to do is tell people that the 
supermarket A has great stocks of toilet paper, pasta, dried milk, beans 
etc. so that the users flock to supermarket A to panic buy and fight 
over the stock. Meanwhile you can visit supermarket B at the same time 
which will be quiet.  You get a safer shopping trip.


Or have I got this wrong?



--
https://mail.python.org/mailman/listinfo/python-list


Re: [Mostly OT] Feedback on Python homework using Canvas LMS

2020-03-16 Thread DL Neil via Python-list

On 17/03/20 10:49 AM, Grant Edwards wrote:

On 2020-03-16, Irv Kalb  wrote:


I like both suggestions, and will probably go with the non-breaking
space (Option space on my Mac).  I tested that and it works well.


Until somebody tries to cut/paste the snippets you post into a .py
file and run them.  At that point the "distance learning" setup is
definitely good, because you really don't want to hear the names
you'll be called.  ;)


Exactly - and if the 'victim' (literally) cannot see why copy-pasted 
code is being violently rejected, learning objectives will be soundly 
defeated!



Whereas "spaces" have been mentioned (and without wishing to enter into 
a 'religious war'), what happens if the white-space character is a tab?


Failing that, consider adding a visible character, eg the 'right arrow' 
that is occasionally used to indicate paragraph-like indentation in 
other contexts. Would still require the trainees to post-edit though - 
albeit only a single global find-replace.



Similar problems existed on Moodle (may not now, or may have an add-on 
solution) and edX (which does have a built-in solution).


Might Canvas (I haven't used that LMS) permit the embedding of a 
"frame"? (allowing greater formatting freedom/character choices within 
its 'enclosure')



Another option may be to link to a post on a 'snippet site' - most seem 
JavaScript-oriented, but may also support, or at least tolerate, Python.



WebRefs:
https://en.wikipedia.org/wiki/Pastebin
https://pastebin.com/
https://codepen.io/
https://jsfiddle.net/
https://gist.github.com/discover

or, to keep things in-house (and possibly better indexed/reusable):
https://gogs.io/
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-16 Thread Souvik Dutta
I think you might get a man build the app in a manner that allows the
people at the supermarket to update the foot falls of the customers in a
given time period. Like one might count the number on 10 am for a period of
fifteen minutes and say that this will be the number of persons in the mall
for at least an hour, because generally that is the time we spent in
supermarkets.
Then this number could be updated to the customers so that they could plan
accordingly. This will though have a waiting time for the peoples to get
good updates.
And to avoid discrepancy the supermarket workers (s.w) can update the
information when large number of people start coming in to the store.


On Tue, Mar 17, 2020, 12:54 AM Orges Leka  wrote:

> Dear Python developers,
>
> I am a data scientist and use Python regularly. I have a question:
> How difficult is it to write a Python web-app, with the following basic
> functionality:
>
> The user writes anonymously without registration where (City, supermarket),
> when (Date and Time) he plans to go to the supermarket.
> If this is done by a lot of users, the first user gets to see the number of
> other buyers at this supermarket and can better plan when to go shopping.
> This would reduce the waiting queue at the supermarket and possibly the
> contact to other people thus would help a little bit in slowing down the
> spread of the Corona virus.
> One could also add openstreetmap functionality to this.
>
> As I am not a professional software developer, I can not predict how long
> it would take to write such a web-app in python.
>
> If you do not have currently time, but know someone who would possibly be
> interested in working at this project, I would be happy if you let me know.
>
> Kind regards,
> Orges Leka
>
> --
> Mit freundlichen Grüßen
> Herr Dipl. Math. Orges Leka
>
> Mobil: 015751078391
> Email: orges.l...@googlemail.com
> Holzheimerstraße 25
> 65549 Limburg
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-16 Thread Souvik Dutta
This app might also give real time updates.

On Tue, Mar 17, 2020, 10:19 AM Souvik Dutta  wrote:

> I think you might get a man build the app in a manner that allows the
> people at the supermarket to update the foot falls of the customers in a
> given time period. Like one might count the number on 10 am for a period of
> fifteen minutes and say that this will be the number of persons in the mall
> for at least an hour, because generally that is the time we spent in
> supermarkets.
> Then this number could be updated to the customers so that they could plan
> accordingly. This will though have a waiting time for the peoples to get
> good updates.
> And to avoid discrepancy the supermarket workers (s.w) can update the
> information when large number of people start coming in to the store.
>
>
> On Tue, Mar 17, 2020, 12:54 AM Orges Leka  wrote:
>
>> Dear Python developers,
>>
>> I am a data scientist and use Python regularly. I have a question:
>> How difficult is it to write a Python web-app, with the following basic
>> functionality:
>>
>> The user writes anonymously without registration where (City,
>> supermarket),
>> when (Date and Time) he plans to go to the supermarket.
>> If this is done by a lot of users, the first user gets to see the number
>> of
>> other buyers at this supermarket and can better plan when to go shopping.
>> This would reduce the waiting queue at the supermarket and possibly the
>> contact to other people thus would help a little bit in slowing down the
>> spread of the Corona virus.
>> One could also add openstreetmap functionality to this.
>>
>> As I am not a professional software developer, I can not predict how long
>> it would take to write such a web-app in python.
>>
>> If you do not have currently time, but know someone who would possibly be
>> interested in working at this project, I would be happy if you let me
>> know.
>>
>> Kind regards,
>> Orges Leka
>>
>> --
>> Mit freundlichen Grüßen
>> Herr Dipl. Math. Orges Leka
>>
>> Mobil: 015751078391
>> Email: orges.l...@googlemail.com
>> Holzheimerstraße 25
>> 65549 Limburg
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
-- 
https://mail.python.org/mailman/listinfo/python-list