Everyday Python Programming - Engineer Man Live - Jan 2019 #2

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's going on everyone just sound test we're gonna start hearing about one minute two minutes you what's going on everyone welcome to the stream hope everybody's happy have enough happy Saturday today so the stream content today actually first do the channel update so the big update is going to be the engineer main knowledge center that is kind of the thing that we made a while back to collect all the knowledge for different people as well as have some challenges and contests and various other things and the question and answer piece didn't really you know nobody used that a whole lot that wasn't that popular however the actual challenges piece of it was was wildly popular so what we've done is this is a major change is we've completely discontinued question and answer because it wasn't really used at all and instead we're focusing entirely on the challenges and contests piece so there's already some challenges there there's about I think I just go there real quick get rid of this here just for a moment well I'm huge okay anyway larger than life here hold on so the homepage front and center of course is the just the leader board now you know everybody you know all the points there's one guy at the top Kyle undefined' who's actually new a staff member he's completed 100% of all the challenges which is pretty cool so you can come here and check out different challenges I've got some easy ones medium ones hard ones but we're gonna be putting more time into this putting more effort into the the challenges piece of iam Casey because people love this and we're gonna be adding more and then the next thing is gonna be contests contests are gonna be something that we'll do weekly it'll be in like a code golf style format where if you'll know what code golf is it's basically who can accomplish the challenge in the minimum amount of code and it's still going to use the same solution checker that the challenges does it's just gonna record also the length of the solution and then that's that's how things gonna be rated it's not gonna be a time-based like you don't have to rush to do it you know you'll have a full week to do it and of course different languages are longer you know like you're probably going to do things with less code in Python than you are with Java so we'll break it down into different language categories that way if you're doing solutions in Java you're competing against somebody who's also doing things in Java so I'm gonna try to get the first one of these out within the next like two to three weeks and then from there it'll just be a weekly thing because I got to build all the blood or play for it so that's the big update for emk see there is no more QA there's none of that this is purely a learning place now with challenges contests resources and then of course you get awarded for for your stuff you know if you want to be on the leaderboard then you know go there and do some challenges so there's like 480 members in the MKC right now and a total of like 30 30 thousand points awarded and total of at least 700 challenges accomplished so it's pretty cool some activity here should be a lot of fun so I'll close that up that's the big kind of the big update for that as far as the channel channel is healthy don't need to talk too much about that we're approaching hundred fifty K I'm gonna do a I'm gonna do a hundred and fifty K video and it will do it 250 K 500 K and a million if that's even something that could happen so that'll be the that would be the schedule for that sorry I'm gonna take a few questions I'm gonna look at some questions here that they've sent me if you have any questions specifically about you know coding or whatever not not too specific think more like look more like theory you know don't ask me like how to convert things into a list and python and ask me something theory-based and I can answer that here alive so I'm gonna check it out Oh Mouse up to you yeah Mouse update so the mouse is gone but so it's my server and I haven't fixed it yet I need to do need to buy a new system board for this haven't done so okay how do I get Tama to how do I get motivated to code so the best way to get motivated to code is to kind of skip past the point of starting to code and look at kind of the end state so the assumption is if you're beginning a new project you're doing it because you either want to learn which is a benefit to yourself or you're doing it because you want to help other people that's probably also a benefit to yourself as well as a benefit to others or maybe you're doing it to better yourself professionally you know maybe your maybe your employer has said hey you should look at react and then you want to do a react project so you got a look at the end goal and say you know I'm gonna I'm gonna do I'm gonna put the effort in on this project and it's gonna get me XY and Z reward and then that that's how you can get motivated and also learning at least for me like learning something new that itself is motivation because I just want to I want to learn everything when everything there is to know about programming for your science and so on that's a good way what's my pin on OS CP is that I don't actually what that is offense I don't know what that is I'm sorry what cool automated home TAS are in Python I did a probably my coolest home automation thing is I did a a garage door opener and this is a long time ago this was when like the Raspberry Pi I did it with the Raspberry Pi one and I want to say that came out 2000 what 12 it's like that so around there so I didn't automate a garage door opener with that I made a simple app I use the simple relay I used the Raspberry Pi I used a Wi-Fi module not module but a a a key and then I built it up so I was able to open my garage door and that was extremely satisfying and that was kind of my first foray into kind of the home automation space a blue monk said can I use a VM to practice Linux installations from scratch absolutely in fact that's the best way to do it because when you're using a VM you can't you know the VM is separate from your host system which means that there's nothing you can do in the VM that can harm your host system and that's a huge benefit because you could be really reckless you can be really aggressive with your installation and you don't have to worry about messing anything up you don't have to be careful you can just you can focus primarily on the learning without worrying about the consequences what is the best idea of 2019 I you know the thing about I des and anybody that's been my discord server that any time I catch people talking about you know Adams the best ie D or vs Coates the best ie D or or Jeff brands or whatever I always tell people the same thing I say the best IDE is the one that you can be the most productive with so if the answer to that question is Adam editor then Adam editor is the best idea for you vs code is the one then that's the best idea for you if you like jet brain stuff pycharm what not fantastic yeah some guy Jeremy mentioned vim hey if you can use vim and be ultra productive and that's the thing you know the best then more power to you that is vim would be the best iid in that case I am part of team Adam but hey that's that's just me that doesn't make it the best just makes it the best for me like I'm really good at Adam and I'm not really good at BS code how do you do GPU pass-through I actually don't know I've never never done that I'm sorry I can to that one how does it differ from hacker rank Elite code it I I guess II MKC is just the place where if you want to be in the e MKC community and you want to do things where you're going up against your fellow you know community people then that would be what sets it apart but certainly there's no you know em Casey's not doing anything special in the way of of challenges of course you can find you can find challenges all over the place on the Internet Oh French fruits Python GUI czar tough what is your go-to pie cutie tkinter or nothing I I like so I like tkinter I think it's lighter and I also like if I'm building certain blood there's a thing called W Khalid and that's a nifty way to build kind of GUI applications with with Python but tkinter is also fine too and pipe iqt I mean pie cutie I would say is the most comprehensive because it's backed by QT which is which is fairly heavy but so it's not like what you're wanting to accomplish and then you know certainly nothing could be an option as well I mean if if you're if your GUI can be serviced by like a terminal like a to e a terminal UI then I suppose that'd be fine too and thanks for the 10 in French boots I appreciate it he's a longtime supporter so thank you very much for that now so good do more Jim okay good question where can i lauren to linux okay so i have a good PDF for that i'm gonna post it later just somebody remind me on discord I have a I have a really cool like Systems Administrator PDF for hot for learning Linux and it's one that I've read myself it's really great it teaches you a lot of the a lot of the basic terminal commands I know I said Systems Administrator but it reads more like a junior Systems Administrator which kind of teaches you the basics of Linux so if you remind me on discord to get that for you I will I will kick that PDF over to you I I don't I don't use Microsoft Azure I host on Google cloud platform and I also host on digital ocean which works for me but it could you know I guess a sure is fine if you're doing Microsoft stuff okay so there's a lot more questions I'm gonna put some these on hold and we're gonna get to the coding but I promise I'm gonna we're gonna come back to answering that so what are we coding today we are coding you know so if you read the title it says every day Python programming and it's important to understand what that means in the context of of what type of coding we're gonna be doing so I've had a lot of people some of my friends they they approached me and they say you know Brian if I wanted to get involved in programming you know I have no programming skills what what would I do like what projects would I take on and I always tell them I say what things do you do manually today and they say well I you know I do some manual things you know for my job you know maybe I maybe I work in a legal office or something and I'm constantly going out to a site to get updated data you know or I'm crunching some numbers in a spreadsheet or I just hey Kevin what man glad you could make it you know or I'm you know or I'm doing some particular task for for whatever I'm doing and so everyday programming is like you know what's the minimum amount of skills you need to learn to do something useful that would help you out just as a normal person so I picked two examples today that we're gonna do that are applicable to pretty much everybody who works with a computer not necessarily not necessarily a programmer just people that work with a computer so we're gonna be doing two things today we're gonna be processing vCard contacts from a export that came from Google takeout and then we're gonna process some spreadsheet data that was in Google sheets but we want to pull it into Python to do some advanced kind of calculations on it so that's that's the two things we're doing today so you know the first is the context if if you don't know this Google lets you export all of your data off of Google and but the problem with that is it's not always in them here I won't blind people but it's not always in the most consumable format so in this case for the contacts you know when you export your contacts through Google takeout what you get is you get a VCF file and it's a it's a vCard file and there are plenty of things on the internet that will that will consume vCard information it's just what if you come across the one place that does not you know what what is your solution now do you just manually do all this you know do you just one by one you know take the name copy it in take the email copy it in go the next one and then what do you just do that a thousand times like that's that's ridiculous you know why would you do that so we're gonna build just a simple script that just reads the v-cards into some structured format and then output it into format that you actually need whether that's comma separated tab separated JSON or just some some proprietary standard so we have our context dot VCF and we're gonna do is just read that into a variable and these are really short scripts because memory these are designed to be for people that have a little programming language it's like how little amount of programming which you have to learn to shorten copying a thousand contacts down to writing a five-minute script so we're gonna write like 20 lines of code something like that so simply will do with you know open you have contacts VCF so that's gonna be our that's gonna be our context file as F and then we'll just set like you know contacts equals F dot read you know will read everything into that variable and it will just strip the whitespace off the end and then split on a new line and just that alone is going to get us you know all the lines of I gotta so you can see that gets us a it gets us a list of all the elements that are that are in the vCard now this itself is not useful but you know here in a moment it's it's gonna be useful so we'll continue modifying our code and we know that we want a just a list of names so we'll do you know names create a list there we'll do name equals nothing email cuz nothing and you know we're gonna try to extract the name of the email and the intent to that's funny yeah so all these contacts are just from some site I think it's called ma Carew where you could just specify you know I want a thousand fake contacts so none of these are real I that be amusing if it was from that come on we need more lol's we got like 10 everybody lol in the chat so all we're looking to do now is just put the right name in the variable right email in the variable and then just place it into the names list so to do so we'll do it for contact and contacts and all we're looking for is you know we know that yeah there we go make it rain with those lols so we're looking for FN and we're looking for email and we already know the format of vCard keep in mind if there is a Python vCard library where it's not going to use it because the short way is more or less just is short so you know we'll do email will do if email in contact if it is then we'll set the email to be the contact dot split on what semicolon no : call ya : and that will take the last one so that should give us the email if FN in contact they will do name equals contact up split and then for the cut for the FN it's going to be everything after the : again it'll take the last element now we just have to check that if we're at the end of the V card so each one is like begin v card version FN and then NV card so this is one this is one v card you know and then second v card third v card and so on so we're just looking for end v card as the boundary so we'll do if you know contact equals and V card then we gotta do two things one is append the poppy and and this is where we're gonna append whatever the format is so maybe we want it in comma separated so we'll do Bryce comma brace format name email so let's check our code so we're good here it's it's everything we need and then now it's just iterating over that so for name and names print name and tada we have all our names and we have all our emails in a big long list and technically this is comma separated if we wanted to write this into a comma separated you know file we could simply do Python 3 context top I use the redirection operator and then specify context and dot CSV that will write all that content to context out CSV and then here we are all we'd have to do now is just come up at the top put name comma email and then magically that will import into whatever system and this is a really quick way of taking those v cards and getting them into a better format so this is one this is kind of kind of one example of just a really simple thing so let's let's review what we did here we started by reading the raw contacts into a variable and then we looped over every Lion of the contact file and start looking for emails first names and then when we got to the end of the vCard we just appended the name and email into that list and then we printed out that name and this could be in whatever format if it needs to be tab separated yeah you could put a backslash key there if it needed to be some proprietary format like it needs to be you know email then name with a colon you know three colons and then the email has it be first name had to be second then you could you could simply do it that way so there's tons of ways you can mutate this data to work with the target system that that you're looking to import the stuff into so that was the first example very simple very simple example and this wouldn't take a person that long to learn they'd have to learn how to open files they'd have to learn what split does they'd have to learn how to iterate over a list and then they'd have to learn a simple if statement I mean you could probably teach somebody that in under a day I would say why negative one and not one so it probably would have worked one but negative one just says take the last element and and that's why I was interested I I don't I don't personally know the exact format of v-cards so but it very well could have been one that that would have been that would have been perfectly fine in this case it would have worked negative one should work you know all all the you know all the time okay so the second thing we're doing and I'm gonna post all this code on github so I don't worry you can go and you can run it yourself later that'll that'll be perfectly fine the second thing we're doing is we're looking at spreadsheet data so I have a spreadsheet here and people I'm sure have worked with spreadsheets you know all the time it's one of the most popular things ever so I have this really long spreadsheet you know maybe your boss at work said oh speaking of that if you could if you're in a non-technical job and there's no tech people around you and you can find a way to interact with your non-technical job using things like Python you will blow people's minds you will become ten thousand times as as as that useful out that job as you previously were I've also held jobs that were not tech related but I used tech to help that job and it made me quite valuable so I mean certainly try that out you know if there's lots of spreadsheets out there and there's not as many Python programmers so we have a we have a spreadsheet and you know don't get me wrong spreadsheets are super powerful Google sheets is powerful Excel is powerful they're all powerful you can do a ton of stuff and probably what I'm about to do you can also do through a spreadsheet but you know at some point you're gonna need to do something that you can't do directly through the spreadsheet so if somebody hand to a spreadsheet start by exporting it however you need to into CSV you know in my case I go to file download as CSV and then it downloads so after that you can get rid your spreadsheet and you're done there go to my folder here and this is what it extracted for me extracted me all these names I don't know exactly this data is it's all just fake stuff it looks like order dates you know units unit caught let's get again so imagine you wanted to say how many units were sold in the east region and I'm sure as a way to do it through the spreadsheet but what if you need to interact with another program like maybe your company uses some internal system some database and you need to insert it into that database automatically that's probably not something a spreadsheet can do so for this example we're just going to look at or we're gonna sum up all the units that have a region of East except 20 with your Python not through Google sheets so we have our data here and we need to get this into a format that works well so Python Ralph the bat Python has a CSV module so you don't have to reinvent the wheel on that you simply do import CSV and you're good to go now you can use the facilities that are made available by the csv module to kind of make that work so it's very simple so you can you can pull things into a Python in one of two ways you can pull it in either as a as a list or as a ordered ordered dictionary and of course ordered dictionaries easier because it lets you reference things like order date you can subscript your own dictionary with order date region rep item and that yeah automate your co-workers out of a job don't do that that's gonna piss people off or maybe you want to I don't know that's up to you I guess the so we'll start by well we could do both examples so we'll do with open data dot CSV as F and then we'll do rows equals CSV so CSV dot there's two things here there's a reader and co-worker dot pi yeah that's fantastic won't come back to that that's amazing so there's two things here there's CSV dot reader and there's CSV dot dict reader so you know one is reader F and then the other one is dictator and each of these one reads the you know one reads it as a list one reads it as a dictionary and then you can use whichever you want today it will do the dictionary version and then Randi rose grow for Rowan Rose just to get it into a normal list that we wouldn't close the file so right now our rows should be a list of dictionaries a list of ordered dictionaries I should say so Python 3 what's this called Dada Dada up hi-yah so here it is so you can see that there's one there's one ordered dictionary here and it has the information that you need so but this is all in the right format this this is what we need so now you know we said we want to sum up how many units are you know for the region East and very simple to do you know you can do it probably with one line we're going to not do it with one line just so you can you know watch it so we'll do like will set the sum to zero for row and rows so this will loop for every single row in there and then we're gonna do if row region equals East they were going to insert the integer of row and I think it's was e units units so put units in here so this this should be what we need I think this is the whole code so this will give us just comment that out yeah so you could see ten thousand three hundred and sixty-five so that's gonna be how many units are in the region east so you could also do you know region change the central seventeen thousand nine eighty five and you know this was a very quick way to yeah row row row your for hands buddy this is a quick way to kind of kind of mutate this data in into whatever you need and this was not a lot of code you know once once you read the data into a list of dictionaries or a list of lists then what an additional five lines of code to get us um you know that's pretty cool because you could also do grouping you know you could also write it so you know it adds units to a dictionary based on the region you know I suppose we could we could do that you know if we wanted to modify this you know rather than once um you know week instead do sums then do things like east what was Central West and then oh I guess that's a central use in the West so rather than doing you know just adding it to the sum we can do sums row region plus equals int row units and then this should give us a kind of a grouping of you know what units are are in which well that worked that's cool so East you know is 10 665 now what's cool about this is imagine if somebody had asked you hey we need you to write a program to take this data and then insert it into our other system so on you know at the bottom of this code now you would simply write whatever you need to write to push this into another system and I'm gonna put this back to so that stays and now you can do whatever you want with it or you can set it up to run on a job to run once you know once a day or once an hour or there's just unlimited things you can do to work with this data you know you could even have a system save the file on top of the current one overwrite it and then run this on top of the new file so yeah pretty cool right seriously try it you know find something find something in your daily life that's you just do that's just really manual that you just do over and over it's mundane boring and then just write a program for and you don't have to do it it's especially great if you can do it your job there's also a website that I'm going to let you guys know about that and this is not a paid promotion it's it's just something I came across while I was you know prepping for the stream and it's called automate the boring stuff with Python you don't actually buy the book you can there's all the stuff at the bottom it's automate the boring stuff calm and you know there's a table of contents with all the additional content you can of course buy the book if you want but it's you know this is like the exact stuff I'm talking about when when I'm shown some examples you know it's spreadsheets twang it's PDFs and Word documents working with them you know scheduling tasks launching programs sending email and texts nibbling images and then CSV files in JSON data you know like that's when I think of boring stuff and I think of easy things to automate you know potentially mundane tasks like that's the stuff that I'm referring to and so you should check that out there's some interesting examples there you know if you need some like if you need some food for you know some thought generation on you know what what ideas you know you like to work on yeah that's what I was looking for you know if you're looking for some good ideas like that some that's some interesting stuff there okay let's take a couple more questions or we're running way ahead we've got about 25 minutes left I'm gonna go back to questions water paddle are you interested in machine learning and teaching it so I am very interested in however I'm not currently teaching it because one thing it's important on my channel to me is that I anybody that spent any time in discord that's that's talked to me about different things knows that I don't I don't try to know it all I don't try to project you know to you guys and gals that I know it all I I want to bring you high quality content and the best way I can do that is to take on topics that I know very well and machine learning is just not one of those things so if if I got to a point where like a new machine learning really well and I thought that I had a good enough grasp on it to where I can make a video and and teach all of you I I promise you that I'll do that and potentially that's that will happen in the future until then you should go and check out scent decks who has fantastic machine learning him and I are friends so all good you know you can you can check him out he has great machine learning stuff he's he's the machine learning guy but I think in the future you can expect to see some machine learning stuff come out of my channel it's just I I first need to fully fully grasp it and I don't currently so let's see we're gonna all right did that one what's uh what's unique Raspberry Pi project that's not commonly done the thing about Raspberry Pi is that they've sold so many units and they've sold so much stuff that I'm not entirely sure that there there is a such thing I perhaps a screener for your car you get a check a five-inch screen to it yeah maybe that'd be something firewall a VPN those are probably common though I don't know Raspberry Pi that's a super popper plot you know super popular project and there's just so much done with it that I don't I don't know that there's anything that's not and did you have a hack the box account I I don't but that sounds really cool you should tell me on discord what that is so I can check it out how does one begin to understand where to begin learning to code so if I understand that correctly that's like a like a meta question on what so it all starts on first understanding what a programming language can accomplish for you and I kind of you know there were a couple people in the chat that said I'm not having a Python programmer what am I doing here and you actually show up to a good stream because maybe you're not a Python programmer but are you a guy with contacts are you a guy with spreadsheets so Bill Ralston thank you very much for the seven that's very nice of you please do a Python GUI tutorial of either tkinter or similar I I think I should I think I need to do a GUI tutorial I've only done one it was G TK 3 with uh with C and I think it might be time to do a Python one people been asking for it as well so thanks to that suggestion and thank you for the 7 I appreciate that let Y the staff know if you're on discord let one of the staff know who you are just DM them and you get a special role on discord for donating so thank you yeah so learning how to code you got to first identify it you got to say to yourself you know what I want to accomplish and know what a programming language can do for you and the good thing is it could pretty much do anything really literally you know technology is so advanced today there's so many tools there's so much pre-built code that not only can it do everything but the barrier to entry is so low that there's a lot of stuff that's already kind of out there that just makes it easier for you to get moving do you do any front-end stuff yes all the time I do tons of friends stuff like I'm a big react guy these days never use vous I also have done angular one I've done some angular five I know there's kind of a big jump there I don't care for angular I really like react I like material design I like bootstrap and I like jQuery I think of others of course there's a litany of other you know modules that I like as well where is the first Python stream I I don't know what that means there's I think my first or second stream August's I I do streams every two weeks and I started doing this in August so I think there is August number two I believe it's Python CRM McCall yeah I also want to learn everything about programming but I find it overwhelming how do you narrow your focus that you actually learn something I think the best answer to that is going to be try to stick to one language stick to one language to start you know don't get carried away though what makes things really overwhelming is people say all right well start with Python and then they're like wow I'm interested in web so now they're on HTML and then they're like oh I want it to look nice now they're on CSS and that's like well how do I store data oh well now they're doing databases and then now they're doing jQuery and then react and then Django and then frameworks and then it's just it gets out of control starts spiraling out of control and the next thing you know you got this big bag of of 20 pieces of technology that you know about 0.5% of and and that's how you get overwhelmed so I recommend just stick to one thing stick to one thing and pick something that is relevant to what interests you and then just learn that really well first because once you learn the one programming language and you learn the fundamentals very very well yeah Oh shiny it's exactly it I mean programmers love shiny stuff including myself I see something shiny I'm like a like a squirrel just run after it and the that's just what it is so learn the fundamentals people seriously you got to learn the fundamentals first and foremost and then after that it's not that hard to learn other things you know once you on your first language language two through ten are a lot easier because they all have several commonalities across all of them Python Internet boy okay when I learn Python the internet blogs sometimes it's in 2.0 and sometimes it's in 3.0 where could I get to learn Python where can you learn Python so code Academy is one option you can of course learn Python from my channel and then you can learn PI I recommend you watch a lot of videos like don't just watch mine you know don't just watch syntaxes don't just watch whoever you know watch everybody's because everybody's going to teach it differently and you need to hear it from several people because we're all like I'm not going to be the best to explain something and you know other youtubers may not be good either so you have to get take it all in you got to take a bunch of different content authors all their videos take it all in and just take the parts that make sense to you from each I'm a web programmer PHP and JavaScript who's also becoming gradually more comfortable and Bosch I'd like to get more into scripting and automation work so if you just want if you want to get into just general programming like system type programming then Python is a fantastic option if you're gonna be working primarily on the Linux systems then it's going to be important that you know bash which is a born again shell and it's also a full-fledged programming language or has well I want to make sure I'm clear here so it's it has constructs that are similar to other programming languages but you can do most things or you can leverage tools that are common to Linux to accomplish most things so in short TLDR I would say Python and bash I would like to learn about virtual environments in Python can you cover that in the videos if I if I find a way to sneak that in I will I'll definitely do that I don't think I've ever covered virtual end but I probably should will you do a tkinter tart yes hey man oh that's a good question about a vat of auto sorry if I pronounced it wrong heyy man I'm doing more and more Jas recently I want to get deeper understanding of JavaScript I was thinking of reading mdn Web Docs try to check out v8 what would you recommend so I don't think it's necessary to read the v8 code because that's C++ and that's the JavaScript interpreter that's probably not necessary reading the v8 code and understanding how that works is probably not going to make you a better JavaScript programmer so however the mdn is fantastic you know that's the that's the single source documentation for JavaScript I've personally read that entire site the entire thing everything on it that relates to JavaScript so I would certainly read that it's it's not that hard to read you know built-in objects for JavaScript you're gonna want to know each of those very carefully I'm very closely and then you don't understand all the syntax so yeah if you want a full comprehensive deep understanding of JavaScript you'll want to read the MDN from front to back everything that relates to ECMO script six and beyond I'll go on Tristan says what does it mean when something like a framework is a lightweight or heavyweight so it's all about abstraction it's all like I can provide you a framework for JavaScript that we'll just do a couple things and then it relies on you to pick up the pieces for the other things so like maybe I write a JavaScript framework that just parses incoming data but you're responsible to do everything else you know that would be considered a lightweight framework and it would be very low overhead you wouldn't take a huge performance hit to use it but it's also not that useful so on the opposite end of the spectrum you can find really heavyweight frameworks that that define everything that are hundreds of thousands if not you know a million lines of code but they are extremely comprehensive they do everything they offer you the most feature sets however you are gonna get some inefficiencies with that heavyweight software does come at a cost that that's just what it is you know if there was there's there's just no such silver bullet as SuperDuper fast and efficient and comprehensive it just doesn't work that way what are your thoughts on docker and I don't know if it's kubernetes or kubernetes but whichever it is kubernetes the i I love docker so my thought on docker is it's an amazing piece of technology and everybody who is a modern developer you know in 2019 needs to at least take a peek at it because you're you're and variably gonna come across in some organization where people are are deploying their entire software stack in a containerized kind of architecture and if you're not prepared for that then you're gonna be behind the curve so certainly you need to be looking at docker it's terrific III containerize everything these days primarily because I'm just sick of dealing with I'm sick of dealing with upkeep on applications I'm sick of dealing with different versioning it's just it's just a pain so definitely definitely check that out should I learn okay alpha pictures said should I learn Python or Java as a beginner so back in nineteen 1990 hey thanks a lot thanks a lot for the for the five love from Wales America nice cool thanks a lot appreciate that thanks for the support if you're not on I know you have that K that looks like Kieran's K but if you're not if you're on discordant and you don't have the if you don't have the supporter role please let one of my staff know on discord and they'll get you hooked up should you learn Python or Java is beginners so when I started out I learned I know it was gonna laugh at me laugh at me in the chat it's okay I learned PHP it was kind of my first major language but keep in mind this was back in 1997 sort of Ben PHP three maybe four can't remember exactly and I I felt like that harmed me in the long run because my fret that's right get the walls going get a get a lolz train going the I think it probably harmed me because it's a dynamic language that had no type system and it was kind of my first it was my it was my first thing that I learned seriously so when I got to learn things like C and Java oh my god it was it was a disaster because you know those those are all types I'm looking at this like what what is what you know what is bool this and int that and string this and I was like peach P don't have that I never learned this I wasn't I wasn't prepared for this so I yeah I felt kind of disadvantaged so I guess my answer is you should you should understand types check out Java for its types you know the fact you have to define types and understand how that works and then once you understand that go to Python where you don't have to use types and you can continue learning from there I still think you should learn Python but don't make the mistake I made and just ignore this entire this entire world that we call the typing system also I just noticed we're at 397 viewers right now three more we're gonna go above the 400 mark has never happened is the this the biggest stream of all time so far on this channel we recommend using libraries in Python yeah absolutely you should use core libraries and then you should also use libraries that are you know libraries in Python are the same as libraries like an NPM or other places they will rise up if they are good and then the bad ones will get pushed to the ground so the good thing about using libraries that are already pre-built is that they usually have a community around them and they're usually very stable people trust them and you can use the library with confidence that it's gonna help you more than you trying to roll your own we're a 400 there it is 400 viewers awesome people very cool very cool so absolutely use libraries I do all the time because number one I don't want to spend the time reinventing the wheel and number two is I guarantee that a project that's been worked on by like five or ten people over the course of months is going to be more stable than what I can produce at a at a given moment oh man 406 now Oh nuts why don't you use contact that starts with I guess I could have you know I guess I could have I don't know is all this code I'm you know I'm kind of coding all this live I'm just kind of doing what comes to me in the moment but yeah contact starts with what would have been perfectly fine I display data from a database to a web page one by one you so getting data from a database to a web page is really just making a query for that data and then once the data comes back into your application you can prep the data in the way you want and then you can pass it to some sort of template renderer and then in that template renderer you can usually do a for loop on your data which you can display a row by row and that's that's more or less what it would do what does for percentage one do so that's the that's the module oh and that basically says that it's basically division where it returns the remainder so it's a it's a way of figuring out if something's equally divisible by something else so you could do like pull it open here just do this real quick so like for mod one you could see 0 for mod 2 is also 0 but for mod 3 has a remainder of 1 because 3 goes into 4 once and there's one left over so that's that's kind of what that does I use the module operator a lot when I want to do pagination like if I want to say you know do something every 500 items you know I can do I can do data set size you know mod 500 and then if it's a 0 I know it's divisible equally actually I'm sorry I messed that up I think what I would actually do yeah well you can use that for pagination I can't think of an exact example in my head at the moment what is CSV CSV is comma separated values it's a format for data that's not dependent on any particular you know like language you know CSV is not specific to Python or JavaScript or Microsoft or whatever it's just a it's a format where you have all your headers separated by commas you have all your values separated by commas unless it contains a comma and then it's quoted with a quote unless it also has a quote that's escaped Louis any questions where can we get sample data you're using from okay I guess we're past that now can you explain row for row and rows so row for row and rows so I'll set up my like a ship in rows so my Rose is a list so for row in row we'll for row and rows well we'll loop over every row a one time per iteration so when you do row for row and rows it's you're saying take that value and return it in that iteration into like a list so we call that list comprehension so if I wanted to like just double everything I could I could put you could start a list I could do row times two for row and rows and then that would give me two four six so row for row probably seems weird but you got to remember that the first part is kind of the thing that will be returned so I could specify things like you know x 2 or x 3 or whatever lots of questions okay i'ma check it through these questions we've got about five minutes left now will you ever do any golang yes actually piston is in going and we have a we have a super high speed going expert on the discord server his name is professional pizza he's uh he's the best best go program I've ever met so if you guys have any go problems post in the well not not problems you know he's he's a smart guy so you got a you got to give him smart questions you gotta make the questions match the person so if you want to if you have any go theory you want to talk about you can you can definitely check it out there probably other languages best place for that we have more Python videos on your channel so I've been doing a lot of Linux lately probably when I'm done with Linux I'm gonna circle back to Python so that'll be good so if you're if you're missing a lot of the Python videos then know that there are they're coming back soon I've ever used to Django personally no I've not I I don't do a ton of like I don't do any any web-based Python programming all I only do we do systems stuff in Python so yeah I just don't do any web stuff that that's related to that how long it take you to fully learn Python I would argue that I still haven't fully you know learned it like I'm super efficient in I can do whatever but to fully learn something is a massive feat I would say that it took me a few years to get you know really really solid and stable with it so a couple years can you execute a Python file on a web server yes you can you can do so through CGI which essentially just you put out you put a hash bang at the top of your file and then use a CGI module with a web server and that web server simply execute the file that you request then the output goes into the page so you can it's not a common way of doing it you know these days that used to be the only way that's how pearl things like that was executed back in the day but these days mmm it's not allows CGI going on not not as far as I've seen I haven't seen it in years oh sorry I I totally missed the supporter question board my dad I'm assuming you can implement somehow actual files okay source sir I'm gonna get back to that that question offline I'm not sure how to answer that here on stream so I'll feed check that out yep let's see it I see it I think Python no Alexander Prusak do you think python is a noobs language no I think Python is is easier easier than other languages to to get ramped up on but I don't think I wouldn't called a noobs language because that has the connotations of this language is only for beginners and therefore it's not as good and that's simply not true like PHP is one of the most popular the most widely deployed and the most powerful languages on on planet Earth so but at the same time it happens to be extremely readable like almost human readable and you know that's of course very helpful see why I see yeah good morning sir C++ right now but kind of hard what do you think should keep with it or do PI or something that was by bad ash so you need to figure out what your end goal is are you you know do you want to make games are you gonna do C++ professionally if so you should definitely stick with it but if you want a more simpler you know language that where you don't have to worry about things like memory management then then certainly you know Python is a good you know good choice for that okay one more question and then we're gonna wrap it up okay I may answer this one sick boy said we doe have left Python do you think this language still has a future that's a good question that's a fantastic question actually so him believing he left you two health issues and I you know he trusts the people they're building it you know for better or worse they're gonna do what they're gonna do the reason I'm not super worried about the pythons future is because it's still open source software and therefore if you know you saw what happen with nodejs back when BEC when joint was the steward of it you know it forked to IO jeaious they did massive advancements in it they reemerged into nodejs and then the linux foundation took them over so you never have to worry about open source because if somebody is a bad actor or doing bad things for the Python community and the software well guess what somebody's gonna just take that torch they're gonna run with it and we're gonna Python it's gonna be fine so I think it's okay it's never good when I want to tighten like you know we don't arouse some leaves his own project but at the same time it's it's okay people people leave all the time keep in mind you know Lena's Torvalds that who runs Linux you know he's eventually gonna get too old do Linux and you know we're gonna have to trust whoever picks up the torch from there but in the end it's so open source software ok that's there for the stream I just want to say thanks to everybody we hit 413 viewers it's insane insanity his new video coming tomorrow I I don't know the exact topic yet but there'll be one tomorrow and then you should check out there's a link in the chat right now to check out discord there's a is a fantastic discord server operated by myself and my team and people are chatting with everybody every day there's tons of learning going on it's tightly integrated with e/m Casey and I think you'll find that out of all the servers you're going to be on it's the it's the best management one it's the best curated one it's the one with the least nonsense and there's a globally diverse audience of different countries different skills different time zones people that like different things so there's a wide variety there's like 4,000 people on there of which probably 10 to 15% are active so it's a good place to be if you're not there is a link right there discord GG / engineer man or you can go to engineer man org slash discord either one works fine that's it for the stream within the next half hour I will post all this code to github so you can check it out if you want to run it offline but other than that thank you so much for coming to the stream thank you so much to the supporters you know who flipped me a few bucks I really appreciate that it means a lot to me I don't I don't usually I don't ask for any donations ever so when people you know feel feel like they want to you know give that's that means a lot to me and then thanks to all the regulars I see a lot of the same names every two weeks show up to the streams that's that's fantastic so thank you to all those people that uh that continue to come and and support the channel you know with their with their presence you know it I'm sure it means a lot to other people as well and I think that's it I will I'm on discord all the time so if you need to get in contact with me just you know shoot me a message there or in that have a fantastic rest of your weekend check out the vo to morrow and I will see you on the stream two weeks from now nuna and we'll get back to it everybody take care have a good one
Info
Channel: Engineer Man
Views: 28,237
Rating: undefined out of 5
Keywords: python, python programming, engineer man live
Id: _CgYa0aLea8
Channel Id: undefined
Length: 69min 40sec (4180 seconds)
Published: Sat Jan 26 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.