9
votes
Fortnightly Programming Q&A Thread
General Programming Q&A thread! Ask any questions about programming, answer the questions of other users, or post suggestions for future threads.
Don't forget to format your code using the triple backticks or tildes:
Here is my schema:
```sql
CREATE TABLE article_to_warehouse (
article_id INTEGER
, warehouse_id INTEGER
)
;
```
How do I add a `UNIQUE` constraint?
The answer is going to come down to who you apply to and what their preferences are. To me, as someone who has input to the hiring process at my company, I'd prefer to see in order of importance:
Whatever you decide, just be sure to tailor your resume to the company you're applying to if you want to increase your chances.
At one point do you feel the need for the
const.py
file? Maybe PyCharm can help you with that. You might write outconst.my_new_const
and let PyCharm create it via a shortcut.Is it possible to import a python file that is present in a parent directory?
You’ll have to add the directory containing the file to your python path, either permanently in your .bashrc or at runtime in your imports.
Yeah. I thought this must be a frequent enough task for python to support using '../' for module imports.
I've been struggling with this a lot recently too. I think my fault is that I run all my python scripts as individual files. That means, I'm not really using the module concept of my parent directory. I've been thinking about creating a main.py file in the root directory that transforms all my little scripts into commands for an internal CLI. This doesn't help my desire to reuse code in jupyter notebooks. We'll see if I ever get around to it though.