From avi.e.gross at gmail.com Thu Sep 1 14:06:51 2022 From: avi.e.gross at gmail.com (avi.e.gross at gmail.com) Date: Thu, 1 Sep 2022 14:06:51 -0400 Subject: [Tutor] Just wanted to ask about SimpiLearn Data scientist course In-Reply-To: <917140316.1747418.1661867606203@mail.yahoo.com> References: <1945484005.1733295.1661867314863.ref@mail.yahoo.com> <1945484005.1733295.1661867314863@mail.yahoo.com> <917140316.1747418.1661867606203@mail.yahoo.com> Message-ID: <011101d8be2d$9ca71130$d5f53390$@gmail.com> I had already forwarded a similar message so I am glad he sent directly to the group. But sadly, sometimes people from some cultures might appreciate some of what you say is not good. Heck, imagine going to a school in your own country where the courses are mainly taught in English (and this is true in MANY countries for some subjects) and most of the students are local and most of the staff are local. They all speak English to various degrees and often with similar accents and maybe understand each other somewhat better than any outsider might. And, local customs being what they are, they may see chauvinistic comments 9whatever that means) as fun or with it rather than being deplorable to the outsider. Joking aside, I know of people who went to say a Medical School in some country and were the only real English speaker in an area that may not have especially favored aspects of themselves like gender and sexuality or racial/cultural/religious ... Online courses though can appeal to a more mixed worldwide audience. Old info being taught worked if only older equipment and software was available in the local market. But is that particularly true anymore in many parts of the world? -----Original Message----- From: Tutor On Behalf Of O ZA via Tutor Sent: Tuesday, August 30, 2022 9:53 AM To: tutor at python.org Subject: Re: [Tutor] Just wanted to ask about SimpiLearn Data scientist course I hope you receive my advice on time Data science is great, but Simplilearn is a horrible platform They play with dates, so that you cannot ask for a refund Their tutorials are really old, and they use low cost instructors who speak broken English and come out with chauvinistic comments There?s a Simplilearn fraud group on Facebook. Maybe you can also ask in there Please, let me know which course you eventually chose Good luck, ?scar On 29/08/2022 22.03, ??????? ???? wrote: > Hello! > I'm willing to have a course from SimpiLearn as a data scientist but > unfortunately I am not sure if is going to be a good course, I'm still > new and don't have any experience or knowledge about data scientist. _______________________________________________ Tutor maillist - Tutor at python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor From abdullahkhrief at gmail.com Thu Sep 1 20:57:38 2022 From: abdullahkhrief at gmail.com (Abdullah Rashid) Date: Fri, 2 Sep 2022 03:57:38 +0300 Subject: [Tutor] Tutor Digest, Vol 223, Issue 1 In-Reply-To: References: Message-ID: I really enjoying the conversations here, and sorry if the topic is a bit strange to ask, I really would like to start data scientist career, but don't know how to begin, so what are your advice to start the career? Thank you in advance for your help. On Thu, 1 Sept 2022, 19:01 , wrote: > Send Tutor mailing list submissions to > tutor at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://mail.python.org/mailman/listinfo/tutor > or, via email, send a message with subject or body 'help' to > tutor-request at python.org > > You can reach the person managing the list at > tutor-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Tutor digest..." > Today's Topics: > > 1. FW: Simplilearn data science (avi.e.gross at gmail.com) > 2. Re: Just wanted to ask about SimpiLearn Data scientist course > (O ZA) > > > > ---------- Forwarded message ---------- > From: > To: > Cc: > Bcc: > Date: Tue, 30 Aug 2022 13:01:14 -0400 > Subject: [Tutor] FW: Simplilearn data science > I am not clear on any RULES of etiquette here and may be violating some > broader expectations, but I am forwarding a message I received in private > from a third party. > > > > The topic is, or was, a user with some name like Abdallah Rashid (??????? > ????) who wrote a short message here and, as too often happens here, then > has not reappeared to respond to anything several of us wrote. In my > opinion, that is a fine reason to stop discussing it as we may be talking > to ourselves and it may not be a topic we are interested in. > > > > But we also have seen people in many groups like this who use it for their > own purposes and one such purpose can be to sort of advertise their product > and hope someone tries it. As I read it, we were being asked about a > platform for teaching in general, and on a specific, albeit loose, topic. > No pointers to a specific web page showing what was meant were given. > > > > The letter below was sent to me in what looks like a Bcc as a response to > the original message. As I understand it, it suggests that the Simplilearn > platform as a whole is not a great choice for the many reasons mentioned. > It goes to the point of suggesting it is a fraud. > > > > I, personally, am not in the market for taking courses to gain > credentials, but more along the lines of just for fun and enlightenment. I > have taken all kinds of courses over the years, both for free and with some > kind of tuition, and have had plenty where the instructor was not a native > English speaker and has had, shall we say, cultural differences. They were > not all low-cost either, but often simply people who were raised and > educated partially or completely in other places and were not cunning > linguists. I can usually get past that as long as they also know the > content well. Some can?t. But if I were to try to do lectures in one of the > many human languages I have decent familiarity with, and I include the > languages I spoke before English, I suspect I would not please the ones > listening that much either. Then again, after a few months, in my own > experience, I would adapt and probably do a passable job with less of an > accent or stumbling around for words. > > > > In any case, I think what ?scar wrote below and the fact the questioner > remains silent, are solid reasons for not continuing to delve into > Simplilearn further here. I am fairly sure there are better ways to learn > these topics but more importantly, better CREDENTIALS people can get for > real jobs. > > > > The reality is that many people (including many here) are largely > self-taught using things as simple as textbooks and playing around writing > and debugging actual programs. I came upon Python in the last decade or so > and began by reading lots of books on it and internet resources and did > some Coursera courses just for fun that rarely taught me anything new. I > then got books more focused on doing things like Statistics or Machine > Learning and so on, that had parts done using Python and packages (but > also, or instead, often other languages like R). Luckily, as I have no > regular day job, I do not need to care about credentials. If I was trying > to make a living using python, I would try to find out about jobs and what > they would accept as partial proof of eligibility, as was mentioned here. > For some people a good route is to redirect their early education towards > getting degrees in something like computer science that are broader than > one language or discipline like data analysis. For others, especially with > a shorter time-frame in mind, there may well be ways to earn decent > credentials in shorter periods but those may qualify you barely enough to > get in the door. > > > > When I joined Bell labs, I came from a complicated background that > included a Masters in Computer Science but the focus was both broad and > abstract and the experience was largely in other directions than the way > things were done there. I mean I had been using languages like FORTRAN and > Pascal on mainframes and DEC platforms like a VAX running VMS. At the labs > the languages I ended up using required learning more about C and UNIX and > an assortment of tools that overlapped but largely were different. I mean > different text editors and utilities and so on. > > > > What qualified me for the jobs I then did was not that I could walk in on > day one knowing everything but the fact I could learn anything rapidly and > already knew about quite a bit of similar things and ways and so on. > > > > And my job kept changing. If all I could do was one-trick, I would not > have lasted. My education has continued and will continue in a world that > is not static. Many of the things I once learned are now fairly useless and > some arguably never were useful. Most were fun, at least for a while. > > > > If a student is not able to learn easily on their own, or tries and > something in the books is not clicking, sure, classes chosen carefully may > be helpful. This forum is here partially for that reason as a supplement to > either books or classrooms. > > > > The letter from ?scar follows. I assume he is on this forum and am not > sure why he has trouble posting here. Usually a reply-all works. > > > > From: O ZA > Sent: Tuesday, August 30, 2022 9:49 AM > To: avi.e.gross at gmail.com > Subject: Simplilearn data science > > > > Hello > > > > Sorry for having contacted you directly. I?m new to this, and I don?t know > how to access your enquiry > > > > Data science is great, but Simplilearn is a horrible platform > > > > They play with dates, so that you cannot ask for a refund > > > > Their tutorials are really old, and they use low cost instructors who > speak broken English and come out with chauvinistic comments > > > > There?s a Simplilearn fraud group on Facebook. Maybe you can also ask in > there > > > > Please, let me know which course you eventually chose > > > > Good luck, > > > > ?scar > > > On 29/08/2022 22.03, ??????? ???? wrote: > > Hello! > > I'm willing to have a course from SimpiLearn as a data scientist but > > unfortunately I am not sure if is going to be a good course, I'm still > new > > and don't have any experience or knowledge about data scientist. > > > > > > ---------- Forwarded message ---------- > From: O ZA > To: > Cc: > Bcc: > Date: Tue, 30 Aug 2022 13:53:26 +0000 (UTC) > Subject: Re: [Tutor] Just wanted to ask about SimpiLearn Data scientist > course > I hope you receive my advice on time > > > Data science is great, but Simplilearn is a horrible platform > They play with dates, so that you cannot ask for a refund > Their tutorials are really old, and they use low cost instructors who > speak broken English and come out with chauvinistic comments > There?s a Simplilearn fraud group on Facebook. Maybe you can also ask in > there > Please, let me know which course you eventually chose > Good luck, > ?scar > > > On 29/08/2022 22.03, ??????? ???? wrote: > > Hello! > > I'm willing to have a course from SimpiLearn as a data scientist but > > unfortunately I am not sure if is going to be a good course, I'm still > new > > and don't have any experience or knowledge about data scientist. > > > > _______________________________________________ > Tutor maillist - Tutor at python.org > https://mail.python.org/mailman/listinfo/tutor > From abdullahkhrief at gmail.com Sun Sep 4 17:38:03 2022 From: abdullahkhrief at gmail.com (Abdullah Rashid) Date: Mon, 5 Sep 2022 00:38:03 +0300 Subject: [Tutor] Tutor Digest, Vol 223, Issue 2 In-Reply-To: References: Message-ID: Hello there! Thank you for your advice, I don't have a problem to study by English Language, I think it's harder to study data scientist by other languages since it's based on English Language, and I would like to have an online courses because I don't want it to be a struggle if I have got a job, but maybe I could have some courses in Saudi Arabia and it's still in English Language and it's not online, but as I said I don't have a problem with English, but still I don't know how to start the career... Thank you for your response On Fri, 2 Sept 2022, 19:01 , wrote: > Send Tutor mailing list submissions to > tutor at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://mail.python.org/mailman/listinfo/tutor > or, via email, send a message with subject or body 'help' to > tutor-request at python.org > > You can reach the person managing the list at > tutor-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Tutor digest..." > Today's Topics: > > 1. Re: Just wanted to ask about SimpiLearn Data scientist course > (avi.e.gross at gmail.com) > 2. Re: Tutor Digest, Vol 223, Issue 1 (Abdullah Rashid) > > > > ---------- Forwarded message ---------- > From: > To: "'O ZA'" , > Cc: > Bcc: > Date: Thu, 1 Sep 2022 14:06:51 -0400 > Subject: Re: [Tutor] Just wanted to ask about SimpiLearn Data scientist > course > I had already forwarded a similar message so I am glad he sent directly to > the group. > > But sadly, sometimes people from some cultures might appreciate some of > what you say is not good. Heck, imagine going to a school in your own > country where the courses are mainly taught in English (and this is true in > MANY countries for some subjects) and most of the students are local and > most of the staff are local. They all speak English to various degrees and > often with similar accents and maybe understand each other somewhat better > than any outsider might. And, local customs being what they are, they may > see chauvinistic comments 9whatever that means) as fun or with it rather > than being deplorable to the outsider. > > Joking aside, I know of people who went to say a Medical School in some > country and were the only real English speaker in an area that may not have > especially favored aspects of themselves like gender and sexuality or > racial/cultural/religious ... > > Online courses though can appeal to a more mixed worldwide audience. Old > info being taught worked if only older equipment and software was available > in the local market. But is that particularly true anymore in many parts of > the world? > > -----Original Message----- > From: Tutor On Behalf Of > O ZA via Tutor > Sent: Tuesday, August 30, 2022 9:53 AM > To: tutor at python.org > Subject: Re: [Tutor] Just wanted to ask about SimpiLearn Data scientist > course > > I hope you receive my advice on time > > > Data science is great, but Simplilearn is a horrible platform They play > with dates, so that you cannot ask for a refund Their tutorials are really > old, and they use low cost instructors who speak broken English and come > out with chauvinistic comments There?s a Simplilearn fraud group on > Facebook. Maybe you can also ask in there Please, let me know which course > you eventually chose Good luck, ?scar > > > On 29/08/2022 22.03, ??????? ???? wrote: > > Hello! > > I'm willing to have a course from SimpiLearn as a data scientist but > > unfortunately I am not sure if is going to be a good course, I'm still > > new and don't have any experience or knowledge about data scientist. > > > _______________________________________________ > Tutor maillist - Tutor at python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > > > > > > ---------- Forwarded message ---------- > From: Abdullah Rashid > To: tutor at python.org > Cc: > Bcc: > Date: Fri, 2 Sep 2022 03:57:38 +0300 > Subject: Re: [Tutor] Tutor Digest, Vol 223, Issue 1 > I really enjoying the conversations here, and sorry if the topic is a bit > strange to ask, > I really would like to start data scientist career, but don't know how to > begin, so what are your advice to start the career? > > Thank you in advance for your help. > > On Thu, 1 Sept 2022, 19:01 , wrote: > > > Send Tutor mailing list submissions to > > tutor at python.org > > > > To subscribe or unsubscribe via the World Wide Web, visit > > https://mail.python.org/mailman/listinfo/tutor > > or, via email, send a message with subject or body 'help' to > > tutor-request at python.org > > > > You can reach the person managing the list at > > tutor-owner at python.org > > > > When replying, please edit your Subject line so it is more specific > > than "Re: Contents of Tutor digest..." > > Today's Topics: > > > > 1. FW: Simplilearn data science (avi.e.gross at gmail.com) > > 2. Re: Just wanted to ask about SimpiLearn Data scientist course > > (O ZA) > > > > > > > > ---------- Forwarded message ---------- > > From: > > To: > > Cc: > > Bcc: > > Date: Tue, 30 Aug 2022 13:01:14 -0400 > > Subject: [Tutor] FW: Simplilearn data science > > I am not clear on any RULES of etiquette here and may be violating some > > broader expectations, but I am forwarding a message I received in private > > from a third party. > > > > > > > > The topic is, or was, a user with some name like Abdallah Rashid (??????? > > ????) who wrote a short message here and, as too often happens here, then > > has not reappeared to respond to anything several of us wrote. In my > > opinion, that is a fine reason to stop discussing it as we may be talking > > to ourselves and it may not be a topic we are interested in. > > > > > > > > But we also have seen people in many groups like this who use it for > their > > own purposes and one such purpose can be to sort of advertise their > product > > and hope someone tries it. As I read it, we were being asked about a > > platform for teaching in general, and on a specific, albeit loose, topic. > > No pointers to a specific web page showing what was meant were given. > > > > > > > > The letter below was sent to me in what looks like a Bcc as a response to > > the original message. As I understand it, it suggests that the > Simplilearn > > platform as a whole is not a great choice for the many reasons mentioned. > > It goes to the point of suggesting it is a fraud. > > > > > > > > I, personally, am not in the market for taking courses to gain > > credentials, but more along the lines of just for fun and enlightenment. > I > > have taken all kinds of courses over the years, both for free and with > some > > kind of tuition, and have had plenty where the instructor was not a > native > > English speaker and has had, shall we say, cultural differences. They > were > > not all low-cost either, but often simply people who were raised and > > educated partially or completely in other places and were not cunning > > linguists. I can usually get past that as long as they also know the > > content well. Some can?t. But if I were to try to do lectures in one of > the > > many human languages I have decent familiarity with, and I include the > > languages I spoke before English, I suspect I would not please the ones > > listening that much either. Then again, after a few months, in my own > > experience, I would adapt and probably do a passable job with less of an > > accent or stumbling around for words. > > > > > > > > In any case, I think what ?scar wrote below and the fact the questioner > > remains silent, are solid reasons for not continuing to delve into > > Simplilearn further here. I am fairly sure there are better ways to learn > > these topics but more importantly, better CREDENTIALS people can get for > > real jobs. > > > > > > > > The reality is that many people (including many here) are largely > > self-taught using things as simple as textbooks and playing around > writing > > and debugging actual programs. I came upon Python in the last decade or > so > > and began by reading lots of books on it and internet resources and did > > some Coursera courses just for fun that rarely taught me anything new. I > > then got books more focused on doing things like Statistics or Machine > > Learning and so on, that had parts done using Python and packages (but > > also, or instead, often other languages like R). Luckily, as I have no > > regular day job, I do not need to care about credentials. If I was trying > > to make a living using python, I would try to find out about jobs and > what > > they would accept as partial proof of eligibility, as was mentioned here. > > For some people a good route is to redirect their early education towards > > getting degrees in something like computer science that are broader than > > one language or discipline like data analysis. For others, especially > with > > a shorter time-frame in mind, there may well be ways to earn decent > > credentials in shorter periods but those may qualify you barely enough to > > get in the door. > > > > > > > > When I joined Bell labs, I came from a complicated background that > > included a Masters in Computer Science but the focus was both broad and > > abstract and the experience was largely in other directions than the way > > things were done there. I mean I had been using languages like FORTRAN > and > > Pascal on mainframes and DEC platforms like a VAX running VMS. At the > labs > > the languages I ended up using required learning more about C and UNIX > and > > an assortment of tools that overlapped but largely were different. I mean > > different text editors and utilities and so on. > > > > > > > > What qualified me for the jobs I then did was not that I could walk in on > > day one knowing everything but the fact I could learn anything rapidly > and > > already knew about quite a bit of similar things and ways and so on. > > > > > > > > And my job kept changing. If all I could do was one-trick, I would not > > have lasted. My education has continued and will continue in a world that > > is not static. Many of the things I once learned are now fairly useless > and > > some arguably never were useful. Most were fun, at least for a while. > > > > > > > > If a student is not able to learn easily on their own, or tries and > > something in the books is not clicking, sure, classes chosen carefully > may > > be helpful. This forum is here partially for that reason as a supplement > to > > either books or classrooms. > > > > > > > > The letter from ?scar follows. I assume he is on this forum and am not > > sure why he has trouble posting here. Usually a reply-all works. > > > > > > > > From: O ZA > > Sent: Tuesday, August 30, 2022 9:49 AM > > To: avi.e.gross at gmail.com > > Subject: Simplilearn data science > > > > > > > > Hello > > > > > > > > Sorry for having contacted you directly. I?m new to this, and I don?t > know > > how to access your enquiry > > > > > > > > Data science is great, but Simplilearn is a horrible platform > > > > > > > > They play with dates, so that you cannot ask for a refund > > > > > > > > Their tutorials are really old, and they use low cost instructors who > > speak broken English and come out with chauvinistic comments > > > > > > > > There?s a Simplilearn fraud group on Facebook. Maybe you can also ask in > > there > > > > > > > > Please, let me know which course you eventually chose > > > > > > > > Good luck, > > > > > > > > ?scar > > > > > > On 29/08/2022 22.03, ??????? ???? wrote: > > > Hello! > > > I'm willing to have a course from SimpiLearn as a data scientist but > > > unfortunately I am not sure if is going to be a good course, I'm still > > new > > > and don't have any experience or knowledge about data scientist. > > > > > > > > > > > > ---------- Forwarded message ---------- > > From: O ZA > > To: > > Cc: > > Bcc: > > Date: Tue, 30 Aug 2022 13:53:26 +0000 (UTC) > > Subject: Re: [Tutor] Just wanted to ask about SimpiLearn Data scientist > > course > > I hope you receive my advice on time > > > > > > Data science is great, but Simplilearn is a horrible platform > > They play with dates, so that you cannot ask for a refund > > Their tutorials are really old, and they use low cost instructors who > > speak broken English and come out with chauvinistic comments > > There?s a Simplilearn fraud group on Facebook. Maybe you can also ask in > > there > > Please, let me know which course you eventually chose > > Good luck, > > ?scar > > > > > > On 29/08/2022 22.03, ??????? ???? wrote: > > > Hello! > > > I'm willing to have a course from SimpiLearn as a data scientist but > > > unfortunately I am not sure if is going to be a good course, I'm still > > new > > > and don't have any experience or knowledge about data scientist. > > > > > > > > _______________________________________________ > > Tutor maillist - Tutor at python.org > > https://mail.python.org/mailman/listinfo/tutor > > > > _______________________________________________ > Tutor maillist - Tutor at python.org > https://mail.python.org/mailman/listinfo/tutor > From abhjop at gmail.com Tue Sep 6 08:18:26 2022 From: abhjop at gmail.com (Abhishek Yadav) Date: Tue, 6 Sep 2022 17:48:26 +0530 Subject: [Tutor] Help me to print this formatted output In-Reply-To: References: Message-ID: celsius = float(input('Enter temperature in celsius: ')) # Converting fahrenheit = 1.8 * celsius + 32 kelvin = 273.15 + celsius gap = " "*3 # Displaying output print(f"{'Celsius':7s}{gap}{'Fahrenheit':10s}{gap}{'Kelvin':6s}") print(f"{celsius:7.0f}{gap}{fahrenheit:10.1f}{gap}{kelvin:6.2f}") out put : -- Enter temperature in celsius: 10 Celsius Fahrenheit Kelvin 10 50.0 283.15 On Tue, 6 Sept 2022 at 17:42, Abhishek Yadav wrote: > > From alan.gauld at yahoo.co.uk Tue Sep 6 12:06:10 2022 From: alan.gauld at yahoo.co.uk (Alan Gauld) Date: Tue, 6 Sep 2022 17:06:10 +0100 Subject: [Tutor] Help me to print this formatted output In-Reply-To: References: Message-ID: On 06/09/2022 13:18, Abhishek Yadav wrote: > celsius = float(input('Enter temperature in celsius: ')) > > # Converting > fahrenheit = 1.8 * celsius + 32 > kelvin = 273.15 + celsius > gap = " "*3 > # Displaying output > print(f"{'Celsius':7s}{gap}{'Fahrenheit':10s}{gap}{'Kelvin':6s}") > print(f"{celsius:7.0f}{gap}{fahrenheit:10.1f}{gap}{kelvin:6.2f}") > > > out put : -- > > Enter temperature in celsius: 10 > Celsius Fahrenheit Kelvin > 10 50.0 283.15 Works fine for me. are you sure you have a monospace font in your display? -- 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 From learn2program at gmail.com Tue Sep 6 12:44:16 2022 From: learn2program at gmail.com (Alan Gauld) Date: Tue, 6 Sep 2022 17:44:16 +0100 Subject: [Tutor] Help me to print this formatted output In-Reply-To: References: Message-ID: On 06/09/2022 17:26, Abhishek Yadav wrote: > output should be like this > Celsius? ?Fahrenheit? ?Kelvin > 10? ? ? ? ? ?50.0? ? ? ? ? ? ?283.15 Yes and that's what I get(almost): ~/Desktop $ python3 tmp.py Enter temperature in celsius: 10 Celsius?? Fahrenheit?? Kelvin ???? 10???????? 50.0?? 283.15 You need to change the justification sign if you want it left aligned. > > On Tue, 6 Sept 2022 at 21:36, Alan Gauld via Tutor > wrote: > > On 06/09/2022 13:18, Abhishek Yadav wrote: > > celsius = float(input('Enter temperature in celsius: ')) > > > > # Converting > > fahrenheit = 1.8 * celsius + 32 > > kelvin = 273.15 + celsius > > gap = " "*3 > > # Displaying output > > print(f"{'Celsius':7s}{gap}{'Fahrenheit':10s}{gap}{'Kelvin':6s}") > > print(f"{celsius:7.0f}{gap}{fahrenheit:10.1f}{gap}{kelvin:6.2f}") > > > > > > out put? : -- > > > > Enter temperature in celsius: 10 > > Celsius? ?Fahrenheit? ?Kelvin > >? ? ? ? ?10? ? ? ? ? ? ? 50.0? 283.15 > > > Works fine for me. are you sure you have a monospace > font in your display? > > -- > 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 at python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- 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 From weok1965 at yahoo.com Thu Sep 15 07:15:42 2022 From: weok1965 at yahoo.com (Judy Roberts) Date: Thu, 15 Sep 2022 06:15:42 -0500 Subject: [Tutor] Questions on Python Programming in Context Third Edition References: Message-ID: I have a question on question # 2.36: Run the montePi function using 100,000 and 1 million darts. I am new to Python so struggling to find this answer. Can you enlighten me on the process please? Thank you in advance, Judy Roberts From mats at wichmann.us Thu Sep 15 11:16:40 2022 From: mats at wichmann.us (Mats Wichmann) Date: Thu, 15 Sep 2022 09:16:40 -0600 Subject: [Tutor] Questions on Python Programming in Context Third Edition In-Reply-To: References: Message-ID: On 9/15/22 05:15, Judy Roberts via Tutor wrote: > I have a question on question # 2.36: > > Run the montePi function using 100,000 and 1 million darts. > > I am new to Python so struggling to find this answer. Can you enlighten me on the process please? > > Thank you in advance, > Judy Roberts We don't have any idea what you're asking. There are hundreds of Python books, that's one I've never heard of, and personally haven't bought one for almost two decades. We don't know specifically what "montePi" is - can make a somewhat educated guess that it has to do with approximating Pi using the Monte Carlo method, but even so we wouldn't know what the specific problem statement in your book is. This forum works best if you come with a specific question - show some actual code, describe what's going wrong (pasting the full error message is usually best), and ask for help that way. From avi.e.gross at gmail.com Thu Sep 15 12:04:37 2022 From: avi.e.gross at gmail.com (avi.e.gross at gmail.com) Date: Thu, 15 Sep 2022 12:04:37 -0400 Subject: [Tutor] Questions on Python Programming in Context Third Edition In-Reply-To: References: Message-ID: <009c01d8c91c$daf22840$90d678c0$@gmail.com> Judy, Just FYI, just about everybody here is not in your class or has immediate access to your textbook. Your question SOUNDS LIKE you already have a function called "montePi " and it can be called with one or more arguments directing what it does. I think it is a Monte Carlo method for estimating the constant "pi". Again, just as a guess, it sounds like the algorithm throws random darts at a "square" target and tests how many fall within an inscribed circle. It can do this umpteen times and then divide one sum from the other to determine a ratio and so on and then determine what pi must be for that to happen. That is not relevant though for the question. The function sounds like it wants to be told how many random darts to throw. You are asked to call the function twice. Once telling it to do 100,00 random darts and another time to do a million darts. Presumably the goal is to see if you get more significant digits of pi correctly if you throw more random numbers at the problem. If I am write, this is only a Python problem if you are asking how to start Python, make the function available and call it several times and examine the output. So do you know how to call a function in Python with one or more changes such as sin(.5) and sin(.6) and what the way to call the montePi() function is? Again, I and most others cannot see the question so consider telling anything you want anyone to see explicitly. No attachments either. Avi -----Original Message----- From: Tutor On Behalf Of Judy Roberts via Tutor Sent: Thursday, September 15, 2022 7:16 AM To: tutor at python.org Subject: [Tutor] Questions on Python Programming in Context Third Edition I have a question on question # 2.36: Run the montePi function using 100,000 and 1 million darts. I am new to Python so struggling to find this answer. Can you enlighten me on the process please? Thank you in advance, Judy Roberts _______________________________________________ Tutor maillist - Tutor at python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor From torbjorn.svensson.diaz at gmail.com Fri Sep 16 11:53:04 2022 From: torbjorn.svensson.diaz at gmail.com (=?UTF-8?Q?Torbj=c3=b6rn_Svensson_Diaz?=) Date: Fri, 16 Sep 2022 17:53:04 +0200 Subject: [Tutor] OT: Line wrap Message-ID: <867ec052-d304-6bb3-f0e4-1f2f76be28cf@gmail.com> Dear, tutors, From a manual about mail lists: Quote. 2.3. What is considered proper etiquette when posting to the mailing lists? Please wrap lines at 75 characters, since not everyone uses fancy GUI mail reading programs.End quote. How do I configure this in Mozilla Thunderbird? I use Mozilla 102.2.2. -- Torbj?rn Svensson Diaz From jf_byrnes at comcast.net Fri Sep 16 14:24:42 2022 From: jf_byrnes at comcast.net (Jim Byrnes) Date: Fri, 16 Sep 2022 13:24:42 -0500 Subject: [Tutor] OT: Line wrap In-Reply-To: <867ec052-d304-6bb3-f0e4-1f2f76be28cf@gmail.com> References: <867ec052-d304-6bb3-f0e4-1f2f76be28cf@gmail.com> Message-ID: On 9/16/22 10:53, Torbj?rn Svensson Diaz wrote: > Dear, tutors, > > > From a manual about mail lists: > > Quote. > 2.3. What is considered proper etiquette when posting to the mailing lists? > Please wrap lines at 75 characters, since not everyone uses fancy GUI > mail reading programs.End quote. > > How do I configure this in Mozilla Thunderbird? I use Mozilla 102.2.2. > > > > It's more complicated than I remembered. Settings-->General scroll down to the bottom and click config editor. Then type wrap in the search box. The setting you want is mailnews.wraplength. regards, Jim From avi.e.gross at gmail.com Fri Sep 16 13:48:11 2022 From: avi.e.gross at gmail.com (avi.e.gross at gmail.com) Date: Fri, 16 Sep 2022 13:48:11 -0400 Subject: [Tutor] OT: Line wrap In-Reply-To: <867ec052-d304-6bb3-f0e4-1f2f76be28cf@gmail.com> References: <867ec052-d304-6bb3-f0e4-1f2f76be28cf@gmail.com> Message-ID: <03ec01d8c9f4$7d45a8b0$77d0fa10$@gmail.com> You definitely came to the right place for this question. We all use Thunderbird as our mailer and we have had lots of complaints on this forum that lines are not wrapping properly and need to be kept short. I am breathlessly awaiting the solutions offered. OK, to be serious, although this forum is meant primarily to help people regarding specifically Python programming, there have been issues with what might loosely be called mail etiquette. It can be tricky as just about any mailer used set to any format (including plain text) ends up being displayed oddly by some reader out there, including things like a cell phone with a small screen. So some mailing lists convert everything they get to plain text, often causing more issues and strip attachments, causing yet more. I do NOT like using plain text as my default as I like being able to use HTML features in my usual mail for other purposes and do not like switching back and forth to text mode. But life is what it is and I do sometimes do annoying things like manually shorten my lines of text. But if you make changes in your mailer, what are you expecting? Do you want the lines wrapped ON YOUR SCREEN the way you want (and often not as the sender intended) or do you want your outgoing mail altered so long seemingly wrapped lines on your screen are actually wrapped into multiple lines on the output? I note some people like their lines intact and be able to scroll sideways. As an example, when I look at the contents of a wide data.frame then the wrapping makes it useless as columns no longer line up at all. Long lines I can slide sideways in may be better. Good Luck, perhaps asking the question again in a forum that might deal with it or doing a SEARCH that includes the name of your mailer and some keywords. -----Original Message----- From: Tutor On Behalf Of Torbj?rn Svensson Diaz Sent: Friday, September 16, 2022 11:53 AM To: tutor at python.org Subject: [Tutor] OT: Line wrap Dear, tutors, From a manual about mail lists: Quote. 2.3. What is considered proper etiquette when posting to the mailing lists? Please wrap lines at 75 characters, since not everyone uses fancy GUI mail reading programs.End quote. How do I configure this in Mozilla Thunderbird? I use Mozilla 102.2.2. -- Torbj?rn Svensson Diaz _______________________________________________ Tutor maillist - Tutor at python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor From torbjorn.svensson.diaz at gmail.com Fri Sep 16 14:54:37 2022 From: torbjorn.svensson.diaz at gmail.com (=?UTF-8?Q?Torbj=c3=b6rn_Svensson_Diaz?=) Date: Fri, 16 Sep 2022 20:54:37 +0200 Subject: [Tutor] OT: Line wrap In-Reply-To: References: <867ec052-d304-6bb3-f0e4-1f2f76be28cf@gmail.com> Message-ID: On 2022-09-16 20:24, Jim Byrnes wrote: > > It's more complicated than I remembered. Settings-->General scroll > down to the bottom and click config editor. Then type wrap? in the > search box. The setting you want is mailnews.wraplength. I tried this and it seems as though it's in my display that there's something wrong. When I view source of emails that I sent to email lists, everything is working the way it should. But when I read then in the normal way, lines do not wrap the way I want them to. Instead I see very long lines. What to do? Best regards, -- Torbj?rn Svensson Diaz From PythonList at DancesWithMice.info Sat Sep 17 17:12:37 2022 From: PythonList at DancesWithMice.info (dn) Date: Sun, 18 Sep 2022 09:12:37 +1200 Subject: [Tutor] OT: Line wrap In-Reply-To: References: <867ec052-d304-6bb3-f0e4-1f2f76be28cf@gmail.com> Message-ID: <3f6d8033-d423-c6aa-e988-c2981fba1c33@DancesWithMice.info> On 17/09/2022 06.54, Torbj?rn Svensson Diaz wrote: > On 2022-09-16 20:24, Jim Byrnes wrote: >> >> It's more complicated than I remembered. Settings-->General scroll >> down to the bottom and click config editor. Then type wrap? in the >> search box. The setting you want is mailnews.wraplength. > > > I tried this and it seems as though it's in my display that there's > something wrong. When I view source of emails that I sent to email > lists, everything is working the way it should. But when I read then in > the normal way, lines do not wrap the way I want them to. Instead I see > very long lines. What to do? Am impressed, even amazed, that you have taken the trouble to read 'the manual' and other rules relating to our Discussion List. Thank you! Like many conventions and regulations there are multiple dimensions to the background reasons and considerations. The TLDR; is that the 80/79/75 is historical and largely does not apply today. So, most have (actively or passively) ignored it and 'moved-on'. Please join our community, ask your questions, mentor others, and generally make the [?Python] world a better place... The long form: Simple text cf HTML Writing cf Reading Text cf Code Email "reflectors" Line-limits are a hold-over from the days of punched-cards and early VDU-screens on mini-computers (of fond memory only to us grey-beards). Now that higher-resolution screens are in popular-use, considerably-longer lines can be displayed across a screen - even across a sheet of paper (remember that technology?). Similarly, we no longer use punched-cards as an input-device (despite their excellence for re-cycling as book-marks and ToDo/shopping-lists). When typing, it probably doesn't matter how wide the screen, or how far it might allow the line to extend. Contrarily, when reading, width matters. The established view is that speed-reading is best achieved by keeping both head/neck relatively-still, and attempting to see as much of a line of text at a time without extra effort. Accordingly, the width or a line at reading-time is (?should be) limited by one's field-of-view* and quality of eye-sight. (why are novels and text-books produced in set formats? why are newspapers - particularly "broad-sheets" divided into columns?) * needing glasses/spectacles, I can't wear bi-focals because their 'dot' of close-up focus is too narrow for reading, ie how to become sea-sick without leaving port. Originally email was limited to the characters in the 7-bit ASCII-code. This meant that many languages/scripts were excluded. It even limited 'fancy features' such as the use of /italics/ or *bold-text* to make points 'stand out', or underlines to identify URLs (for example). These days are passed, with most OpSys and email-systems adopting UniCode. Another 'new-development' now relegated to the distant-past has been enabling different fonts. Not merely a matter of appearance, but with "proportionally-spaced fonts". Suddenly the definition of line-length had to change! Two lines which could fit into exactly the same width/number of horizontal-pixels might contain quite different numbers of characters by virtue of font-choice. Width became defined in pixels or centimetres/inches. (on which point, maybe this essay should cease; and the list-requirement defined in characters, be expunged!) When Microsoft finally (and very late) climbed-aboard the 'Internet-bus', they had a mind to web-ify everything. (You can still find web-pages which were built using MS-Word and are horrendously-bloated as a result) This included their email-client offerings, starting with Outlook Express and rapidly-thereafter, full-fat Outlook. Accordingly, they offered a choice of "HTML format" or "Simple text format". At which point opportunity abounded or the downfall began - depending upon your point-of-view. Marketing folk went 'nuts', and started producing email-messages with all manner of 'bells and whistles' - only to discover that many email-clients were incapable of displaying same. Thus, giving rise to a veritable industry of people associated with ascertaining what works, and what doesn't - and generations of marketing-wonks who, to this day, haven't figured it out - because "I don't 'do' technology" (yet still know how to choose flash cars, offices, ... - can you detect any bias?). Back to "bloat": much HTML-laden email is (still) sent as a game-of-two-halves, with a "simple text version" as well (for the benefit of 'simple' email-clients or email-users?). Thus, many email-clients offer a choice of which to display (first). This all contributed to the plaintive question amongst IT-specialists and non-specialists alike: "why does it take so long for this message to load?" I expect that as bandwidth-to-the-desktop has increased, we don't hear this so-often. Although, many a SysAdmin will confirm that the space-required on the backing-store for email has exploded (this only one of many factors) - hence: 'please prune your archives...'! The sad part was that MSFT chose to trumpet their HTML-offerings in the style of recent-converts proselytising (aka "feature creep", "marketing", and "give us more of your money"), and by denigrating 'the old ways'. Thus, calling it "Simple text format". What they failed to foresee was how the HTML-option would become a vehicle whereby viruses and other security risks could become embedded within email messages (cf .doc, .PDF, etc, viruses embedded in "attachments"). Not too 'smart' then? Accordingly, a good reason many of us chose to stick with "Simple text format"! Rather than equating "simple" with 'brainless', 'stupid', or 'unintelligent'; please review what "The Zen of Python" has to say on the subject. In relation to line-length, Thunderbird is currently limiting these typed-lines to something less than 80-characters, and auto-magically performing a word-wrap when (it deems) necessary. I have no recollection of setting this myself - however, this Tb-profile probably dates-back decades; having migrated from machine-to-machine, OpSys-to-OpSys, and version-to-version (even country-to-country) over the period. When it comes to reading, the OP's didn't, but @Avi's and @Jim's replies featured paragraphs (text between Enter-keying*) longer than 'the limit'. Thunderbird presents these according to the width of the containing-panel. Displaying the message in its own window will (potentially) extend line-length to the width of the screen/resolution of the display (etc). Keeping it within a panel sharing the screen with 'folders' and 'headers' panels restricts display-width. Accordingly, upon display, both HTML and 'Simple text' will "flow" according to the width of the application-window (HTML may be subject to other formatting-factors). Thus, control is the hands of the email-recipient, ie "beauty is in the eye of the beholder" and "suit yourself". * there's another issue: different OpSys terminate a line/paragraph with either an LF-character or a CR+LF combination. What joy when one's work has to move-between/work for both! Matters of style in Python are frequently driven by PEP-008 (even though it does not necessarily apply). This also refers to a line-limit. The justification there comes back to 'reading'. We often need to see code reproduced in messages to this list. Thus, there could be two 'line limits' to face! In some cases (and some first-time post-ers) the OpSys line-ending differences become apparent, or indentation is 'lost'. Again, this is less-likely to happen when using "simple text" (but not impossible)! OTOH if the author is committed to HTML-format, adjusting code-presentation to use a fixed-width (mono) font would be a great favor to the reader(s) - but, in-turn assumes that the reader's computer offers the same or some compatible font! The nature of this list is to develop conversations (just as 'here'). Accordingly, messages start-out neatly-formatted. As replies develop into "threads" of replies-to-replies, most email-clients differentiate the stages of the conversation by color-coding (HTML-format) and/or indenting older-text with a prefix/marker. Inevitably, longer lines will thus exceed a line-length limit and will be 'wrapped' and then 're-wrapped' creating little 'stubby' part-lines. This becomes ugly, very quickly! Probably most adapt to the situation and accept it. If code is to remain readable, then life becomes difficult! Sometimes code is mis-represented in the original post. The Python Console or REPL prefixes code-lines with three right angle-brackets (">"). If such code is copied from the terminal into an email-message, the recipient's email-client may mis-interpret the prefix-characters in a non-Pythonic fashion. Sad to say... This leads to a social (rather than technical) call (of many Discussion Lists), that replies be "interposed", "top-posted", or "bottom-posted". The latter avoid the issue of replies being auto-indented and lines of text being re-wrapped as a result. The former reproduces the flow of normal human conversation: you ask a question, and I (subsequently) answer it, point-by-point. Finally, we come to the underlying technology of the list itself. A "reflector" is a specialised email-server which accepts a single-message (from a member) and broadcasts ("reflects") it 'out' to all of list-members. There are options relating to how such servers are configured, which affect messaging - and with which we must all live. This is the point at which only certain formats are accepted, and (a frequent error by first-time post-ers) specific attachments are unceremoniously and "silently" stripped (eg "Tutor" will not accept graphics). Interestingly some such restrictive ideas relate to 'security' (eg viruses) but others date-back to a time when message-size and 'bandwidth' considerations were rated more-important (perhaps a trend re-emerging as mobile-users become impatient with long-load times, excessive memory demands, and paying over-the-odds traffic-fees). Am closing in appreciation of the concern-raised, and expressing hope that you will bring much value to the community through attention to detail and consideration of others... -- Regards, =dn From dbhagler at gmail.com Wed Sep 21 06:36:52 2022 From: dbhagler at gmail.com (Dominique Hagler) Date: Wed, 21 Sep 2022 06:36:52 -0400 Subject: [Tutor] Create command Message-ID: Create a command line tool for storing and fetching key-value pairs. In other words, given a key and a value, which are both strings, it can store key and value together, and then return that value when fetched by that key. The tool must be able to be run from the command line by typing "key-value", though it is acceptable to also require the path or an extension (eg, "./key-value.rb" is fine). If needed, it is acceptable to include a setup script that must be run before the tool can be run. Running the tool must open an interactive session that accepts put, fetch, and exit commands. When ready to accept a command, it must output the string "> " as a command prompt. My command example: Person1 = { ?name? : ? Daisy?, ?age?: 20} Thank you, Dominique Hagler Have a great day! Sent from an iPhone, so please excuse brevity and typos! From torbjorn.svensson.diaz at gmail.com Sun Sep 18 11:37:12 2022 From: torbjorn.svensson.diaz at gmail.com (=?UTF-8?Q?Torbj=c3=b6rn_Svensson_Diaz?=) Date: Sun, 18 Sep 2022 17:37:12 +0200 Subject: [Tutor] OT: Line wrap In-Reply-To: <3f6d8033-d423-c6aa-e988-c2981fba1c33@DancesWithMice.info> References: <867ec052-d304-6bb3-f0e4-1f2f76be28cf@gmail.com> <3f6d8033-d423-c6aa-e988-c2981fba1c33@DancesWithMice.info> Message-ID: On 2022-09-17 23:12, dn wrote: > On 17/09/2022 06.54, Torbj?rn Svensson Diaz wrote: >> I tried this and it seems as though it's in my display that there's >> something wrong. When I view source of emails that I sent to email >> lists, everything is working the way it should. But when I read then in >> the normal way, lines do not wrap the way I want them to. Instead I see >> very long lines. What to do? > Am impressed, even amazed, that you have taken the trouble to read 'the > manual' and other rules relating to our Discussion List. Thank you! > > Snip - Interesting text. > Am closing in appreciation of the concern-raised, and expressing hope > that you will bring much value to the community through attention to > detail and consideration of others... Thank you for that and for an interesting answer! -- Torbj?rn Svensson Diaz From steve at madscience.zone Wed Sep 21 18:57:55 2022 From: steve at madscience.zone (Steve Willoughby) Date: Wed, 21 Sep 2022 15:57:55 -0700 Subject: [Tutor] Create command In-Reply-To: References: Message-ID: <58B28372-7CDF-4D69-9AE8-468B3EB4B2FD@madscience.zone> Dominique, It looks like you have an interesting homework exercise there to figure out. I don?t see a specific question from you, though. What have you tried so far? How did that work? What are your thoughts for where to proceed with this? We can help guide you in your course of discovery here, but we need something to start with since we?re not going to do your homework for y ou. > On 21-Sep-2022, at 03:36, Dominique Hagler wrote: > > Create a command line tool for storing and fetching key-value pairs. In other words, given a key and a value, which are both strings, it can store key and value together, and then return that value when fetched by that key. The tool must be able to be run from the command line by typing "key-value", though it is acceptable to also require the path or an extension (eg, "./key-value.rb" is fine). If needed, it is acceptable to include a setup script that must be run before the tool can be run. Running the tool must open an interactive session that accepts put, fetch, and exit commands. When ready to accept a command, it must output the string "> " as a command prompt. > > My command example: > > Person1 = { ?name? : ? Daisy?, ?age?: 20} > > > Thank you, > > Dominique Hagler > Have a great day! > > Sent from an iPhone, so please excuse brevity and typos! > _______________________________________________ > Tutor maillist - Tutor at python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor From steve at madscience.zone Wed Sep 21 19:18:50 2022 From: steve at madscience.zone (Steve Willoughby) Date: Wed, 21 Sep 2022 16:18:50 -0700 Subject: [Tutor] Create command In-Reply-To: References: <58B28372-7CDF-4D69-9AE8-468B3EB4B2FD@madscience.zone> Message-ID: <46CDCA9E-E741-4058-A5C6-26D75950CBB4@madscience.zone> It looks like you?re getting used to using Python in interactive mode, which is a good way to become familiar with the language features or try out an idea quickly. However, for this it sounds like you?re going to need to write a Python program of your own which interacts with the user, so I?d start by working on putting together some kind of loop which prompts the user, reads their command, and then figures out what they want to do based on the input they typed, then repeat. So look at how while and for loops work, and how to read input from the user using the input function, then look for ideas on how to examine the string entered by the user to see if it?s a ?put?, ?fetch?, or ?exit? command. Once you have that much working, I?d add the details of setting up some kind of storage and retrieval. It?s not clear from the problem given whether they want you to permanently store the data so if you restart the program you still have all the data stored previously, or just need to hold it in memory for retrieval during the same run of the program. > On 21-Sep-2022, at 16:11, Dominique Hagler wrote: > > Hi Steve, > > This is what I have come up with. Sorry still not sure how to save it correctly. > > > > > > Thank you, > > Dominique Hagler > Have a great day! > > Sent from an iPhone, so please excuse brevity and typos! > >> On Sep 21, 2022, at 6:57 PM, Steve Willoughby wrote: >> >> ?Dominique, >> >> It looks like you have an interesting homework exercise there to figure out. I don?t see a specific question from you, though. What have you tried so far? How did that work? What are your thoughts for where to proceed with this? >> >> We can help guide you in your course of discovery here, but we need something to start with since we?re not going to do your homework for y ou. >> >>> On 21-Sep-2022, at 03:36, Dominique Hagler wrote: >>> >>> Create a command line tool for storing and fetching key-value pairs. In other words, given a key and a value, which are both strings, it can store key and value together, and then return that value when fetched by that key. The tool must be able to be run from the command line by typing "key-value", though it is acceptable to also require the path or an extension (eg, "./key-value.rb" is fine). If needed, it is acceptable to include a setup script that must be run before the tool can be run. Running the tool must open an interactive session that accepts put, fetch, and exit commands. When ready to accept a command, it must output the string "> " as a command prompt. >>> >>> My command example: >>> >>> Person1 = { ?name? : ? Daisy?, ?age?: 20} >>> >>> >>> Thank you, >>> >>> Dominique Hagler >>> Have a great day! >>> >>> Sent from an iPhone, so please excuse brevity and typos! >>> _______________________________________________ >>> Tutor maillist - Tutor at python.org >>> To unsubscribe or change subscription options: >>> https://mail.python.org/mailman/listinfo/tutor >> From steve at madscience.zone Wed Sep 21 20:27:20 2022 From: steve at madscience.zone (Steve Willoughby) Date: Wed, 21 Sep 2022 17:27:20 -0700 Subject: [Tutor] Create command In-Reply-To: References: <58B28372-7CDF-4D69-9AE8-468B3EB4B2FD@madscience.zone> <46CDCA9E-E741-4058-A5C6-26D75950CBB4@madscience.zone> Message-ID: <333BEAA5-C9DA-4E75-8AAF-FD8341894C6C@madscience.zone> Ok, that?s good. Now try putting that in a loop so it asks over and over, then look at changing if from the question of name and age to the commands the assignment is asking for. > On 21-Sep-2022, at 17:06, Dominique Hagler wrote: > > I started over and this is what I have so far. > > On Wed, Sep 21, 2022 at 7:18 PM Steve Willoughby wrote: > It looks like you?re getting used to using Python in interactive mode, which is a good way to become familiar with the language features or try out an idea quickly. > > However, for this it sounds like you?re going to need to write a Python program of your own which interacts with the user, so I?d start by working on putting together some kind of loop which prompts the user, reads their command, and then figures out what they want to do based on the input they typed, then repeat. > > So look at how while and for loops work, and how to read input from the user using the input function, then look for ideas on how to examine the string entered by the user to see if it?s a ?put?, ?fetch?, or ?exit? command. > > Once you have that much working, I?d add the details of setting up some kind of storage and retrieval. It?s not clear from the problem given whether they want you to permanently store the data so if you restart the program you still have all the data stored previously, or just need to hold it in memory for retrieval during the same run of the program. > > > >> On 21-Sep-2022, at 16:11, Dominique Hagler > wrote: >> >> Hi Steve, >> >> This is what I have come up with. Sorry still not sure how to save it correctly. >> >> >> >> >> >> Thank you, >> >> Dominique Hagler >> Have a great day! >> >> Sent from an iPhone, so please excuse brevity and typos! >> >>> On Sep 21, 2022, at 6:57 PM, Steve Willoughby > wrote: >>> >>> ?Dominique, >>> >>> It looks like you have an interesting homework exercise there to figure out. I don?t see a specific question from you, though. What have you tried so far? How did that work? What are your thoughts for where to proceed with this? >>> >>> We can help guide you in your course of discovery here, but we need something to start with since we?re not going to do your homework for y ou. >>> >>>> On 21-Sep-2022, at 03:36, Dominique Hagler > wrote: >>>> >>>> Create a command line tool for storing and fetching key-value pairs. In other words, given a key and a value, which are both strings, it can store key and value together, and then return that value when fetched by that key. The tool must be able to be run from the command line by typing "key-value", though it is acceptable to also require the path or an extension (eg, "./key-value.rb" is fine). If needed, it is acceptable to include a setup script that must be run before the tool can be run. Running the tool must open an interactive session that accepts put, fetch, and exit commands. When ready to accept a command, it must output the string "> " as a command prompt. >>>> >>>> My command example: >>>> >>>> Person1 = { ?name? : ? Daisy?, ?age?: 20} >>>> >>>> >>>> Thank you, >>>> >>>> Dominique Hagler >>>> Have a great day! >>>> >>>> Sent from an iPhone, so please excuse brevity and typos! >>>> _______________________________________________ >>>> Tutor maillist - Tutor at python.org >>>> To unsubscribe or change subscription options: >>>> https://mail.python.org/mailman/listinfo/tutor >>> > > > > -- > Thank You, > Dominique Hagler > > > From avi.e.gross at gmail.com Wed Sep 21 21:57:08 2022 From: avi.e.gross at gmail.com (avi.e.gross at gmail.com) Date: Wed, 21 Sep 2022 21:57:08 -0400 Subject: [Tutor] Create command In-Reply-To: <58B28372-7CDF-4D69-9AE8-468B3EB4B2FD@madscience.zone> References: <58B28372-7CDF-4D69-9AE8-468B3EB4B2FD@madscience.zone> Message-ID: <002d01d8ce26$a008a5b0$e019f110$@gmail.com> Steve, I think it is time for some of us to go into business and charge $500 or more per hour to actually DO people's HW from beginning to end and not even think of trying to get them to learn anything. I am afraid even at that price we might have people who took us seriously and were willing to pay! LOL! Kidding aside, I and others here want to be helpful but not do their work. The goal is supposed to be to get them to think and learn and perhaps explain some facet where they are stuck. I am not clear what Dominique wants as her understanding of the word "command" may very much differ from what some of us may mean. So to be clear, the assignment she is looking at can range from the trivial to the complex. There already is built-in python functionality that deals with key value pairs in data structures with names like dictionary or hash or associative array. A function that encapsulates that may not be needed but can be simple enough. But what is a command line? Is it the shell in which you invoke python from as in the old days? Probably not as a way to call python and ask it to store a key/value pair and return immediately seems less than useful. So, I assume she means the console-level of a python interpreter. But what does it mean to type "key-value" there, let alone "./key-value.rb" ??? The latter looks like a RUBY file and that is not even python. So the question is a tad muddled and a non-starter even if we were willing to do her HW. My guess is that what is being asked for is sort of like asking you to write a primitive calculator in python and then calling it interactively and having it read your commands like "5 + 3" and parsing and evaluating such commands line after line till you quit. So without providing an answer, it is my GUESS you need to write a stand-alone python program. Give it a name like hashing.py and call it from a command line or double click on an icon or whatever. Inside the program it should initialize something like an empty dictionary object and read lines from STDIN that the user types that use some format to specify your request to add a key and value pair. Additional commands it should handle are mentioned such as fetching the value for an existing key. Who knows what else is being asked, such as showing the current contents, deleting and so on. It sounds a bit like the calculator analogy. Make a program that lets you add and modify and whatever the contents of dictionary. I see no code illustrating such a user interface. The class should have covered how to play with something like a dictionary (or is asking to build your own) and how to read from a console and write to it and so on. But as none of us here has been in the class or seen what materials have been covered, and it is not our HW, I think Dominique should either do it herself and only ask when some more specific Python question comes up, such as how do you put out a prompt without a carriage return inserted, or whatever. The HW is meant to have the student learn and mostly do it themselves so if test (or the real world) comes around, ... I may be a bit touchy as someone on another forum submitted totally clearly a HW style question that their girlfriend asked them to do for her, so of course they figured they delegate it to a random bunch of people out there and take the credit. I sent a note suggesting we don't really feel like doing HW, especially so indirectly and got a reply: " so what if it is home work - if you can't do something, simply walk away- " What a nice attitude. Totally missed or avoided my point and suggested I leave them alone to find someone else to do it for them. Like I said, if we charged $500/hour, would most people realize that the goal is to do it for themselves? -----Original Message----- From: Tutor On Behalf Of Steve Willoughby Sent: Wednesday, September 21, 2022 6:58 PM To: Dominique Hagler Cc: tutor at python.org Subject: Re: [Tutor] Create command Dominique, It looks like you have an interesting homework exercise there to figure out. I don?t see a specific question from you, though. What have you tried so far? How did that work? What are your thoughts for where to proceed with this? We can help guide you in your course of discovery here, but we need something to start with since we?re not going to do your homework for y ou. > On 21-Sep-2022, at 03:36, Dominique Hagler wrote: > > Create a command line tool for storing and fetching key-value pairs. In other words, given a key and a value, which are both strings, it can store key and value together, and then return that value when fetched by that key. The tool must be able to be run from the command line by typing "key-value", though it is acceptable to also require the path or an extension (eg, "./key-value.rb" is fine). If needed, it is acceptable to include a setup script that must be run before the tool can be run. Running the tool must open an interactive session that accepts put, fetch, and exit commands. When ready to accept a command, it must output the string "> " as a command prompt. > > My command example: > > Person1 = { ?name? : ? Daisy?, ?age?: 20} > > > Thank you, > > Dominique Hagler > Have a great day! > > Sent from an iPhone, so please excuse brevity and typos! > _______________________________________________ > 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 From dbhagler at gmail.com Wed Sep 21 19:11:55 2022 From: dbhagler at gmail.com (Dominique Hagler) Date: Wed, 21 Sep 2022 19:11:55 -0400 Subject: [Tutor] Create command In-Reply-To: <58B28372-7CDF-4D69-9AE8-468B3EB4B2FD@madscience.zone> References: <58B28372-7CDF-4D69-9AE8-468B3EB4B2FD@madscience.zone> Message-ID: Hi Steve, This is what I have come up with. Sorry still not sure how to save it correctly. Thank you, Dominique Hagler Have a great day! Sent from an iPhone, so please excuse brevity and typos! > On Sep 21, 2022, at 6:57 PM, Steve Willoughby wrote: > > ?Dominique, > > It looks like you have an interesting homework exercise there to figure out. I don?t see a specific question from you, though. What have you tried so far? How did that work? What are your thoughts for where to proceed with this? > > We can help guide you in your course of discovery here, but we need something to start with since we?re not going to do your homework for y ou. > >> On 21-Sep-2022, at 03:36, Dominique Hagler wrote: >> >> Create a command line tool for storing and fetching key-value pairs. In other words, given a key and a value, which are both strings, it can store key and value together, and then return that value when fetched by that key. The tool must be able to be run from the command line by typing "key-value", though it is acceptable to also require the path or an extension (eg, "./key-value.rb" is fine). If needed, it is acceptable to include a setup script that must be run before the tool can be run. Running the tool must open an interactive session that accepts put, fetch, and exit commands. When ready to accept a command, it must output the string "> " as a command prompt. >> >> My command example: >> >> Person1 = { ?name? : ? Daisy?, ?age?: 20} >> >> >> Thank you, >> >> Dominique Hagler >> Have a great day! >> >> Sent from an iPhone, so please excuse brevity and typos! >> _______________________________________________ >> Tutor maillist - Tutor at python.org >> To unsubscribe or change subscription options: >> https://mail.python.org/mailman/listinfo/tutor > From dbhagler at gmail.com Wed Sep 21 22:30:27 2022 From: dbhagler at gmail.com (Dominique Hagler) Date: Wed, 21 Sep 2022 22:30:27 -0400 Subject: [Tutor] Create command In-Reply-To: <002d01d8ce26$a008a5b0$e019f110$@gmail.com> References: <002d01d8ce26$a008a5b0$e019f110$@gmail.com> Message-ID: Avi, I never asked anyone to DO my homework I was providing what I had so I could have a better understanding. Thank you, I will no longer need service from you all. Thank you Steve for taking the time that you did. Thank you, Dominique Hagler Have a great day! Sent from an iPhone, so please excuse brevity and typos! > On Sep 21, 2022, at 9:57 PM, avi.e.gross at gmail.com wrote: > > ?Steve, > > I think it is time for some of us to go into business and charge $500 or more per hour to actually DO people's HW from beginning to end and not even think of trying to get them to learn anything. I am afraid even at that price we might have people who took us seriously and were willing to pay! LOL! > > Kidding aside, I and others here want to be helpful but not do their work. The goal is supposed to be to get them to think and learn and perhaps explain some facet where they are stuck. > > I am not clear what Dominique wants as her understanding of the word "command" may very much differ from what some of us may mean. > > So to be clear, the assignment she is looking at can range from the trivial to the complex. There already is built-in python functionality that deals with key value pairs in data structures with names like dictionary or hash or associative array. A function that encapsulates that may not be needed but can be simple enough. > > But what is a command line? Is it the shell in which you invoke python from as in the old days? Probably not as a way to call python and ask it to store a key/value pair and return immediately seems less than useful. > > So, I assume she means the console-level of a python interpreter. But what does it mean to type "key-value" there, let alone "./key-value.rb" ??? > > The latter looks like a RUBY file and that is not even python. > > So the question is a tad muddled and a non-starter even if we were willing to do her HW. > > My guess is that what is being asked for is sort of like asking you to write a primitive calculator in python and then calling it interactively and having it read your commands like "5 + 3" and parsing and evaluating such commands line after line till you quit. > > So without providing an answer, it is my GUESS you need to write a stand-alone python program. Give it a name like hashing.py and call it from a command line or double click on an icon or whatever. > > Inside the program it should initialize something like an empty dictionary object and read lines from STDIN that the user types that use some format to specify your request to add a key and value pair. Additional commands it should handle are mentioned such as fetching the value for an existing key. Who knows what else is being asked, such as showing the current contents, deleting and so on. It sounds a bit like the calculator analogy. Make a program that lets you add and modify and whatever the contents of dictionary. > > I see no code illustrating such a user interface. The class should have covered how to play with something like a dictionary (or is asking to build your own) and how to read from a console and write to it and so on. > > But as none of us here has been in the class or seen what materials have been covered, and it is not our HW, I think Dominique should either do it herself and only ask when some more specific Python question comes up, such as how do you put out a prompt without a carriage return inserted, or whatever. The HW is meant to have the student learn and mostly do it themselves so if test (or the real world) comes around, ... > > I may be a bit touchy as someone on another forum submitted totally clearly a HW style question that their girlfriend asked them to do for her, so of course they figured they delegate it to a random bunch of people out there and take the credit. I sent a note suggesting we don't really feel like doing HW, especially so indirectly and got a reply: > > " so what if it is home work - if you can't do something, simply walk away- " > > What a nice attitude. Totally missed or avoided my point and suggested I leave them alone to find someone else to do it for them. > > Like I said, if we charged $500/hour, would most people realize that the goal is to do it for themselves? > > > -----Original Message----- > From: Tutor On Behalf Of Steve Willoughby > Sent: Wednesday, September 21, 2022 6:58 PM > To: Dominique Hagler > Cc: tutor at python.org > Subject: Re: [Tutor] Create command > > Dominique, > > It looks like you have an interesting homework exercise there to figure out. I don?t see a specific question from you, though. What have you tried so far? How did that work? What are your thoughts for where to proceed with this? > > We can help guide you in your course of discovery here, but we need something to start with since we?re not going to do your homework for y ou. > >> On 21-Sep-2022, at 03:36, Dominique Hagler wrote: >> >> Create a command line tool for storing and fetching key-value pairs. In other words, given a key and a value, which are both strings, it can store key and value together, and then return that value when fetched by that key. The tool must be able to be run from the command line by typing "key-value", though it is acceptable to also require the path or an extension (eg, "./key-value.rb" is fine). If needed, it is acceptable to include a setup script that must be run before the tool can be run. Running the tool must open an interactive session that accepts put, fetch, and exit commands. When ready to accept a command, it must output the string "> " as a command prompt. >> >> My command example: >> >> Person1 = { ?name? : ? Daisy?, ?age?: 20} >> >> >> Thank you, >> >> Dominique Hagler >> Have a great day! >> >> Sent from an iPhone, so please excuse brevity and typos! >> _______________________________________________ >> 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 > From avi.e.gross at gmail.com Thu Sep 22 09:57:27 2022 From: avi.e.gross at gmail.com (avi.e.gross at gmail.com) Date: Thu, 22 Sep 2022 09:57:27 -0400 Subject: [Tutor] Create command In-Reply-To: References: <002d01d8ce26$a008a5b0$e019f110$@gmail.com> Message-ID: <003601d8ce8b$4010f9e0$c032eda0$@gmail.com> Nadine and all, I agree. I was trying to get across that people who want HELP have to be more clear on what they want help on in a limited way. I am seeing many requests on other forums too in which there seem to be people asking for work to be done FOR them rather than alongside them. People want answers. I prefer people wanting to LEARN how to make their own. Perhaps a better answer is no answer at all. My message also could have been a request for more explanation of what exactly they are stuck on, or asking them to explain in their own words what they think the outline of the problem is, or one of many other such back-and-forth exchanges. I have seen such a process take a very long time to resolve, longer than the class the student is taking. Particularly annoying have been times when multiple people interacting have found they were not being given enough correct info and solving the wrong problems. I have exchanged some private mail with Dominique and she seems sincere enough. I continue to think her original question looked like HW, and that is OK if she then asks a more specific question in which the overall HW is mentioned for context and the question is one about how to parse a string that looks like ?fetch this? or how to write a function that will do part of what they want or get help on what may be causing an error message ? If anyone read the rest of my message, and note I am NOT asking anyone pay me anything, just pointing out there is value to the time you ask others to donate, I zoom in on the problem and show how it took some effort to make a guess about what the assignment was and then talk more about approaches to solve it. But I am not running this forum and it seems likely that others are happy to work with such requests. I will let them do so and not point out that I am unwilling. From: Nadine Mullings Sent: Thursday, September 22, 2022 8:43 AM To: Dominique Hagler Cc: avi.e.gross at gmail.com; tutor at python.org Subject: Re: [Tutor] Create command This is a listserv that goes out to multiple recipients. I would encourage those who offer help to assume positive intent and share help in that spirit otherwise reserve their additional commentary for outside this chain. It was disappointing to see the blatantly condescending response to this inquiry. On Thu, Sep 22, 2022 at 6:40 AM Dominique Hagler > wrote: Avi, I never asked anyone to DO my homework I was providing what I had so I could have a better understanding. Thank you, I will no longer need service from you all. Thank you Steve for taking the time that you did. Thank you, Dominique Hagler Have a great day! Sent from an iPhone, so please excuse brevity and typos! > On Sep 21, 2022, at 9:57 PM, avi.e.gross at gmail.com wrote: > > ?Steve, > > I think it is time for some of us to go into business and charge $500 or more per hour to actually DO people's HW from beginning to end and not even think of trying to get them to learn anything. I am afraid even at that price we might have people who took us seriously and were willing to pay! LOL! > > Kidding aside, I and others here want to be helpful but not do their work. The goal is supposed to be to get them to think and learn and perhaps explain some facet where they are stuck. > > I am not clear what Dominique wants as her understanding of the word "command" may very much differ from what some of us may mean. > > So to be clear, the assignment she is looking at can range from the trivial to the complex. There already is built-in python functionality that deals with key value pairs in data structures with names like dictionary or hash or associative array. A function that encapsulates that may not be needed but can be simple enough. > > But what is a command line? Is it the shell in which you invoke python from as in the old days? Probably not as a way to call python and ask it to store a key/value pair and return immediately seems less than useful. > > So, I assume she means the console-level of a python interpreter. But what does it mean to type "key-value" there, let alone "./key-value.rb" ??? > > The latter looks like a RUBY file and that is not even python. > > So the question is a tad muddled and a non-starter even if we were willing to do her HW. > > My guess is that what is being asked for is sort of like asking you to write a primitive calculator in python and then calling it interactively and having it read your commands like "5 + 3" and parsing and evaluating such commands line after line till you quit. > > So without providing an answer, it is my GUESS you need to write a stand-alone python program. Give it a name like hashing.py and call it from a command line or double click on an icon or whatever. > > Inside the program it should initialize something like an empty dictionary object and read lines from STDIN that the user types that use some format to specify your request to add a key and value pair. Additional commands it should handle are mentioned such as fetching the value for an existing key. Who knows what else is being asked, such as showing the current contents, deleting and so on. It sounds a bit like the calculator analogy. Make a program that lets you add and modify and whatever the contents of dictionary. > > I see no code illustrating such a user interface. The class should have covered how to play with something like a dictionary (or is asking to build your own) and how to read from a console and write to it and so on. > > But as none of us here has been in the class or seen what materials have been covered, and it is not our HW, I think Dominique should either do it herself and only ask when some more specific Python question comes up, such as how do you put out a prompt without a carriage return inserted, or whatever. The HW is meant to have the student learn and mostly do it themselves so if test (or the real world) comes around, ... > > I may be a bit touchy as someone on another forum submitted totally clearly a HW style question that their girlfriend asked them to do for her, so of course they figured they delegate it to a random bunch of people out there and take the credit. I sent a note suggesting we don't really feel like doing HW, especially so indirectly and got a reply: > > " so what if it is home work - if you can't do something, simply walk away- " > > What a nice attitude. Totally missed or avoided my point and suggested I leave them alone to find someone else to do it for them. > > Like I said, if we charged $500/hour, would most people realize that the goal is to do it for themselves? > > > -----Original Message----- > From: Tutor > On Behalf Of Steve Willoughby > Sent: Wednesday, September 21, 2022 6:58 PM > To: Dominique Hagler > > Cc: tutor at python.org > Subject: Re: [Tutor] Create command > > Dominique, > > It looks like you have an interesting homework exercise there to figure out. I don?t see a specific question from you, though. What have you tried so far? How did that work? What are your thoughts for where to proceed with this? > > We can help guide you in your course of discovery here, but we need something to start with since we?re not going to do your homework for y ou. > >> On 21-Sep-2022, at 03:36, Dominique Hagler > wrote: >> >> Create a command line tool for storing and fetching key-value pairs. In other words, given a key and a value, which are both strings, it can store key and value together, and then return that value when fetched by that key. The tool must be able to be run from the command line by typing "key-value", though it is acceptable to also require the path or an extension (eg, "./key-value.rb" is fine). If needed, it is acceptable to include a setup script that must be run before the tool can be run. Running the tool must open an interactive session that accepts put, fetch, and exit commands. When ready to accept a command, it must output the string "> " as a command prompt. >> >> My command example: >> >> Person1 = { ?name? : ? Daisy?, ?age?: 20} >> >> >> Thank you, >> >> Dominique Hagler >> Have a great day! >> >> Sent from an iPhone, so please excuse brevity and typos! >> _______________________________________________ >> 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 > _______________________________________________ Tutor maillist - Tutor at python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor -- Nadine (she/her) Nadine Mullings From nmullings1 at fordham.edu Thu Sep 22 08:42:38 2022 From: nmullings1 at fordham.edu (Nadine Mullings) Date: Thu, 22 Sep 2022 08:42:38 -0400 Subject: [Tutor] Create command In-Reply-To: References: <002d01d8ce26$a008a5b0$e019f110$@gmail.com> Message-ID: This is a listserv that goes out to multiple recipients. I would encourage those who offer help to assume positive intent and share help in that spirit otherwise reserve their additional commentary for outside this chain. It was disappointing to see the blatantly condescending response to this inquiry. On Thu, Sep 22, 2022 at 6:40 AM Dominique Hagler wrote: > Avi, > > I never asked anyone to DO my homework I was providing what I had so I > could have a better understanding. > > Thank you, I will no longer need service from you all. > > Thank you Steve for taking the time that you did. > > > Thank you, > > Dominique Hagler > Have a great day! > > Sent from an iPhone, so please excuse brevity and typos! > > > On Sep 21, 2022, at 9:57 PM, avi.e.gross at gmail.com wrote: > > > > ?Steve, > > > > I think it is time for some of us to go into business and charge $500 or > more per hour to actually DO people's HW from beginning to end and not even > think of trying to get them to learn anything. I am afraid even at that > price we might have people who took us seriously and were willing to pay! > LOL! > > > > Kidding aside, I and others here want to be helpful but not do their > work. The goal is supposed to be to get them to think and learn and perhaps > explain some facet where they are stuck. > > > > I am not clear what Dominique wants as her understanding of the word > "command" may very much differ from what some of us may mean. > > > > So to be clear, the assignment she is looking at can range from the > trivial to the complex. There already is built-in python functionality that > deals with key value pairs in data structures with names like dictionary or > hash or associative array. A function that encapsulates that may not be > needed but can be simple enough. > > > > But what is a command line? Is it the shell in which you invoke python > from as in the old days? Probably not as a way to call python and ask it to > store a key/value pair and return immediately seems less than useful. > > > > So, I assume she means the console-level of a python interpreter. But > what does it mean to type "key-value" there, let alone "./key-value.rb" ??? > > > > The latter looks like a RUBY file and that is not even python. > > > > So the question is a tad muddled and a non-starter even if we were > willing to do her HW. > > > > My guess is that what is being asked for is sort of like asking you to > write a primitive calculator in python and then calling it interactively > and having it read your commands like "5 + 3" and parsing and evaluating > such commands line after line till you quit. > > > > So without providing an answer, it is my GUESS you need to write a > stand-alone python program. Give it a name like hashing.py and call it from > a command line or double click on an icon or whatever. > > > > Inside the program it should initialize something like an empty > dictionary object and read lines from STDIN that the user types that use > some format to specify your request to add a key and value pair. Additional > commands it should handle are mentioned such as fetching the value for an > existing key. Who knows what else is being asked, such as showing the > current contents, deleting and so on. It sounds a bit like the calculator > analogy. Make a program that lets you add and modify and whatever the > contents of dictionary. > > > > I see no code illustrating such a user interface. The class should have > covered how to play with something like a dictionary (or is asking to build > your own) and how to read from a console and write to it and so on. > > > > But as none of us here has been in the class or seen what materials have > been covered, and it is not our HW, I think Dominique should either do it > herself and only ask when some more specific Python question comes up, such > as how do you put out a prompt without a carriage return inserted, or > whatever. The HW is meant to have the student learn and mostly do it > themselves so if test (or the real world) comes around, ... > > > > I may be a bit touchy as someone on another forum submitted totally > clearly a HW style question that their girlfriend asked them to do for her, > so of course they figured they delegate it to a random bunch of people out > there and take the credit. I sent a note suggesting we don't really feel > like doing HW, especially so indirectly and got a reply: > > > > " so what if it is home work - if you can't do something, simply walk > away- " > > > > What a nice attitude. Totally missed or avoided my point and suggested I > leave them alone to find someone else to do it for them. > > > > Like I said, if we charged $500/hour, would most people realize that the > goal is to do it for themselves? > > > > > > -----Original Message----- > > From: Tutor On Behalf > Of Steve Willoughby > > Sent: Wednesday, September 21, 2022 6:58 PM > > To: Dominique Hagler > > Cc: tutor at python.org > > Subject: Re: [Tutor] Create command > > > > Dominique, > > > > It looks like you have an interesting homework exercise there to figure > out. I don?t see a specific question from you, though. What have you tried > so far? How did that work? What are your thoughts for where to proceed with > this? > > > > We can help guide you in your course of discovery here, but we need > something to start with since we?re not going to do your homework for y ou. > > > >> On 21-Sep-2022, at 03:36, Dominique Hagler wrote: > >> > >> Create a command line tool for storing and fetching key-value pairs. In > other words, given a key and a value, which are both strings, it can store > key and value together, and then return that value when fetched by that > key. The tool must be able to be run from the command line by typing > "key-value", though it is acceptable to also require the path or an > extension (eg, "./key-value.rb" is fine). If needed, it is acceptable to > include a setup script that must be run before the tool can be run. Running > the tool must open an interactive session that accepts put, fetch, and exit > commands. When ready to accept a command, it must output the string "> " as > a command prompt. > >> > >> My command example: > >> > >> Person1 = { ?name? : ? Daisy?, ?age?: 20} > >> > >> > >> Thank you, > >> > >> Dominique Hagler > >> Have a great day! > >> > >> Sent from an iPhone, so please excuse brevity and typos! > >> _______________________________________________ > >> 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 > > > _______________________________________________ > Tutor maillist - Tutor at python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- Nadine *(she/her)* Nadine Mullings From steve at madscience.zone Thu Sep 22 14:21:19 2022 From: steve at madscience.zone (Steve Willoughby) Date: Thu, 22 Sep 2022 11:21:19 -0700 Subject: [Tutor] Create command In-Reply-To: References: <002d01d8ce26$a008a5b0$e019f110$@gmail.com> Message-ID: Personally, I think a tutor list should be as friendly to people seeking tutorial (i.e. beginner-level) help as they try to figure out Python, even if it?s their first experience with programming, while at the same time holding firm on our position of offering advice without doing homework for them. What concerned me most about Dominique?s request was the thought that a teacher was expecting her to complete an assignment without adequately preparing her to understand what was needed. (Of course, if this was a case of her working on her own to learn Python using exercises she found on her own, then bravo for being self-motivated and maybe it would be good to start with one of the tutorial books or websites that will give a gentle introduction to it all up front.) I didn?t mind that she was looking here for help, although my response was to try to point her in the right direction and let her keep trying, knowing she?d learn a lot more that way than if I just gave her the answer. I hope nothing in that was taken to be negative or condescending. > On 22-Sep-2022, at 05:42, Nadine Mullings wrote: > > This is a listserv that goes out to multiple recipients. I would encourage > those who offer help to assume positive intent and share help in that > spirit otherwise reserve their additional commentary for outside this > chain. It was disappointing to see the blatantly condescending response to > this inquiry. > > > On Thu, Sep 22, 2022 at 6:40 AM Dominique Hagler wrote: > >> Avi, >> >> I never asked anyone to DO my homework I was providing what I had so I >> could have a better understanding. >> >> Thank you, I will no longer need service from you all. >> >> Thank you Steve for taking the time that you did. >> >> >> Thank you, >> >> Dominique Hagler >> Have a great day! >> >> Sent from an iPhone, so please excuse brevity and typos! >> >>> On Sep 21, 2022, at 9:57 PM, avi.e.gross at gmail.com wrote: >>> >>> ?Steve, >>> >>> I think it is time for some of us to go into business and charge $500 or >> more per hour to actually DO people's HW from beginning to end and not even >> think of trying to get them to learn anything. I am afraid even at that >> price we might have people who took us seriously and were willing to pay! >> LOL! >>> >>> Kidding aside, I and others here want to be helpful but not do their >> work. The goal is supposed to be to get them to think and learn and perhaps >> explain some facet where they are stuck. >>> >>> I am not clear what Dominique wants as her understanding of the word >> "command" may very much differ from what some of us may mean. >>> >>> So to be clear, the assignment she is looking at can range from the >> trivial to the complex. There already is built-in python functionality that >> deals with key value pairs in data structures with names like dictionary or >> hash or associative array. A function that encapsulates that may not be >> needed but can be simple enough. >>> >>> But what is a command line? Is it the shell in which you invoke python >> from as in the old days? Probably not as a way to call python and ask it to >> store a key/value pair and return immediately seems less than useful. >>> >>> So, I assume she means the console-level of a python interpreter. But >> what does it mean to type "key-value" there, let alone "./key-value.rb" ??? >>> >>> The latter looks like a RUBY file and that is not even python. >>> >>> So the question is a tad muddled and a non-starter even if we were >> willing to do her HW. >>> >>> My guess is that what is being asked for is sort of like asking you to >> write a primitive calculator in python and then calling it interactively >> and having it read your commands like "5 + 3" and parsing and evaluating >> such commands line after line till you quit. >>> >>> So without providing an answer, it is my GUESS you need to write a >> stand-alone python program. Give it a name like hashing.py and call it from >> a command line or double click on an icon or whatever. >>> >>> Inside the program it should initialize something like an empty >> dictionary object and read lines from STDIN that the user types that use >> some format to specify your request to add a key and value pair. Additional >> commands it should handle are mentioned such as fetching the value for an >> existing key. Who knows what else is being asked, such as showing the >> current contents, deleting and so on. It sounds a bit like the calculator >> analogy. Make a program that lets you add and modify and whatever the >> contents of dictionary. >>> >>> I see no code illustrating such a user interface. The class should have >> covered how to play with something like a dictionary (or is asking to build >> your own) and how to read from a console and write to it and so on. >>> >>> But as none of us here has been in the class or seen what materials have >> been covered, and it is not our HW, I think Dominique should either do it >> herself and only ask when some more specific Python question comes up, such >> as how do you put out a prompt without a carriage return inserted, or >> whatever. The HW is meant to have the student learn and mostly do it >> themselves so if test (or the real world) comes around, ... >>> >>> I may be a bit touchy as someone on another forum submitted totally >> clearly a HW style question that their girlfriend asked them to do for her, >> so of course they figured they delegate it to a random bunch of people out >> there and take the credit. I sent a note suggesting we don't really feel >> like doing HW, especially so indirectly and got a reply: >>> >>> " so what if it is home work - if you can't do something, simply walk >> away- " >>> >>> What a nice attitude. Totally missed or avoided my point and suggested I >> leave them alone to find someone else to do it for them. >>> >>> Like I said, if we charged $500/hour, would most people realize that the >> goal is to do it for themselves? >>> >>> >>> -----Original Message----- >>> From: Tutor On Behalf >> Of Steve Willoughby >>> Sent: Wednesday, September 21, 2022 6:58 PM >>> To: Dominique Hagler >>> Cc: tutor at python.org >>> Subject: Re: [Tutor] Create command >>> >>> Dominique, >>> >>> It looks like you have an interesting homework exercise there to figure >> out. I don?t see a specific question from you, though. What have you tried >> so far? How did that work? What are your thoughts for where to proceed with >> this? >>> >>> We can help guide you in your course of discovery here, but we need >> something to start with since we?re not going to do your homework for y ou. >>> >>>> On 21-Sep-2022, at 03:36, Dominique Hagler wrote: >>>> >>>> Create a command line tool for storing and fetching key-value pairs. In >> other words, given a key and a value, which are both strings, it can store >> key and value together, and then return that value when fetched by that >> key. The tool must be able to be run from the command line by typing >> "key-value", though it is acceptable to also require the path or an >> extension (eg, "./key-value.rb" is fine). If needed, it is acceptable to >> include a setup script that must be run before the tool can be run. Running >> the tool must open an interactive session that accepts put, fetch, and exit >> commands. When ready to accept a command, it must output the string "> " as >> a command prompt. >>>> >>>> My command example: >>>> >>>> Person1 = { ?name? : ? Daisy?, ?age?: 20} >>>> >>>> >>>> Thank you, >>>> >>>> Dominique Hagler >>>> Have a great day! >>>> >>>> Sent from an iPhone, so please excuse brevity and typos! >>>> _______________________________________________ >>>> 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 >>> >> _______________________________________________ >> Tutor maillist - Tutor at python.org >> To unsubscribe or change subscription options: >> https://mail.python.org/mailman/listinfo/tutor >> > -- > Nadine *(she/her)* > > Nadine Mullings > _______________________________________________ > Tutor maillist - Tutor at python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor From leamhall at gmail.com Thu Sep 22 16:30:54 2022 From: leamhall at gmail.com (Leam Hall) Date: Thu, 22 Sep 2022 15:30:54 -0500 Subject: [Tutor] Communicating (was: Create command) In-Reply-To: References: <002d01d8ce26$a008a5b0$e019f110$@gmail.com> Message-ID: Programming is a skill, as is teaching. Just because someone knows programming, does not mean they can teach it well or even say it well. When someone new comes to the list, and often that is displayed by the question(s) they ask, it might be better for the community that those who have *both* Python and Teaching skills answer. For the more advanced questioner, or those who have been here a while, and who understand the mix of cultures and personalities, maybe those who are still working on their communication skills can jump in. I am not a perfect teacher, but I do understand the difference between talking about something and helping someone else learn. Leam On 9/22/22 13:21, Steve Willoughby wrote: > Personally, I think a tutor list should be as friendly to people seeking tutorial (i.e. beginner-level) help as they try to figure out Python, even if it?s their first experience with programming, while at the same time holding firm on our position of offering advice without doing homework for them. > > What concerned me most about Dominique?s request was the thought that a teacher was expecting her to complete an assignment without adequately preparing her to understand what was needed. (Of course, if this was a case of her working on her own to learn Python using exercises she found on her own, then bravo for being self-motivated and maybe it would be good to start with one of the tutorial books or websites that will give a gentle introduction to it all up front.) I didn?t mind that she was looking here for help, although my response was to try to point her in the right direction and let her keep trying, knowing she?d learn a lot more that way than if I just gave her the answer. I hope nothing in that was taken to be negative or condescending. > >> On 22-Sep-2022, at 05:42, Nadine Mullings wrote: >> >> This is a listserv that goes out to multiple recipients. I would encourage >> those who offer help to assume positive intent and share help in that >> spirit otherwise reserve their additional commentary for outside this >> chain. It was disappointing to see the blatantly condescending response to >> this inquiry. >> >> >> On Thu, Sep 22, 2022 at 6:40 AM Dominique Hagler wrote: >> >>> Avi, >>> >>> I never asked anyone to DO my homework I was providing what I had so I >>> could have a better understanding. >>> >>> Thank you, I will no longer need service from you all. >>> >>> Thank you Steve for taking the time that you did. >>> >>> >>> Thank you, >>> >>> Dominique Hagler >>> Have a great day! >>> >>> Sent from an iPhone, so please excuse brevity and typos! >>> >>>> On Sep 21, 2022, at 9:57 PM, avi.e.gross at gmail.com wrote: >>>> >>>> ?Steve, >>>> >>>> I think it is time for some of us to go into business and charge $500 or >>> more per hour to actually DO people's HW from beginning to end and not even >>> think of trying to get them to learn anything. I am afraid even at that >>> price we might have people who took us seriously and were willing to pay! >>> LOL! >>>> >>>> Kidding aside, I and others here want to be helpful but not do their >>> work. The goal is supposed to be to get them to think and learn and perhaps >>> explain some facet where they are stuck. >>>> >>>> I am not clear what Dominique wants as her understanding of the word >>> "command" may very much differ from what some of us may mean. >>>> >>>> So to be clear, the assignment she is looking at can range from the >>> trivial to the complex. There already is built-in python functionality that >>> deals with key value pairs in data structures with names like dictionary or >>> hash or associative array. A function that encapsulates that may not be >>> needed but can be simple enough. >>>> >>>> But what is a command line? Is it the shell in which you invoke python >>> from as in the old days? Probably not as a way to call python and ask it to >>> store a key/value pair and return immediately seems less than useful. >>>> >>>> So, I assume she means the console-level of a python interpreter. But >>> what does it mean to type "key-value" there, let alone "./key-value.rb" ??? >>>> >>>> The latter looks like a RUBY file and that is not even python. >>>> >>>> So the question is a tad muddled and a non-starter even if we were >>> willing to do her HW. >>>> >>>> My guess is that what is being asked for is sort of like asking you to >>> write a primitive calculator in python and then calling it interactively >>> and having it read your commands like "5 + 3" and parsing and evaluating >>> such commands line after line till you quit. >>>> >>>> So without providing an answer, it is my GUESS you need to write a >>> stand-alone python program. Give it a name like hashing.py and call it from >>> a command line or double click on an icon or whatever. >>>> >>>> Inside the program it should initialize something like an empty >>> dictionary object and read lines from STDIN that the user types that use >>> some format to specify your request to add a key and value pair. Additional >>> commands it should handle are mentioned such as fetching the value for an >>> existing key. Who knows what else is being asked, such as showing the >>> current contents, deleting and so on. It sounds a bit like the calculator >>> analogy. Make a program that lets you add and modify and whatever the >>> contents of dictionary. >>>> >>>> I see no code illustrating such a user interface. The class should have >>> covered how to play with something like a dictionary (or is asking to build >>> your own) and how to read from a console and write to it and so on. >>>> >>>> But as none of us here has been in the class or seen what materials have >>> been covered, and it is not our HW, I think Dominique should either do it >>> herself and only ask when some more specific Python question comes up, such >>> as how do you put out a prompt without a carriage return inserted, or >>> whatever. The HW is meant to have the student learn and mostly do it >>> themselves so if test (or the real world) comes around, ... >>>> >>>> I may be a bit touchy as someone on another forum submitted totally >>> clearly a HW style question that their girlfriend asked them to do for her, >>> so of course they figured they delegate it to a random bunch of people out >>> there and take the credit. I sent a note suggesting we don't really feel >>> like doing HW, especially so indirectly and got a reply: >>>> >>>> " so what if it is home work - if you can't do something, simply walk >>> away- " >>>> >>>> What a nice attitude. Totally missed or avoided my point and suggested I >>> leave them alone to find someone else to do it for them. >>>> >>>> Like I said, if we charged $500/hour, would most people realize that the >>> goal is to do it for themselves? >>>> >>>> >>>> -----Original Message----- >>>> From: Tutor On Behalf >>> Of Steve Willoughby >>>> Sent: Wednesday, September 21, 2022 6:58 PM >>>> To: Dominique Hagler >>>> Cc: tutor at python.org >>>> Subject: Re: [Tutor] Create command >>>> >>>> Dominique, >>>> >>>> It looks like you have an interesting homework exercise there to figure >>> out. I don?t see a specific question from you, though. What have you tried >>> so far? How did that work? What are your thoughts for where to proceed with >>> this? >>>> >>>> We can help guide you in your course of discovery here, but we need >>> something to start with since we?re not going to do your homework for y ou. >>>> >>>>> On 21-Sep-2022, at 03:36, Dominique Hagler wrote: >>>>> >>>>> Create a command line tool for storing and fetching key-value pairs. In >>> other words, given a key and a value, which are both strings, it can store >>> key and value together, and then return that value when fetched by that >>> key. The tool must be able to be run from the command line by typing >>> "key-value", though it is acceptable to also require the path or an >>> extension (eg, "./key-value.rb" is fine). If needed, it is acceptable to >>> include a setup script that must be run before the tool can be run. Running >>> the tool must open an interactive session that accepts put, fetch, and exit >>> commands. When ready to accept a command, it must output the string "> " as >>> a command prompt. >>>>> >>>>> My command example: >>>>> >>>>> Person1 = { ?name? : ? Daisy?, ?age?: 20} >>>>> >>>>> >>>>> Thank you, >>>>> >>>>> Dominique Hagler >>>>> Have a great day! >>>>> >>>>> Sent from an iPhone, so please excuse brevity and typos! >>>>> _______________________________________________ >>>>> 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 >>>> >>> _______________________________________________ >>> Tutor maillist - Tutor at python.org >>> To unsubscribe or change subscription options: >>> https://mail.python.org/mailman/listinfo/tutor >>> >> -- >> Nadine *(she/her)* >> >> Nadine Mullings >> _______________________________________________ >> 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 -- Automation Engineer (reuel.net/resume) Scribe: The Domici War (domiciwar.net) General Ne'er-do-well (github.com/LeamHall) From PythonList at DancesWithMice.info Thu Sep 22 20:50:38 2022 From: PythonList at DancesWithMice.info (dn) Date: Fri, 23 Sep 2022 12:50:38 +1200 Subject: [Tutor] Create command In-Reply-To: References: <002d01d8ce26$a008a5b0$e019f110$@gmail.com> Message-ID: What is my background to this sort of disagreement? (certainly wouldn't claim particular expertise!) I've been advising/discussing with a group of university staff the subject of "community" and how they can establish same amongst their students, alumni, and other interested parties. As well as the usual mode of staff helping students, and even (more experienced) students helping students, we also looked at the opposite side of that assumed-relationship. What should the questioner do? How should (s)he behave? What should be expected of such BEFORE the first question is asked? Is there any point in expecting anything? (most popular question for any webinar etc (outside of formal courseware): "is this session being recorded?" - despite it being mentioned on the invitation, advertising, meeting-notifications, whatever! Who reads that stuff? - and why not?) Secondly, contributing 'here' regularly (cf @Steve, @Nadine, and @Dominique appearing for the first time - albeit not recognising the names, and only checked back over the last three months) Thirdly, am currently putting-together a Coding Challenge, and have been generously-assisted by one of the contributors to this thread, in-part ensuring that I don't 'talk down' or otherwise fail to properly appreciate the learner's point-of-view. With that said, taking a look at the discussion:- On 23/09/2022 06.21, Steve Willoughby wrote: > Personally, I think a tutor list should be as friendly to people seeking tutorial (i.e. beginner-level) help as they try to figure out Python, even if it?s their first experience with programming, while at the same time holding firm on our position of offering advice without doing homework for them. Everyone will agree with this statement. (and not only to the benefit of "Beginners" - correspondents have been know to ask quite 'advanced' questions, seeking a tutorial response) The "homework" part is a regular theme. Regular correspondents can find it difficult to remember that giving a 'no homework' answer to Fred one day, is not somehow imparted to Barney the next. Nevertheless, saying the same thing over-and-over is irritating - which is (one of the reasons) why "Tutor" is separate from 'the Python list'! The point is that the student has been set a task - and it's not that specific assignment! The student-task is to learn. Learning is unlikely to occur by copying (plagiarism) or having someone else tell you how/do the assignment. Hence the value of the respondent's tactic: "advice". Trouble is: it's often less-effort to give the answer! There is a student market-place featuring "paper-mills", ie organisations which, for a fee, will deliver completed student-assignments. Accordingly, there are students who may come 'here' thinking that to be the list's purpose (and hence the subsequent comment about perhaps asking to be $paid)! Aside: relevant to assignments and "grading" is the widespread availability of AI programming-assistants. Thus, programming assignment-completion without "learning" - cognitive by-pass mode. > What concerned me most about Dominique?s request was the thought that a teacher was expecting her to complete an assignment without adequately preparing her to understand what was needed. Quite possibly the case. However, is this the only interpretation? How about: the student didn't pay attention when the teacher explained... ? (my second job at university was what is now often called a "TA" (Teacher's Assistant). The lecturer would brief me about the next assignment (and presumably checked that I could answer it myself!). Later students would seek assistance. A fair proportion were unable to explain the basis of the assignment and/or the lecture topics leading into same!) Why would a teacher fail to prepare his/her students? Assumptions about that might be negative, but there-again, there are times when the research-component of an assignment is just as important as reaching 'the answer'. (not that first-steps-in-Python would be a good time for such a learning-technique!) The approach to these sorts of posts may be to (first) ask questions and seek more 'background'. (yes, some think it rude to answer a question with a question, but you know the aphorism about "assumptions", and it'd be a total waste of time to disappear on some incorrect 'tangent'!) (Of course, if this was a case of her working on her own to learn Python using exercises she found on her own, then bravo for being self-motivated and maybe it would be good to start with one of the tutorial books or websites that will give a gentle introduction to it all up front.) Ah, so the respondent realised that the circumstances were totally unknown and un-stated. (an observation of the situation, not a criticism of the person) Who knows the OP's circumstances? Who has the power/responsibility to communicate those to the list? Why? Why not? Asking questions, particularly on a list like this is a skill, ie is something to be learned. There are numbers of posts, blogs, and the like aiming to encourage 'good questions'! Sometimes such questions come-across as a demand. Maybe that is laziness. Often it is a matter of language - many list-members do not speak English as their first- or home-language! In this case: ?Create a command line tool...? has all the hallmarks of a direct quotation of a student assignment - but don't "Tutors" deal with assignments? However, no background was provided, eg doing a course, which course, what book, what is current topic, etc. Should the OP 'set the scene' with care? What is the element of 'help us to help you'? (some even seem to think we/someone here is paid to answer questions - which is not the case. Hence, should there be respect for, and how does one show respect for (helpful) peoples' time-donation?) Personally, after asking myself the question: what is the "Create command"? (message subject), followed by reading "...command line tool..." and later what appears to be a Python dictionary; I came away confused by both the (apparent lack of) 'question' and the what/why/how. So, feeling over-busy, I was very happy to see @Steve handling things. Thanks and credit to you! I didn?t mind that she was looking here for help, although my response was to try to point her in the right direction and let her keep trying, knowing she?d learn a lot more that way than if I just gave her the answer. I hope nothing in that was taken to be negative or condescending. IMHO you soldiered-on bravely. Well done! Similarly, don't think the negative vibes were aimed in your direction! Here's hoping you will contribute similarly in-future, and that there may be ideas in this response which will empower your future endeavors... >> On 22-Sep-2022, at 05:42, Nadine Mullings wrote: >> >> This is a listserv that goes out to multiple recipients. I would encourage Trouble is, various posts appear to have been sent directly to correspondents and/or to include attachments which the list-server strips. Have these list-failings been mentioned? Has the 'missing data' been posted? Also not-mentioned, is that conversations 'here' are not merely between participants. There are many others (rejoicing under the wonderful label of "lurkers") who read messages in the expectation of learning. Accordingly, missing information becomes a disservice. >> those who offer help to assume positive intent and share help in that >> spirit otherwise reserve their additional commentary for outside this >> chain. It was disappointing to see the blatantly condescending response to >> this inquiry. There's an interpretation here too - which may or may not be correct/fair/whatever. (see also 'language', above! What seems arrogant in one society may qualify as normal-expression in another. Many mistake my Socratic style of questioning for (my) ignorance - and don't get me started on self-deprecating humor!) Also, actions speak louder than words! Walk a mile in ... However, most of us will agree strongly with the first sentence. It is very much a truth! How can a 'community' like this exist, except enacting a positive r?le? Relationships are two-way (cue: "it takes two to tango"). How does this come-across? ?I never asked anyone to DO my homework I was providing what I had so I could have a better understanding. Thank you, I will no longer need service from you all.? - what was written was interpreted to be some form of homework, and by more than one respondent - how does the word "asked" fit into the OP? - what was "provided"? - what did the OP imagine was the list's "service"? - "all" - what have we "all" done to deserve such? >From this it seems unlikely that the OP will return. On the one hand that represents failure. On the other hand, reviewing the thread from start-to-finish has only left me wondering: what was the actual question? and, if/what was the eventual answer? - which means it was unlikely to have offered benefit to anyone else either. Another failure! Lots to learn! If there are ways to assist contributors, many of us (who have 'been around' for a while) will be happy to advise and discuss. If the OP would like to try again, this time within the list-server's capabilities, and with sufficient information to enable us to better help you, I (again, no doubt amongst others) will be happy to help... -- Regards, =dn From PythonList at DancesWithMice.info Fri Sep 23 00:49:39 2022 From: PythonList at DancesWithMice.info (dn) Date: Fri, 23 Sep 2022 16:49:39 +1200 Subject: [Tutor] Create command In-Reply-To: References: <002d01d8ce26$a008a5b0$e019f110$@gmail.com> Message-ID: On 23/09/2022 13.24, Nadine Mullings wrote: > I was introduced to this "community" through a Google certificate program.? Welcome! Wasn't aware of Fordham as an IT-school (hence Google?). Though, have had one or two discussions with staff there on Cognitive Psychology (my research area). > Infrequency of responses does not erase existence and limited > participation should not preclude calling out something shared here > that's not right.?? Agreed, and thank you for doing-so. Will look forward to positive support and future contributions... > High performance, here, represented as frequent responses to inquiries, > does not entitle anyone to be unkind.? Agreed. > Neither does accountability require unkindness. If there are community > standards, state them, and thoughtfully hold community members accountable.? As before, please be aware of cultural differences, how poorly humor can 'translate', and beware assumptions. For example, should the second sentence be interpreted as a list of requests or demands? Of whom? No, I'm not asking for a (written) response, and have no doubt about the goodness of your intentions - but (hopefully) illustrates how easily text-messages can leave room for misinterpretation of intent! > There is no reason to excuse unkindness here unless one of the goals of > this group is to be exclusionary.? Agreed, but is it a reasonable attribution to the group. > Please clarify.? There is nothing to clarify. Ref: PSF's Code of Conduct. (PSF = Python Software Foundation) If you have further questions, I may be able to help, but best done off-list to reduce 'noise'. Perhaps a better first-step would be to contact the person you feel has been unkind (also off-list). Maybe such will lead to mutual-understanding, education rather than hurt, ... -- Regards, =dn From PythonList at DancesWithMice.info Fri Sep 23 01:12:54 2022 From: PythonList at DancesWithMice.info (dn) Date: Fri, 23 Sep 2022 17:12:54 +1200 Subject: [Tutor] NZPUG: Smart Iterator Challenge Message-ID: <428d6a24-5d20-4178-52bd-ba0eff5c4fdb@DancesWithMice.info> A week-by-week Challenge series. A new venture by the Auckland Branch of the New Zealand Python Users' Group (AuckPUG) Challenge-week 1: Implementing a monolithic solution, starts today! All welcome! Kiwi accent optional (most people are no-good at it anyway). Details from the Meetup site: https://www.meetup.com/nzpug-auckland/ Summary: - Two parts: Tutorial and Coding Challenge - during next four of AuckPUG's 'off-weeks' - will suit Python-Apprentices ready to move-on from 'the basics' and Python-Journeymen - special Challenge for Python-Masters and others who want 'more' - specs and templates to download, explanation, references - attempt in bite-sized chunks: work on the Challenge in your own time, when you have the time - you do the coding and (privately) self-check against "Acceptance Test" - "Office Hours" for queries, successes, frustrations, ... (see below) - closes Sunday-week - review at beginning of next Challenge-Week (details, as above) Schedule: (all times NZST/UTC+12 today, and NZDT/UTC+13 from Sunday) 1: Implementing a monolithic solution, from Sat 24 Sep 2: Modular Programming, from Sat 8 Oct 3: Generalising the solution, from Sat 22 Oct 4: Review, from Sat 5 Nov, concluding: 1830, Wed 9 Nov Please find all details, and file follow-up questions through the (above) Meetup-site - don't want @Alan growling at me (not with those long, sharp, teeth!) With special thanks to our own Leam Hall, for feedback and advice - that said, all errors and omissions are mine. Are you up for a challenge? Regards =dn (for Pete and DJ) From steve at madscience.zone Fri Sep 23 01:13:33 2022 From: steve at madscience.zone (Steve Willoughby) Date: Thu, 22 Sep 2022 22:13:33 -0700 Subject: [Tutor] Create command In-Reply-To: References: <002d01d8ce26$a008a5b0$e019f110$@gmail.com> Message-ID: > On 22-Sep-2022, at 21:49, dn wrote: > > On 23/09/2022 13.24, Nadine Mullings wrote: >> I was introduced to this "community" through a Google certificate program. > Welcome to the community. I?m not sure of the meaning of using scare quotes around that word, but this is a community nonetheless, and as with all communities of humans, we always have a need to make an effort to get along with each other and find a way to constructively work together. > >> Infrequency of responses does not erase existence and limited >> participation should not preclude calling out something shared here >> that's not right. > > Agreed, and thank you for doing-so. > Yes, indeed. I?ve been a member of this community for a very long time (not until recently with this particular email address due to a domain change a year or so ago), but just haven?t had the time to respond as much as I?d like. But I do appreciate the time others have taken to welcome newcomers and help people along the way of learning Python. > Will look forward to positive support and future contributions... > >> High performance, here, represented as frequent responses to inquiries, >> does not entitle anyone to be unkind. > Especially here since we?re contributing in our spare time as an act of kindness, not as a job or obligation. Steve From hitz0043 at gmail.com Sat Sep 24 07:51:22 2022 From: hitz0043 at gmail.com (Hitesh Kumar/District Manager/Agra/CSC 2.0) Date: Sat, 24 Sep 2022 17:21:22 +0530 Subject: [Tutor] If else statement Message-ID: Hi all, Need help in if else statement as nothing seems to work out :( From nmullings1 at fordham.edu Thu Sep 22 21:24:45 2022 From: nmullings1 at fordham.edu (Nadine Mullings) Date: Thu, 22 Sep 2022 21:24:45 -0400 Subject: [Tutor] Create command In-Reply-To: References: <002d01d8ce26$a008a5b0$e019f110$@gmail.com> Message-ID: I was introduced to this "community" through a Google certificate program. Infrequency of responses does not erase existence and limited participation should not preclude calling out something shared here that's not right. High performance, here, represented as frequent responses to inquiries, does not entitle anyone to be unkind. Neither does accountability require unkindness. If there are community standards, state them, and thoughtfully hold community members accountable. There is no reason to excuse unkindness here unless one of the goals of this group is to be exclusionary. Please clarify. On Thu, Sep 22, 2022 at 8:52 PM dn wrote: > What is my background to this sort of disagreement? > (certainly wouldn't claim particular expertise!) > > I've been advising/discussing with a group of university staff the > subject of "community" and how they can establish same amongst their > students, alumni, and other interested parties. As well as the usual > mode of staff helping students, and even (more experienced) students > helping students, we also looked at the opposite side of that > assumed-relationship. What should the questioner do? How should (s)he > behave? What should be expected of such BEFORE the first question is > asked? Is there any point in expecting anything? > (most popular question for any webinar etc (outside of formal > courseware): "is this session being recorded?" - despite it being > mentioned on the invitation, advertising, meeting-notifications, > whatever! Who reads that stuff? - and why not?) > > Secondly, contributing 'here' regularly (cf @Steve, @Nadine, and > @Dominique appearing for the first time - albeit not recognising the > names, and only checked back over the last three months) > > Thirdly, am currently putting-together a Coding Challenge, and have been > generously-assisted by one of the contributors to this thread, in-part > ensuring that I don't 'talk down' or otherwise fail to properly > appreciate the learner's point-of-view. > > With that said, taking a look at the discussion:- > > > On 23/09/2022 06.21, Steve Willoughby wrote: > > Personally, I think a tutor list should be as friendly to people seeking > tutorial (i.e. beginner-level) help as they try to figure out Python, even > if it?s their first experience with programming, while at the same time > holding firm on our position of offering advice without doing homework for > them. > > Everyone will agree with this statement. > (and not only to the benefit of "Beginners" - correspondents have been > know to ask quite 'advanced' questions, seeking a tutorial response) > > The "homework" part is a regular theme. Regular correspondents can find > it difficult to remember that giving a 'no homework' answer to Fred one > day, is not somehow imparted to Barney the next. Nevertheless, saying > the same thing over-and-over is irritating - which is (one of the > reasons) why "Tutor" is separate from 'the Python list'! > > The point is that the student has been set a task - and it's not that > specific assignment! The student-task is to learn. Learning is unlikely > to occur by copying (plagiarism) or having someone else tell you how/do > the assignment. > > Hence the value of the respondent's tactic: "advice". Trouble is: it's > often less-effort to give the answer! > > There is a student market-place featuring "paper-mills", ie > organisations which, for a fee, will deliver completed > student-assignments. Accordingly, there are students who may come 'here' > thinking that to be the list's purpose (and hence the subsequent comment > about perhaps asking to be $paid)! > > Aside: relevant to assignments and "grading" is the widespread > availability of AI programming-assistants. Thus, programming > assignment-completion without "learning" - cognitive by-pass mode. > > > > What concerned me most about Dominique?s request was the thought that a > teacher was expecting her to complete an assignment without adequately > preparing her to understand what was needed. > > Quite possibly the case. However, is this the only interpretation? > > How about: the student didn't pay attention when the teacher explained... ? > > (my second job at university was what is now often called a "TA" > (Teacher's Assistant). The lecturer would brief me about the next > assignment (and presumably checked that I could answer it myself!). > Later students would seek assistance. A fair proportion were unable to > explain the basis of the assignment and/or the lecture topics leading > into same!) > > > Why would a teacher fail to prepare his/her students? > > Assumptions about that might be negative, but there-again, there are > times when the research-component of an assignment is just as important > as reaching 'the answer'. > (not that first-steps-in-Python would be a good time for such a > learning-technique!) > > > The approach to these sorts of posts may be to (first) ask questions and > seek more 'background'. > (yes, some think it rude to answer a question with a question, but you > know the aphorism about "assumptions", and it'd be a total waste of time > to disappear on some incorrect 'tangent'!) > > > (Of course, if this was a case of her working on her own to learn Python > using exercises she found on her own, then bravo for being > self-motivated and maybe it would be good to start with one of the > tutorial books or websites that will give a gentle introduction to it > all up front.) > > Ah, so the respondent realised that the circumstances were totally > unknown and un-stated. > (an observation of the situation, not a criticism of the person) > > Who knows the OP's circumstances? > Who has the power/responsibility to communicate those to the list? > Why? Why not? > > Asking questions, particularly on a list like this is a skill, ie is > something to be learned. There are numbers of posts, blogs, and the like > aiming to encourage 'good questions'! > > > Sometimes such questions come-across as a demand. Maybe that is > laziness. Often it is a matter of language - many list-members do not > speak English as their first- or home-language! > > > In this case: ?Create a command line tool...? has all the hallmarks of a > direct quotation of a student assignment - but don't "Tutors" deal with > assignments? However, no background was provided, eg doing a course, > which course, what book, what is current topic, etc. > > Should the OP 'set the scene' with care? What is the element of 'help us > to help you'? > (some even seem to think we/someone here is paid to answer questions - > which is not the case. Hence, should there be respect for, and how does > one show respect for (helpful) peoples' time-donation?) > > Personally, after asking myself the question: what is the "Create > command"? (message subject), followed by reading "...command line > tool..." and later what appears to be a Python dictionary; I came away > confused by both the (apparent lack of) 'question' and the what/why/how. > So, feeling over-busy, I was very happy to see @Steve handling things. > Thanks and credit to you! > > > I didn?t mind that she was looking here for help, although my response > was to try to point her in the right direction and let her keep trying, > knowing she?d learn a lot more that way than if I just gave her the > answer. I hope nothing in that was taken to be negative or condescending. > > IMHO you soldiered-on bravely. Well done! > > Similarly, don't think the negative vibes were aimed in your direction! > > Here's hoping you will contribute similarly in-future, and that there > may be ideas in this response which will empower your future endeavors... > > > >> On 22-Sep-2022, at 05:42, Nadine Mullings > wrote: > >> > >> This is a listserv that goes out to multiple recipients. I would > encourage > > Trouble is, various posts appear to have been sent directly to > correspondents and/or to include attachments which the list-server > strips. Have these list-failings been mentioned? Has the 'missing data' > been posted? > > Also not-mentioned, is that conversations 'here' are not merely between > participants. There are many others (rejoicing under the wonderful label > of "lurkers") who read messages in the expectation of learning. > Accordingly, missing information becomes a disservice. > > > >> those who offer help to assume positive intent and share help in that > >> spirit otherwise reserve their additional commentary for outside this > >> chain. It was disappointing to see the blatantly condescending response > to > >> this inquiry. > > There's an interpretation here too - which may or may not be > correct/fair/whatever. > (see also 'language', above! What seems arrogant in one society may > qualify as normal-expression in another. Many mistake my Socratic style > of questioning for (my) ignorance - and don't get me started on > self-deprecating humor!) > > Also, actions speak louder than words! > Walk a mile in ... > > > However, most of us will agree strongly with the first sentence. It is > very much a truth! How can a 'community' like this exist, except > enacting a positive r?le? > > > Relationships are two-way (cue: "it takes two to tango"). > > How does this come-across? > ?I never asked anyone to DO my homework I was providing what I had so I > could have a better understanding. Thank you, I will no longer need > service from you all.? > > - what was written was interpreted to be some form of homework, and by > more than one respondent > - how does the word "asked" fit into the OP? > - what was "provided"? > - what did the OP imagine was the list's "service"? > - "all" - what have we "all" done to deserve such? > > From this it seems unlikely that the OP will return. On the one hand > that represents failure. On the other hand, reviewing the thread from > start-to-finish has only left me wondering: what was the actual > question? and, if/what was the eventual answer? - which means it was > unlikely to have offered benefit to anyone else either. Another failure! > > > Lots to learn! > > > If there are ways to assist contributors, many of us (who have 'been > around' for a while) will be happy to advise and discuss. > > If the OP would like to try again, this time within the list-server's > capabilities, and with sufficient information to enable us to better > help you, I (again, no doubt amongst others) will be happy to help... > -- > Regards, > =dn > _______________________________________________ > Tutor maillist - Tutor at python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- Nadine *(she/her)* Nadine Mullings From deepakdixit0001 at gmail.com Sun Sep 25 06:07:44 2022 From: deepakdixit0001 at gmail.com (Deepak Dixit) Date: Sun, 25 Sep 2022 15:37:44 +0530 Subject: [Tutor] If else statement In-Reply-To: References: Message-ID: Hi Hitesh, Can you post your code here and we can See what is wrong with it? Also post complete errors to get some idea about your problam. On Sun, 25 Sep, 2022, 12:13 pm Hitesh Kumar/District Manager/Agra/CSC 2.0, < hitz0043 at gmail.com> wrote: > Hi all, > > Need help in if else statement as nothing seems to work out :( > _______________________________________________ > Tutor maillist - Tutor at python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > From nulla.epistola at web.de Sun Sep 25 06:05:30 2022 From: nulla.epistola at web.de (Sibylle Koczian) Date: Sun, 25 Sep 2022 12:05:30 +0200 Subject: [Tutor] If else statement In-Reply-To: References: Message-ID: Hello, Am 24.09.2022 um 13:51 schrieb Hitesh Kumar/District Manager/Agra/CSC 2.0: > Hi all, > > Need help in if else statement as nothing seems to work out :( > _______________________________________________ What did you try? In what way didn't it work out? Please show the code that didn't work as expected. Tell us what it should have done and what it did instead. This list removes screenshots and other images. HTML may cause problems with indentation which is very important in Python. So best write everything as plain text into the body of your mail. Additionally it might be helpful if you told us what documentation you used to get started: the official Python tutorial? Other parts of docs.python.org? Other sources? And the usual questions - but they might be unimportant in your case: what Python version? What OS? Sorry to answer with questions only, but I don't think reciting the relevant part of the tutorial would be more helpful. Greetings Sibylle From nulla.epistola at web.de Sun Sep 25 06:05:30 2022 From: nulla.epistola at web.de (Sibylle Koczian) Date: Sun, 25 Sep 2022 12:05:30 +0200 Subject: [Tutor] If else statement In-Reply-To: References: Message-ID: Hello, Am 24.09.2022 um 13:51 schrieb Hitesh Kumar/District Manager/Agra/CSC 2.0: > Hi all, > > Need help in if else statement as nothing seems to work out :( > _______________________________________________ What did you try? In what way didn't it work out? Please show the code that didn't work as expected. Tell us what it should have done and what it did instead. This list removes screenshots and other images. HTML may cause problems with indentation which is very important in Python. So best write everything as plain text into the body of your mail. Additionally it might be helpful if you told us what documentation you used to get started: the official Python tutorial? Other parts of docs.python.org? Other sources? And the usual questions - but they might be unimportant in your case: what Python version? What OS? Sorry to answer with questions only, but I don't think reciting the relevant part of the tutorial would be more helpful. Greetings Sibylle From torbjorn.svensson.diaz at gmail.com Mon Sep 26 11:29:11 2022 From: torbjorn.svensson.diaz at gmail.com (=?UTF-8?Q?Torbj=c3=b6rn_Svensson_Diaz?=) Date: Mon, 26 Sep 2022 17:29:11 +0200 Subject: [Tutor] OT: Line wrap In-Reply-To: <3f6d8033-d423-c6aa-e988-c2981fba1c33@DancesWithMice.info> References: <867ec052-d304-6bb3-f0e4-1f2f76be28cf@gmail.com> <3f6d8033-d423-c6aa-e988-c2981fba1c33@DancesWithMice.info> Message-ID: <3991e5f7-e708-57b0-12de-0e70da750a17@gmail.com> On 2022-09-17 23:12, dn wrote: > On 17/09/2022 06.54, Torbj?rn Svensson Diaz wrote: >> I tried this and it seems as though it's in my display that there's >> something wrong. When I view source of emails that I sent to email >> lists, everything is working the way it should. But when I read then in >> the normal way, lines do not wrap the way I want them to. Instead I see >> very long lines. What to do? > Am impressed, even amazed, that you have taken the trouble to read 'the > manual' and other rules relating to our Discussion List. Thank you! > > Snip - Interesting text. > Am closing in appreciation of the concern-raised, and expressing hope > that you will bring much value to the community through attention to > detail and consideration of others... Thank you for that and for an interesting answer! -- Torbj?rn Svensson Diaz From avi.e.gross at gmail.com Wed Sep 28 01:16:33 2022 From: avi.e.gross at gmail.com (Avi Gross) Date: Wed, 28 Sep 2022 01:16:33 -0400 Subject: [Tutor] On my way out ... Message-ID: Before I leave this forum, I want to write a brief note so that those I have gotten to know and like here do not wonder if I do not reply to them when they post here. I will not be ignoring you, just not receiving any messages including yours, unless sent to me personally or on some other forum I remain on. I was a volunteer here and I have my own unique style and expertise among others with their own and I have appreciated the different viewpoints each brings and especially when it improves on mine. But there are elements here who have their ideas of the only right way to do things and would like people like me to not be ourselves but constantly check every word and censor ourselves because they want a safe space for learners. That is a laudable goal but by doing that they make an unsafe or even hostile space for people like me who believe in concepts like freedom of speech more than freedom from speech and so on. This is a forum I do not manage and do not need to participate in. I have no problem with AG or most others but have no interest in having to keep dealing with a few individuals I need not name who make the experience of helping others stressful to me. My policy is that you either take me as I am or get none of me. That does not mean I am not willing to adapt just that I am very resistant to anything I consider mindless brainwashing. There is a real world out there that people with high self-esteem and who want their hands held may have trouble competing in when actual skills and results matter. This began with me suggesting we be wary of people who just want their homework done for them and focus on people who can define their problem and want to learn how to improve on their efforts. I offer no apologies and will not work with anyone who seems to want others to apologize constantly for ever sharing a view or opinion contrary to their orthodoxy. So, I am taking my leave and hopefully others will be able to work within these constraints and the group will get things done. I have plenty of projects including voluntary activities by people actually in my life who want help with Python, R and other things I am good at and take me as I am. Why be in a stressful and even hostile place? For those that want peace, my leaving may give you the space you want. Just don?t ask me for a job. From alan.gauld at yahoo.co.uk Wed Sep 28 04:11:08 2022 From: alan.gauld at yahoo.co.uk (Alan Gauld) Date: Wed, 28 Sep 2022 09:11:08 +0100 Subject: [Tutor] On my way out ... In-Reply-To: References: Message-ID: On 28/09/2022 06:16, Avi Gross wrote: > Before I leave this forum, I want to write a brief note so that those I > have gotten to know and like here do not wonder if I do not reply to them > when they post here. Sorry to see you go Avi but you are, like everyone else here, a volunteer and free to choose where and how you spend your time. Enjoy your other outlets and activities and our paths are likely to cross on other fora.. -- 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 From cs at cskk.id.au Wed Sep 28 07:41:08 2022 From: cs at cskk.id.au (Cameron Simpson) Date: Wed, 28 Sep 2022 21:41:08 +1000 Subject: [Tutor] On my way out ... In-Reply-To: References: Message-ID: On 28Sep2022 09:11, Alan Gauld wrote: >On 28/09/2022 06:16, Avi Gross wrote: >> Before I leave this forum, I want to write a brief note so that those I >> have gotten to know and like here do not wonder if I do not reply to them >> when they post here. > >Sorry to see you go Avi but you are, like everyone else here, >a volunteer and free to choose where and how you spend >your time. Enjoy your other outlets and activities and our >paths are likely to cross on other fora.. I'm also sorry to see you go, but good luck elsewhere. Cheers, Cameron Simpson From PythonList at DancesWithMice.info Wed Sep 28 18:16:14 2022 From: PythonList at DancesWithMice.info (dn) Date: Thu, 29 Sep 2022 11:16:14 +1300 Subject: [Tutor] On my way out ... In-Reply-To: References: Message-ID: On 29/09/2022 00.41, Cameron Simpson wrote: > On 28Sep2022 09:11, Alan Gauld wrote: >> On 28/09/2022 06:16, Avi Gross wrote: >>> Before I leave this forum, I want to write a brief note so that those I >>> have gotten to know and like here do not wonder if I do not reply to >>> them >>> when they post here. >> >> Sorry to see you go Avi but you are, like everyone else here, >> a volunteer and free to choose where and how you spend >> your time. Enjoy your other outlets and activities and our >> paths are likely to cross on other fora.. > > I'm also sorry to see you go, but good luck elsewhere. Thanks for the help, advice, and provoking-of-thought you've given us, over the years! -- Regards, =dn From natprva at amazon.es Thu Sep 29 04:33:00 2022 From: natprva at amazon.es (Priede Vazquez, Natalia) Date: Thu, 29 Sep 2022 08:33:00 +0000 Subject: [Tutor] Mosel to Python Message-ID: <633df368592444c1979cc93555d16b73@amazon.es> Hello! My name is Natalia and I have experience programming in Mosel language. For my current job I need to translate a program from mosel to python, but I am new to Python and I need a lot of help. Where can I get help to do this? Best, Natalia From sjeik_appie at hotmail.com Wed Sep 28 18:41:45 2022 From: sjeik_appie at hotmail.com (Albert-Jan Roskam) Date: Thu, 29 Sep 2022 00:41:45 +0200 Subject: [Tutor] On my way out ... In-Reply-To: Message-ID: Sorry to see you go Avi. I liked your thoughtful advice. The internet is an unfriendly place at times - Don't take it personally. Best of luck to you! Albert-Jan From alan.gauld at yahoo.co.uk Thu Sep 29 04:56:26 2022 From: alan.gauld at yahoo.co.uk (Alan Gauld) Date: Thu, 29 Sep 2022 09:56:26 +0100 Subject: [Tutor] Mosel to Python In-Reply-To: <633df368592444c1979cc93555d16b73@amazon.es> References: <633df368592444c1979cc93555d16b73@amazon.es> Message-ID: On 29/09/2022 09:33, Priede Vazquez, Natalia via Tutor wrote: > Hello! My name is Natalia and I have experience programming in Mosel language. I had never heard of Mosel but I had a look at the website and it looks quite interesting. (A mix of C and Pascal!) Based on my quick skim through the tutorial I don't think converting to Python should be too difficult. While we are not Mosel experts (most of us at least, there may be some) we can certainly help with Python. If you need to translate some Mosel it will help if you include the Mosel code and an explanation of what it does. Then we can advise on the Pythonic equivalent. Also, when translating between languages there is always a temptation to do a simple line by line translation, That will usually work but often results in inefficient code in the new version. Often there will be a better, more idiomatic way, to write the code using native features of Python (especially the many standard and 3rd party library modules). So you might be best translating whole blocks of code or even whole functions at a time. But basically, feel free to ask questions. Show us any error messages you get and code snippets (we are happy with up to 100 lines inside a post. Anything bigger should go on a pastebin - we don't get attachments on the list) Finally, let us know the OS and Python version you are using. -- 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 From PythonList at DancesWithMice.info Thu Sep 29 07:10:55 2022 From: PythonList at DancesWithMice.info (dn) Date: Fri, 30 Sep 2022 00:10:55 +1300 Subject: [Tutor] Mosel to Python In-Reply-To: <633df368592444c1979cc93555d16b73@amazon.es> References: <633df368592444c1979cc93555d16b73@amazon.es> Message-ID: Hola! On 29/09/2022 21.33, Priede Vazquez, Natalia via Tutor wrote: > Hello! My name is Natalia and I have experience programming in Mosel language. For my current job I need to translate a program from mosel to python, but I am new to Python and I need a lot of help. Where can I get help to do this? Do you have any unit-tests for the Mosel application? They would be a very good place to start. Once they're complete, it will be easier to prove that the 'translated into Python' application is working properly! -- Regards, =dn From edwinconnell at gmail.com Thu Sep 29 10:29:00 2022 From: edwinconnell at gmail.com (Ed Connell) Date: Thu, 29 Sep 2022 09:29:00 -0500 Subject: [Tutor] A sorted dictionary (of sorts) Message-ID: Hi, The following works fine, but it always made me nervous because ordinary dictionaries are not supposed to be sorted. It works (for now). Should I worry that some new version of python will break things? # produce a sorted dictionary sorted_names = sorted( Team_Calc_d, key = lambda e: Team_Calc_d[ e ].current_power, reverse = True ) # sorted by current power TeamPwrSorted_Result_d = {} for tm in sorted_names: # setup SortTeams_PowerResult_Dict and copy from Analysis objects # to Results objects TeamPwrSorted_Result_d[ tm ] = Results( Team_Basics_d[ tm ].start_power ) # create the dictionary TeamPwrSorted_Result_d[ tm ].current_power = Team_Calc_d[ tm ].current_power needs_processing = False # we just updated return TeamPwrSorted_Result_d -- I have a right and a left brain, but there is nothing right in the left one and there is nothing left in the right one! From mats at wichmann.us Thu Sep 29 13:39:39 2022 From: mats at wichmann.us (Mats Wichmann) Date: Thu, 29 Sep 2022 11:39:39 -0600 Subject: [Tutor] A sorted dictionary (of sorts) In-Reply-To: References: Message-ID: On 9/29/22 08:29, Ed Connell wrote: > Hi, > > The following works fine, but it always made me nervous because > ordinary dictionaries are not supposed to be sorted. It works (for > now). Should I worry that some new version of python will break things? > > # produce a sorted dictionary > sorted_names = sorted( Team_Calc_d, key = lambda e: Team_Calc_d[ e > ].current_power, > reverse = True ) # sorted by current power > TeamPwrSorted_Result_d = {} > for tm in sorted_names: > # setup SortTeams_PowerResult_Dict and copy from Analysis objects > # to Results objects > TeamPwrSorted_Result_d[ tm ] = Results( Team_Basics_d[ tm > ].start_power ) > # create the dictionary > TeamPwrSorted_Result_d[ tm ].current_power = Team_Calc_d[ tm > ].current_power > > needs_processing = False # we just updated > > return TeamPwrSorted_Result_d > It's unlikely anything will breaks because you aren't using internals. If you want to "check your work" against a fairly well known implementation (which may have different aims than yours), take a look at Grant Jenks' stuff. https://grantjenks.com/docs/sortedcontainers/sorteddict.html From edwinconnell at gmail.com Thu Sep 29 16:42:38 2022 From: edwinconnell at gmail.com (Ed Connell) Date: Thu, 29 Sep 2022 15:42:38 -0500 Subject: [Tutor] A sorted dictionary (of sorts) In-Reply-To: References: Message-ID: Thanks for your comments and advice. Ed On Thu, Sep 29, 2022 at 12:46 PM Mats Wichmann wrote: > On 9/29/22 08:29, Ed Connell wrote: > > Hi, > > > > The following works fine, but it always made me nervous because > > ordinary dictionaries are not supposed to be sorted. It works (for > > now). Should I worry that some new version of python will break things? > > > > # produce a sorted dictionary > > sorted_names = sorted( Team_Calc_d, key = lambda e: Team_Calc_d[ e > > ].current_power, > > reverse = True ) # sorted by current power > > TeamPwrSorted_Result_d = {} > > for tm in sorted_names: > > # setup SortTeams_PowerResult_Dict and copy from Analysis > objects > > # to Results objects > > TeamPwrSorted_Result_d[ tm ] = Results( Team_Basics_d[ tm > > ].start_power ) > > # create the dictionary > > TeamPwrSorted_Result_d[ tm ].current_power = Team_Calc_d[ tm > > ].current_power > > > > needs_processing = False # we just updated > > > > return TeamPwrSorted_Result_d > > > > > It's unlikely anything will breaks because you aren't using internals. > > If you want to "check your work" against a fairly well known > implementation (which may have different aims than yours), take a look > at Grant Jenks' stuff. > > https://grantjenks.com/docs/sortedcontainers/sorteddict.html > > > _______________________________________________ > Tutor maillist - Tutor at python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- I have a right and a left brain, but there is nothing right in the left one and there is nothing left in the right one! From samiraeastcoast at gmail.com Thu Sep 29 14:09:28 2022 From: samiraeastcoast at gmail.com (samira khoda) Date: Thu, 29 Sep 2022 15:09:28 -0300 Subject: [Tutor] Python text file read/compare Message-ID: Hello I am very new to python programming. I actually just finished my course provided by my employer and now practicing on some data processing and I need some direction to solve the issue I have. Any help would be appreciated. I am trying to create a loop that reads the file line by line and compares the last timestamp to the current one in my data to find the line number where to split the files. Then do another loop that writes lines to a new file based on those line numbers. Below is the snapshot of the data. Basically I need to find where the timestamps jump down to zero or the lowest number so I can split the file. For your information the timestamps are in milliseconds on the last column. [image: image.png] *And below is the code I wrote but nothing came out of it. Not even a new text file(s). I am sure there is definitely something wrong with this. I have a very hard time to figure this out.* # op stands for output # opf stands for output file with open('hfx-test-.txt') as kyk: op='' start=0 count=1 for x in kyk.read().split("\n"): if(x=='0'): if (start==1): with open(str(count)+ '.txt', 'w') as opf: opf.write(op) opf.close() op='' count+=1 else: start=1 else: if(op==''): op = x else: op= op+ '\n' + x kyk.close() From cs at cskk.id.au Thu Sep 29 17:43:54 2022 From: cs at cskk.id.au (Cameron Simpson) Date: Fri, 30 Sep 2022 07:43:54 +1000 Subject: [Tutor] Python text file read/compare In-Reply-To: References: Message-ID: On 29Sep2022 15:09, samira khoda wrote: >Below is the snapshot of the data. Basically I need to find where the >timestamps jump down to zero or the lowest number so I can split the file. >For your information the timestamps are in milliseconds on the last column. > >[image: image.png] This list strips nontext attachments. Please just paste a few lines of example data directly into your message. >*And below is the code I wrote but nothing came out of it. I'll make a few remarks about the code inline below. >with open('hfx-test-.txt') as kyk: > op='' > start=0 > count=1 > for x in kyk.read().split("\n"): This reads all the data and then breaks it up on newlines. For big files that can be expensive. Text files are iterables, yielding lines, so you can write this: for line in kyk: x = line.rstrip() # this removes the newline > if(x=='0'): You don't need brackets in Python if-statements: if x =='0': > if (start==1): If you don't get any files, presumably `start` is never equal to `1`. > with open(str(count)+ '.txt', 'w') as opf: > opf.write(op) > opf.close() The `with open()` form does the `close()` for you, you do not need the `opf.close()`. > op='' > count+=1 and I'd have these lines outside the `with` i.e. less indented. > else: > start=1 > > else: > if(op==''): > op = x > else: > op= op+ '\n' + x It looks like you're accumulating the `x` values as one big string. That will work, but it would be more common to accumulate a list< eg: Up the top: ops = [] # an empty list. Down here: ops.append(x) In the `opf` with-statement: for op in ops: print(op, file=opf) ops = [] # we have writtne them, reset the list to empty >kyk.close() As with `opf`, the with statement closes the file for you. You don't need this line. Finally, if your code's not doing what you intend, then _either_ the if-statements have the wrong tests _or_ the variables you're testing do not have the values you expect. Put some `print()` calls in the code to see what's going on. Examples: for line in kyk: x = line.rstrip() # this removes the newline print("x =", repr(x)) print("start =", start, "count =", count, "op = ", repr(op)) That should show you the lines of data as you read them, and the values of the variable you're testing. Hopefully that should show you when things go wrong, and lead you to a fix. The `repr(x)` expression prints a representation of the value, which is particularly handy for things like strings. Cheers, Cameron Simpson From PythonList at DancesWithMice.info Thu Sep 29 17:47:13 2022 From: PythonList at DancesWithMice.info (dn) Date: Fri, 30 Sep 2022 10:47:13 +1300 Subject: [Tutor] Python text file read/compare In-Reply-To: References: Message-ID: <08fff80b-d611-6eb6-4ec3-253d65f7a9f3@DancesWithMice.info> Welcome! On 30/09/2022 07.09, samira khoda wrote: > Hello > > I am very new to python programming. I actually just finished my course > provided by my employer and now practicing on some data processing and I > need some direction to solve the issue I have. Any help would be > appreciated. Which course? > I am trying to create a loop that reads the file line by line and compares > the last timestamp to the current one in my data to find the line number > where to split the files. Then do another loop that writes lines to a new > file based on those line numbers. There's more than one task, or stage, to this. Recommendation: split the problem into separate, smaller, problems - then solve each, one at a time... > Below is the snapshot of the data. Basically I need to find where the > timestamps jump down to zero or the lowest number so I can split the file. > For your information the timestamps are in milliseconds on the last column. > > [image: image.png] Unfortunately, this list will not carry graphics-files. Please copy-paste (if it is short) - probably only need a few sample-lines to give the correct impression. > *And below is the code I wrote but nothing came out of it. Not even a new > text file(s). I am sure there is definitely something wrong with this. I > have a very hard time to figure this out.* To have something "come out", or be able to 'see' what's happening (in a routine of this size), add some print() calls. > # op stands for output > # opf stands for output file > > with open('hfx-test-.txt') as kyk: > op='' > start=0 > count=1 > for x in kyk.read().split("\n"): What does x look-like at this point? > if(x=='0'): What is the intent of this condition? > if (start==1): Why initiate the output file at this point (and not earlier)? - this is complicated! - there may be a good reason, but nothing was mentioned in the specification (above)... > with open(str(count)+ '.txt', 'w') as opf: > opf.write(op) > opf.close() > op='' > count+=1 At the start (of your work), ignore the output-stage, and replace it with one or more print() calls ("mock" the output-file). What is shown? > else: > start=1 > > else: > if(op==''): > > op = x > > else: > op= op+ '\n' + x > > kyk.close() Once the input-file processing is confirmed, how does this code extract the timestamp? How can this stage of the solution be seen/proven? -- Regards, =dn From roel at roelschroeven.net Thu Sep 29 18:17:24 2022 From: roel at roelschroeven.net (Roel Schroeven) Date: Fri, 30 Sep 2022 00:17:24 +0200 Subject: [Tutor] A sorted dictionary (of sorts) In-Reply-To: References: Message-ID: <47cd47d4-4d72-210e-4d46-a16888273c78@roelschroeven.net> Ed Connell schreef op 29/09/2022 om 16:29: > Hi, > > The following works fine, but it always made me nervous because > ordinary dictionaries are not supposed to be sorted. It works (for > now). Should I worry that some new version of python will break things? > > # produce a sorted dictionary > sorted_names = sorted( Team_Calc_d, key = lambda e: Team_Calc_d[ e > ].current_power, > reverse = True ) # sorted by current power > TeamPwrSorted_Result_d = {} > for tm in sorted_names: > # setup SortTeams_PowerResult_Dict and copy from Analysis objects > # to Results objects > TeamPwrSorted_Result_d[ tm ] = Results( Team_Basics_d[ tm > ].start_power ) > # create the dictionary > TeamPwrSorted_Result_d[ tm ].current_power = Team_Calc_d[ tm > ].current_power > > needs_processing = False # we just updated > > return TeamPwrSorted_Result_d These days Python dictionaries are ordered (which is not the same as sorted), meaning that they preserve the order in which keys were inserted. This was already the case in version 3.6 of the CPython implementation, but since version 3.7 dictionary order is guaranteed to be insertion order in all conforming implementations. You sort the keys before you insert the items, and you then insert them in that order, so everything is fine. Since that behavior is now guaranteed, you can rely on it. Should it ever change, which is very unlikely, there would be a depreciation period to give everybody the chance to fix things. -- "The saddest aspect of life right now is that science gathers knowledge faster than society gathers wisdom." -- Isaac Asimov From threesomequarks at proton.me Thu Sep 29 18:05:12 2022 From: threesomequarks at proton.me (ThreeBlindQuarks) Date: Thu, 29 Sep 2022 22:05:12 +0000 Subject: [Tutor] A sorted dictionary (of sorts) In-Reply-To: References: Message-ID: <8-uYnvh3Tg-rP5fYkxliSdU6I2wmY6t0Zs8bh9ttR-Q1hwINongmN7U0benJ73wojQBUquEL_AQvKw2Lp1CQnyv9zRCYn9Jid8Njgidq7GI=@proton.me> If one may ask, what is the great advantage of keeping a dictionary sorted? A major point in hashing something is to get access to any item in constant time. Python once stated dictionaries had no pre-defined guaranteed order but that has changed and there is one that keeps the keys in the order they were added. If you want keys sorted alphabetically or numerically or sorted by values, you can simply create a function to sort them when you want to use them such as in an iterable. Changes in Python would not easily break your access function. Some people have created hash-like objects extend dictionaries in many ways and you could do that too. - 3 Sent with Proton Mail secure email. ------- Original Message ------- On Thursday, September 29th, 2022 at 10:29 AM, Ed Connell wrote: > Hi, > > The following works fine, but it always made me nervous because > ordinary dictionaries are not supposed to be sorted. It works (for > now). Should I worry that some new version of python will break things? > > # produce a sorted dictionary > sorted_names = sorted( Team_Calc_d, key = lambda e: Team_Calc_d[ e > ].current_power, > reverse = True ) # sorted by current power > TeamPwrSorted_Result_d = {} > for tm in sorted_names: > # setup SortTeams_PowerResult_Dict and copy from Analysis objects > # to Results objects > TeamPwrSorted_Result_d[ tm ] = Results( Team_Basics_d[ tm > ].start_power ) > # create the dictionary > TeamPwrSorted_Result_d[ tm ].current_power = Team_Calc_d[ tm > ].current_power > > needs_processing = False # we just updated > > return TeamPwrSorted_Result_d > > -- > I have a right and a left brain, but there is nothing right in the left one > and there is nothing left in the right one! > _______________________________________________ > Tutor maillist - Tutor at python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor From edwinconnell at gmail.com Fri Sep 30 14:06:24 2022 From: edwinconnell at gmail.com (Ed Connell) Date: Fri, 30 Sep 2022 13:06:24 -0500 Subject: [Tutor] A sorted dictionary (of sorts) In-Reply-To: <47cd47d4-4d72-210e-4d46-a16888273c78@roelschroeven.net> References: <47cd47d4-4d72-210e-4d46-a16888273c78@roelschroeven.net> Message-ID: Thanks for the reassurance, Roel. On Thu, Sep 29, 2022 at 6:42 PM Roel Schroeven wrote: > Ed Connell schreef op 29/09/2022 om 16:29: > > Hi, > > > > The following works fine, but it always made me nervous because > > ordinary dictionaries are not supposed to be sorted. It works (for > > now). Should I worry that some new version of python will break things? > > > > # produce a sorted dictionary > > sorted_names = sorted( Team_Calc_d, key = lambda e: Team_Calc_d[ e > > ].current_power, > > reverse = True ) # sorted by current power > > TeamPwrSorted_Result_d = {} > > for tm in sorted_names: > > # setup SortTeams_PowerResult_Dict and copy from Analysis > objects > > # to Results objects > > TeamPwrSorted_Result_d[ tm ] = Results( Team_Basics_d[ tm > > ].start_power ) > > # create the dictionary > > TeamPwrSorted_Result_d[ tm ].current_power = Team_Calc_d[ tm > > ].current_power > > > > needs_processing = False # we just updated > > > > return TeamPwrSorted_Result_d > These days Python dictionaries are ordered (which is not the same as > sorted), meaning that they preserve the order in which keys were > inserted. This was already the case in version 3.6 of the CPython > implementation, but since version 3.7 dictionary order is guaranteed to > be insertion order in all conforming implementations. > > You sort the keys before you insert the items, and you then insert them > in that order, so everything is fine. > > Since that behavior is now guaranteed, you can rely on it. Should it > ever change, which is very unlikely, there would be a depreciation > period to give everybody the chance to fix things. > > -- > "The saddest aspect of life right now is that science gathers knowledge > faster than society gathers wisdom." > -- Isaac Asimov > > _______________________________________________ > Tutor maillist - Tutor at python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- I have a right and a left brain, but there is nothing right in the left one and there is nothing left in the right one!