[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]

python

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: 106
Thread images: 6

File: daily python thread.jpg (113KB, 984x927px) Image search: [Google]
daily python thread.jpg
113KB, 984x927px
python general
bonus:
whats our official opinion of python
>>
I had to use python for a university assignment once.
I didn't like it.
>>
Comfiest language in existence
>>
>>60737393
Based language. Triggers the unemployable half of /g/ like a boss for being so easy and useful.
>>
Was able to make my first full program using python. Its simple to use yet powerful enough to be useful.
>>
trying to git gud at it. Have done some stuff here and there.
I have a hard time seeing the use for anything serious, mostly because of performance.
It's nice to prototype in, but am I better off just going all out C++ so I can prototype faster in that and not go down on performance?

I also have some security concerns, though that's entirely there in C++ too, but it's easier to avoid because your use of memory and types (thinking int overflows) is more transparent.

Thoughts?
>>
File: works.png (229KB, 800x774px) Image search: [Google]
works.png
229KB, 800x774px
good high-level language for writing easy APIs for automating low-level processes

shit slow and sucks with arithmetic tho

i use it frequently to automate running blocks of reusable SQL queries. SQL handles the number crunching, Python just makes it dead simple to glue the blocks together in whatever order you want
>>
>>60739246
>sucks with arithmetic
Numpy
>>
Python is very comfy for scripting, but I wouldn't write any projects in it.

It has it's niche.
>>
>>60739522

numpy is effectively just a big wrapper class for C scripts, basically what i described except i used SQL as an example

https://stackoverflow.com/questions/1825857/how-much-of-numpy-and-scipy-is-in-c
>>
>>60737393
>using python to auto download torrents, based on what day it is

Feels comfy

>improving keylogger for windows in python.
>>
pandas is the best library in existence
>>
>>60740874
my nigga
>>
>>60739195
got the same issues atm dont really know where to start looking into more advanced stuff
been trying to find stuff like programming challenges but didnt find any good ones yet, anyone knows whats good to do in this situation?

i should mention ive been told i need to improve my python for an upcoming job and trying to cover as much as possible in the next 2 weeks
>>
>>60739195
Python allows you to write a correct solution quickly.
If you're interested in performance you're using the wrong language.
HOWEVER, you can gain a boost if you write in Cython, use JIT plugins, etc.
If you need an even greater boost you can write the business logic you require in C or C++
If that still doesn't help, consider using another language for the project, or for the specific process which is performance critical.
>>
>>60742920
What sort of job are you applying for?
Have you tried Codewars?
>>
File: 2352313.jpg (100KB, 658x439px) Image search: [Google]
2352313.jpg
100KB, 658x439px
>>60737393
>>
>>60737393
Fast, sleek, modern.
Everything you could want in a programming language.
>>
jython anyone? :^)
>>
>>60737393
I don't think Yuki would use it, although you could say she is already an interpreter.
>>
>>60737393
I've used it for like 2 hours

>try to learn java
>this shit's fucking ridiculous
>learn python instead

yes/no?
>>
>>60740806
mind to share keylogger?
>>
>>60745304
If you're just learning to program, it doesn't matter much what language you start out with.
>>
>>60737393
Fucking slow as shit. Even meme languages like Lisp are faster, and more sane.
>>
>>60737393

redit was built with python

>Python is literally redit
>>
>>60739246
>Python:
Simple and useful, slow though

>C
Fast and useful, complex and unintelligable

>Julia
best of both worlds.

Fuck python, Julia is superior.
>>
>>60745634
I swear to god if only employers didnt force you to write shit in a specific language, or atleast if all the other languages were more popular I would be so fucking happy. Julia is indeed pretty nice, but like no one uses it for codebases etc. So if you actually wanna make some money you're stuck with the same old bullshit
>>
>>60745578
want python but superior speed?
Try Julia:
>same syntax as python
>execution time comparable to C (and sometimes faster)

>>60745755
Is there anyway to undo the travesty we have set ourselves in?
>>
>>60745768
If I wanted to use a niche language, I'd just use Common Lisp.
>>
>>60737393
Looks like Sub-Zero hugging Scorpion in the thumbnail.
>>
>>60745787
but common lisp is slower?
>>
>>60745855
Does Julia use Lisp syntax?
>>
>>60745578
>meme languages like Lisp
Your opinions are invalid
>>
>>60745924
lemmie check
>>
>>60745985
Why shill a language you don't know?
>>
>>60745924
nope, It uses python syntax.
>>60746000
i know the language. i don't know lisp though which is shy i had to check if the syntax is the same or not.
>>
>>60737393
I want to FUCK that anime girl
>>
>>60744248
>Fast
>>
fucking hate python. every single time i write something longer than a few lines, the code becomes unmanageable and i have never ending 'unexpected indentantions' just because i fucked up my spaces on one line. and it's slow as shit
>>
>>60746024
i just wanna fuck something

