Talk:Python Concepts/Introduction and Setup
IDLE
editThe present version focuses too much on IDLE. — Fnielsen (discuss • contribs) 17:25, 9 January 2014 (UTC)
Although I have not mastered it, this looks really good. I never understood shells.--guyvan52 (discuss • contribs) 04:26, 11 December 2014 (UTC)
- Thanks! It's still a work in progress as I need to elaborate on some things within this resource. --I8086 (discuss • contribs) 18:38, 11 December 2014 (UTC)
Computer Speak
editI presume this was a grammar error and not computerspeak; I added the bold d: Window users, by default, Python files are executed with py.exe--Guy vandegrift (discuss • contribs) 23:37, 31 March 2015 (UTC)
- You are correct, it should be executed. That's just one of many copyedits needed on this page. --I8086 (discuss • contribs) 01:37, 1 April 2015 (UTC)
Something that confused this novice
editBefore you we go ahead, you should open up the python prompt in your operating system's shell. Simply open up a new shell[1] and type python into it. Congratulations, you now have a working Python interpreter.
- ↑ On a Windows machine the shell is opened from the w:Start menu
- I would have added this footnote myself, but am such a novice I am not even sure this is true.--Guy vandegrift (discuss • contribs) 23:19, 2 April 2015 (UTC)
- That would be true for pre-Windows 8 (Windows 8 doesn't have a start button, although something similiar was brought back in 8.1). Nowadays, with Windows taking a new direction and operating systems changing up the desktop to make it the "next big thing", where the shell (command prompt on Windows) is can be hazy at times. I think it would be good to add a footnote for pre-Windows 8 users, though. --I8086 (discuss • contribs) 23:28, 2 April 2015 (UTC)
--Thanks. I will go ahead and add the footnote with the comment that this is pre Windows 8. Here is another section that was way over my head:
Note: Window users, by default, Python files are executed with py.exe, which usually will execute your script in Python 2.X. If you want it to execute in Python 3.X, you'll need to use the switch -3 . This means that you'll need to edit your registries or you'll need to delete py.exe in your windows folder and replace it with python.exe from your python folder. You'll also need to rename it to py.exe!
Another, more recommended alternative is to open up your control panel and set/create the environment variable PY_PYTHON and set its value to 3. |
I ran py from the shell and got this:
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. >>>
I assume that means that our IT guys set this up properly.--Guy vandegrift (discuss • contribs) 23:37, 2 April 2015 (UTC)
- Yes, it can be assumed that they did. For some reason, when installing Python on some versions of Windows, its possible that default could be 2.X . This seems to especially plague Windows XP. It might be better to change usually to sometimes, to reduce emphasize. --I8086 (discuss • contribs) 23:43, 2 April 2015 (UTC)
- Should I mention the "trick" of running py and seeing which version runs?--Guy vandegrift (discuss • contribs) 23:52, 2 April 2015 (UTC)
- Yessir! --I8086 (discuss • contribs) 23:53, 2 April 2015 (UTC)
Proposed deletion
editWarning: When you right-click your mouse on the desktop or in an explorer window, you'll be able to select a new file to create. If you have experience working with Windows registries you can add a Python file into New. I should warn you now, it can be dangerous editing your registries, so do so at your own risk. If your still intent on doing this, run the program regedit.exe either from Run... or from the command prompt. When the program opens open My Computer, then open HKEY_CLASSES_ROOT. From here, scroll down until you find .py and open it. The right-click .py move the mouse over new and then select Key. Name this Key ShellNew. Now right-click ShellNew and add a New String this time. Name it NullFile and leave its value empty. There, you've done it! It probably won't work at first, so you'll need to restart the computer. |
- Telling novices that they shouldn't do something they don't know how to do seems unnecesaary.--Guy vandegrift (discuss • contribs) 00:03, 3 April 2015 (UTC)
- Agreed as stated below. --I8086 (discuss • contribs) 01:16, 3 April 2015 (UTC)
Proposed simplification
editReplace:
An alternative for any OS is to open IDLE via the shell. It can be accessed with this command: python -m idlelib
. Note: that this will open the IDLE shell. To create a Python script, you'll need to click File
and then New File
. It's a lot easier to do the first, if it's available on your system.
By:
An alternative is to open IDLE via the shell using the command: python -m idlelib
.
Rationale: You don't need to tell a novice that doing something from the shell is not as easy.--Guy vandegrift (discuss • contribs) 00:07, 3 April 2015 (UTC)
- Agreed, content here should be for new comers and, in general, shorting or removing some of these boxes would make the page look nicer. --I8086 (discuss • contribs) 01:15, 3 April 2015 (UTC)
Do you want to use footnotes?
edit@I8086: I reinserted your advanced solution as a footnote, but as the main hawk on this page you need to decide how much you want to use them. Wikipedia tends to frown on footnotes, but I am a strong believer in footnotes, as long as too many editors aren't involved. When I write a page by myself, the footnotes stay under control, and instead of a "References" section I use "References and Footnotes". Revert my use of the footnote if you wish.--Guy vandegrift (discuss • contribs) 13:51, 4 April 2015 (UTC)
- I don't have a problem with footnotes, so long as they're separated from the references. By separating them, a lot of confusion can be resolved. --I8086 (discuss • contribs) 13:56, 6 April 2015 (UTC)
- Pretty cool trick, that <ref group="note"></ref>. Now for my question: Is there any difference between {{reflist}} and <references/>?
I use the latter because I copied it from a page once, but noticed that Wikipedia prefers the former. --Guy vandegrift (discuss • contribs) 16:22, 6 April 2015 (UTC)
- As stated on this page,
- "It encapsulates the <references /> tag used by the Cite.php MediaWiki extension to show the list of references as defined by <ref> tags. It adds support for a reduced font size, columns, groups and List-defined references.".
- So I assume that
{{reflist}}
is just an extension of<references />
. In short,{{reflist}}
is just a customizable<references />
. --I8086 (discuss • contribs) 17:17, 6 April 2015 (UTC)
- So I assume that
IDLE
editI was not able to run IDLE using this manual, so I found the way via YouTube. Juandev (discuss • contribs) 19:54, 31 January 2020 (UTC)