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
Thermopyle
Jul 1, 2003

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

Eela6 posted:

They used 'callable' as a synonym for in-place, so I assumed they meant 'mutable', given the example.

Yes, I know what you assumed, I'm pointing out that there's more than one way to read it so the poster doesn't get confused.

Adbot
ADBOT LOVES YOU

Eela6
May 25, 2007
Shredded Hen

Thermopyle posted:

Yes, I know what you assumed, I'm pointing out that there's more than one way to read it so the poster doesn't get confused.

Thanks!

QuarkJets
Sep 8, 2008

vikingstrike posted:

Anybody had any issues with PyCharm skipping over breakpoints when debugging? My Google searches have failed me, and it's getting super annoying because I can't figure out how to replicate the issues.

Only when I've accidentally Run the code instead of Debugging it.

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

Slimchandi posted:

When I was learning Python basics, it took me a long time to realise that when using a list comprehension, you can use any name in the for part.

I saw examples of [letter.lower() for letter in name] and assumed you hadto use letter if you were iterating through a string. :(

I always try to avoid doing callable/in-place stuff in a list comprehension eg [print(letter) for letter in name]. Is there any particular reason to avoid this? It seems to be more concise than the indentation of a for-loop.

As well as what people have said, print takes varargs anyway, so you can unpack an iterable like my example a couple of posts ago

Python code:
print(*[letter for letter in name])
that way you are generating a list, and then you're passing it to print so it can print each element, so the list is actually getting consumed and it makes sense

it might make more sense to use a generator comprehension instead though, since you don't really need the list
Python code:
print(*(letter for letter in name))
pipes each letter direct to the print function, feels good!

Cingulate
Oct 23, 2012

by Fluffdaddy
In this case,
code:
print(*name)
will do the same though.

Slimchandi
May 13, 2005
That finger on your temple is the barrel of my raygun
For clarity, I was referring to functions with side effects or return None rather than just callables. The given example was exactly what I intended.

It seems much more convenient than a for loop; is it just non-conventional or A Bad Thing?

Cingulate
Oct 23, 2012

by Fluffdaddy

Slimchandi posted:

For clarity, I was referring to functions with side effects or return None rather than just callables. The given example was exactly what I intended.

It seems much more convenient than a for loop; is it just non-conventional or A Bad Thing?
I actually asked this very same question in I think the last thread. For the record, I've since come to understand the thread was perfectly correct to insist that I use a list comp to create a list and otherwise just do an ordinary loop. Much more pythonic!

Remember, it violates PEP8, but you can even do
[code]for counter in iterable: function_with_side_effects()[/cod]
Without the line break.

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

Cingulate posted:

In this case,
code:
print(*name)
will do the same though.

Doh yes

Cingulate
Oct 23, 2012

by Fluffdaddy
I was a bit surprised
code:
print(name.split(""))
does not work.

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

I guess there isn't really a use for it since you can do *name, especially with the Python philosophy of having one way to do a thing. It would be more convenient if the separator was supplied from elsewhere, so you always get consistent behaviour, but hey


Slimchandi posted:

For clarity, I was referring to functions with side effects or return None rather than just callables. The given example was exactly what I intended.

It seems much more convenient than a for loop; is it just non-conventional or A Bad Thing?

It's convenient in the sense that a 2-line (or 3 with a conditional) for loop can be put on 1 line instead, or even more complicated nesting. It gets to a point where that might be less clear about what you're doing though

The problem is that list comprehensions generate a list, that's their whole purpose. When someone reads your code, and they see a list comprehension, they see you generating data, they don't see the side effects. You can argue that the clues are all there because a) you're not keeping the list and b) it's calling print() and everyone knows what that does, but that's not always necessarily true. The actual purpose of your code is implicit instead of explicit. (You're also actually generating a list full of Nones, which is grody garbage at best and might actually cause memory issues at worst)

Unfortunately Python doesn't seem to have any equivalent to forEach, where you'd have something like for_each(function, iterable) and it would explicitly call the function with each element, returning nothing. There's a consume recipe in itertools but that means it's not actually in the standard library, for reasons, and you'd have to put it in your own code somewhere. And that means you need to add your own iterable of function calls, like consume(print(c) for c in name) or consume(map(print, name)). Which is better, in that it's more explicit, but I think the plain for loop is more pythonic

If you do it a lot though, no reason you can't write your own utility function to make it super explicit and concise!

Dr Subterfuge
Aug 31, 2005

TIME TO ROC N' ROLL
map sounds like what you're talking about?

