Best practice for Testing with Python in VSC [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed last year.
Improve this question
I would like to ask for your recommendation about coding in Python, mainly with VSC. I have read several Python standards but I have several doubts about testing. I have found some good extensions in VSC marketplace and (to me) the more relevant are installed with Python Official Extension.
I have little experience with testing and I have only used unittest, but reading here I believe Pytest is far more complete, should I change to it?
A "basic" test extension is installed with Python Official Extension from VSC, but I don't know if there are better extensions for this. I suppose it is compatible with unittest, pytest and nose. What I don't is how to do test in several Python version with VSC, I believe is a good practice, but I don't know if I must have installed all the other Python versions to do this.

I have find some good extensions in VSC marketplace and (to me) the more relevant are installed with Python Official Extension
Yes this is correct. Most packages needed for basic python programming are included in the official extension. Ofcourse there are some great packages out there that aren't included but still can be quite usefull.
I have little experience with test and I have only use the unittest, but reading here I believe Pytest is far more complete, should I change to it?
Pytest is very easy to use and definatly a recommender, I use it myself and never thaught of changing.
What I don't is how to do test in several Python version with VSC
I recommend tox, their readme even has an example of exactly what you want to do, testing (with pytest) on multiple python versions.
Hope this clears things up.

Related

Embed python in to iOS (iphone) app written in Objective-C/Swift/C/C++ (whatever language i can compile in Xcode and bridge to iOS) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I Do Not Intend To Put The Project On The App Store
Short Question - is there any up-to-date PyObjC tutorial for embedding python scripts into an iOS app written in Objective-C and/or swift? If not if there any up-to-date method for achieving the same goal?
Background: I want to run a bunch python scripts in an objective-c ios app. I have tried a couple of things:
I have tried using the python.framework, but i get a "could not build Python module" error. After googling for help, I realized that python.framework does not work on iOS - Run python scripts in iOS app
PyObjC - For the sake of experimenting, I managed to get the generated *.plugin working on OS X. I followed this tutorial - https://pythonhosted.org/pyobjc/tutorials/embedded.html
Using the same method on iOS, it fails to compile
If anyone is ever interested in calling python from swift, here is some helpful material I found(used) -
use the python framework - https://developer.apple.com/library/ios/technotes/tn2328/_index.html
PyObjC (a little more challenging) -
cobbal - https://github.com/cobbal/python-for-iphone
python docs (you would need to make C-Swift bridhe)
Most of it is for Objective-c, but if you need to use swift you can easily just create an ObjC-Swift bridge (super-super easy) - Lookup the apple docs
I managed to get the first two methods working on an OS X app, but I got some architecture errors for iOS(not important). I've pushed the project aside for now, I have a ton I need to get done.
Hope this will be helpful for anyone interested :-)

Is there portable Python 2.7 Windows distribution without any libraries included? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Each Python distribution I found contains a lot of libs I don't need (numpy, scipy, PyQt etc.) I am looking for portable CPython analogue that doesn't require installation, doesn't touch anything but its directory, and is small to download over a slow or metered Internet connection.
I don't mean specifically http://portablepython.com/. I can choose packages to unpack manually. There is no way to make installer silent.
There is https://winpython.github.io/. I have to unpack 1.5GB first and uninstall unused packages.
PyPy -- http://pypy.org/. As far as I understand, is portable too but it seems it don't support all packages I need. (I will investigate that later.)
Why I need that.
Project is required to be copy-deployed on Windows machines with no prerequisites. Second, building project directory with Python interpreter and packages (including mine) must be completely automated and should use project's repository and files that can be easily downloaded from Internet.
suggestion:
install a winpython,
remove all packages you don't want,
add all packages you want,
zip the result, and unzip it on any PCs.
There is Portable Python. But as you said, it comes with some extra (and very useful) libs. What's wrong with this extra libs? I mean, if you will not use, just leave there.

