Reputation: 777
I use Sublime Text(the latest version) as the Python editor. But there are some issues. First, I have Python 3.6.1 on my MAC. But this division doesn't work properly in Sublime Text.
For example, when I type
print(3/2)
The result should be 1.5, but it shows 1 instead.
And another one, when I use set,
course = {'Math', 'English', 'Digital Circuit Design', 'Python'}
print(course)
The result is also a little weird.
set(['Python', 'English', 'Math', 'Digital Circuit Design'])
Is there some kind of configuration setting or something?
When I build with the new build system, then it shows this following:
[Errno 2] No such file or directory: 'python3'
[cmd: ['python3', '-u', '/Users/L/Desktop/Python/Tutorial3.py']]
[dir: /Users/L/Desktop/Python]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
[Finished]
Upvotes: 0
Views: 108
Reputation: 9647
Are you sure that you are using Python 3? Because Python 2 returns 1
and Python 3 returns 1.5
If your Sublime does use Python 2 build options (default is Python 2), you can change it to Python 3 like this:
Tools > Build System > New Build System
Use following configuration to declare a new build system.
{
"cmd": ["python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
Build with this new system.
Done.
Read also: http://docs.sublimetext.info/en/latest/file_processing/build_systems.html
Extra troubleshooting from comments with help of AdamSmith:
If you get such an error: [Errno 2] No such file or directory: 'python3'
Try replacing python3
part of the configuration with full path.
You can find full path by which python3
command.
Upvotes: 3