Cingulate
Oct 23, 2012

by Fluffdaddy

Dr Subterfuge posted:

map sounds like what you're talking about?
baka is, in fact, literally talking about map:

baka kaba posted:

consume(map(print, name)).

Buuuut why not just
code:
for thing in things: function(thing)
?

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

^^^ that's what I'm saying, in most cases that's probably the best way to do it

Yeah I used map in my last example - it returns an iterable though, you still have to consume it by iterating over it somehow

Personally I don't really like the semantics of that anyway - map is for transforming elements from one set of data into another set of data, so it produces some values. In this case you're still ignoring the results and relying on the side effects of the mapping function - like here's one way to consume that example I gave:
Python code:
for _ in map(print, "hallo"):
  pass
I mean it works, but it sucks. Functional languages tend to have functions that work like map (take a mapping function and a sequence of elements to run it on), but that explicitly don't return a value (or return unit, or whatever you want to call it). forEach, iter, they just immediately do the thing to each element and you know it's explicitly about the side effects

shovelbum
Oct 21, 2010

Fun Shoe
Hey I'm coming to Python from JS, this is just a hobby, I started that Think Python book and it is a lot of trying to make myself remember 8th grade geometry in turtle graphics form, does it get less tedious?

Dr Subterfuge
Aug 31, 2005

TIME TO ROC N' ROLL

Cingulate posted:

baka is, in fact, literally talking about map:

:doh:

Trying to python from my phone was a bad idea.

NtotheTC
Dec 31, 2007


I know a few of you guys run your python linux dev environments in vms due to being on windows machines out of preference or necessity...

Anyone have any experience with using Pycharm with docker / windows subsystem for Linux? My current place of work runs windows machines only but our app is switching over to docker containers on Linux and I'm looking for a way to develop on Linux without actually having to dual boot if possible.

Ahz
Jun 17, 2001
PUT MY CART BACK? I'M BETTER THAN THAT AND YOU! WHERE IS MY BUTLER?!

NtotheTC posted:

I know a few of you guys run your python linux dev environments in vms due to being on windows machines out of preference or necessity...

Anyone have any experience with using Pycharm with docker / windows subsystem for Linux? My current place of work runs windows machines only but our app is switching over to docker containers on Linux and I'm looking for a way to develop on Linux without actually having to dual boot if possible.

