Member Avatar for leegeorg07

im quite new to python and have made a few programs to help me in school but i dont know how to compile them.
i have found a tutorial and have copied the code correctly but python says that the 'import' syntax is incorrect.

this is the code:

from distutils.core import setup import py2exe

setup(console=['2.py'])

how could i fix this?

Recommended Answers

All 3 Replies

Here is a link on how to import modules from the Dive Into Python online book http://www.diveintopython.org/object_oriented_framework/importing_modules.html An online tutorial or book is a good way to start learning. When you just copy something and screw it up, you have no idea what to do, so the place to begin is with a step by step instruction that you understand.

Member Avatar for leegeorg07

thanks for the post but what i mean is that i understand the simple things just not why the syntax error has come up

how could i fix this?

from distutils.core import setup, import, py2exe When you import multiple modules you need to separate with commas.

Or you could just do: from distutils.core import * to get everything within distutils.core

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.