wxPython autocomplete [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
What editors or IDEs offer decent autocompletion for wxPython on Windows or Linux? Are there any? I tried several and support is either non-existant or limited.
Eclipse+PyDev with the install directory for wxPython added to the PythonPath has fully functioning autocomplete.
Pydev
I use Ulipad, and its has good autocompletion for wxPython too.
Wingide can do it
I use Eclipse/PyDev for wxPython development. I've been very satisfied with Eclipse for Python development productivity. It does have support for autocompletion for wxPython.
I'm partial to PyCharm. However, most IDEs will auto complete code based on what modules you've imported, so it's not specific to PyCharm.
Whatever the default windows IDE for Python is can autocomplete, with code not from the standard library.
Sublime Text + anaconda
I'm coding in a small project using wxPython, it provides good autocompletion function for the wxPython.
try use brain to autocomplete... :)
just joking. when I coding in in PyQt4, I open qt-assistant and search the manual,
and wrap myclass like : MyButton = QPusuButton
I think it is impossible to use autocomplete in python,
because only in runtime the computer know what happens.

Looking for a Python IDE with good support for libraries (Twisted) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm looking for a Python IDE that can help me easily locate and manage and use the libraries on my system (Ubuntu). Specifically Twisted.
Code completion is important including the symbols I import.
(I've so far had a look at PyDev as well as OpenKomodo, but while both offer code completion for default Python concepts, I wasn't able to get either to import Twisted into my project and was thus getting reference errors.)
Usual disclaimer: I don't like EMACS or vi, please, nothing regarding those.
Using Wing IDE with Twisted discusses how to debug twisted using their IDE - although unfortunately WingWare is not free.
Are you sure you have given PyDev a fair look? It seems to be the most popular Python IDE, and I have always had good experiences with it in the past.
I've just downloaded the preview of netbeans and it seems to have done quite well so far.
It has detected inherited methods & properties. I haven't had to add a single library reference in my project, so this seems to be the most fluid so far.
eclipse + pydev seems to work well for me.
Just remember to right-click on the project and select Properties and make sure that your libraries are on the path. Sometimes this doesn't happen for easy_installed libraries.
Check out JetBrains PyCharm. It features:
Code completion of any imported library
Good support for unit testing
Refactoring
Debugging
Version control integration
It's built on the same platform as IntelliJ IDEA which is a generally considered one of the best Java IDEs. There's a community edition which is free and open-source.
Like Eclipse is primarily a Java IDE written in Java, you could try Eric which is a Python IDE written in Python. I have had some issues with it in the past but I really enjoy the ability to stop your code at a breakpoint and have access to the python console to manipulate your data or even to inject new functions. PyDev could really use a console like that.
for a small proyects Scribes. Otherwise Eclipse+pydev.

Alternative ways to browse the python api [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Is it just me, or the python standard library documentation is extremely difficult to browse through?
http://docs.python.org/3.1/library/index.html
http://docs.python.org/3.1/modindex.html
Java has its brilliant Javadocs, Ruby has its helpful Ruby-Docs, only in python I cannot find a good way to navigate through the standard library documentation.
There's the Epydoc project, which looks nice, but does anyone know if it is actually being used on the standard library, so we can all go through it? If not, what are the alternatives people are using to browse python documentation.
I usually use the built-in pydoc, if you are on windows it should be called Module Docs if you are on linux use pydoc -p 8000 and connect through browser.
pydoc from the command line, help() from the interactive interpreter prompt.
pydoc -p 8080
The python community is semi-hostile to automatically generated documentation, especially if it's Object-Orientated. Python isn't just object-orientated (it's a multi-paradigm language), so Python developers generally prefer human-written documentation. Sometimes the functions are important, sometimes the Class structure is important.
you can go to here and download the chm version of Python 3.1. With that, searching through the docs should be easy.
I used to use the python sidebar from Edgewall a long time ago.
These days, I google for the python function (the standard docs almost always show up as the first link).If I want to browse the source of the module (useful sometimes), I use this little shell function I wrote.
epy () {
cmd="import $1 as a ; print a.__file__.endswith('.pyc') and a.__file__[:-1] or a.__file__"
file=$(/usr/bin/env python -c $cmd)
echo $file
emacsclient --no-wait $file
}
I guess I'm going to get downvoted but I find nothing wrong with the Sphinx docs and I find them way way better than the java alternative.

Categories

Resources