Questions tagged [autopep8]

autopep8 automatically formats Python code to conform to the PEP 8 style guide.

99 questions
0
votes
0 answers

Show pep8 errors as you type in Jupyter notebook

I just successfully installed autopep8 in Jupyter and I am able to use hot keys and/or click the gavel to correct cells. However, I was really hoping that I would see pep8 errors/suggestions as I typed, so that I could learn proper code…
0
votes
2 answers

How can I change the path in VS Code to the extension and what is the correct path to autopep8 if I already installed the python extension?

I receive this error when trying to install module "autopep8" for VS Code: rrgut@DESKTOP-NQJ4S14 MINGW64 ~/Documents/Raymond/HelloWorld $ C:/Users/rrgut/AppData/Local/Programs/Python/Python39/python.exe…
Razor One
  • 1
  • 1
0
votes
2 answers

How can I change tab size of python code in vs code

When I type the python code in vs code, indent tab size is 2. But when I save the file, tab size is changed to 4. I think this is because of autopep8. How can I change the tab size, when I save the python code? ※ I already change editor.tabsize to 2
HyungHo
  • 19
  • 6
0
votes
0 answers

Can Autopep8 Support `source python django` in the grammar?

I am using atom with django and python-autopep8 package for code formatting, In Atom grammar-selector The package work fine with files uses source python. My question is there a way to use autopep8 with files usessource python django ?
AMINE BIDDA
  • 21
  • 1
  • 3
0
votes
0 answers

Geting EOF error when trying to use autopep8

I'm trying to use autopep8 in order to correct automatically pep errors. I passed this command using the anaconda cmd: $ autopep8 --in-place --aggressive --aggressive machin.py I got this error: for name in dir(): ^ SyntaxError:…
HSN
  • 23
  • 1
  • 5
0
votes
1 answer

How to use autopep8 to format code in Spyder / Anaconda

I have been looking for the correct installation instructions to properly install Spyder with Anaconda and then use the autopep8 plugin to format my python code when I am working on Spyder. I was not able to find a single place with the proper…
Johnny
  • 819
  • 1
  • 10
  • 24
0
votes
1 answer

How do you install autopep8 into python 3x on a Mac?

I have a Mac and have installed the latest version of Python 3.x, and I downloaded/installed autopep8, but it got installed into the Python 2 directory. I need autopep8 to be installed on the Python 3 directory. Can that be done? $ pip install…
JDeLeon
  • 9
  • 4
0
votes
1 answer

How can I convert multi-line Python code to a single line?

I have some code like: imgs, original_img, original_size = load_img(INPUT_IMG_FILE, input_size=NETWORK_INPUT_SIZE, preprocess_fn=resnet.preprocess_input) It…
Shamoon
  • 41,293
  • 91
  • 306
  • 570
0
votes
1 answer

Python Auto-Formatting Adds Extra Spaces

The problem I have been facing related to auto formatting in Visual Studio Code for my Python Files. I like using tabs in Python, since it makes it easier to be consistent and type code quicker; however, when I save on Visual Studio Code the…
Miguel Tapia
  • 3
  • 1
  • 4
0
votes
1 answer

installing pip autopep8 failed, invalid syntax?

everyone. I just started to learn python, and am currently trying to add some nice additional features to Atom. I was trying to follow the steps from the video "Setting up a Python Development Environment in Atom":…
0
votes
1 answer

Project level control over use of autopep8

I have a situation where I have configured the use of autopep8 globally but now I need to disable it for certain projects but not others. Is this possible and, if so, how can it be done?
Jonathan
  • 2,635
  • 3
  • 30
  • 49
0
votes
1 answer

What kind of object do I need to use the options parameter of fix_multiple_files?

I need to create a simple script for fixing indentation in python scripts of the repository. I found fix_multiple_files in autopep8 module: import autopep8 autopep8.fix_multiple_files('/home/playrix/work/ci-teamcity/scripts/', options={'recursive':…
0
votes
0 answers

Automatically fixing python indentations

I have code without correct indentations if age > 18: if salary > 100000: print('success') elif salary < 50000: print('fail') else: print('get_more_info') else: print('fail') I need to get if age > 18: if salary > 100000: …
Petr Petrov
  • 4,090
  • 10
  • 31
  • 68
0
votes
1 answer

Exclude file in PyDev formatter

In Eclipse PyDev I use autopep8.py for code formatting. I also have "Auto-format editor contents before saving" switched on. In >99% of all situations this is exactly what I want. However, I have a set of files with large tables that I wish that…
Habba
  • 33
  • 5
0
votes
1 answer

AutoPEP8, Anaconda, Sublime Text 3 Inconsistent Error Reporting

Please reference the attached screenshot. I am working on a scrapy pipeline. I am using Sublime Text 3 with Anaconda/AutoPep8. I just moved over from ST2 where I did not have AutoPep8 or Anaconda. The huge white dot is telling me that this line has…
Malik A. Rumi
  • 1,855
  • 4
  • 25
  • 36