« first day (3153 days earlier)      last day (1805 days later) » 

wim
12:13 AM
@AndrasDeak 11 years before you were born, then?
 
12:28 AM
:|
Oh I get some more of it, group/grape.
 
@PM2Ring historically, "an" precedes all words starting with an h regardless if it's silent or not, no? "an historic" for example is extremely common
Ah, looks like in the past, because "historic" has a stress on the second syllable, the first unstressed "h" can be almost inaudible and thus "an historic"
So it wasn't all words starting with an H. Just certain ones that changed from a pronounced H to a now pronounced one...
 
12:47 AM
@U9-Forward While I appreciate your enthusiasm to answer, I would take wim's advice and refrain from posting unless you're sure you have something to add that hasn't already been covered or is relevant to the topic being discussed. PS, not that it matters, but the downvote isn't from me.
 
 
1 hour later…
1:52 AM
@cs95 Deleted it
 
it's your decision in the end but you've done the right thing, IMO
 
cbg
@cs95 Yeah
 
 
1 hour later…
3:17 AM
Adding a "Comments on Other Solutions" wasn't something I knew you could do, but it turns out you can (and should)
 
3:42 AM
@cs95 Do you have a link to illustrate what you mean?
 
@PM2Ring This answer by Aaron hall has a blog post on critiquing other answers. In the same spirit, I've done something similar with this answer of mine here, although I've kept the tone a little more neutral by critiquing the solution itself, rather than the answer(er).
my initial approach was to facepalm my keyboard repeatedly writing comments under other answers until I realised I could just edit my answer and forget about it after.
 
I sometimes compare my solution to the other answers, but it can be hard to do it without it looking like you're attacking the author, unless you use very neutral & diplomatic language. But if their code has big problems, then they need to be pointed out. Usually, I don't bother going into details, I just post timeit code that illustrates my point. ;) But sometimes, it's not a question of speed, but one of style, readability, and / or extensibility, and a timeit test can't show that.
 
yes, I believe there is still scope to the old questions to add answers which discuss the advantages and pitfalls/style issues with the existing solutions.
performance is one aspect you can measure, but you can't measure pythonicity
(pythonicness?)
 
I prefer "pythonicity".
@cs95 Nice work. I spotted 1 typo: maninly. And last time I looked, sets don't preserve insertion order.
 
4:05 AM
Thanks for the tips! re:sets, should've cross checked, I had the behaviour confused with dicts.
I was actually under the misconception that sets would preserve ordering because they work like dicts under the hood.
 
@cs95 They started out being very similar, but they've diverged a bit, but AFAIK, the core hash table stuff they do is identical.
 
ah, good to know.
 
Dict just has a bit of extra machinery so it can link keys to values. I have read how keys, values, and hash table entries all tie together, but it's kind of faded from my memory. ;)
My biggest "compare & contrast" answer was a necropost to a 5 year old question about counting inversions in a list. stackoverflow.com/a/47845960 It's so large that I had to put the timeit results in a separate answer. :)
 
4:33 AM
@PM2Ring that timeit answer is incomprehensible. If and when you have the time, might I suggest converting it into a graph? I used to do all the setup myself through pandas, but now I just use perfplot, it's literally one line of code to run the benchmarks. Here's an example gist.
 
4:49 AM
@cs95 I guess it is a bit dense... With perfplot, what's the random stuff in the setup for?
 
@PM2Ring When setting up your input, you'll need to specify n_range and setup. n_range as you've guessed lets you specify the different values of N (usually in increasing order of magnitude) that your various functions will be run on. setup lets you create your actual input using the previously specified values of n. The GitHub page has more usage examples.
For example, to measure the performance of some list comprehension, I would use n_range to specify the sizes of N to be [1, 10, 100, 1000], and then using setup, I would actually create random input lists of the specified size (1, 10, 100, or 1000).
the tricky part is when your kernels require multiple inputs. your setup function will return a tuple and your kernels will have to accept that tuple as an argument and unpack the arguments before using them.
small disclaimer: perfplot can only support upto 12 (or somewhere thereabouts) kernels or so (I think it runs out of colors, or whatever)
 
@cs95 Ah, right. I forgot you were processing random lists. :oops:
 
perfplot is exclusively used in this answer on list comprehensions in pandas to generate some 9 plots
 
A 12 kernel limit is tolerable. Too many lines could get confusing, unless the lines don't cross.
 
very handy and relatively small code footprint (I didn't get paid to advertise, I just like the module a lot, lol)
 
wim
5:03 AM
@cs95 Just because Aaron Hall does it, that doesn't mean you should do it
 
@wim Lol, I did it because I thought it was a good idea and a way to get the point across easily, not because he'd done it too. I cited his post as an example of an overkilled way to it, so in a way I agree with the point I think you're trying to make
I'm well aware of the consensus on Aaron's deep dives :P but much as you hate it, his formula works
(most of the time)
I know there's such a thing as "too much information" and with my posts I've slowly been learning where that line is drawn
 
wim
This one is not so much about "too much info". Personally I find it kind of distasteful to critique other answers.
 
I'm completely with you there. Which is why I'd rather critique the solution myself, without pointing fingers at the answer. It's really the same as a comment or downvote, imo
 
wim
On a practical note, an answer should be able to stand alone on its own (for a similar reason we don't encourage to link to offsite blog posts, pastebins, etc) since the other answer(s) could disappear or be edited without warning
 
Rather than "@xyz said you can use list.__len__() to find the length of a list, which in my humble opinion, is complete hogwash" instead say "yeah, dunders suck man"
gets the same point across without hurting as many feelings
 
5:15 AM
@wim Fair enough. But if an answer is promoting bad technique, it's good to explain what's wrong with it. But I said my piece on this issue up there.
Of course, if you do point out flaws in other answers, you need to be 100% certain that you've got the facts straight. And preferably have some supporting evidence.
 
@wim Still counts as an assignment in my book
 
wim
@PM2Ring I agree, but the right place for that is a comment under the bad answer. Then the user will get a notification about it and has the chance to edit/address it or offer some rebuttal. If you're just putting such content in your answer they might never even see that.
 
5:35 AM
@wim Ok. That's a good point. But sometimes the whole approach is flawed, and they can't fix it without using a different approach. And that could turn their answer into a clone of another answer (maybe of your answer).
And their approach might seem reasonable, and even obvious. So somebody needs to point out why it's undesirable. And that sort of info belongs in answers, not comments.
 
wim
huh what the heck is DynamicClassProperty How to create a self-referential Python 3 Enum?
sorry DynamicClassAttribute
yeah I'm reading that
 
@wim Yammed if I know. Also, what's "flansh" mean? stackoverflow.com/a/56437617/4014959
 
wim
5:50 AM
flansh, also a good question
 
6:00 AM
Olivier's answer has list(RPS). I don't know enum, but I assume that creates a fresh list every time the property is accessed.
 
@PM2Ring It's german, and very colloquial. It can probably be translated with "fenaggle".
 
wim
@PM2Ring it does, but that doesn't particularly matter
more important is that OP specifically wanted for ROCK.value == "rock" and using integer values in order to have indexing departs from that
anyway this is an interesting question with a good diversity of answers. surprised nobody did it with a class decorator yet.
 
@Arne added a comment
 
@tripleee should I just paste my translation? I'm not too sure fenaggle is a common word
 
i speak german and dont know the word, neither does google...
and cbg
 
6:15 AM
cbg
he dropped the c from Flansch and verbed it
 
wim
@Aran-Fey is this your book? docs.python.org/3/reference/… :)
 
@tripleee he edited it, translation crisis averted =)
 
@Arne I think you mean "finagle", although that has connotations of unlawful behaviour.
 
@wim Nope, that's just a chapter in my book. But isn't that grammar incorrect? () = '' isn't valid syntax according to that spec, is it?
 
@Aran-Fey this, then? docs.python.org/3/reference/…
 
6:23 AM
Yeah, that's it
 
wim
puzzle could be updated to "without binding a name"
 
@PM2Ring didn't know that, thanks
 
I'm... not sure if rephrasing it would make it more correct. Don't type hints also bind the name?
 
wim
no they don't
 
alright then
 
6:32 AM
@trip who would have thought. It might be german - I was under the impression it has something to do attatching somthing to some other thing: here (german) - in english it would be flange. Reworded answer. — Patrick Artner 10 mins ago
 
wim
>>> def f():
...     x: int
...     y = 1
...
>>> f.__code__.co_varnames
('y',)
 
@Arne I guess the connotation is "devious", but not necessarily dishonest. But there's definitely a sense of exploiting loopholes.
 
then my translation would have been a bad fit. As it seems, the connotation for flanschen is "attaching, but in a mac gyver manner". I don't know a english word for that =D
 
7:00 AM
i might have asked before, not sure, but what are your experiences with zeromq vs just using sockets?
 
@Hakaishin that's pretty much a "what's the difference between apples and oranges" like question?
 
Really? Based on what I read and heard zeromq does pretty similar stuff like I do with sockets.
 
sure... it uses sockets... but so do a lot of things :)
 
7:44 AM
@Hakaishin sockets with redundancy, priorities, persistence across restarts, queue management etc
i.e. not at all the same thing
it's like saying bytes and XML are the same thing
 
Webbrowser.open module does not show the web page when the *.py script is called in html code. is there anybody who knows the solution..?
 
@YangelyatOsman unclear what you are asking
 
@tripleee Yeah, that's kinda what my program does too, that's why I thought they are similar, but I guess that's just my use case. But I kinda assumed that this use case is common
 
The winner of the most overly-complicated and unnecessary code for today has to go to this one... not only is it completely contradicting itself... it's also just... wow...
 
7:58 AM
depends on what you need it for
if you goal is to send data from A to B, they are effectively the same
if you need any of the extra goodies, zeromq does them better than any custom code glued on top of a socket
personally, I usually just use TCP sockets since dependencies are hell to install for my use cases
 
@tripleee I have html code which calls a python script file. I want that script to open www.google.com by using webbrowser.open () module but it does not.
 
hi can you guys explain this
regx3.sub(r'[1|\1]', line)
 
It was written by a potato who had no clue what they were doing. No point trying to explain it
 
even tho top one work fine bellow one not working
def replacement(match):
return '[{}| \1 ]'.format(next(counter))
 
haha, written by a potato might just be my favourite new expression
 
8:05 AM
\1 is working perfectly if i use directly in re.sub
 
what are you trying to do?
can you provide example inputs ?
 
but if i want it work bellow code it not working
import re
from itertools import count

regx3 = re.compile('@@@(.*?)@@@')
counter = count(1)

def replacement(match):
            return '[{}| \1 ]'.format(next(counter))

line = regx3.sub(replacement, line)
 
First of all, '\1' is different from r'\1'. And secondly, backreferences are only automatically replaced if you pass a string to re.sub. If you pass a replacement function, you have to do it manually.
 
line = regx3.sub(r'[1|\1]', line)
this is work perfect
 
@JonClements I think he's counting chars, not lines. And not including the newlines. But at the end he prints "Total Length of words are". I assume the files are UTF-8, or some other multibyte encoding...
 
8:12 AM
def replacement(match):
    return '[{}|{}]'.format(next(counter), match.group(1))
 
thanks
 
@PM2Ring oh okay... that might be inline with their description of "sum of chars"....
 
let me try
@Aran-Fey thanks it is working perfectly
 
@YangelyatOsman there is no way for HTML to call any code at all, HTML is a markup language
do you actually have PHP insise the HTML or something like that?
or HTML inside Python by way of Jinja2 or ...
 
@JonClements I am always amazed at the willingness of people to throw parallelism at completely sequential bottlenecks...
 
8:18 AM
@JonClements Hang on. He's using Python 2, so open doesn't give him automatic UTF-8 decoding.
 
@tripleee I have form tag inside html which posts the parameter to python script via action attribute. The script reads the parameter and pass it to webbrowser.open module ..is it clear..?
 
What, you have a form like <form action="my_script.py">?
 
@Aran-Fey exactly ..
 
And... my_script.py is located where? On the server or on the user's PC?
Because what that does is open the URL https://your-website.com/my_script.py. It does not start the python script. It sends a HTTP request.
 
and where is webbbrowser.open() in this? in the script on the server which the HTML form submission connects to?
 
8:28 AM
I have localhost xampp it is located there
 
Okay, let's back up: What you're trying to do doesn't make any sense
 
If the script is on the user's PC, then it's impossible to run it because it'd be ridiculous if websites could run programs you have on your PC
If the script is on the server, you have to configure your HTTP server so that it starts the script when a particular URL is accessed.
 
You mean I need to run it a http server otherwise it wont run...?
 
Uh... you need a http server anyways. You're writing HTML. How are you planning to serve your HTML without a server?
 
8:40 AM
I have apache server on my computer that is running as localhost..?
 
is that a question or a statement
 
It serves well but for this case it does not give output
 
Ok. I don't know if apache can do that, but you have to make it execute your python script when it receives a POST request to https://your-website.com/my_script.py.
 
@ParitoshSingh a statement
 
@Aran-Fey Sure, you can configure Apache to run a Python CGI script. But it's been a few years since I've done it.
 
8:46 AM
@PM2Ring how..?
 
@YangelyatOsman You need to read the Apache docs relating to CGI configuration. And put your Python CGI script where Apache wants it to live.
 
i think first things first, python doesn't just "run" out of the box. if you're clear on the difference between server and client side operations, you'll have an easier time
for turning a python into a cgi script, you need to add some kind of header at the top that the server can interpret as "cgi" with an executable path pointing to python, iirc
 
@YangelyatOsman However, you also need to learn more about how CGI works if you want to do this. I can't conceive of a sensible reason for putting webbrowser.open() in a CGI script.
Or just forget about doing low-level CGI, and learn a more modern way of creating a dynamic website.
 
I was going to say... if you're starting out now - don't even consider touching CGI :)
 
@JonClements why..?
 
8:52 AM
'cos it's 2019 :)
 
people still learn assembly in 2019, just saying...
 
@PM2Ring I'm sure letting other people start a web browser on your server is a good idea
 
@YangelyatOsman Ok. I just had a look at your question from yesterday. I assume you've read the docs for the cgi module. Are you using Python 2, or Python 3?
 
if windows, i can atleast vouch for the fact that you do not need to set execute permissions explicitly on the cgi file itself.
however, i wonder if you needed to mark a folder in apache configs as allowing executable files with certain extensions
i do not quite recall, fuzzy memory
 
@PM2Ring It is python 3.7
 
8:57 AM
i suppose first things first
are you able to run any cgi scripts at the moment?
 
@ParitoshSingh sure
 
this will be a lot easier to figure out if we can eliminate that
oh! okay!
 
I can run many cgi's in my localhost, but only this does not
 
@YangelyatOsman Oh, good. Python comes with a very simple Web server. docs.python.org/3/library/http.server.html It is not designed to be used on the open internet, so it has almost no security. But it's very easy to set up, and it can easily do CGI with Python scripts. So you can play with it on your computer or your private LAN.
But you need to know what you're doing! Even 10 years ago, it was hard to find good tutorials on the Net about CGI. These days, I bet it's close to impossible.
 
@PM2Ring Thanks I will try that
 
9:03 AM
@YangelyatOsman even better - start with a micro-framework such as flask - you'll find that extremely easy to get going quickly and it'll scale instead of Python's BasicHttpServer...
 
HTTPServer doesn't even do anything... what kind of security holes can it possibly have?
 
@YangelyatOsman Good luck! Read the Python docs for the cgi module several times, and test all the example code. There are some answers on SO about CGI, even a few involving Python, but they're pretty rare.
 
Any idea what this could be? I'm receiving it over a serial port: b'6\xb3\xef\x90\x80\xd8\xfc'
 
@Aran-Fey ah, the no code philosophy
 
@Hakaishin I imagine it's data from the device connected to the serial port in a format that the device's documentation defines somewhere? :)
 
9:07 AM
hahaha device documentation :D
 
@Aran-Fey It's not that bad. :) You can run it like python -m http.server --cgi 8000
 
I mean, sure, the SimpleHTTPRequestHandler and CGIHTTPRequestHandler might have some holes... but surely there's no risk in using the server itself and/or BaseHTTPRequestHandler?
 
If you want to see a truly minimal http server, I've got one I wrote in awk, that's only a couple of dozen lines. It doesn't do CGI, but it can serve text & images, and give a directory listing.
@Aran-Fey Probably not. But like any dev server, they aren't intended to face the internet.
I don't know what an attacker could do with the base server. But the docs have a big pink warning up the top.
 
I actually use the HTTPServer in all my modules that have to go through OAuth2 authentication, hence the question. It only runs for a minimal amount of time, but it still sucks if I'm exposing myself to danger by doing that
 
@Aran-Fey Ah. In that case, you should ask someone who knows more about security, and about that module, than I do.
I used the old Python 2 equivalent quite a few times, but never in a situation that exposed it to the real internet. Most Linuxes come with one or more http servers that are certified safe for production use. Some of those are quite light-weight, but powerful enough for small loads.
One nice small but powerful server is thttpd, created by legendary coder Jef Poskanzer.
 
9:35 AM
Here's a fork of thttpd that does SSL: github.com/troglobit/merecat/blob/master/README.md
 
