Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
NinpoEspiritoSanto
Oct 22, 2013




Thermopyle posted:

According to the forums search, I've posted in the current incarnation of this thread 242 times!

I meant I'm a newcomer!

e:

Other recommendations:

Pendulum, the last datetime replacement you'll ever need:
https://pendulum.eustace.io/docs/#introduction

Take all that bloody boilerplate out of class creation with the excellent attrs library:
https://www.attrs.org/en/stable/

NinpoEspiritoSanto fucked around with this message at 22:35 on Jan 1, 2019

Adbot
ADBOT LOVES YOU

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Bundy posted:

I meant I'm a newcomer!

Oops!

NinpoEspiritoSanto
Oct 22, 2013




An excellent free book I didn't see in the OP, good for newcomers to programming and Python specifically and teaches lots of idiomatic approaches that are useful even for the seasoned:

Think Python:
http://greenteapress.com/wp/think-python-2e/

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Bundy posted:

An excellent free book I didn't see in the OP, good for newcomers to programming and Python specifically and teaches lots of idiomatic approaches that are useful even for the seasoned:

Think Python:
http://greenteapress.com/wp/think-python-2e/

It's already there (search "Think Python"), but it links to the Python 2 version.

Hughmoris
Apr 21, 2007
Let's go to the abyss!

Bundy posted:

The Clean Architecture in Python (also a nice watch for anyone interested in FP approaches in Python):
https://www.youtube.com/watch?v=DJtef410XaM

Thanks for this one!

NinpoEspiritoSanto
Oct 22, 2013




Thermopyle posted:

It's already there (search "Think Python"), but it links to the Python 2 version.

Doh missed it ah well my link is py3 at least!

Hughmoris posted:

Thanks for this one!

No worries, that video inspired me to learn FP in python, it's really improved my work and I've some really nice hybrid apps that make use of classes and functions etc where appropriate.

keyframe
Sep 15, 2007

I have seen things

Bundy posted:



Pendulum, the last datetime replacement you'll ever need:
https://pendulum.eustace.io/docs/#introduction


This looks really cool, cheers!

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

Thermopyle posted:

It's already there (search "Think Python"), but it links to the Python 2 version.

the Python search experience

Sad Panda
Sep 22, 2004

I'm a Sad Panda.
I'm struggling horribly to get OpenCV running. On Windows 10, Python 3.7.0 and using PyCharm 2018.3.2 if it matters.

This is the output of pip list

code:
Package          Version
---------------- ----------
browsermob-proxy 0.8.0
certifi          2018.11.29
chardet          3.0.4
Click            7.0
colorama         0.4.1
cycler           0.10.0
Cython           0.29.2
Flask            1.0.2
idna             2.7
itsdangerous     0.24
Jinja2           2.10
kiwisolver       1.0.1
MarkupSafe       1.1.0
matplotlib       3.0.2
numpy            1.16.0rc1
opencv-python    4.0.1
Pillow           5.4.0
pip              18.1
psutil           5.4.8
PyAutoGUI        0.9.39
PyMsgBox         1.0.6
pyparsing        2.3.0
PyScreeze        0.1.18
pytesseract      0.2.4
python-dateutil  2.7.5
PyTweening       1.0.3
requests         2.20.1
selenium         3.141.0
setuptools       40.6.3
six              1.12.0
urllib3          1.23
Werkzeug         0.14.1
I tried installing it through pip install opencv-python which got me 3.4.5. The current version was manually installed after downloading the wheel from https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv

Either way, I get the following...
code:
>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.
edit : Looking in Python37/Lib/site-packages/

code:
...
03/01/2019  21:29                21 cv.py
03/01/2019  21:29        55,729,152 cv2.cp37-win_amd64.pyd
...
03/01/2019  21:29        18,652,160 opencv_ffmpeg401_64.dll
03/01/2019  21:29    <DIR>          opencv_python-4.0.1.dist-info
...
So it hasn't created a cv2 folder?

Sad Panda fucked around with this message at 22:50 on Jan 3, 2019

NinpoEspiritoSanto
Oct 22, 2013




What does the following give you in your REPL?

code:
>>> import imp
>>> imp.find_module('cv2')
The cv2.pyd file is your module here. Do you have the relevant VC runtimes installed that the opencv wheel would have been built with? You probably want at least vcredist 2015, it's been a while since I've had to resolve any Windows dependencies.

Mark Larson
Dec 27, 2003

Interesting...
For someone coming from a SQL world, is there a quick guide to Python or Pandas somewhere for stuff like group by, order by, removing/adding/calculating columns? Maybe I'm asking for something extremely basic but it would be good to have a cheat sheet to quickly reference stuff I already do in SQL that I'd like to do in Python.

cinci zoo sniper
Mar 15, 2013




Mark Larson posted:

For someone coming from a SQL world, is there a quick guide to Python or Pandas somewhere for stuff like group by, order by, removing/adding/calculating columns? Maybe I'm asking for something extremely basic but it would be good to have a cheat sheet to quickly reference stuff I already do in SQL that I'd like to do in Python.

https://pandas.pydata.org/pandas-docs/stable/comparison_with_sql.html

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

Bundy posted:

What does the following give you in your REPL?

code:
>>> import imp
>>> imp.find_module('cv2')
The cv2.pyd file is your module here. Do you have the relevant VC runtimes installed that the opencv wheel would have been built with? You probably want at least vcredist 2015, it's been a while since I've had to resolve any Windows dependencies.

code:
imp.find_module('cv2')
(<_io.BufferedReader name='C:\\Users\\Dom\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\cv2.cp37-win_amd64.pyd'>, 'C:\\Users\\Dom\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\cv2.cp37-win_amd64.pyd', ('.cp37-win_amd64.pyd', 'rb', 3))
I just went through https://www.itechtics.com/microsoft-visual-c-redistributable-versions-direct-download-links/
I downloaded every 64 bit redistributable for Visual C++ and now have 2005, 2008, 2010, 2012, 2013, 2017 on the system. I then reinstalled opencv using pip and the same...

code:
>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.

Sad Panda fucked around with this message at 10:48 on Jan 4, 2019

Foxfire_
Nov 8, 2010

Installing opencv is kind of a clusterfuck and I wouldn't really expect pip-ing it to work. From vague memories of the last time I did that, pip-ing it only installs the python wrapper, not opencv itself.

cv2.pyd is the dll with the python wrapper. It implicitly links to all the actual opencv dlls. Probably one or more of those is missing or not locateable.

Take dependency walker and open cv2.pyd with it. It will show you everything cv2.pyd tries to load, everything its immediate dependencies tries to load, etc... Every implicit load has to be satisfied or cv2.pyd will fail to load. Delay-loaded ones don't have to be satisfied (delay-load = the program tries to LoadLibrary() in some code path, which (A) may never actually be executed and (B) it can handle LoadLibrary() returning an error)

QuarkJets
Sep 8, 2008

If you use conda (instead of pip) then everything should just work, since anaconda will pull not only the python module but also the non-python dependencies built for your target platform. But this isn't the kind of thing where you can just install conda and then install opencv; if you're not already using anaconda then you basically are starting over from square 1, but that's okay because anaconda rules

KICK BAMA KICK
Mar 2, 2009

I successfully installed opencv with pip pretty recently for Python 3 on both Windows and Raspbian; you can't get the non-free extensions through pip (the package that claims to have those modules called something like opencv-contrib still exists the in repository but since a few versions ago in the opencv 3 branch it no longer contains the extra things it's supposed to). I absolutely understand it being a weird thing that that may or may not work but I don't think it's undoable, at least in the configurations I was using. IDK what VC runtimes I already had installed for whatever reason, maybe that was the difference.

Furism
Feb 21, 2006

Live long and headbang
I have a newbie question. I guess it's more algorithmic than Python-specific but I do use Python.

