Re: [Tutor] missing idlelib and pip

2017-11-01 Thread Paul Simon

On 11/1/2017 9:08 AM, Mats Wichmann wrote:

On 11/01/17 04:39, Alan Gauld via Tutor wrote:

On 01/11/17 04:30, Paul Simon wrote:

The python distribution for the Mageia 6 update does not include idlelib
or pip.  Please tell me where to find them to add.


IDLE should be in your package manager - along with zillions of
other Python packages. You should just need to select it and
install it. The caveat is that I don't use Mageia but that's
how it works on every other Linux Python I've used.

On my Mint system I use Synaptic as a package manager and typing
idle into the search box brings up a long list in the form

idle-pythonX.Y

Where X.Y represent every version from 2.3 through to 3.6
Just select the version corresponding to your installed
Python.



Mageia is a descendant of Mandrake, which once upon a time (should be
over a decade ago by now) I used as my main system.  If they haven't
changed away, that means you would search using urpmi... but you've
indicated you have asked them for things and not gotten a satisfactory
answer.

You can _always_ just install your own Python environment.  I have used
this to simplify management/installation:

https://github.com/pyenv/pyenv

Once you are running in a Python you have installed and are not messing
up the system version, you should be able to install whatever you want,
however you want, outside of whatever you think the distribution isn't
doing right. Installing from source the way pyenv does means you have  a
full build, not one that's been segmented into sub-packages the way
Linux distributions do.

Note: IDLE would require a properly working tkinter, which requires a
working tk library, which should not actually be a problem, it's not a
tough thing to do, but has managed to trip up many people (for example,
the system-provided tk on MacOS is not functional for this use so a lot
of people have had IDLE problems there).  Don't feel you _have_ to use
IDLE as your interactive programming environment, there are tons of
other choices - the python.org website has a page of links.


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

Thank you all very much.  All is working fine now.  I had always assumed 
that Idle and pip were installed with the standard library and not have 
to be separately installed.  My experience is not much above novice and 
whenever I upgrade versions of Mageia I ask for help, sometimes in not 
the nicest way.  I'm a bit older andmy  memory is not always the best.


Paul Simon

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


Re: [Tutor] missing idlelib and pip

2017-11-01 Thread Paul Simon

On 11/1/2017 9:08 AM, Mats Wichmann wrote:

On 11/01/17 04:39, Alan Gauld via Tutor wrote:

On 01/11/17 04:30, Paul Simon wrote:

The python distribution for the Mageia 6 update does not include idlelib
or pip.  Please tell me where to find them to add.


IDLE should be in your package manager - along with zillions of
other Python packages. You should just need to select it and
install it. The caveat is that I don't use Mageia but that's
how it works on every other Linux Python I've used.

On my Mint system I use Synaptic as a package manager and typing
idle into the search box brings up a long list in the form

idle-pythonX.Y

Where X.Y represent every version from 2.3 through to 3.6
Just select the version corresponding to your installed
Python.



Mageia is a descendant of Mandrake, which once upon a time (should be
over a decade ago by now) I used as my main system.  If they haven't
changed away, that means you would search using urpmi... but you've
indicated you have asked them for things and not gotten a satisfactory
answer.

You can _always_ just install your own Python environment.  I have used
this to simplify management/installation:

https://github.com/pyenv/pyenv

Once you are running in a Python you have installed and are not messing
up the system version, you should be able to install whatever you want,
however you want, outside of whatever you think the distribution isn't
doing right. Installing from source the way pyenv does means you have  a
full build, not one that's been segmented into sub-packages the way
Linux distributions do.

Note: IDLE would require a properly working tkinter, which requires a
working tk library, which should not actually be a problem, it's not a
tough thing to do, but has managed to trip up many people (for example,
the system-provided tk on MacOS is not functional for this use so a lot
of people have had IDLE problems there).  Don't feel you _have_ to use
IDLE as your interactive programming environment, there are tons of
other choices - the python.org website has a page of links.


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

Thank you all very much.  I assumed it was always installed with the 
standard library, and every time I upgrade to a new version of Mageia, I 
have the same problem and can never remember what I have done before. 
Pat of the problem for me is that idle is automatically installed with 
the Windows version.

I got a lot of help from the Mageia group and now have all installed.

Paul Simon

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


[Tutor] missing idlelib and pip

2017-10-31 Thread Paul Simon
The python distribution for the Mageia 6 update does not include idlelib 
or pip.  Please tell me where to find them to add.


This seems to be a constant issue with linux distributions of python.  I 
tried to have idlelib added to the Mageia 6 update and all I got was 
vague noise and nothing done.


Paul Simon

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


Re: [Tutor] truncated dictionary return

2013-12-01 Thread Paul Simon
Wolfgang Maier wolfgang.ma...@biologie.uni-freiburg.de wrote in message 
news:loom.20131201t230651-...@post.gmane.org...
 richard kappler richkappler at gmail.com writes:


 I have a script that reads sensor values gathered by an Arduino board 
 from
 serial as a dictionary, said values to later be used in the AI for Nav 
 Control. Here's the script:
 #!/usr/bin/python


 def sensorRead():
 import serial
 from time import sleep

 sensors = {}
 sensors = dict.fromkeys('Sonar1 Sonar2 Sonar3 Sonar4 Dewpoint
 Temperature Humidity Light'.split())

 arduino = serial.Serial('/dev/ttyACM0', 9600)
 sleep(1)
 line = arduino.readline().strip()
 line = line.lstrip('{').rstrip('}').strip()

 d = {}
 for item in line.split(','):
 item = item.strip()
 key, value = item.split(':')
 key = key.strip()

 value = value.strip()
 d[key]=int(value)
 return d

 The script works great with one exception. I understand the problem, I'm
 just not sure how to address it. The problem is:

 The Arduino runs on a constant loop, it reads each sensor, sends the key
 and the value to the serial bus in format for python to read it as a
 dictionary, lather, rinse, repeat.

 Python querries the bus when told. Usually the python script gets the 
 full
 dictionary (all 8 values with keys, brackets etc) but sometimes it 
 doesn't.
 Sometimes it only gets the last few values, sometimes it gets nothing or
 misses a bracket and throws an error. This makes sense. They are not in 
 sync.

 What I need to figure out how to do is have the python script wait until
 the next round of values as signified by the opening bracket { or check
 that it has all 8 values and if not retry or something.

 There should be no sync issue here. The readline method should read from 
 the
 serial port until it reaches an EOL character, then return the whole line
 (i.e., your sleep(1) should be removed since readline() already waits for
 input).
 From what you're describing, the real issue seems to be on the side of the
 sender. Are you sure, it terminates each line with \n as it should? Where 
 is
 that code coming from?
 Best,
 Wolfgang

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

I also suspect sleep doesn't work.  Two better options would be:
1. read/loop until line terminator,
2. Use serial signals, i.e., RTS/DTS if possible.

Paul  Simon 



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