seems to be good at serving files, but I need to execute python code :(
 
@Aran-Fey I've used thttpd to serve CGI scripts.
 
9:59 AM
cbg
 
wut, since when does python have typed functions?
 
@towc 3.5
 
damn
 
@towc I am pretty sure that you're in a lower version :P, you can't have f-strings either since it comes in 3.6 if so
 
Not really typed. They're called "hints" for a reason
 
10:05 AM
@U9-Forward you what now
I can use f-strings
and typed functions
 
@towc Ow... that means you also have another version, if not why dlo you say "damn"
 
Because he just learned about the feature
 
^
 
@towc and yeah, what andras said, they're hints and not assertions. So they won't influence python's behavior during runtime at all. But third party tools like mypy or your IDE can use them to make a code analysis
 
oh
huh
that's neat
 
10:09 AM
check the pep for specifics
 
am
 
Hello I have a small question
 
oh, I need one of those. I can exchange them for one answer, it's all I have
deal?
 
using "pandas" is the cost to read an xlsx file greater than that of csv?>
 
just try it
 
10:15 AM
I'm not sure how much I want people to start using type hints in python
it kind of destroys the whole quick and dirty philosophy
but I guess python is getting used in big projects now, so this isn't bad for that
 
it's being used in big projects since a long time
 
haha yeah
 
well, not in any codebase I've seen
before the one that made me find out about it today, I guess
 
...
 
Any idea what would be a good way to write a tool in python, which with I can display such a system?
I thought of Django and make a background graphic and overlay buttons and displays, but this seems clunky, I wonder if there is a library for this kind of stuff
Basically it is a fluid system and I want to display pressure values and be able to open valves
 
10:21 AM
so then it becomes an interactive chart right?
 
yes
 
@towc lot of people hate the concept
 
for charts I would recommend using d3.js as it is highly customizable
but there is a hefty learning curve
also python has some chart libraries but the ones I have used render the charts as canvas on the front-end and that makes it un-interactive
 
@AndrasDeak you mean type hints in general or how typing and related tools work?
 
@Aqua4 canvas can be interactive
 
10:37 AM
@MisterMiyagi type hints in general
 
@Hakaishin You could display that with GraphViz. It's not exactly designed for interactive networks, but some interaction is possible with some of the output file types, like SVG, and once you have the SVG I guess it wouldn't be too hard to add more interactivity to it. If played with simple static GraphViz a bit. And I've done some static & animated SVG, but I've never tried to do anything interactive with it.
@Hakaishin But I just found this Python pipe network analysis toolkit, and it uses GraphViz for display. github.com/apthorpe/jeppson-python/blob/master/README.rst
GraphViz is mostly used for displaying connected graphs. It has several layout engines that mostly do a good job of figuring out where to put the nodes & edges of a graph. But you can also specify the exact locations of any of the graph elements.
 
@towc
sorry i did not know it until now
i would use canvas if the chart is too big i.e. too many elements to be plotted ... Since the case is different here,, SVG would be easy to use and would totally suffice the use-case
 
@PM2Ring Awesome, thanks I will check it out
 
The core GraphViz programs read in a plain text file describing the graph, in the DOT language, and output the results in any of a bunch of vector graphic or bitmap files, or as a new DOT file with all of the computed layout info. So if you like working with CLI programs that read & write text files, you'll feel at home with GraphViz.
The core programs have no GUI input, although they can output directly to a window, instead of writing a file. It's been around for years, so there are now quite a few GUI programs that use GraphViz for the heavy lifting. And there are a few Python libraries that use it.
 
10:53 AM
hmm, i dont really like cli. but let's see what there is
 
@Aqua4 SVG is probably the most sensible choice for vector graphics these days. Every modern browser displays it. It has some quite powerful animation features, but you can add more with JavaScript. It can also be used in conjunction with CSS.
 
@PM2Ring as per your suggestion I would prefer clubbing it with css and js to make the best of it'
 
11:33 AM
is there a function in matplotlib which i can pass x, y data and it generates an image similar to this one, which mean and std bounds?
 
11:50 AM
quite old though, could be more tools these days
 
yeah i found it thanks.
 
@Hakaishin how are you planning to attach functionality along with the matplotlb?
 
oh, no this is another project. Just displaying stuff.
 
12:11 PM
cbg
 
cbg
 
12:31 PM
How can I align entries in a multi line string like this one:
"""Measurement points       {}          Mean Velocity Dev. (km/h)       {}
Measurement Rate (%)        {}          Std. Dev. (km/h)                {}
Limit mean + 3 * std        {}
"""
Because when I print this I get this unaligned output:
Measurement points       10          Mean Velocity Dev. (km/h)       12
Measurement Rate (%)        0          Std. Dev. (km/h)                0.3
Limit mean + 3 * std        0.6
 
i believe its called justification. ljust and rjust should help.
you might have to tweak some numbers till you get it right
 
:(
 
as in, you might need to construct the string one line at a time i think
alternatively, you'd need to process it one line at a time and apply the rules.
 
yeah, with ljust yes, but this sounds surprisingly manual
 
"""\
Measurement points          {}          Mean Velocity Dev. (km/h)       {}
Measurement Rate (%)        {}          Std. Dev. (km/h)                {}
Limit mean + 3 * std        {}
"""
 
12:34 PM
does not work
 
oh, that does work for me though
 
hmmm ok, it does work in the python console, not in a subplot axis title
odd
 
When you need to display numeric values in a table, plan on using the formats for ints and floats. For instance: "{:8.3f}".format(numeric) will always display an 8 character wide field, with 3 decimal places.
 
that does not solve my problem though
ok, i just inserted spaces manually...
 
now that doesn't solve your problem
 
12:39 PM
how do you mean?
 
unless you're talking about the 3 missing spaces after "Measurement points"
 
Well, for those specific values, it probably does. Unless the values change, like if measurement rate exceeds 9%, or > 99 measurement points are collected.
Is this a tabs-vs-spaces issue?
 
you can't manually insert spaces so that the values are always aligned correctly. What if you have 100 measurement points instead of 10? Or 9?
 
they start aligned, but don't end aligned. I guess it's better than nothing ¯_(ツ)_/¯
ok, nvm you are right it does not start aligned in the following lines
 
In my KevinScript project, I have a pretty printer that automatically aligns tabular data like this. it puts everything in a grid composed of pipes and hyphens and stuff, but that's easy enough to change if you just want the data sans decoration
 
12:42 PM
man this is so annoying
Cool, I might come back to this. For now I will leave it ugly
 
If only there were a way to consistently show the numeric values with a predictable number of digits, then the spaces could always be the same
 
fairly sure there's some python library out there that makes creating tabular like data fairly easy...
 
data = [
    ["Measurement points", 999, "Mean Velocity Dev. (km/h)", 4],
    ["Measurement Rate (%)", 8, "Std. Dev. (km/h)", 15],
    ["Limit mean + 3 * std", 42, "", ""]
]

data = [[str(item) for item in row] for row in data]

print(grid_print(data))
#result:
#+--------------------+---+-------------------------+--+
#|  Measurement points|999|Mean Velocity Dev. (km/h)| 4|
#+--------------------+---+-------------------------+--+
#|Measurement Rate (%)|  8|         Std. Dev. (km/h)|15|
#+--------------------+---+-------------------------+--+
 
thanks, but I'm too annoying to bother more with this right now.
 
I used to like plusses and dashes, and more recently there is a package that will use the ANSI or Unicode line drawing characters instead, but now it just ugly clutter to me. Just whitespace please. Does grid_print have such an output option?
 
12:49 PM
Ummm... tabulate seems to work
Using print(tabulate.tabulate(data, tablefmt='plain')) gives you:
 
what's tabulate?
oh
 
Measurement points    999  Mean Velocity Dev. (km/h)  4
Measurement Rate (%)    8  Std. Dev. (km/h)           15
Limit mean + 3 * std   42
It's a module on pypi...
 
Ahh, my eyes are soothed...
 
Leaving the fmt off give you:
 
AttributeError: 'str' object has no attribute 'tabulate' #derp.
 
12:50 PM
--------------------  ---  -------------------------  --
Measurement points    999  Mean Velocity Dev. (km/h)  4
Measurement Rate (%)    8  Std. Dev. (km/h)           15
Limit mean + 3 * std   42
--------------------  ---  -------------------------  --
and then you've got other options that use unicode characters or the +| style stuff etc...
it's got a github option as well... must remember that - that could have come in quite useful in the past...
 
Can someone remind me again why this doesn't work:
class A:
    x = 1
    class B:
        print(x)
 
is the second class supposed to be a def?
 
No.
 
@JonClements thanks, this looks nice. Just weird that the first data column is right aligned and the second one the numbers are left aligned
 
Perhaps I should clarify since "doesn't work" is infamously vague. Why does this crash with NameError: name 'x' is not defined on the line print(x)?
 
12:57 PM
@Hakaishin It might be that since it's not completely tabular and since not all elements that would be in that column if it were are integer like the first one - then it determines it's not something that should be right-aligned and keeps it left aligned...
(you'd have to look at the code I guess...)
 

« first day (3153 days earlier)      last day (1805 days later) »