Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Activity for J-henâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #285274 | Initial revision | — | about 3 years ago |
Question | — |
Open file in script's own folder I have a Python script that needs to access some data (or configuration) file in its very own folder. For example, say `script.py` does something like this: ```python with open('data.txt') as file: data = file.read() ``` The script will find the file, `data.txt`, if it is run in the term... (more) |
— | about 3 years ago |
Edit | Post #284975 | Initial revision | — | about 3 years ago |
Answer | — |
A: Docutils rst2pseudoxml.py reported error: No role entry for "meth" There is no resolution for this issue as the `meth` role is a syntax extension defined by Sphinx, in what it calls the Python "domain". The standard reStructuredText roles that Docutils supports do not include `meth`. (more) |
— | about 3 years ago |
Edit | Post #284646 | Initial revision | — | about 3 years ago |
Question | — |
What is the purpose of `if __name__ == '__main__'`? I often see the construct `if name == 'main'` in Python code. For example, the `queens.py` demo in the Python repository ends with these two lines: ```python if name == "main": main() ``` However, the `beer.py` demo does not. Both run just fine and display things in the console. Moreover, ... (more) |
— | about 3 years ago |
Edit | Post #281519 |
Post edited: Fixed typos. |
— | over 3 years ago |
Suggested Edit | Post #281519 |
Suggested edit: Fixed typos. (more) |
helpful | over 3 years ago |