I'm uploading files to a REST API. I can't do anything with the files while they are being processed so I need to wait for them to be before I can move to the next action I need to do with them. I could just put a "sleep" I guess but I think it's ugly and dirty and won't cover edge cases. For now what I do is this:

* Parse some directory with all the files
* Upload them one by one to the API. Each API calls sends a response with some JSON object that I store in an array.
* Now I want to iterate through that array and check for the status of each file. When the status changed from "processing" to "complete", do something and keep iterating until all the files' status is "complete."

At first I wanted to remove the current entry from the array, but I don't think I can modify an array while I'm moving through it (especially from within a loop?). So I was thinking of creating another array and fill it with the completed JSON objects as they get completed. But that means I'd have to potentially loop through the array an unknown amount of times. I feel that this way of doing it (I'm not even sure I explain it right) is correct.

What would be the best way to solve this little issue?

M. Night Skymall
Mar 22, 2012

Furism posted:

I have a newbie question. I guess it's more algorithmic than Python-specific but I do use Python.

I'm uploading files to a REST API. I can't do anything with the files while they are being processed so I need to wait for them to be before I can move to the next action I need to do with them. I could just put a "sleep" I guess but I think it's ugly and dirty and won't cover edge cases. For now what I do is this:

* Parse some directory with all the files
* Upload them one by one to the API. Each API calls sends a response with some JSON object that I store in an array.
* Now I want to iterate through that array and check for the status of each file. When the status changed from "processing" to "complete", do something and keep iterating until all the files' status is "complete."

At first I wanted to remove the current entry from the array, but I don't think I can modify an array while I'm moving through it (especially from within a loop?). So I was thinking of creating another array and fill it with the completed JSON objects as they get completed. But that means I'd have to potentially loop through the array an unknown amount of times. I feel that this way of doing it (I'm not even sure I explain it right) is correct.

What would be the best way to solve this little issue?

Use a while loop and iterate through the array until it's empty by removing completed objects, you might still want to use a sleep or some kind of limiter so you aren't hammering the API though.

Edit: I realized this doesn't answer some of the issues you're having. I'd use a manual index into the array, and then just check the boundary at the start of the while loop to see if you're past the end, reset to beginning of array and continue iterating through, once the array is empty you're done. I guess technically you'll skip some entries in your array when you remove an entry, so you could not increment your iterator whenever you remove an item if it's important to you that you check each item once in order.

M. Night Skymall fucked around with this message at 13:46 on Jan 7, 2019

nonathlon
Jul 9, 2004
And yet, somehow, now it's my fault ...
What's a stable library for building a REST client?

There seems to be dozens of contenders, most of them on v0.1, a lot with little or no documentation, several of which roll-their-own request / parsing libraries, which is insane. When I last looked at this a few years ago, there were a few generic frameworks you could build upon that provided argument encoding / decoding and auth and the usual common features.

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

nonathlon posted:

What's a stable library for building a REST client?
The de facto choice these days is still Django Rest Framework for Django. Aside from that you could use leaner alternatives like Flask or Falcon but in the end you just might end up writing a lot of functionality that comes out of the box with DRF.

Rastor
Jun 2, 2001

Wait REST server or REST client? Isn't a client basically just an HTTP client (such as requests) or am I missing something?

Business
Feb 6, 2007

IAmKale posted:

The de facto choice these days is still Django Rest Framework for Django. Aside from that you could use leaner alternatives like Flask or Falcon but in the end you just might end up writing a lot of functionality that comes out of the box with DRF.

Is Django very much Industry Standard in people's experience? I've been learning Flask as my first real framework project but I don't know if I should bother doing things that way. I'm honestly not knowledgeable enough to say whether the flexibility in database type matters for my project yet. What would be more useful to learn if I want to apply for industry jobs in a few years?

NtotheTC
Dec 31, 2007


I've used Django exclusively up until 3 months ago when i finally had a project i thought flask wouks be perfect for.

2 weeks later i binned it and redid it in django

This is just one mans opinion of course

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Business posted:

Is Django very much Industry Standard in people's experience? I've been learning Flask as my first real framework project but I don't know if I should bother doing things that way. I'm honestly not knowledgeable enough to say whether the flexibility in database type matters for my project yet. What would be more useful to learn if I want to apply for industry jobs in a few years?

The thing with most web frameworks is that they're very similar, and this holds for Flask and Django.

There's two areas where they differ:

1. Where their documentation and community focuses.

Flask documentation and community concentrates on smaller apps, whereas the Django documentation and community focuses on larger apps.

2. How "batteries included" they are.

Flask basically handles routing urls to functions. Django includes a lot of other stuff like it's auto-generated admin site.


Because web frameworks are all very similar it's completely possible to write a Django project that looks almost identical to a Flask project...a single file with some decorators on some functions. It's just that the documentation and the community is not focused on this use case so it's not until you become familiar with Django that you realize this is the case.

All that being said, Django is likely a more job-worthy thing to learn, but I haven't done an analysis of job listings to confirm that. Of note, is that once you know Django, Flask is easy, but the other way around is not exactly the case.

I like Flask because I know enough to know when a project will be too big for it so I don't choose it inappropriately. And by "too big" I mean, "have to use all those flask-* (which have a 50/50 chance of being not-poo poo) packages to add on functionality that comes out of the box with Django".

(of course, that's not to say that some of the batteries-included stuff in Django isn't poo poo as well)

nonathlon
Jul 9, 2004
And yet, somehow, now it's my fault ...

Rastor posted:

Wait REST server or REST client? Isn't a client basically just an HTTP client (such as requests) or am I missing something?

Like I said, client. Sure, I could just use requests, but some syntactic sugar over the top would be a long way. And handling asynchronous requests.

Crack
Apr 10, 2009
I'm trying to make an image viewer / sorter with tkinter and I'm having trouble with animated gifs. Is there a way to make it play nice with any random gif and if not what is the best alternative? I looked at Qt but it requires xcode (6 gb download) which seems a bit overkill for my application.

