code_junkie

Is there a way to convert indentation in Python code to braces?

Nov 11th, 2011
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. def foobar(a, b):
  2. if a == b:
  3. a = a+1
  4. elif a < b:
  5. b = b-1
  6. if b > a: a = a-1
  7. # end if
  8. else:
  9. print 'oops!'
  10. # end if
  11. # end def foobar
  12.  
  13. def foobar(a, b):
  14. if a == b:
  15. a = a+1
  16. elif a < b:
  17. b = b-1
  18. if b > a: a = a-1
  19. else:
  20. print 'oops!'
  21.  
  22. class MyClass(object): #{
  23. def myfunction(self, arg1, arg2): #{
  24. for i in range(arg1): #{
  25. print i
  26. #}
  27. #}
  28. #}
  29.  
  30. fi = endclass = enddef = endclass = done = None
  31. class MyClass(object):
  32. def myfunction(self, arg1, arg2):
  33. for i in range(arg1): #do
  34. if i > 5: #then
  35. print i
  36. fi
  37. done
  38. enddef
  39. endclass
  40.  
  41. class MyClass(object): #{
  42. def myfunction(self, arg1, arg2): #{
  43. for i in range(arg1): #{
  44. print i
  45. # whoops, forgot to close that bracket!
  46. #}
  47. #}
  48.  
  49. fi = od = yrt = end = lambda object: None;
  50. class MyClass(object):
  51. def myfunction(self, arg1, arg2):
  52. for i in range(arg1) :# do
  53. if i > 5 :# then
  54. print i
  55. fi
  56. od # or end(i) #
  57. end(myfunction)
  58. end(MyClass)
Add Comment
Please, Sign In to add comment