Create Setup.py file with PyCharm
-
Hello,
I program with PyCharm 2020.1.3, Python Python 3.7.6
and Qt version 5.9.7
I want to create a Setup.py file using PyCharm.
I would like to query the operating system in Setup.py
and execute the correct command depending on the operating system
Install Qt.Question:
How do I do something or where can I find information about this? -
Hello,
I program with PyCharm 2020.1.3, Python Python 3.7.6
and Qt version 5.9.7
I want to create a Setup.py file using PyCharm.
I would like to query the operating system in Setup.py
and execute the correct command depending on the operating system
Install Qt.Question:
How do I do something or where can I find information about this?import platform platform.system()
-
Hello,
I program with PyCharm 2020.1.3, Python Python 3.7.6
and Qt version 5.9.7
I want to create a Setup.py file using PyCharm.
I would like to query the operating system in Setup.py
and execute the correct command depending on the operating system
Install Qt.Question:
How do I do something or where can I find information about this?@PythonQTMarlem
@jsulm'splatform.system()
may be fine, I don't know. Personally I usedimport os def isWindows() -> bool: # return whether the current OS is Windows return os.name == "nt" def isLinux() -> bool: # return whether the current OS is Linux return os.name == "posix"
-
Thank you for both answers.
What I'm still interested in:
If I want to create a Setup.py file in PyCharm, is there a certain procedure or can I simply create a new file called setup.py?I made operating system queries like this:
def operatingsystemqueries ():os_info = sys.platform print ("operating system:" + os_info)
Possible expenses:
Issue 1: Operating System: win32 Issue 2: Operating System: linux@jonB
Is your method better? -
Thank you for both answers.
What I'm still interested in:
If I want to create a Setup.py file in PyCharm, is there a certain procedure or can I simply create a new file called setup.py?I made operating system queries like this:
def operatingsystemqueries ():os_info = sys.platform print ("operating system:" + os_info)
Possible expenses:
Issue 1: Operating System: win32 Issue 2: Operating System: linux@jonB
Is your method better?@PythonQTMarlem said in Create Setup.py file with PyCharm:
Is your method better?
Nope, they are all fine, they just produce different strings. I happen to notice that @jsulm's
platform.system()
producesLinux
with a capitalL
, so you'd have to be careful checking in Python.If I want to create a Setup.py file in PyCharm, is there a certain procedure or can I simply create a new file called setup.py?
You can just go File > New..., pick Python file type, give it a name. Then PyCharm has added it right into your project.
-
@JonB said in Create Setup.py file with PyCharm:
You can just go File > New..., pick Python file type, give it a name. Then PyCharm has added it right into your project.
Thank you!
-
Hi,
As posted in your other thread, unless you have very specific needs, installing dependencies should be done using python's package manager. Use a proper dependency list to trigger their installation.