« first day (3471 days earlier)      last day (1480 days later) » 

2:53 AM
@PM2Ring I didn't see where it was used as a dupe target. Anyway I think yatu's fixing of the title was fantastic and very necessary
 
 
3 hours later…
@AndrasDeak is my question wrong?
 
What is the use of collections.UserList or collections.UserString class?
 
@G.Lakshmi I have told you so many times, and I have trashed your messages so many times. I'm telling you as a room owner to stop asking questions here! Any question. You can't use the help you are given, you need to learn the basics of the language first. Read a tutorial. This is the last time I'm explaining this to you. Your pattern of asking confusing things for an hour without any progress is a burden for the room. It's enough. Ask for help elsewhere. I can't be any more clear.
@LordOfThunder have you looked at the docs yet?
 
@AndrasDeak Yes I learnt the basics of django though documentation Ok sorry if I did anything wrong asking the question
 
@AndrasDeak Yes, in docs it's written that these are wrapper classes over the usual list or str class. But does not mention when to use and why we need these
 
6:09 AM
@LordOfThunder really? Up top I see "wrapper around list objects for easier list subclassing", and down on the class I see
> This class acts as a wrapper around list objects. It is a useful base class for your own list-like classes which can inherit from them and override existing methods or add new ones. In this way, one can add new behaviors to lists.

The need for this class has been partially supplanted by the ability to subclass directly from list; however, this class can be easier to work with because the underlying list is accessible as an attribute.
I think it was historically difficult/broken to subclass built-in types. This works better now but these helper classes were left, and offer some advantages such as the .data attribute on UserList
 
@AndrasDeak Ok, now making some sense for me :-) can you tell me what do we mean when we say wrapper? I used to think that we can directly override methods of list class and create a new sub-class
 
Lingusitically speaking a wrapper is something thin you package other stuff in, like a piece of candy in a plastic wrapper. In programming a wrapper means an object that "covers" another with additional functionality or slightly altering its behaviour.
 
OK
Is there any reason for which we don't have the authority to directly create new sub-class from the list class itself?
 
I don't know enough about this section of python to be able to help. It might be harmless to subclass it in modern python, or they may be unexpected pitfalls due to how certain things work in python. Hopefully someone more experienced will come along and will be able to answer.
 
Ok, thanks :)
 
6:20 AM
Sep 20 '18 at 6:23, by Aran-Fey
Subclassing builtins is always a bit risky... none of them are good parents
I have vague memories like that ^
 
6:33 AM
Looking at the source of UserList, I don't see any advantage inheriting from it over a regular list. It will behave different when overriding special methods (e.g. __getitem__) but probably not any more intuitive.
E.g. if you override __getitem__ , basically you trade having to call super().__getitem__(i) for directly calling self.data[i].
@LordOfThunder with the exception of some very niche types (e.g. slice), builtin types can be subclassed just fine.
 
As the docs hint at, historically that wasn't always the case. That reason is gone since Python 2.2
The old docs have some more information on this.
The only actual "use-case" listed there is multiple inheritance with another builtin type of different layout, which isn't possible otherwise.
For example, class CharList(UserList, str): ... is valid but class CharList(list, str): ... fails (the memory layout of the built-ins is not compatible).
 
6:52 AM
Ok
@MisterMiyagi What is the meaning of "the memory layout of the built-ins is not compatible"? :)
Thanks, it makes the use more clear to me :)
 
7:09 AM
@LordOfThunder Are you familiar with structs, as used by C or similar languages? Or Python's __slots__?
 
@MisterMiyagi Yes, I have used structs in C, but haven't used __slots__
 
Okay, so a C struct implies a memory layout for its fields – most importantly an ordering.
So if you have a struct of, say, {int a; int b; int c;}, then in-memory a, b and c are stored in that order.
 
The layout of that struct is compatible with shorter and longer variants. E.g. you could cram it into {int a; int b; int c; int d;}
The important part is that changes are only possible after the common block. A struct {int a; int b; int c; char d;} would match the initial one, but a struct of the form {char alpha; int b; int c; int d;} would not.
 
Ok, can you tell me which book will be best for learning Object-Oriented Design patterns in Python?
 
7:19 AM
Python's builtin types are represented by C structs (in CPython), which contain methods and data.
These structs are generally not compatible.
 
Ok, now getting it
 
8:04 AM
How do i get a python package to work in VS2017 and VS2017 Code? It is installed and works from the powershell...
 
8:35 AM
Do you have more than one interpreter on your system, or virtual environments?
 
9:16 AM
Am I the only one who feels following a question is a bit verbose?
 
9:29 AM
hello every one , i have 15lakhs plus observation , in that i have percentage column , data of this column looks like this 0.4567 , 0.1564 , 19 , 23, 0 , 0.1234 where i want these decimal percentage to convert to whole number . how to go about this because with for loop it takes age to check every row and convert . any other function we can we use pls guide this .
 
this seems like a job for numpy
is the data already in a dataframe, perhaps?
 
Hi :)
I'm trying to run a command on a switch, using pexpect - it works so far as it runs the command for me - but then I'd like to just output the content constantly to a file and I'm unsure how.

It's running 'top' on the switch, so every second the screen refreshes, and I'd like to capture that (I don't need _every_ refresh, just to make sure it's still running).
But I've no idea how to manage that using pexpect.
so capture, sleep 1, capture... etc forever more.
 
:49140380 dicti = {'id':[coli for coli in range(1,(10+1))],
         'perc_col':[30,0.4546,0.76543223190,10,0,0.29567,93,'NaN',0.31,0.456]}
df = pd.DataFrame(dicti)
 
@NabiShaikh I take that as "yes, it's a dataframe"
can you clarify what you mean by "want these decimal percentage to convert to whole number"? Does 0.4546 become 45? What does 30 become? What about 'NaN'?
 
9:46 AM
@MisterMiyagi yes. decimal to whole number , whole number will remain whole number and Nan will rename NaN.
:49140506  i am getting error  TypeError: '>' not supported between instances of 'str' and 'int'
After tring this code
df['perc_col'] = df['perc_col'].apply(lambda x : int(x) if x > 1 else int(100*x))
 
lambda x : if int(x) > 1 else 100*int(x)
Perhaps you want this?
 
@jigglypuff i did that , but i have NaN in few rows , and i am getting error
 
@NabiShaikh That NaN is a string, that is why you're getting that error
 
I guess it's because some strings can't convert to an int. Perhaps detect that case and ignore them?
 
@djsmiley2kStaysInside note that the pexpect FAQ recommends using pyte for screen scraping htop.
 
9:54 AM
@NabiShaikh you need to decide what you want to do with nan values and sort the column data type out rather than allowing it to be a string type before you run your comparison
 
@NabiShaikh Is there any structure to this? E.g. are the percentages always in the same column/position?
 
@MisterMiyagi this is few example i can produce [30,0.4546,0.76543223190,10,0,0.29567,93,'NaN',0.31,0.456]
 
so it's really just one column of randomly ordered integers, floats and strings?
 
@NabiShaikh You need to start by casting to float pd.to_numeric(df.perc_col, errors='coerce'), and then look for those with decimal part to multiply them by 100
 
10:10 AM
How would you go about creating a class and a "class property", e.g. class Foo: name='bar', that would change each time you call Foo.name. I am not allowed to instantiate the class, I need to yield that name from a list. So on first call Foo.name is x on the second call Foo.name is y and so on
I think yielding is the only way of achieving this
 
Does it have to be an attribute, or is a method fine as well?
E.g. Foo.name()?
 
@MisterMiyagi :O
 
@MisterMiyagi I don't actually care about the output as long as it's changing...
 
jchl, here stackoverflow.com/questions/5189699/… suggested using a separate class with a __get__ defined to achieve this. I could not make this work yet
 
10:16 AM
@isquared-KeepitReal use a metaclass or a custom descriptor, then
 
is this like a quiz or test or something? Or a Y to an XY problem? because you might not like the rabbit hole this solution would take. I'd suggest sticking to just using a method as that's nice. because otherwise, you'd have to mess with metaclasses
 
Nope, an actual problem I came across when writing scrapers. And all of the derived classes already inherit from a base that inherits from a metaclass ABC
 
heres a question that shows how that might look though.
 
never heard of custom descriptors
 
class MultiClassAttr:
    def __init__(self, options: 'Iterable'):
        self.options = cycle(options)

    def __get__(self, instance, owner):
        return next(self.options)
class Foo:
    name = MultiClassAttr(["a", "b", "c"])
 
10:23 AM
oooh this is great. Thanks MisterMiyagi
 
Note that this might very well be the A of an XY problem.
 
init make a generator and get just cycles through it
 
By the way, cycle is from itertools
 
@NabiShaikh heads-up: most people outside India won't know what a lakh is
 
10:26 AM
@isquared-KeepitReal any class can implement the descriptor protocol. Note that there is a small difference between implementing just __get__ versus also __set__ and __del__.
 
I think I know what you are talking about. It like using the @property to just define the getter versus also adding the setter and deleter
*It is
 
yep. property is a descriptor behind the scenes.
 
@AndrasDeak oops my bad ..
 
@isquared-KeepitReal you can edit/delete messages in chat for two minutes
 
@AndrasDeak forgot about it. Thanks for reminding
 
10:36 AM
omg i did it
interact basically just hands teh session back to the os
 
11:29 AM
Silly question but I can't seem to find an answer. If I had multiple versions of Python (on Windows, if it matters), is there a way to determine which version pip is installing into? Or, approaching from the other angle, what's the simplest way to debug "I installed package_x with pip but get ModuleNotFoundError" and you want to confirm that they're installing into a different version than they expect
 
Probably not the right answer but which pip helps
 
I suspected that would be the approach, but it throws an error on Windows and I don't know the equivalent :/ I'll start by finding that
 
You can probably check the __file__ of some stdlib from python
 
hi, does anyone has an idea how i can expand a json string in phyton on a requests.post?
here is my code: https://pastebin.com/9MAzfjmk
 
The which command doesn't look viable for simple debugging for SO comments. I'm quite surprised Microsoft didn't pinch the idea; it looks like you have to build the command yourself. Annoying
@qd0r I'm not sure what you mean by "expand a json string". What is the error you're getting?
Oh, we can just use cmd and use where for showing the path. That's easier
 
11:44 AM
running pip -V or pip --version will show the version and the path of the package, which may indicate the Python version
at the very least it may compare to python -m pip --version, which if don't match, indicates a mismatch between the installed Python and the pip that the command line has resolved
 
@metatoaster may do, but I just see this question so many times and I want a really compact way of just proving it to someone that PyCharm is using some different version than pip is pointing to
PyCharm, or some_other_ide
 
i think i found the solution.

the problem was that i get an array without name from an api [{prop1:"x"}, {prop1:"y"}]

and i wanted to POST this result with the modification:
{myArray: $apiResponse}
 
@roganjosh I've stopped using any bare pip command completely in favour of the -m variants. Too much of a hassle trying to find out things after the fact.
 
i solved it this way:
response = urllib.urlopen(url)
x = "{last_donations:" + response.read() + "}"
requests.post('http://httpbin.org/post', json=x)
 
if you want to "prove" it, let them check the installed packages via bare pip and -m pip.
 
11:47 AM
yeah, basically what I suggested
 
@qd0r Please don't do this. Create the dictionary and then use requests.post('httpbin.org/post', json=json.dumps(x)) if you need to send the string
 
You don't even need json.dumps if you are using a more recent version of requests, see documentation, just construct/pass the dict directly.
 
IIRC the form encoding differs if you pass a dict versus string
 
Also note that requests in their code is actually from botocore.vendored import requests so they might fix the version
 
okay thank you!
 
11:55 AM
@MisterMiyagi no, passing a string value to json results in a string when decoded as JSON on the server side, verify for yourself with print(requests.post('http://httpbin.org/post', json='{"foo": "bar"}').text)
note how the data field is basically doubly encoded
 
12:08 PM
OP apparently wants to do binning, but has never heard of split-apply-combine. Also, a horrible XY question. Create dataframes with new names each time inside for loop
 
Are you asking us to try find dupes?
 
@roganjosh I'm at a loss how to respond. I posted them some comments. Not sure what should be done with it. It's not properly answerable in its current incarnation. It really feels like they need split-apply-combine, but not enough detail/clarity.
 
I don't think it's unreasonable that they might actually want 10 different dfs depending on what they're going to do afterwards. But just close as "needs more details" IMO since that's what you've stated yourself
 
12:32 PM
For absolute newbies, I give them 24-48 hrs to fix or clarify the question before doing that.
 
1:22 PM
I've a bounty question stackoverflow.com/questions/61135835/… i've found the answer (included in its comment) but cant convert it into python. Can any one?
 
@JoshuaVarghese the context of that question has drifted. It originally had nothing to do with Python but then you start mentioning it in the comments. I think you need to re-focus the question body if you're expecting specifically python help (it's not a topic I can help with personally, though, sorry)
 
Most command prompt commands can be executed within python by using the subprocess module
I wonder if we have a canonical question for that
 
@MisterMiyagi I've wandered around on the breeze and this seems the most sensible option. Thanks :)
 
1:37 PM
I'm a little surprised Ahmed didn't suggest that himself... Maybe the problem is more complicated than I'm giving it credit for
 
1:48 PM
Cbg
@Kevin It looks like the OP's approach has morphed from "how do I do this from the command line? (which, btw, I'm doing from Python)" to "I found this recipe to do what I want by hacking the Windows Registry directly, how do I do it with win32.winreg?"
 
Sounds a bit harder than a single subprocess call, in that case
 
It's probably not very hard, actually, if he knows the exact key and value to poke into the registry. Something probably easily gleaned from reading winreg docs for 5 minutes.
Of course, asking to be spoon fed on SO is always easier than reading docs.
pre-coffee morning attitude, I'll be better in a bit
 
@PaulMcG nooo :P
 
2:05 PM
I have sympathy for bountied questions that fall a little short of our usual quality standards, because every time I've ever put a bounty on a question of mine, it was because everything in my immediate surroundings was on fire
I'm still not going to answer ambiguous questions, but I won't begrudge the fast gunners enticed by the 50+ points on offer
 
2:28 PM
So i should do what? cancel the bounty?
edit the entire question?
 
as the question currently stands, it belongs on ServerFault or SuperUser, not SO.
You should definitely edit it if you are looking for the Python code to do whatever you want to do.
 
Mm hmm, the reader should be able to determine exactly what you want without having to read any of the comments
 
Was it really necessary to post the same link twice with two different pings?
 
Please don't go through us pinging us all. I already said it isn't something I can help with#
 
2:40 PM
ok sorry :)
so how i let paul know the updation?
 
He's probably aware
Mentioning Python in the question is certainly an improvement. I still don't know how to poke registry values, myself
Earlier I suggested subprocess, and wondered if there was some reason that it wasn't a suitable approach. If you've tried using subprocess and it didn't work, try including that code in your question. If you haven't tried using subprocess, definitely try using it
"But Kevin, why don't you try it and reap the bounty for yourself?" you ask. Altering values in my registry based on internet advice costs more than 50 points ;-)
 
You no-doubt anticipate the "well, how much does it cost?" question? :P
Oh, I think this qualifies for a stackoverflow.com/a/24948281/4799172 even though I can't participate. It's just come up on a basic search while I was looking for a dupe for something else
 
3:16 PM
cbg
 
hey puppy! it's been a while
 
a few days maybe? :p
 
I don't even remember anymore. They all seem the same to me. It could have as well been a year ago
 
@JoshuaVarghese Google turns up this SO tidbit on how to use winreg to write a value into the registry at a particular key. The winreg docs here point to a nicer form, using a context manager to auto-close things once you are done (which is probably a good idea).
 
@roganjosh it needs <0 score for delv. How about finding a dupe?
 
3:30 PM
@AndrasDeak The other answer given is fine, as far as I'm concerned. So we can't do anything but downvote an accepted, and terrible, answer?
I don't think the question is bad, but the accepted answer is absolutely the opposite of a fix. And that generic title has got 3k views
 
Dupe != bad
 
yeah... must be a dupe for that
 
Unregistereds get automatically redirected to dupe targets
@roganjosh and no, not really
 
Well... there's stackoverflow.com/questions/9802697/… - must be others though
 
There is a decent dupe mentioned in the second answer (which is the correct answer, not the accepted one)
 
3:35 PM
 
We don't do downvote requests here
 
I didn't mean for it to be a downvote request. I thought it might be possible to just remove it
 
@JonClements nuke the entire site from orbit
@roganjosh I meant vis-a-vis Paul's remark
I don't want people to pile on with downvotes
 
So the bounty's wasted :)
 
@AndrasDeak Good point, thanks for the reminder
 
3:38 PM
Don't feel blue, you've got four more days to get an answer
 
stackoverflow feels like a challenge for me (maybe because I am 16).
 
I'm over 30 and it challenges me every day
 
at what age did you start here?
 
@JoshuaVarghese nah, it just needs practice. Don't feel insecure about your age. I've seen young professionals and older jokes both.
 
It's been 8 years 7 months apparently
 
3:42 PM
@Kevin ~25%
 
should i believe Go will takeover python when i reach about 30?
 
It's anyone's guess
 
@JonClements well, now I know why those tags are just a garbage heap :'(
 
25%...
 
right?
 
3:47 PM
why suggest delv-pls? it doesnt exist
 
@JoshuaVarghese it does, depending on reputation
 
@JoshuaVarghese it's markdown abuse like [cv-pls]
 
I could have spent that time hiking the Appalachian Trail or learning Mandarin or something... Well, let's be real, I probably would have stayed home and played video games. So it's for the best.
 
@Kevin Tried any Ikoria yet?
 
Nah, looks pretty rad though
Can't believe they turned Augment into a real mechanic and called it Mutate, those mad lads
 
3:55 PM
i get it
 
tried a few games out last night... it's err... interesting
 
Unfortunate that they couldn't pull the "SpaceGodzilla, Death Corona" promo card before the first print run went to stores. Poor choice of descriptor there
 
how do i inform Martijn that data.stackexchange.com/stackoverflow/query/197953/… is broken?
It looks like I still have to go a long way for the badge, but I earned it today :0
 
@Kevin well... they did that months in advance... think it was a little daft they put up an apology :)
 
Yeah I don't think there's anything they could have done, so I don't blame them. But I understand why they'd apologize anyway as a PR safeguard
@JoshuaVarghese Maybe the badge doesn't have the "at least 10 days old" requirement anymore. You could make a fork of the query and remove that condition if you wanted.
 
4:18 PM
I did count 10 days.
 
Should I download a VM with Ubuntu on it or stick with the WSL? I feel kind of limited with the WSL because it doesn't have any apps, GUI etc.
 
Hmm, strange. If I modify the select section, you clearly have 10+ unsung answers. So why does Martijn's query say you have 1?
data.stackexchange.com/stackoverflow/revision/1228110/1510748/… uses nearly identical logic to Martijn's, but gives me a completely different answer. I'm baffled.
 
4:42 PM
wow lol
 
@JossieCalderon should I have long hair or short hair? How can we answer this for you?
 
@roganjosh you should have blue hair so it matches the potatoes...
 
Indeed. Bad parallel to choose because it's obvious that hair should match the vegetable produce that you grow...
Also, long hair through hating idle chit chat and random people touching my head has ruined several years of photos, including my graduation :/
 
5:00 PM
that sounds like a story to be told over a few pints :)
 
@JonClements The pictures are... awful. Oh well :P
@JossieCalderon on a more practical note, I've found WSL really simple to use and haven't even bothered trying to install VMs and bridge ports
 
How do you save the fork query?
i think i did find the problem with that
how do i edit the query?
 
5:21 PM
How do i save the revision?
 
5:46 PM
# A riddle with dynamic class generation

# setup:
from dataclasses import dataclass, field
import datetime

@dataclass
class Timey:
    timestamp: datetime.datetime = field(init=False, default_factory=datetime.datetime.now)

# goal:
assert Timey().timestamp == datetime.datetime(2020, 1, 1)

# restriction: don't overwrite/implement Timey.__init__ or Timey.__post_init__
disclaimer: I don't know if there's a solution. It seems to me like there should be, but I can't get it done. Based on this Q.
 
I suppose one could monkeypatch datetime.datetime.now
datetime.datetime.now = lambda: datetime.datetime(2020, 1, 1)
 
huh
I tried around with freezegun, that didn't work, and after that I kind of gave up on that direction
not that simple at least:
gives me a TypeError: can't set attributes of built-in/extension type 'datetime.datetime'
 
Very sad - I thought datetime was in Python, so more amenable to the monkeypatch approach
 
Timey.__init__.__closure__[0].cell_contents = lambda: datetime.datetime(2020, 1, 1)
^ perfectly clean code, not hacky in the slightest
 
haha what the heck
I didn't know that was possible
So I guess this answer is also not strictly correct?
 
6:02 PM
Hmm, not sure. Do closure variables count as local variables?
 
@Aran-Fey I get a TypeError: 'NoneType' object is not subscriptable when I run it though
 
I guess the dataclass implementation must've changed. I tested in 3.8
 
Me in 3.7.2 and 3.8 both on windows
works in repl.it though, so I guess I need to debug my machine
 
 
2 hours later…
wim
7:54 PM
@AndrasDeak it's deletable now.
@roganjosh you can. accepted answer can be deleted by three sufficiently high rep users. I agree with you that alecxe's answer is fine.
 
8:07 PM
@wim Thanks :) It's out of my hands now. It's frustrating looking down at the roots on SQL questions
 
8:22 PM
No module named 'MySQLdb' anyone know a workaround in python 3.6.9?
 
Did you install MySQL on the system?
And then, after that, you'll need to narrow things down on what is throwing the exception. SQL Alchemy? There is no "workaround". You need to fix this.
 
@JossieCalderon Install mysqlclient.
 
@IljaEverilä Yes, I've done that and still the same issue.
I've tried that
I've tried
sudo apt-get install python3-dev default-libmysqlclient-dev build-essential
 
wim
@Arne Added an answer there.
 
Also tried
 sudo apt-get install python-mysqldb
 
8:29 PM
@JossieCalderon assuming you're using system python that should probably be python3-mysqldb according to naming customs
 
I also asked you some fundamental questions that you haven't answered @JossieCalderon
 
wim
@Arne freezegun should work here. maybe you were using it wrong.
 
Used this, not sure if it's the best coding practices though
12
A: No module named MySQLdb

alphiiipip install PyMySQL and then add this two lines to your Project/Project/init.py import pymysql pymysql.install_as_MySQLdb() Works on WIN and python 3.3+

 
So I need to work with colors and I'm tired of juggling RGB tuples - any recommendations for a library that lets me work with object-oriented colors?
 
@roganjosh No, it's not installed.
 
wim
8:33 PM
what's wrong with RGB
 
@JossieCalderon Great. So start with that. Then download the wrappers
 
@wim the same thing that's wrong with using b'\xc3\xa4' instead of 'ä'
 
@AndrasDeak I did sudo apt-get install python3-mysqldb. It says it installed as normal but when I do pip3 freeze it doesn't show up. Why doesn't it show up under installed packages?
 
@Aran-Fey Have you thought of working in HSV instead of RGB?
 
@JossieCalderon you have multiple pythons and pips
apt will always use system python and python3, pip and friends will use whatever pip corresponds to at the time
 
8:36 PM
I've been meaning to do so in my own work, but haven't gotten to it. But it sounds like you are just getting started, so you might consider it.
 
@JossieCalderon you can have 1. system python with system modules, 2. system python with --user-installed modules, 3. virtualenvs (to name the most straightforward three confusion options)
 
@PaulMcG Hmm, depends. I haven't thought of specifically using HSV, but I have thought of using arbitrary color objects that can be converted to RGB (or whatever) else when required
In my case, I'll mostly be taking colors as input (from a programmer) and converting them to RGB or ANSI codes
(I.e. I'm not really manipulating colors, is what I'm trying to say)
 
That makes sense, thanks Andras
 
wim
what do you mean by object oriented colors anyway
b'\xc3\xa4' looks good to me. now, b'\xe4', that's wrong!
 
Well, instances of a Color class (or subclasses thereof). Which would let me do things like RGBColor(r, g, b).to_hsv() or whatever
 
The only usable thing I've found so far is python-colormath
 
Seems like colorspacious only has module-level converters colorspacious.readthedocs.io/en/latest/…
You could wrap it
 
ha, I'd rather not. It has some links to similar packages though, some of those seem promising
 
wim
@Arne ahh, I see. if I understand correctly, freezegun will work if you allow a later name resolution.
@dataclass
class Timey:
    timestamp: datetime.datetime = field(
      init=False,
      default_factory=lambda: datetime.datetime.now()
    )
try that.
 
nope, tried that too
slightly simpler mcve without the dactaclass
 
wim
8:54 PM
@Arne I don't believe it ...
 
damn, you're right\
forgot to close the parens =(
 
done
 
Thanks
 
wim
it's the old “Least Astonishment” and the Mutable Default Argument in disguise.
 
8:58 PM
how to fix Branch name expected in Git-it?
I have created a txt file named add-myusername within it my username
 
@Student404Mus what is git-it?
 
@Student404Mus is this python-related?
 
git-it is a workshop to learn github
 
So before I can run MySQLdb.connect, I have to download MySQL?
 
@JossieCalderon I can only go off past experience that downloading the clients are required before the libraries work. You ignored my other questions and just went for the linux-y stuff
 
9:03 PM
@roganjosh I'm trying to figure out what is throwing the exception right now.
 
And I'm suggesting how to fix it.
It's not enough to have installed the python wrappers/bindings if you haven't installed the actual database client. And, as I found in the past, it throws spurious errors
 
Ok, installing the client now (from here): dev.mysql.com/downloads/file/?id=492814
 
Ok, the solution is, the syntax <BRANCHNAME> should be replaced by, add-yourusername.
 
Uff, colormath depends on numpy. That's not a dependency I want to have...
 
Same for colorspacious
Fire up a web API that does the conversion... :P
 
9:21 PM
@roganjosh Ok, I've installed the actual database client on windows. I'm using WSL for the commands by the way (Ubuntu 18.04) - that shouldn't make a difference, right?
Local Instance MySQL80
root
localhost:3306
Hey!
The error 111 went away!
Now I just get only one exception, 1045, access denied for user root@localhost, using password:NO
 
I went for a cig sorry
Ok, so now you need to configure the database. But it fixed your error. You need to look into the admin tools of MySQL. I'm not really familiar with them and it's not a python issue.
 
right
I just want to know if I'm doing the right thing or if I'm getting sidetracked. My task is:

"Extract the data from a JSON file to a csv, then load that data into mysql using airflow."

The first part was easy, so I'm trying to load that .csv data into MySQL.

However, I haven't introduced airflow into any of this yet. That's fine, right? I was planning on doing that at the end.
 
thanks a lot for the input with my problem Aran and Wim, I incorporated it partly here.
 
I upvoted, then remembered I can't upvote, then realized I suddenly can upvote. Weird.
 
I did it, @roganjosh! I managed to create the database...it's over. Thanks you all for your help so much
 
9:36 PM
Happy to help :)
 
So now I just have to introduce airflow. But I want to know if the thinking process was right. Am I doing it right by introducing airflow at the end?
 
@JossieCalderon can you please drop the empty lines going forward?
 
By empty lines you mean?
 
The blank spaces in your messages

like this
 
Yes, no problem
 
9:40 PM
thanks
 
wim
Andras Deak is our resident linter :)
 
pep pep, cabbages
 
10:09 PM
Okay friendos my mind is melting. Has it always been possible to have a foo/__init__.py with bar = 42 in it...
and then several subpackages
and be able to do import foo.bang.quux.other; print(foo.bar)?
I would swear that in the past that did not work
but it definitely works for me
 
 
1 hour later…
wim
11:10 PM
Yes that's normal
I talked about how/why in Do I need to import submodules directly? (specifically, in the footnote)
 
11:48 PM
@WayneWerner yes, import x.y imports x, then imports y and assigns it to x.y, so x.attr also works.
 

« first day (3471 days earlier)      last day (1480 days later) »