Setting out to learn Python. Anyone wanna join?

Pages

That is exactly right Malor. Functions are first class objects that can be passed around like anything else.

Sometimes you do actually want to return a function that can be called from something else, but when you do that accidentally and wanted to actually return the value from calling the function it can be a hard one to notice the problem at first.

Well, maybe I should clarify that is used to be a hard one to spot when just working with Emacs and a console. You kids with your fancy eclipse IDE's and step debuggers have it a lot easier tracking down the issue. Now get off my lawn!

Hmmm, I think I have a bit more of an understanding, I think it's just the terms of things are throwing me off. I did manage to complete Automate the boring stuff final task chapter 6 largely on my own today, which I'm very proud of I'm quite lucky to work with some friendly coders who will help me along the way, I even managed to improve on what the task told me!

One thing with this though, and it might be stupid, but why would you assign a variable name to a function? Some stuff I've been doing recently, which involves VBA (don't judge me ) uses things like:

Call Report_change

So, it's almost a year since my last post in here and I'm actually giving a talk to my local Python group next week on interactive data visualisation in Python, using Plotly and Bokeh libraries!

My job involves using Python a lot, and although it was at first for a lot of visualisation stuff, it's now moved on to involve more machine learning and natural language processing. I'm a lot more confident with my programming now, it's hard to think a year ago when I would get so frustrated at how I didn't understand anything.

So for the help of everyone that gave me some good tips to start, and answered a lot of my stupid newbie questions, thanks!

Senkrad wrote:

Now get off my lawn!

lol, you use PyCharm now Senkrad. Totally not my fault....

Clusks wrote:

So, it's almost a year since my last post in here and I'm actually giving a talk to my local Python group next week on interactive data visualisation in Python, using Plotly and Bokeh libraries!

My job involves using Python a lot, and although it was at first for a lot of visualisation stuff, it's now moved on to involve more machine learning and natural language processing. I'm a lot more confident with my programming now, it's hard to think a year ago when I would get so frustrated at how I didn't understand anything.

So for the help of everyone that gave me some good tips to start, and answered a lot of my stupid newbie questions, thanks! :)

This is badass. Thank you for sharing.

I've also had some great success from having learned Python. I started with an online course from Coursera (This one) about 3.5 years ago. Now I'm writing automation to facilitate game testing. Moving from Python to C# is actually pretty easy, I was able to start coding for Unity in my spare time and am now leading an indie game project (though with the primary coding being someone else's responsibility).

I just started a bootcamp for graphic and web design to learn to create my web portfolio for UX.
My first class was Illustrator which I had some experience with but was self taught so this class really filled in the gaps and got me up to speed with a lot of the new features in the latest version. (damn you Adobe and your subscriptions!)
The second class was HTML/CSS and it made me feel really dumb for not trying it sooner. obviously I'm not an expert but I can certainly parse web pages now and understand what is going on
I really can't wait to start on my custom portfolio from scratch!

Something Python related that I've been using that a lot of people don't know about:

http://sikulix.com/ (It's Free)

