Indentation problem with python3 and vim
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
0
down vote
favorite
A sample of my python file is
def __init__(self, csvFile, chunksize=10000):
self.newName = csvFile[:-4]
import ipdb; ipdb.set_trace()
self.csvFile=csvFile
self.chunksize=int(chunksize)
self.headers_without_timestamp = header_without_timestamp
self.total_rows = 0
self.username=username
self.password=password
self.dbname="data"
and it is well written.
I have the little error, but I can't fix it. When I ran the command python3 Final_Fast_Version_Waqar.py ~/home/Data/DCIX_OB.csv 1000 7
, I got
File "Final_Fast_Version_Waqar.py", line 37
import ipdb; ipdb.set_trace()
^
TabError: inconsistent use of tabs and spaces in indentation
It is a problem related to the vim editor I guess because I set up an Ubuntu server and installed vim very recently. How can I fix the indentation error?
python vim
add a comment |Â
up vote
0
down vote
favorite
A sample of my python file is
def __init__(self, csvFile, chunksize=10000):
self.newName = csvFile[:-4]
import ipdb; ipdb.set_trace()
self.csvFile=csvFile
self.chunksize=int(chunksize)
self.headers_without_timestamp = header_without_timestamp
self.total_rows = 0
self.username=username
self.password=password
self.dbname="data"
and it is well written.
I have the little error, but I can't fix it. When I ran the command python3 Final_Fast_Version_Waqar.py ~/home/Data/DCIX_OB.csv 1000 7
, I got
File "Final_Fast_Version_Waqar.py", line 37
import ipdb; ipdb.set_trace()
^
TabError: inconsistent use of tabs and spaces in indentation
It is a problem related to the vim editor I guess because I set up an Ubuntu server and installed vim very recently. How can I fix the indentation error?
python vim
Were you using Vim to write the script?
â ubashu
May 16 at 2:44
Yes, write this script with Vim.
â Jeremie
May 16 at 2:44
The error says it all actually, you're mixing tabs and spaces. Double check that you only use one of the two (4 spaces is preferred) for indentation.
â Timo
May 16 at 7:49
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
A sample of my python file is
def __init__(self, csvFile, chunksize=10000):
self.newName = csvFile[:-4]
import ipdb; ipdb.set_trace()
self.csvFile=csvFile
self.chunksize=int(chunksize)
self.headers_without_timestamp = header_without_timestamp
self.total_rows = 0
self.username=username
self.password=password
self.dbname="data"
and it is well written.
I have the little error, but I can't fix it. When I ran the command python3 Final_Fast_Version_Waqar.py ~/home/Data/DCIX_OB.csv 1000 7
, I got
File "Final_Fast_Version_Waqar.py", line 37
import ipdb; ipdb.set_trace()
^
TabError: inconsistent use of tabs and spaces in indentation
It is a problem related to the vim editor I guess because I set up an Ubuntu server and installed vim very recently. How can I fix the indentation error?
python vim
A sample of my python file is
def __init__(self, csvFile, chunksize=10000):
self.newName = csvFile[:-4]
import ipdb; ipdb.set_trace()
self.csvFile=csvFile
self.chunksize=int(chunksize)
self.headers_without_timestamp = header_without_timestamp
self.total_rows = 0
self.username=username
self.password=password
self.dbname="data"
and it is well written.
I have the little error, but I can't fix it. When I ran the command python3 Final_Fast_Version_Waqar.py ~/home/Data/DCIX_OB.csv 1000 7
, I got
File "Final_Fast_Version_Waqar.py", line 37
import ipdb; ipdb.set_trace()
^
TabError: inconsistent use of tabs and spaces in indentation
It is a problem related to the vim editor I guess because I set up an Ubuntu server and installed vim very recently. How can I fix the indentation error?
python vim
asked May 16 at 2:23
Jeremie
33
33
Were you using Vim to write the script?
â ubashu
May 16 at 2:44
Yes, write this script with Vim.
â Jeremie
May 16 at 2:44
The error says it all actually, you're mixing tabs and spaces. Double check that you only use one of the two (4 spaces is preferred) for indentation.
â Timo
May 16 at 7:49
add a comment |Â
Were you using Vim to write the script?
â ubashu
May 16 at 2:44
Yes, write this script with Vim.
â Jeremie
May 16 at 2:44
The error says it all actually, you're mixing tabs and spaces. Double check that you only use one of the two (4 spaces is preferred) for indentation.
â Timo
May 16 at 7:49
Were you using Vim to write the script?
â ubashu
May 16 at 2:44
Were you using Vim to write the script?
â ubashu
May 16 at 2:44
Yes, write this script with Vim.
â Jeremie
May 16 at 2:44
Yes, write this script with Vim.
â Jeremie
May 16 at 2:44
The error says it all actually, you're mixing tabs and spaces. Double check that you only use one of the two (4 spaces is preferred) for indentation.
â Timo
May 16 at 7:49
The error says it all actually, you're mixing tabs and spaces. Double check that you only use one of the two (4 spaces is preferred) for indentation.
â Timo
May 16 at 7:49
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1036767%2findentation-problem-with-python3-and-vim%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Were you using Vim to write the script?
â ubashu
May 16 at 2:44
Yes, write this script with Vim.
â Jeremie
May 16 at 2:44
The error says it all actually, you're mixing tabs and spaces. Double check that you only use one of the two (4 spaces is preferred) for indentation.
â Timo
May 16 at 7:49