Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
print floating point number
#11
(Aug-13-2017, 04:13 PM)hbknjr Wrote: If you correctly added python34 to the path and changed the python.exe name to python3.exe, You should be able to execute your seq.py file by typing following in CMD.
Should never do this @hbknjr.
Advisable for Windows is to have one main version that you run with python my.py in case over will 3.6 to run.
If use other version use py -version, py -2.7 my.py use Python 2.7 to run.
Reply
#12
Well, Windows has a PATH env. variable, right? So there is something called shortcuts, right? So make a shortcut in the PATH directory and let's point to the Python executable. Doesn't matter where is installed.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#13
(Aug-13-2017, 04:32 PM)wavic Wrote: Well, Windows has a PATH env. variable, right? So there is something called shortcuts, right?
The point @wavic is that Python 3.6  add to path automatically under installation. 
[Image: 4Qfi5o.jpg]
Then when use python my.py from command line it use 3.6 to run.
And pip command will install to 3.6

All other version can be run with py -version
py -3.4 my.py will run code in 3.4.
py -2.7 my.py will run code in 2.7.
py -3.4 -m pip install requests will install Requests to 3.4
This way it easy to access all version,and using python it will use 3.6 which should be main version on OS.
Reply
#14
Another way, I believe,  is to add a shebang line at the beginning of the script. Then double clicking the "my_file.py" in Windows or typing "./my_file.py" in Linux with run the correct version.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#15
(Aug-12-2017, 11:07 PM)Regulus Wrote: Could the problem be my python environment? I code in Notepad++ and run the program at a DOS prompt. Here are the last few lines of my output with the new print command you kindly provided:
n = 496 and c = 3.0
n = 497 and c = 3.0
n = 498 and c = 3.0
n = 499 and c = 3.0

(Aug-13-2017, 04:15 PM)snippsat Wrote: Some advice follow my link over and install Python 3.6.
Restart Pc.
I will do that as soon as I resolve the problem I mentioned in post #8 (it got hidden inside other quotes). My Windows 7 doesn't install anything I download from the internet. The downgrade from Win 10 back to Win 7 somehow ruined that feature. I've asked how to fix it on Seven Forums, but no reply yet.
Reply
#16
Quote:My Windows 7 doesn't install anything I download from the internet.
Why? What are your permissions?
This sounds like a very restricted, or worse yet, corrupted operating system
Reply
#17
(Aug-14-2017, 12:01 AM)Larz60+ Wrote:
Quote:My Windows 7 doesn't install anything I download from the internet.
Why? What are your permissions?
This sounds like a very restricted, or worse yet, corrupted operating system
I must be missing an installation driver. It was working fine before the "upgrade" to Win 10, then I realized my computer isn't built for Win 10. The one thing I seem to have lost after switching back to Win 7 is the ability to install software I download online. Everything else is fine.

How do I check my permissions?
Reply
#18
Quote:How do I check my permissions?
There
  • right click the folder that you want to view permissions on.
  • Click properties
  • Click security (this is a tab)
  • View permissions in the second box
This is only useful if you are doing a few selected directories.
To do bulk reset, see: https://social.technet.microsoft.com/For...rosecurity
Reply
#19
It's been awhile since I've used MS 7, can you right click on the downloaded file and select "Run As Administrator"?

You should also be able to go into Control Panel --> User Accounts and verify that you are in the Administrator group. If it's not listed, you may have to login as the actual Administrator in order to add you to the group.  While logged in as Administrator, can you install programs?

Note that the Administrator account may be "hidden" (the default) here is one link to show how to activate it:
Activate Hidden Admin.  Make sure you "hide" it again when you are done.

EDIT: I should add, whether posting on this site or another, you should copy and paste any error code in it's entirety, this helps us or others understand what is actually going on. In your case, if you cannot install a file, MS will usually generate an 'error code', which can be looked up online and give you at least an idea of what is happening.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#20
(Aug-13-2017, 08:51 PM)sparkz_alot Wrote: Another way, I believe,  is to add a shebang line at the beginning of the script. Then double clicking the "my_file.py" in Windows or typing "./my_file.py" in Linux with run the correct version.

Double clicking in windows works with file associations and the .py extension.  The shebang, in windows, is only used by the windows-specific python launcher, to switch to a different version of python if windows tries to use the wrong one.  It won't start python if windows doesn't already know that it should be starting python.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Print Player Name and Number of Pokemon webmanoffesto 1 1,065 Aug-23-2022, 08:54 PM
Last Post: deanhystad
  print two different sequence number mantonegro 2 1,629 Nov-16-2020, 06:19 PM
Last Post: mantonegro
  Print the number of items in a list on ubuntu terminal buttercup 2 1,897 Jul-24-2020, 01:46 PM
Last Post: ndc85430
  Beginner Code, how to print something after a number of turns (guessing game) QTPi 4 2,679 Jun-18-2020, 04:59 PM
Last Post: QTPi
  floating point not increasing properly rakeshpe43 4 2,347 Apr-30-2020, 05:37 AM
Last Post: rakeshpe43
  Print 'X' a number of times Than999 1 2,611 Jan-18-2020, 06:41 PM
Last Post: Larz60+
  connecting the first point to the last point Matplotlib omar_mohsen 0 4,524 Jan-15-2020, 01:23 PM
Last Post: omar_mohsen
  how do I make a number only print once but the number keeps on decreasing? syafiq14 5 2,888 Jan-03-2020, 10:34 AM
Last Post: perfringo
  Complex floating issue arshad 2 11,768 Nov-05-2019, 03:26 PM
Last Post: arshad
  floating point arithmetic exDeveloper 2 2,072 Sep-25-2019, 04:33 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020