Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread ^Bart

In my experience based on decades of writing programs...

1. The assignment/exercise/problem should be a write a function with a 
particular signature.  So first decide on the signature.


def max3(n1, n2, n3):
     "Return the max of the three inputs."
     return None  # To be replaced.


I need to do this exercize just by using if, elif and else, in the next 
lesson we'll discuss other kind of rules! :)


So I need to insert three int numbers and I should show which is the 
high, the middle and the min.


# Exercize 305

number1 = int( input("Insert the first number: "))

number2 = int( input("Insert the second number: "))

number3 = int( input("Insert the third number: "))

numbermax = number1

numbermiddle = number2

numbermin = number3

if number2 > number1 and number2 > number3:
numbermax = number2

if number3 < number2 and number3 < number1:
numbermin = number3

else:
numbermiddle is number1

print("Number max is: ",numbermax, "Number middle is; 
",numbermiddle,"Number min is: ", numbermin)


if number2 < number1 and number2 < number3:
numbermin = number2

if number3 > number2 and number3 > number1:
numbermax = number3

else:
numbermiddle is number2

print("Number min is: ",numbermin)

I don't understand how could I fix it :\
--
https://mail.python.org/mailman/listinfo/python-list


Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread ^Bart

   You need to do this exercize just by using if, elif and else,
   but in the quotation above, you use "=".


We can use > < and =

Now I wrote:

number1 = int( input("Insert the first number: "))

number2 = int( input("Insert the second number: "))

number3 = int( input("Insert the third number: "))

numbermax = number1

numbermiddle = number2

numbermin = number3

if number2 > number1 and number2 > number3 and number3 < number2 and 
number3 < number1:

numbermin = number3
numbermax = number2
numbermiddle = number1

print("Number max is: ",numbermax, "Number middle is: 
",numbermiddle,"Number min is: ", numbermin)


if number2 < number1 and number2 < number3 and number3 > number2 and 
number3 > number1:

numbermin = number2
numbermax = number3
numbermiddle = number1

print("Number max is: ",numbermax, "Number middle is: 
",numbermiddle,"Number min is: ", numbermin)


else:

print("Number max is: ",number1, "Number middle is: 
",number2,"Number min is: ", number3)


But it doesn't work... :\
--
https://mail.python.org/mailman/listinfo/python-list


Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-27 Thread sjmsoft
After chickening out a couple of times over the past few years, about eight 
months ago we migrated our small code base from 2.7.14 to 3.6.5.  Some notes:

On 2.7 we spent a couple of years coding with 3.x in mind, using import from 
__future__ and coding to Python 3 standards wherever possible.  This greatly 
reduced the number of changes put into production during cutover and got us 
used to Python 3.

We used 2to3.py and found that it handled easy cases (print) well and provided 
a good check on my work when I hand-converted.

The string versus bytes issue was the most difficult.  We receive many files 
from other financial institutions, who receive some of the data from yet other 
FIs.  Most of them seem to have little understanding of, or interest in, 
encodings, and claim to send the files in 'ASCII'.  Python 3 is intolerant of 
dirty data, whereas previous Pythons let anything go.  I because very familiar 
with encoding= and errors= on open().  And network protocols want bytes.

I also suggest paying special attention to division (/).  We used the 
__future__ import to handle this early.

We had some problems installing Python 3.6.5 on Windows Server 2012 that 
already had 2.7, particularly Registry settings that wound up being wrong.  The 
problems seemed to occur erratically, so YMMV.  After some trial and error, we 
chose to leave Python 2.7 installed and install Python launcher for Windows 
(PyLauncher), to allow for easy fallback (which we never had to do) and because 
this provided the smoothest install.

We have found Python 3.6.5 to be very reliable on Windows Server 2012.

My next project is to upgrade to Windows Server 2016 and Python 3.7 on a new 
machine.  We will not be installing Python 2.7 on this machine.

HTH,
  Steve J. Martin


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread Frank Millman

"^Bart"  wrote in message news:q2k1kk$1anf$1...@gioia.aioe.org...


>You need to do this exercize just by using if, elif and else,
>but in the quotation above, you use "=".

We can use > < and =

Now I wrote:

number1 = int( input("Insert the first number: "))

number2 = int( input("Insert the second number: "))

number3 = int( input("Insert the third number: "))



[snip stuff that doesn’t work]



But it doesn't work... :\



You have got to a starting point - you have three numbers. Good.

Where do you do go from here?

I would start with two of the numbers, and work out which one is higher.

Once you know that, you can compare that one with the third number, and work 
out which one is higher.


From that, you can work out which one is the highest of all three.

Then you can apply the same logic to work out which is the lowest.

Give that a go, and come back here if you get stuck.

Frank Millman



--
https://mail.python.org/mailman/listinfo/python-list


ANN: Smil 0.9.1

2019-01-27 Thread Jose Marcio Martins da Cruz


Hi all,

I'm pleased to announce Smil - Simple Morphological Image Library - v. 0.9.1

SMIL is a library with all basic and some advanced mathematical morphology features which can be extended with plugins 
and user modules.


It's been developed in C++ and has a Python interface thanks to Swig.

It's a product of CMM, the research Center of Mathematical Morphology of Mines-Paristech. The discipline of Mathematical 
Morphology was created here in the 60's by Jean Serra and Georges Matheron.


We use Smil in our research activities in the field.

Smil is distributed with GPL license.

You can find Smil - binaries and documentation - at our web site :

http://smil.cmm.mines-paristech.fr

or the source code at :

https://github.com/ensmp-cmm/smil

Thanks

--

 ---
 Jose Marcio MARTINS DA CRUZ, Ph.D.
 Ecole des Mines de Paris
 Centre de Morphologie Mathématique
 ---
 Spam :http://amzn.to/LEscRu ou http://bit.ly/SpamJM
 ---

--
https://mail.python.org/mailman/listinfo/python-list


Problem in Installing version 3.7.2(64 bit)

2019-01-27 Thread Vrinda Bansal
Dear Sir/Madam,

After Installation of the version 3.7.2(64 bit) in Windows 8 when I run the
program it gives an error. Screenshot of the error is attached below.
Please help me.

Regards,
Vrinda Bansal
G-3 Kamla Nagar, Agra
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: preferences file

2019-01-27 Thread Bill Campbell
On Thu, Jan 24, 2019, Dave wrote:
>I'm doing a small application and want to add user preferences.  Did some
>googling to see if there are standard Python ways/tools, but it seems not so
>much.  My specific questions are:
>
>1. Best practices for a user preference file/system?

Generally I put them in the user's $HOME or $HOME/etc directory
with appropriate permissions unless working in a virtual
environement.
>2. File format favored and why - ini, JSON, etc?

I like ini for most user configuration files as the format is
simple, easy to read, and handled nicely with the ConfigParser
libraries.

>3. File location?  I'm using Ubuntu and I believe that the correct location
>would be home/.config/ .  What about Mac and Windows?

See above.  Same for Mac.  I don't do Windows.

Bill
-- 
INTERNET:   b...@celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www2.celestial.com/ 6641 E. Mercer Way
Mobile: (206) 947-5591  PO Box 820
Fax:(206) 232-9186  Mercer Island, WA 98040-0820

The budget should be balanced, the Treasury should be refilled, public
debt should be reduced, the arrogance of officialdom should be
tempered and controlled, and the assistance to foreign lands should be
curtailed lest Rome become bankrupt. People must again learn to work,
instead of living on public assistance. -- Cicero - 55 BC
-- 
https://mail.python.org/mailman/listinfo/python-list


python 3.7.2

2019-01-27 Thread Sarah P
Hi,

I’m having problems installing and using python as it defaults into  [ 
...users/ user/appdata/local/programs/] etc  etc, its about 9 locations in all  
but there is no route to ‘app data’, the trail is lost at this point. Its such 
an obscure location and I cannot find it anywhere on windows, even though it is 
working okay, I’m worried I will lose files.

I cannot transfer files saved on python 3.4 to the new python3.7.2 as I cannot 
find the new version on my computer. In the installer it defaults to this 
location and there is no option to install it anywhere else (greyed out box). 
It says I need write permissions to change the location but no more information 
about how to do this.

Also, I thought it would be an add on, not a whole new download. What happens 
if I delete python 3.4 after I have downloaded 3.7.2? will I lose all my 
existing code samples?
I’m a student programmer and I can’t understand the highly technical, expert 
level documentation that might rectify the problem and there is only a small 
amount of information anyway.
I just want to download Python to C drive on windows, it should be really 
easy...

Hope you can help

Sarah Padden

-- 
https://mail.python.org/mailman/listinfo/python-list


Fatal Python error

2019-01-27 Thread Abdallah Adham
Hey
I am having this problem for about 2 weeks, I can't do anything, so please
give me some instructions so I can solve it.

Fatal Python error: initfsencoding: unable to load the file system code.
ModuleNotFoundError: No module named 'encodings'

:Current thread 0x3c7c (most recent call first

Process finished with exit code -1073740791 (0xC409)

 Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


Sub-Org Applications for GSoC 2019 due soon!

2019-01-27 Thread Matthew Lagoe
Hey all, it's Google Summer of Code time again! PSF Sub-org
applications are due
Febuary 4th so if your project could use some student code this year get moving!

If your project is involved with python and you would be willing to
mentor students
this summer email gsoc-admins at python.org
 so we can make
sure to get your
project on the list. All projects using python are welcome!

We need a good set of sub-organisations and ideas by Feb 4 for our application,
and then if we're accepted by Google, we can add a few other ideas up until
Feb 28 or so.

For those not familiar with it, Google Summer of Code is a mentoring
program where Google provides stipends to pay students to work with
selected open source organizations. PSF has participated for many
years now, and we're hoping to be selected to participate again.

The PSF GSoC page is http://python-gsoc.org/

That has contact information and answers to questions like "what does it
take to be a mentor?" and please feel free to ask if there's more you
want to know!

Thank you!

Matthew Lagoe
-- 
https://mail.python.org/mailman/listinfo/python-list


Unable to install Python 3

2019-01-27 Thread Hemant Mehta
Dear Team,

I am unable to install python 3 in my computer.
Kindly find my system configuration details & error details occured at the time 
of installation.
Please do the needful on priority.


Regards,
Hemant Mehta
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Unable to install Python 3

2019-01-27 Thread Shakti Kumar
On Sun, 27 Jan 2019 at 18:44, Hemant Mehta 
wrote:
>
> Dear Team,
>
> I am unable to install python 3 in my computer.
> Kindly find my system configuration details & error details occured at
the time of installation.

Unable to find the system configuration details & error details.
> *Please do the needful on priority.*
>
>
> Regards,
> Hemant Mehta
> --
> https://mail.python.org/mailman/listinfo/python-list



--
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fatal Python error

2019-01-27 Thread songbird
Abdallah Adham wrote:
> Hey
> I am having this problem for about 2 weeks, I can't do anything, so please
> give me some instructions so I can solve it.
>
> Fatal Python error: initfsencoding: unable to load the file system code.
> ModuleNotFoundError: No module named 'encodings'
>
>:Current thread 0x3c7c (most recent call first
>
> Process finished with exit code -1073740791 (0xC409)

  
https://stackoverflow.com/questions/54087049/fatal-python-error-initfsencoding-unable-to-load-the-file-system-codec


  songbird
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread ^Bart

You have got to a starting point - you have three numbers. Good.

Where do you do go from here?

I would start with two of the numbers, and work out which one is higher.


# SOLVED!!!
number1 = int( input("Insert the first number: "))

number2 = int( input("Insert the second number: "))

number3 = int( input("Insert the third number: "))

numbermax = number1

numbermiddle = number2

numbermin = number3

if number2 > number1 and number2 > number3:
numbermax = number2

print("Number max is: ",numbermax)

if number1 > number2 and number1 > number3:
numbermax = number1

print("Number max is: ",numbermax)

if number3 > number2 and number3 > number1:
numbermax = number3

print("Number max is: ",numbermax)

if number2 < number1 and number2 < number3:
numbermin = number2

print("Number min is: ",numbermin)

if number1 < number2 and number1 < number3:
numbermin = number1

print("Number min is: ",numbermin)

if number3 < number2 and number3 < number1:
numbermin = number3

print("Number min is: ",numbermin)

numbermiddle = (number1+number2+number3)-(numbermax+numbermin)

print("Number middle is: ",numbermiddle)

Maybe it's not the best way to do it but at this time in our course we 
should try to solve problems just by using few things like if, else, 
etc. I know there's also min or max but before to use them we must 
understand if else! :)



Frank Millman


Thank you very much, you helped me to power on my brain! :D
^Bart
--
https://mail.python.org/mailman/listinfo/python-list


Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread Peter Otten
^Bart wrote:

>> You have got to a starting point - you have three numbers. Good.
>> 
>> Where do you do go from here?
>> 
>> I would start with two of the numbers, and work out which one is higher.
> 
> # SOLVED!!!

Hm, what does your script print if there are equal numbers?


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread Alister via Python-list
On Sun, 27 Jan 2019 15:59:42 +0100, ^Bart wrote:

>> You have got to a starting point - you have three numbers. Good.
>> 
>> Where do you do go from here?
>> 
>> I would start with two of the numbers, and work out which one is
>> higher.
> 
> # SOLVED!!!
> number1 = int( input("Insert the first number: "))
> 
> number2 = int( input("Insert the second number: "))
> 
> number3 = int( input("Insert the third number: "))
> 
> numbermax = number1
> 
> numbermiddle = number2
> 
> numbermin = number3
> 
> if number2 > number1 and number2 > number3:
>  numbermax = number2
> 
>  print("Number max is: ",numbermax)
> 
> if number1 > number2 and number1 > number3:
>  numbermax = number1
> 
>  print("Number max is: ",numbermax)
> 
> if number3 > number2 and number3 > number1:
>  numbermax = number3
> 
>  print("Number max is: ",numbermax)
> 
> if number2 < number1 and number2 < number3:
>  numbermin = number2
> 
>  print("Number min is: ",numbermin)
> 
> if number1 < number2 and number1 < number3:
>  numbermin = number1
> 
>  print("Number min is: ",numbermin)
> 
> if number3 < number2 and number3 < number1:
>  numbermin = number3
> 
>  print("Number min is: ",numbermin)
> 
>  numbermiddle = (number1+number2+number3)-(numbermax+numbermin)
> 
>  print("Number middle is: ",numbermiddle)
> 
> Maybe it's not the best way to do it but at this time in our course we
> should try to solve problems just by using few things like if, else,
> etc. I know there's also min or max but before to use them we must
> understand if else! :)
> 
>> Frank Millman
> 
> Thank you very much, you helped me to power on my brain! :D ^Bart

as a follow on exercise if you have covered them yet, convert your code 
into a function takes the 3 numbers as parameters. you will find as you 
progress it is a better way of structuring your program & increases 
flexibility.

good luck with your learning & congratulations on asking for assistance 
not simply a solution




-- 
 Zoidberg: Muy macho. Hey, gringos, here comes El Zoido to ruin 
   your drinking water! 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread ^Bart

Hm, what does your script print if there are equal numbers?


Insert the first number: 5
Insert the second number: 6
Insert the third number: 5
Number max is:  6
Number middle is:  5
>>>

The exercize was made to improve the use of if with three different 
conditions, maybe it could be nice to write something like "there isn't 
a middle number" but it goes further the exercize! :)

--
https://mail.python.org/mailman/listinfo/python-list


Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread ^Bart

as a follow on exercise if you have covered them yet, convert your code
into a function takes the 3 numbers as parameters. you will find as you
progress it is a better way of structuring your program & increases
flexibility.


Next step will be to study functions and I'll have other kind of 
homework but I'll be able also to solve old problems in another way! :)



good luck with your learning & congratulations on asking for assistance
not simply a solution


Thank you for your reply, maybe you'll read new posts from me next week 
or this night! Lol! :)

--
https://mail.python.org/mailman/listinfo/python-list


Re: Problem in Installing version 3.7.2(64 bit)

2019-01-27 Thread Terry Reedy

On 1/26/2019 6:24 AM, Vrinda Bansal wrote:

Dear Sir/Madam,

After Installation of the version 3.7.2(64 bit) in Windows 8 when I run the
program it gives an error. Screenshot of the error is attached below.


Nope.  This is text only mail list.  Images are tossed.  You must copy 
and paste.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: python 3.7.2

2019-01-27 Thread eryk sun
On 1/27/19, Dennis Lee Bieber  wrote:
> On Sat, 26 Jan 2019 15:06:10 +, Sarah P  declaimed
> the following:
>
> C:\Users\Wulfraed>dir %userprofile%\appdata

Avoid hard coding default paths. The roaming and local application
data directories are relocatable. It's even less typing to use the
proper variable, e.g. "%localappdata%" vs
"%userprofile%\appdata\local".

Also, if you can remember this in CMD, you can just as easily type it
in Explorer's location bar, which supports environment variables.
Explorer even has a "shell:" protocol that's more reliable than
environment variables, e.g. "shell:Local AppData" and
"shell:UserProgramFiles".

environment variables
https://ss64.com/nt/syntax-variables.html

shell: folders
https://ss64.com/nt/shell.html

more shell: folders
https://www.winhelponline.com/blog/shell-commands-to-access-the-special-folders

Side Note

Thanks to Steve Dower, there's now a Microsoft Store app for Python
3.7 [1]. Feedback would be appreciated if you have a supported system
(Windows 10 1809+, build 10.0.17763+). Notably, 3.7.2 has a new venv
launcher for Windows. The launcher is named "python.exe" in the
environment's "Scripts" directory, but it's not a copy of or symlink
to the installed "python.exe". It works around the limited access of
store apps by directly running the installed Python with a
__PYVENV_LAUNCHER__ environment variable. This needs more testing. A
significant bug has already been addressed for multiprocessing.

[1]: https://www.microsoft.com/en-us/p/python-37/9nj46sx7x90p
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread Frank Millman

"^Bart"  wrote in message news:q2kh0t$1hnj$1...@gioia.aioe.org...


> You have got to a starting point - you have three numbers. Good.
>
> Where do you do go from here?
>
> I would start with two of the numbers, and work out which one is higher.

# SOLVED!!!
number1 = int( input("Insert the first number: "))

number2 = int( input("Insert the second number: "))

number3 = int( input("Insert the third number: "))

numbermax = number1

numbermiddle = number2

numbermin = number3

if number2 > number1 and number2 > number3:
 numbermax = number2

 print("Number max is: ",numbermax)

if number1 > number2 and number1 > number3:
 numbermax = number1

 print("Number max is: ",numbermax)

if number3 > number2 and number3 > number1:
 numbermax = number3

 print("Number max is: ",numbermax)

if number2 < number1 and number2 < number3:
 numbermin = number2

 print("Number min is: ",numbermin)

if number1 < number2 and number1 < number3:
 numbermin = number1

 print("Number min is: ",numbermin)

if number3 < number2 and number3 < number1:
 numbermin = number3

 print("Number min is: ",numbermin)

 numbermiddle = (number1+number2+number3)-(numbermax+numbermin)

 print("Number middle is: ",numbermiddle)

Maybe it's not the best way to do it but at this time in our course we 
should try to solve problems just by using few things like if, else, etc. 
I know there's also min or max but before to use them we must understand 
if else! :)


Thank you very much, you helped me to power on my brain! :D



Excellent! Glad I could help.

Two comments on your code -

1. The last two lines appear to be indented under the 'if number3 < ' line. 
I think you want them to be unindented so that they run every time.


2. When you have lines such as -

   if a == 1:
   do something
   if a == 2:
   do something else

then if 'a' is equal to 1, there is no need to check for 'a' equal to 2.

Python allows you to shortcut this as follows -

   if a == 1:
   do something
   elif a == 2:
   do something else

Frank


--
https://mail.python.org/mailman/listinfo/python-list


Re: preferences file

2019-01-27 Thread DL Neil

On 25/01/19 4:22 PM, Bill Campbell wrote:

On Thu, Jan 24, 2019, Dave wrote:

I'm doing a small application and want to add user preferences.  Did some
googling to see if there are standard Python ways/tools, but it seems not so
much.  My specific questions are:

1. Best practices for a user preference file/system?


Generally I put them in the user's $HOME or $HOME/etc directory
with appropriate permissions unless working in a virtual
environement.


Good idea.

What about running a multi-tenant application (for multiple users who 
are not also system-users) - cf them logging-on to run their own. It is 
appropriate, possibly even "required" to keep Fred's config file, 
reports, graphs, logs, etc; separate from Barney's. Ideally they will 
not be sub-dirs of the application/package.


--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list