Re: Guido sees the light: PEP 8 updated
We employ a pretty hard limit of 100. This way I can reliably have 1 module split vertically with a test or configuration file open or 3 separate modules, etc. I find 80 to be a bit strict, although in the past I've been in unfortunate environments where it was helpful. The rest of PEP8 is largely adhered to wherever possible and it's been wonderful. When I first came to the project it had no real standard and was mostly formatted at the whims of the one dev working on it. It was a mess. The team has grown significantly internationally and a codified standard not rooted in any of our habits is great. (I've never replied to this list so I hope I don't goof up.) On Sat, Apr 16, 2016 at 2:18 PM, BartC wrote: > On 16/04/2016 17:58, Larry Martell wrote: > >> On Sat, Apr 16, 2016 at 12:51 PM, Marko Rauhamaa >> wrote: >> >>> Larry Martell : >>> >>> I have worked for many companies where you are required to get a clean run of pep8 on your code before your pull request will even be considered for approval. I don't agree with this at all, as I think it makes the code very ugly, especially enforcing the max line length. >>> >>> Agh, I was with you until your last remark. >>> >>> A max line length of 79 characters is among the *only* rigorous >>> principles I judge coding style on. >>> >>> It comes with the maxim that one function must be visible at once on the >>> screen. >>> >> >> if we still had 1970's 80 character TTYs that would matter but on my >> 29" 1920x1080 screen it doesn't. >> > > There are reasons why 'broadsheet' newspapers don't have a single wide > column spanning the entire width of the page, but are divided into multiple > columns. > > (But I think 80 columns is a bit limited. Maybe 100 or 132.) > > -- > Bartc > -- > https://mail.python.org/mailman/listinfo/python-list > -- "On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question." -Charles Babbage, 19th century English mathematician, philosopher, inventor and mechanical engineer who originated the concept of a programmable computer. -- https://mail.python.org/mailman/listinfo/python-list
Re: Guido sees the light: PEP 8 updated
The 80 column limit probably helps protect us from the singularity. Once the robots take over we will have code with a digestible amount of logic per line and can fix what we have caused. In other words, Java is only armoring the robots against us for the inevitable battle. On Sat, Apr 16, 2016 at 7:33 PM, Chris Angelico wrote: > On Sun, Apr 17, 2016 at 9:25 AM, Ben Bacarisse > wrote: > > Dennis Lee Bieber writes: > > > >> I still miss the Amiga -- in which one could /push/ a window to > the > >> back of the stack while still retaining input focus! Made it nice for > >> transcribing stuff from a visible window to a text input region while it > >> was obscured. > > > > That was commonly available on Unix window managers and is still around. > > I use it on even an up-to-date Linux/Gnome3 system (you set focus > > follows mouse rather than focus on click). > > Focus follows mouse is annoying for other reasons though. > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > -- "On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question." -Charles Babbage, 19th century English mathematician, philosopher, inventor and mechanical engineer who originated the concept of a programmable computer. -- https://mail.python.org/mailman/listinfo/python-list
Re: How to become more motivated to learn Python
Beyond motivation, it's not likely just reading a flat text will be retained meaningfully without creative problem solving. Personal projects are the best route in my opinion. I like reading technical books but I figure I retain a small percentage of the specifics. On May 4, 2016 6:32 AM, "mviljamaa" wrote: > I tend to not have the patience to go through programming tutorials, > because I think they're boring. I sometimes use them as reference to see or > recall how something is done, but I don't step through them in order to > learn a language. > > Rather, I write programs to learn programming and languages. It's easier > if you have some background in programming in some other language. > > I merely pick personal projects that interest me and then try to develop > them to finish. I seek resources that help me do what I need to. > > I think it's easier to be motivated in actual projects that interest you, > rather than programming assignments. > > -Matti > > Cai Gengyang kirjoitti 2016-05-03 14:20: > >> So I have completed up to CodeAcademy's Python Unit 2 , now moving on >> to Unit3 : Conditionals and Control Flow. >> >> But I feel my motivation wavering , at times I get stuck and >> frustrated when trying to learn a new programming language ? >> >> This might not be a technical question per say, but it is a Python >> programming related one. How do you motivate a person (either yourself >> or your child) to become more interested in programming and stick with >> it ? Is determination in learning (especially in a tough field like >> software) partly genetic ? >> >> Related , This is a very well written essay on determination by Paul >> Graham >> >> http://www.paulgraham.com/determination.html >> >> Gengyang >> > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: Python is an Equal Opportunity Programming Language
It seems like it would be equal opportunity between sexes. 1:1 opportunity to ask based on apparent sex. It is not equal representation necessarily. On May 6, 2016 5:53 PM, "beliavsky--- via Python-list" < [email protected]> wrote: > On Friday, May 6, 2016 at 5:07:28 PM UTC-4, Ethan Furman wrote: > > On 05/06/2016 01:35 PM, beliavsky--- via Python-list wrote: > > > > > Most of [Guido's] keynote at that conference was answering questions > from > > > the people who had attended. And he actually said, "Let's alternate > > between > > > men and women asking questions."On the second day of the conference, > > he was > > > wearing a shirt from PyLadies, another nonprofit like Django Girls > > that helps > > > women learn how to program on Python. > > > > > > * > > > > > > This not "equal opportunity". It is a quota system. > > > > It's a corrective action, a way of getting men accustomed to listening > > to women and hearing good ideas and questions from them, and a way to > > accustom women to speaking in (currently) male dominated groups. > > It's silly to say that just because a group is over-represented that it > "dominates". If a conference has more Asians than whites does that > necessarily make it Asian-dominated? > > > And it is far more equal opportunity than having 25 males ask questions > > and only one or two females. > > Not if there are 25 males with questions and only one or two females with > questions. Among the people who have questions, you could choose randomly. > You and Terry Reedy misuse the term "equal opportunity". > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: How to put back a number-based index
I have recently been going through "Data Science From Scratch" which may be
interesting. There is a podcast with the author on talk python to me.
https://talkpython.fm/episodes/show/56/data-science-from-scratch
On Sat, May 14, 2016 at 10:33 AM, Michael Selik
wrote:
> You might also be interested in "Python for Data Analysis" for a thorough
> discussion of Pandas.
> http://shop.oreilly.com/product/0636920023784.do
>
> On Sat, May 14, 2016 at 10:29 AM Michael Selik
> wrote:
>
> > David, it sounds like you'll need a thorough introduction to the basics
> of
> > Python.
> > Check out the tutorial: https://docs.python.org/3/tutorial/
> >
> > On Sat, May 14, 2016 at 6:19 AM David Shi wrote:
> >
> >> Hello, Michael,
> >>
> >> I discovered that the problem is "two columns of data are put together"
> >> and "are recognised as one column".
> >>
> >> This is very strange. I would like to understand the subject well.
> >>
> >> And, how many ways are there to investigate into the nature of objects
> >> dynamically?
> >>
> >> Some object types only get shown as an object. Are there anything to be
> >> typed in Python, to reveal objects.
> >>
> >> Regards.
> >>
> >> David
> >>
> >>
> >> On Saturday, 14 May 2016, 4:30, Michael Selik
> >> wrote:
> >>
> >>
> >> What were you hoping to get from ``df[0]``?
> >> When you say it "yields nothing" do you mean it raised an error? What
> was
> >> the error message?
> >>
> >> Have you tried a Google search for "pandas set index"?
> >>
> >>
> http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.set_index.html
> >>
> >> On Fri, May 13, 2016 at 11:18 PM David Shi
> wrote:
> >>
> >> Hello, Michael,
> >>
> >> I tried to discover the problem.
> >>
> >> df[0] yields nothing
> >> df[1] yields nothing
> >> df[2] yields nothing
> >>
> >> However, df[3] gives the following:
> >>
> >> sid
> >> -9223372036854775808 NaN
> >> 1 133738.70
> >> 4 295256.11
> >> 5 137733.09
> >> 6 409413.58
> >> 8 269600.97
> >> 9 12852.94
> >>
> >>
> >> Can we split this back to normal? or turn it into a dictionary, so
> that I can put values back properly.
> >>
> >>
> >> I like to use sid as index, some way.
> >>
> >>
> >> Regards.
> >>
> >>
> >> David
> >>
> >>
> >>
> >> On Friday, 13 May 2016, 22:58, Michael Selik
> >> wrote:
> >>
> >>
> >> What have code you tried? What error message are you receiving?
> >>
> >> On Fri, May 13, 2016, 5:54 PM David Shi wrote:
> >>
> >> Hello, Michael,
> >>
> >> How to convert a float type column into an integer or label or string
> >> type?
> >>
> >>
> >> On Friday, 13 May 2016, 22:02, Michael Selik
> >> wrote:
> >>
> >>
> >> To clarify that you're specifying the index as a label, use df.iloc
> >>
> >> >>> df = pd.DataFrame({'X': range(4)}, index=list('abcd'))
> >> >>> df
> >>X
> >> a 0
> >> b 1
> >> c 2
> >> d 3
> >> >>> df.loc['a']
> >> X0
> >> Name: a, dtype: int64
> >> >>> df.iloc[0]
> >> X0
> >> Name: a, dtype: int64
> >>
> >> On Fri, May 13, 2016 at 4:54 PM David Shi
> wrote:
> >>
> >> Dear Michael,
> >>
> >> To avoid complication, I only groupby using one column.
> >>
> >> It is OK now. But, how to refer to new row index? How do I use
> floating
> >> index?
> >>
> >> Float64Index([ 1.0, 4.0, 5.0, 6.0, 8.0, 9.0, 10.0, 11.0, 12.0,
> 13.0, 16.0,
> >> 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0,
> 26.0, 27.0,
> >> 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0,
> 37.0, 38.0,
> >> 39.0, 40.0, 41.0, 42.0, 44.0, 45.0, 46.0, 47.0, 48.0,
> 49.0, 50.0,
> >> 51.0, 53.0, 54.0, 55.0, 56.0],
> >> dtype='float64', name=u'StateFIPS')
> >>
> >>
> >> Regards.
> >>
> >>
> >> David
> >>
> >>
> >>
> >> On Friday, 13 May 2016, 21:43, Michael Selik
> >> wrote:
> >>
> >>
> >> Here's an example.
> >>
> >> >>> import pandas as pd
> >> >>> df = pd.DataFrame({'group': list('AB') * 2, 'data': range(4)},
> >> index=list('wxyz'))
> >> >>> df
> >>data group
> >> w 0 A
> >> x 1 B
> >> y 2 A
> >> z 3 B
> >> >>> df = df.reset_index()
> >> >>> df
> >> index data group
> >> 0 w 0 A
> >> 1 x 1 B
> >> 2 y 2 A
> >> 3 z 3 B
> >> >>> df.groupby('group').max()
> >> index data
> >> group
> >> A y 2
> >> B z 3
> >>
> >> If that doesn't help, you'll need to explain what you're trying to
> >> accomplish in detail -- what variables you started with, what
> >> transformations you want to do, and what variables you hope to have when
> >> finished.
> >>
> >> On Fri, May 13, 2016 at 4:36 PM David Shi
> wrote:
> >>
> >> Hello, Michael,
> >>
> >> I changed groupby with one column.
> >>
> >> The inde
Re: Django Girls workshop at EuroPython 2016
From the link: "If you are a woman, know English and have a laptop you can apply for a pass!" So it would appear so. On Thu, May 26, 2016 at 5:39 AM, Karim wrote: > > > On 26/05/2016 10:58, M.-A. Lemburg wrote: > >> We’re pleased to announce a Django Girls workshop on Sunday, July 17, >> the first day of the EuroPython 2016 conference. >> >> If you want participate or know someone who’d like to join, please >> fill in our application form on the Django Girls’ website: >> >> >> *** Django Girls EuroPython 2016 *** >> >>https://djangogirls.org/europython2016/ >> >> >> Remember: you don’t need any prior programming knowledge to >> participate ! >> >> >> About the workshop >> -- >> >> After the workshop you will have learned about: >> >> * HTML / CSS >> * Python / Django >> >> and in a single day, you’ll have created a blog. >> >> If that sounds challenging, no worries: our friendly coaches will help >> you. >> >> Paola Katherine, DG organizer: >> >> "If you participate, we’ll raffle one full ticket for EuroPython >> 2016, the largest and best Python event in Europe." >> >> >> More infos >> -- >> >> The Django Girls EuroPython 2016 networks: >> >> * More infos and details on the website: djangogirls.org/europython2016 >> * Facebook: fb.me/djangogirlseuropython >> * Twitter: @DjangoGirlsEP16 >> >> If you have questions, please write to [email protected] >> >> >> With gravitational regards, >> -- >> EuroPython 2016 Team >> http://ep2016.europython.eu/ >> http://www.europython-society.org/ >> >> >> PS: Please forward or retweet to help us reach all interested parties: >> https://twitter.com/europython/status/735755247046426624 >> Thanks. >> > > Hello, > > This is only for girls? > > Regards > KL > > -- > https://mail.python.org/mailman/listinfo/python-list > -- "On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question." -Charles Babbage, 19th century English mathematician, philosopher, inventor and mechanical engineer who originated the concept of a programmable computer. -- https://mail.python.org/mailman/listinfo/python-list
Re: movie from pictures
I find shlex.split to be most useful to make my arguments a list in these cases. On Jun 9, 2016 3:28 PM, "MRAB" wrote: > On 2016-06-09 19:58, Peter Otten wrote: > >> Nev wrote: >> >> Thank you for your reply. I tried something like this in python code: >>> >>> from subprocess import call >>> call(["ffmpeg -framerate 4/1 -start_number 1 -i >>> C:\\Projects\\data2\\img_%05d.png -c:v libx264 -r 30 -pix_fmt yuv420p >>> C:\\Projects\\data2\\movie.mp4"]) >>> >>> But it did not work. I get FileNotFoundError: [WinError 2] The system >>> cannot find the file specified.. >>> >> >> You have to pass the command-line arguments as separate items in the list: >> >> call(["ffmpeg", >> "-framerate", "4/1", >> "-start_number", "1", >> "-i", "C:\\Projects\\data2\\img_%05d.png", >> ... # and so on >> ]) >> >> You should also give it the full path of ffmpeg. > > On the other hand, in-loop solution would be more preferable since it lets >>> me to use variable names of the images and paths.. >>> >> > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: PyCon Keynote
I enjoyed it. Skipped most of the intro video but I enjoyed the content of his talk. Shared with a co-worker as well. On Jun 18, 2016 5:23 PM, "Chris Angelico" wrote: > On Sun, Jun 19, 2016 at 7:14 AM, Quivis wrote: > > On Thu, 09 Jun 2016 12:53:37 -0700, Ethan Furman wrote: > > > >>https://www.youtube.com/watch?v=bSfe5M_zG2s > > > > Good example of how not to do a presentation. Embarrassing. > > I turned it off after one minute. > > Strange. Must be in the eye of the beholder... I watched it, shared it > with members of my family, then added it to our list of "watch these > if you haven't". > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
