Re: [Tutor] Advanced python recommendations
On 10/10/18 20:54, Mats Wichmann wrote: >>> This is actually the concept of test driven development (TDD), which I'm >>> not a huge proponent of personally, but kind of useful for this: >> >> I'm curious: What are the things you find less than satisfactory for TDD? > "TDD as religion" seems to me to lead to an absence of thinking about > overall system design, and system testing. An excess focus on the unit, I'll +1 that. I believe in TDD in principle - or more accurately I believe in thorough unit testing. Whether the testing drives the development is another story with pros and cons of its own. But the biggest downside of TDD, as often preached, is too strong a focus on unit tests. There then comes an assumption that if all the units work then the system must work. Which is not true at all. Not even close. So unit tests are essential, but they are a small part of the overall testing regime needed to deliver any significant system. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
[Tutor] Help please
I have no clue what I’m doing wrong, I’m a new student food_1=input("Sushi") food_2=input("Quesdilla") new_food=food_1+food_2 print("Combining these foods will you,",new_food) input("Press enter to continue") Sent from Mail for Windows 10 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
[Tutor] Regarding python functions
Dear Sir/Ma'am, I'm a beginner who has started to learn this wonderful and easy software language through the help of my school... I am not clear with the functions in python, which we can create while programming in order to make our program efficient and neat... Please brief me with those at the earliest... Thanking you, Yours truly, Siddharth ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
[Tutor] Asynchronous http requests in Python
Hi everyone, I am using python 2.7 and I wanted to ask the list the best way to issue multiple concurrent http requests from a Django application: Any input, suggestions are appreciated Thank you Sent from my iPhone ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Tutor Digest, Vol 176, Issue 13
Try for river in rivers: print ("The " + river + " is in the country of " + rivers[river]) On Wed, Oct 10, 2018 at 9:30 PM wrote: > Send Tutor mailing list submissions to > tutor@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-requ...@python.org > > You can reach the person managing the list at > tutor-ow...@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: help please (Abdur-Rahmaan Janhangeer) >2. Re: Advanced python recommendations (Abdur-Rahmaan Janhangeer) >3. Re: help please (Mirage Web Studio) >4. Re: help please (Deepak Dixit) >5. Re: Advanced python recommendations (Mariam Haji) > > > > -- Forwarded message -- > From: Abdur-Rahmaan Janhangeer > To: Michael Schmitt > Cc: tutor > Bcc: > Date: Wed, 10 Oct 2018 11:53:41 +0400 > Subject: Re: [Tutor] help please > i think it should have been > > for river in rivers instead of > for rivers in rivers > > Abdur-Rahmaan Janhangeer > https://github.com/Abdur-rahmaanJ > Mauritius > > > > > -- Forwarded message -- > From: Abdur-Rahmaan Janhangeer > To: Mariam Haji > Cc: Tutor@python.org > Bcc: > Date: Wed, 10 Oct 2018 14:26:24 +0400 > Subject: Re: [Tutor] Advanced python recommendations > apart from already said, see popular python projects, and read the source > as you would read a book. you'll discover amazing tricks, it'll broaden > your horizon. hanging around those who achieved a good level will make you > level up. > > Abdur-Rahmaan Janhangeer > Mauritius > > > > > -- Forwarded message -- > From: Mirage Web Studio > To: Michael Schmitt , Python Tutor Mailing > List > Cc: > Bcc: > Date: Wed, 10 Oct 2018 13:45:40 +0530 > Subject: Re: [Tutor] help please > You are using the same variable name twice. > You may use "rivers" for the dict and "river" for values. > Also use descriptive names for variables. For eg if you correct the above > mistake, the next one will be this line > > for rivers in rivers.values(): > print (rivers) > > > and sorry for top positing. > > > On Wed 10 Oct, 2018, 12:38 Michael Schmitt, > wrote: > > > To whom it may concern: > > > > > > I am trying to teach myself Python and ran into a problem. This is my > code > > > > > > # name of rivers and country > > > > rivers = {'nile' : 'egypt', 'ohio' : 'US', 'rhine' : 'germany' } > > > > # prints river name > > for rivers in rivers.keys(): > > print (rivers) > > > > #prints country > > for rivers in rivers.values(): > > print (rivers) > > > > # prints statement " The (river) is in the country of (country) > > for rivers in rivers: > > print ("The " + rivers.keys() + "is in the country of " + > > rivers.vaules()) > > > > I am getting the following error > > for rivers in rivers.values(): > > AttributeError: 'str' object has no attribute 'values' > > > > Thanks for the help. > > > > Sincerely, > > > > Michael S. Schmitt > > > > > > [ > > > https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif > > ]< > > > https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon > > > > Virus-free. www.avast.com< > > > https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link > > > > > ___ > > Tutor maillist - Tutor@python.org > > To unsubscribe or change subscription options: > > https://mail.python.org/mailman/listinfo/tutor > > > > > > > -- Forwarded message -- > From: Deepak Dixit > To: Michael Schmitt > Cc: tutor@python.org > Bcc: > Date: Wed, 10 Oct 2018 12:43:46 +0530 > Subject: Re: [Tutor] help please > On Wed, Oct 10, 2018, 12:37 PM Michael Schmitt > > wrote: > > > To whom it may concern: > > > > > > I am trying to teach myself Python and ran into a problem. This is my > code > > > > > > # name of rivers and country > > > > rivers = {'nile' : 'egypt', 'ohio' : 'US', 'rhine' : 'germany' } > > > > # prints river name > > for rivers in rivers.keys(): > > print (rivers) > > > > #prints country > > for rivers in rivers.values(): > > print (rivers) > > > > # prints statement " The (river) is in the country of (country) > > > > Why are you using "for rivers in rivers". > Replace this for loop with :- > > for river in rivers: > print ("The " + river + "is in the country of " + rivers.get(river)) > > for rivers in rivers: > > print ("The " + rivers.keys() + "is in the country of " + > > rivers.vaules()) > > > > I am getting the following error > > for rivers in rivers.values(): > > AttributeError: 'str' object has no attribute 'values' > > > > Thanks for the help. > > > > Sincerely, > >
Re: [Tutor] Help please
On 11/10/18 04:19, Holly Jo wrote: > > I have no clue what I’m doing wrong, I’m a new student > > food_1=input("Sushi") > food_2=input("Quesdilla") > new_food=food_1+food_2 > print("Combining these foods will you,",new_food) > input("Press enter to continue") Please always tell us what has gone wrong. What you expected and what you got. If there is an error message send the full error text. It also helps if you tell us which Python version and OS you are using. Based on the above I'm guessing you may be running this Python v3 code using Python v2. One of the changes between 3 and 2 is how input() works. If that's not the case then you need to provide more details, as requested above. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Regarding python functions
On 11/10/18 14:25, Siddharth V wrote: > I am not clear with the functions in python, which we can create while > programming in order to make our program efficient and neat... > Please brief me with those at the earliest... Its not clear exactly what kind of help you need so for now I will point you to the topic in my tutorial that covers functions - both using and defining them. http://www.alan-g.me.uk/l2p2/tutfunc.htm If that does not help please come back with more specific questions. Include any code you have tried and any error messages you received. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Asynchronous http requests in Python
On 10/10/18 23:17, Lulu wrote: > Hi everyone, > I am using python 2.7 and I wanted to ask the list the best way> to issue > multiple concurrent http requests from a Django application: This may be better addressed on the Django mailing list since Django may well have its own support for this. However in regular Python code there are multiple options and the best solution depends on the exact requirements on how these are to be processed. modules to research include threading, multiprocessing, and asyncio. But there are several other options besides. Which one is "best" depends on exactly what you need to do, your server environment, even your OS... That's why the Django users may be a more useful resource. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Help please
What are you trying to do? tor. 11. okt. 2018 18.33 skrev Holly Jo : > > I have no clue what I’m doing wrong, I’m a new student > > food_1=input("Sushi") > food_2=input("Quesdilla") > new_food=food_1+food_2 > print("Combining these foods will you,",new_food) > input("Press enter to continue") > > > Sent from Mail for Windows 10 > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Help please
https://www.w3schools.com/python/ref_func_input.asp tor. 11. okt. 2018 18.51 skrev Carlton Banks : > What are you trying to do? > > tor. 11. okt. 2018 18.33 skrev Holly Jo : > >> >> I have no clue what I’m doing wrong, I’m a new student >> >> food_1=input("Sushi") >> food_2=input("Quesdilla") >> new_food=food_1+food_2 >> print("Combining these foods will you,",new_food) >> input("Press enter to continue") >> >> >> Sent from Mail for Windows 10 >> >> ___ >> Tutor maillist - Tutor@python.org >> To unsubscribe or change subscription options: >> https://mail.python.org/mailman/listinfo/tutor >> > ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor