« first day (3519 days earlier)      last day (1422 days later) » 

12:17 AM
Can we get this question reopened?
 
12:27 AM
@user2357112supportsMonica Your question as stated doesn't make sense unless you edit it to tell us how we're expected to know if some given memoryview is (say) a 10x10 matrix, 4x25, 20x5..., what dtype (numpy 'i4'? 'f8'?), etc.... can't transpose without knowing that.
 
@smci: That's all in the memoryview. shape and format.
I even edited in a demonstration of retrieving the shape.
 
@user2357112supportsMonica Then edit your examples in the question to be more explicit, showing people how the shape can unambiguously be automatically determined. IIUC, your code only shows how it can manually be cast, if we already know the dimensions.
 
wim
is your answer edited into the question? I'm confused
 
No. My answer is posted as an answer. It doesn't need to explicitly access the dimensions at any point (NumPy handles that).
I did edit the question, in the hopes of making it clearer to people that the concept of transposing a memoryview actually makes sense.
 
wim
OK. that's a massive edit ...
I reopened it because you're right about stuff 99.95% of the time
 
12:33 AM
@user2357112supportsMonica Ah, I thought you were talking about your edits to the question wording. I didn't even see that you had also written an answer. It would help a lot if you edit the question statement to say that the dtype, order (col/row-major) and shape can all automatically be determined, if we're told it's an ndarray...
 
wim
1:02 AM
A core developer resigns because of perceived PSF political overreach discuss.python.org/t/the-psf-should-be-less-political-not-more/…
 
I'm not sure where he's seeing religion in the PSF's stance.
 
1:18 AM
also I don't know why that developer can't see that every decision involving a large number of people (or users) are political in nature.
 
1:52 AM
@JossieCalderon sure you can do that - that is reinventing the wheel (soap + scrape + parse is always an option with web-based items but APIs are worth it/easier in the long run 90% of the time)
 
 
1 hour later…
2:57 AM
cbg, if I have two files, a.py and b.py and a.py has a simple if else check to see if the input value matches a certain value, if it does then I do from b import foo, foo(), but anyone can directly access b.py and call foo(), how can I make sure foo is accessible only when the check is true?
php has cookie I believe, you can check using that, is there something like that in python?
 
wim
@user2357112supportsMonica yes that was a little strange but I concluded the word may have been used in the more literal sense, to mean "a specific set of beliefs", rather than any particular religion
 
 
1 hour later…
4:25 AM
Hello! I am still trying to figure things out with Python and generally, in programming.
I have an array of integers that can change per run.

Example:
r_q = [[2, 3, 1], [3, 2, 1], [0, 3, 1]]

How can I get a separate array with the values in r_q, element-wise of the nested array?

Output:
r_q_1 = [2, 3, 0]
r_q_2 = [3, 2, 3]
r_q_3 = [1, 1, 1]

I know that I have to use for/list comprehension. Can anyone give me an idea?
Any help would be appreciated! Thank you so much.
 
 
2 hours later…
6:24 AM
Separate array with values in r_q: `mysubs = [sublist for sublist in list]`
equivalent to `for sublist in list: mysubs.append(sublist)`
 
6:45 AM
@Acee The builtin zip function does that.
 
7:08 AM
cbg-ning
 
sri
Hello!
 
@sri o\
 
sri
I have a question How can we extract specific data from a text file? for instance, I have a text file that consists of this information. "As more than one social media historian has reminded few people" I want my output to print "one", "media" "people". I tried using split function. When I tried to print "one" I am getting complete sentence after "one." Any help would be appreciated
 
>>> sent = "As more than one social media historian has reminded few people"
>>> sent.split()
['As', 'more', 'than', 'one', 'social', 'media', 'historian', 'has', 'reminded', 'few', 'people']
 
@MisterMiyagi So Python has a builtin function for simple things but not for kwargs formatting? WTF.
 
7:21 AM
@sri not sure to get your question?
 
@sri What's the code?
 
7:39 AM
@wim wow
@Acee side note: lists are not arrays
 
7:53 AM
@JossieCalderon not sure I get your comment. What do you mean by kwargs formatting?
In general, Python has builtins for common tasks. Some of these are simple, some of these appear simple.
@sri what is your criteria for selecting these words? They seem unrelated.
 
8:27 AM
Oops:
Wow, awesome find! Turns out there's a bug in the markdown autofixer: When a line preceding a blockquote contains a hyphen, a subsequent blockquote will be indented. I've got a repro and will fix this now so we don't run into this for upcoming migrations. In those two cases, feel free to edit the markdown manually. — Ham Vocke ♦ 19 mins ago
 
Anyone has any insights on this?
Do you know or have at least an idea why the f-string and format versions seem to take more time for one variable than for two? — ExternalCompilerError yesterday
 
Make sure it's timed correctly (general guidance)
 
It seems to be. Let me recheck.
 
Also look at dis.dis perhaps
 
yeah, doing that after recheck
 
8:38 AM
I can try to take a closer look later from laptop
 
Doing it normally suggests the result should be wrong, but may be due to the timeit setup that I have in place is skewing results. Wild guessing.
 
Time for coffee? :P Or bed.
 
both :D
Doing some testing now. reverses polarity
 
Side note, (as expected) Python 3.8 results are quite faster than 3.6 (my laptop is same, although my OS is upgraded to Ubuntu 20.04, but don't think that should make a difference)
 
@shad0w_wa1k3r It looks ok to me. Were you running any other intensive programs at the same time?
 
8:46 AM
nope
 
the code is broken
 
x0 = ('0',) versus x0,x1 = ('0', '1')
the single-parameter case formats a tuple
+-----------------+-------+-------+-------+
| Type \ num_vars |   5   |   2   |   1   |
+-----------------+-------+-------+-------+
|    f_str_str    | 0.099 | 0.065 | 0.013 |
+-----------------+-------+-------+-------+
|    f_str_int    | 0.403 | 0.183 | 0.061 |
+-----------------+-------+-------+-------+
|   concat_str    | 0.185 | 0.057 | 0.011 |
+-----------------+-------+-------+-------+
with fixed code
 
nice, thanks
will update the answer
 
@MisterMiyagi Well spotted.
 
8:53 AM
TIL you can't inherit from bool
>>> class Foo(bool):pass
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: type 'bool' is not an acceptable base type
 
yeah, same for NoneType and ellipsis.
 
I often put a verify or validate function in my timeit programs which checks that all the different versions produce the same result. And it can print the results of each version as a quick sanity check that the results are what we expect.
 
@PM2Ring How do you do that? Any example?
 
@Aran-Fey Not being able to extend bool and friends makes sense when you consider them as enumerations.
    import enum
    class Boolay(enum.Enum):
        Yay = enum.auto()
        Nay = enum.auto()

    class Hooray(Boolay):  # not allowed either
        May = enum.auto()
 
Huh, I didn't know that
 
9:01 AM
It means if you know a variable is boolean, no-one can sneakily sneak a sneaky Third Option in there to take.
Looking at you, Mr. Kirk.
 
@shad0w_wa1k3r It depends. If there's no setup string, and you're testing functions, it's easy. Otherwise, you probably need to use eval.
Here's a simple example that times functions: stackoverflow.com/a/46569726/4014959
 
thanks
 
I figure that eval or exec is ok in that context, since I assume timeit is using eval or exec.
 
9:37 AM
@MisterMiyagi enforcement of tertium non datur with extreme prejudice
 
10:34 AM
@CodeDecode Please take a look at the room rules, specifically that we ask not to post fresh questions (<48h) here.
 
Hi all, When i try to run tox command i get this issue:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/toxbat/requirements.py", line 39, in <module>
from pip.download import PipSession
ModuleNotFoundError: No module named 'pip.download'

does anyone know how to fix this?
 
have you tried updating pip/tox/tox-battery?
 
@MisterMiyagi Let me try this ^
 
 
1 hour later…
12:21 PM
@MisterMiyagi That didn't help
thanks anyway
 
@Sankar hey @Sankar
sup bro?
 
Hey @AndyK o/
just workin here bud
 
@Sankar cool. same here.
 
cool :)
 
1:01 PM
What does sys.call_tracing do?[I tried googling, it seems that it is used for debugging but there were explanation]
I initially thought that it might give the number of calls or something like that, but it justs return what the function has returned.
 
@MisterMiyagi Getting the values out of the dict_items that kwargs returns.
I had to write my own custom value for this
 
1:23 PM
@JossieCalderon Huh? Are we talking actually about a function's **kwargs? Why would you use dict.items on that to get the values? Why would you use **kwargs and not *args if you only want the values?
@AjayMishra As the description says, it is intended to be used with a debugger. Did you use a debugger?
 
No, I thought(was finding too) a function which returns the number of inner call made by another function(which is supposed to be passed as argument).
 
1:50 PM
helo
 
2:11 PM
@MisterMiyagi Ever considered that I just have a terrible understanding of it?
Just realized **kwargs stores a dictionary and *args stores values
Hence, "keyword arguments": Key, argument
 
Closed
 
3:20 PM
does anyone here do codefroces?
 
huh, I thought the books mentioned in that was the "From Scratch" series from O'Reilly (love that series: Data Science from Scratch is still on my required reading list). Instead its a really sketchy self-published & sold only by author book - weird.
 
@JossieCalderon I am beginning to consider this, yes. You seem to have a pretty strong, vocal opinion for that, though.
 
3:41 PM
I remember finding args when I was looking for a solution for some vector based calculations - loved it. Then I found zip & "splat" from that and was like :O cause I could do return [x * y for x, y in zip(*args)] - one line dynamic vector multiplication - check
 
I was pleased to discover *args, coming from a language that supported variadic functions, but gave no way of determining how many arguments were being passed
You essentially had a generator that segfaulted if you called next() on it too many times
 
"Ah, to be young again. And also a robot"
 
The observed behavior is "my program crashes"
Conventional advice for "how do I determine how many args are being passed?" are "pass the number explicitly via a number_of_args argument", or "derive it indirectly, e.g. by counting the number of % directives in the printf format string"
 
@Kevin I am always surprised by how much footwork is required in a language whose compiler can literally write code for you.
 
My suspicion is that the compiler could tell you how many arguments are being passed, but it would take an extra asm instruction, so they left it out for the sake of speed
 
3:56 PM
@Permian you have failed asking here
 
gone
 
Mar 27 at 14:09, by Andras Deak
@Permian If you didn't keep asking here all the time to have your code debugged you'd have learned by now how to do it.
let's keep that in mind going forward ^
For the sake of being explicit: @Permian please debug your own code.
 
Normally here I would say "this is one of the flaws of coding challenge sties -- they'll tell you 'code failed' without showing you the input or output. 99% of real programming will never tie your hands like that"...
... But as a matter of fact, I've spent all of this morning trying to debug an exception that Visual Studio refuses to pause and display
I guess I'm in the 1% right now
 
@Kevin Down with @Kevin!
 
My reign of terror has lasted long enough
 
4:06 PM
@Kevin I also like intermittent segfaults...
 
@Kevin unless it's a Heisenbug...
 
My current problem is a heisenbug, since it only appears 90% of the time
 
still better than hunting rare Pokemons
 
I suspect it's the same problem that I had last year where my program would fail exactly every second time I ran it. Except now it's mutated into a more powerful strain.
 
you should breed it into a symbiote, making it Kevin's job security bug
 
4:13 PM
@AndrasDeak Give it an Egyptian name, place it into each new piece of software?
 
I don't need to cultivate unsolvable problems, the program ecosystem is already full of them
 
4:28 PM
 
another victim of carcinization
 
Crabs are arthropods, bugs are arthropods, therefore bugs are crabs
 
And apparently give you cancer?
 
A common misconception, much like "frogs give you warts" and "spiders give you superpowers"
 
4:47 PM
Discussion of Heisenbugs reminds me of the time I was debugging code that accessed a @property with side effects. So when the debugger read the property it performed the side effects well before normal execution would. Took me a while to figure out I had to find a different way to debug the code since debugging was causing different behavior than normal execution.
Specifically error handling in Django's forms does this
 
I've seen that happen on SO from time to time
In C#, VS's debugger won't show you the value of a property unless you click to confirm. That's one way to avoid side effects.
I suspect that feature would be hard to implement in Python, since attribute-getting is so extensible
 
5:19 PM
@Kevin In the assignments I build for classes I typically use unit testing for..well...testing but sometimes "cheat" with a quick input/output match for simple things. Always shocked when students fail, tell me all the ways their code "works" and blame my tests - without reading the "your code should match the exact output:"
^ "check the exact output your suppose to give" is also my first answer whenever asked about coding challenges (besides Euler or Kaggle if you count those)
 
Am i really the top new user, or is the order always different for different computers?
 
you mean in users? You're really the top user on SO for the month at least
 
wim
@Code-Apprentice properties with side-effects are evil
ipython invokes them when inspecting attributes for tab-completion ..
mock invokes them when autospeccing a mock ..
and, as you've seen, debuggers
 
5:34 PM
@Kevin Shurely 'reign of error'
 
wim
@AnnZen You really are the top new user for the month, keep up the good work!
 
Thanks...
 
Sam
5:58 PM
import requests
url = 'http://api.guerrillamail.com/ajax.php'
params = {'email_ids%5B%5D': 512999723}
r = requests.get(url, params)
print(r.url)
> api.guerrillamail.com/ajax.php?email_ids%255B%255D=512999723
what on earth is going on: email_ids%255B%255D
Is this normal? :P
 
Ended up calling the MD over my dashboard project. First full day back in the factory since the whole WFH thing; felt rather strange! It was rather fun going from "you're not even allowed an export of your data" to "yeah, you can have full remote access to your server" but it was useful being on-site anyway. Apparently I did still have some pulling power :)
 
nice
 
@MisterMiyagi Thank you!
 
Sam
Ah looks like some funky url encoding...
 
6:14 PM
@LinkBerest Nice
 
6:40 PM
@Sam any chance that it was encoded twice?
>>> unquote(unquote('http://api.guerrillamail.com/ajax.php?email_ids%255B%255D=512999723'))
'http://api.guerrillamail.com/ajax.php?email_ids[]=512999723'
Should your params be encoded?
 
wim
6:51 PM
 
Wooo. flask-session has finally sprung back into life
Prior to that it had been dead since 2017 and started falling apart. That'll make things a bit easier
 
I wonder how bad it is in the long run if the "springing back to life" is just a fluke
 
There were people there asking for it to be handed over to the community; I'll see if he actually added some others
 
than again 3 years is more than enough for someone to fork it and build further
 
anything that helps people avoid bad practices & session hijacking, I'm all for
 
7:04 PM
rb folks. good eve
 
I think realistically that's what should happen because this might just be a lurch forward and then it'll go quiet again. Thing is, it seems to be the de facto if you search for session management, with years of accumulated answers etc. and potentially several libraries with it as a dependency (I'd have to check that) so it'd be nice to keep the original alive
 
if you fork the original you'll have the same answers
not that I know anything about maintaining packages
 
oi, this answer: "If Windows finds Python 2 in the PATH first just rename the Python3 exe"
 
wim
the blind leading the blind in that whole Q&A
even commenters recommending to restart the computer (for a PATH change)
 
....can I set a dupe to superuser? I really like their answer on Path way more :) ;P
I'm tempted to answer this question on that subject just to have a better dupe target for later
 
