Re: [Tutor] Total newbie question

2017-01-04 Thread Alan Gauld via Tutor
On 04/01/17 06:51, MR ZenWiz wrote:

> It appears that while python is installed in /usr/bin, idle is in
> /usr/local/bin and expects the python interpreter to be also under
> /usr/local, which does not seem to be the default.
> 
> I created a symlink 'ln -s /usr/bin/python3.5
> /usr/local/bin/python3.5' and now idle comes up.

Did you install the idle-python3.5 package too?
That should have created a launcher in your menu system for idle.

On Ubuntu (and most Linux systems) you have to install "extra"
features like idle as packages. It's well worth browsing the
available python packages using synaptic, or whatever manager
you prefer.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Total newbie question

2017-01-04 Thread MR ZenWiz
On Tue, Jan 3, 2017 at 5:15 PM, Cameron Simpson  wrote:
> On 03Jan2017 17:07, Peter Otten <__pete...@web.de> wrote:
>>
>> Cameron Simpson wrote:
>>>
>>> On 02Jan2017 17:21, MR ZenWiz  wrote:

 I'm trying to install python 4.6 on my Xubuntu 16.04 desktop, [...]
 INFO: Can't locate Tcl/Tk libs and/or headers
>>>
>>> You lack the tk development libraries and/or headers. Try (as root):
>>>   apt-get install tk-dev
>
> [...]
>>>
>>> You need a bunch of other devleopment libraries too. [...]
>>
>>
>> A nice shortcut for this is to install the build dependencies of the
>> Python
>> 3 used by your distribution:
>>
>> $ sudo apt-get build-dep python3.x
>>
>> Replace x with the actual minor version present on your system.
>
>
> I Did Not Know This!
>
> Yes, that sounds far more reliable than my guess-the-names approach.
>
> Thank you,
>

If that had worked, I'd be quite pleased, but as I posted earlier,
apgt-get claims not to know what to do with that.

I tried deleting all the ~/.local/python3* files and also all python
files in /etc and /usr, then reinstalled all the (previously) system
installed version via synaptic, and python3.5 seems to work as a
command, but idle3 does not:

admar@marbase:~ $ which idle3
/usr/local/bin/idle3
admar@marbase:~ $ which idle3.5
/usr/local/bin/idle3.5
admar@marbase:~ $ which python3
/usr/bin/python3
admar@marbase:~ $ which python3.5
/usr/bin/python3.5
admar@marbase:~ $ idle3
bash: /usr/local/bin/idle3: /usr/local/bin/python3.5: bad interpreter:
No such file or directory
admar@marbase:~ $ idle3.5
bash: /usr/local/bin/idle3.5: /usr/local/bin/python3.5: bad
interpreter: No such file or directory

It appears that while python is installed in /usr/bin, idle is in
/usr/local/bin and expects the python interpreter to be also under
/usr/local, which does not seem to be the default.

I created a symlink 'ln -s /usr/bin/python3.5
/usr/local/bin/python3.5' and now idle comes up.

While this works, it is not at all intuitive (and I haven't exercised
it to see how robust this is).

What would make the idle want something that isn't there without such hackery?

Thanks.
MR
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Total newbie question

2017-01-04 Thread Peter Otten
MR ZenWiz wrote:

> Forgot to include the list.
> 
> 
> On Tue, Jan 3, 2017 at 11:37 AM, MR ZenWiz  wrote:
>> On Tue, Jan 3, 2017 at 8:07 AM, Peter Otten <__pete...@web.de> wrote:
>>> Cameron Simpson wrote:
>>>
 On 02Jan2017 17:21, MR ZenWiz  wrote:
>I'm trying to install python 4.6 on my Xubuntu 16.04 desktop, and I
>keep getting scads of errors that culminate with this from make test:
>
>> :
>>>
>>> A nice shortcut for this is to install the build dependencies of the
>>> Python 3 used by your distribution:
>>>
>>> $ sudo apt-get build-dep python3.x
>>>
>>> Replace x with the actual minor version present on your system.
>>>
>> admar@marbase:~/Downloads $ sudo apt-get build-dev python3.5
>> E: Invalid operation build-dev

It has to be build-dep, not build-dev.


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Fw: path string

2017-01-04 Thread Alan Gauld via Tutor
On 03/01/17 15:59, anatta anatta wrote:

> Please disregard my request below.
> 
> I know the problem!
> 
> I have not defined the variable in question as a global variable.

That's one solution but its not a very good one.

Global variables are not considered good practice for many
reasons. In particular, they make code reuse difficult and
if you ever need to use your code in a multi-threaded
environment, to improve performance say, they are nearly
impossible to work with.

It's much better to pass the required value out of the function
as a return value.

> regret the inconvenience caused.

No inconvenience, its what the list is here for! :-)

hth
-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor