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.

Pages