7:19 PM
mmm, I've properly borked my PATH in the past, editing it in cmd to get around restrictions. Fun fact: it works but truncates to 1024 characters.
 
At the same time I'm tempted to close it as its more a windows issue (and I'd just be duplicating the info on that linked superuser thread anyway)
 
Maybe the powershell approach doesn't suffer that... hiccup
 
registry is hard limited to about 2048 even if you edit it directly (or use a few PS tricks)
 
Ah, regedit was out of the question, that set off all sorts of security systems. This was, IIRC, setx %path%;
 
the trick in PS is: [Environment]::SetEnvironmentVariable('path', ...) fyi
 
7:23 PM
I'm a big fan of security systems that push savvy-enough-to-be-dangerous users to try find ways to circumvent the ticket system where it takes 2 weeks for someone to come and fix what you need... so you just end up trashing things by trying tricks
 
Yeah, setx is just a windows utility (not necessarily PS but is a direct reg edit so works). I think you have to be an admin account for the PS version and use -ExecutionPolicy Bypass -Command type arguments too (i.e. its a horrible idea and I never use it : symlinks are bad but safer for this or using DOS style minification).
 
7:39 PM
It's been a while since I've looked at flask-session code and now I'm wondering why I even bother using it. I might as well just create my own class, for all the work it does, and just drop the dependency altogether
 
 
1 hour later…
9:02 PM
Have there ever been a time when you see a question and you have a very good, sophisticated answer, that you spent a while perfecting. Then, while you're preparing to post your answer (probably taking your time because no one else will), the question closed!
 
wim
Yep. It's annoying. But with time you get a feel for what kind of questions are considered on topic, and know not to answer questions that will likely get closed
<\s*a[^>]*>(.*?)<\s*/\s*a>
^ heh, copy and paste that into chat for an easter egg
 
Hello Lovebirds
 
9:18 PM
@wim how did that happen?
 
@wim That actually happened, did it? Dinosaurs waltzing through the chat and eating messages?
 
@AnnZen It's exactly that, an easter egg. A reference to Tony the Pony
Please everybody else post that into the sandbox and not here
hmm, if there are dinosaurs this might be a new one
 
If anyone is bored and knows SQLAlchemy, I'd really like to know why db.execute("SELECT * FROM books WHERE author LIKE %s", ('%' + search + '%',)).fetchall() failed here but db.execute("SELECT * FROM books WHERE author LIKE :search", {"search": '%' + search + '%'}).fetchall() worked. It's possible I'm losing my marbles but I've pored over it on/off for an hour
 
I'm confused, is there supposed to be dinos?
 
perhaps Miyagi was joking
 
9:28 PM
This is a public service announcement! Please do not go looking for the dinosaurs, citizens!K eep being productive! There are no dinosaurs in room 6! Move along!
 
Chat easter eggs are here. Please play with them elsewhere.
@MisterMiyagi that's just what you want me to think!
@roganjosh read the traceback one more time
books = db.execute("SELECT * FROM books WHERE author LIKE %s", ('%' + search + '%')).fetchall()
no tuple...
OP can't copy-paste. More news at 6.
 
Gahhh!
My typo-spotting skills. They're leaving me :/
 
I didn't mean to be snarky at you, @nilajawill :) Welcome. But typos can be frustrating to find.
 
Oh! Hello! I didn't know what to say :). May I know what I did wrong?
 
your question contains the correct code before the traceback, so it's not obvious that you have a typo in your actual code that you ran
@nilajawill you wrote ('%' + search + '%') which is not a tuple. This is just a string. To create a tuple you need a comma. Compare ('%' + search + '%', )
>>> search = 'foo'
>>> ('%' + search + '%')
'%foo%'
>>> ('%' + search + '%', )
('%foo%',)
The behaviour of db.execute depends on the type of the second argument, so it makes a huge difference whether you pass a tuple, a string or a dict (or something else)
If you're new to python it can be confusing to use a single-element tuple in certain situations, but there are usually design choices that explain why you have to do that (otherwise there would be syntax difference between a single-element and a multiple-element case). Do you see what I mean?
 
9:40 PM
So I've tried both ways. With the comma, I get "AttributeError: 'tuple' object has no attribute 'keys'" and without the comma, I get "AttributeError: 'list' object has no attribute 'keys'"
 
OK, that's an improvement :) That sounds as if db.execute only allowed dict-like objects as the second argument. Since I don't use any databases I'll let @roganjosh continue with this
 
I was on my phone, let me check properly again. If it is a typo on a comma, then I also missed it @nilajawill in the traceback so I wouldn't feel too bad
 
I suspect that the string gets converted to a list internally, at which point it gets stuck on the missing keys attribute, just like the tuple.
so the question is whether the exact db library allows non-mappings to be the second arg of execute
Although an internal conversion to a list followed by a lookup of .keys makes no sense. Might have something to do with the underlying engine?
 
Looking again, I think Andras is correct. The traceback doesn't match ('%' + search + '%',) so, as it unpacks the arguments into the query, it will see the string as a sequence, similar to a list. Why keys() come up in this, I don't know but SQLA is a huge library so I don't know all the layers that parameters pass through
 
@roganjosh but they've since said that fixing the comma raises the same error on a tuple
 
9:46 PM
I looked at the documentation for execute() and it seems like the structure must be like db.execute("SELECT * FROM table WHERE id = :id", {"id": id}). So maybe only dicts can be passed? Am I understanding this correctly?
 
Of course we'd be better off with a corresponding traceback, one without the typo @nilajawill.
 
@AndrasDeak Do you want me to post it here?
 
Hmm, I'm not sure. Since your question already has the traceback, it probably makes sense to edit that traceback with the proper code. We might not be wiser from it, but at least it won't contain a sneaky typo.
 
@nilajawill I don't believe this to be true but I'll have to test it. I have never used a dict for binding parameters in 5 years. If it is true, then it's a hole in my knowledge that I need to plug
 
I've looked up psycopg's docs and named parameters assume a mapping whereas %s parameters assume a sequence, as expected. Question is what sqlalchemy does, but I suspect that should also be sane.
 
9:49 PM
Or what flask-sqlalchemy does, since it's a bit more than a wrapper
 
*multiparams/**params –

represent bound parameter values to be used in the execution. Typically, the format is either a collection of one or more dictionaries passed to *multiparams:
@roganjosh traceback says sqlalchemy, not flask-sqlalchemy. Any chance we're missing an MCVE...?
seems non-named args have to be passed as *args?
conn.execute(
    "INSERT INTO table (id, value) VALUES (?, ?)",
    (1, "v1"), (2, "v2")
)

conn.execute(
    "INSERT INTO table (id, value) VALUES (?, ?)",
    1, "v1"
)
 
@AndrasDeak Done! I have updated it.
 
@AndrasDeak I don't think so. This is now tomorrow's job because PEP249 should get us over this yam
 
@nilajawill thank you :)
@nilajawill umm...now neither your code before the traceback nor the traceback contains the comma :(
I think you fixed it in the wrong direction
 
Oh! Was I supposed to add the comma?
 
9:53 PM
yep
 
Okay, on it!
 
Anyway, I'll step back because I can't even tell what db library is being used here, but my own utter lack of domain knowledge makes me wary of guessing. I'll let roganjosh handle it if he feels like it.
 
I'm gonna look at it properly tomorrow. Something still seems wonky. Until then, I think we'll pause this convo?
 
yeah, probably not a bad idea
 
Okey dokey, I will update my traceback in the meantime. Thank you very much for all your help! Also, regarding my DB, it is a remote DB hosted by Heroku and managed by Adminer. I connect to it using cmd by setting my DATABASE_URL. Hopefully that helps
 
9:57 PM
@nilajawill I'm more curious about the imports and objects involved
 
Oh! Okay, would you like me to add them to my question for review tomorrow?
 
@nilajawill That won't make a difference, I don't think. It's postgres, SQLA, and flask-SQLA
No need to add more to the question
 
and that's why I said that my lack of domain knowledge is not helping anybody :P
 
Picked up on the missing comma, though :P
 
Okey dokey. Let me know if anything else is needed from me. Thank you very much for your assistance and I hope you guys rest well!
 
10:01 PM
@nilajawill sure thing. If we forget feel free to come back to remind us in a few days. Seems like a non-trivial problem.
 
Okey dokey!
 
Anyway, @nilajawill, I didn't suggest you just came here for this problem. You're a student and you were super-receptive in responding to my requests, so I thought it would be useful for you to know that this room exists
 
can concur
 
@roganjosh Oh! I do appreciate this! I didn't know this was around and I will peek in here for extra knowledge and assistance. This was very helpful to me :)!
 
Just make sure to also peek at our rules.
 
10:03 PM
Absolutely!
 
but you'll be fine :)
 
Thank you :)! Goodbye for now!
 
bye
 
10:38 PM
cbg
 
with that sqlalchemy question: you need to pass the parameters (in a dict) with the wildcards, i.e.:
books = db.execute("SELECT * FROM books WHERE author LIKE :search", {"search": '%' + search + '%'}).fetchall()
 
@LinkBerest that's what the answer does. Question was why a tuple with unnamed params doesn't work.
 
what answer? I didn't know this was attached to a question, one sec
 
yup
roganjosh linked it before the discussion
 
ah, found it. reading it and remembering why I use the ORM over raw SQL whenever possible with SQLAlchemy
I wonder if it has to do with the logic they added for baked queries (which is different than the default where the parameter list is expanded at statement construction time into individual BindParameter objects)
 
11:12 PM
1 message moved to Sandbox
 
@LinkBerest why?
 
So that's a sandbox.
 
To me, that raw query with a %s placeholder and their tuple should work
 
I just have a feeling it has to do with handling "IN" and remember running into weird conditions (which are needed basically only when making baked queries) with tuples and params
# hold on; setting up a test DB and trying to see if this works:
cur.execute('SELECT * FROM mytable WHERE blah LIKE %s', (path,)).fetchall()
 
11:19 PM
Opps! Sorry!
 
@AnnZen I asked twice not to use this room as a sandbox.
 
I thought this was sandbox
 
errr....or with the correct syntax I mean (too much JDBC lately). But I think I know what it is now
 
wim
this is not sandbox, but we also have a lot of cat poop
 
I need some help understanding logging
just need to formulate a question first...
 
11:35 PM
Or at least a starting point: seems if you just use .execute(...) SQLAlchemy handles all the parameters. If you use .bind.execute(...) the engine handles the parameters and it works
Interesting, might look deeper into that later
 
Why was my mistake message moved to The Rotating Knives?
 
@wim really? always seemed like we had more dogs than cats here
@AnnZen it keeps the chat clear (easier to search, easier to see flow of conversation, etc) without "completely" deleting messages
 
@wim We keep them to feed the python.
 
@AnnZen that's where unnecessary messages get moved. The first one was an exception: I kindly moved that to the sandbox as another hint for you.
 
anyway, I'm off for tonight. adios all
 
11:43 PM
@LinkBerest good night
 
rhubarb
 
@LinkBerest I think we're on the same page here in what looks wonky. I'll test specifically with flask-sqla tomorrow if I get chance
 

« first day (3519 days earlier)      last day (1422 days later) »