About 50 results
Open links in new tab
  1. How do I autoformat some Python code to be correctly formatted?

    Use reindent.py. It should come with the standard distribution of Python, though on Ubuntu you need to install the python2.6-examples package. You can also find it on the web. This script attempts to …

  2. What is the common header format of Python files?

    Oct 6, 2009 · Its all metadata for the Foobar module. The first one is the docstring of the module, that is already explained in Peter's answer. How do I organize my modules (source files)? (Archive) The …

  3. How do I convert a IPython Notebook into a Python file via …

    Jun 13, 2013 · Is there a way to do the reverse i.e convert from a python script to a notebook. For ex - having some specialized docstrings that are parsed into cells ?

  4. How can I pretty-print JSON in a shell script? - Stack Overflow

    Dec 9, 2008 · With python -mjson.tool I can pretty print a 96KB json file in 0.1s - the json output of earthporn that jshon links to is about 24KB and I can pretty print that in 0.08s.

  5. pandas - how to format excel file using python? - Stack Overflow

    Mar 5, 2021 · I have a script that scrapes data from list of websites using beautifulSoup package and save in an excel file using pandas and xlsxwriter packages. What i want is to be able to format the …

  6. How to call clang-format from Python script - Stack Overflow

    Feb 28, 2019 · The problem is that I'm getting some differences due to the format. I can run clang-format on the expected output file. What I'm still trying to do is to run clang-format on the generated files, …

  7. How would you save a simple settings/configuration file in Python?

    Oct 27, 2024 · Configuration files in Python There are several ways to do this depending on the file format required. ConfigParser [.ini format] I would use the standard configparser approach unless …

  8. python - What does if __name__ == "__main__": do? - Stack Overflow

    Jan 7, 2009 · When you run python helloworld.py it will run the whole script file (whether you specify if __name__ == "__main__" or not ) . There is only a difference in execution when you are importing …

  9. Which format should I save my python script output?

    Aug 19, 2010 · Which format should I save my python script output? Asked 15 years, 6 months ago Modified 15 years, 6 months ago Viewed 1k times

  10. How to get JSON from webpage into Python script

    32 This gets a dictionary in JSON format from a webpage with Python 2.X and Python 3.X: