How can I access modules from another folder?  Here's the file structure:  /&lt;appname&gt;     /config         __init__.py         config.py     /test         test.py # I'm here   I wanted to access the functions from config.py from test.py . How would I do this? Here is my import:  import config.config   When I run the test.py script, it will always say:  ImportError: No module named config.config   Did I do something wrong?
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.
error tex capacity exceeded log files added I am having a hard time figuring out where the problem is with my code/workflow. I previously posted this question , but then the same problem came straight back. When I run it in tex, I get an error input limit exceeded. The exact log is pasted below:  This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9.6210 64-bit) (preloaded format=pdflatex 2017.1.26)  26 JAN 2017 20:45 entering extended mode **./master.tex (master.tex LaTeX2e &lt;2016/03/31&gt; patch level 3 Babel &lt;3.9r&gt; and hyphenation patterns for 75 language(s) loaded. ("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls" Document Class: article 2014/09/29 v1.4h Standard LaTeX document class ("C:\Program Files\MiKTeX 2.9\tex\latex\base\size11.clo" File: size11.clo 2014/09/29 v1.4h Standard LaTeX file (size option) ) \c@part=\count79 \c@section=\count80 \c@subsection=\count81 \c@subsubsection=\count82 \c@paragraph=\count83 \c@subparagraph=\count84 \c@figure=\count85 \c@table=\count86 \abovecaptionskip=\skip41 \belowcaptionskip=\skip42 \bibindent=\dimen102 ) ("C:\Program Files\MiKTeX 2.9\tex\latex\apacite\apacite.sty" Package: apacite 2013/07/21 v6.03 APA citation \c@BibCnt=\count87 \bibleftmargin=\skip43 \bibindent=\skip44 \bibparsep=\skip45 \bibitemsep=\skip46 \biblabelsep=\skip47 ) No file master.aux. \openout1 = `master.aux'.  LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 5. LaTeX Font Info:    ... okay on input line 5. LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 5. LaTeX Font Info:    ... okay on input line 5. LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 5. LaTeX Font Info:    ... okay on input line 5. LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 5. LaTeX Font Info:    ... okay on input line 5. LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 5. LaTeX Font Info:    ... okay on input line 5. LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 5. LaTeX Font Info:    ... okay on input line 5. \c@maskedRefs=\count88 ("C:\Program Files\MiKTeX 2.9\tex\latex\apacite\english.apc" File: english.apc 2013/07/21 v6.03 apacite language file LaTeX Info: Redefining \BPBI on input line 129. LaTeX Info: Redefining \BHBI on input line 130. ) ! TeX capacity exceeded, sorry [input stack size=5000]. \AtBeginDocument #1-&gt;#1  l.5 \begin{document}  If you really absolutely need more capacity, you can ask a wizard to enlarge me.   Here is how much of TeX's memory you used:  641 strings out of 493333  7639 string characters out of 3139188  74825 words of memory out of 3000000  4254 multiletter control sequences out of 15000+200000  3940 words of font info for 15 fonts, out of 3000000 for 9000  1141 hyphenation exceptions out of 8191  5000i,0n,4998p,136b,36s stack positions out of 5000i,500n,10000p,200000b,50000s !  ==&gt; Fatal error occurred, no output PDF file produced!   I previously posted this question and thought I solved it but am having the same problem again.   The latex code I am trying to execute is below:   \documentclass[11pt,twoside]{article} \usepackage{apacite} \nocite{*}  \begin{document}   % title page. Edit as needed for future publications.  \title{Research Proposal} \author{Teererai Marange \\ Department of Computer Science \\ University of Auckland\\ \texttt{t.marange@auckland.ac.nz}} \date{January 26, 2017} \maketitle % end title page.    % abstract goes here \newpage \begin{abstract} Abstract goes here  \end{abstract} \newpage   % table of contents  \tableofcontents \newpage   %begin introduction  \section {Introduction} Lorem Ipsum Doremifaso   %\cite{Nedakeyword} use to cite     %references our biliography. This must go whereever we use our bibtex references  \bibliography{references} \bibliographystyle{apacite}   \end{document}   and the bib file that I am using to build the bibliography is below:   @misc{wikipedia1,   title = "Scripting language",   author = "Wikipedia",   url = {http://en.wikipedia.org/wiki/Scripting_language},   year = 2014, } Motivation behind standard deviation? Exit strategies for "chameleon questions" I'm not sure if there's already an existing term for this, so I'm inventing my own. (tl;dr: I call them &quot;chameleon questions&quot; because they change every time you submit or edit an answer.  If you're already intimately familiar with the phenomenon, please skip past the first set of bullet points to where I ask for recommendations.)  I think many of us have experienced this on occasion:  You open up a narrow-looking question, usually dealing with some specific error message.  The question probably contains a snippet of sloppy but not quite awful code; code indicating that the author, typically a new/low-rep user, possibly a , doesn't really know what they're doing.  I'm not trying to be condescending here, they're probably very intelligent and hardworking, but in this specific case, they're clearly in way over their head.  However, as a question, it's not really too bad.  The goal and problem are both clearly stated.  The code is formatted (sort of).  Mort was polite and checked their spelling.  The question looks answerable, although from a rep perspective* it's an obvious dead-end, it's had maybe 3 views in the past 30 minutes.  So you decide, you know what, this person took the time to write up the question properly, they deserve an answer, put on your good citizen hat and throw them a bone.  You slog through the ugly code, find the offending line, direct their attention to it and explain why it's wrong and how it needs to be fixed.  Later, they leave a comment saying that yes, that was indeed the problem and your answer helped them fix it (great!).  Oh, but, now there's another problem (uh-oh...). Something else is broken.  After letting out a long sigh, you read the comment and/or edited question, roll up your sleeves, and write up Take 2, hoping that's the end of it.  And of course it's not the end.  Now maybe the error is gone, but it's not doing what it's supposed to.  If you're anything like me, your patience is now starting to wear thin. It's lousy code and you didn't volunteer to help them rewrite their whole app.  And of course, the question still only has 12 views, and nobody has upvoted either the question or your answer, including the person you're helping, so this is turning out to be a genuinely thankless task in all respects.  Welcome to &quot;Family Tech Support&quot;, Web 2.0 Edition.   * Which is of course just an arbitrary number that none of us care about. Not really, anyway. Not very much, at least.  So, here's where I get to my question.  At this point, do you:  Leave a comment, stating as politely as possible that you've done your best to help them answer the original question they asked, and if they have a new problem then they should start a new question?  (I did this once, and actually ended up with an accept, but I felt kind of guilty afterwards, I don't think anybody answered their 2nd question).  Bite the bullet and edit your answer a 3rd, 4th, 5th time, however many times it takes to resolve their issue, knowing full well that they may not even remember to accept the answer once you're done? (I may work for free on SO, but that doesn't mean my time is worthless.)  Just abandon the question, hoping that it will force Mort to start thinking for himself?  Something else?   I've tried all three of the above and none of them ever quite feel right. I do want to help, but at the same time there are a lot more &quot;lucrative&quot; questions I could be answering. And I don't mind spending a lot of time on an answer either, if the question is interesting or important to me, but debugging is dull work. I'd prefer not to reference specific questions here; I'm pretty sure that this is a shared experience, and my objective isn't to point fingers at &quot;misbehaving&quot; members.  I'm more looking for some practical advice on how to dig myself out of these pits of despair. Anybody have any other ideas? Limit of the geometric sequence $\{r^n\}$, with $|r| < 1$, is $0$? Link2SD not working completely Is the energy density of vacuum uniform in the whole universe? Is there a word for four times as much, analogous to once, twice, and thrice? Is there a word for 'four times as much', analogous to once, twice, and thrice? Exact relationship between electric field and intensity I often see $I(t)\propto |E(t)|^2$. What is the exact form ? Which constants are missing to make this an equality and why are they so often omitted ? How to combine bold and "code sample" in Markdown? How can I make a word in a code sample bold? I only see asterisks around the expected bold text.  sample **sample** sample Neopronouns or trolling? It’s the  question: Am I looking at someone’s legitimate pronouns or trolling?   (It’s unfortunate I have to ask, but this is just where we are right now.)  I’ve seen “my pronouns are [insert ridiculous fake stuff here]” trolling recently (in posts) when before I never did. Also stuff that looks to be trolling, but could also maybe not be. Trolls deserve red flags while everyone else specifying pronouns does not, right?  (To clarify, the problem is not just about not wanting to use a troll's words. The purpose of some of this trolling is to try and convince people that transgender people—or their neopronouns—are stupid or unreasonable. Ignoring the trolls allows us to avoid the first problem, but not the second since it allows them to still reach people with their message, which is not something that I want to see promoted.)  Some neopronouns are clearly legitimate. Some trolling is clearly trolling. But unfortunately there’s a big grey area where it’s not clear to me what is what.   Does anyone have a good method for dealing with this? There just doesn’t even seem to be a good way to ask about someone’s specified pronouns in such a way that doesn’t sound insulting if the user isn’t trolling.     Note: A while ago, I did some research on neo-/third person pronouns which can be found . There are several important things I found:   There are more neopronouns than I could ever hope to keep track of The most popular neopronouns are very uncommon. On the other end of the spectrum, it looks like some neopronouns are neologisms used by a single person  Some neopronouns come from unlikely places, such as SciFi Non-uniform distribution of p-values when simulating binomial tests under the null hypothesis I heard that under the null hypothesis the p-value distribution should be uniform. However, simulations of binomial test in MATLAB return very different-from-uniform distributions with mean larger than 0.5 (0.518 in this case):   coin = [0 1]; success_vec = nan(20000,1);  for i = 1:20000     success = 0;     for j = 1:200         success = success + coin(randperm(2,1));     end     success_vec(i) = success; end      p_vec = binocdf(success_vec,200,0.5);     hist(p_vec);   Trying to change the way in which I generate random numbers didn't help.  I would really appreciate any explanation here. Code   find / -name netcdf   Output  find: `/root/.dbus': Permission denied find: `/root/.gconf': Permission denied find: `/root/.gconfd': Permission denied find: `/root/.gnome': Permission denied find: `/root/.gnome2': Permission denied find: `/root/.gnome2_private': Permission denied Perfect set without rational numbers Sorry if this problem is repeated.  Is there a nonempty perfect set in $\mathbb{R}^1$ which contains no rational number?  Proof sketch: This set must be uncountable because any nonempty perfect set in $\mathbb{R}^k$ is uncountable.   We know that Cantor set (C) is perfect set on a line. If we take $E=C+\sqrt{2}=\{x+\sqrt{2}: x\in C\}$. Will this set be an answer to above problem? Why don't the Google Docs CTRL + ALT shortcuts work? I'm currently using Google Docs, but when I try to use the keyboard shortcuts like Ctrl+Alt+M it gives µ instead.    Is Chrome (9) overruling Google Docs in some way?  How can I get these shortcuts working?  I'm using Chrome dev 9 on a Dutch Windows 7 with a US-layout keyboard itoa() is a really handy function to convert a number to a string. Linux does not seem to have itoa(), is there an equivalent function or do I have to use sprintf(str, "%d", num)? Changing the language in Windows 8.1 single language I followed the instructions in this  question  but now windows won't start properly, the screen is on but it's just black and I can see the cursor if I move it but I can't do anything else. Order and degree of a differential equation How to perform Stream functions on an Iterable? How to install MATLAB on Ubuntu 14.04? With the ls command, is it possible to show only the files created after a specific date, hour...?  I'm asking it because I have a directory with thousand of files.  I want so see all files that were created since yesterday.   I use ls -ltr but I have to wait to see all files...  There is an equivalent of DIRECTORY/SINCE=date from OpenVMS ?