My current implementation is based on this, which works for some but a lot of files turn out janky (apparently when they're large or optimized).

Rastor
Jun 2, 2001

nonathlon posted:

Like I said, client. Sure, I could just use requests, but some syntactic sugar over the top would be a long way. And handling asynchronous requests.

For asyncio I understand aiohttp is the hotness but I don't have personal experience with it.

You might take a look at aiohttp-requests

Dominoes
Sep 20, 2007

Some things included in Django, but not Flask:
-Database/migrations
-Authentication
-Admin page
-Email support
-Serialization

Most websites will use these, making Django a good default.

NinpoEspiritoSanto
Oct 22, 2013




Packt currently running a buy 4 get 1 free, buy 6 get 2 free, buy 10 get 5 free on ebooks/videos (which are all still 5bux a pop)


nonathlon posted:

Like I said, client. Sure, I could just use requests, but some syntactic sugar over the top would be a long way. And handling asynchronous requests.

aiohttp for async. Not sure what "syntactic sugar" you're after, a REST client is literally a http client.

e: Connexion + Flask is a really nice way to put together a REST API using Flask.

https://realpython.com/flask-connexion-rest-api/

NinpoEspiritoSanto fucked around with this message at 19:17 on Jan 7, 2019

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

Foxfire_ posted:

Installing opencv is kind of a clusterfuck and I wouldn't really expect pip-ing it to work. From vague memories of the last time I did that, pip-ing it only installs the python wrapper, not opencv itself.

cv2.pyd is the dll with the python wrapper. It implicitly links to all the actual opencv dlls. Probably one or more of those is missing or not locateable.

Take dependency walker and open cv2.pyd with it. It will show you everything cv2.pyd tries to load, everything its immediate dependencies tries to load, etc... Every implicit load has to be satisfied or cv2.pyd will fail to load. Delay-loaded ones don't have to be satisfied (delay-load = the program tries to LoadLibrary() in some code path, which (A) may never actually be executed and (B) it can handle LoadLibrary() returning an error)

Thank you! I tried Dependency Walker but it seems a bit out of date and gave a giant list. Googling got a suggestion of https://github.com/lucasg/Dependencies. That flagged up MFPlat.dll, MF.dll and MFReadWrite.dll. I suspect that they vanished when I was trying to make a minimal Windows installation. Found the right installer on the MS website and cv2 now imports.

unpacked robinhood
Feb 18, 2013

by Fluffdaddy
I have a simple list of items:
Python code:
items = [
    {"thermostat":14,"girth":30},
    {"carpet_cleaning":30,"girth":18},
    {"gas carpal":6,"girth":7},
    {"worthy": 8,"girth":11},
    {"nothing":"yes","girth":0},
    {"redundant":"yes","girth":0},
    {"zero":"void","girth":0}
]
How do I sort it by increasing girth value, except for zeroes which should be at the end in no particular order ?

I can do:
Python code:
sorted(items,key=lambda x:x['girth'])
Which gives;
code:
{'nothing': 'yes', 'girth': 0}
{'redundant': 'yes', 'girth': 0}
{'zero': 'void', 'girth': 0}
{'gas carpal': 6, 'girth': 7}
{'worthy': 8, 'girth': 11}
{'carpet_cleaning': 30, 'girth': 18}
{'thermostat': 14, 'girth': 30}
What I'd like is:
code:
{'gas carpal': 6, 'girth': 7}
{'worthy': 8, 'girth': 11}
{'carpet_cleaning': 30, 'girth': 18}
{'thermostat': 14, 'girth': 30}
{'nothing': 'yes', 'girth': 0}
{'redundant': 'yes', 'girth': 0}
{'zero': 'void', 'girth': 0}

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE

unpacked robinhood posted:

I have a simple list of items:
Python code:
items = [
    {"thermostat":14,"girth":30},
    {"carpet_cleaning":30,"girth":18},
    {"gas carpal":6,"girth":7},
    {"worthy": 8,"girth":11},
    {"nothing":"yes","girth":0},
    {"redundant":"yes","girth":0},
    {"zero":"void","girth":0}
]
How do I sort it by increasing girth value, except for zeroes which should be at the end in no particular order ?

I can do:
Python code:
sorted(items,key=lambda x:x['girth'])
Which gives;
code:
{'nothing': 'yes', 'girth': 0}
{'redundant': 'yes', 'girth': 0}
{'zero': 'void', 'girth': 0}
{'gas carpal': 6, 'girth': 7}
{'worthy': 8, 'girth': 11}
{'carpet_cleaning': 30, 'girth': 18}
{'thermostat': 14, 'girth': 30}
What I'd like is:
code:
{'gas carpal': 6, 'girth': 7}
{'worthy': 8, 'girth': 11}
{'carpet_cleaning': 30, 'girth': 18}
{'thermostat': 14, 'girth': 30}
{'nothing': 'yes', 'girth': 0}
{'redundant': 'yes', 'girth': 0}
{'zero': 'void', 'girth': 0}

Kinda ugly but simple solution:
Python code:
big_number = 2**32 # just something bigger than the greatest possible girth
sorted(items, key=lambda x: x['girth'] if x['girth'] != 0 else big_number)
Golf variant:
Python code:
sorted(items, key=lambda x: x['girth'] or 2**32)

TheFluff fucked around with this message at 16:25 on Jan 8, 2019

NinpoEspiritoSanto
Oct 22, 2013




I solved it like this:

code:
items = [
    {"thermostat":14,"girth":30},
    {"carpet_cleaning":30,"girth":18},
    {"gas carpal":6,"girth":7},
    {"worthy": 8,"girth":11},
    {"nothing":"yes","girth":0},
    {"redundant":"yes","girth":0},
    {"zero":"void","girth":0}
]

desired_sort = [x for x in sorted(items, key=lambda x: x['girth']) if x['girth'] > 0]
desired_sort.extend([x for x in items if x['girth'] == 0])
Which gives:

code:
In [19]: desired_sort
Out[19]: 
[{'gas carpal': 6, 'girth': 7},
 {'worthy': 8, 'girth': 11},
 {'carpet_cleaning': 30, 'girth': 18},
 {'thermostat': 14, 'girth': 30},
 {'nothing': 'yes', 'girth': 0},
 {'redundant': 'yes', 'girth': 0},
 {'zero': 'void', 'girth': 0}]

unpacked robinhood
Feb 18, 2013

by Fluffdaddy

Oh yes thanks

TheFluff posted:

Python code:
sorted(items, key=lambda x: x['girth'] or 2**32)

Gotta admit it's both concise and not unreadable, gonna keep that in the comments just in case

ninepints
Sep 7, 2017
four and a half quarts
I like the following because the code lines up with the intent: we've got a comparison function that considers zero greater than anything else, and we're gonna sort using that comparison.

Python code:
>>> from functools import cmp_to_key
>>> def cmp(x, y):
...     if x == 0:
...         return 0 if y == 0 else 1
...     else:
...         return -1 if y == 0 else x - y
... 
>>> sorted([0, 1, 0, 2, 0, 3, 0, 4], key=cmp_to_key(cmp))
[1, 2, 3, 4, 0, 0, 0, 0]

Linear Zoetrope
Nov 28, 2011

A hero must cook
Out of wonder, in requirements and/or pipenv files, does ">=x.y.z" specify semver compatible or literally "any version later than this"? I see on the User Guide some examples like ">=1.0,<=2.0" so I'm guessing it's absolute version, not semver.

SnatchRabbit
Feb 23, 2006

by sebmojo
Can someone give me a hand with this for loop? I'm trying to build a json object from a large query using only tag that I've specified. The loop seems to work correctly but the return is only giving me the last object that I found when I know there are at least three objects that have the tag I'm looking for. I'm thinking the update on stacks is overwriting the dict. Anyone know whats up with it?

code:
import boto3
import json

def lambda_handler(event, context):
    client = boto3.client('cloudformation') 
    paginator = client.get_paginator('describe_stacks')
    
    entry = {}
    stacks = {}
    
    pages = paginator.paginate()
    for page in pages:
        for obj in page['Stacks']:
           tags = obj['Tags']
           for tag in tags:
            if tag != None and tag['Key'] == 'mykey':
                stackname = obj['StackName']
                stack = {'StackName' : stackname}
                tags1 = {'Tags' : tags}
               
                stack.update(tags1)
                stacks.update(stack)
                print(stacks)
                #stacks = {'Stacks' : stack}
            else:
               continue
    json.dumps(stacks)
    return stacks
  
     
 

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

dict1.update(dict2) basically adds all the key/value pairs from dict2 into dict1. So it'll overwrite any keys that already exist

Every stack you're adding has a "Stackname" key and a "Tags" one, so those values will just get overwritten each time. Sure you don't want a list of stack dicts? Or maybe a dictionary where each key is the name of a stack, and that maps to the actual stack dict, or something like that

baka kaba fucked around with this message at 23:50 on Jan 9, 2019

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
What's the best and most efficient way to deploy my Flask / MySQL API to a server nowadays? I basically just have a local MySQL server and Flask connecting to it with pymysql

Keep in mind I am very much a front-end developer, so I'd like to be spoken to as if I'm a child.

FWIW, I am definitely deploying with Linode if that makes a difference

teen phone cutie fucked around with this message at 04:02 on Jan 10, 2019

Adbot
ADBOT LOVES YOU

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Grump posted:

What's the best and most efficient way to deploy my Flask / MySQL API to a server nowadays? I basically just have a local MySQL server and Flask connecting to it with pymysql

Keep in mind I am very much a front-end developer, so I'd like to be spoken to as if I'm a child.

FWIW, I am definitely deploying with Linode if that makes a difference

I'd go with Docker.

A quick google shows a bunch of tutorial-lookin' results for "docker flask mysql".

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply