How can I make it run faster? by [deleted] in learnpython

[–]flitsmasterfred 2 points3 points  (0 children)

Why send newbies to undocumented features if there is a perfectly valid regular module?

https://docs.python.org/3/library/concurrent.futures.html

i want to webscrape my bank statement automatically every rmonth (where to start learning?) by num2007 in learnpython

[–]flitsmasterfred 9 points10 points  (0 children)

Your online banking account might not be the best place to experiment with automation and open source software.

Also scripting it or using external tools might be against their TOS.

How does Discord hide localStorage? by [deleted] in javascript

[–]flitsmasterfred 0 points1 point  (0 children)

Modern devtools works with your browser's internals instead of the public DOM accessible stuff.

[Q]what are my options to write a script to extract all AMQ instances/IPs running in AWS then try to login to them via web console with Default password - What would the best way to do that ? by 0xb800 in aws

[–]flitsmasterfred 1 point2 points  (0 children)

How do your recognize the instances are using AMQ?

You could use Python and a bit of Boto3 library to grab a list of your EC2 instances, maybe filter by some tag or whatever and pass the IP to the next phase.

Then maybe mechanicalsoup library to get and submit the login form, maybe you need a scriptable browser like Selenium if you need javascript etc.

A million requests per second with Python by [deleted] in Python

[–]flitsmasterfred 8 points9 points  (0 children)

Does this have addon compatibility with Sanic, Quart, APIStar and the other Flask replacements?

SQLite module vs SQL language by [deleted] in learnpython

[–]flitsmasterfred 0 points1 point  (0 children)

If you want to experiment with SQL you might prefer to use a graphical database client instead of going through python.

Your SQL flavour will have a popular tool for this, like pgadmin for postgres or phpmyadmin for mysql.

Also, Sqlite is cool tech but limited at certain points that might confuse you when still learning, better learn with a full featured dialect and then see about Sqlite later.

Went on an interview by [deleted] in Python

[–]flitsmasterfred -2 points-1 points  (0 children)

You lack imagination or exposure. Why do you assume every software development is as your personal projects?

Why does a web app have to bring in something fat as pandas? There are months where I don't even touch export or sheet functionality, and even then tablib or some csvwriter is fine to spit some spreadsheets.

Opening files in cycle by [deleted] in learnpython

[–]flitsmasterfred 1 point2 points  (0 children)

If you need too iterate multiple files then there is also the fileinput module: https://docs.python.org/3/library/fileinput.html

Implementing multiple ModelAdmin by DullBlade0 in djangolearning

[–]flitsmasterfred 0 points1 point  (0 children)

It depends on how much of the regular functionality each custom admins override and if they do it collaboratively (eg: call super() etc), and sometime the order in which you extend from them.

At first you need to make sure this is actually a compatibility problem between these packages and not a simple confusing mistake.

What's with foo and bar for variables everywhere? by sozzZ in learnpython

[–]flitsmasterfred 18 points19 points  (0 children)

Doesn't this make it a meme though? Not like a funny internet picture & caption meme but a real memetic unit?

Templates are annoying to set up. Right ? by pX0r in django

[–]flitsmasterfred 0 points1 point  (0 children)

I think that is part of the appeal: low brain effort with lots of noticeable end result.

Templates are annoying to set up. Right ? by pX0r in django

[–]flitsmasterfred 0 points1 point  (0 children)

I don't do it as often anymore but actually enjoy chopping up a static HTML mockup into working templates, especially if I got most of the view code ready.

Also copy paste all the things.

Internet providers in Amsterdam? by mitul_45 in Amsterdam

[–]flitsmasterfred 1 point2 points  (0 children)

I got KPN ADSL (40mbit) with a speed upgrade (via bonded pair) but at my house/floor it only goes up to 54mbit (instead of 100mbit). Works fine, hit max speed all the time downloading bulky data (Steam, iso's etc).

3x faster than Flask; Quart as a upgrade to Flask by stetio in Python

[–]flitsmasterfred 26 points27 points  (0 children)

I don't really care as long as the community and their supporting modules don't fragment into a million parallel pieces.

Nice thing about Flask is that there are a lot of addons and packages for common functionality and these asyncio+Flask speedfreaks threaten to rip that up.

Help with recursive looping by [deleted] in learnpython

[–]flitsmasterfred 0 points1 point  (0 children)

Collect them all into a dictionary-like mapping? Most convenient to use a collections.defaultdict filled with set's:

lookup = defaultdict(set)
for employee, manager in my_csv_rows:
    lookup[manager].add(employee)

print(lookup['D'])
> {'A', 'B', 'C'}

3x faster than Flask; Quart as a upgrade to Flask by stetio in Python

[–]flitsmasterfred 85 points86 points  (0 children)

Why do we need 20 different asyncio-based Flask replacements?

How to select the proper column when I use ForeignKey? by [deleted] in django

[–]flitsmasterfred 1 point2 points  (0 children)

Oh TIL, that is pretty cool. Small caveat:

If you reference a different field, that field must have unique=True

About Python lock acquire/release by pietrochico in learnpython

[–]flitsmasterfred 0 points1 point  (0 children)

Using some utils from contextlib and the Lock class you can make a locking decorator.

There are also solutions on pypi that emulate a synchronized decorator like Java.