Python: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(55 intermediate revisions by the same user not shown)
Line 1: Line 1:
=External=
* http://www.python.org
=Internal=
=Internal=
* [[Conda]]
* [[pip]]
* [[Julia]]
* [[Julia]]
* [[Jep]]
* [[Jep]]
* [[Go]]
* [[Java]]


=Subjects=
=Subjects=
* [[Python Language]]
** [[Python_Language_String#Overview|String]]
** [[Python_Language_List#Overview|List]], [[Python_Language_Dictionary#Overview|Dictionary]], [[Python_Language_Set#Overview|Set]]
** [[Python Language Functions#Overview|Functions]]
** [[Python_Language_Exceptions#Overview|Exceptions]]
** [[Python_Language_Modularization#Overview|Modularization]]
** [[Python_Language_OOP#Overview|Object Oriented Programming]]
* [[Python Engineering]]
* [[PyCharm]]
* [[Python on Kubernetes]]
* Simple Projects:
** [[PyCharm_Operations#Create_a_Simple.2C_Standalone_Project|With PyCharm]]
**  [[Python_Project_Layout#Setting_a_Manual_Project|Manual]]


* [[Python and IntelliJ IDEA#Overview|Python and IntelliJ IDEA]]
=Code Examples=
 
{{Internal|Python Code Examples|Python Code Examples}}
=Installation=
 
==Mac==
 
<syntaxhighlight lang='bash'>
brew install python3
</syntaxhighlight>
 
==Linux==
<syntaxhighlight lang='bash'>
yum install python3
</syntaxhighlight>
 
=Organizatorium=
 
* https://opensource.com/article/18/1/running-python-application-kubernetes
* Each installation of Python may have different modules installed. Python determines the path to its modules by examining the location of the <code>python3</code> executable.
* Python environments on Mac:
** ~/Library/ApplicationSupport/iTerm2/iterm2env/versions/*/bin/python3
** ~/Library/ApplicationSupport/iTerm2/Scripts/YourScript/iterm2env/versions/*/bin/python3
=Basic Language=
Printing done with print() function.
<syntaxhighlight lang='py'>
print('something')
</syntaxhighlight>
Comments:
<syntaxhighlight lang='py'>
# This is a comment
</syntaxhighlight>
Variables.
<syntaxhighlight lang='py'>
a = 1
b = 'something'
print(a)
print(b)
</syntaxhighlight>
Functions:
<syntaxhighlight lang='py'>
def function_name(arguments):
  <function body>
 
def something(a, b):
  c = a + b
  return c
</syntaxhighlight>
 
Conditions:
<syntaxhighlight lang='py'>
if a == 1:
  print('something')
else
  print('something else')
</syntaxhighlight>
 
Loops:
<syntaxhighlight lang='py'>
while <condition>:
  code-block
 
while x < 5:
  x = x + 1
  print
</syntaxhighlight>


<font color=darkgray>TODO. Continue: https://levelup.gitconnected.com/python-for-absolute-beginners-a-quick-primer-c7db94a5d0e</font>
=Python Versions=
{{External|https://docs.python.org/3/whatsnew/}}

Latest revision as of 22:46, 2 July 2024