[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Is Python3 still relevant/am I on the right track?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 88
Thread images: 5

File: pdw_logo[1].png (132KB, 759x816px) Image search: [Google]
pdw_logo[1].png
132KB, 759x816px
Is it worth learning Python3 if I want to get a job as a programmer?

I've been self-teaching myself Python3 and honestly I've been having a lot of fun. Programming is something I've only done a few times. I took an introduction to programming course in college, then after a year I got back into it for a few weeks but abandoned it. Now (again) I started it up again and I feel very dedicated and motivated to spend a lot of my free time on it and keep going. I noticed it improved my mood because I don't feel like I'm wasting time anymore.

What I'm asking is if I should be focusing on Java or some other more popular language? I've been going through tutorials and I do feel I'm learning a lot with Python. I'm really trying to nail down and understand each concept and how things work so I'd have an easier time logically understanding the syntax, if possible. I have a list of tutorials already organized that'll get me to the skill level where I can make a pay-roll calculator that my boss would have a great use for.

I keep hearing that Java and C++ proficiency is more desirable in a potential employee. While I'm ignorant of how Java and C++ work, I really do like Python. I also plan on learning how to use django or Flask to create a website, and learning SQL (which I heard isn't difficult), because I've noticed SQL experience is often something that employers like to put as a skill requirement for a job.

Anyways, I guess my question is am I on the right track? Maybe this isn't the board to post this in, but I was curious what you guys think.
>>
>>60115417

I write python/C professionally and have for the last 3 years. I have never once seen anyone actually use Python 3. None of the applications I have worked on use Python 3. It's all been 2.7.

Python is a great first language to learn with. Stay focused with Python. Java and C have different use cases. People who say that Java and C are better than Python have no idea what they are talking about. They are different use cases.

For example, lets say I want to quickly hack up something that will do backups on my computer to a USB stick. I would write the script in python, and it would make calls to shell commands like rysnc, tar, gpg etc. The logic and script is in Python, but Python is still calling those commands which are basically C programs. Writing the whole thing in C is fucking stupid.

People who speak like this are basically handicapped to 1 language, and all they do is listen to what other people have said in casual conversation. They never actually try things for themselves.
>>
Syntax of a language is only relevant to a small degree.

The algorithms, documentation, and quality of your code is all much more important than what specific language you're learning.
>>
>>60115549
How to learn proper algorithms and documentation ?
>>
>>60115417
>Is it worth learning Python3 if I want to get a job as a programmer?
No.
It's mostly used by scientists, most of which are """"scientists"""" and some plebs like admins and distributors.
There aren't that many job offers to write whole Python applications.

>>60115515
>Python is a great first language to learn with. Stay focused with Python. Java and C have different use cases. People who say that Java and C are better than Python have no idea what they are talking about. They are different use cases.

However, people saying that the Java dev team is somewhat competent and the Python team isn't are somewhat right.
On additional note: Mixing scripts with C extensions gets you the worst of both, as bindings and FFI with slow scripting languages don't scale up to actual software.
Sandboxed embedding is ok - something Python isn't that great at either - but extending will give you hell for anything more finegrained than some default trash like in the standard library.
>>
>>60115515
Thanks for the response, I'll keep going with Python and see where that gets me. I know Python 2 and 3 are different, so I might learn the differences between them eventually.

>>60115549
Well I'm just learning the syntax so I could actually code, but I do need to learn how to document properly. I imagine quality of algorithms should increase with practice.
>>
>>60115598
geeksforgeeks.org has a bunch of algorithm examples

documentation just means very legible code. Concise and to the point comments, variable names, etc.
>>
>>60115646

Thanks
>>
I need a short script written but can't seem to find the help that I need, so I guess I'll spend weeks or months learning python just so I can get a days' worth of code written.

What's a good resource to learn python?
>>
>>60116731
Hey, What script you need written, maybe I can write it for you to practice if I have the knowledge. I could just paste it here.

I've been using videos on youtube by sentdex and Corey Schafer, and of course lots of googling.
>>
>>60115417
>self taught programmer
Just give up now
>>
>>60116779
Why?
>>
>>60116790
Because you're a brainlet
>>
>>60116754
No offense, but I've offered to pay people here and on fiverr and no one seems to be able to get it. It involves finding values from a list/tuple in a json from an API, and I guess that's hard.

I appreciate the recommendations for educational materials though.
>>
>>60116803
I don't understand this meme yet. Can you explain?
>>
>>60116816
Just don't go in thinking you're hot shit after having done a few online examples, at the end of the day you've got to be good
>>
File: 1491496727730.jpg (21KB, 480x480px) Image search: [Google]
1491496727730.jpg
21KB, 480x480px
>>60115417
>if I want to get a job as a programmer?
>self-teaching
Nothing will get you a job when you are self taught unless you are some kind of prodigy, which you arent judging by your post.
Even Pajeet, the professional street shitter, will get a job before you, because he at least has some formal qualifications.
>>
>>60116859
>>60116899
No idea how I came off as someone like that. I'm fully aware I have a lot more to learn. If I'll end up having enough money I don't see why I wouldn't continue my education.
>>
>>60115417
>I've been self-teaching myself Python3 and honestly I've been having a lot of fun. Programming is something I've only done a few times.

If you're having fun, you're on the right track regardless.

When I look for a programmer, I rarely look for specific tools. I look for evidence that you get shit done, and if you genuinely like programming you will get shit down.
>>
>>60116946
Also,
>>60116899
this guy is trolling. I know plenty of awesome programmers who are self taught. One of them didnt' even go to college
>>
>>60115417

No. Python is not in fashion anymore.

Rather learn Go, it's the future.
>>
Do I need numpy to find the value of X from the largest Y in a list X,Y pairs? Or is this something built into python?

>{"category":{"subcategory":[[5,3],[6,9],[2,2]
>return 6 as Y, because 9 is greatest X
>>
>>60117037

python """programmers""", everyone..
>>
File: 1490809955947.gif (2MB, 350x305px) Image search: [Google]
1490809955947.gif
2MB, 350x305px
>>60115515
>. I have never once seen anyone actually use Python 3
>>60115640
>It's mostly used by scientists
>>60116779
Just give up now

jesus, thats enough /g/ retardation for today
https://pythonclock.org/
>>
>>60116987
If he really was trolling then it was a bit thoughtless. Somehow it felt slightly demotivating which was needless because I don't have enough money atm to go to school again and I'm putting in my free time into this.
>>
>>60117056
I don't understand your statement.
>>
>>60115417
>logically understanding the syntax
you don't need that
did you logically learn grammar ? I don't think so.
>>
>>60117095
Wouldn't you say, at least to a degree, grammar has a sort of logic to it? You can't just be writing random words and expect to make a coherent sentence. And I guess I just meant learn syntax.
>>
>>60116987
Nah, there are so much CS grads that Google can afford to only hire PhDs and Pajeets.

The programming field is already way past saturation because every single 3rd world country hands out degrees like candies.
>>
python is the only thing ive seen used in the limited amount of SDN I've seen

as things get more hardcore due to more ips in enterprises im sure that'll change
>>
>>60117065
Some hack may hire you kiddo. But don't _ever_ expect to be seen as a _real_ programmer
>>
>>60117082

Your question shows a significant lack of understanding fundamental parts of the python programming langauges. This confirms the stereotype of most python programmers being programming newbies (= people that can't programm very good), whihc I tried to indicate by putting the words "python programmers" in a triple quotation mark as a rhetorical device in favour of the lulz.
>>
>>60117191
Oh.. You thought I was claiming to be a programmer. No, not at all. I was just asking a question, because I'm aware that I don't understand python as well as most of the people in this thread understand addition.
>>
>>60115417
Learning programming is like fighting ludwig in bloodborne.

At first some will goat you into c#, java, but once you've spend enough time on stackoverflow trying to make hello world work you will realize that python was by your side all along, your true mentor, your guiding moonlight.
>>
>>60117170
grammar and syntax has a logic to it but you don't need to understand it deeply to right stuff
In fact, up to a level onky the syntax changes between la,guages that do the same thing, the concepts (for(), if, while()) are always the same
>>
>>60117032
Python 2.7 isn't about fashion. Its timeless classic. Post-2.7 is shit though
>>
I found an example that I don't think actually solves my issue:
arr = [[1,0],[8,9],[2,1],[3,2],[10,10]]
print(max(arr))

[10, 10]

It looks like it's returning that pair because both X and Y are largest, but that wouldn't be the case in my problem. If I change it so that it reads:

arr = [[1,0],[8,9],[2,1],[3,2],[7,10]]
print(max(arr))

I get the result [8,9] when I want [7,10]

Anyone know how to fix that?
>>
>>60117337
cont.
I'm getting a syntax error on:
X,Y = [[1,0],[8,9],[2,1],[3,2],[7,10]]
print(X,(max Y))
I can't figure out what's wrong here.
>>
>>60117212

Fair enough.

a = {"category":{"subcategory":[[9,2],[6,9],[2,2]]}}
k, v = 0, 0


for i in a["category"]["subcategory"]:
if v < i[1]:
k, v = i[0], i[1]

print(k, v)
>>
>>60117432
Why should [7,10] be returned? What is your criteria for picking that list?
>>
>>60117432

>X,Y = [[1,0],[8,9],[2,1],[3,2],[7,10]]

You have only one list and try to assign it at two values, that's the error.
>>
>>60117515
Awesome! Though I don't really understand why that works.

>>60117563
If 10 is the largest Y in the list (or tuple?), then I'm trying to find the 7 from that pair.

>>60117571
So then is >>60117515 the best way to do this (which works) or can I find 7 in >>60117432 with some sort of modification to print(X,(max Y))?

>>60117515
>>60117563
>>60117571
I really appreciate the help, btw.
>>
File: download (2).jpg (9KB, 220x229px) Image search: [Google]
download (2).jpg
9KB, 220x229px
>>60117058
nobody cares, the future of python is pypy and they aint gona drop 27. also fuck guido
>>
>>60117618

>Though I don't really understand why that works.

how can you not understand how it works?

k=0
v=0

>for i in a["category"]["subcategory"]:

iterates through all the values like [9,2], [6,9] and so on. in other words: "i" is always a list with the length 2: the key and the value

>if v < i[1]
i[0] is the first entry
i[1] is the second entry

if the second entry is bigger than the second entry..

> k, v = i[0], i[1]

save the new key/vale pair in the variables k and v
>>
>>60117688
So it checks each individually, rewriting the stored value if larger, skipping if smaller until it hits the end, where it returns that value? Does anything else happen in the rest of the script (there's more to this) before it hits the end of the list?
>>
>>60117618

> can I find 7 in >>60117432 with some sort of modification to print(X,(max Y))?


No, you can't.

Even if you would assign X to the keys and Y to the values, then
print(X, max(Y))
is just completely wrong.

The programm would return the complete keys as X, not the single key which has max(Y) as value..
>>
>>60117743

No, it's exactly like you said:

You iterate through all the values and store the key-value pair of the biggest value (so far) until the end of the list.
>>
>>60117337
max(arr, key=lambda x: x[1])
>>
>>60117761
Okay. I'm playing around with changing values in >>60117515 and getting a better understanding of why and how this can be applied.

>>60117797
Great. That saves me the worry of returning a temporary value accidentally.

>>60117799
lambda is a sort of plug-in, right? Is it faster to run this with or without it?
>>
>>60117799

This is much more elegant then my solution, but I wanted to give anon a solution he can understand (and modify), since he obviously no programmer...
>>
A lambda is just an anonymous function. It's not a plugin, just a shorthand for declaring functions without a name.

I can't really speak of its performance, but since it is a function that gets called there is the overhead that goes along with creating space for the variables and stack frame, etc. If you are really concerned, you could always take a look at the implementation of max() to see what it's doing under the hood (only if you're really interested/concerned)

If you have a large data set, you could also bench it.
>>
Okay, so that's working and this is working:

with urllib.request.urlopen("url") as url:
data = json.loads(url.read().decode())
print (data)

So how would I incorporate the two, so that in >>60117515 I'm pulling (k, v) from 'data' returned from url? I'm trying:

with urllib.request.urlopen("url") as url:
data = json.loads(url.read().decode())
for n in data["category"]["subcategory"]:
if y < n[1]:
x, y = n[0], n[1]
print (x)

But it's telling me that 'y' isn't defined when it was working before.
>>
>>60115515
Why not just write shell script?
>>
>>60118455
cont.
If I replace 'data' with 'x, y' it tells me 'not enough values to unpack', so I think that's where the problem is.
>>
>>60115640
>It's mostly used by scientists, most of which are """"scientists""""

Wtf is that supposed to mean?

t. Scientist
>>
with urllib.request.urlopen("url") as url:
a = json.loads(url.read().decode())
x, y = 0, 0

for i in a["category"]["subcategory"]:
if y < i[1]:
x, y = i[0], i[1]
print(x)
print(a)

Okay, I think this is working, it looks like it's returning the 'x' from the largest 'y' in x,y pairs from 'a'. Thanks, guys!
>>
>>60118977
I am not a programmer and have no formal education in computer science. But if you are unable to come up with that solution on your own using Google in a day, you should seriously consider a career in a job that only involves very simple repetitive manual labor.
>>
>>60115417
Here is why python is a good language especially for learning programming.
>Multiplatform
Unlike VB.
>Actually a marketable skill.
Used by Google, quantative finance/data science companies and system administrators. Unlike Scheme.
>Is interpreted allowing for easier debugging and TDD for beginners.
Unlike C, C++ and so on.
>Has simple easy to read syntax.
Unlike C, C++, JavaScript and so on.
>Forces programmer to use correct white space and formatting.
Unlike virtually everything else.
>Is multi paradigm (functional and object oriented)
Unlike Haskell.
>Comes with a packet manager, interpreter, editor and more all out of the box.
Unlike anything else I have seen.

Personally I believe that everyone should know at least 10 languages well.
>C
>Scheme/Common Lisp
>Python
>JavaScript
>Haskell
>C++
>Java
>BASH
>C#
>x86_64 Assembly
Above are the ones that I have chosen for myself based on industry prevelance as well as for novelty and for their different paradigms. Python is a great place to start desu senpai.
>>
>>60119114
Found the paid shill.
>>
>>60119101
Thank you for your vote of confidence!
>>
>>60119114

>>Forces programmer to use correct white space and formatting.
>Unlike virtually everything else.

You're new to programming I'm guessing.


>Personally I believe that everyone should know at least 10 languages well.
>C
Useful in many places
>Scheme/Common Lisp
For what job?
>Python
Useful in many places
>JavaScript
Useful for webdev only
>Haskell
For what job?
>C++
Useful until you get a stack overflow because you're calling shit you don't know calls shit that calls other shit for days
>Java
Useful in many places
>BASH
Useful if you need to admin or use Unix...otherwise no
>C#
Useful in a few places
>x86_64 Assembly
No useful for anyone but OS programmers 0.1% of their career, even engineers programming drivers need not use this 99.9% of the time. Assembly for ANY processor should be studied once by serious programmers/engineers and purged from memory until the day you need it again at which time you can search or buy a book on it. Waste of life otherwise.
>>
>>60115417
Learn PHP. You'll get more job faster than anything else.
>>
>>60116899
Tell that to the guy making 150/yr self taught. 5 years in.
>>
>>60115645
For learning purposes the difference between 2 and 3 are irrelevant and once you know one you can work in both. Any little quirks you can deal with as they arise. I use 2.7 for work shit bc that's what's supported. For side shit I use 3 bc why not.
>>
>>60116810
Surely you're not serious? How is this difficult?
>>
>>60119600
No idea. I seem to be making decent progress, thanks to /g/. Now, it's just a matter of interfacing the script with the API.
>>
>>60119626
Pip install requests
>>
>>60119705
I don't know what that is...
>>
>Python 3
>Print Is A Function
>The print statement has been replaced with a print() function, with keyword arguments to replace most of the special syntax of the old print statement

print "nigger plz"
>>
Yes. Learn Py3 if applicable. Most differences between 2 & 3 are not too huge for most work. 2 will be deprecated in a few years, don't write in it if you don't have to.

In fact where I am anything new we just default to Py3, no point in using Py2 going forward when we don't have to.
>>
>>60117037
no, just use max+itemgetter or sorted( ... , reverse=True)[0]
>>
I want to return a value and email it to myself.

import smtplib

server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login("YOUR EMAIL ADDRESS", "YOUR PASSWORD")

msg = "YOUR MESSAGE!"
server.sendmail("YOUR EMAIL ADDRESS", "THE EMAIL ADDRESS TO SEND TO", msg)
server.quit()

But if I take off the quotes from 'your message!' or change msg in any way it doesn't send. What do?
>>
>>60119158
Sorry, it was maybe a bit harsh. But have you given the problem an honest try yourself before crying out to others for help? You may surprise yourself. Or not.
>>
>>60119915
I never got this, like what was the point of changing it to print()?
>>
>>60119277
Loool

Never ever learn php
>>
>>60123863
Initially, no. I figured it would be a short write for someone who already knows the language, whereas I expected it to take me a couple weeks to learn it (or as much as I needed for this project).

That said, I'm mostly done, and this is only the first day I've been working on it myself. So yeah... it could have been easy money for somebody.
>>
>>60121740
>take off the quotes

What the fuck are you talking about? You need quotes to delimit a string. It's an error to take the quotes off.
>>
>>60123934
So then how could I get the email message to contain a return value instead of pre-loaded text? Everything that goes inside the quotes is displayed as-is.
>>
>>60123966
Can't you just create the string beforehand? Like msg = "hello %s" % some_name_var

Actually I forgot the string formatting syntax but can't you just create your string and make sure it's actually a string?
>>
>>60123992
Maybe. This is my first day learning Python.
>>
Python 3 has all the right decisions 2 never made at this point. Duck typing was a mistake.
def f(x: int) -> str:
return f"{x}"
>>
>>60119270
right, because embedded devices don't require asm.
>>
>>60123899
print() is much more flexible than special syntax. You can pass it to other functions as an argument. For example, if you are making a UI and are adding buttons, you can try giving print to it as a callback, to check what argument each button sends with its callback.
>>
File: 643931283.jpg (66KB, 534x540px) Image search: [Google]
643931283.jpg
66KB, 534x540px
is python 3 more used than 2 yet?
>>
>>60124419
Not him, but they definitely don't require x86_64 ASM
>>
>>60125071
nobody said they did.
>>
>>60125071
>right, because embedded devices don't require asm.

Anon says 'i think you should learn x86_64 ASM'
Another anon replies 'no you shouldn't, waste of time'
Another anon replies to that with sarcastic text quoted above, making the argument that its not a waste of time as embedded devices use it.

Did I miss anything?
>>
>>60125132
Meant for >>60125075
Thread posts: 88
Thread images: 5


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.