SikuliX (this is a fork of MIT's Sikuli, which they stopped updating) can look for images on your screen and do things like click on them, click and drag, right click, hover, double click, type into fields.. on top of python (or sort of python, close enough)

You can literally automate anything on your PC with this simple toolset.
Some things I've used it for:
- I needed to enter 100 or so emails from a spreadsheet into a system that didn't support mass updates, so I wrote a script that selected the text entry field, copied the next row from the excel sheet, clicked the Enter button and then navigated back to the page where you can enter an email address to start the next iteration of the loop. Since Sikuli can wait until it sees something specific (like that submit button) your automation is robust enough to survive something like a long network wait
- I was testing a game that would fail to run randomly. To get some better stats on how often it failed I set up Sikuli to launch the game, wait 20 seconds and test whether it saw X or Y. X is pass, Y is fail. With that I could run it any number of times to get data about percentage failure.
- When I was first learning Python, I set up Sikuli to help me 'bot' in EVE, this was mainly to see if I could do it, not to actually cheat. I had 2 accounts and 2 clients. I set up one to visually watch a chat channel for a 'come get me' message. Since Eve has a nice visual GUI I trained it on the right sequence of button presses to launch a hauler, find me, warp to me, find my container, empty it, warp back, unload and wait for the next call. There are plenty of other ways to do this I'm sure but this was fun to build.

The toolset is really flexible. You can set up 'fuzzy' image searches to help match up with the image you tell it to watch for and you can capture stuff from your monitor right from the client. Its a really valuable tool.

polypusher wrote:

Something Python related that I've been using that a lot of people don't know about:

http://sikulix.com/ (It's Free)

SikuliX (this is a fork of MIT's Sikuli, which they stopped updating) can look for images on your screen and do things like click on them, click and drag, right click, hover, double click, type into fields.. on top of python (or sort of python, close enough)

You can literally automate anything on your PC with this simple toolset.
Some things I've used it for:
- I needed to enter 100 or so emails from a spreadsheet into a system that didn't support mass updates, so I wrote a script that selected the text entry field, copied the next row from the excel sheet, clicked the Enter button and then navigated back to the page where you can enter an email address to start the next iteration of the loop. Since Sikuli can wait until it sees something specific (like that submit button) your automation is robust enough to survive something like a long network wait
- I was testing a game that would fail to run randomly. To get some better stats on how often it failed I set up Sikuli to launch the game, wait 20 seconds and test whether it saw X or Y. X is pass, Y is fail. With that I could run it any number of times to get data about percentage failure.
- When I was first learning Python, I set up Sikuli to help me 'bot' in EVE, this was mainly to see if I could do it, not to actually cheat. I had 2 accounts and 2 clients. I set up one to visually watch a chat channel for a 'come get me' message. Since Eve has a nice visual GUI I trained it on the right sequence of button presses to launch a hauler, find me, warp to me, find my container, empty it, warp back, unload and wait for the next call. There are plenty of other ways to do this I'm sure but this was fun to build.

The toolset is really flexible. You can set up 'fuzzy' image searches to help match up with the image you tell it to watch for and you can capture stuff from your monitor right from the client. Its a really valuable tool.

Interesting, I may give this a go this weekend, although does it work with Python 3.x? I can only see them mention 2.6.

I've only used it with 2.7.
For most purposes, if you know how to write code in 3 you know how to write code in 2.7

This may or may not be the right thread but anyone going to PyCon 2018? It's in Ohio! I plan on going and am hoping I have something to contribute or discuss by then.

I discovered Codewars last night, it provides a ton of user generated coding puzzles, rated for difficulty, types of coding involved and overall quality. It's not a teaching tool but it's great for polishing off rust, practice, and exploring topics you're not otherwise comfortable with.

polypusher wrote:

I discovered Codewars last night, it provides a ton of user generated coding puzzles, rated for difficulty, types of coding involved and overall quality. It's not a teaching tool but it's great for polishing off rust, practice, and exploring topics you're not otherwise comfortable with.

That looks cool. I'ma give it a whirl.

ARISE THREAD!

So, I've decided I want to learn Python. CodeAcademy has a great course that I see a lot of you have taken, but you need the Pro version it seems to get the most out of it. Is there any other good resource to learn?

EDIT: Well jeez, one page back shows the MIT course. That may be worth looking into.

EDIT2: For those of you who have finished Python courses, did you find it useful? Or was it something like an "oh cool!" moment in time and now you've forgotten everything?

I enjoyed the coursera one a couple years ago. Making some simple games like pong and asteroids was fun.

DeThroned wrote:

ARISE THREAD!

So, I've decided I want to learn Python. CodeAcademy has a great course that I see a lot of you have taken, but you need the Pro version it seems to get the most out of it. Is there any other good resource to learn?

EDIT: Well jeez, one page back shows the MIT course. That may be worth looking into.

EDIT2: For those of you who have finished Python courses, did you find it useful? Or was it something like an "oh cool!" moment in time and now you've forgotten everything?

Can you code in any other languages? I couldn't really before I learned it, so the hardest part was understanding terminology and logic behind programming itself. I use it in my job every day now, but if I didn't, I'm not sure it'd stick. It depends what you want out of it, but I'd try think of a project or something you really want to do, that way you can learn about something you can at least be passionate about. I like AutomateTheBoringStuff, I found code academy to be a little bit boring and not really that practical.

There is also Code Wars, which I found later on, but seems quite cool for giving you practical examples that make you problem solve.

I found the edx.org course "Introduction to Computing using Python" by Georgia Tech University to be absolutely fantastic. It's free. I highly recommend it.

Stele wrote:

I enjoyed the coursera one a couple years ago. Making some simple games like pong and asteroids was fun.

Yeah, this one taught by a couple folks from Rice University, is still the only Coursera course I've ever completed. Teaches you the basics and gets your feet wet in object-oriented programming while having a sense of humor about it all. I took it when it was free, but it looks like it costs money now. Hmm. Not sure how much value I'd associate with it but I don't think $49/month sounds right. But what do I know.

I was also going to mention in here actually, that I recently played Doki Doki Literature Club. It looks like a throwaway title that's fairly generic, but was recommended to me and appears to be gaining some traction as a cult hit. I'm not manga, visual novel or dating sim fan, and it didn't really do it for me, but the game does do a lot of interesting things. I can't really explain without spoilers, but the game is free.

Anyway, the game is built on Python, in particular a package called renpy that I didn't know existed! It's actually a package solely for visual novels, confirming that there really is a Python package for everything.

Regarding the question of "was it useful or just entertaining" I directly attribute my transition from basic QA dude to game developer to the Rice python course (and continuing through a more advanced python course from MIT as mentioned and then transitioning to C#)

Python taught me the basics of programming. That led to more useful languages. While you can start with something like C# which engines like Unity use, or C++, python is a better starting point in my opinion. Python can itself be useful for making plenty of things but I think it's better as a launching point.

Clusks wrote:

Anyway, the game is built on Python, in particular a package called renpy that I didn't know existed! It's actually a package solely for visual novels, confirming that there really is a Python package for everything.

A lot of stuff has been built with RenPy, more than most people realize, I think. And, of course, you can also tie it in with arbitrary Python code...

polypusher wrote:

Python taught me the basics of programming. That led to more useful languages. While you can start with something like C# which engines like Unity use, or C++, python is a better starting point in my opinion. Python can itself be useful for making plenty of things but I think it's better as a launching point.

Caveat: I think it's the best way to do a few specific things (such as machine learning right now). I don't use it for everything, or even most things, but there's some scientific stuff where Python has great tooling.

Though I spent the last few months switching back and forth between JavaScript and Python, which I don't really recommend. When I spent twenty minutes trying to look up Javascript's parseInt() in the Python docs, it was a sign that it was time to go for a walk.

Python is a powerful general purpose language. It can be great for learning to program and can continue to be very useful after that depending on what type of things you build.

The software I work on (written mostly in Python) handles hundreds of millions of end users and billions of transactions per day.

We’ve replaced a few parts with C and Go as needed but for the most part Python is still working great for us and I’m in no rush to move to anything else for primary development.

I’ve worked on bigger systems written primarily in C++ and I have to say I don’t miss that at all. My recent work in Go was fun and productive but by the end I was very happy to go back to Python.

Pages