Message from Python discussions

November 2018

— Looking for a Django developer who knows (frontend as well) for a freelancing project .
If you have any friend in your network with set of specific skills, please redirect if someone is the right fit

Message permanent page


Guys,which is the shortest way to add a tab to each line of a string? I mean,I have 2 strings and I don't want to do it with

for line in str.split('\n')

Are the generators the best way?

— What do you mean by the shortest way? The fastest in terms of performance?

— Or with the least amount of code?

— The amount of code.

— Hello!! how to unlock database I am using sqlite3 in python3 h

— But are there any differences in the speed?

— You could do it like that:
'\t' + s.replace('\n', '\n\t')

It's short but not very readable.

— I don't really know

— Yep

— Now I think.. I would prefer the most beautiful way.

— If I want ti insert some data into my database file there is check out ==> sqlite3.OperationalError: database is locked how to solve it please help me

Message permanent page