Re: Considering migrating to Python from Visual Basic 6 for engineering applications
On Wednesday, February 17, 2016 at 1:49:44 PM UTC-6, wrong.a...@gmail.com wrote: > I am mostly getting positive feedback for Python. > > It seems Python is used more for web based applications. Is it equally fine > for creating stand-alone *.exe's? Can the same code be compiled to run on > Linux or Android or web-based? > > Is it possible to create GUI elements with a good IDE? Can they be defined > like in Visual Basic with given sizes, fonts, visible/invisible, etc.? > > Is it easy to do matrix operations in Python? Or do I need to write > subroutines like in Visual Basic? > > Could someone kindly tell me advantages and disadvantages of Python? Or any > better options? I have like 40-50 VB Forms and may be around 2 lines of > code. It will be a task to learn a new language and translate/re-write that > code. > > Thanks for your responses. I'm surprised that no one mentioned this tool called vb2py. It looks outdated, but I actually used it successfully to convert vba code to python, once all dependencies were installed correctly :) http://vb2py.sourceforge.net/ You can also understand how vb objects map to python objects. vb2py has also minimal support for GUI conversion. Someone has even forked it on github recently: https://github.com/reingart/vb2py -- https://mail.python.org/mailman/listinfo/python-list
Re: Considering migrating to Python from Visual Basic 6 for engineering applications
Note that you can continue using your existing vb6 code from python through COM using pywin32 or pythonnet, until you decide to rewrite it. -- https://mail.python.org/mailman/listinfo/python-list
Inception
Is it possible to embed CPython in CPython, e.g. using ctypes, cffi, or cython? -- https://mail.python.org/mailman/listinfo/python-list
Re: Inception
Embed using C-API from ctypes, cffi or cython, but not using subprocesses. Thanks for asking! Here is link to official documentation about embedding: https://docs.python.org/3.6/extending/index.html -- https://mail.python.org/mailman/listinfo/python-list
Re: Inception
Thank you Paul and Christian for your reply and understanding my question. I was actually inspired by this example for IronPython and thought that this is pretty useful for testing and exploring of C-API: http://www.voidspace.org.uk/ironpython/ip_in_ip.shtml So does it all boil down to GIL restriction in CPython? On Thursday, March 3, 2016 at 2:10:15 AM UTC-6, Christian Gollwitzer wrote: > Hi Denis, > > Am 03.03.16 um 06:01 schrieb Denis Akhiyarov: > > Is it possible to embed CPython in CPython, e.g. using ctypes, cffi, or > > cython? > > > > since you titled your question with a famous movie title, I take it more > as a "philosophical" question (musing about the CPython world) than an > actual demand. Technically, I think it cannot work with the current > state of CPython. Embedding CPython into another application requires > you to load libpython3.5.so (or similar depending on OS and version) and > to call the functino sfrom within there. When a Python program runs in > the standalone interpreter, then this DLL is already loaded, obviously, > so the question is if the Python C API functions can be called from a > Python script. > > Possibly ctypes or cffi can do that for you, but you would end up with > the same interpreter that executes your main script. A DLL is loaded by > the OS only once, which makes it possible to create plugin interfaces > etc. using shared symbols in C. > > Now, the CPython interpreter saves its state in global variables. > Therefore only one interpreter can exist in a single process, and this > is also the reason that multithreading is complicated and does not > really work (GIL &c). > > How useful could it be to have more than a single interpreter? For > instance, Tcl does it in a different way. All of the interpreter state > is stored within a Tcl_Interp struct which is passed around to every API > function. You can create more than a single interpreter, and that even > works from the script level using the "interp create" command. This is > useful to shield user script evaluation from the main script. Such > interpreters can be made "safe", i.e. to not allow file operations, or > to limit the CPU time for script evaluation, which has its primary use > case in things like web browser plugins or simple servers. A pythonized > version of the API would look like this: > > from pyembedding import Interp > > i=Interp() > i2=Interp(safe=True) > > i.eval('print("Hello world")') > # prints Hello world > > i2.eval('print("Hello world")') > # raises a SafeInterpException > # I/O is unsafe and disabled here > > def greetme(): > print("Hello world") > > i2.alias(greet=greetme) > i2.eval('greet') > # calls back to greetme in main interpreter > > This mechanism would also allow true multithreading. If you run another > interpreter in the second thread, it will have it's own GIL. > > I'm not familiar with the internals of other Python implementation, but > I can imagine that maybe in Jython such an extension could be written. > > Christian -- https://mail.python.org/mailman/listinfo/python-list
Re: Pythons for .Net
On Sunday, July 24, 2016 at 11:30:09 PM UTC-5, Steven D'Aprano wrote: > Yes, I said Pythons plural :-) > > For those wanting to use Python on .Net or Mono, there is some good news. > > Firstly, the venerable old "Python for .Net" project is still alive, and now > supports up to Python 3.5 on .Net or Mono. PythonNet, as this is known, > integrates the regular CPython interpreter with .Net or Mono. > > Secondly, we can also expect that IronPython will have a new lease of life. > Continuing on the work of their predecessor, Jeff Hardy, the IronPython > project now has two tech leads who will carry it forward: Alex Earl and > Benedikt Eggers. > > https://thelasttechie.com/2016/07/24/its-back-python-for-net/ > > > IronPython is a reimplementation of Python, written in C# as managed code > for .Net. It doesn't use a GIL, and is sometimes considered a little faster > than CPython, so this is good news for the Python ecosystem. > > IronPython: > http://ironpython.net/ > > Python for .Net: > https://github.com/pythonnet/pythonnet > http://pythonnet.github.io/ > https://pypi.python.org/pypi/pythonnet > > > > > -- > Steven > “Cheer up,” they said, “things could be worse.” So I cheered up, and sure > enough, things got worse. Hello Steven, I'm one of the contributors to pythonnet. We strive for compatibility with IronPython, but also have a simplified embedding interface and support Python 3 + C-Extensions such as numpy, scipy, sklearn. If anyone is interested in learning pythonnet, then try it out from PYPI or github and use this tutorial: https://pythonnet.github.io/readme.html There is also a mailing list and a tag on stackoverflow: https://mail.python.org/mailman/listinfo/pythondotnet http://stackoverflow.com/questions/tagged/python.net Finally if anyone can contact Christian Heimes (Python Core Developer), then please ask him to reply on request to update the license to MIT: https://github.com/pythonnet/pythonnet/issues/234 He is the only contributor that prevents updating to MIT license. -- https://mail.python.org/mailman/listinfo/python-list
Re: Pythons for .Net
On Saturday, September 3, 2016 at 8:53:18 PM UTC-5, Steve D'Aprano wrote: > On Sat, 3 Sep 2016 12:34 pm, Denis Akhiyarov wrote: > > > Finally if anyone can contact Christian Heimes (Python Core Developer), > > then please ask him to reply on request to update the license to MIT: > > > > https://github.com/pythonnet/pythonnet/issues/234 > > > > He is the only contributor that prevents updating to MIT license. > > > I have emailed him off-list. > > Thanks for the information on PythonNet, Denis. > > > > -- > Steve > “Cheer up,” they said, “things could be worse.” So I cheered up, and sure > enough, things got worse. Emailing and twitter did not help either. -- https://mail.python.org/mailman/listinfo/python-list
Re: announcing fython
On Sunday, October 2, 2016 at 10:57:57 AM UTC-5, nicolases...@gmail.com wrote: > >One problem with using very similar syntax for distinct languages is that it > >can get confusing. > > The first inspiration for Fython was to be close to Fortran, while improving > the syntax. The project is in the early days, so all suggestions are welcome. > Some difference to the Python language are inevitable though, as Fython is a > compiled language. > > >does an actual Fortran compiler need to be invoked? > > Yes, this is done in the background. > > > >And do you need to install one, or is it all included? > > A Fortran compiler must be avalaible on the machine. > A free often used compiler is gfortran. > > > >If so, at what point in the above example is it invoked? > >Is it every time you run that Python code, or will the load() used a cached > >copy of the compiled mean.fy? > > The compiler is invoked whenever the Fython sources are new or have changed. > A cached copy is used to avoid unnessecary compilation. Have you looked at f2py? You can write Fortran and then use it Python by just wrapping it with f2py. Actually this is a project bundled in numpy. There is also fortran magic for Jupyter notebooks. f90wrap extends f2py to support modern Fortran. -- https://mail.python.org/mailman/listinfo/python-list
Re: Build desktop application using django
Have a look at automatic web app builder using Django or Flask called Wooey based Gooey. https://github.com/wooey/Wooey -- https://mail.python.org/mailman/listinfo/python-list
Re: How does one distribute Tkinter or Qt GUI apps Developed in Python
On Wednesday, December 16, 2015 at 6:45:50 PM UTC-6, Rick Johnson wrote: > On Wednesday, December 16, 2015 at 6:03:55 PM UTC-6, Bruce Whealton wrote: > > > Surely, one is going to want to create GUI apps for users > > that are not Python Developers. I would not think to ask > > someone to install Python on their system and make sure it > > is added to the path. Maybe it is not so hard for the non- > > technical, average users. > > > > I would want to package in some way so that when launched, > > it installs whatever is needed on the end user's computer. > > How is this done? Are there common practices for this? > > > Your assumptions are correct! In fact, in a language that was "supposedly" > designed to be an "applications language" (eat your heart out D'Aprano!!!), > one would think that distributing apps would not only be obvious, but also > intuitive! > > ALAS, THE CRUEL REALITIES OF INTERPRETED LANGUAGES SLAPS YOU IN THE PASTEY > WHITE FACE! > > Unlike a true "applications language", like say, um, *JAVA*, one cannot > simply compile an executable and distribute it in a teeny tiny binary form, > no, with Python, the end user must either (1) have Python on his machine > already, (2) download Python, or (3) you must package a Python interpreter > along with your script (and dependencies) -- which will end up being a very > large file just to run (what is in most cases) a very small script. > > BOO-HISS! > > But the good news is that, Python ships on many machines already. But of > course, you're seeking more consistency in your distribution QA than the > "wild guess" and the fickle nature of "lady luck". > > Many 3rd party libraries exist to solve your distribution issue. Google > probably knows about all (or at least most) of them. if you did not notice Java/.NET ship with runtime VMs as well. Even C/C++ have some requirements depending on the platform. We should all switch to assembly to avoid any dependencies and port our code to each platform without hesitation. -- https://mail.python.org/mailman/listinfo/python-list
Re: What are your opinions on .NET Core vs Python?
On Sunday, January 29, 2017 at 4:00:27 PM UTC-6, Gregory Ewing wrote: > Joseph L. Casale wrote: > >>.NET is a library that can be used from many languages, including Python. > > > > No. > > Yes: > > http://pythonnet.sourceforge.net/ > > "Python for .NET is a package that gives Python programmers nearly seamless > integration with the .NET Common Language Runtime (CLR) and provides a > powerful > application scripting tool for .NET developers. Using this package you can > script .NET applications or build entire applications in Python, using .NET > services and components written in any language that targets the CLR (Managed > C++, C#, VB, JScript)." > > -- > Greg This is outdated location. pythonnet (python for .NET) is on GitHub since 2014. https://github.com/pythonnet/pythonnet We just released v2.2.2 with Python 3.6 support and transition to MIT license. Download from PYPI using pip or from Anaconda using conda: https://pypi.python.org/pypi/pythonnet/2.2.2 https://anaconda.org/pythonnet/pythonnet -- https://mail.python.org/mailman/listinfo/python-list
RE: ironpython not support py3.6
Either wait for IronPython 3.6, use COM interop, pythonnet, subprocess, or things like gRPC. Based on PyPy experience, it is probably 1-2 years of sponsored development to get a working IronPython 3.6. -- https://mail.python.org/mailman/listinfo/python-list
RE: ironpython not support py3.6
To: Schachner, Joseph From: denis.akhiya...@gmail.com Either wait for IronPython 3.6, use COM interop, pythonnet, subprocess, or things like gRPC. Based on PyPy experience, it is probably 1-2 years of sponsored development to get a working IronPython 3.6. --- BBBS/Li6 v4.10 Toy-3 * Origin: Prism bbs (1:261/38) -- https://mail.python.org/mailman/listinfo/python-list
RE: ironpython not support py3.6
To: Schachner, Joseph From: "denis akhiyarov" To: Schachner, Joseph From: denis.akhiya...@gmail.com Either wait for IronPython 3.6, use COM interop, pythonnet, subprocess, or things like gRPC. Based on PyPy experience, it is probably 1-2 years of sponsored development to get a working IronPython 3.6. -+- BBBS/Li6 v4.10 Toy-3 + Origin: Prism bbs (1:261/38) --- BBBS/Li6 v4.10 Toy-3 * Origin: Prism bbs (1:261/38) -- https://mail.python.org/mailman/listinfo/python-list