I`m lazy so I just run a bunch of VMs in Virtualbox and tell windows pycharm to remote control the binaries there with my code via remote interpreters. Works well enough for me.

Thermopyle
Jul 1, 2003

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

NtotheTC posted:

I know a few of you guys run your python linux dev environments in vms due to being on windows machines out of preference or necessity...

Anyone have any experience with using Pycharm with docker / windows subsystem for Linux? My current place of work runs windows machines only but our app is switching over to docker containers on Linux and I'm looking for a way to develop on Linux without actually having to dual boot if possible.

Yeah, you just configure remote interpreters.

There's plenty of Googleable advice on the subject.

Thermopyle
Jul 1, 2003

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

.

sofokles
Feb 7, 2004

Fuck this
Noob stuff i guess:

If I have a nested dictionary and a bunch of strings with nested keys on the form

“[‘Dic1’][‘Dic1.2’][’innerkey’]”

How can I use the strings to get at the value at innerkey? In other words

Outerdic [‘Dic1’][‘Dic1.2’][’innerkey’]

Obviously

Outerdic “[‘Dic1’][‘Dic1.2’][’innerkey’]”
Is not it

unpacked robinhood
Feb 18, 2013

by Fluffdaddy

If your dictionnary is declared like so :
Python code:
d={'akey':{'somekey':'value'}}
You can do
Python code:
d['akey']['somekey']

e: someone will probably give you a better answer

unpacked robinhood fucked around with this message at 18:22 on Feb 13, 2018

sofokles
Feb 7, 2004

Fuck this

unpacked robinhood posted:

If your dictionnary is declared like so :
Python code:
d={'akey':{'somekey':'value'}}
You can do
Python code:
d['akey']['somekey']

Yes I know, and that’s why I’m asking how I can use a string and a dictionary to the same effect.

I need to unpack the string somehow and pass it to the dictionary if you get what I mean.

Thermopyle
Jul 1, 2003

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

sofokles posted:

Noob stuff i guess:

If I have a nested dictionary and a bunch of strings with nested keys on the form

“[‘Dic1’][‘Dic1.2’][’innerkey’]”

How can I use the strings to get at the value at innerkey? In other words

Outerdic [‘Dic1’][‘Dic1.2’][’innerkey’]

Obviously

Outerdic “[‘Dic1’][‘Dic1.2’][’innerkey’]”
Is not it

Not sure I completely understand what you're asking here, but I think this is what you're looking for?

You have a dictionary:

Python code:
import operator
import re
from functools import reduce

the_dict = {
    'a': {
        'b': {
            'c': 'I want this value.'
        }
    }
}

the_string = "['a']['b']['c']"

key_map = re.findall("\w+", the_string)

def do_thing_with_dict(keys, the_dict):
    return reduce(operator.getitem, key_map, the_dict)
Using it:

Python code:
>>> do_thing_with_dict(key_map, the_dict)
'I want this value.'

Thermopyle fucked around with this message at 18:51 on Feb 13, 2018

sofokles
Feb 7, 2004

Fuck this

Thermopyle posted:

Not sure I completely understand what you're asking here, but I think this is what you're looking for?

You have a dictionary:

Python code:
import operator
import re
from functools import reduce

the_dict = {
    'a': {
        'b': {
            'c': 'I want this value.'
        }
    }
}

the_string = "['a']['b']['c']"

key_map = re.findall("\w+", the_string)

def do_thing_with_dict(keys, the_dict):
    return reduce(operator.getitem, key_map, the_dict)
Using it:

Python code:
>>> do_thing_with_dict(key_map, the_dict)
'I want this value.'

Thats what im after - thank you !

Reduce and operator.getitem did the trick

The re pattern wont work as there could be some weird symbols in some of the keys, but i can get the string to list by other means. But for the sake of interest, as Im no good at regex, what would a pattern be for capturing all instances in single quotes starting from left so that it would capture "'this',notthis'this'....notthis..'this', andnotthis" ?


I changed the do_things args a little :

Python code:
def do_thing_with_dict(keys_map, the_dict):
    return reduce(operator.getitem, keys_map, the_dict)
Thanks again

Cingulate
Oct 23, 2012

by Fluffdaddy

sofokles posted:

Thats what im after
Why? Why did you want to do that?

Thermopyle
Jul 1, 2003

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

sofokles posted:

The re pattern wont work as there could be some weird symbols in some of the keys, but i can get the string to list by other means. But for the sake of interest, as Im no good at regex, what would a pattern be for capturing all instances in single quotes starting from left so that it would capture "'this',notthis'this'....notthis..'this', andnotthis" ?


Pulled from my collection of regexs that I thought might be useful at some point:

code:
([\"'])(?:(?=(\\?))\2.)*?\1

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

That's some sweet reduce action

sofokles
Feb 7, 2004

Fuck this

Cingulate posted:

Why? Why did you want to do that?

As i said I'm a noob. :) . Using VBA a lot I instinctively grab a dict. Also my approach is probably not totally utilitarian.

I get some xml files from a supplier - that I need to clean up and transform into columnar data. They change in shape and form and exactly where, or how deep in, or under what tag, the data Im after sits - is unpredictable. So i flatten it as much as possible (cant flatten completely - wouild give duplicate keys).

Then i iterate over that and create a reverse lookup dictionary to provide the paths to the "inner" keys

Next the plan was/is to iterate over the first-level keys-values, and for each iterate over an ordered list of columns, and get the data values for each keypath that corresponds to a specific column and spit the resulting rows out to excel


Thermopyle posted:

Pulled from my collection of regexs that I thought might be useful at some point:

code:
([\"'])(?:(?=(\\?))\2.)*?\1

Thanks - tryingg out

sofokles fucked around with this message at 21:55 on Feb 13, 2018

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Is there a good article somewhere that goes through some of the idiosyncrasies of Popen? I'm sure anybody here that has used it many times in different circumstances have found little quirks based on things like the OS, how the application handles pipes, what happens with arguments, shell=True, etc.

I'm not talking "hurr look at the subprocess/psutil documentation hurr." I'm talking about contextual, system caveats that plague using Popen and friends for spawning and monitoring other processes and their output.

QuarkJets
Sep 8, 2008

Rocko Bonaparte posted:

Is there a good article somewhere that goes through some of the idiosyncrasies of Popen? I'm sure anybody here that has used it many times in different circumstances have found little quirks based on things like the OS, how the application handles pipes, what happens with arguments, shell=True, etc.

I'm not talking "hurr look at the subprocess/psutil documentation hurr." I'm talking about contextual, system caveats that plague using Popen and friends for spawning and monitoring other processes and their output.

I don't know of any such article, and while I'm sure one exists I will instead offer some recommendations from my own limited experience:

A) shell=True will actually launch a new shell, which you want to avoid if you can; it's going to almost always be possible to use the sequence form of Popen instead of just passing in a string and shell=True, so just do that. Basically you can just build your entire command string with arguments and flags as a list or a tuple and then pass that in as the first argument of Popen, bada-bing bada-boom

B) the stdout and stderr variables basically work like you'd expect, and if you want to read from them from within your Python session then there's the helpful subprocess.PIPE object. If you don't set stdout or stderr to anything then they'll just do whatever your stdout / stderr normally do (e.g. print to the terminal)

C) if your Popen object goes out of scope while executing, such as when you start a long-running Popen inside of a function and then that function suddenly exits, then Python will helpfully close it for you; be sure to do something like call Popen.wait() if you actually want to keep the process running until it completes

D) I only code in *nix so who the gently caress knows what a Windows environment is going to do but the same advice is probably all still true

SurgicalOntologist
Jun 17, 2004

Only things I would add to that are:

- you can usually just use subprocess.run as a convenience function (everything QuarkJets said still holds)
- if you are dealing with pipes with text instead of bytes you may need text=True. Older guides/posts may suggest unversal_newlines=True; these are the same.

I would also emphasize QuarkJet's point A. I would say you basically never need shell=True, but avoiding it just requires some understanding of what the shell does. Anything the shell is doing you can do more explicitly and securely in Python. For example, expanding wildcards you can use Path.glob or glob.glob; os.environ for environment variables, etc.

German Joey
Dec 18, 2004
I'm a very long-time Python user, but most of my experience has been with the 2.x line. I've used a few versions of 3.x, but mostly kept my code to be compatible with 2.x. However! I now have a job-interview coming up at a place that uses 3.6.

I was able to pass this place's take-home coding interview just fine (or at least, fine enough to get a callback to the on-site, heh) but I'm worried about getting asked to whiteboard something related to some more recent 3.x feature that I'm less familiar with at the on-site interview. Which feature? Who knows, well not me, and that's what I'm worried about! Thus, my question: is there something I can read that has an overview of important 3.x features? Are there any important 3.x-only libraries I should know about? Thank you in advance for your advice, fellow goons.

QuarkJets
Sep 8, 2008

German Joey posted:

I'm a very long-time Python user, but most of my experience has been with the 2.x line. I've used a few versions of 3.x, but mostly kept my code to be compatible with 2.x. However! I now have a job-interview coming up at a place that uses 3.6.

I was able to pass this place's take-home coding interview just fine (or at least, fine enough to get a callback to the on-site, heh) but I'm worried about getting asked to whiteboard something related to some more recent 3.x feature that I'm less familiar with at the on-site interview. Which feature? Who knows, well not me, and that's what I'm worried about! Thus, my question: is there something I can read that has an overview of important 3.x features? Are there any important 3.x-only libraries I should know about? Thank you in advance for your advice, fellow goons.

A number of the features added to 3.x were backported to 2.7, which is good. But there are cheat sheets for the remainder.

This python.org article is a starting point:
https://docs.python.org/3/howto/pyporting.html
Especially this section:
https://docs.python.org/3/howto/pyporting.html#learn-the-differences-between-python-2-3

It links to a number of documents cheat sheets, and here's another:
http://sebastianraschka.com/Articles/2014_python_2_3_key_diff.html

What does your new employer do?

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
I want to make multiple plots so that I can save and style them indivudually, and then I wanna be able to pass them into one master plot where I’d arrange them into some logical order, and then save that final one too. How would I do that?

Something like,

code:
# first figure
fig, ax1 = plt.subplots()
ax1.plot(...)
# style the plot
fig.savefig(...)

# repeat for ax2 and ax3

# this is the part I don’t understand
# define master_figure with a layout like this:
# ax1 ax1 ax1
# ax2 ax2 ax3
# ax2 ax2 ax3

master_figure.add_ax1_to_proper_layout_location()
# repeat for others

# each subplot would keep the sane colors, styles, limits as already defined
master_figure.savefig(...)
Just to be clear, each ax object should be saved as a full figure that takes up the whole page, and then when I pass it into master_figure it should just automatically resize and put it onto the proper grid location. Everything else wrt limits, markers, etc, should not change.

Boris Galerkin fucked around with this message at 13:32 on Feb 21, 2018

Cingulate
Oct 23, 2012

by Fluffdaddy

Boris Galerkin posted:

I want to make multiple plots so that I can save and style them indivudually, and then I wanna be able to pass them into one master plot where I’d arrange them into some logical order, and then save that final one too. How would I do that?

Something like,

code:
# first figure
fig, ax1 = plt.subplots()
ax1.plot(...)
# style the plot
fig.savefig(...)

# repeat for ax2 and ax3

# this is the part I don’t understand
# define master_figure with a layout like this:
# ax1 ax1 ax1
# ax2 ax2 ax3
# ax2 ax2 ax3

master_figure.add_ax1_to_proper_layout_location()
# repeat for others

# each subplot would keep the sane colors, styles, limits as already defined
master_figure.savefig(...)
Just to be clear, each ax object should be saved as a full figure that takes up the whole page, and then when I pass it into master_figure it should just automatically resize and put it onto the proper grid location. Everything else wrt limits, markers, etc, should not change.
code:
fig, axes = plt.subplots(n_columns, n_rows)

axes[0, 1].plot(something)
axes[1, 3].scatter(*data)
fig.savefig(name)
Like this?

mr_package
Jun 13, 2000
Using RQ what is the best way to create multiple workers? I'm not so familiar with systemd, is there a simple way to configure this? I kind of wish it was just built-in the way you can specify number of workers when launching gunicorn, for example.

This seems like it's probably the best of the simple options, that I can find; would you follow it? https://serverfault.com/questions/730239/start-n-processes-with-one-systemd-service-file/878398#878398

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
No that's not what I meant.

Say I create my first figure,
code:
fig1, ax1 = plt.subplots()
ax1.plot(np.linspace(0, 1), np.sin(np.linspace(0, 10)))
ax1.set_xlabel('sin()')
And then a second figure,
code:
fig2, ax2 = plt.subplots()
ax2.plot(np.linspace(0, 1), np.cos(np.linspace(0, 10)))
ax2.set_xlabel('cos()')
I would now like to create a third figure, using the existing ax1 and ax2 objects (with all the colors, formatting, labels, tick marks, etc, all as-is), but with a custom layout,
code:
fig3, ax3 = plt.subplots(nrow=1, ncol=3)

# I want ax1 to span 2 columns, and ax2 to span 1:
ax3[0:2].set_from_existing_ax(ax1)
ax3[2].set_from_existing_ax(ax2)

plt.savefig(fig3)
In my mind, I am not making a new plot for figure 3. I just want to take the existing ax objects, and put them into fig3, in the proper layout location, with all data labels, markers, colors, etc, exactly how they were in figs 1 and 2. I'm aware that the plots themselves will stretch/distort to fit the layout, but that's fine.

e: In the end, I want 3 saved figures. figs 1 and 2 are full sized pictures of my sin and cos plots, and fig3 has those same plots stretched to fit into the layout I defined in fig3.

It's my understanding that a figure object is just a container for axes objects, and an axes object is a container for curves, labels, markers, etc. So I feel like creating a figure object from existing axes objects should be a thing?

Boris Galerkin fucked around with this message at 18:47 on Feb 21, 2018

Cingulate
Oct 23, 2012

by Fluffdaddy
You can try this stackexchange answer:
https://stackoverflow.com/questions/6309472/matplotlib-can-i-create-axessubplot-objects-then-add-them-to-a-figure-instance/46906599#46906599

But my suggestion would be to write a function that creates your axis, and give it an axis parameter. Then you call it once for its own figure, and another time for the joint figure. Much less awkward.

Thermopyle
Jul 1, 2003

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

mr_package posted:

Using RQ what is the best way to create multiple workers? I'm not so familiar with systemd, is there a simple way to configure this? I kind of wish it was just built-in the way you can specify number of workers when launching gunicorn, for example.

This seems like it's probably the best of the simple options, that I can find; would you follow it? https://serverfault.com/questions/730239/start-n-processes-with-one-systemd-service-file/878398#878398

Probably more of a Linux question then a Python question. I'd try the Linux thread.

Adbot
ADBOT LOVES YOU

mr_package
Jun 13, 2000
Yeah I just figured if there's any RQ-specific gotchas or advice there might be people with experience on it here-- RQ was recommended to me several pages back, and the docs straight up say if you want concurrent work you need to spawn multiple workers, so this is a problem anyone who's deployed it will already have solved. It's weird that there's no detailed info about this either in the docs or even in google searches; it would be pointless in most cases to only run a single worker. But sometimes that just means the simple solution is the one to use, and worker@01 / worker@02 / etc. seems to be a common enough systemd paradigm I'll just try that.

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