wish my dick fit in the optical drive
>>
Pick one for me to learn
>go
>rust
>>
>>60746260
lisp
>>
>>60746244
I bet it does
>>
>>60746260
>Julia.
If not then:
>Go
>>
>>60737393
I'm trying to learn python but once I start reading about coding I immediately go crosseyed, start yawning, I can't think straight. What the fuck is wrong with me.
>>
>>60737393
>whats our official opinion of python
Slow ass dog shit.
>>
>>60739195
I'm incredibly new
How feasible is it to write out all your functions in a faster language and then using Python to call them?
>>60747846
That was me a week ago, just start and don't look back. It's pretty interesting once you can start seeing all the examples and break down what each line does
>>
File: disgusting.jpg (51KB, 854x570px) Image search: [Google]
disgusting.jpg
51KB, 854x570px
>>60737393
I just can't get the syntactical whitespace
>>
Would picking a project and then learning how to make it work be a good idea to learn Python? Sort of picking it up as I go along instead of following a guide?
>>
>>60748945
I've always remembered the most while actually makings something.

I usually just got a good guide, but instead of reading it front to back, used it to look up and understand the different concepts as I needed them.

What do you have to lose by giving a shot?
>>
>>60745597
reddit is literally python*
>>
>>60748874
IDEs will take care of it like they do with brackets
>>
>>60748874
have you tried not being retarded and writing legible code?
>>
>>60737393
its pretty good, im stating on python and even that i feel like a retarded hitting the water with a stick python is a good language
>>
>>60749245
Doesn't get much easier than print('shit')
>>
>>60749114
I can do both. Why do you assume code can be written only one way.

It doesn't make it a bad language because I don't like one aspect of it.

Don't be an asshat.
>>
File: 1480266123414.jpg (39KB, 374x347px) Image search: [Google]
1480266123414.jpg
39KB, 374x347px
>Whitespace syntax
>>
>>60745530
>>60745530
desu its kind of messy, I like to have title of the window (web browser or whatever) along with what they're typing, so its kind of clunky, but here you go.

The paste expires in one week.
>https://pastebin.com/vwRrMfdS

>features I still want to add
>mutex
>remote output
>detect uppercase letters (by default all keystrokes are in uppercase, but this is problematic if you need a password that require case sensitivity) but I had the string convert them to lower case. I just picked it up again, hopefully I can make it more elegant.
>>
>>60749775
>being a brainlet
>>
File: django.png (8KB, 1200x418px) Image search: [Google]
django.png
8KB, 1200x418px
Python & django = best for web development
>>
If you use it to make applications then you're retarded. But vpython is a ok my guy
>>
>>60745634
Python is much more complex than C. It's easier to write in Python.
>>
How to package a python application for running on other machines?
>>
>>60745768
Seems line a python fork based om pypy JIT.
>>
Q: Does anyone actually use Type Hinting?
For what? Is it nice?

>>60737393
9/10 language.
>>
Reminder that Kobayashi from no maid dragon literally uses Python
>>
Had to do a few assignments in Python for one of my lectures and I like it more than the other shit languages I had to use for my other lectures (Haskell/Java).
>>
>>60737393
Great for system administration. I find C more fun to use, though.
>>
>>60755563
D for dragon
P for programming
>>
>>60755587
C
>Spending 5h writing a simple function
>Spend the next week bug fixing.

Python
>Spend 1h writing a simple function
>Spend 30 bug fixing

Ye C sure is more fun anon
>>
>>60737393
- (really) bad performances
- poorly designed plt wise
- lot of libraries are poorly written
- python2 vs python mess
- most of python programmers are mediocre
- no more interesting to adopt
- stuff being continually added to the language (async, typing, ...)
- insignificant in both amateur and pro game development

+ stuff being continually added to the language (yeah, it's also a positive)
+ huge adoption in both the industry and the academics
+ great and friendly community
+ employment
+ has a builtin package manager
+ it's just works
+ forced indentation of code

honestly, clisp/scheme/racket blow out python
>>
>>60745855
i highly doubt that.

Julia:                         19.321510121 seconds time elapsed
Common Lisp SBCL: 3.015000773 seconds time elapsed
>>
Name an example program that Python is supposedly slow in.
Preferably something I can try out myself.
>>
>>60737393
Not quite as good as Ruby.
>>
>>60755953
Ok, now put out the type annotations of your CL code and put them into your Julia code and turn on optimizations in Julia.
Tada, CL is beaten.
>>
It's all right. As a C++ guy I don't like the way it boxes you into certain ways of doing things, but I appreciate the stronger typing than other scripting languages and code tends to be very readable.
>>
>>60756026
Anything that requires math really.
You might then start to Wonder, why does big-data and scientists use it then?
The answer being that python has great libs that compiles to c and therefore enableing math at near c
>>
I love python, string.split is my jam
>>
>>60756026
iterating through for loops.
nesting them naturally multiplies the problem. try writing insertion sort as an example
>>
Is https://pythonprogramming.net/ any good?
>>
>>60765075

I'm trying to implement some simple NLP work into a webapp and that web doesn't stop popping on internet searches.

They only have one article about what I'm trying to do and it's awful. I haven't used the site apart from that.
>>
>>60761401
> flat is better than nested
Using iterators and the itertools library can cut down on the ugliness.
Preferably, you should never index a list or a tuple in python.
>>
>>60757071
But about single threaded performance unless you want to rape your memory.
I still hadn't tried using blaze with subprocess but I guess the world will crash and burn if I do
>>
>>60737393
Currently trying to make a python testing script at work using pyserial and some other assorted bullshit for a nodemcu chip

Python is great for scripting, but I'm not entirely sure why my coworker decided to use pyserial for this shit instead of C or C++
>>
>>60755457
setup.py
>>
>>60737393
Python is great. Use it for scientific computing. Most people who have a negative opinion about it usually don't understand what it's supposed to be and how to use it. Especially shit opinions such as "It's slower than C" is something only idiots would ever say. You are never actually implementing any algorithms in Python, if you do, you don't use it correctly. If you take advantage of the huge amount of libraries in Python, then you usually end up with code that is a LOT faster than anything you could come up with in C in the same time.
>>
>>60755579
>Haskell
>shit
You're just too new to get it.
>>
>>60765843
>I'm too stupid to write in a real language so I'm going to rely on dogshit slow libraries other people wrote
If you're not a programmer, at all, sure, use python libraries to crunch data.
If you can program in any capacity, then you're a fucking retard if you use that god awful language.
>>
>>60765895
Maybe if you have lots of time to waste, but certainly not if you've got shit to do. Anybody who implements any kind of number crunching in a low level language, is a fucking idiot. It's only an option if you really have to implement algorithms that are not available anywhere. And that is rather rare usually.
>>
>>60738469
So much this. I use Python for work and my boss loves how fast I can implement stuff in it.

Newsflash for neckbeards. The customer doesnt care if a program takes 5 second to start or if a task takes 200ms instead of 20ms, to complete. Everybody cares about the time it takes to get a product ready.
>>
>>60765286

Okay. Thank you.
>>
What should I read after 'Automate the Boring Stuff'?
>>
>>60766119
Some people care about running 1 server instead of 50, so there's that.
>>
This is probably the best thread to ask in.

Every time that I try to work in python I spend ages sitting there trying to work out if i'm meant to use python 2 or 3. I really strongly dislike that they have two different versions out there.

I'd really like to get better at python for some of the reasons mentioned in the thread (fast to write in etc.) but this issue annoys me a lot.

Am I the only one?

Which version is best to use? is 2 going to die soon?
>>
>>60766742

bump.
>>
>>60767464
Use 3. The only excuse for using python 2 for a new project is that you NEED a library that is python 2 only, and that's pretty rare now
>>
>>60768466

bump
>>
>>60769225
This is a lie that Python users keep telling noobs, that *everyone* uses Python 3 when actually almost no one uses 3 as all the libraries are all in Python 2 and the Python community is not going to rewrite the entire Python libraries for no appreciable difference
>>
>>60769944


try starting a project, or solving python questions on SO or reddit /learnpython
>>
>>60769225
>and that's pretty rare now
That's not even remotely accurate
>>
>>60770836
>actively promoting a subreddit
You need to leave and never come back
>>
>>60766742
The Hitchhiker's Guide to Python is a good reference you should go over
Consider watching a few pycon lectures (Raymond Hettinger might give you a few good ideas)
Besides that, start writing. Once you start using it you'll know what you're missing
>>
Im fucking shit on maths, literal brainlet, there is a guide for python that is for retards, i mean a guide from total 0? or i just should kill myself?
>>
>>60770654
this.

https://hynek.me/articles/python3-2016/
>>
>>60770654
https://python3wos.appspot.com
Apologise
>>
I just starting with python for learning code
Thread posts: 106
Thread images: 6


[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.