Q_Id
int64 337
49.3M
| CreationDate
stringlengths 23
23
| Users Score
int64 -42
1.15k
| Other
int64 0
1
| Python Basics and Environment
int64 0
1
| System Administration and DevOps
int64 0
1
| Tags
stringlengths 6
105
| A_Id
int64 518
72.5M
| AnswerCount
int64 1
64
| is_accepted
bool 2
classes | Web Development
int64 0
1
| GUI and Desktop Applications
int64 0
1
| Answer
stringlengths 6
11.6k
| Available Count
int64 1
31
| Q_Score
int64 0
6.79k
| Data Science and Machine Learning
int64 0
1
| Question
stringlengths 15
29k
| Title
stringlengths 11
150
| Score
float64 -1
1.2
| Database and SQL
int64 0
1
| Networking and APIs
int64 0
1
| ViewCount
int64 8
6.81M
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
214,852 | 2008-10-18T10:17:00.000 | 0 | 0 | 1 | 0 | python,module | 68,483,909 | 5 | false | 0 | 0 | I had the same issue as administrative rights to the default python library is blocked in a corporate environment and its extremely troublesome to perform installations.
What works for me:
Duplicate the sqlite3 library in a new location
Put in the latest sqlite3.dll (version you want from sqlite3 web) and the old _sqlite3.pyd into the new location or the new sqlite3 library. The old _sqlite3.pyd can be found in the default python library lib/DLLs folder.
Go to the new sqlite3 library and amend the dbapi2.py as follows:
Change "from _sqlite3 import *" to "from sqlite3._sqlite3 import *"
Make sure python loads this new sqlite3 library first. Add the path to this library if you must. | 3 | 24 | 0 | Is there a way to make a python module load a dll in my application directory rather than the version that came with the python installation, without making changes to the python installation (which would then require I made an installer, and be careful I didn't break other apps for people by overwrting python modules and changing dll versions globaly...)?
Specifically I would like python to use my version of the sqlite3.dll, rather than the version that came with python (which is older and doesn't appear to have the fts3 module). | python module dlls | 0 | 0 | 0 | 32,146 |
214,852 | 2008-10-18T10:17:00.000 | 0 | 0 | 1 | 0 | python,module | 214,855 | 5 | false | 0 | 0 | If your version of sqlite is in sys.path before the systems version it will use that. So you can either put it in the current directory or change the PYTHONPATH environment variable to do that. | 3 | 24 | 0 | Is there a way to make a python module load a dll in my application directory rather than the version that came with the python installation, without making changes to the python installation (which would then require I made an installer, and be careful I didn't break other apps for people by overwrting python modules and changing dll versions globaly...)?
Specifically I would like python to use my version of the sqlite3.dll, rather than the version that came with python (which is older and doesn't appear to have the fts3 module). | python module dlls | 0 | 0 | 0 | 32,146 |
214,852 | 2008-10-18T10:17:00.000 | 7 | 0 | 1 | 0 | python,module | 214,901 | 5 | true | 0 | 0 | Ok it turns out python always loads the dll in the same directory as the pyd file, regardless of what the python and os paths are set to.
So I needed to copy the _sqlite3.pyd from python/v2.5/DLLS to my apps directory where the new sqlite3.dll is, making it load my new dll, rather than the one that comes with python (since the pyd files seem to follow the PYTHONPATH, even though the actual dlls themselves don't). | 3 | 24 | 0 | Is there a way to make a python module load a dll in my application directory rather than the version that came with the python installation, without making changes to the python installation (which would then require I made an installer, and be careful I didn't break other apps for people by overwrting python modules and changing dll versions globaly...)?
Specifically I would like python to use my version of the sqlite3.dll, rather than the version that came with python (which is older and doesn't appear to have the fts3 module). | python module dlls | 1.2 | 0 | 0 | 32,146 |
215,267 | 2008-10-18T16:51:00.000 | 0 | 1 | 0 | 1 | python,configuration,trac,python-egg-cache | 406,119 | 5 | false | 0 | 0 | I found that using the PythonOption directive in the site config did not work, but SetEnv did. The environment variable route will also work though. | 3 | 1 | 0 | We've been using Trac for task/defect tracking and things were going well enough, but this morning it started serving up a 500 error. Looking in the Apache error_log, I get a stack trace that culminates in:
PythonHandler trac.web.modpython_frontend:
ExtractionError: Can't extract file(s) to egg cache
The following error occurred while trying to extract file(s) to the Python egg
cache:
[Errno 13] Permission denied: '/.python-eggs'
The Python egg cache directory is currently set to:
/.python-eggs
Perhaps your account does not have write access to this directory? You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory
So I explicitly set PYTHON_EGG_CACHE to /srv/trac/plugin-cache. I restarted Apache. Yet I get the same error (it still says "egg cache directory current set to: \n\n /.python_eggs.")
How should I proceed? Is the simplest thing to do to reinstall Trac? If I go that route, what steps do I need to take to ensure that I don't lose existing data? | How do you fix a Trac installation that begins giving errors relating to PYTHON_EGG_CACHE? | 0 | 0 | 0 | 2,011 |
215,267 | 2008-10-18T16:51:00.000 | 0 | 1 | 0 | 1 | python,configuration,trac,python-egg-cache | 219,233 | 5 | false | 0 | 0 | I had the same problem. In my case the directory wasn't there so I created and chown'ed it over to the apache user (apache on my centos 4.3 box). Then made sure it had read-write permissions on the directory. You could get by with giving rw rights to the directory if the group that owns the directory contains the apache user. A simple ps aux|grep httpd should show you what account your server is running under if you don't know it. If you have trouble finding the directory remember the -a on the ls command since it is a "hidden" directory. | 3 | 1 | 0 | We've been using Trac for task/defect tracking and things were going well enough, but this morning it started serving up a 500 error. Looking in the Apache error_log, I get a stack trace that culminates in:
PythonHandler trac.web.modpython_frontend:
ExtractionError: Can't extract file(s) to egg cache
The following error occurred while trying to extract file(s) to the Python egg
cache:
[Errno 13] Permission denied: '/.python-eggs'
The Python egg cache directory is currently set to:
/.python-eggs
Perhaps your account does not have write access to this directory? You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory
So I explicitly set PYTHON_EGG_CACHE to /srv/trac/plugin-cache. I restarted Apache. Yet I get the same error (it still says "egg cache directory current set to: \n\n /.python_eggs.")
How should I proceed? Is the simplest thing to do to reinstall Trac? If I go that route, what steps do I need to take to ensure that I don't lose existing data? | How do you fix a Trac installation that begins giving errors relating to PYTHON_EGG_CACHE? | 0 | 0 | 0 | 2,011 |
215,267 | 2008-10-18T16:51:00.000 | 1 | 1 | 0 | 1 | python,configuration,trac,python-egg-cache | 215,401 | 5 | false | 0 | 0 | I have wrestled many a battle with PYTHON_EGG_CACHE and I never figured out the correct way of setting it - apache's envvars, httpd.conf (SetEnv and PythonOption), nothing worked. In the end I just unpacked all python eggs manually, there were only two or three anyway - problem gone. I never understood why on earth people zip up files weighting no more than a few kilobytes in the first place... | 3 | 1 | 0 | We've been using Trac for task/defect tracking and things were going well enough, but this morning it started serving up a 500 error. Looking in the Apache error_log, I get a stack trace that culminates in:
PythonHandler trac.web.modpython_frontend:
ExtractionError: Can't extract file(s) to egg cache
The following error occurred while trying to extract file(s) to the Python egg
cache:
[Errno 13] Permission denied: '/.python-eggs'
The Python egg cache directory is currently set to:
/.python-eggs
Perhaps your account does not have write access to this directory? You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory
So I explicitly set PYTHON_EGG_CACHE to /srv/trac/plugin-cache. I restarted Apache. Yet I get the same error (it still says "egg cache directory current set to: \n\n /.python_eggs.")
How should I proceed? Is the simplest thing to do to reinstall Trac? If I go that route, what steps do I need to take to ensure that I don't lose existing data? | How do you fix a Trac installation that begins giving errors relating to PYTHON_EGG_CACHE? | 0.039979 | 0 | 0 | 2,011 |
215,570 | 2008-10-18T21:12:00.000 | 15 | 0 | 0 | 1 | python,api,google-app-engine | 216,187 | 2 | true | 1 | 0 | There are several differences:
All entities with the same ancestor are in the same entity group. Transactions can only affect entities inside a single entity group.
All writes to a single entity group are serialized, so throughput is limited.
The parent entity is set on creation and is fixed. References can be changed at any time.
With reference properties, you can only query for direct relationships, but with parent properties you can use the .ancestor() filter to find everything (directly or indirectly) descended from a given ancestor.
Each entity has only a single parent, but can have multiple reference properties. | 1 | 10 | 0 | From what I understand, the parent attribute of a db.Model (typically defined/passed in the constructor call) allows you to define hierarchies in your data models. As a result, this increases the size of the entity group. However, it's not very clear to me why we would want to do that. Is this strictly for ACID compliance? I would like to see scenarios where each is best suited or more appropriate. | What's the difference between a parent and a reference property in Google App Engine? | 1.2 | 1 | 0 | 1,067 |
216,093 | 2008-10-19T06:07:00.000 | 0 | 0 | 0 | 0 | python,gtk,module,pygtk,organization | 219,737 | 6 | false | 0 | 1 | So having not heard back regarding my edit to the original question, I have done some more research and the conclusion I seem to be coming to is that yes, I should break the interface out into several views, each with its own controller. Python-gtkmvc provides the ability to this by providing a glade_top_widget_name parameter to the View constructor. This all seems to make a good deal of sense although it is going to require a large refactoring of my existing codebase which I may or may not be willing to undertake in the near-term (I know, I know, I should.) Moreover, I'm left to wonder whether should just have a single Model object (my application is fairly simple--no more than twenty-five state vars) or if I should break it out into multiple models and have to deal with controllers observing multiple models and chaining notifications across them. (Again, I know I really should do the latter.) If anyone has any further insight, I still don't really feel like I've gotten an answer to the original question, although I have a direction to head in now.
(Moreover it seems like their ought to be other architectural choices at hand, given that up until now I had not seen a single Python application coded in the MVC style, but then again many Python applications tend to have the exact problem I've described above.) | 2 | 8 | 0 | I am working on a desktop application in PyGTK and seem to be bumping up against some limitations of my file organization. Thus far I've structured my project this way:
application.py - holds the primary application class (most functional routines)
gui.py - holds a loosely coupled GTK gui implementation. Handles signal callbacks, etc.
command.py - holds command line automation functions not dependent on data in the application class
state.py - holds the state data persistence class
This has served fairly well so far, but at this point application.py is starting to get rather long. I have looked at numerous other PyGTK applications and they seem to have similar structural issues. At a certain point the primary module starts to get very long and there is not obvious way of breaking the code out into narrower modules without sacrificing clarity and object orientation.
I have considered making the GUI the primary module and having seperate modules for the toolbar routines, the menus routines, etc, but at that point I believe I will lose most of the benefits of OOP and end up with an everything-references-everything scenario.
Should I just deal with having a very long central module or is there a better way of structuring the project so that I don't have to rely on the class browser so much?
EDIT I
Ok, so point taken regarding all the MVC stuff. I do have a rough approximation of MVC in my code, but admittedly I could probably gain some mileage by further segregating the model and controller. However, I am reading over python-gtkmvc's documentation (which is a great find by the way, thank you for referencing it) and my impression is that its not going to solve my problem so much as just formalize it. My application is a single glade file, generally a single window. So no matter how tightly I define the MVC roles of the modules I'm still going to have one controller module doing most everything, which is pretty much what I have now. Admittedly I'm a little fuzzy on proper MVC implementation and I'm going to keep researching, but it doesn't look to me like this architecture is going to get any more stuff out of my main file, its just going to rename that file to controller.py.
Should I be thinking about separate Controller/View pairs for seperate sections of the window (the toolbar, the menus, etc)? Perhaps that is what I'm missing here. It seems that this is what S. Lott is referring to in his second bullet point.
Thanks for the responses so far. | How do I coherently organize modules for a PyGTK desktop application? | 0 | 0 | 0 | 2,015 |
216,093 | 2008-10-19T06:07:00.000 | 2 | 0 | 0 | 0 | python,gtk,module,pygtk,organization | 216,386 | 6 | false | 0 | 1 | "holds the primary application class (most functional routines)"
As in singular -- one class?
I'm not surprised that the One Class Does Everything design isn't working. It might not be what I'd call object-oriented. It doesn't sound like it follows the typical MVC design pattern if your functionality is piling up in a single class.
What's in this massive class? I suggest that you can probably refactor this into pieces. You have two candidate dimensions for refactoring your application class -- if, indeed, I've guessed right that you've put everything into a single class.
Before doing anything else, refactor into components that parallel the Real World Entities. It's not clear what's in your "state.py" -- wether this is a proper model of real-world entities, or just mappings between persistent storage and some murky data structure in the application. Most likely you'd move processing out of your application and into your model (possibly state.py, possibly a new module that is a proper model.)
Break your model into pieces. It will help organize the control and view elements. The most common MVC mistake is to put too much in control and nothing in the model.
Later, once your model is doing most of the work, you can look at refactor into components that parallel the GUI presentation. Various top-level frames, for example, should probably have separate cotrol objects. It's not clear what's in "GUI.py" -- this might be a proper view. What appears to be missing is a Control component. | 2 | 8 | 0 | I am working on a desktop application in PyGTK and seem to be bumping up against some limitations of my file organization. Thus far I've structured my project this way:
application.py - holds the primary application class (most functional routines)
gui.py - holds a loosely coupled GTK gui implementation. Handles signal callbacks, etc.
command.py - holds command line automation functions not dependent on data in the application class
state.py - holds the state data persistence class
This has served fairly well so far, but at this point application.py is starting to get rather long. I have looked at numerous other PyGTK applications and they seem to have similar structural issues. At a certain point the primary module starts to get very long and there is not obvious way of breaking the code out into narrower modules without sacrificing clarity and object orientation.
I have considered making the GUI the primary module and having seperate modules for the toolbar routines, the menus routines, etc, but at that point I believe I will lose most of the benefits of OOP and end up with an everything-references-everything scenario.
Should I just deal with having a very long central module or is there a better way of structuring the project so that I don't have to rely on the class browser so much?
EDIT I
Ok, so point taken regarding all the MVC stuff. I do have a rough approximation of MVC in my code, but admittedly I could probably gain some mileage by further segregating the model and controller. However, I am reading over python-gtkmvc's documentation (which is a great find by the way, thank you for referencing it) and my impression is that its not going to solve my problem so much as just formalize it. My application is a single glade file, generally a single window. So no matter how tightly I define the MVC roles of the modules I'm still going to have one controller module doing most everything, which is pretty much what I have now. Admittedly I'm a little fuzzy on proper MVC implementation and I'm going to keep researching, but it doesn't look to me like this architecture is going to get any more stuff out of my main file, its just going to rename that file to controller.py.
Should I be thinking about separate Controller/View pairs for seperate sections of the window (the toolbar, the menus, etc)? Perhaps that is what I'm missing here. It seems that this is what S. Lott is referring to in his second bullet point.
Thanks for the responses so far. | How do I coherently organize modules for a PyGTK desktop application? | 0.066568 | 0 | 0 | 2,015 |
216,119 | 2008-10-19T06:56:00.000 | 0 | 0 | 1 | 0 | python,list,recursion | 216,123 | 20 | false | 0 | 0 | Take the first element, reverse the rest of the list recursively, and append the first element at the end of the list. | 3 | 6 | 0 | I want to have a function that will return the reverse of a list that it is given -- using recursion. How can I do that? | How do I reverse a list using recursion in Python? | 0 | 0 | 0 | 54,014 |
216,119 | 2008-10-19T06:56:00.000 | 7 | 0 | 1 | 0 | python,list,recursion | 216,184 | 20 | false | 0 | 0 | I know it's not a helpful answer (though this question has been already answered), but in any real code, please don't do that. Python cannot optimize tail-calls, has slow function calls and has a fixed recursion depth, so there are at least 3 reasons why to do it iteratively instead. | 3 | 6 | 0 | I want to have a function that will return the reverse of a list that it is given -- using recursion. How can I do that? | How do I reverse a list using recursion in Python? | 1 | 0 | 0 | 54,014 |
216,119 | 2008-10-19T06:56:00.000 | 4 | 0 | 1 | 0 | python,list,recursion | 216,132 | 20 | false | 0 | 0 | The trick is to join after recursing:
def backwards(l):
if not l:
return
x, y = l[0], l[1:]
return backwards(y) + [x] | 3 | 6 | 0 | I want to have a function that will return the reverse of a list that it is given -- using recursion. How can I do that? | How do I reverse a list using recursion in Python? | 0.039979 | 0 | 0 | 54,014 |
216,489 | 2008-10-19T14:45:00.000 | 0 | 0 | 0 | 0 | python,webserver,web-frameworks | 217,467 | 5 | false | 1 | 0 | Your staging environment should mimic your production environment. Development is more like a playground, and the control on the development environment should not be quite so strict. However, the development environment should periodically be refreshed from the production environment (e.g,. prod data copied to the dev db, close the ports on dev that are closed on prod, etc.).
Ideally, dev, stage, and prod are all on separate machines. The separate machines can be separate physical boxes, or virtual machines on the same physical box, depending on budget/needs. | 4 | 5 | 0 | Most python frameworks will have a development webserver of some kind that will have a warning that it isn't for use as production servers. How much different do they tend to be from their production equivalents?
I haven't quite decided which framework to go with, much less what production server to use, so it's kinda difficult for me to pin this down to a "compare development server x to production server y." So with that said, let me make the question a little bit more precise: In your past experience with a python framework, how much time did you have to spend getting your application up and running with a production system once its been developed on a development server? Or did you skip the development server and develop your app on a server that's more like what you will use in production? | How close are development webservers to production webservers? | 0 | 0 | 0 | 609 |
216,489 | 2008-10-19T14:45:00.000 | 2 | 0 | 0 | 0 | python,webserver,web-frameworks | 216,495 | 5 | false | 1 | 0 | Generally, they are same in terms of the settings which are required to run the applications which include the environment setting.
However, the clients genereally have dev systems which are less powerful in terms of the processing power and other h/w resources. I have seen using them virtual servers in dev evironment since they generally have multiple projects going on in parallel an this helps them reducing the cost. | 4 | 5 | 0 | Most python frameworks will have a development webserver of some kind that will have a warning that it isn't for use as production servers. How much different do they tend to be from their production equivalents?
I haven't quite decided which framework to go with, much less what production server to use, so it's kinda difficult for me to pin this down to a "compare development server x to production server y." So with that said, let me make the question a little bit more precise: In your past experience with a python framework, how much time did you have to spend getting your application up and running with a production system once its been developed on a development server? Or did you skip the development server and develop your app on a server that's more like what you will use in production? | How close are development webservers to production webservers? | 0.07983 | 0 | 0 | 609 |
216,489 | 2008-10-19T14:45:00.000 | 5 | 0 | 0 | 0 | python,webserver,web-frameworks | 216,628 | 5 | true | 1 | 0 | The lower environments should try to match the production environment as closely as possible given the resources available. This applies to all development efforts regardless of whether they are python-based or even web-based. In practical terms, most organizations are not willing to spend that type of money. In this case try to make at least the environment that is directly below production as close to production as possible.
Some of the variable to keep in mind are:
many times there are multiple machines (app server, database server, web server, load balancers, fire walls, etc) in a production. Keep these all in mind.
Operating Systems
number of CPUs. Moving from a one CPU lower environment to a multi core production environment can expose multi-threading issues that were not tested
load balancing. Many times lower environments are not load balanced. If you are replicating sessions (for instance) across multiple production app servers, you should try to do the same in a lower environment
Software / library versions | 4 | 5 | 0 | Most python frameworks will have a development webserver of some kind that will have a warning that it isn't for use as production servers. How much different do they tend to be from their production equivalents?
I haven't quite decided which framework to go with, much less what production server to use, so it's kinda difficult for me to pin this down to a "compare development server x to production server y." So with that said, let me make the question a little bit more precise: In your past experience with a python framework, how much time did you have to spend getting your application up and running with a production system once its been developed on a development server? Or did you skip the development server and develop your app on a server that's more like what you will use in production? | How close are development webservers to production webservers? | 1.2 | 0 | 0 | 609 |
216,489 | 2008-10-19T14:45:00.000 | 2 | 0 | 0 | 0 | python,webserver,web-frameworks | 216,653 | 5 | false | 1 | 0 | I develop with django. The production server we have is remote, so it's a pain to be using it for development. Thus, at first, I created a vm and tried to match as closely as I could the environment of the prod server. At some point that vm got hosed (due to an unrelated incident). I took stock of the situation at that time and realized there really was no good reason to be using a customized vm for development. Since the resources available to the app weren't the same as the prod server, it was no good for timing queries anyway (in an absolute sense).
That said, I now use django's built in dev server with sqlite for development, and apache/wsgi and postgresql for production. As long as the python dependencies are met on both sides, it's 100% compatible. The only potential problem would be writing raw sql instead of using the orm. | 4 | 5 | 0 | Most python frameworks will have a development webserver of some kind that will have a warning that it isn't for use as production servers. How much different do they tend to be from their production equivalents?
I haven't quite decided which framework to go with, much less what production server to use, so it's kinda difficult for me to pin this down to a "compare development server x to production server y." So with that said, let me make the question a little bit more precise: In your past experience with a python framework, how much time did you have to spend getting your application up and running with a production system once its been developed on a development server? Or did you skip the development server and develop your app on a server that's more like what you will use in production? | How close are development webservers to production webservers? | 0.07983 | 0 | 0 | 609 |
216,972 | 2008-10-19T21:08:00.000 | 508 | 0 | 1 | 0 | python,terminology | 216,980 | 6 | true | 0 | 0 | It basically means that the object implements the __getitem__() method. In other words, it describes objects that are "containers", meaning they contain other objects. This includes strings, lists, tuples, and dictionaries. | 1 | 544 | 0 | Which types of objects fall into the domain of "subscriptable"? | What does it mean if a Python object is "subscriptable" or not? | 1.2 | 0 | 0 | 871,051 |
219,215 | 2008-10-20T17:19:00.000 | -1 | 0 | 1 | 0 | python,windows,windows-vista,tkinter | 792,527 | 3 | false | 0 | 1 | python 2.6.2 + tkinter 8.5, no problems | 3 | 3 | 0 | I installed Python 2.6 for one user on Windows Vista. Python works okay, but when I try: import Tkinter, it says the side-by-side configuration has errors. I've tried tinkering with the Visual Studio runtime, with no good results. Any ideas on how to resolve this? | How do I use Tkinter with Python on Windows Vista? | -0.066568 | 0 | 0 | 1,345 |
219,215 | 2008-10-20T17:19:00.000 | 1 | 0 | 1 | 0 | python,windows,windows-vista,tkinter | 219,326 | 3 | false | 0 | 1 | It seems this is a one of the many weird Vista problems and some random reinstalling, installing/upgrading of the visual studio runtime or some such seems sometimes to help, or disabling sxs in the system configuration or writing a manifest file etc.
Though I think you should downgrade to windows XP. | 3 | 3 | 0 | I installed Python 2.6 for one user on Windows Vista. Python works okay, but when I try: import Tkinter, it says the side-by-side configuration has errors. I've tried tinkering with the Visual Studio runtime, with no good results. Any ideas on how to resolve this? | How do I use Tkinter with Python on Windows Vista? | 0.066568 | 0 | 0 | 1,345 |
219,215 | 2008-10-20T17:19:00.000 | 1 | 0 | 1 | 0 | python,windows,windows-vista,tkinter | 219,284 | 3 | true | 0 | 1 | Maybe you should downgrade to 2.5 version? | 3 | 3 | 0 | I installed Python 2.6 for one user on Windows Vista. Python works okay, but when I try: import Tkinter, it says the side-by-side configuration has errors. I've tried tinkering with the Visual Studio runtime, with no good results. Any ideas on how to resolve this? | How do I use Tkinter with Python on Windows Vista? | 1.2 | 0 | 0 | 1,345 |
220,525 | 2008-10-21T01:58:00.000 | 0 | 0 | 0 | 1 | python,linux,single-instance | 220,536 | 12 | false | 0 | 0 | If you create a lock file and put the pid in it, you can check your process id against it and tell if you crashed, no?
I haven't done this personally, so take with appropriate amounts of salt. :p | 4 | 33 | 0 | I'm working on a GUI application in WxPython, and I am not sure how I can ensure that only one copy of my application is running at any given time on the machine. Due to the nature of the application, running more than once doesn't make any sense, and will fail quickly. Under Win32, I can simply make a named mutex and check that at startup. Unfortunately, I don't know of any facilities in Linux that can do this.
I'm looking for something that will automatically be released should the application crash unexpectedly. I don't want to have to burden my users with having to manually delete lock files because I crashed. | Ensure a single instance of an application in Linux | 0 | 0 | 0 | 22,567 |
220,525 | 2008-10-21T01:58:00.000 | 62 | 0 | 0 | 1 | python,linux,single-instance | 220,709 | 12 | false | 0 | 0 | The Right Thing is advisory locking using flock(LOCK_EX); in Python, this is found in the fcntl module.
Unlike pidfiles, these locks are always automatically released when your process dies for any reason, have no race conditions exist relating to file deletion (as the file doesn't need to be deleted to release the lock), and there's no chance of a different process inheriting the PID and thus appearing to validate a stale lock.
If you want unclean shutdown detection, you can write a marker (such as your PID, for traditionalists) into the file after grabbing the lock, and then truncate the file to 0-byte status before a clean shutdown (while the lock is being held); thus, if the lock is not held and the file is non-empty, an unclean shutdown is indicated. | 4 | 33 | 0 | I'm working on a GUI application in WxPython, and I am not sure how I can ensure that only one copy of my application is running at any given time on the machine. Due to the nature of the application, running more than once doesn't make any sense, and will fail quickly. Under Win32, I can simply make a named mutex and check that at startup. Unfortunately, I don't know of any facilities in Linux that can do this.
I'm looking for something that will automatically be released should the application crash unexpectedly. I don't want to have to burden my users with having to manually delete lock files because I crashed. | Ensure a single instance of an application in Linux | 1 | 0 | 0 | 22,567 |
220,525 | 2008-10-21T01:58:00.000 | 0 | 0 | 0 | 1 | python,linux,single-instance | 220,541 | 12 | false | 0 | 0 | By far the most common method is to drop a file into /var/run/ called [application].pid which contains only the PID of the running process, or parent process.
As an alternative, you can create a named pipe in the same directory to be able to send messages to the active process, e.g. to open a new file. | 4 | 33 | 0 | I'm working on a GUI application in WxPython, and I am not sure how I can ensure that only one copy of my application is running at any given time on the machine. Due to the nature of the application, running more than once doesn't make any sense, and will fail quickly. Under Win32, I can simply make a named mutex and check that at startup. Unfortunately, I don't know of any facilities in Linux that can do this.
I'm looking for something that will automatically be released should the application crash unexpectedly. I don't want to have to burden my users with having to manually delete lock files because I crashed. | Ensure a single instance of an application in Linux | 0 | 0 | 0 | 22,567 |
220,525 | 2008-10-21T01:58:00.000 | 25 | 0 | 0 | 1 | python,linux,single-instance | 220,542 | 12 | true | 0 | 0 | There are several common techniques including using semaphores. The one I see used most often is to create a "pid lock file" on startup that contains the pid of the running process. If the file already exists when the program starts up, open it up and grab the pid inside, check to see if a process with that pid is running, if it is check the cmdline value in /proc/pid to see if it is an instance of your program, if it is then quit, otherwise overwrite the file with your pid. The usual name for the pid file is application_name.pid. | 4 | 33 | 0 | I'm working on a GUI application in WxPython, and I am not sure how I can ensure that only one copy of my application is running at any given time on the machine. Due to the nature of the application, running more than once doesn't make any sense, and will fail quickly. Under Win32, I can simply make a named mutex and check that at startup. Unfortunately, I don't know of any facilities in Linux that can do this.
I'm looking for something that will automatically be released should the application crash unexpectedly. I don't want to have to burden my users with having to manually delete lock files because I crashed. | Ensure a single instance of an application in Linux | 1.2 | 0 | 0 | 22,567 |
220,777 | 2008-10-21T04:40:00.000 | 2 | 0 | 1 | 0 | python,dll,installation,py2exe,pyd | 220,830 | 4 | false | 0 | 0 | If they're not being automatically detected, try manually copying them into py2exe's temporary build directory. They will be included in the final executable. | 1 | 10 | 0 | One of the modules for my app uses functions from a .pyd file. There's an option to exclude dlls (exclude_dlls) but is there one for including them? The build process doesn't seem to be copying the .pyd in my module despite copying the rest of the files (.py). I also need to include a .dll. How do I get py2exe to include both .pyd and .dll files? | Including PYDs/DLLs in py2exe builds | 0.099668 | 0 | 0 | 14,984 |
221,386 | 2008-10-21T10:21:00.000 | 0 | 0 | 1 | 0 | python,numpy,binaryfiles | 221,696 | 6 | false | 0 | 0 | You need to make your question more precise. Do you know the values you want to trim ahead of time?
Assuming you do, I would probably search for the matching sections using subprocess to run "fgrep -o -b <search string>" and then change the relevant sections of the file using the python file object's seek, read and write methods. | 1 | 3 | 0 | I would like to trim long sequences of the same value from a binary file in python. A simple way of doing it is simply reading in the file and using re.sub to replace the unwanted sequence. This will of course not work on large binary files. Can it be done in something like numpy? | Removing a sequence of characters from a large binary file using python | 0 | 0 | 0 | 3,954 |
221,745 | 2008-10-21T12:56:00.000 | 0 | 0 | 0 | 1 | python,networking,sockets,twisted | 24,895,751 | 4 | false | 0 | 0 | A better way to do this is with twisted.protocols.policies.TimeoutMixin. It's essentially doing a callLater but abstracted into a Mixin. | 1 | 9 | 0 | I realize I'm probably just dumb and missing something big and important, but I can't figure out how to specify a timeout in twisted using reactor.listenUDP. My goal is to be able to specify a timeout, and after said amount of time, if DatagramProtocol.datagramReceived has not been executed, have it execute a callback or something that I can use to call reactor.stop(). Any help or advice is appreciated. Thanks | Is it possible to set a timeout on a socket in Twisted? | 0 | 0 | 0 | 7,051 |
224,337 | 2008-10-22T02:54:00.000 | 1 | 0 | 0 | 0 | python,wxpython,wizard | 247,409 | 5 | false | 0 | 1 | The wxPython demo has an example of a "dynamic" wizard. Pages override GetNext() and GetPrev() to show pages dynamically. This shows the basic technique; you can extend it to add and remove pages, change pages on the fly, and rearrange pages dynamically.
The wizard class is just a convenience, though. You can modify it, or create your own implementation. A style that seems popular nowadays is to use an HTML-based presentation; you can emulate this with the wxHtml control, or the IEHtmlWindow control if your app is Windows only. | 2 | 3 | 0 | I'm making a program that fits the wizard concept ideally; the user is walked through the steps to create a character for a game.
However, I'm realizing that the limitations of the wizard are making it difficult to design "elegant" logic flow. For example, because all pages of the wizard are initalized at the same time, I can't have the values entered in one page available to the next one. I have to put a button on each page to get the values from a previous page rather than simply having fields auto-populated.
I've thought about alternatives to using the wizard. I think the best idea is to have some buttons on one panel that change the information on another panel, e.g. a splitter window.
However, I can't find any documentation in wxPython on how to dynamically change the panel. Everything I've found so far is really pretty static, hence the use of the wizard. Even the "wxPython in Action" book doesn't mention it.
Are there any tutorials for making "dynamic panels" or better management of a wizard? | Alternatives to a wizard | 0.039979 | 0 | 0 | 2,843 |
224,337 | 2008-10-22T02:54:00.000 | 0 | 0 | 0 | 0 | python,wxpython,wizard | 247,633 | 5 | false | 0 | 1 | I'd get rid of wizard in whole. They are the most unpleasant things I've ever used.
The problem that requires a wizard-application where you click 'next' is perhaps a problem where you could apply a better user interface in a bit different manner. Instead of bringing up a dialog with annoying 'next' -button. Do this:
Bring up a page. When the user inserts the information to the page, extend or shorten it according to the input. If your application needs to do some processing to continue, and it's impossible to revert after that, write a new page or disable the earlier section of the current page. When you don't need any input from the user anymore or the app is finished, you can show a button or enable an existing such.
I don't mean you should implement it all in browser. Make simply a scrolling container that can contain buttons and labels in a flat list.
Benefit: The user can just click a tab, and you are encouraged to put all the processing into the end of filling the page. | 2 | 3 | 0 | I'm making a program that fits the wizard concept ideally; the user is walked through the steps to create a character for a game.
However, I'm realizing that the limitations of the wizard are making it difficult to design "elegant" logic flow. For example, because all pages of the wizard are initalized at the same time, I can't have the values entered in one page available to the next one. I have to put a button on each page to get the values from a previous page rather than simply having fields auto-populated.
I've thought about alternatives to using the wizard. I think the best idea is to have some buttons on one panel that change the information on another panel, e.g. a splitter window.
However, I can't find any documentation in wxPython on how to dynamically change the panel. Everything I've found so far is really pretty static, hence the use of the wizard. Even the "wxPython in Action" book doesn't mention it.
Are there any tutorials for making "dynamic panels" or better management of a wizard? | Alternatives to a wizard | 0 | 0 | 0 | 2,843 |
226,528 | 2008-10-22T16:14:00.000 | 13 | 0 | 0 | 0 | python,django,django-urls | 226,536 | 4 | false | 1 | 0 | I always use something like <a href="/"> (assuming your home is at the root, of course). I seem to recall looking this up once, and couldn't find a Django variable for this path; at any rate, / seemed pretty easy, anyway. | 1 | 24 | 0 | In Django templates, is there a variable in the context (e.g. {{ BASE\_URL }}, {{ ROOT\_URL }}, or {{ MEDIA\_URL }} that one can use to link to the home url of a project?
I.e. if Django is running in the root of a project, the variable (let's call it R) {{ R }} in a template would be /. If the root url is a sub-folder http://host/X/ the variable {{ R }} would be /X/ (or http://host/X/).
It seems painfully simple, but I can't find an answer. :) Thank you! | How does one put a link / url to the web-site's home page in Django? | 1 | 0 | 0 | 50,505 |
226,693 | 2008-10-22T17:00:00.000 | 0 | 0 | 1 | 0 | python,database,dictionary,disk-based | 226,837 | 8 | false | 0 | 0 | You should bring more than one item at a time if there's some heuristic to know which are the most likely items to be retrieved next, and don't forget the indexes like Charles mentions. | 2 | 43 | 0 | I was running some dynamic programming code (trying to brute-force disprove the Collatz conjecture =P) and I was using a dict to store the lengths of the chains I had already computed. Obviously, it ran out of memory at some point. Is there any easy way to use some variant of a dict which will page parts of itself out to disk when it runs out of room? Obviously it will be slower than an in-memory dict, and it will probably end up eating my hard drive space, but this could apply to other problems that are not so futile.
I realized that a disk-based dictionary is pretty much a database, so I manually implemented one using sqlite3, but I didn't do it in any smart way and had it look up every element in the DB one at a time... it was about 300x slower.
Is the smartest way to just create my own set of dicts, keeping only one in memory at a time, and paging them out in some efficient manner? | Python Disk-Based Dictionary | 0 | 0 | 0 | 17,656 |
226,693 | 2008-10-22T17:00:00.000 | 6 | 0 | 1 | 0 | python,database,dictionary,disk-based | 226,803 | 8 | false | 0 | 0 | Last time I was facing a problem like this, I rewrote to use SQLite rather than a dict, and had a massive performance increase. That performance increase was at least partially on account of the database's indexing capabilities; depending on your algorithms, YMMV.
A thin wrapper that does SQLite queries in __getitem__ and __setitem__ isn't much code to write. | 2 | 43 | 0 | I was running some dynamic programming code (trying to brute-force disprove the Collatz conjecture =P) and I was using a dict to store the lengths of the chains I had already computed. Obviously, it ran out of memory at some point. Is there any easy way to use some variant of a dict which will page parts of itself out to disk when it runs out of room? Obviously it will be slower than an in-memory dict, and it will probably end up eating my hard drive space, but this could apply to other problems that are not so futile.
I realized that a disk-based dictionary is pretty much a database, so I manually implemented one using sqlite3, but I didn't do it in any smart way and had it look up every element in the DB one at a time... it was about 300x slower.
Is the smartest way to just create my own set of dicts, keeping only one in memory at a time, and paging them out in some efficient manner? | Python Disk-Based Dictionary | 1 | 0 | 0 | 17,656 |
227,279 | 2008-10-22T19:48:00.000 | -2 | 0 | 1 | 0 | python,twisted,xmpp,google-talk | 228,877 | 4 | false | 0 | 0 | As the Twisted libs seem to be out of date, you have two choices:
Implement your own XMPP-handler or look for another library.
I would suggest working with the raw XML; XMPP is not that complicated and you are bound to learn something. | 1 | 17 | 0 | I am interested in making a Google Talk client using Python and would like to use the Twisted libraries Words module. I have looked at the examples, but they don't work with the current implementation of Google Talk.
Has anybody had any luck with this? Would you mind documenting a brief tutorial?
As a simple task, I'd like to create a client/bot that tracks the Online time of my various Google Talk accounts so that I can get an aggregate number. I figure I could friend the bot in each account and then use the XMPP presence information to keep track of the times that I can then aggregate.
Thanks. | How do you create a simple Google Talk Client using the Twisted Words Python library? | -0.099668 | 0 | 1 | 8,406 |
231,371 | 2008-10-23T20:30:00.000 | 8 | 1 | 1 | 0 | python,testing,bdd | 812,490 | 10 | false | 0 | 0 | The Pyccuracy project is an effort to provide a domain-specific language for BDD in Python.
Unlike doctest, which works at the API level, it encodes higher-level operations such as loading a web page and submitting a form. I haven't used it but it looks somewhat promising if that is what you're looking for. | 1 | 133 | 0 | Which are the most advanced frameworks and tools there are available for python for practicing Behavior Driven Development? Especially finding similar tools as rspec and mocha for ruby would be great. | Practicing BDD with python | 1 | 0 | 0 | 46,233 |
232,008 | 2008-10-23T23:50:00.000 | 4 | 0 | 0 | 0 | python,django,permissions | 232,243 | 6 | false | 1 | 0 | The Django permission system totally rules. Each model has a default set of permissions. You can add new permissions to your models, also.
Each User has a set of permissions as well as group memberships. Individual users can have individual permissions. And they inherit permissions from their group membership.
Your view functions (and templates) can easily check the presence of absence of those permissions at any level of granularity you need to use.
And if this isn't enough for you, the Profile add-on gives you yet more options for defining a "User" and their capabilities, permissions, roles, responsibilities, etc.
And if this isn't enough for you, you can define your own authentication schemes.
What's important is not to try and define groups that are actual subsets of users, not casually defined titles or roles. You never need to "set permissions for a sub-set of a group". You need to have smaller groups. Groups defined around subsets of people.
Django's default permissions are around model access, not row access within a model. On the other hand, your problem is about subsets of rows in several models: Client, Store, Employee, Manager.
You'll need a basic set of FK's among these items, and some filters to subset the rows. You may have trouble doing this with default admin pages. You may need your own version of admin to make use of specialized filters.
If you can't do it with the Django permission system, you should rethink your use cases. Seriously.
[The Django-REST Interface, however, is another beast entirely, and requires some care and feeding.] | 1 | 14 | 0 | I've been exploring the details of Django for about a week now and like what I see. However I've come upon some.. negativity in relation to fine-grained control of permissions to the CRUD interface.
What I'm writing is an Intranet client management web-app. The organisation is about 6 tiers, and I need to restrict access to client groups based on tiers. Continually expanding. I have a fairly good idea how I'm going to do this, but am not sure if I'll be able to integrate it well into the pre-built admin interface.
I've done absolutely zero Django development otherwise I'd probably have a better idea on whether this would work or not. I probably won't use Django if the generated admin interface is going to be useless to this project - but like I said, there is a heavy reliance on fine-grained custom permissions.
Will Django let me build custom permissions/rules and integrate it seamlessly into the admin CRUD interface?
Update One: I want to use the admin app to minimise the repitition of generating CRUD interfaces, so yes I consider it a must have.
Update Two:
I want to describe the permissions required for this project.
A client can belong to one or many 'stores'. Full time employees should only be able to edit clients at their store (even if they belong to another store). However, they should not be able to see/edit clients at another store. Casuals should only be able to view clients based on what store they are rostered too (or if the casual is logged in as the store user - more likely).
Management above them need to be able to see all employees for the stores they manage, nothing more.
Senior management should be able to edit ALL employees and grant permissions below themselves.
After reading the django documentation, it says you can't (autmoatically) set permissions for a sub-set of a group. Only the entire group. Is it easy enough to mock up your own permissions for this purpose? | Will Django be a good choice for a permissions based web-app? | 0.132549 | 0 | 0 | 8,167 |
236,407 | 2008-10-25T13:30:00.000 | 3 | 1 | 0 | 0 | python,development-environment | 236,570 | 8 | false | 0 | 0 | My general rule of thumb is to use dynamic languages for small non-mission-critical projects and statically-typed languages for big projects. I find that code written in a dynamic language such as python gets "tangled" more quickly. Partly that is because it is much quicker to write code in a dynamic language and that leads to shortcuts and worse design, at least in my case. Partly it's because I have IntelliJ for quick and easy refactoring when I use Java, which I don't have for python. | 4 | 62 | 0 | I would be interested to learn about large scale development in Python and especially in how do you maintain a large code base?
When you make incompatibility changes to the signature of a method, how do you find all the places where that method is being called. In C++/Java the compiler will find it for you, how do you do it in Python?
When you make changes deep inside the code, how do you find out what operations an instance provides, since you don't have a static type to lookup?
How do you handle/prevent typing errors (typos)?
Are UnitTest's used as a substitute for static type checking?
As you can guess I almost only worked with statically typed languages (C++/Java), but I would like to try my hands on Python for larger programs. But I had a very bad experience, a long time ago, with the clipper (dBase) language, which was also dynamically typed. | How can I use Python for large scale development? | 0.07486 | 0 | 0 | 19,675 |
236,407 | 2008-10-25T13:30:00.000 | 2 | 1 | 0 | 0 | python,development-environment | 236,470 | 8 | false | 0 | 0 | The usual answer to that is testing testing testing. You're supposed to have an extensive unit test suite and run it often, particularly before a new version goes online.
Proponents of dynamically typed languages make the case that you have to test anyway because even in a statically typed language conformance to the crude rules of the type system covers only a small part of what can potentially go wrong. | 4 | 62 | 0 | I would be interested to learn about large scale development in Python and especially in how do you maintain a large code base?
When you make incompatibility changes to the signature of a method, how do you find all the places where that method is being called. In C++/Java the compiler will find it for you, how do you do it in Python?
When you make changes deep inside the code, how do you find out what operations an instance provides, since you don't have a static type to lookup?
How do you handle/prevent typing errors (typos)?
Are UnitTest's used as a substitute for static type checking?
As you can guess I almost only worked with statically typed languages (C++/Java), but I would like to try my hands on Python for larger programs. But I had a very bad experience, a long time ago, with the clipper (dBase) language, which was also dynamically typed. | How can I use Python for large scale development? | 0.049958 | 0 | 0 | 19,675 |
236,407 | 2008-10-25T13:30:00.000 | 24 | 1 | 0 | 0 | python,development-environment | 236,537 | 8 | true | 0 | 0 | Since nobody pointed out pychecker, pylint and similar tools, I will: pychecker and pylint are tools that can help you find incorrect assumptions (about function signatures, object attributes, etc.) They won't find everything that a compiler might find in a statically typed language -- but they can find problems that such compilers for such languages can't find, too.
Python (and any dynamically typed language) is fundamentally different in terms of the errors you're likely to cause and how you would detect and fix them. It has definite downsides as well as upsides, but many (including me) would argue that in Python's case, the ease of writing code (and the ease of making it structurally sound) and of modifying code without breaking API compatibility (adding new optional arguments, providing different objects that have the same set of methods and attributes) make it suitable just fine for large codebases. | 4 | 62 | 0 | I would be interested to learn about large scale development in Python and especially in how do you maintain a large code base?
When you make incompatibility changes to the signature of a method, how do you find all the places where that method is being called. In C++/Java the compiler will find it for you, how do you do it in Python?
When you make changes deep inside the code, how do you find out what operations an instance provides, since you don't have a static type to lookup?
How do you handle/prevent typing errors (typos)?
Are UnitTest's used as a substitute for static type checking?
As you can guess I almost only worked with statically typed languages (C++/Java), but I would like to try my hands on Python for larger programs. But I had a very bad experience, a long time ago, with the clipper (dBase) language, which was also dynamically typed. | How can I use Python for large scale development? | 1.2 | 0 | 0 | 19,675 |
236,407 | 2008-10-25T13:30:00.000 | 40 | 1 | 0 | 0 | python,development-environment | 236,445 | 8 | false | 0 | 0 | I had some experience with modifying "Frets On Fire", an open source python "Guitar Hero" clone.
as I see it, python is not really suitable for a really large scale project.
I found myself spending a large part of the development time debugging issues related to assignment of incompatible types, things that static typed laguages will reveal effortlessly at compile-time.
also, since types are determined on run-time, trying to understand existing code becomes harder, because you have no idea what's the type of that parameter you are currently looking at.
in addition to that, calling functions using their name string with the __getattr__ built in function is generally more common in Python than in other programming languages, thus getting the call graph to a certain function somewhat hard (although you can call functions with their name in some statically typed languages as well).
I think that Python really shines in small scale software, rapid prototype development, and gluing existing programs together, but I would not use it for large scale software projects, since in those types of programs maintainability becomes the real issue, and in my opinion python is relatively weak there. | 4 | 62 | 0 | I would be interested to learn about large scale development in Python and especially in how do you maintain a large code base?
When you make incompatibility changes to the signature of a method, how do you find all the places where that method is being called. In C++/Java the compiler will find it for you, how do you do it in Python?
When you make changes deep inside the code, how do you find out what operations an instance provides, since you don't have a static type to lookup?
How do you handle/prevent typing errors (typos)?
Are UnitTest's used as a substitute for static type checking?
As you can guess I almost only worked with statically typed languages (C++/Java), but I would like to try my hands on Python for larger programs. But I had a very bad experience, a long time ago, with the clipper (dBase) language, which was also dynamically typed. | How can I use Python for large scale development? | 1 | 0 | 0 | 19,675 |
237,079 | 2008-10-25T21:54:00.000 | -3 | 1 | 0 | 1 | python,file | 367,166 | 12 | false | 0 | 0 | os.stat does include the creation time. There's just no definition of st_anything for the element of os.stat() that contains the time.
So try this:
os.stat('feedparser.py')[8]
Compare that with your create date on the file in ls -lah
They should be the same. | 2 | 1,205 | 0 | What's the best cross-platform way to get file creation and modification dates/times, that works on both Linux and Windows? | How do I get file creation and modification date/times? | -0.049958 | 0 | 0 | 1,083,080 |
237,079 | 2008-10-25T21:54:00.000 | 13 | 1 | 0 | 1 | python,file | 237,093 | 12 | false | 0 | 0 | os.stat returns a named tuple with st_mtime and st_ctime attributes. The modification time is st_mtime on both platforms; unfortunately, on Windows, ctime means "creation time", whereas on POSIX it means "change time". I'm not aware of any way to get the creation time on POSIX platforms. | 2 | 1,205 | 0 | What's the best cross-platform way to get file creation and modification dates/times, that works on both Linux and Windows? | How do I get file creation and modification date/times? | 1 | 0 | 0 | 1,083,080 |
237,209 | 2008-10-25T23:36:00.000 | 3 | 1 | 1 | 0 | python,parsing,apache-config | 237,599 | 6 | false | 0 | 0 | Red Hat's Emerging Technologies group has Augeas (written in C, but with Python bindings available), a generic system configuration tool with "lenses" for reading and writing several different configuration file formats. I would consider investigating the availability of a lens for Apache. | 1 | 12 | 0 | Any python libs for parsing apache config files or if not python anyone aware of such thing in other languages (perl, php, java, c#)?
As i'll be able to rewrite them in python. | Any python libs for parsing apache config files? | 0.099668 | 0 | 0 | 11,646 |
237,211 | 2008-10-25T23:41:00.000 | 4 | 0 | 0 | 0 | python,plone,zope,archetypes | 240,456 | 1 | true | 1 | 0 | Quickest solution: subclass from ATFolder instead of BaseFolder. That gives you all the "normal" reordering and other commmon plone folder capabilities (which I suspect you also want).
If you want to be more selective, look into Products/ATContentTypes/content/base.py: ATCTOrderedFolder and OrderedBaseFolder. | 1 | 6 | 0 | I have Plone product that uses a custom folder type for containing a set of custom content objects. The folder type was created by subclassing BaseFolder and it has a schema with a couple of text fields. Currently, when custom objects are added to the custom folder, the objects are sorted alphabetically by their id. How can I override this behavior and allow my users to sort the custom folders manually, say through the "Contents" view? | How do you programmatically reorder children of an ATFolder subclass? | 1.2 | 0 | 0 | 468 |
238,081 | 2008-10-26T14:37:00.000 | 0 | 0 | 0 | 0 | python,django,error-logging | 70,617,888 | 7 | false | 1 | 0 | You can use the logging library in Python, no need to pip install anything.
Replace any print() with logging.debug()
but,
Django Sentry is a good way to go
as EMP said. | 1 | 185 | 0 | So, when playing with the development I can just set settings.DEBUG to True and if an error occures I can see it nicely formatted, with good stack trace and request information.
But on kind of production site I'd rather use DEBUG=False and show visitors some standard error 500 page with information that I'm working on fixing this bug at this moment ;)
At the same time I'd like to have some way of logging all those information (stack trace and request info) to a file on my server - so I can just output it to my console and watch errors scroll, email the log to me every hour or something like this.
What logging solutions would you recomend for a django-site, that would meet those simple requirements? I have the application running as fcgi server and I'm using apache web server as frontend (although thinking of going to lighttpd). | How do you log server errors on django sites | 0 | 0 | 0 | 97,638 |
238,523 | 2008-10-26T19:54:00.000 | 6 | 0 | 1 | 0 | c++,python,sdl,pygame | 239,167 | 9 | false | 0 | 1 | Yes. If python is much more natural to you than C++, it might be a good idea to learn pygame first. You'll have to go through a translation process when migrating to using SDL and C, but it should be a more-or-less one-to-one mapping. | 5 | 18 | 0 | If I want to move to C++ and SDL in the future, is Python and pygame a good way to learn SDL? | Is Python and pygame a good way to learn SDL? | 1 | 0 | 0 | 25,055 |
238,523 | 2008-10-26T19:54:00.000 | 0 | 0 | 1 | 0 | c++,python,sdl,pygame | 255,136 | 9 | false | 0 | 1 | I wouldn't consider Python (or any managed or interpreted language, for that matter) a good way to learn any complex task, because it insulates the programmer from the workings of the system too much. As a friend of mine put it, "Python loves you and wants you to be happy." And that's all well and good if you already know the fundamentals, but if you want to learn, the last thing you want is a language that does all the work for you.
You'll learn the what very quickly, but not the why, and then when something goes badly wrong, (and it will eventually, in any non-trivial project,) you'll be left with no idea what's happening or why. | 5 | 18 | 0 | If I want to move to C++ and SDL in the future, is Python and pygame a good way to learn SDL? | Is Python and pygame a good way to learn SDL? | 0 | 0 | 0 | 25,055 |
238,523 | 2008-10-26T19:54:00.000 | 1 | 0 | 1 | 0 | c++,python,sdl,pygame | 275,461 | 9 | false | 0 | 1 | python won't prevent you off learning design and that's pretty much the more important thing to learn IMO, I'm doing a smash bros clone with pygame and I learnt a lot in design. And yet you will learn not to write too much suboptimal code too, python have clever and beautiful hacks too. | 5 | 18 | 0 | If I want to move to C++ and SDL in the future, is Python and pygame a good way to learn SDL? | Is Python and pygame a good way to learn SDL? | 0.022219 | 0 | 0 | 25,055 |
238,523 | 2008-10-26T19:54:00.000 | 6 | 0 | 1 | 0 | c++,python,sdl,pygame | 238,659 | 9 | false | 0 | 1 | pygame abstracts the SDL interface quite a lot, therefore I don't think there's much of an advantage carried over. | 5 | 18 | 0 | If I want to move to C++ and SDL in the future, is Python and pygame a good way to learn SDL? | Is Python and pygame a good way to learn SDL? | 1 | 0 | 0 | 25,055 |
238,523 | 2008-10-26T19:54:00.000 | 6 | 0 | 1 | 0 | c++,python,sdl,pygame | 238,671 | 9 | false | 0 | 1 | You can learn some techniques, ways to implement game logic etc. in SDL-based enviroment but after moving to C++/SDL you will have to use SDL functions directly, helper functions/objects from pyGame will be completely useles. | 5 | 18 | 0 | If I want to move to C++ and SDL in the future, is Python and pygame a good way to learn SDL? | Is Python and pygame a good way to learn SDL? | 1 | 0 | 0 | 25,055 |
239,009 | 2008-10-27T03:32:00.000 | 1 | 0 | 0 | 0 | python,openoffice.org,pywin32,adodbapi | 239,487 | 3 | false | 0 | 0 | maybe the best way to install pywin32 is to place it in
(openofficedir)\program\python-core-2.3.4\lib\site-packages
it is easy if you have a python 2.3 installation (with pywin installed) under
C:\python2.3
move the C:\python2.3\Lib\site-packages\ to your
(openofficedir)\program\python-core-2.3.4\lib\site-packages | 1 | 0 | 0 | I need to update data to a mssql 2005 database so I have decided to use adodbapi, which is supposed to come built into the standard installation of python 2.1.1 and greater.
It needs pywin32 to work correctly and the open office python 2.3 installation does not have pywin32 built into it. It also seems like this built int python installation does not have adodbapi, as I get an error when I go import adodbapi.
Any suggestions on how to get both pywin32 and adodbapi installed into this open office 2.4 python installation?
thanks
oh yeah I tried those ways. annoyingly nothing. So i have reverted to jython, that way I can access Open Office for its conversion capabilities along with decent database access.
Thanks for the help. | getting pywin32 to work inside open office 2.4 built in python 2.3 interpreter | 0.066568 | 1 | 0 | 833 |
239,020 | 2008-10-27T03:42:00.000 | 4 | 1 | 0 | 1 | python,perl,dll | 239,098 | 5 | false | 0 | 0 | For Python, you could compile an extension which links to the DLL, so that in Python you could just import it like a normal module. You could do this by hand, by using a library like Boost.Python, or by using a tool such as SWIG (which also supports Perl and other scripting languages) to generate a wrapper automatically. | 1 | 9 | 0 | I have a third-party product, a terminal emulator, which provides a DLL that can be linked to a C program to basically automate the driving of this product (send keystrokes, detect what's on the screen and so forth).
I want to drive it from a scripting language (I'm comfortable with Python and slightly less so with Perl) so that we don't have to compile and send out executables to our customers whenever there's a problem found.
We also want the customers to be able to write their own scripts using ours as baselines and they won't entertain the idea of writing and compiling C code.
What's a good way of getting Python/Perl to interface to a Windows DLL. My first thought was to write a server program and have a Python script communicate with it via TCP but there's got to be an easier solution. | How can I call a DLL from a scripting language? | 0.158649 | 0 | 0 | 3,922 |
240,996 | 2008-10-27T18:41:00.000 | 3 | 0 | 1 | 0 | python,embedded | 278,420 | 17 | false | 0 | 0 | We use Python here at the university for embedded applications based on the Gumstix hardware platform. Although more capable than traditional embedded systems, we find the mix of small formfactor, low (ish) power consumption and the ease in transferring code between development on desktop machines and the target hardware invaluable.
Python is also a great language to teach the students, and with the Gumstix its great they can get code working on a low power system, rather than the headache and heartbreak that comes with using dedicated languages such as NesC. | 6 | 41 | 0 | My company is using Python for a relatively simple embedded project. Is anyone else out there using Python on embedded platforms? Overall it's working well for us, quick to develop apps, quick to debug. I like the overall "conciseness" of the language.
The only real problem I have in day to day work is that the lack of static checking vs a regular compiler can cause problems to be thrown at run-time, e.g. a simple accidental cat of a string and an int in a print statement can bring the whole application down. | Anyone using Python for embedded projects? | 0.035279 | 0 | 0 | 36,731 |
240,996 | 2008-10-27T18:41:00.000 | 3 | 0 | 1 | 0 | python,embedded | 1,458,366 | 17 | false | 0 | 0 | I worked for a company which used Python on an embedded product based around an Atmel AVR32 and running embedded Linux. The firmware was initially developed on a PC (due to lack of a working hardware prototype), then later moved to the embedded hardware running on the cross-compiled Python interpreter.
The ability to debug and modify source code "live" on the device was a big plus during development, and saved a lot of time. The big disadvantages were speed and memory usage of the Python interpreter.
Following the first release of production firmware we ported critical sections of code over to C/C++. The porting effort was quite straightforward and resulted in an improvement of several orders of magnitude on speed-critical code (as you would expect).
Incidently most of the design and production testing code was written in Python, mainly running inside a test harness on a PC. | 6 | 41 | 0 | My company is using Python for a relatively simple embedded project. Is anyone else out there using Python on embedded platforms? Overall it's working well for us, quick to develop apps, quick to debug. I like the overall "conciseness" of the language.
The only real problem I have in day to day work is that the lack of static checking vs a regular compiler can cause problems to be thrown at run-time, e.g. a simple accidental cat of a string and an int in a print statement can bring the whole application down. | Anyone using Python for embedded projects? | 0.035279 | 0 | 0 | 36,731 |
240,996 | 2008-10-27T18:41:00.000 | 3 | 0 | 1 | 0 | python,embedded | 26,122,895 | 17 | false | 0 | 0 | In my experience, Python has been traditionally used in desktop environments more than in the embedded field. There are two reasons, related to the fact that Python is interpreted:
C/C++ languages have higher performance than Python (and this is important in embedded systems with a slow microcontroller)
C/C++ languages have more deterministic response times (and this is important in real-time embedded systems controlling something).
Of course, as embedded systems will become faster and time-to-market shorter, Python will be more adopted in the embedded sector. | 6 | 41 | 0 | My company is using Python for a relatively simple embedded project. Is anyone else out there using Python on embedded platforms? Overall it's working well for us, quick to develop apps, quick to debug. I like the overall "conciseness" of the language.
The only real problem I have in day to day work is that the lack of static checking vs a regular compiler can cause problems to be thrown at run-time, e.g. a simple accidental cat of a string and an int in a print statement can bring the whole application down. | Anyone using Python for embedded projects? | 0.035279 | 0 | 0 | 36,731 |
240,996 | 2008-10-27T18:41:00.000 | 4 | 0 | 1 | 0 | python,embedded | 278,438 | 17 | false | 0 | 0 | The only real problem I have in day to
day work is that the last of static
checking vs a regular compiler can
cause problems to be thrown at
run-time, e.g. a simple accidental cat
of a string and an int in a print
statement can bring the whole
application down.
Unit tests are your only safety against these things. | 6 | 41 | 0 | My company is using Python for a relatively simple embedded project. Is anyone else out there using Python on embedded platforms? Overall it's working well for us, quick to develop apps, quick to debug. I like the overall "conciseness" of the language.
The only real problem I have in day to day work is that the lack of static checking vs a regular compiler can cause problems to be thrown at run-time, e.g. a simple accidental cat of a string and an int in a print statement can bring the whole application down. | Anyone using Python for embedded projects? | 0.047024 | 0 | 0 | 36,731 |
240,996 | 2008-10-27T18:41:00.000 | -5 | 0 | 1 | 0 | python,embedded | 25,940,451 | 17 | false | 0 | 0 | Blockquote
The only real problem I have in day to day work is that the last of static checking vs a regular compiler can cause problems to be thrown at run-time, e.g. a simple accidental cat of a string and an int in a print statement can bring the whole application down
To me it is a huge deal. Problems you could find at compile time and fix the problem now have to rely at run time. Not knowing the data type and having to write additional function just to check the datatype is hassle. There is no need to do that in C. How would you declare 'volatile' in python?
Blockquote
The only downsides for embedded work is that sometimes python can be slow and sometimes it uses a lot of memory (relatively speaking). This hasn't causes us a show stopping problem yet, and python is quite easy to profile for both speed and memory if it becomes a problem.
This is also huge. For Embedded sytems or RTOS time constraint is very important.
Python is not necessary quick to code. It really depends what language you are comfortable with. Honestly it takes me 1 day to write function and unnecessary object orientation stuff which I can do in 2 hours in C.
Testing is so inconvenient I have to write the code, py_compile, copy pyc in the target then run the program, then python quits complaining variable not defined or type cast error or some petty thing like that.
My suggestion is C toolchain is available for any target. C is fast, hardware oriented,challenging and fun. Stick with C for Embedded systems. No need to install configure silly python packages just to run it. | 6 | 41 | 0 | My company is using Python for a relatively simple embedded project. Is anyone else out there using Python on embedded platforms? Overall it's working well for us, quick to develop apps, quick to debug. I like the overall "conciseness" of the language.
The only real problem I have in day to day work is that the lack of static checking vs a regular compiler can cause problems to be thrown at run-time, e.g. a simple accidental cat of a string and an int in a print statement can bring the whole application down. | Anyone using Python for embedded projects? | -1 | 0 | 0 | 36,731 |
240,996 | 2008-10-27T18:41:00.000 | 3 | 0 | 1 | 0 | python,embedded | 497,808 | 17 | false | 0 | 0 | My team wrote an embedded software made out of C++ and Python. We decided to write basic classes and heavy computational routines in C++. We wrote logic in Python. Boost libraries as glue. Using boost is never easy, but the results is excellent. Fast and easy to modify. Using python to represent the custom needings, we are able to satisfy customers' needings realtime, changing the code using injection technics. Something really exciting! (ok, I'm a geek ;)
We started prototyping in python but we suddenly realized that it was clearly too slow. So we decided to structure the program in different computational layers, in order to reach the speed requirements. C++ was the best solution.
In order to use python and c++ together we had to keep a strict control on typing. | 6 | 41 | 0 | My company is using Python for a relatively simple embedded project. Is anyone else out there using Python on embedded platforms? Overall it's working well for us, quick to develop apps, quick to debug. I like the overall "conciseness" of the language.
The only real problem I have in day to day work is that the lack of static checking vs a regular compiler can cause problems to be thrown at run-time, e.g. a simple accidental cat of a string and an int in a print statement can bring the whole application down. | Anyone using Python for embedded projects? | 0.035279 | 0 | 0 | 36,731 |
241,007 | 2008-10-27T18:43:00.000 | 1 | 0 | 0 | 1 | python,svn,google-app-engine,continuous-integration,google-code | 241,672 | 5 | false | 1 | 0 | For those of us who are using Github, this feature from the GAE team would make us all seriously consider switching to Google Code... | 2 | 18 | 0 | Anyone have any thoughts on how/if it is possible to integrate Google Code commits to cause a Google AppEngine deployment of the most recent code?
I have a simple Google AppEngine project's source hosted on Google Code and would love if everytime I committed to Subversion, that AppEngine would reflect the latest commit. I don't mind if things are broken on the live site since the project is for personal use mainly and for learning.
Anyone have any thoughts on how to tie into the subversion commit for the Code repository and/or how to kickoff the deployment to AppEngine? Ideally the solution would not require anything manual from me nor any type of server/listener software on my machine. | Possible to integrate Google AppEngine and Google Code for continuous integration? | 0.039979 | 0 | 0 | 2,320 |
241,007 | 2008-10-27T18:43:00.000 | 1 | 0 | 0 | 1 | python,svn,google-app-engine,continuous-integration,google-code | 241,126 | 5 | false | 1 | 0 | Very interesting, but not yet possible, AFAIK. I have been looking for that option in Google Code with no success.
The only solution I can figure out is to install something in your machine that checks for changes in your SVN repository.
I'll be happy to hear about other approaches. | 2 | 18 | 0 | Anyone have any thoughts on how/if it is possible to integrate Google Code commits to cause a Google AppEngine deployment of the most recent code?
I have a simple Google AppEngine project's source hosted on Google Code and would love if everytime I committed to Subversion, that AppEngine would reflect the latest commit. I don't mind if things are broken on the live site since the project is for personal use mainly and for learning.
Anyone have any thoughts on how to tie into the subversion commit for the Code repository and/or how to kickoff the deployment to AppEngine? Ideally the solution would not require anything manual from me nor any type of server/listener software on my machine. | Possible to integrate Google AppEngine and Google Code for continuous integration? | 0.039979 | 0 | 0 | 2,320 |
241,141 | 2008-10-27T19:32:00.000 | 2 | 0 | 1 | 0 | python | 241,519 | 5 | true | 0 | 0 | No, there isn't. | 1 | 15 | 0 | I would like create my own collection that has all the attributes of python list and also knows how to save/load itself into/from a database. Also I want to make the load implicit and lazy, as in it doesn't happen at the point of creation of the list, but waits until its first used.
Is there a single__xxx__method I can override to load the list on first usage of any list property (such aslen,getitem,iter...etc) without having to override them all? | Python lazy list | 1.2 | 0 | 0 | 3,784 |
241,327 | 2008-10-27T20:47:00.000 | 0 | 1 | 1 | 0 | c++,python,c,regex,comments | 1,078,406 | 13 | false | 0 | 0 | You don't really need a parse tree to do this perfectly, but you do in effect need the token stream equivalent to what is produced by the compiler's front end. Such a token stream must necessarilyy take care of all the weirdness such as line-continued comment start, comment start in string, trigraph normalization, etc. If you have the token stream, deleting the comments is easy. (I have a tool that produces exactly such token streams, as, guess what, the front end of a real parser that produces a real parse tree :).
The fact that the tokens are individually recognized by regular expressions suggests that you can, in principle, write a regular expression that will pick out the comment lexemes. The real complexity of the set regular expressions for the tokenizer (at least the one we wrote) suggests you can't do this in practice; writing them individually was hard enough. If you don't want to do it perfectly, well, then, most of the RE solutions above are just fine.
Now, why you would want strip comments is beyond me, unless you are building a code obfuscator. In this case, you have to have it perfectly right. | 2 | 48 | 0 | I'm looking for Python code that removes C and C++ comments from a string. (Assume the string contains an entire C source file.)
I realize that I could .match() substrings with a Regex, but that doesn't solve nesting /*, or having a // inside a /* */.
Ideally, I would prefer a non-naive implementation that properly handles awkward cases. | Remove C and C++ comments using Python? | 0 | 0 | 0 | 43,080 |
241,327 | 2008-10-27T20:47:00.000 | 4 | 1 | 1 | 0 | c++,python,c,regex,comments | 242,110 | 13 | false | 0 | 0 | The regular expression cases will fall down in some situations, like where a string literal contains a subsequence which matches the comment syntax. You really need a parse tree to deal with this. | 2 | 48 | 0 | I'm looking for Python code that removes C and C++ comments from a string. (Assume the string contains an entire C source file.)
I realize that I could .match() substrings with a Regex, but that doesn't solve nesting /*, or having a // inside a /* */.
Ideally, I would prefer a non-naive implementation that properly handles awkward cases. | Remove C and C++ comments using Python? | 0.061461 | 0 | 0 | 43,080 |
241,575 | 2008-10-27T22:19:00.000 | 3 | 1 | 0 | 0 | python,frameworks,content-management-system,enterprise | 241,773 | 14 | false | 1 | 0 | The first thing that comes to mind here is that you're approaching this all wrong. It seems like you're looking for a pet project for yourself and trying to decide what you'd like to do best. You didn't specify the scope of who is going to be managing this site.. which is the real question. Is it just you? Is it the management team? Is it each division?
Making a huge decision like this takes a lot of time and thought. We spend a lot of time just helping our clients choose the right CMS for their needs. There are a lot out there and a decision like this is not something to be taken lightly. A lot are good in the right situation and HORRIBLE in others. Also, what is right for you as the developer isn't necessarily right for your end user.
As someone up there suggested, you need a lot more research into what the requirements are before anyone (including the developer community) can make any suggestions about what is best to use. | 8 | 8 | 0 | Dear stack overflow community,
I've been given the task of overhauling a couple of websites for a large corporation I'm working for, as well as developing an internal intranet site for content management and document storage within the organization.
My "problem" is this: They want me to use a framework/set of languages/technologies that I can prove to them are "stable, enterprise-ready technologies with a proven track record."
The spec's "big picture" really isn't too complicated: Implement an enterprise-class CMS for management of each division's web pages that deal mostly with product information and documentation (i.e. a simpler version of www.linksys.com).
As an open-source programmer, I'd like to use Python with TurboGears and build it from scratch, but I can't really find a way to prove to the president that TurboGears has a huge enterprise track record. Zope seems to have a lot of enterprise usage, but it looks a bit bloated to me. Django could be an option, but doesn't seem as flexible as TurboGears.
I'd rather not use PHP, but Drupal has a very nice resume with the "right" names under it (AOL, Sony, MTV); plus it could save me building many of the CMS components from scratch.
Rails might be another option, but I'm not too familiar with it (and as a Python/PHP programmer, Ruby's syntax drives me crazy).
What would the S.O. community suggest for a project like this? I'm sure many of you have faced the same dilemma. What ended up working/not working for you? As I said before, my first choice would be Python, second would be PHP, third would be Rails.
Thank you,
Seth | Framework/CMS suggestions for enterprise website & intranet (I've got to convince the president its solid!) | 0.042831 | 0 | 0 | 4,065 |
241,575 | 2008-10-27T22:19:00.000 | 0 | 1 | 0 | 0 | python,frameworks,content-management-system,enterprise | 294,729 | 14 | false | 1 | 0 | CMS for a medium-big company is not about Software. It is about proccesses and policies.
Very true!
Association with prestigious names is not necessarily an indicator of pleasing end results.
I like Sony products, yes, but on the various occasions on which I have sought support from Sony sites I have felt like banging my head against a brick wall! Those head-cracking sites may not have been Drupal-oriented, I have no idea, but the point is: don't be sucked in by big names alone.
An issue you should expect is: preconceptions of what may be achieved (or constrained) by a system.
Allow yourself some learning time with Plone — ideally, for a large project such as this, invest in expert advice — and you'll realise that traditional-ish ideas of what a system can or should accomplish are mostly exceeded by Plone's capabilities.
Gauge user requirements with a very open mind (not based on simplicities such as "I'd like a system that's equal to system x") then come to plone.org | Support | Chat Room to further discuss your requirements. | 8 | 8 | 0 | Dear stack overflow community,
I've been given the task of overhauling a couple of websites for a large corporation I'm working for, as well as developing an internal intranet site for content management and document storage within the organization.
My "problem" is this: They want me to use a framework/set of languages/technologies that I can prove to them are "stable, enterprise-ready technologies with a proven track record."
The spec's "big picture" really isn't too complicated: Implement an enterprise-class CMS for management of each division's web pages that deal mostly with product information and documentation (i.e. a simpler version of www.linksys.com).
As an open-source programmer, I'd like to use Python with TurboGears and build it from scratch, but I can't really find a way to prove to the president that TurboGears has a huge enterprise track record. Zope seems to have a lot of enterprise usage, but it looks a bit bloated to me. Django could be an option, but doesn't seem as flexible as TurboGears.
I'd rather not use PHP, but Drupal has a very nice resume with the "right" names under it (AOL, Sony, MTV); plus it could save me building many of the CMS components from scratch.
Rails might be another option, but I'm not too familiar with it (and as a Python/PHP programmer, Ruby's syntax drives me crazy).
What would the S.O. community suggest for a project like this? I'm sure many of you have faced the same dilemma. What ended up working/not working for you? As I said before, my first choice would be Python, second would be PHP, third would be Rails.
Thank you,
Seth | Framework/CMS suggestions for enterprise website & intranet (I've got to convince the president its solid!) | 0 | 0 | 0 | 4,065 |
241,575 | 2008-10-27T22:19:00.000 | 3 | 1 | 0 | 0 | python,frameworks,content-management-system,enterprise | 241,785 | 14 | false | 1 | 0 | I agree with Will's, braveterry's and Divamatrix's comments. Fully.
There are tons of questions/issues/risks/considerations to take in order to succesfully launch a CMS solution for a medium/big enterprise. I will not repeat what Will and braveterry had said, instead of it I will offer a different point of view:
CMS for a medium-big company is not about Software. It is about proccesses and policies.
Which framework/tool to use must be dependent on exact requirements (kind of content, sources for content, who will be responsible to capture and create content, what are their abilities, who will be approving content updates, which departments will have a voice on what goes into the home page?, under which policies will be selected the content for the home page?, what will be the puropose for the home page? (marketing? sales? technical? branding?).
If the answers to these questions (there are lot more) are not clear to you or even if you do not get why are SO important. Then I think you need to contract a seasoned consulting firm.
PS: This gives me the idea to publish some sort of paper about this topic but that would take some days as I currently do not have the time to prepare it. | 8 | 8 | 0 | Dear stack overflow community,
I've been given the task of overhauling a couple of websites for a large corporation I'm working for, as well as developing an internal intranet site for content management and document storage within the organization.
My "problem" is this: They want me to use a framework/set of languages/technologies that I can prove to them are "stable, enterprise-ready technologies with a proven track record."
The spec's "big picture" really isn't too complicated: Implement an enterprise-class CMS for management of each division's web pages that deal mostly with product information and documentation (i.e. a simpler version of www.linksys.com).
As an open-source programmer, I'd like to use Python with TurboGears and build it from scratch, but I can't really find a way to prove to the president that TurboGears has a huge enterprise track record. Zope seems to have a lot of enterprise usage, but it looks a bit bloated to me. Django could be an option, but doesn't seem as flexible as TurboGears.
I'd rather not use PHP, but Drupal has a very nice resume with the "right" names under it (AOL, Sony, MTV); plus it could save me building many of the CMS components from scratch.
Rails might be another option, but I'm not too familiar with it (and as a Python/PHP programmer, Ruby's syntax drives me crazy).
What would the S.O. community suggest for a project like this? I'm sure many of you have faced the same dilemma. What ended up working/not working for you? As I said before, my first choice would be Python, second would be PHP, third would be Rails.
Thank you,
Seth | Framework/CMS suggestions for enterprise website & intranet (I've got to convince the president its solid!) | 0.042831 | 0 | 0 | 4,065 |
241,575 | 2008-10-27T22:19:00.000 | 1 | 1 | 0 | 0 | python,frameworks,content-management-system,enterprise | 241,593 | 14 | false | 1 | 0 | No matter what you choose, don't use Typo3. It is a huge unhackable mess with its own idiotic template "script" language, near impossible to learn quickly, hard to teach to your enterprise users and damn ugly. No wonder there are shops which earn a living just doing Typo3 consulting. It is somewhat popular but don't think there is any decent documentation. | 8 | 8 | 0 | Dear stack overflow community,
I've been given the task of overhauling a couple of websites for a large corporation I'm working for, as well as developing an internal intranet site for content management and document storage within the organization.
My "problem" is this: They want me to use a framework/set of languages/technologies that I can prove to them are "stable, enterprise-ready technologies with a proven track record."
The spec's "big picture" really isn't too complicated: Implement an enterprise-class CMS for management of each division's web pages that deal mostly with product information and documentation (i.e. a simpler version of www.linksys.com).
As an open-source programmer, I'd like to use Python with TurboGears and build it from scratch, but I can't really find a way to prove to the president that TurboGears has a huge enterprise track record. Zope seems to have a lot of enterprise usage, but it looks a bit bloated to me. Django could be an option, but doesn't seem as flexible as TurboGears.
I'd rather not use PHP, but Drupal has a very nice resume with the "right" names under it (AOL, Sony, MTV); plus it could save me building many of the CMS components from scratch.
Rails might be another option, but I'm not too familiar with it (and as a Python/PHP programmer, Ruby's syntax drives me crazy).
What would the S.O. community suggest for a project like this? I'm sure many of you have faced the same dilemma. What ended up working/not working for you? As I said before, my first choice would be Python, second would be PHP, third would be Rails.
Thank you,
Seth | Framework/CMS suggestions for enterprise website & intranet (I've got to convince the president its solid!) | 0.014285 | 0 | 0 | 4,065 |
241,575 | 2008-10-27T22:19:00.000 | 2 | 1 | 0 | 0 | python,frameworks,content-management-system,enterprise | 243,952 | 14 | false | 1 | 0 | You'd like to build an Enterprise Class CMS from scratch? Just for one project? Are you crazy? Unless plan to go into the CMS business and have thousands and thousands of hours of development time there absolutely is no point to create a new one. There are excellent CMS's already out there. Drupal and Plone are the best in my opinion. I like Plone because its delightful to use. It's used by CIA, NASA, Akami, Novell and Ebay.
Best wishes,
Tony | 8 | 8 | 0 | Dear stack overflow community,
I've been given the task of overhauling a couple of websites for a large corporation I'm working for, as well as developing an internal intranet site for content management and document storage within the organization.
My "problem" is this: They want me to use a framework/set of languages/technologies that I can prove to them are "stable, enterprise-ready technologies with a proven track record."
The spec's "big picture" really isn't too complicated: Implement an enterprise-class CMS for management of each division's web pages that deal mostly with product information and documentation (i.e. a simpler version of www.linksys.com).
As an open-source programmer, I'd like to use Python with TurboGears and build it from scratch, but I can't really find a way to prove to the president that TurboGears has a huge enterprise track record. Zope seems to have a lot of enterprise usage, but it looks a bit bloated to me. Django could be an option, but doesn't seem as flexible as TurboGears.
I'd rather not use PHP, but Drupal has a very nice resume with the "right" names under it (AOL, Sony, MTV); plus it could save me building many of the CMS components from scratch.
Rails might be another option, but I'm not too familiar with it (and as a Python/PHP programmer, Ruby's syntax drives me crazy).
What would the S.O. community suggest for a project like this? I'm sure many of you have faced the same dilemma. What ended up working/not working for you? As I said before, my first choice would be Python, second would be PHP, third would be Rails.
Thank you,
Seth | Framework/CMS suggestions for enterprise website & intranet (I've got to convince the president its solid!) | 0.028564 | 0 | 0 | 4,065 |
241,575 | 2008-10-27T22:19:00.000 | 9 | 1 | 0 | 0 | python,frameworks,content-management-system,enterprise | 241,637 | 14 | false | 1 | 0 | This is a contradictory statement: "The spec's "big picture" really isn't too complicated: Implement an enterprise-class CMS for management of each division's web pages".
"Enterprise Class" and "isn't too complicated" do not belong in the same sentence. Seriously.
"Enterprise Class" stuff is complicated because "enterprise class" tasks and environments are complicated.
Mind, just because something is deployed within an enterprise doesn't mean it requires an "enterprise class" tool. But those that DO have "enterprise class" requirements ARE complicated because the problem domain and deployment environment are complicated.
So, you need to be more clear on your specs than "buzzword compliant", "my boss has heard of it", "never breaks", etc.
CMS seems deceptively simple, but it's not. If it's geeks managing stuff for geeks, that's one thing, but CMSs tend to have great impact on non-technical end users which can dramatically complicate user interfaces, security, workflows, support, etc. Think "marketing wants to maintain the website", and that they're going to let their junior intern do it.
So, seriously, without REAL requirements it's hard to suggest anything. And without REAL requirements, and a solid understanding of your user base, you most certainly should NOT just "roll your own". | 8 | 8 | 0 | Dear stack overflow community,
I've been given the task of overhauling a couple of websites for a large corporation I'm working for, as well as developing an internal intranet site for content management and document storage within the organization.
My "problem" is this: They want me to use a framework/set of languages/technologies that I can prove to them are "stable, enterprise-ready technologies with a proven track record."
The spec's "big picture" really isn't too complicated: Implement an enterprise-class CMS for management of each division's web pages that deal mostly with product information and documentation (i.e. a simpler version of www.linksys.com).
As an open-source programmer, I'd like to use Python with TurboGears and build it from scratch, but I can't really find a way to prove to the president that TurboGears has a huge enterprise track record. Zope seems to have a lot of enterprise usage, but it looks a bit bloated to me. Django could be an option, but doesn't seem as flexible as TurboGears.
I'd rather not use PHP, but Drupal has a very nice resume with the "right" names under it (AOL, Sony, MTV); plus it could save me building many of the CMS components from scratch.
Rails might be another option, but I'm not too familiar with it (and as a Python/PHP programmer, Ruby's syntax drives me crazy).
What would the S.O. community suggest for a project like this? I'm sure many of you have faced the same dilemma. What ended up working/not working for you? As I said before, my first choice would be Python, second would be PHP, third would be Rails.
Thank you,
Seth | Framework/CMS suggestions for enterprise website & intranet (I've got to convince the president its solid!) | 1 | 0 | 0 | 4,065 |
241,575 | 2008-10-27T22:19:00.000 | 2 | 1 | 0 | 0 | python,frameworks,content-management-system,enterprise | 241,831 | 14 | false | 1 | 0 | "They want me to use a framework/set of languages/technologies that I can prove to them are "stable, enterprise-ready technologies with a proven track record.""
There's no proof of those features. None.
Is there some incumbent technology that they want you to use? If so, you might be swimming upstream.
If you're fighting for your preferred technology, you probably can't win their hearts and minds without a serious proof of concept or pilot project or something.
If they're willing to listen, they'd be more willing to listen if you had a demo that showed how rock-solid your preferred approach is.
if there is no incumbent, then they're just wringing their hands. In this case, you'll need some evidence they actually believe -- a pilot project or a proof of concept.
There's no Proof in this industry. For every technology you can find a proponent and an opponent. Even crap technology has proponents. Forget proof.
Just pick something that you can use very rapidly. Get something up and running so quickly, with such high quality that you're obviously right and the rest of your opinions must be equally right.
For this reason, flexibility has no value. Go with Django and get something to run ASAP. | 8 | 8 | 0 | Dear stack overflow community,
I've been given the task of overhauling a couple of websites for a large corporation I'm working for, as well as developing an internal intranet site for content management and document storage within the organization.
My "problem" is this: They want me to use a framework/set of languages/technologies that I can prove to them are "stable, enterprise-ready technologies with a proven track record."
The spec's "big picture" really isn't too complicated: Implement an enterprise-class CMS for management of each division's web pages that deal mostly with product information and documentation (i.e. a simpler version of www.linksys.com).
As an open-source programmer, I'd like to use Python with TurboGears and build it from scratch, but I can't really find a way to prove to the president that TurboGears has a huge enterprise track record. Zope seems to have a lot of enterprise usage, but it looks a bit bloated to me. Django could be an option, but doesn't seem as flexible as TurboGears.
I'd rather not use PHP, but Drupal has a very nice resume with the "right" names under it (AOL, Sony, MTV); plus it could save me building many of the CMS components from scratch.
Rails might be another option, but I'm not too familiar with it (and as a Python/PHP programmer, Ruby's syntax drives me crazy).
What would the S.O. community suggest for a project like this? I'm sure many of you have faced the same dilemma. What ended up working/not working for you? As I said before, my first choice would be Python, second would be PHP, third would be Rails.
Thank you,
Seth | Framework/CMS suggestions for enterprise website & intranet (I've got to convince the president its solid!) | 0.028564 | 0 | 0 | 4,065 |
241,575 | 2008-10-27T22:19:00.000 | 2 | 1 | 0 | 0 | python,frameworks,content-management-system,enterprise | 1,384,018 | 14 | false | 1 | 0 | "Enterprise" is a marketing term. It has pretty much zero technical meaning. If your boss wants to hear Enterprise, then he will, but this won't mean that a given system is suitable for your needs.
Beware of lists of companies that use a given suite of software. "Ebay uses Plone", and "Ebay runs on Plone" are two very different statements.
Mostly, if you're doing "Enterprise" CMS (for whatever that term is worth) you should expect to have a learning curve that will only just begin to flatten out by the end of a significant project.
For your project, I'd suggest you try to figure out what you really need. If you think TurboGears (or any other framework) is a good fit, discuss some risk management strategies with your boss. Maybe a small pilot to start with. Adopting a new technology is risky. Many "large corporation" web sites are mission-critical these days.
For what it's worth. I like Plone, but I've only ever used it for non-corporate stuff. I don't personally know of any "Enterprise" implementations. At work I use Tridion, and I know of numerous implementations at that level. (If you're looking for a choice that will let you work in Python, Tridion isn't a good fit.) | 8 | 8 | 0 | Dear stack overflow community,
I've been given the task of overhauling a couple of websites for a large corporation I'm working for, as well as developing an internal intranet site for content management and document storage within the organization.
My "problem" is this: They want me to use a framework/set of languages/technologies that I can prove to them are "stable, enterprise-ready technologies with a proven track record."
The spec's "big picture" really isn't too complicated: Implement an enterprise-class CMS for management of each division's web pages that deal mostly with product information and documentation (i.e. a simpler version of www.linksys.com).
As an open-source programmer, I'd like to use Python with TurboGears and build it from scratch, but I can't really find a way to prove to the president that TurboGears has a huge enterprise track record. Zope seems to have a lot of enterprise usage, but it looks a bit bloated to me. Django could be an option, but doesn't seem as flexible as TurboGears.
I'd rather not use PHP, but Drupal has a very nice resume with the "right" names under it (AOL, Sony, MTV); plus it could save me building many of the CMS components from scratch.
Rails might be another option, but I'm not too familiar with it (and as a Python/PHP programmer, Ruby's syntax drives me crazy).
What would the S.O. community suggest for a project like this? I'm sure many of you have faced the same dilemma. What ended up working/not working for you? As I said before, my first choice would be Python, second would be PHP, third would be Rails.
Thank you,
Seth | Framework/CMS suggestions for enterprise website & intranet (I've got to convince the president its solid!) | 0.028564 | 0 | 0 | 4,065 |
242,059 | 2008-10-28T02:29:00.000 | 1 | 0 | 0 | 1 | python,opengl,fedora | 242,063 | 6 | false | 0 | 1 | What OpenGL library are you using? What windowing library? What version of Python?
Most likely cause I can think of is that your windowing library (SDL or whatever you're using) isn't initializing OpenGL before you start calling into it. | 5 | 15 | 0 | I am currently in a course that is using OpenGL and I have been using C for all the programs so far. I have Python installed on Fedora as well as OpenGL, however the minute I call an OpenGL command in my Python code, I get a segmentation fault. I have no idea why this is.
Just to avoid the "just use C" comments, here is why I want to use Python:
There are a couple reasons I am wanting to switch from C to Python, but the main one is because we are about to start writing a raytracer and I would like to use classes to make it easier on me. Since I hate classes in C++ and structs in C seems a little crazy, I thought I would give Python a try at it. I have also been looking for a reason to use Python again as it has been a while.
Thanks for any help. | OpenGl with Python | 0.033321 | 0 | 0 | 18,416 |
242,059 | 2008-10-28T02:29:00.000 | 0 | 0 | 0 | 1 | python,opengl,fedora | 242,371 | 6 | false | 0 | 1 | We have neither ideas about random segmentation faults. There is not enough information. What python libraries are you using for opengl? How do you use them? Can you show us your code? It's probably something trivial but my god -skill ends up to telling me just and only that.
Raytracer in python? I'd prefer just doing that in C with those structs. But then, I'm assuming you aren't going to do a realtime raytracer so that may be ok. | 5 | 15 | 0 | I am currently in a course that is using OpenGL and I have been using C for all the programs so far. I have Python installed on Fedora as well as OpenGL, however the minute I call an OpenGL command in my Python code, I get a segmentation fault. I have no idea why this is.
Just to avoid the "just use C" comments, here is why I want to use Python:
There are a couple reasons I am wanting to switch from C to Python, but the main one is because we are about to start writing a raytracer and I would like to use classes to make it easier on me. Since I hate classes in C++ and structs in C seems a little crazy, I thought I would give Python a try at it. I have also been looking for a reason to use Python again as it has been a while.
Thanks for any help. | OpenGl with Python | 0 | 0 | 0 | 18,416 |
242,059 | 2008-10-28T02:29:00.000 | 0 | 0 | 0 | 1 | python,opengl,fedora | 246,922 | 6 | false | 0 | 1 | Perhaps you are calling an OpenGL function that requires an active OpenGL context, without having one? That shouldn't necessarily crash, but I guess it might. How to set up such a context depends on the platform, and it's been a while since I used GL from Python (and when I did, I also used GTK+ which complicates matters). | 5 | 15 | 0 | I am currently in a course that is using OpenGL and I have been using C for all the programs so far. I have Python installed on Fedora as well as OpenGL, however the minute I call an OpenGL command in my Python code, I get a segmentation fault. I have no idea why this is.
Just to avoid the "just use C" comments, here is why I want to use Python:
There are a couple reasons I am wanting to switch from C to Python, but the main one is because we are about to start writing a raytracer and I would like to use classes to make it easier on me. Since I hate classes in C++ and structs in C seems a little crazy, I thought I would give Python a try at it. I have also been looking for a reason to use Python again as it has been a while.
Thanks for any help. | OpenGl with Python | 0 | 0 | 0 | 18,416 |
242,059 | 2008-10-28T02:29:00.000 | 2 | 0 | 0 | 1 | python,opengl,fedora | 1,778,664 | 6 | false | 0 | 1 | Well, I don't know if these are the libs the original poster are using but I saw identical issues in a pet project I'm working on (Graphics Engine using C++ and Python) using PyOpenGL.
PyOpenGL didn't correctly pick up the rendering context if it was created after the python script had been loaded (I was loading the script first, then calling Python methods in it from my C++ code).
The problem doesn't appear if you initialize the display and create the OpenGL rendering context before loading the Python script. | 5 | 15 | 0 | I am currently in a course that is using OpenGL and I have been using C for all the programs so far. I have Python installed on Fedora as well as OpenGL, however the minute I call an OpenGL command in my Python code, I get a segmentation fault. I have no idea why this is.
Just to avoid the "just use C" comments, here is why I want to use Python:
There are a couple reasons I am wanting to switch from C to Python, but the main one is because we are about to start writing a raytracer and I would like to use classes to make it easier on me. Since I hate classes in C++ and structs in C seems a little crazy, I thought I would give Python a try at it. I have also been looking for a reason to use Python again as it has been a while.
Thanks for any help. | OpenGl with Python | 0.066568 | 0 | 0 | 18,416 |
242,059 | 2008-10-28T02:29:00.000 | 0 | 0 | 0 | 1 | python,opengl,fedora | 2,284,461 | 6 | false | 0 | 1 | Scripts never cause segmentation faults.
But first see if your kernel and kmod video driver working property ...
Extension modules can cause "segmentation fault". | 5 | 15 | 0 | I am currently in a course that is using OpenGL and I have been using C for all the programs so far. I have Python installed on Fedora as well as OpenGL, however the minute I call an OpenGL command in my Python code, I get a segmentation fault. I have no idea why this is.
Just to avoid the "just use C" comments, here is why I want to use Python:
There are a couple reasons I am wanting to switch from C to Python, but the main one is because we are about to start writing a raytracer and I would like to use classes to make it easier on me. Since I hate classes in C++ and structs in C seems a little crazy, I thought I would give Python a try at it. I have also been looking for a reason to use Python again as it has been a while.
Thanks for any help. | OpenGl with Python | 0 | 0 | 0 | 18,416 |
242,065 | 2008-10-28T02:34:00.000 | 1 | 0 | 1 | 0 | python,python-2.6,python-install | 248,884 | 3 | false | 0 | 0 | Macports should be easy to get rid of; just delete /opt/local/. I think that Fink does something similar.
You can do which python to see what python is the default one. The system python should be in /System/Library/Frameworks/Python.framework/Versions/2.5/bin/python
The MacPython you may have downloaded would either be in /Library/Frameworks/Python.framework. You can delete this as well.
Also, both MacPython and MacPorts edit your ~/.profile and change the PYTHONPATH, make sure to edit it and remove the extra paths there. | 1 | 2 | 0 | I have been enjoying learning the basics of python, but before I started reading things I tried to install various python versions and modules clumsily. Now that I have some ideas of what I want to do and how to do it I'm finding that various aspects are broken. For instance, 2.6 IDLE won't launch, and when I try to import modules they usually don't work.
My question is, how would you recommend I clean this up and start fresh? I have read information about modifying the 2.6 install, but I still can't get it to work.
IDLE 2.4 works, and when I launch python from the terminal I am running python 2.4.4. | Python + Leopard + Fink + Mac Ports + Python.org + Idiot = broken Python - fresh start? | 0.066568 | 0 | 0 | 3,948 |
242,485 | 2008-10-28T07:37:00.000 | 6 | 0 | 1 | 0 | python,debugging | 41,656,242 | 15 | false | 0 | 0 | If you are using the IPython environment, you can just use the %debug and the shell will take you back to the offending line with the ipdb environment for inspections etc. Another option as pointed above is to use the iPython magic %pdb which effectively does the same. | 4 | 264 | 0 | This is a question I have wondered about for quite some time, yet I have never found a suitable solution. If I run a script and I come across, let's say an IndexError, python prints the line, location and quick description of the error and exits. Is it possible to automatically start pdb when an error is encountered? I am not against having an extra import statement at the top of the file, nor a few extra lines of code. | Starting python debugger automatically on error | 1 | 0 | 0 | 101,335 |
242,485 | 2008-10-28T07:37:00.000 | 58 | 0 | 1 | 0 | python,debugging | 13,003,378 | 15 | false | 0 | 0 | Ipython has a command for toggling this behavior: %pdb. It does exactly what you described, maybe even a bit more (giving you more informative backtraces with syntax highlighting and code completion). It's definitely worth a try! | 4 | 264 | 0 | This is a question I have wondered about for quite some time, yet I have never found a suitable solution. If I run a script and I come across, let's say an IndexError, python prints the line, location and quick description of the error and exits. Is it possible to automatically start pdb when an error is encountered? I am not against having an extra import statement at the top of the file, nor a few extra lines of code. | Starting python debugger automatically on error | 1 | 0 | 0 | 101,335 |
242,485 | 2008-10-28T07:37:00.000 | 3 | 0 | 1 | 0 | python,debugging | 44,708,864 | 15 | false | 0 | 0 | python -m pdb script.py in python2.7 press continue to start and it will run to the error and break there for debug. | 4 | 264 | 0 | This is a question I have wondered about for quite some time, yet I have never found a suitable solution. If I run a script and I come across, let's say an IndexError, python prints the line, location and quick description of the error and exits. Is it possible to automatically start pdb when an error is encountered? I am not against having an extra import statement at the top of the file, nor a few extra lines of code. | Starting python debugger automatically on error | 0.039979 | 0 | 0 | 101,335 |
242,485 | 2008-10-28T07:37:00.000 | 0 | 0 | 1 | 0 | python,debugging | 23,113,690 | 15 | false | 0 | 0 | Put a breakpoint inside the constructor of topmost exception class in the hierarchy, and most of the times you will see where the error was raised.
Putting a breakpoint means whatever you want it to mean : you can use an IDE, or pdb.set_trace, or whatever | 4 | 264 | 0 | This is a question I have wondered about for quite some time, yet I have never found a suitable solution. If I run a script and I come across, let's say an IndexError, python prints the line, location and quick description of the error and exits. Is it possible to automatically start pdb when an error is encountered? I am not against having an extra import statement at the top of the file, nor a few extra lines of code. | Starting python debugger automatically on error | 0 | 0 | 0 | 101,335 |
243,836 | 2008-10-28T15:58:00.000 | 78 | 0 | 1 | 0 | python | 244,654 | 5 | false | 0 | 0 | Try destination.__dict__.update(source.__dict__). | 1 | 61 | 0 | Is there a library method to copy all the properties between two (already present) instances of the same class, in Python?
I mean, something like Apache Commons' PropertyUtilsBean.copyProperties() | How to copy all properties of an object to another object, in Python? | 1 | 0 | 0 | 52,354 |
244,340 | 2008-10-28T18:35:00.000 | 0 | 0 | 0 | 0 | wxpython,device,win32gui,bitblit | 253,897 | 2 | false | 0 | 1 | From what I can tell, DCs in python are abstracted due to platform variation. So a device context in python doesn't directly map to a device context in Windows even though many of the methods are direct Windows method calls. To make this happen it appears you would need to make your own DelegateDC class or something similar that is intended just for Windows so that you could set the DC handle directly.
There might also be some way to attach a wxWindow to the window handle after which you could get a wxWindowDC from the wxWindow...can't figure this out though. | 1 | 2 | 0 | I am getting a DC for a window handle of an object in another program using win32gui.GetDC which returns an int/long. I need to blit this DC into a memory DC in python. The only thing I can't figure out how to do is get a wxDC derived object from the int/long that win32gui returns. None of the wxDC objects allow me to pass an actual DC handle to them from what I can tell. This of course keeps me from doing my blit. Is there any way to do this? | wxPython wxDC object from win32gui.GetDC | 0 | 0 | 0 | 1,086 |
245,192 | 2008-10-28T22:58:00.000 | 3 | 0 | 1 | 0 | python,language-agnostic | 245,238 | 5 | false | 0 | 0 | IMO this is one of those metaphors used to describe things in a natural language. The term is essentially used in context of describing functions as first class objects.
If you consider a object oriented language, we can impart various features to objects for eg: inheritance, class definition, ability to pass to other sections of code(method arguments), ability to store in a data structure etc. If we can do the same with an entity which is not normally considered as a object, like functions in the case of java script, such entities are considered to be first class objects.
First class essentially here means, not handled as second class (with degraded behaviour). Essentially the mocking is perfect or indistinguishable. | 1 | 239 | 0 | When are objects or something else said to be "first-class" in a given programming language, and why? In what way do they differ from languages where they are not?
When one says "everything is an object" (like in Python), do they indeed mean that "everything is first-class"? | What are "first-class" objects? | 0.119427 | 0 | 0 | 72,722 |
245,237 | 2008-10-28T23:16:00.000 | 2 | 1 | 0 | 0 | python,django,apache,fastcgi | 245,464 | 7 | false | 1 | 0 | I'm using it with nginx. not sure if it's really faster, but certainly less RAM/CPU load. Also it's easier to run several Django processes and have nginx map each URL prefix to a different socket. still not taking full advantage of nginx's memcached module, but first tests show huge speed advantage. | 6 | 20 | 0 | which would you recommend?
which is faster, reliable?
apache mod_python or nginx/lighttpd FastCGI? | Running Django with FastCGI or with mod_python | 0.057081 | 0 | 0 | 5,251 |
245,237 | 2008-10-28T23:16:00.000 | 2 | 1 | 0 | 0 | python,django,apache,fastcgi | 245,484 | 7 | false | 1 | 0 | There's also mod_wsgi, it seems to be faster than mod_python and the daemon mode operates similar to FastCGI | 6 | 20 | 0 | which would you recommend?
which is faster, reliable?
apache mod_python or nginx/lighttpd FastCGI? | Running Django with FastCGI or with mod_python | 0.057081 | 0 | 0 | 5,251 |
245,237 | 2008-10-28T23:16:00.000 | 2 | 1 | 0 | 0 | python,django,apache,fastcgi | 245,259 | 7 | false | 1 | 0 | Personally I've had it working with FastCGI for some time now (6 months or so) and the response times 'seem' quicker when loading a page that way vs mod___python. The critical reason for me though is that I couldn't see an obvious way to do multiple sites from the same apache / mod_python install whereas FastCGI was a relative no-brainer.
I've not conducted any particularly thorough experiments though :-)
[Edit] Speaking from experience though, setting up FastCGI can be a bit of a pain the first time around. I keep meaning to write a guide..! | 6 | 20 | 0 | which would you recommend?
which is faster, reliable?
apache mod_python or nginx/lighttpd FastCGI? | Running Django with FastCGI or with mod_python | 0.057081 | 0 | 0 | 5,251 |
245,237 | 2008-10-28T23:16:00.000 | 5 | 1 | 0 | 0 | python,django,apache,fastcgi | 258,159 | 7 | false | 1 | 0 | Nginx with mod_wsgi | 6 | 20 | 0 | which would you recommend?
which is faster, reliable?
apache mod_python or nginx/lighttpd FastCGI? | Running Django with FastCGI or with mod_python | 0.141893 | 0 | 0 | 5,251 |
245,237 | 2008-10-28T23:16:00.000 | 21 | 1 | 0 | 0 | python,django,apache,fastcgi | 245,660 | 7 | true | 1 | 0 | I've done both, and Apache/mod_python tended to be easier to work with and more stable. But these days I've jumped over to Apache/mod_wsgi, which is everything I've ever wanted and more:
Easy management of daemon processes.
As a result, much better process isolation (running multiple sites in the same Apache config with mod_python almost always ends in trouble -- environment variables and C extensions leak across sites when you do that).
Easy code reloads (set it up right and you can just touch the .wsgi file to reload instead of restarting Apache).
More predictable resource usage. With mod_python, a given Apache child process' memory use can jump around a lot. With mod_wsgi it's pretty stable: once everything's loaded, you know that's how much memory it'll use. | 6 | 20 | 0 | which would you recommend?
which is faster, reliable?
apache mod_python or nginx/lighttpd FastCGI? | Running Django with FastCGI or with mod_python | 1.2 | 0 | 0 | 5,251 |
245,237 | 2008-10-28T23:16:00.000 | 6 | 1 | 0 | 0 | python,django,apache,fastcgi | 245,264 | 7 | false | 1 | 0 | lighttpd with FastCGI will be nominally faster, but really the time it takes to run your python code and any database hits it does is going to absolutely dwarf any performance benefit you get between web servers.
mod_python and apache will give you a bit more flexibility feature-wise if you want to write code outside of django that does stuff like digest auth, or any fancy HTTP header getting/setting. Perhaps you want to use other builtin features of apache such as mod_rewrite.
If memory is a concern, staying away form apache/mod_python will help a lot. Apache tends to use a lot of RAM, and the mod_python code that glues into all of the apache functionality occupies a lot of memory-space as well. Not to mention the multiprocess nature of apache tends to eat up more RAM, as each process grows to the size of it's most intensive request. | 6 | 20 | 0 | which would you recommend?
which is faster, reliable?
apache mod_python or nginx/lighttpd FastCGI? | Running Django with FastCGI or with mod_python | 1 | 0 | 0 | 5,251 |
247,724 | 2008-10-29T17:40:00.000 | 0 | 0 | 1 | 0 | python,scripting,ipc | 54,100,051 | 7 | false | 0 | 0 | I like os.startfile("path to file") as it opens the file as if you've double clicked to open.
I found that with os.system("start excel filename") it opened it like a file opened from the web and you had to enable editing. | 2 | 14 | 0 | I am creating a Python script where it does a bunch of tasks and one of those tasks is to launch and open an instance of Excel. What is the ideal way of accomplishing that in my script? | How can I launch an instance of an application using Python? | 0 | 0 | 0 | 52,328 |
247,724 | 2008-10-29T17:40:00.000 | 0 | 0 | 1 | 0 | python,scripting,ipc | 247,730 | 7 | false | 0 | 0 | os.system("open file.xls") | 2 | 14 | 0 | I am creating a Python script where it does a bunch of tasks and one of those tasks is to launch and open an instance of Excel. What is the ideal way of accomplishing that in my script? | How can I launch an instance of an application using Python? | 0 | 0 | 0 | 52,328 |
248,730 | 2008-10-29T23:02:00.000 | 0 | 0 | 0 | 1 | python,linux,root | 248,874 | 7 | false | 0 | 0 | I'm not familiar enough with Python to tell you what the necessary commands would be in that language, but you should be able to accomplish this by forking and using a pipe to communicate between the parent and child processes. Something along the lines of:
Run the program as root via sudo or suid
On startup, the program immediately forks and establishes a pipe for communication between the parent and child processes
The child process retains root power, but just sits there waiting for input from the pipe
The parent process drops root (changes its uid back to that of the user running it), then displays the GUI, interacts with the user, and handles all operations which are available to a non-privileged user
When an operation is to be performed which requires root privileges, the (non-root) parent process sends a command down the pipe to the (root) child process which executes it and optionally reports back to the parent
This is likely to be a bit easier to write than an independent daemon, as well as more convenient to run (since you don't need to worry about whether the daemon is running or not), while also allowing the GUI and other things which don't need root powers to be run as non-root. | 6 | 3 | 0 | I'm developing an application that manages network interfaces on behalf of the user and it calls out to several external programs (such as ifconfig) that requires root to make changes. (Specifically, changing the IP address of a local interface, etc.) During development, I have been running the IDE as root (ugh) and the debugger as root (double-ugh). Is there a nice way for the end-user to run these under a non-root account? I strongly dislike the size of the attack surface presented by GTK, wxPython, Python, and my application when it runs as root.
I have looked into capabilities, but they look half-baked and I'm not sure if I'd be able to use them in Python, especially if they are on a thread basis. The only option I haven't explored is a daemon that has the setuid bit set and does all the root-type stuff on behalf of the UI. I'm hesitant to introduce that complexity this early in the project, as running as root is not a dealbreaker for the users. | Is there something between a normal user account and root? | 0 | 0 | 0 | 1,208 |
248,730 | 2008-10-29T23:02:00.000 | 3 | 0 | 0 | 1 | python,linux,root | 248,759 | 7 | false | 0 | 0 | What you want is a "Group"
You create a group, specify that the account wanting to do the action belongs to the group, then you specify that the resource you want access to is a member of that group.
Sometimes group management can be kind of irritating, but it should allow you to do anything you want, and it's the user that is authorized, not your program.
(If you want your program authorized, you can create a specific user to run it as and give that user the proper group membership, then su to that group within your program to execute the operation without giving the running user the ability.) | 6 | 3 | 0 | I'm developing an application that manages network interfaces on behalf of the user and it calls out to several external programs (such as ifconfig) that requires root to make changes. (Specifically, changing the IP address of a local interface, etc.) During development, I have been running the IDE as root (ugh) and the debugger as root (double-ugh). Is there a nice way for the end-user to run these under a non-root account? I strongly dislike the size of the attack surface presented by GTK, wxPython, Python, and my application when it runs as root.
I have looked into capabilities, but they look half-baked and I'm not sure if I'd be able to use them in Python, especially if they are on a thread basis. The only option I haven't explored is a daemon that has the setuid bit set and does all the root-type stuff on behalf of the UI. I'm hesitant to introduce that complexity this early in the project, as running as root is not a dealbreaker for the users. | Is there something between a normal user account and root? | 0.085505 | 0 | 0 | 1,208 |
248,730 | 2008-10-29T23:02:00.000 | 1 | 0 | 0 | 1 | python,linux,root | 248,756 | 7 | false | 0 | 0 | You could create and distribute a selinux policy for your application. Selinux allows the kind of fine-grained access that you need. If you can't or won't use selinux, then the daemon is the way to go. | 6 | 3 | 0 | I'm developing an application that manages network interfaces on behalf of the user and it calls out to several external programs (such as ifconfig) that requires root to make changes. (Specifically, changing the IP address of a local interface, etc.) During development, I have been running the IDE as root (ugh) and the debugger as root (double-ugh). Is there a nice way for the end-user to run these under a non-root account? I strongly dislike the size of the attack surface presented by GTK, wxPython, Python, and my application when it runs as root.
I have looked into capabilities, but they look half-baked and I'm not sure if I'd be able to use them in Python, especially if they are on a thread basis. The only option I haven't explored is a daemon that has the setuid bit set and does all the root-type stuff on behalf of the UI. I'm hesitant to introduce that complexity this early in the project, as running as root is not a dealbreaker for the users. | Is there something between a normal user account and root? | 0.028564 | 0 | 0 | 1,208 |
248,730 | 2008-10-29T23:02:00.000 | 7 | 0 | 0 | 1 | python,linux,root | 248,758 | 7 | true | 0 | 0 | Your idea about the daemon has much merit, despite the complexity it introduces. As long as the actions don't require some user interface interaction as root, a daemon allows you to control what operations are allowed and disallowed.
However, you can use SUDO to create a controlled compromise between ROOT and normal users... simply grant SUDO access to the users in question for the specific tools they need. That reduces the attack surface by allowing only "permitted" root launches. | 6 | 3 | 0 | I'm developing an application that manages network interfaces on behalf of the user and it calls out to several external programs (such as ifconfig) that requires root to make changes. (Specifically, changing the IP address of a local interface, etc.) During development, I have been running the IDE as root (ugh) and the debugger as root (double-ugh). Is there a nice way for the end-user to run these under a non-root account? I strongly dislike the size of the attack surface presented by GTK, wxPython, Python, and my application when it runs as root.
I have looked into capabilities, but they look half-baked and I'm not sure if I'd be able to use them in Python, especially if they are on a thread basis. The only option I haven't explored is a daemon that has the setuid bit set and does all the root-type stuff on behalf of the UI. I'm hesitant to introduce that complexity this early in the project, as running as root is not a dealbreaker for the users. | Is there something between a normal user account and root? | 1.2 | 0 | 0 | 1,208 |
248,730 | 2008-10-29T23:02:00.000 | 1 | 0 | 0 | 1 | python,linux,root | 248,882 | 7 | false | 0 | 0 | The traditional way would be to create and use a setuid helper to do whatever you need. Note that, however, properly writing a setuid helper is tricky (there are several attack vectors you have to protect against).
The modern way would be to use a daemon (running as root, started on boot) which listens to requests from the rest of the application. This way, your attack surface is mostly limited to whichever IPC you chose (I'd suggest d-bus, which seems to be the modern way).
Finally, if you are managing network interfaces, what you doing is very similar to what network-manager does on a modern distribution. It would be a good idea to either try to somehow integrate what you are doing with network-manager (so it will not conflict with your manipulations), or at least looks at how it works. | 6 | 3 | 0 | I'm developing an application that manages network interfaces on behalf of the user and it calls out to several external programs (such as ifconfig) that requires root to make changes. (Specifically, changing the IP address of a local interface, etc.) During development, I have been running the IDE as root (ugh) and the debugger as root (double-ugh). Is there a nice way for the end-user to run these under a non-root account? I strongly dislike the size of the attack surface presented by GTK, wxPython, Python, and my application when it runs as root.
I have looked into capabilities, but they look half-baked and I'm not sure if I'd be able to use them in Python, especially if they are on a thread basis. The only option I haven't explored is a daemon that has the setuid bit set and does all the root-type stuff on behalf of the UI. I'm hesitant to introduce that complexity this early in the project, as running as root is not a dealbreaker for the users. | Is there something between a normal user account and root? | 0.028564 | 0 | 0 | 1,208 |
248,730 | 2008-10-29T23:02:00.000 | 0 | 0 | 0 | 1 | python,linux,root | 248,743 | 7 | false | 0 | 0 | There's no single user that is halfway between a "normal" user and root. You have root, and then you have users; users can have differing levels of capabilities. If you want something that's more powerful than a "normal" user but not as powerful as root, you just create a new user with the capabilities you want, but don't give it the privileges you don't want it to have. | 6 | 3 | 0 | I'm developing an application that manages network interfaces on behalf of the user and it calls out to several external programs (such as ifconfig) that requires root to make changes. (Specifically, changing the IP address of a local interface, etc.) During development, I have been running the IDE as root (ugh) and the debugger as root (double-ugh). Is there a nice way for the end-user to run these under a non-root account? I strongly dislike the size of the attack surface presented by GTK, wxPython, Python, and my application when it runs as root.
I have looked into capabilities, but they look half-baked and I'm not sure if I'd be able to use them in Python, especially if they are on a thread basis. The only option I haven't explored is a daemon that has the setuid bit set and does all the root-type stuff on behalf of the UI. I'm hesitant to introduce that complexity this early in the project, as running as root is not a dealbreaker for the users. | Is there something between a normal user account and root? | 0 | 0 | 0 | 1,208 |
249,283 | 2008-10-30T04:32:00.000 | 1 | 0 | 1 | 0 | python,ubuntu,pygtk,virtualenv | 249,708 | 5 | false | 0 | 0 | I find in this situation, symlinks, or even copying specific files (packages, modules, extensions) works really well.
It allows the program to emulate being run in the target environment, rather than changing the application to suit the development environment.
Same deal for something like AppEngine. | 1 | 25 | 0 | I've been using virtualenv lately while developing in python. I like the idea of a segregated development environment using the --no-site-packages option, but doing this while developing a PyGTK app can be a bit tricky. The PyGTK modules are installed on Ubuntu by default, and I would like to make a virtualenv (with --no-site-packages) aware of specific modules that are located elsewhere on the system.
What's the best way to do this? Or should I just suck it up and drop the --no-site-packages option? | Virtualenv on Ubuntu with no site-packages | 0.039979 | 0 | 0 | 11,144 |
249,785 | 2008-10-30T10:50:00.000 | 2 | 0 | 0 | 1 | python,macos,filesystems | 249,800 | 6 | false | 0 | 0 | The File Manager API has a pair of functions called FSMoveObjectToTrashAsync and FSPathMoveObjectToTrashSync.
Not sure if that is exposed to Python or not. | 1 | 1 | 0 | Simply moving the file to ~/.Trash/ will not work, as if the file os on an external drive, it will move the file to the main system drive..
Also, there are other conditions, like files on external drives get moved to /Volumes/.Trash/501/ (or whatever the current user's ID is)
Given a file or folder path, what is the correct way to determine the trash folder? I imagine the language is pretty irrelevant, but I intend to use Python | OS X: Determine Trash location for a given path | 0.066568 | 0 | 0 | 3,560 |
250,151 | 2008-10-30T13:21:00.000 | 12 | 1 | 1 | 0 | python,scripting,lua | 250,158 | 11 | true | 0 | 0 | Just because it is "marketed" (in some general sense) as a special-purpose language for embedded script engines, does not mean that it is limited to that. In fact, WoW could probably just as well have chosen Python as their embedded scripting language. | 4 | 37 | 0 | When I see Lua, the only thing I ever read is "great for embedding", "fast", "lightweight" and more often than anything else: "World of Warcraft" or in short "WoW".
Why is it limited to embedding the whole thing into another application? Why not write general-purpose scripts like you do with Python or Perl?
Lua seems to be doing great in aspects like speed and memory-usage (The fastest scripting language afaik) so why is it that I never see Lua being used as a "Desktop scripting-language" to automate tasks? For example:
Renaming a bunch of files
Download some files from the web
Webscraping
Is it the lack of the standard library? | Lua as a general-purpose scripting language? | 1.2 | 0 | 0 | 12,626 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.