Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

name 'xrange' is not definedRunning the Python command 'CreateSimpleGroup' failed #10

Closed
morganrallen opened this issue Apr 19, 2019 · 2 comments

Comments

@morganrallen
Copy link
Contributor

Hello, trying to get started with Exploded Assembly but it doesn't look like it's working with FreeCAD 0.18.1

name 'xrange' is not definedRunning the Python command 'CreateSimpleGroup' failed:
Traceback (most recent call last):
  File "/home/morgan/.FreeCAD/Mod/ExplodedAssembly/EAInit.py", line 71, in Activated
    ea.createSimpleDisassemble()
  File "/home/morgan/.FreeCAD/Mod/ExplodedAssembly/ExplodedAssembly.py", line 249, in createSimpleDisassemble
    updateTrajectoryLines()
  File "/home/morgan/.FreeCAD/Mod/ExplodedAssembly/ExplodedAssembly.py", line 627, in updateTrajectoryLines
    for s in xrange(len(objects)):

name 'xrange' is not defined
OS: Ubuntu 18.10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.1.
Build type: Release
Python version: 3.6.7
Qt version: 5.11.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)

Let me know if there is any additional info I can provide.

@morganrallen
Copy link
Contributor Author

Oh! It turns out this is simply python 3 not having xrange

I found this reference on Python Central website.

One more thing to add. In Python 3.x, the xrange function does not exist anymore. The range function now does what xrange does in Python 2.x, so to keep your code portable, you might want to stick to using range instead.

Changing all calls to xrange to range was enough to make it work.

@JMG1
Copy link
Owner

JMG1 commented May 22, 2019

Solved with 562c05f

@JMG1 JMG1 closed this as completed May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants