Two Plus Two Poker Forums

Two Plus Two Poker Forums (https://forumserver.twoplustwo.com/)
-   Computer and Technical Help (https://forumserver.twoplustwo.com/48/computer-technical-help/)
-   -   ** Python Support Thread ** (https://forumserver.twoplustwo.com/48/computer-technical-help/python-support-thread-1007515/)

NLSoldier 03-09-2013 06:43 PM

Re: ** Python Support Thread **
 
Quote:

Originally Posted by Alex Wice (Post 37532843)
Btw, you can stick with notepad++ for now / for that course, but later on, Sublime 2 is imo the sickest text editor ever.

cool ill keep this in mind thx.

tyler_cracker 03-14-2013 10:33 PM

Re: ** Python Support Thread **
 
Quote:

Originally Posted by drinkingcoffee (Post 37611685)
how do i know when i have crossed the line from n00b to intermeddiate?

why does this matter?

kerowo 03-15-2013 06:17 PM

Re: ** Python Support Thread **
 
Quote:

Originally Posted by drinkingcoffee (Post 37611685)
i have programmed with python for over a year now part time. have no significant programming experience in other language. how do i know when i have crossed the line from n00b to intermeddiate?

When you stop worrying about being a noob

Alex Wice 03-15-2013 07:01 PM

Re: ** Python Support Thread **
 
Quote:

Originally Posted by drinkingcoffee (Post 37611685)
how do i know when i have crossed the line from n00b to intermeddiate?

obviously this isn't one size fits all, but if i had to guess some strong correlation factors, it would be like:

strong intermediate
you use keywords like yield and filter
you use correct datastructures, especially BSTs
you know and can use bitwise operations effectively
you have a sense of the runtime speed of your code in extreme cases

expert
you know about decorators and monads and can use them to greatly simplify code
you leverage dynamic typing correctly (dont need to check if something is an int or a string etc.) and can override methods appropriately
you understand MVC model and how it relates to your programming; you understand threading.* and how multithreading should work
other experts can understand your code quickly and you would be able to code well with others

ballin4life 03-16-2013 12:34 AM

Re: ** Python Support Thread **
 
Quote:

Originally Posted by Alex Wice (Post 37625844)
obviously this isn't one size fits all, but if i had to guess some strong correlation factors, it would be like:

strong intermediate
you use keywords like yield and filter
you use correct datastructures, especially BSTs
you know and can use bitwise operations effectively
you have a sense of the runtime speed of your code in extreme cases

Binary search trees and bitwise operations? Really?

daveT 03-16-2013 12:53 AM

Re: ** Python Support Thread **
 
Intermediate Python is filtering map-reduced bitwise XORs out of a stacked queue of binary tree generators.

Yield def. beginning Python stuff.

clowntable 03-16-2013 06:35 AM

Re: ** Python Support Thread **
 
Meh depends on your definitions of beginner, intermediate and advanced.
I think beginner could also defined as doing basic stuff and understanding the OO concepts and you could start intermediate with the functional stuff. Adding yield to the intermediate category is defendable imo. Maybe using yield is beginner and really understanding it is intermediate.

My very useless definition of intermediate would probably be that your code is pythonic by default :P

Quote:

you know about decorators and monads and can use them to greatly simplify code
Maybe there are no experts after all ;P

I'd def be interested in creating a 2p2-approved (lol) list going though. would be pretty useful for the "where should I start, what should I learn" questions. If anyone here is working at a python shop maybe just post what you'd roughly expect and intern or junior dev to know (just language wise not development practices etc)?

Alex Wice 03-16-2013 03:44 PM

Re: ** Python Support Thread **
 
When I said strong intermediate, I was sort of thinking the minimum level required to have significant involvement in a project (involving python code)

Also these were correlation factors, not every person has every factor, but its something where, if I saw it, I would feel it is very likely they were an expert for example.

ballin4life 03-16-2013 07:15 PM

Re: ** Python Support Thread **
 
What are you doing where you need bitwise operations? Why do you need binary search trees as opposed to the built in set/dict structures?

And are these use cases so common that most intermediates would run into them?

Alex Wice 03-16-2013 08:08 PM

Re: ** Python Support Thread **
 
Looks like I took a lot of heat for what I said,.. again its not a one size fits all.

I said these were the factors for me that would correlate most strongly with that level of ability. Also no one else put out a definition, donno why I am basically getting blamed here.

ballin4life 03-17-2013 01:43 AM

Re: ** Python Support Thread **
 
I'm actually sincerely curious ... not just disagreeing.

daveT 03-17-2013 01:59 AM

Re: ** Python Support Thread **
 
Wasn't disagreeing either. I would definitely like to know the answer to the bitwise and BST question as well. I'm kind of surprised people are pushing around bits with Python.

And also the monad thing... You can do functional programming in Python, but it's fundamentally NOT an FP language, and going so far as to use monads in Python seems a little overkill.

RogerKwok 03-17-2013 05:52 PM

Re: ** Python Support Thread **
 
Hi guys, I'm missing something silly in recursion, can you tell me what I'm doing wrong?

Code:

def func(word):
    if len(word) <= 2:
        return True
    else:
        func(word[1:])

So if I run func("test"), it doesn't return "True" only "None", but why?

tyler_cracker 03-17-2013 05:56 PM

Re: ** Python Support Thread **
 
what happens to the result of `func(word[1:])`?

also, learn how to use print statements (or a debugger!) to figure out what your program is doing.

RogerKwok 03-17-2013 06:07 PM

Re: ** Python Support Thread **
 
Quote:

Originally Posted by tyler_cracker (Post 37651325)
what happens to the result of `func(word[1:])`?

also, learn how to use print statements (or a debugger!) to figure out what your program is doing.

Hey thanks for response,

I did put in print, so this
Code:

def func(word):
    print word, len(word)
    if len(word) <= 2:
        return True
    else:
        func(word[1:])
       
print func("test")

Outputs "test 4 ", "est 3", "st 2", "None", but I expect the "None" to be True

Alex Wice 03-17-2013 06:14 PM

Re: ** Python Support Thread **
 
Hint: Your function rarely actually returns anything.
Spoiler:
return func(word[1:])

RogerKwok 03-17-2013 06:16 PM

Re: ** Python Support Thread **
 
I know it doesn't return anything, but why doesn't the "if len(word) <= 2:" trigger the return when len(word) evaluates to 2?

RogerKwok 03-17-2013 06:51 PM

Re: ** Python Support Thread **
 
^ Oops I figured it out, thanks for the tip, forgot the "return" to call the recursive lol

coon74 04-11-2016 12:56 PM

Re: ** Python Support Thread **
 
Wow, this thread is so legendary at least due to Alex Wice's immense participation, I need to bump it at least to see quicker which exactly familiar 2+2'ers have posted here :) (It's been a surprise to me that Alex and the chess forum mod RoundTower have been Python programmers at least at some point :))

I think the tradition of official language-specific threads was great, wonder why it died in 2013... (Well, there's a much newer 'learning Python' thread but I'm not sure if it has been regarded as official.)

RustyBrooks 04-11-2016 02:32 PM

Re: ** Python Support Thread **
 
I didn't ever read this forum until fairly recently. I only had a small idea it even existed. I was surprised to find out that so many 2+2ers I know are secret computer nerds.

Well. Not *that* surprised, but a little.

kerowo 04-11-2016 02:47 PM

Re: ** Python Support Thread **
 
Holy crap. I don't even remember what I started this thread about, in the last 5 years only 2 of the schlubs I worked with are still at the company. The support department doesn't exist as the devs who built the product now support the product. We've switched architectures once and products multiple times and now I'm a Product Owner. I am probably going to have to write some Python soon though to work with Alooma for getting some of our ingest data into a Redshift table...

coon74 04-11-2016 03:04 PM

Re: ** Python Support Thread **
 
Quote:

Originally Posted by kerowo (Post 49770204)
now I'm a Product Owner.

Wow, congrats! :cake: (even though the title 'product owner' is a bit misleading as you're apparently still subordinate to someone, I guess you're still making big money in this role, though your responsibility is also huge).

I'm surprised by the big %-age of posts by 'members of colour' (green, yellow etc.) in this forum, I guess that's because it's discussed more often on the mod forum than on other non-mod ones, and also because devs seem less meticulous about the way they spend time than 'greedy' poker players, so a dev is more likely to agree to become a mod than an average 2+2'er.
______________

As for Python, there are a couple of reasons why I'm still wary of it: firstly, it seems to allow a bit too much freedom (e.g. too many typecasts) and I'm afraid of messing things up and not being able to debug fast (I've been told that, in C#, half of stupid mistakes are revealed during compilation already); secondly, my go-to example of how a Python GUI might look like is FPDB, and though I last used it as many as 2 or 3 years ago and it might look more modern now, the way it looked and operated then was too reminiscent of the 90s :D though I can't blame it - it was doing the job it was expected to do for its zero price :)

kerowo 04-11-2016 03:13 PM

Re: ** Python Support Thread **
 
Yea, there is a lot of hand-waving and dotted lines in that title that hopefully will settle down to just product owner. I'm making decisions on the product and leading the dev team that's implementing it, that's close enough to PO for me.

I think there were just a lot of mods that were technical and pushed for the forum to get started way back when and that's why we're a little overrepresented in the earlier threads.

coon74 04-11-2016 03:31 PM

Re: ** Python Support Thread **
 
Quote:

Originally Posted by kerowo (Post 49770444)
Yea, there is a lot of hand-waving and dotted lines in that title that hopefully will settle down to just product owner. I'm making decisions on the product and leading the dev team that's implementing it, that's close enough to PO for me.

I'm surprised in general that 'product owner' is a legit name for a position; I'm under the impression that any freelancer is more of an owner of his products (i.e. has more control over them but also faces more risk) than a corporate so-called 'product owner'.

RustyBrooks 04-11-2016 03:41 PM

Re: ** Python Support Thread **
 
If you're worried about dumb mistakes, I guess I propose you use an IDE like Pycharms. I was never a proponent of IDEs, but I like Pycharms quite a bit. It will show you syntax errors, and it will help you with some more subtle mistakes also. It also helps by auto-filling function parameters and stuff like that. It's sped me up a lot - I basically never run a piece of python with syntax errors any more, because I've caught them before I even save the file.


All times are GMT -4. The time now is 04:27 PM.

Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.

Copyright © 2008-2020, Two Plus Two Interactive