I have python code with the directory structure -     main.py basics.py component1   file1.py   file2.py component2   file1.py   file2.py   I want the code in the directories component1 and component2 to use code from basics.py. What is the most pythonic way of doing this?  Thanks!
How do I import a Python module given its relative path?  For example, if dirFoo contains Foo.py and dirBar, and dirBar contains Bar.py, how do I import Bar.py into Foo.py?  Here's a visual representation:  dirFoo\     Foo.py     dirBar\         Bar.py   Foo wishes to include Bar, but restructuring the folder hierarchy is not an option.
How to uncover a table column wise in Latex beamer I have a table with 7 columns and want to show the first 5 at once, and then  the 6th and 7th on consecutive slides.  This is the code I have for now:  \begin{frame}{Наслов}     \begin{itemize}         \item Ставка.     \end{itemize}         \begin{tabular}{ccccc&lt;{\onslide&lt;2-&gt;}c&lt;{\onslide}c}             $p_1$ &amp; $p_2$ &amp; $\ldots$ &amp; $p_{9}$ &amp; $p_{10}$ &amp; $W$  &amp; $D$\\             $1$   &amp; $1$   &amp; $\ldots$ &amp; $1$      &amp; $1$     &amp; $w_1$&amp; $d_1$\\             $1$   &amp; $1$   &amp; $\ldots$ &amp; $1$      &amp; $0$     &amp; $w_2$&amp; $d_2$\\             $1$   &amp; $1$   &amp; $\ldots$ &amp; $0$      &amp; $1$     &amp; $w_3$&amp; $d_3$\\             $1$   &amp; $1$   &amp; $\ldots$ &amp; $0$      &amp; $0$     &amp; $w_4$&amp; $d_4$\\             $\vdots$ &amp; $\vdots$ &amp; $\vdots$ &amp; $\vdots$ &amp; $\vdots$ &amp; $\vdots$ &amp; $\vdots$\\             $0$   &amp; $0$   &amp; $\ldots$ &amp; $0$      &amp; $1$     &amp; $w_{1023}$&amp; $d_{1023}$\\             $1$   &amp; $1$   &amp; $\ldots$ &amp; $0$      &amp; $0$     &amp; $w_{1024}$&amp; $d_{1024}$         \end{tabular} \end{frame}   This produces 2 slides: the first one with p1, p2, ..., p9, p10 and D columns, and the second with W added, while I want them to appear in the following order:   1st slide: p1, p2, ..., p9, p10  2nd slide: p1, p2, ..., p9, p10, W 3rd slide: p1, p2, ..., p9, p10, W, D   I looked in the manual and found this example:  \begin{frame}     \begin{tabular}{l!{\vrule}c&lt;{\onslide&lt;2-&gt;}c&lt;{\onslide&lt;3-&gt;}c&lt;{\onslide&lt;4-&gt;}c&lt;{\onslide}c}     Class &amp; A &amp; B &amp; C &amp; D \\     217     X &amp; 1 &amp; 2 &amp; 3 &amp; 4 \\     Y &amp; 3 &amp; 4 &amp; 5 &amp; 6 \\     Z &amp; 5 &amp; 6 &amp; 7 &amp; 8     \end{tabular} \end{frame}   which does what is supposed to. However, I don't seem to be able to apply its logic to my problem. :( Is anyone willing to help?   P.S. What are the meanings of &lt; and ! in columns specification? I have an older Nvidia video card and my PC crashes when installing the driver for the video card in Ubuntu 16.04. When I get to the login screen but no further: after entering my password, the system went into a loop and returned always back to the login screen [with funny stripes present].   How do I fix this problem? Setting the correct encoding when piping stdout in Python Is a Schengen visa/transit visa required for a transit flight through two Schengen airports? Password protected Visualforce Page rendered as PDF Is it possible that a Visualforce page rendered as pdf can be password protected?  I am using Messaging.SingleEmailMessage to send mail with attachment, but I need the attachment password protected. Dropping articles in the title (of an article or a section) or in the caption (of a figure or a table)? What's the general rule? It is said that "To give added punch, articles are often dropped in the titles"  Source:   Is there any general rule or reference about dropping articles, especially in academic research papers? Why Does Software Updater Say No updates Available, but apt-get upgrade Shows updates available? I need to prove that $\mathbb{R}\backslash\mathbb{Q} \sim \mathbb{R} $  Using Cantor-Bernstein, need to show an injection from $\mathbb{R}\backslash\mathbb{Q}$ to $\mathbb{R}$ and from $\mathbb{R}$ to $\mathbb{R}\backslash\mathbb{Q}$.    $\mathbb{R}\backslash\mathbb{Q}$ is a subset of $\mathbb{R}$ so only need to show injection from $\mathbb{R}$ to $\mathbb{R}\backslash\mathbb{Q}$ to complete the proof.    Possible injection: $f:\mathbb{R}\to \mathbb{R}\backslash\mathbb{Q}$ defined as $f(x) = \pi x$ if $x$ is not a multiple of $\pi$; otherwise $f(x) = \sqrt{2} x$.    Not sure if $f$ actually is an injection... I'm using Python, and would like to insert a string into a text file without deleting or copying the file. How can I do that? uint color;  bool parsedhex = uint.TryParse(TextBox1.Text, out color);  //where Text is of the form 0xFF0000 if(parsedhex)    //...   doesn't work. What am i doing wrong? Continuity of $L^1$ functions with respect to translation How do I prevent mouse movement from waking up a suspended computer? PHP errors NOT being displayed in the browser [Ubuntu 10.10] Dictionary definitions  often seem to use the terms sentience, awareness, and consciousness as if they are synonymous with each other. Is this really the case? If not, how do they differ? Some books suggest that sentience and awareness are simply facets of the larger concept of consciousness. Disable drag and drop option for multiple file uploader These are the screenshots of multiple file uploader from the same SharePoint 2010 site. Some users are seeing the first and some are seeing the second one. Is it possible to disable the second view(drag and drop) by editing upload.aspx in the layouts folder?      Thank you need initfamfs modules. 15.04 is anything else supposed to be here? I am using Ubuntu gnome and my keyboard is unresponsive for encryption password. Do I need any more modules, and if so where do I add them.  # List of modules that you want to include in your initramfs. # They will be loaded at boot time in the order below. # # Syntax:  module_name [args ...] # # You must run update-initramfs(8) to effect this change. # # Examples: # # raid1 # sd_mod Is Dishonored an open-world game? I was considering whether or not to buy Dishonored, and watching gameplay of it on Youtube, when a thought popped into my head: is Dishonored free-roam? Can you go anywhere you want, similarly to Fallout or The Elder Scrolls? I'm looking for a formula to calculate the sum of $(a+b+c+d+...)^n$ but with coefficients equal to 1. For example in $(a+b+c)^2$. I want the sum of $a^2 + b^2 + c^2 + ab + bc + ca$. And for $(a+b+c+d)^3$, I want the sum of $a^3 + b^3 + c^3 + a^2b + a^2c + b^2a + b^2c + c^2a + c^2b + abc$. Similarly, I want the sum of expansion of $(a+b+c+d+e+....)^n$ with coefficient equal to 1. I tried to find the pattern by expanding the $(a+b+c)^2$. And I found that its formula is $a^2 + b^2 + c^2$ + $\frac{((a+b+c)^2 - a^2-b^2-c^2)}{2}$. This works for the power of 2. But fails on other powers. Any help will be really appreciated. What does -y mean in apt-get -y install command? I always see commands like this  apt-get -y install    What is the -y tag for and what is the difference between apt-get install with and without the -y tag? App keeps crashing & rendering error since update to 1.0.68 I can reproduce that every time now, I go to a site, open an article, then to the next site, open another article. The Feed page pops up for a second, the article page lays over this with some some transparent areas (see picture). The same app-version is ok on a Smartphone with Android 4.4.2. I also sent in some bug reports.    Edit  1.0.71 isn't the solution yet. I go to Meta SE, then to an article. When I want back to Meta SE again, it crashes. Much earlier than before. I already sent in a bug report for this.  Another Edit  I can describe it better now. From the questions-page of a site I go to a post. When I use the back button, everything is ok, I can go to the next site. When I try to go to the next site directly from the post, it crashes. This only happens on the Nexus 10 with Android 5.1.1, App version 1.0.71. Hope this helps.  Edit3  This is fixed in 1.0.73 now. Thanks again.