[Tutor] Python 3.5.2 Installaton Question

2016-10-21 Thread Viraja Chandrashekhar Khatu
Hello,


I have a quick question about installing Python 3.5.2 on my Windows 7 laptop.


I already have Python 2.7.1 installed on my laptop. However, I now wish to 
switch to Python 3.5.2, which is the latest release. My question is:


Do I have to completely uninstall Python 2.7.1 and then install Python 3.5.2? 
Or can I still install Python 3.5.2 keeping Python 2.7.1 untouched on my 
laptop? Even if the second option would work, what is recommended to be done so 
that both versions do not show any kind of interference while programming in 
Python?


Kindly confirm at your earliest.


Thanks and Regards


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


Re: [Tutor] Python 3.5.2 Installaton Question

2016-10-21 Thread bharath ks via Tutor
Hello,
You could you have multiple version of python on your system. It's not 
necessary to uninstall the older version.
you can look at this link for more infoHow to run different python versions in 
cmd

  
|  
|   
|   
|   ||

   |

  |
|  
|   |  
How to run different python versions in cmd
 How can I configure windows command dialog to run different python versions in 
it? For example when I type pytho...  |   |

  |

  |

 

 
Thanks & BR, Bharath Shetty 

On Friday, 21 October 2016 11:38 AM, Viraja Chandrashekhar Khatu 
 wrote:
 

 Hello,


I have a quick question about installing Python 3.5.2 on my Windows 7 laptop.


I already have Python 2.7.1 installed on my laptop. However, I now wish to 
switch to Python 3.5.2, which is the latest release. My question is:


Do I have to completely uninstall Python 2.7.1 and then install Python 3.5.2? 
Or can I still install Python 3.5.2 keeping Python 2.7.1 untouched on my 
laptop? Even if the second option would work, what is recommended to be done so 
that both versions do not show any kind of interference while programming in 
Python?


Kindly confirm at your earliest.


Thanks and Regards


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


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


[Tutor] a bit off topic.. - more of a high level arch question!

2016-10-21 Thread bruce
Hi.

Thinking of a situation where I have two "processes" running. They
each want to operate on a list of files in the dir on a first come
first operate basis. Once a process finishes with the file, it deletes
it.

Only one process operates on a file.

I'm curious for ideas/thoughts.

As far as I can tell, using some sort of PID/Lock file is "the" way of
handling this.

ProcessA looks to see if the PIDFile is in use,
 If it is, I wait a "bit"
 if the PIDFile is "empty", I set it an proceed
   --when I finish my work, i reset the PIDFile


As long as both/all processes follow this logic,
 things should work, unless you get a "race" condition
 on the PIDFile..

Any thoughts on how you might handle this kind of situation, short of
having a master process, that forks/spawns of children, with the
master iterating through the list of files..

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


Re: [Tutor] Python 3.5.2 Installaton Question

2016-10-21 Thread niraj pandey
Hi ,

In Linux I have multiple version of python on separate location and so far
I do not see any issue .
So I think you can also install multiple version of python on your window
system as well. You may just need to provide separate installation
directory path to install it on another location without overwrite the
previous version.

Thanks
Niraj

On Fri, Oct 21, 2016 at 7:38 AM, Viraja Chandrashekhar Khatu 
wrote:

> Hello,
>
>
> I have a quick question about installing Python 3.5.2 on my Windows 7
> laptop.
>
>
> I already have Python 2.7.1 installed on my laptop. However, I now wish to
> switch to Python 3.5.2, which is the latest release. My question is:
>
>
> Do I have to completely uninstall Python 2.7.1 and then install Python
> 3.5.2? Or can I still install Python 3.5.2 keeping Python 2.7.1 untouched
> on my laptop? Even if the second option would work, what is recommended to
> be done so that both versions do not show any kind of interference while
> programming in Python?
>
>
> Kindly confirm at your earliest.
>
>
> Thanks and Regards
>
>
> Viraja Khatu
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>



-- 
Success occurs when opportunity and preparation meet
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] a bit off topic.. - more of a high level arch question!

2016-10-21 Thread Danny Yoo
> Thinking of a situation where I have two "processes" running. They
> each want to operate on a list of files in the dir on a first come
> first operate basis. Once a process finishes with the file, it deletes
> it.
>
> Only one process operates on a file.
>
> I'm curious for ideas/thoughts.


Hi Bruce,

An inter-process locking approach seems straightforward: it allows us
to make sure that only one process is running a particular section of
code at once.  In your case, this allows us to make sure the worker
processes don't get mixed up when deciding what to work on next.

I know that there's some built-in support for file locks in the
standard library, but on brief glance, it looks a bit low-level.

https://docs.python.org/3.6/library/fcntl.html#fcntl.lockf

... I wonder if there is a nicer API for this.  I've been out of the
loop in terms of what third-party Python libraries are in vogue these
days, but let me do a few searches...

Ok, the following library might be helpful:

http://fasteners.readthedocs.io/en/latest/
http://fasteners.readthedocs.io/en/latest/examples.html#interprocess-locks

Does anyone have experience with this "fasteners" library?  It looks
promising!  It appears to provide a nice library for using lock files
for inter-process synchronization; their example of interprocess locks
seems straightforward.


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


[Tutor] Fwd: Re: Fwd: Re: Created map after opening file

2016-10-21 Thread Alan Gauld

Forwarding to list

 Forwarded Message 



I can now see my data.

Current view: https://s15.postimg.org/ni570gxl7/pyscreenshot2.png

Yes, you are correct on how the points are going to be plotted. My
question is, how do you plot only rows on python?
I found an example online, but the data is in columns.
(http://www.ast.uct.ac.za/~sarblyth/pythonGuide/PythonPlottingBeginnersGuide.pdf,
pg. 14).

How do I change this particular part on the example so it reads the
rows: pl.plot(data[:,0], data[:,1], ’ro’):: Or will this not work in
this case? I was thinking of making two arrays like this: x=np.array []
and y=np.array[] and the inserting the data between the brackets, but
then though wouldn't that defeat the purpose of the file?


On Thu, Oct 20, 2016 at 12:45 PM, Alan Gauld mailto:alan.ga...@alan-g.me.uk>> wrote:

Resending after mail error, apologies if you get two!

---
Always use Reply All (Or Reply List) to reply to the tutor list...

On 20/10/16 14:45, Betty Cruz wrote:
> I had actually attached the map and how the data looked. I guess the
> pictures didn't go through? I have added links.
>

The server often strips attachments, it's always better to
include as text or provide a link if it's big.


>
> The data looks like this:
> 1 1 1 7367   7367   7367
> 1 29410 29410 29410 29410 36101

So the points you want to plot are:

(1,1), (1,294210),(1,29410)(again?), (7367,29410)...

correct?

> https://i.stack.imgur.com/tUvBj.png

>
> I have tried printing it out, but I just get this error: No such file
> or directory: 'map.dat'

Have you tried using the full path?

eg:
data = np.loadtxt(r'C:/myfolder/map.dat')

Python is looking in the current working directory
for the file and not finding it.

> I added print (data) after data = np.loadtxt('map.dat'), but that
> didn't work.

Yes, that will only work once you get the file path sorted out.


--
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





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


Re: [Tutor] Python 3.5.2 Installaton Question

2016-10-21 Thread Raghunadh
Hi Niraj,

Try virtual environments in python.
More helpful to deal with multiple versions.

Regards
Raghunadh

On October 21, 2016, at 12:10 PM, niraj pandey  
wrote:

Hi ,

In Linux I have multiple version of python on separate location and so far
I do not see any issue .
So I think you can also install multiple version of python on your window
system as well. You may just need to provide separate installation
directory path to install it on another location without overwrite the
previous version.

Thanks
Niraj

On Fri, Oct 21, 2016 at 7:38 AM, Viraja Chandrashekhar Khatu 
wrote:

> Hello,
>
>
> I have a quick question about installing Python 3.5.2 on my Windows 7
> laptop.
>
>
> I already have Python 2.7.1 installed on my laptop. However, I now wish to
> switch to Python 3.5.2, which is the latest release. My question is:
>
>
> Do I have to completely uninstall Python 2.7.1 and then install Python
> 3.5.2? Or can I still install Python 3.5.2 keeping Python 2.7.1 untouched
> on my laptop? Even if the second option would work, what is recommended to
> be done so that both versions do not show any kind of interference while
> programming in Python?
>
>
> Kindly confirm at your earliest.
>
>
> Thanks and Regards
>
>
> Viraja Khatu
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>



-- 
Success occurs when opportunity and preparation meet
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor