Re: Installing programs that depend on, or are, python extensions.
On Apr 30, 6:39 pm, David Cournapeau wrote: > On Sat, Apr 30, 2011 at 2:19 PM, James A. Donald > wrote: > > > I have noticed that installingpythonprograms tends to be hell, > > particularly underwindows, and installingpythonprograms that rely > > on, or in large part are,pythonextensionswritten in C++ tends to be > > hell on wheels with large spiky knobs and scythes on the wheels. > > > Is this because suchinstallare inherently hard to do and hard to > > write, or is it becauseInstalltends to be done last, and therefore > > not done at all? > > Most likely both. > > Packaging complex application is hard, and I think few programmers > like doing it, so it is rarely done correctly. > > > > > Can anyone suggest any examples of such a program with a cleanwindows > >installthat shows how it was done? > > > Bywindowsinstall, I mean you run setup.exe, and get a program group, > > file types registered, and an entry in the add/remove programs list, I > > do not mean fourteen pages of direly incomplete notes which do not > > actually work for versions later than 1.01, and do not work for > > version 1.01 unless one has already installed the complete developer > > environment. > > Well,pythonitself is a reasonably good example I think. But if you > are interested in having onepythonprogram which is a one clickinstallwithout > requiring the user to eveninstallpython, you will > need to look into tools like py2exe which can create all the files > necessary to do so from an existingpythonpackage. Then, you package > those files into a nice installer. I like nsis, which is open source > and relatively well documented, but there are other solutions as well. > > cheers, > > David py2exe would work, but a correct installer would install Python if not present, then install the program. -- http://mail.python.org/mailman/listinfo/python-list
Installing programs that depend on, or are, python extensions.
I have noticed that installing python programs tends to be hell, particularly under windows, and installing python programs that rely on, or in large part are, python extensions written in C++ tends to be hell on wheels with large spiky knobs and scythes on the wheels. Is this because such install are inherently hard to do and hard to write, or is it because Install tends to be done last, and therefore not done at all? Can anyone suggest any examples of such a program with a clean windows install that shows how it was done? By windows install, I mean you run setup.exe, and get a program group, file types registered, and an entry in the add/remove programs list, I do not mean fourteen pages of direly incomplete notes which do not actually work for versions later than 1.01, and do not work for version 1.01 unless one has already installed the complete developer environment. -- http://mail.python.org/mailman/listinfo/python-list
Re: wxpython ms-dos black window popping up in background
James A. Donald > > > > Horrible installs are a chronic problem of GUI programs driven by > > > > interpreted languages Installing visual basic programs that worked on > > > > one Windows machine to work on a very slightly different windows > > > > machine was also a nightmare. > > > > > > > > I have not attempted to create installable wxPython windows, but > > > > generally, "run anywhere" will bite you. Still looking for a good > > > > solution to "run anywhere". Mike Driscoll > I used Inno Setup which creates an uninstaller, however I am not > seeing it in my Windows Add/Remove. Odd. However, you can uninstall it > from the Start menu entry and it works. Could anyone tell me their experiences with NSIS? Has anyone tried scripting msi (Windows Installer 3.0 Redistributable) with Orca and the Windows SDK Components for Windows Installer Developers. How did it go. I notice that Python 2.4 is distributed as an msi file. I suspect there is a reason for that. Was that constructed with Orca? -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: wxpython ms-dos black window popping up in background
James A. Donald > > Horrible installs are a chronic problem of GUI programs driven by > > interpreted languages Installing visual basic programs that worked on > > one Windows machine to work on a very slightly different windows > > machine was also a nightmare. > > > > I have not attempted to create installable wxPython windows, but > > generally, "run anywhere" will bite you. Still looking for a good > > solution to "run anywhere". Mike Driscoll > I haven't had much trouble getting wxPython applications to run in > Windows XP and Ubuntu Hardy Heron. Did you attempt to create proper install packages that show up in the Linux package managers, and the windows add/remove programs tool? -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: wxpython ms-dos black window popping up in background
On Tue, 9 Sep 2008 14:35:13 -0700 (PDT), icarus <[EMAIL PROTECTED]> wrote: > Oh ok. Thanks. In windows xp I just renamed the file extension to .pyw > That did it. > > one more question... > > how do I create a pythonw standalone executable that works on w32, > linux, mac, etc..? I have noticed that when applications are written in Python with the GUI created by PyGTK, it seems that to install the application on each slightly different version of unix is a fairly major task - although the creators of PyGTK proudly say that the code will run anywhere, it definitely will not install anywhere - the code will only run on a slightly different system after a massive and major rewrite of the install for that target system. Horrible installs are a chronic problem GUI programs driven by interpreted languages Installing visual basic programs that worked on one Windows machine to work on a very slightly different windows machine was also a nightmare. I have not attempted to create installable wxPython windows, but generally, "run anywhere" will bite you. Still looking for a good solution to "run anywhere". -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: Database Query Contains Old Data
On Tue, 03 Jun 2008 12:07:07 +0200, "M.-A. Lemburg" <[EMAIL PROTECTED]> wrote: > As others have mentioned, in systems that have long running logical > transactions, it's usually best to collect the data until the very > end and then apply all changes in one go (and one database > transaction). I understand you to mean that one should arrange matters so that what is a lengthy transaction from the point of view of the user is a short transaction from the point of view of the database. -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: Database Query Contains Old Data
On Mon, 02 Jun 2008 20:59:09 -0700, <[EMAIL PROTECTED]> wrote: James A. Donald > > If one has transactions open for a long time, or transactions that > > involve a great deal of data, this will result in poor performance or > > poor scalability. But one may have such large transactions without > > being aware of it. Is there any way to make transaction size salient > > to the developer? Any way to make sure one is committing as early and > > often as possible? Dennis Lee Bieber > I would tend to suggest that one code to collect all needed > information for a complete transaction /before/ even starting a > transaction; then one can start it and feed all the operations in short > order. > > Now, if the application requires doing something like: > > select set of data > repeat until user is done > display by record to user > wait for user response > issue update for record > commit transaction > > this becomes problematic. Well obviously one should do the former and not the latter, but one may well start out doing the former and gradually drift into doing the latter without entirely being aware of it. > A more complex method would be: > > select set of data; save in local storage; commit > repeat until user is done > display saved record to user > wait for user response > save modified record (second storage) > repeat until no conflicts > select original set again > repeat until done > if saved original <> reselected original > if saved original had been modified by user > User interaction: override other changes > or redisplay and get edits from > user > transaction begin > issue all updates > commit Having drifted into doing things the wrong way without being aware of it, one would then wait until ones application comes to a grinding halt due to scaling problems, figure out what was causing the problem, and then recode by the more complex method you describe. At that point, however, one would belatedly discover that one's schema made the more complex method hideously complex for the programmer and incomprehensible to the user, and that it was far too late to change the schema. I suppose there is no help for it but to be mindful of scaling and transactions from the beginning. -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: Database Query Contains Old Data
On Wed, 21 May 2008 07:23:04 -0700 (PDT), Paul Boddie > MySQL appears to use "repeatable read" by default [1] as its > transaction isolation level, whereas PostgreSQL (for example) uses > "read committed" by default [2]. I would guess that if you were using > PostgreSQL, this particular problem would not have occurred, but there > are other reasons to be aware of the effects of long duration > transactions in PostgreSQL, and the practice of periodically > performing a rollback would still be worth considering with that > database system. If one has transactions open for a long time, or transactions that involve a great deal of data, this will result in poor performance or poor scalability. But one may have such large transactions without being aware of it. Is there any way to make transaction size salient to the developer? Any way to make sure one is committing as early and often as possible? -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: writing python extensions in assembly
On Fri, 16 May 2008 11:21:39 -0400, "inhahe" <[EMAIL PROTECTED]> wrote: > They say that the C++ optimizer can usually optimize > better than a person coding in assembler by hand can, > but I just can't believe that, at least for me, > because when I code in assembler, if one hand compiles C++ into assembler, the result will doubtless be crap compared to what the compiler will generate. If, however, one expresses one's algorithm in assembler, rather than in C++, the result may well be dramatically more efficient than expressing one's algorithm in C++ and the compiler translating it into assembler. A factor of ten is quite common. -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: scaling problems
On Mon, 19 May 2008 21:04:28 -0400, "David Stanek" <[EMAIL PROTECTED]> wrote: > What is the difference if you have a process with 10 threads or 10 > separate processes running in parallel? Apache is a good example of a > server that may be configured to use multiple processes to handle > requests. And from what I hear is scales just fine. > > I think you are looking at the problem wrong. The fundamentals are the > same between threads and processes. I am not planning to write a web server framework, but to use one. Doubtless a python framework could be written to have satisfactory scaling properties, but what are the scaling properties of the ones that have been written? -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: scaling problems
> > 2. It is not clear to me how a python web application scales. Python > > is inherently single threaded, so one will need lots of python > > processes on lots of computers, with the database software handling > > parallel accesses to the same or related data. One could organize it > > as one python program for each url, and one python process for each > > http request, but that involves a lot of overhead starting up and > > shutting down python processes. Or one could organize it as one > > python program for each url, but if one gets a lot of http requests > > for one url, a small number of python processes will each sequentially > > handle a large number of those requests. What I am really asking is: > > Are there python web frameworks that scale with hardware and how do > > they handle scaling? Reid Priedhorsky > This sounds like a good match for Apache with mod_python. I would hope that it is, but the question that I would like to know is how does mod_python handle the problem - how do python programs and processes relate to web pages and http requests when one is using mod_python, and what happens when one has quite a lot of web pages and a very large number of http requests? -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: scaling problems
> > 1. Looks to me that python will not scale to very large programs, > > partly because of the lack of static typing, but mostly because there > > is no distinction between creating a new variable and utilizing an > > existing variable, Ben Finney > This seems quite a non sequitur. How do you see a connection between > these properties and "will not scale to large programs"? The larger the program, the greater the likelihood of inadvertent name collisions creating rare and irreproducible interactions between different and supposedly independent parts of the program that each work fine on their own, and supposedly cannot possibly interact. > These errors are a small subset of possible errors. If writing a large > program, an automated testing suite is essential, and can catch far > more errors than the compiler can hope to catch. If you run a static > code analyser, you'll be notified of unused names and other simple > errors that are often caught by static-declaration compilers. That is handy, but the larger the program, the bigger the problem with names that are over used, rather than unused. -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
scaling problems
I am just getting into python, and know little about it, and am posting to ask on what beaches the salt water crocodiles hang out. 1. Looks to me that python will not scale to very large programs, partly because of the lack of static typing, but mostly because there is no distinction between creating a new variable and utilizing an existing variable, so the interpreter fails to catch typos and name collisions. I am inclined to suspect that when a successful small python program turns into a large python program, it rapidly reaches ninety percent complete, and remains ninety percent complete forever. 2. It is not clear to me how a python web application scales. Python is inherently single threaded, so one will need lots of python processes on lots of computers, with the database software handling parallel accesses to the same or related data. One could organize it as one python program for each url, and one python process for each http request, but that involves a lot of overhead starting up and shutting down python processes. Or one could organize it as one python program for each url, but if one gets a lot of http requests for one url, a small number of python processes will each sequentially handle a large number of those requests. What I am really asking is: Are there python web frameworks that scale with hardware and how do they handle scaling? Please don't read this as "Python sucks, everyone should program in machine language expressed as binary numbers". I am just asking where the problems are. -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list