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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
779,989 | 2009-04-23T01:41:00.000 | 0 | 0 | 1 | 0 | python,logging,methodology | 2,043,176 | 7 | false | 0 | 0 | Python's logging library are thread-safe for single process threads. | 3 | 11 | 0 | My question is simple: what to write into a log.
Are there any conventions?
What do I have to put in?
Since my app has to be released, I'd like to have friendly logs, which could be read by most people without asking what it is.
I already have some ideas, like a timestamp, a unique identifier for each function/method, ... | What to write into log file? | 0 | 0 | 0 | 3,663 |
781,466 | 2009-04-23T12:20:00.000 | 10 | 0 | 1 | 0 | python,http,python-3.x,virtualhost | 781,474 | 2 | false | 0 | 0 | Virtual hosts work by obeying the Host: header in the HTTP request.
Just read the headers of the request, and take action based on the value of the Host: header | 1 | 3 | 0 | I am writing an rather simple http web server in python3. The web server needs to be simple - only basic reading from config files, etc. I am using only standard libraries and for now it works rather ok.
There is only one requirement for this project, which I can't implement on my own - virtual hosts. I need to have a... | Python3 Http Web Server: virtual hosts | 1 | 0 | 1 | 3,802 |
783,023 | 2009-04-23T18:45:00.000 | 0 | 0 | 0 | 0 | python,wxpython | 783,439 | 2 | false | 0 | 1 | This sounds like a use case for wxTimerEvent instead of wxIdleEvent. When there is processing to do call wxTimerEvent.Start(). When there isn't any to do, call wxTimerEvent.Stop() and call your methods to do processing from EVT_TIMER.
(note: i use from wxWidghets for C++ and am not familiar with wxPython but I assume... | 1 | 3 | 0 | I defined an handler for EVT_IDLE that does a certain background task for me. (That task is to take completed work from a few processes and integrate it into some object, making a visible change in the GUI.)
The problem is that when the user is not moving the mouse or doing anything, EVT_IDLE doesn't get called more th... | wxPython: Using EVT_IDLE | 0 | 0 | 0 | 1,623 |
783,120 | 2009-04-23T19:08:00.000 | 0 | 0 | 0 | 0 | wcf,ironpython | 783,626 | 2 | false | 1 | 1 | Is your WCF service interface available in a shared assembly? If so, you could look at using the ChannelFactory to create your client proxy dynamically (instead of using the generated C# proxy). With that method you can supply all the details of the endpoint when you create the ChannelFactory and you won't require an... | 1 | 2 | 0 | Has anyone done this? I've tried generating a c# proxy class and connecting through it, but I cannot figure out how to get IronPython to use the generated app.config file that defines the endpoint. It tries to connect, but I just get an error about no default endpoint. I would ideally like to make the connection usi... | How to connect to a WCF Service with IronPython | 0 | 0 | 0 | 2,231 |
783,189 | 2009-04-23T19:27:00.000 | 2 | 1 | 1 | 0 | python | 783,207 | 1 | true | 0 | 0 | I'm not sure what you're trying to do, but if you're looking for something that can say 'this is valid English' or 'this is valid Finnish', then you're looking at a class of problems that is quite likely unsolvable.
If not, then use a dictionary and/or letter frequencies and Bayesian analysis to determine whether or no... | 1 | 0 | 0 | Is there an easy-to-use python module that'd do english or finnish text validation?
It'd be ok if I could just check the words exist in user-defined dictionary and possibly checking that the grammar is somewhat okay.
I am planning to implement a fancy validation for a directory contents I did while ago back. This invol... | English and/or Finnish text validation | 1.2 | 0 | 0 | 152 |
783,531 | 2009-04-23T21:07:00.000 | 2 | 0 | 1 | 1 | python,windows,backgrounding | 783,541 | 6 | false | 0 | 0 | cron it on linux; schedule it on windows [control panel > scheduled tasks > Add scheduled task] | 3 | 26 | 0 | I have a script that checks something on my PC every 5 minutes and I don't want Python to show on my task tray. I use Windows as my operating system.
Is there any way to make Python run in the background and force it to not show in my task tray? | How to run a python script in the background? | 0.066568 | 0 | 0 | 42,798 |
783,531 | 2009-04-23T21:07:00.000 | 5 | 0 | 1 | 1 | python,windows,backgrounding | 783,559 | 6 | false | 0 | 0 | Just another option you have:
You can create a shortcut to your Python script, then right-click the shortcut --> Properties --> Shortcut tab
There is a drop-down box under the Run option which lets you run the command minimized. | 3 | 26 | 0 | I have a script that checks something on my PC every 5 minutes and I don't want Python to show on my task tray. I use Windows as my operating system.
Is there any way to make Python run in the background and force it to not show in my task tray? | How to run a python script in the background? | 0.16514 | 0 | 0 | 42,798 |
783,531 | 2009-04-23T21:07:00.000 | -6 | 0 | 1 | 1 | python,windows,backgrounding | 783,544 | 6 | true | 0 | 0 | Look for Schedule Tasks in the control panel. | 3 | 26 | 0 | I have a script that checks something on my PC every 5 minutes and I don't want Python to show on my task tray. I use Windows as my operating system.
Is there any way to make Python run in the background and force it to not show in my task tray? | How to run a python script in the background? | 1.2 | 0 | 0 | 42,798 |
784,584 | 2009-04-24T05:02:00.000 | 5 | 1 | 0 | 0 | python,ruby | 784,667 | 11 | false | 1 | 0 | Devil's advocate maybe...
Everything's an object.
This is a feature of Ruby, but it is not self-explanatory as to why this is a benefit. You would need to pre-prepare an argument for why that is a benefit. When convincing somebody of something's superiority, always think in terms of showing the benefits, not the ... | 9 | 2 | 0 | G'day folks. I'm trying to introduce Ruby at work, and a few people are interested. However, I've been asked to present the benefits of Ruby over Python and PHP.
I've broken this down into 2 parts:
1) show Python and Ruby's advantages over PHP;
2) show Ruby's advantages over Python.
The first is easy. I'll explain thin... | Convincing others of Ruby over Python and PHP | 0.090659 | 0 | 0 | 1,888 |
784,584 | 2009-04-24T05:02:00.000 | 0 | 1 | 0 | 0 | python,ruby | 784,633 | 11 | false | 1 | 0 | All 3 languages have their place. As with any programming task you must pick the language best suited for the task. Python has list comprehensions, php is much better when embedding and generating html. Ruby is a great language too. One of the things I have found myself using in ruby a few times is the 'a'...'zzzzz... | 9 | 2 | 0 | G'day folks. I'm trying to introduce Ruby at work, and a few people are interested. However, I've been asked to present the benefits of Ruby over Python and PHP.
I've broken this down into 2 parts:
1) show Python and Ruby's advantages over PHP;
2) show Ruby's advantages over Python.
The first is easy. I'll explain thin... | Convincing others of Ruby over Python and PHP | 0 | 0 | 0 | 1,888 |
784,584 | 2009-04-24T05:02:00.000 | 0 | 1 | 0 | 0 | python,ruby | 784,656 | 11 | false | 1 | 0 | If you are inclined towards a language or a software then you will tend to see only the goodies compared to others. If you want to do real comparison then comapre pros and cons and see if Ruby is clear winner in terms of what you want to achieve with that language in your company. If you do this and your company see be... | 9 | 2 | 0 | G'day folks. I'm trying to introduce Ruby at work, and a few people are interested. However, I've been asked to present the benefits of Ruby over Python and PHP.
I've broken this down into 2 parts:
1) show Python and Ruby's advantages over PHP;
2) show Ruby's advantages over Python.
The first is easy. I'll explain thin... | Convincing others of Ruby over Python and PHP | 0 | 0 | 0 | 1,888 |
784,584 | 2009-04-24T05:02:00.000 | 0 | 1 | 0 | 0 | python,ruby | 1,227,135 | 11 | false | 1 | 0 | This kind of post gives Ruby programmers a bad name. Ruby is Beethoven, Python is Bach. If you prefer one style to the other, fine, but don't try to argue the superiority of one over the other. | 9 | 2 | 0 | G'day folks. I'm trying to introduce Ruby at work, and a few people are interested. However, I've been asked to present the benefits of Ruby over Python and PHP.
I've broken this down into 2 parts:
1) show Python and Ruby's advantages over PHP;
2) show Ruby's advantages over Python.
The first is easy. I'll explain thin... | Convincing others of Ruby over Python and PHP | 0 | 0 | 0 | 1,888 |
784,584 | 2009-04-24T05:02:00.000 | 1 | 1 | 0 | 0 | python,ruby | 785,273 | 11 | false | 1 | 0 | Actually no one ever conviced me (at least directly), to use one programming language or another.
I used to have a certain need for clearness (if you might call it that way) and some other criteria, a language and its ecosystem should meet. And you definitively will end up using some stdlib, and third-party resources,... | 9 | 2 | 0 | G'day folks. I'm trying to introduce Ruby at work, and a few people are interested. However, I've been asked to present the benefits of Ruby over Python and PHP.
I've broken this down into 2 parts:
1) show Python and Ruby's advantages over PHP;
2) show Ruby's advantages over Python.
The first is easy. I'll explain thin... | Convincing others of Ruby over Python and PHP | 0.01818 | 0 | 0 | 1,888 |
784,584 | 2009-04-24T05:02:00.000 | 2 | 1 | 0 | 0 | python,ruby | 785,262 | 11 | false | 1 | 0 | You're going to have a tough sell over python. GitHub is written in Ruby, not for ruby per se, by the way.
For python one has BitBucket (even though I do prefer git), as well as pypi.
Correct me if I'm wrong, but it sounds like you haven't looked at python code all that much. (I've written buckets of both python and R... | 9 | 2 | 0 | G'day folks. I'm trying to introduce Ruby at work, and a few people are interested. However, I've been asked to present the benefits of Ruby over Python and PHP.
I've broken this down into 2 parts:
1) show Python and Ruby's advantages over PHP;
2) show Ruby's advantages over Python.
The first is easy. I'll explain thin... | Convincing others of Ruby over Python and PHP | 0.036348 | 0 | 0 | 1,888 |
784,584 | 2009-04-24T05:02:00.000 | 5 | 1 | 0 | 0 | python,ruby | 785,060 | 11 | false | 1 | 0 | If you really want to show Ruby is better (assuming it is for your application!), why not try writing a small app from scratch in front of them? It doesn't have to be big, but something relavent to what you'll eventually be using it for is a good idea.
Write the app in all three languages including any configuration fo... | 9 | 2 | 0 | G'day folks. I'm trying to introduce Ruby at work, and a few people are interested. However, I've been asked to present the benefits of Ruby over Python and PHP.
I've broken this down into 2 parts:
1) show Python and Ruby's advantages over PHP;
2) show Ruby's advantages over Python.
The first is easy. I'll explain thin... | Convincing others of Ruby over Python and PHP | 0.090659 | 0 | 0 | 1,888 |
784,584 | 2009-04-24T05:02:00.000 | 29 | 1 | 0 | 0 | python,ruby | 784,626 | 11 | false | 1 | 0 | If your goal is to show why language X is better than language Y, you're stuck in subjective-land where there are no right answers.
No, Ruby is not better than PHP or Python. It might be more suited for a given purpose, and for that you can give specific examples. PHP is a poor choice for writing an SMTP server; Ruby a... | 9 | 2 | 0 | G'day folks. I'm trying to introduce Ruby at work, and a few people are interested. However, I've been asked to present the benefits of Ruby over Python and PHP.
I've broken this down into 2 parts:
1) show Python and Ruby's advantages over PHP;
2) show Ruby's advantages over Python.
The first is easy. I'll explain thin... | Convincing others of Ruby over Python and PHP | 1 | 0 | 0 | 1,888 |
784,584 | 2009-04-24T05:02:00.000 | 12 | 1 | 0 | 0 | python,ruby | 784,621 | 11 | false | 1 | 0 | Hmm, as an active programmer in all three languages I simply can't agree with the sentiment that either is better than the other. Sure, Python and Ruby are more object-oriented, but that's not a requirement to be better, it's only a convenience. You can't beat the community of PHP and the legacy (for good and for bad) ... | 9 | 2 | 0 | G'day folks. I'm trying to introduce Ruby at work, and a few people are interested. However, I've been asked to present the benefits of Ruby over Python and PHP.
I've broken this down into 2 parts:
1) show Python and Ruby's advantages over PHP;
2) show Ruby's advantages over Python.
The first is easy. I'll explain thin... | Convincing others of Ruby over Python and PHP | 1 | 0 | 0 | 1,888 |
785,327 | 2009-04-24T10:30:00.000 | 0 | 0 | 0 | 0 | python,twitter,dump,social-graph | 817,451 | 3 | true | 0 | 0 | There was a company offering a dump of the social graph, but it was taken down and no longer available. As you already realized - it is kind of hard, as it is changing all the time.
I would recommend checking out their social_graph api methods as they give the most info with the least API calls. | 1 | 3 | 1 | What ready available algorithms could I use to data mine twitter to find out the degrees of separation between 2 people on twitter.
How does it change when the social graph keeps changing and updating constantly.
And then, is there any dump of twitter social graph data which I could use rather than making so many API c... | Twitter Data Mining: Degrees of separation | 1.2 | 0 | 0 | 2,436 |
785,810 | 2009-04-24T13:18:00.000 | 2 | 1 | 0 | 1 | python,linux,perl,process | 785,836 | 3 | false | 0 | 0 | If you are fork()ing the child, you will know it's PID.
From within the parent you can then parse the files in /proc/<PID/ to check the memory and CPU usage, albeit only for as long as the child process is running. | 2 | 2 | 0 | Is there a way to generically retrieve process stats using Perl or Python? We could keep it Linux specific.
There are a few problems: I won't know the PID ahead of time, but I can run the process in question from the script itself. For example, I'd have no problem doing:
./myscript.pl some/process/I/want/to/get/stats/f... | Is there a way to retrieve process stats using Perl or Python? | 0.132549 | 0 | 0 | 4,760 |
785,810 | 2009-04-24T13:18:00.000 | 1 | 1 | 0 | 1 | python,linux,perl,process | 785,855 | 3 | false | 0 | 0 | A common misconception is that reading /proc is like reading /home. /proc is designed to give you the same information with one open() that 20 similar syscalls filling some structure could provide. Reading it does not pollute buffers, send innocent programs to paging hell or otherwise contribute to the death of kittens... | 2 | 2 | 0 | Is there a way to generically retrieve process stats using Perl or Python? We could keep it Linux specific.
There are a few problems: I won't know the PID ahead of time, but I can run the process in question from the script itself. For example, I'd have no problem doing:
./myscript.pl some/process/I/want/to/get/stats/f... | Is there a way to retrieve process stats using Perl or Python? | 0.066568 | 0 | 0 | 4,760 |
786,138 | 2009-04-24T14:45:00.000 | 3 | 1 | 0 | 0 | python,linux,email | 787,170 | 4 | false | 1 | 0 | A few thousand emails per hour isn't really that much, as long as your outgoing mail server is willing to accept them in a timely manner.
I would send them using a local mta, like postfix, or exim (which would then send them through your outgoing relay if required). That service is then responsible for the mail queues,... | 2 | 3 | 0 | I am working for a company that provides customer support to its clients. I am trying to design a system that would send emails automatically to clients when some event occurs. The system would consist of a backend part and a web interface part. The backend will handle the communication with a web interface (which will... | How to design an email system? | 0.148885 | 0 | 0 | 3,573 |
786,138 | 2009-04-24T14:45:00.000 | 0 | 1 | 0 | 0 | python,linux,email | 787,214 | 4 | false | 1 | 0 | You might want to try Twisted Mail for implementing your own backend in pure Python. | 2 | 3 | 0 | I am working for a company that provides customer support to its clients. I am trying to design a system that would send emails automatically to clients when some event occurs. The system would consist of a backend part and a web interface part. The backend will handle the communication with a web interface (which will... | How to design an email system? | 0 | 0 | 0 | 3,573 |
786,149 | 2009-04-24T14:46:00.000 | 2 | 0 | 0 | 0 | python,django,django-templates | 793,167 | 3 | false | 1 | 0 | Context processors and RequestContext (see Tyler's answer) are the way to go for data that is used on every page load. For data that you may need on various views, but not all (especially data that isn't really related to the primary purpose of the view, but appears in something like a navigation sidebar), it often ma... | 1 | 6 | 0 | I have a Django website as follows:
site has several views
each view has its own template to show its data
each template extends a base template
base template is the base of the site, has all the JS/CSS and the basic layout
So up until now it's all good. So now we have the master head of the site (which exists in the... | Basic MVT issue in Django | 0.132549 | 0 | 0 | 539 |
786,691 | 2009-04-24T16:46:00.000 | 2 | 0 | 0 | 0 | python,vector | 786,758 | 2 | false | 0 | 0 | I don't believe there is anything standard (but I could be wrong, I don't keep up with python that closely).
It's very easy to implement though, and you may want to build on top of the numpy array as a container for it anyway, which gives you lots of good (and efficient) bits and pieces. | 1 | 6 | 1 | I quickly checked numPy but it looks like it's using arrays as vectors? I am looking for a proper Vector3 type that I can instance and work on. | Is there a Vector3 type in Python? | 0.197375 | 0 | 0 | 12,341 |
787,015 | 2009-04-24T18:22:00.000 | 0 | 0 | 1 | 0 | python | 788,253 | 5 | false | 1 | 0 | If you can turn part of the application to a library and provide an API, then site-packages is a good place for it. This is actually how many python applications do it.
But from user or administrator point of view that isn't actually the problem. The problem is how we can manage the installed stuff. After I have instal... | 4 | 5 | 0 | I'm in a bit of a discussion with some other developers on an open source project. I'm new to python but it seems to me that site-packages is meant for libraries and not end user applications. Is that true or is site-packages an appropriate place to install an application meant to be run by an end user? | Is site-packages appropriate for applications or just libraries? | 0 | 0 | 0 | 294 |
787,015 | 2009-04-24T18:22:00.000 | 3 | 0 | 1 | 0 | python | 787,128 | 5 | false | 1 | 0 | The program run by the end user is usually somewhere in their path, with most of the code in the module directory, which is often in site-packages.
Many python programs will have a small script located in the path, which imports the module, and calls a "main" method to run the program. This allows the programmer to do ... | 4 | 5 | 0 | I'm in a bit of a discussion with some other developers on an open source project. I'm new to python but it seems to me that site-packages is meant for libraries and not end user applications. Is that true or is site-packages an appropriate place to install an application meant to be run by an end user? | Is site-packages appropriate for applications or just libraries? | 0.119427 | 0 | 0 | 294 |
787,015 | 2009-04-24T18:22:00.000 | 4 | 0 | 1 | 0 | python | 787,200 | 5 | false | 1 | 0 | We do it like this.
Most stuff we download is in site-packages. They come from pypi or Source Forge or some other external source; they are easy to rebuild; they're highly reused; they don't change much.
Must stuff we write is in other locations (usually under /opt, or c:\opt) AND is included in the PYTHONPATH.
There'... | 4 | 5 | 0 | I'm in a bit of a discussion with some other developers on an open source project. I'm new to python but it seems to me that site-packages is meant for libraries and not end user applications. Is that true or is site-packages an appropriate place to install an application meant to be run by an end user? | Is site-packages appropriate for applications or just libraries? | 0.158649 | 0 | 0 | 294 |
787,015 | 2009-04-24T18:22:00.000 | 0 | 0 | 1 | 0 | python | 787,203 | 5 | false | 1 | 0 | Site-packages is for libraries, definitely.
A hybrid approach might work: you can install the libraries required by your application in site-packages and then install the main module elsewhere. | 4 | 5 | 0 | I'm in a bit of a discussion with some other developers on an open source project. I'm new to python but it seems to me that site-packages is meant for libraries and not end user applications. Is that true or is site-packages an appropriate place to install an application meant to be run by an end user? | Is site-packages appropriate for applications or just libraries? | 0 | 0 | 0 | 294 |
787,330 | 2009-04-24T19:57:00.000 | 2 | 0 | 0 | 1 | python,aptana | 14,819,410 | 7 | false | 0 | 0 | To add the current Python version on Mac:
Add new interpreter via Aptana Studio 3/Preferences/PyDev/Interpreter-Python.
Give it name (check version using the Terminal and then python or /usr/bin/python.
Then add the path (2.7 in my case): /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python
If you inst... | 2 | 2 | 0 | How do I get python to work with aptana studio?
I've downloaded a bunch of stuff, but none of them seem to give me a straight text editor where I can interpret code into an executable type thing. I know there's interactive mode in IDLE, but I want to actually use an editor. So I downloaded the pydev extensions for Apta... | How to install Python on mac os x and windows with Aptana Studio? | 0.057081 | 0 | 0 | 3,309 |
787,330 | 2009-04-24T19:57:00.000 | 0 | 0 | 0 | 1 | python,aptana | 788,002 | 7 | false | 0 | 0 | On Mac OS X Leopard and Tiger, Python is already installed.
On Mac, I've tried a few editor. Textmate is my current choice. If you're looking for a free one, I really liked Xcode. But you'll have to run your script from the command line.
If you want a cross-platform environment, you could try Eclipse and the pydev exte... | 2 | 2 | 0 | How do I get python to work with aptana studio?
I've downloaded a bunch of stuff, but none of them seem to give me a straight text editor where I can interpret code into an executable type thing. I know there's interactive mode in IDLE, but I want to actually use an editor. So I downloaded the pydev extensions for Apta... | How to install Python on mac os x and windows with Aptana Studio? | 0 | 0 | 0 | 3,309 |
787,812 | 2009-04-24T22:32:00.000 | 2 | 0 | 1 | 1 | python,librsvg,rsvg | 787,960 | 1 | true | 0 | 0 | No longer relevant. Installed the entire package, and got rsvg that way. | 1 | 4 | 0 | I need rsvg support in Python 2.5.2. It appears that I have to install all 199 deps along with the package python-gnome2-desktop, which doesn't sound fun at all.
Alternatives? | How to install python-rsvg without python-gnome2-desktop on Ubuntu 8.10? | 1.2 | 0 | 0 | 3,929 |
787,849 | 2009-04-24T23:45:00.000 | 2 | 0 | 1 | 0 | python | 787,995 | 7 | false | 0 | 0 | Also, right now the 2.x branch is the most supported one, so I would also say that it's a good reason to start with that version.
And when the moment comes, you can always switch to Python 3. | 3 | 2 | 0 | I am just learning python on my ubuntu 8.04 machine which comes with
python 2.5 install. Is 2.5 too dated to continue learning? How much
of 2.5 version is still valid python code in the newer version? | python 2.5 dated? | 0.057081 | 0 | 0 | 434 |
787,849 | 2009-04-24T23:45:00.000 | 2 | 0 | 1 | 0 | python | 788,020 | 7 | false | 0 | 0 | Python 2.5 is fine. There are still plenty of people on Python 2.4 and 2.3. | 3 | 2 | 0 | I am just learning python on my ubuntu 8.04 machine which comes with
python 2.5 install. Is 2.5 too dated to continue learning? How much
of 2.5 version is still valid python code in the newer version? | python 2.5 dated? | 0.057081 | 0 | 0 | 434 |
787,849 | 2009-04-24T23:45:00.000 | 3 | 0 | 1 | 0 | python | 787,903 | 7 | false | 0 | 0 | I don't have any statistics but my impression is that Python 2.5 is the version most in use today. It is certainly not "dated" - I still use Python 2.5 and I expect that I will be using it for weeks or months yet to come.
If you have Python 2.6 available, though, I would suggest upgrading, as it's still fairly similar... | 3 | 2 | 0 | I am just learning python on my ubuntu 8.04 machine which comes with
python 2.5 install. Is 2.5 too dated to continue learning? How much
of 2.5 version is still valid python code in the newer version? | python 2.5 dated? | 0.085505 | 0 | 0 | 434 |
788,083 | 2009-04-25T02:19:00.000 | 0 | 0 | 0 | 0 | python | 789,282 | 4 | false | 1 | 0 | Google App Engine will provide hosting for free as well as Django and a db.. | 1 | 1 | 0 | I need to build a web site with the following features:
1) user forum where we expect light daily traffic
2) database backend for users to create profiles, where they can log in
and upload media (pictures)
3) users can uses their profile to buy content from an online inventory
4) create web pages, shopping carts etc fo... | Web development with python and sql | 0 | 0 | 0 | 527 |
788,102 | 2009-04-25T02:36:00.000 | 1 | 0 | 1 | 1 | python,blender | 788,143 | 4 | false | 0 | 0 | Personally, I was setting my PATH environment variable so that Blender would find the most appropriate version of Python first. | 2 | 3 | 0 | How do I point Blender to the version of python I have installed | Blender- python | 0.049958 | 0 | 0 | 1,821 |
788,102 | 2009-04-25T02:36:00.000 | 5 | 0 | 1 | 1 | python,blender | 7,134,809 | 4 | false | 0 | 0 | Blender 2.5x now comes bundled with its own python, this is un-modified, only included to so users don't have to match their system versions of python.
If you remove this python/ directory blender will look for python on the system, matching the version it was compiled with. (3.2, 3.3 etc, minor point releases are all ... | 2 | 3 | 0 | How do I point Blender to the version of python I have installed | Blender- python | 0.244919 | 0 | 0 | 1,821 |
788,411 | 2009-04-25T06:59:00.000 | 0 | 1 | 0 | 1 | python,process,daemon | 66,500,807 | 20 | false | 0 | 0 | I was looking for an answer on this and in my case, came to mind a very easy and very good solution, in my opinion (since it's not possible to exist a false positive on this, I guess - how can the timestamp on the TXT be updated if the program doesn't do it):
--> just keep writing on a TXT the current timestamp in some... | 1 | 121 | 0 | I have a python daemon running as a part of my web app/ How can I quickly check (using python) if my daemon is running and, if not, launch it?
I want to do it that way to fix any crashes of the daemon, and so the script does not have to be run manually, it will automatically run as soon as it is called and then stay ru... | Check to see if python script is running | 0 | 0 | 0 | 189,116 |
789,468 | 2009-04-25T18:30:00.000 | 0 | 0 | 0 | 0 | python | 789,671 | 1 | true | 1 | 0 | "Is it possible to work with 'identity' object at entire framework?"
"But it is really tough to define "Identity" as an object due to its complex nature. "
Until you define identity, yes, it's difficult to work with.
Identity has to be positively specified. Leaving it so vague that "It may contain anything, that is s... | 1 | 0 | 0 | I want to write a simple web framework myself using WSGI, Python. I am in study to understand the authorization system.
The system needs to be more modular and abstract enough to add new system into the project as a plug-in. User may use DB or distributed key/value pair, bigtable, etc to store their information.
Lets ... | Handling Authorization in web frameworks | 1.2 | 0 | 0 | 321 |
789,598 | 2009-04-25T19:48:00.000 | 2 | 1 | 1 | 0 | c++,python,distribution,embedded-language | 789,669 | 2 | false | 0 | 0 | It shouldn't be too difficult to write a script for that. Check out the zipfile.PyZipFile class and it's writepy method. | 1 | 3 | 0 | I am using Python as a plug-in scripting language for an existing C++ application. I am able to embed the python interpreter as stated in the Python documentation. Everything works successfully with the initialization and de-initialization of the interpreter. I am, however, having trouble loading modules because I have... | What is the easiest way to build Python26.zip for embedded distribution? | 0.197375 | 0 | 0 | 845 |
789,685 | 2009-04-25T20:35:00.000 | 0 | 1 | 0 | 0 | python,django,email | 789,699 | 4 | false | 1 | 0 | but I don't really think it is
feasible to actually support all these
emails account normally through a
webmail program
I think that your base assumption here is incorrect. You see, most 'webmail' programs are just frontends (or clients) to the backend mail system (postfix etc). You will need to see how your web... | 1 | 2 | 0 | I'd like to provide a functionality for users of my website to get assigned an email address upon registration (such as firstname.lastname@mydomain.com) but I don't really think it is feasible to actually support all these emails account normally through a webmail program. I am also not sure if my webhost would be cool... | What is the best way to redirect email to a Python script? | 0 | 0 | 0 | 2,191 |
789,718 | 2009-04-25T21:02:00.000 | 0 | 1 | 1 | 0 | python,oop | 789,746 | 4 | false | 0 | 0 | Python is a language that supports object oriented coding, but it deliberately isn't a pure OO language. As you correctly mention, Python classes, even user defined ones, haven't always derived from a single base class.
Functions are the basic unit of functionality in Python, so it makes sense for the core operations (... | 2 | 4 | 0 | (I'm sure this is a FAQ, but also hard to google)
Why does Python use abs(x) instead of x.abs?
As far as I see everything abs() does besides calling x.__abs__ could just as well be implemented in object.abs()
Is it historical, because there hasn't always been a root class? | Why builtin functions instead of root class methods? | 0 | 0 | 0 | 635 |
789,718 | 2009-04-25T21:02:00.000 | 1 | 1 | 1 | 0 | python,oop | 789,724 | 4 | false | 0 | 0 | I think you are looking a typical example where a language designer decides that readability and terseness trump purist constructs. | 2 | 4 | 0 | (I'm sure this is a FAQ, but also hard to google)
Why does Python use abs(x) instead of x.abs?
As far as I see everything abs() does besides calling x.__abs__ could just as well be implemented in object.abs()
Is it historical, because there hasn't always been a root class? | Why builtin functions instead of root class methods? | 0.049958 | 0 | 0 | 635 |
789,953 | 2009-04-25T23:49:00.000 | 0 | 1 | 1 | 1 | python,localization | 790,078 | 2 | false | 0 | 0 | For what it's worth, KDE offers a choice of "Metric" or "Imperial" as the standard unit system, so I would presume that it's possible to access that information through Python somehow. Gnome might have a similar setting, I'm not sure... but I don't think there's any equivalent for a generic UNIX/Linux system.
The most... | 1 | 1 | 0 | Do locales contain information about preferred units for temperature, lengths, etc. on Unix/Linux? Is it possible to access these properties from Python? I checked out the "locales" module, but didn't find anything suitable.
I'd like my application to automatically convert values into the most suitable unit. | Locales and temperature/length conversion | 0 | 0 | 0 | 355 |
790,560 | 2009-04-26T09:36:00.000 | 5 | 0 | 1 | 0 | python | 791,093 | 3 | false | 0 | 0 | No, Python's internals take great care to make built-in types NOT mutable -- very different design choices from Ruby's. It's not possible to make object "monkeypatchable" without deeply messing with the C-coded internals and recompiling the Python runtime to make a very different version (this is for the classic CPyth... | 2 | 4 | 0 | Is it possible to add a method to an object class, and use it on all objects? | Object class override or modify | 0.321513 | 0 | 0 | 1,826 |
790,560 | 2009-04-26T09:36:00.000 | 0 | 0 | 1 | 0 | python | 790,574 | 3 | false | 0 | 0 | >>> object.test = "Test"
Traceback (most recent call last):
File "", line 1, in
TypeError: can't set attributes of built-in/extension type 'object'
Doesn't look like it. (Python 2.5.1) | 2 | 4 | 0 | Is it possible to add a method to an object class, and use it on all objects? | Object class override or modify | 0 | 0 | 0 | 1,826 |
790,613 | 2009-04-26T10:37:00.000 | 2 | 0 | 0 | 0 | python,set,acl,pickle | 791,425 | 4 | false | 1 | 0 | Me, I'd stick with keeping persistent info in the relational DB in a form that's independent from a specific programming language used to access it -- much as I love Python (and that's a lot), some day I may want to access that info from some other language, and if I went for Python-specific formats... boy would I ever... | 2 | 1 | 0 | Currently I have tables like: Pages, Groups, GroupPage, Users, UserGroup. With pickled sets I can implement the same thing with only 3 tables: Pages, Groups, Users.
set seems a natural choice for implementing ACL, as group and permission related operations can be expressed very naturally with sets. If I store the allow... | Using Python set type to implement ACL | 0.099668 | 1 | 0 | 2,877 |
790,613 | 2009-04-26T10:37:00.000 | 2 | 0 | 0 | 0 | python,set,acl,pickle | 790,662 | 4 | false | 1 | 0 | You need to consider what it is that a DBMS provides you with, and which of those features you'll need to reimplement.
The issue of concurrency is a big one. There are a few race conditions to be considered (such as multiple writes taking place in different threads and processes and overwriting the new data), performan... | 2 | 1 | 0 | Currently I have tables like: Pages, Groups, GroupPage, Users, UserGroup. With pickled sets I can implement the same thing with only 3 tables: Pages, Groups, Users.
set seems a natural choice for implementing ACL, as group and permission related operations can be expressed very naturally with sets. If I store the allow... | Using Python set type to implement ACL | 0.099668 | 1 | 0 | 2,877 |
790,711 | 2009-04-26T11:53:00.000 | 1 | 0 | 1 | 0 | indentation,python-idle,code-editor | 53,364,383 | 8 | false | 0 | 0 | By default, IDLE has it on Shift-Left Bracket. However, if you want, you can customise it to be Shift-Tab by clicking Options --> Configure IDLE --> Keys --> Use a Custom Key Set --> dedent-region --> Get New Keys for Selection
Then you can choose whatever combination you want. (Don't forget to click apply otherwise al... | 6 | 45 | 0 | If you want to indent several lines in Python IDLE you just mark the lines and hit Tab. But what if you want to remove the indent from several lines? Shift+Tab does not work for that in IDLE. | How to remove tab indent from several lines in IDLE? | 0.024995 | 0 | 0 | 170,386 |
790,711 | 2009-04-26T11:53:00.000 | 52 | 0 | 1 | 0 | indentation,python-idle,code-editor | 790,740 | 8 | false | 0 | 0 | If you're using IDLE, you can use Ctrl+] to indent and Ctrl+[ to unindent. | 6 | 45 | 0 | If you want to indent several lines in Python IDLE you just mark the lines and hit Tab. But what if you want to remove the indent from several lines? Shift+Tab does not work for that in IDLE. | How to remove tab indent from several lines in IDLE? | 1 | 0 | 0 | 170,386 |
790,711 | 2009-04-26T11:53:00.000 | 48 | 0 | 1 | 0 | indentation,python-idle,code-editor | 790,788 | 8 | false | 0 | 0 | If you're using IDLE, and the Norwegian keyboard makes Ctrl-[ a problem, you can change the key.
Go Options->Configure IDLE.
Click the Keys tab.
If necessary, click Save as New Custom Key Set.
With your custom key set, find "dedent-region" in the list.
Click Get New Keys for Selection.
etc
I tried putting in shift-Ta... | 6 | 45 | 0 | If you want to indent several lines in Python IDLE you just mark the lines and hit Tab. But what if you want to remove the indent from several lines? Shift+Tab does not work for that in IDLE. | How to remove tab indent from several lines in IDLE? | 1 | 0 | 0 | 170,386 |
790,711 | 2009-04-26T11:53:00.000 | 8 | 0 | 1 | 0 | indentation,python-idle,code-editor | 34,186,944 | 8 | false | 0 | 0 | in pythonwin,
SHIFT + TAB works | 6 | 45 | 0 | If you want to indent several lines in Python IDLE you just mark the lines and hit Tab. But what if you want to remove the indent from several lines? Shift+Tab does not work for that in IDLE. | How to remove tab indent from several lines in IDLE? | 1 | 0 | 0 | 170,386 |
790,711 | 2009-04-26T11:53:00.000 | 6 | 0 | 1 | 0 | indentation,python-idle,code-editor | 41,728,365 | 8 | false | 0 | 0 | For IDLE, select the lines, then open the "Format" menu. (Between "Edit" and "Run" if you're having trouble finding it.) This will also give you the keyboard shortcut, for me it turned out that dedent shortcut was "Ctrl+[" | 6 | 45 | 0 | If you want to indent several lines in Python IDLE you just mark the lines and hit Tab. But what if you want to remove the indent from several lines? Shift+Tab does not work for that in IDLE. | How to remove tab indent from several lines in IDLE? | 1 | 0 | 0 | 170,386 |
790,711 | 2009-04-26T11:53:00.000 | 32 | 0 | 1 | 0 | indentation,python-idle,code-editor | 790,713 | 8 | false | 0 | 0 | Depends on your editor.
Have you tried Shift+Tab? | 6 | 45 | 0 | If you want to indent several lines in Python IDLE you just mark the lines and hit Tab. But what if you want to remove the indent from several lines? Shift+Tab does not work for that in IDLE. | How to remove tab indent from several lines in IDLE? | 1 | 0 | 0 | 170,386 |
791,098 | 2009-04-26T16:11:00.000 | 2 | 0 | 1 | 0 | python | 791,116 | 4 | true | 0 | 0 | Use globals()['do_on_' + platform] instead of the getattr call and your original idea should work whether this is inside a package or not. | 1 | 2 | 0 | I need to make one function in a module platform-independent by offering several implementations, without changing any files that import it. The following works:
do_it = getattr(__import__(__name__), "do_on_" + sys.platform)
...but breaks if the module is put into a package.
An alternative would be an if/elif with hard... | How to offer platform-specific implementations of a module? | 1.2 | 0 | 0 | 1,942 |
792,629 | 2009-04-27T08:19:00.000 | 7 | 1 | 1 | 0 | python,build-process,build-automation | 792,646 | 12 | false | 0 | 0 | As you're mentioning Python and SCons, I'd say go for SCons. It is Python after all. And yes, any of the above would be a better choice than hand-rolled build scripts. | 6 | 18 | 0 | Currently I'm using a Windows batch file to build my software. It does things like running MSBuild, copying files, creating a ZIP file, running some tests, including the subversion revision number, etc.
But the problem is, batch files are evil. So I would like to change to something better. I was planning to recreate m... | Is Python the right hammer for this nail? (build script) | 1 | 0 | 0 | 9,281 |
792,629 | 2009-04-27T08:19:00.000 | 4 | 1 | 1 | 0 | python,build-process,build-automation | 792,636 | 12 | false | 0 | 0 | I've seen python scripts used for building releases elsewhere so it can't be bad. Actually, I've personally used perl scripts to automate release building. I guess any scripting language could easily automate that procedure. If it's gonna be easy to do (and probably better than batch scripts), why not try it? | 6 | 18 | 0 | Currently I'm using a Windows batch file to build my software. It does things like running MSBuild, copying files, creating a ZIP file, running some tests, including the subversion revision number, etc.
But the problem is, batch files are evil. So I would like to change to something better. I was planning to recreate m... | Is Python the right hammer for this nail? (build script) | 0.066568 | 0 | 0 | 9,281 |
792,629 | 2009-04-27T08:19:00.000 | 9 | 1 | 1 | 0 | python,build-process,build-automation | 792,663 | 12 | false | 0 | 0 | Batch files aren't evil - they've actually come quite a long way from the brain-dead days of command.com. The command language can be pretty expressive nowadays, it just requires a bit of effort on your part to learn it.
Unless there's an actual problem with your build script that you can't fix (and, if that's the case... | 6 | 18 | 0 | Currently I'm using a Windows batch file to build my software. It does things like running MSBuild, copying files, creating a ZIP file, running some tests, including the subversion revision number, etc.
But the problem is, batch files are evil. So I would like to change to something better. I was planning to recreate m... | Is Python the right hammer for this nail? (build script) | 1 | 0 | 0 | 9,281 |
792,629 | 2009-04-27T08:19:00.000 | 1 | 1 | 1 | 0 | python,build-process,build-automation | 792,676 | 12 | false | 0 | 0 | You can create custom makefiles for Microsoft nmake tool which you already have installed. Using a tool like that (SCons, Maven, etc. fall into the same category) gives you much more than regular scripts.
The main benefit is that dependencies between files are tracked and also the timestamps of changes. For example, y... | 6 | 18 | 0 | Currently I'm using a Windows batch file to build my software. It does things like running MSBuild, copying files, creating a ZIP file, running some tests, including the subversion revision number, etc.
But the problem is, batch files are evil. So I would like to change to something better. I was planning to recreate m... | Is Python the right hammer for this nail? (build script) | 0.016665 | 0 | 0 | 9,281 |
792,629 | 2009-04-27T08:19:00.000 | 3 | 1 | 1 | 0 | python,build-process,build-automation | 793,354 | 12 | false | 0 | 0 | Why should you use python? If your build script isn't broke don't fix it. If your having issues updating it to deal with new aditions to the project then you may want to look at rewriting it. I wouldn't use Python though tools like NANT or MSBuild do the job. I don't see the point in using a general purpis programming ... | 6 | 18 | 0 | Currently I'm using a Windows batch file to build my software. It does things like running MSBuild, copying files, creating a ZIP file, running some tests, including the subversion revision number, etc.
But the problem is, batch files are evil. So I would like to change to something better. I was planning to recreate m... | Is Python the right hammer for this nail? (build script) | 0.049958 | 0 | 0 | 9,281 |
792,629 | 2009-04-27T08:19:00.000 | 1 | 1 | 1 | 0 | python,build-process,build-automation | 792,680 | 12 | false | 0 | 0 | Python is very portable. SCons is field tested and reliable. Given what you know (from what you explained), why even ask the question?
If your maintaining something, its not just about getting it to build, its also about explaining to the user why it can NOT build, which saves you a ton of very frustrating questions wh... | 6 | 18 | 0 | Currently I'm using a Windows batch file to build my software. It does things like running MSBuild, copying files, creating a ZIP file, running some tests, including the subversion revision number, etc.
But the problem is, batch files are evil. So I would like to change to something better. I was planning to recreate m... | Is Python the right hammer for this nail? (build script) | 0.016665 | 0 | 0 | 9,281 |
793,125 | 2009-04-27T11:31:00.000 | 0 | 0 | 1 | 0 | python,d,ctypes | 4,884,444 | 1 | false | 0 | 0 | In this case Windows dlls should work just fine. I'm not sure about the situation on Linux, there are some issues with shared libraries which will be addressed as soon as the 64 bit port of dmd is finished.
Note that you have to export your functions as extern(C) or extern(Windows) to access them from ctypes. | 1 | 1 | 0 | I've been playing around with the rather excellent ctypes library in Python recently. What i was wondering is, is it possible to create shared D libraries and call them in the same way. I'm assuming i would compile the .so files using the -fPIC with dmd or gdc and call them the same way using the ctypes library.
Has ... | Calling gdc/dmd shared libraries from Python using ctypes | 0 | 0 | 0 | 482 |
794,132 | 2009-04-27T15:48:00.000 | 1 | 0 | 1 | 0 | python | 794,157 | 7 | true | 0 | 0 | I've asked myself the same question, albeit while doing 2D geometry stuff.
The answer I found for myself was that if I was planning to write a larger library, with more functions and whatnot, go ahead and return the Point, or in your case the Coord3D object. If it's just a hacky implementation, the tuple will get you g... | 3 | 11 | 0 | I am developing in python a file class that can read and write a file, containing a list of xyz coordinates. In my program, I already have a Coord3D class to hold xyz coordinates.
My question is relative to the design of a getCoordinate(index) method. Should I return a tuple of floats, or a Coord3D object?
In the firs... | Returning an object vs returning a tuple | 1.2 | 0 | 0 | 7,405 |
794,132 | 2009-04-27T15:48:00.000 | 2 | 0 | 1 | 0 | python | 794,200 | 7 | false | 0 | 0 | The more fundamental question is "why do you have Coord3D class?" Why not just use a tuple?
The general advice most of us give to Python n00bz is "don't invent new classes until you have to."
Does your Coord3D have unique methods? Perhaps you need a new class. Or -- perhaps -- you only need some functions that opera... | 3 | 11 | 0 | I am developing in python a file class that can read and write a file, containing a list of xyz coordinates. In my program, I already have a Coord3D class to hold xyz coordinates.
My question is relative to the design of a getCoordinate(index) method. Should I return a tuple of floats, or a Coord3D object?
In the firs... | Returning an object vs returning a tuple | 0.057081 | 0 | 0 | 7,405 |
794,132 | 2009-04-27T15:48:00.000 | 1 | 0 | 1 | 0 | python | 794,208 | 7 | false | 0 | 0 | Returning an object would be the best practice and would give you a better overall software design. I would recommend doing that
But still, keep in mind that creating/returning an object will take more processing time. It could change something if you do this operation a LOT and in that case you might need to think abo... | 3 | 11 | 0 | I am developing in python a file class that can read and write a file, containing a list of xyz coordinates. In my program, I already have a Coord3D class to hold xyz coordinates.
My question is relative to the design of a getCoordinate(index) method. Should I return a tuple of floats, or a Coord3D object?
In the firs... | Returning an object vs returning a tuple | 0.028564 | 0 | 0 | 7,405 |
795,241 | 2009-04-27T20:49:00.000 | 1 | 1 | 0 | 0 | java,python,footprint,memory-footprint | 35,581,985 | 1 | false | 1 | 0 | I can't compare memory footprint because it really depends on classes what you load/use. But what I can tell you that Python (IronPython 2.7 in particular) has real memory leak problems. Especially with third party well used ones like Financial.
When Java application/server runs without issues with rare cases which cou... | 1 | 7 | 0 | Can anyone point to serious comparison of Python runtime footprint versus Java?
Thanks,
Avraham | python versus java runtime footprint | 0.197375 | 0 | 0 | 5,256 |
795,405 | 2009-04-27T21:42:00.000 | 3 | 1 | 1 | 0 | python,multithreading | 797,218 | 2 | false | 0 | 0 | I don't think there's an easy way. There's probably an awkward way, involving rebuilding Python to traverse the PyThreadState list and count the threads each time the lock is acquired, but I doubt it's worth the effort!
I know this is a speculative question but if you are even moderately concerned about there being del... | 1 | 6 | 0 | I have a long-running Python service and I'd like to know how much cumulative wall clock time has been spent by any runnable threads (i.e., threads that weren't blocked for some other reason) waiting for the GIL. Is there an easy way to do this? E.g., perhaps I could periodically dump some counter to its log file.
My... | Is there an easy way to tell how much time is spent waiting for the Python GIL? | 0.291313 | 0 | 0 | 536 |
796,319 | 2009-04-28T05:16:00.000 | 17 | 1 | 0 | 1 | python,shell | 796,344 | 8 | false | 0 | 0 | There's nothing you can do with shell scripts that you can't do with python.
The big advantage of shell scripts is that you use the same commands as you do when you use the shell, so if you're a heavy shell user, shell scripting will at some point become a very quick and easy way to automate your shell work.
I also fi... | 8 | 109 | 0 | I tried to learn shell(bash) scripting few times but was driven away by the syntax. Then I found Python and was able to do most of the things a shell script can do in Python. I am now not sure whether I should invest my time in learning shell scripting anymore. So I want to ask:
What are strengths of shell scripting th... | Strengths of Shell Scripting compared to Python | 1 | 0 | 0 | 63,953 |
796,319 | 2009-04-28T05:16:00.000 | 9 | 1 | 0 | 1 | python,shell | 4,980,553 | 8 | false | 0 | 0 | I agree with most of the previous answers. I consider shell commands most suited to do filesystem-oriented tasks (copy and move files, grep, etc). Shell is better, in my opinion, if you have to read and write to file, since a single >>file.txt redirection appends to file instantly, instead of needing, say, file=open('f... | 8 | 109 | 0 | I tried to learn shell(bash) scripting few times but was driven away by the syntax. Then I found Python and was able to do most of the things a shell script can do in Python. I am now not sure whether I should invest my time in learning shell scripting anymore. So I want to ask:
What are strengths of shell scripting th... | Strengths of Shell Scripting compared to Python | 1 | 0 | 0 | 63,953 |
796,319 | 2009-04-28T05:16:00.000 | 5 | 1 | 0 | 1 | python,shell | 9,188,834 | 8 | false | 0 | 0 | Another thing to consider when choosing shell scripts of Python is the Python version that will be running on the target machines. RHEL5 (to name one) is going to be around for a long time. RHEL5 is stuck with Python 2.4. There are a lot of nice libraries that depend on functionality added to Python post-2.4. | 8 | 109 | 0 | I tried to learn shell(bash) scripting few times but was driven away by the syntax. Then I found Python and was able to do most of the things a shell script can do in Python. I am now not sure whether I should invest my time in learning shell scripting anymore. So I want to ask:
What are strengths of shell scripting th... | Strengths of Shell Scripting compared to Python | 0.124353 | 0 | 0 | 63,953 |
796,319 | 2009-04-28T05:16:00.000 | 36 | 1 | 0 | 1 | python,shell | 814,425 | 8 | false | 0 | 0 | The shell makes common and simple actions really simple, at the expense of making more complex things much much more complex.
Typically, a small shell script will be shorter and simpler than the corresponding python program, but the python program will tend to gracefully accept modifications, whereas the shell script w... | 8 | 109 | 0 | I tried to learn shell(bash) scripting few times but was driven away by the syntax. Then I found Python and was able to do most of the things a shell script can do in Python. I am now not sure whether I should invest my time in learning shell scripting anymore. So I want to ask:
What are strengths of shell scripting th... | Strengths of Shell Scripting compared to Python | 1 | 0 | 0 | 63,953 |
796,319 | 2009-04-28T05:16:00.000 | 58 | 1 | 0 | 1 | python,shell | 797,341 | 8 | false | 0 | 0 | "What are strengths of shell scripting that make it an indispensable tool as compared to Python?"
The shell is not indispensable. Why do you think there are so many? bash, tcsh, csh, sh, etc., etc.,
Python is a shell. Not the one you'd use for running all commands, but for scripting, it's ideal.
Python is a more-or... | 8 | 109 | 0 | I tried to learn shell(bash) scripting few times but was driven away by the syntax. Then I found Python and was able to do most of the things a shell script can do in Python. I am now not sure whether I should invest my time in learning shell scripting anymore. So I want to ask:
What are strengths of shell scripting th... | Strengths of Shell Scripting compared to Python | 1 | 0 | 0 | 63,953 |
796,319 | 2009-04-28T05:16:00.000 | 7 | 1 | 0 | 1 | python,shell | 796,348 | 8 | false | 0 | 0 | The shell is available everywhere. If you stick to a relatively basic set of portable functionality, your scripts can run on cell phones, wireless routers, DVRs, netbooks, workstations, big iron servers, and the like. Python is not necessarily included out of the box on lots of systems, and depending on the environment... | 8 | 109 | 0 | I tried to learn shell(bash) scripting few times but was driven away by the syntax. Then I found Python and was able to do most of the things a shell script can do in Python. I am now not sure whether I should invest my time in learning shell scripting anymore. So I want to ask:
What are strengths of shell scripting th... | Strengths of Shell Scripting compared to Python | 1 | 0 | 0 | 63,953 |
796,319 | 2009-04-28T05:16:00.000 | 11 | 1 | 0 | 1 | python,shell | 3,074,616 | 8 | false | 0 | 0 | one doesn't have to learn shell scripting, as all the previous answers indicate; but learning is never a bad thing. it's really a question of personal priorities. it's very hard for someone else to tell you what is and isn't worth your time.
most programmers find that learning new languages gets incrementally easier ea... | 8 | 109 | 0 | I tried to learn shell(bash) scripting few times but was driven away by the syntax. Then I found Python and was able to do most of the things a shell script can do in Python. I am now not sure whether I should invest my time in learning shell scripting anymore. So I want to ask:
What are strengths of shell scripting th... | Strengths of Shell Scripting compared to Python | 1 | 0 | 0 | 63,953 |
796,319 | 2009-04-28T05:16:00.000 | 95 | 1 | 0 | 1 | python,shell | 796,343 | 8 | true | 0 | 0 | Shell scripting has simpler notations for I/O redirection.
It is simpler to create pipelines out of existing programs in shell.
Shell scripting reuses entire programs.
Shell is universally available (on anything like Unix) - Python is not necessarily installed.
'Tis true that you can do everything in Python that you c... | 8 | 109 | 0 | I tried to learn shell(bash) scripting few times but was driven away by the syntax. Then I found Python and was able to do most of the things a shell script can do in Python. I am now not sure whether I should invest my time in learning shell scripting anymore. So I want to ask:
What are strengths of shell scripting th... | Strengths of Shell Scripting compared to Python | 1.2 | 0 | 0 | 63,953 |
796,490 | 2009-04-28T06:40:00.000 | 1 | 0 | 0 | 0 | python,html,parsing,semantics,html-content-extraction | 796,530 | 5 | false | 1 | 0 | What is meaningful and what is not, it depends on the semantic of the page. If the semantics is crappy, your code won't "guess" what is meaningful. I use readability, which you linked in the comment, and I see that on many pages I try to read it does not provide any result, not talking about a decent one.
If someone pu... | 1 | 8 | 0 | Of course an HTML page can be parsed using any number of python parsers, but I'm surprised that there don't seem to be any public parsing scripts to extract meaningful content (excluding sidebars, navigation, etc.) from a given HTML doc.
I'm guessing it's something like collecting DIV and P elements and then checking ... | python method to extract content (excluding navigation) from an HTML page | 0.039979 | 0 | 1 | 3,581 |
797,771 | 2009-04-28T12:55:00.000 | 4 | 0 | 1 | 0 | python | 797,799 | 8 | false | 0 | 0 | if the variable name is "__secret" and the class name is "MyClass" you can access it like this on an instance named "var"
var._MyClass__secret
The convention to suggest/emulate protection is to name it with a leading underscore: self._protected_variable = 10
Of course, anybody can modify it if it really wants. | 2 | 51 | 0 | How do I access a private attribute of a parent class from a subclass (without making it public)? | Python "protected" attributes | 0.099668 | 0 | 0 | 71,482 |
797,771 | 2009-04-28T12:55:00.000 | 101 | 0 | 1 | 0 | python | 797,814 | 8 | true | 0 | 0 | My understanding of Python convention is
_member is protected
__member is private
Options for if you control the parent class
Make it protected instead of private
since that seems like what you really
want
Use a getter (@property def
_protected_access_to_member...) to limit the protected access
If you don't control... | 2 | 51 | 0 | How do I access a private attribute of a parent class from a subclass (without making it public)? | Python "protected" attributes | 1.2 | 0 | 0 | 71,482 |
797,773 | 2009-04-28T12:56:00.000 | 4 | 0 | 0 | 0 | python,django,caching | 804,829 | 4 | false | 1 | 0 | I have no proof, but I've read BeautifulSoup is slow and consumes a lot of memory. You may want to look at using the lxml module instead. lxml is supposed to be much faster and efficient, and can do much more than BeautifulSoup.
Of course, the parsing probably isn't your bottleneck here; the external I/O is.
First off... | 2 | 5 | 0 | I have a Django view, which receives part of its data from an external website, which I parse using urllib2/BeautifulSoup.
This operation is rather expensive so I cache it using the low-level cache API, for ~5 minutes. However, each user which accesses the site after the cached data expires will receive a significant d... | Django caching - can it be done pre-emptively? | 0.197375 | 0 | 0 | 1,876 |
797,773 | 2009-04-28T12:56:00.000 | 4 | 0 | 0 | 0 | python,django,caching | 798,462 | 4 | false | 1 | 0 | "I'm still unsure as to how I accomplish this with the python script I will be calling. "
The issue is that your "significant delay of a few seconds while I go to the external site to parse the new data" has nothing to do with Django cache at all.
You can cache it everywhere, and when you go to reparse the external sit... | 2 | 5 | 0 | I have a Django view, which receives part of its data from an external website, which I parse using urllib2/BeautifulSoup.
This operation is rather expensive so I cache it using the low-level cache API, for ~5 minutes. However, each user which accesses the site after the cached data expires will receive a significant d... | Django caching - can it be done pre-emptively? | 0.197375 | 0 | 0 | 1,876 |
798,389 | 2009-04-28T14:54:00.000 | -1 | 0 | 1 | 0 | python,refactoring | 2,398,941 | 5 | false | 0 | 0 | i was confuse in this question too,i have found a search helper help me to find the call hierarchy in another way. not very good but better than donot have. sorry about my english.
ps.IDE eclipse+pydev | 1 | 19 | 0 | I'm digging into a huge legacy Python class that has a lot of methods. I eventually break complex ones into smaller pieces so the amount of methods increases even more. I wonder if there is a tool that can scan the Python code and build some kind of dependency diagram for its methods.
I define method x() to be a depend... | Python tool that builds a dependency diagram for methods of a class | -0.039979 | 0 | 0 | 10,338 |
798,413 | 2009-04-28T14:58:00.000 | 2 | 1 | 0 | 1 | python,perl,domainkeys,dkim | 798,508 | 6 | false | 0 | 0 | I'm sure there's a reason you're going down the route you've chosen, but why not just do the signing in Python?
How are you signing it? Maybe we could provide some assitance in writing a python implementation? | 1 | 6 | 0 | I'm hacking some support for DomainKeys and DKIM into an open source email marketing program, which uses a python script to send the actual emails via SMTP. I decided to go the quick and dirty route, and just write a perl script that accepts an email message from STDIN, signs it, then returns it signed.
What I would li... | How to call a Perl script from Python, piping input to it? | 0.066568 | 0 | 0 | 13,888 |
800,769 | 2009-04-29T03:37:00.000 | 0 | 0 | 1 | 0 | python,user-interface,python-3.x | 800,794 | 6 | false | 0 | 1 | Just use whichever editor you are most comfortable with.
The "leading space as logic" and duck typing mean that there is a limited amount of syntax checking and re-factoring an editor can reasonably do (or is required!) with python source.
If you dont have a favorite editor then just use the "idle" editor which comes w... | 4 | 3 | 0 | I would like to start learning Python (zero past experience). I am a bit inclined to start with Python 3.0. However, I am not sure if at this time there exists a GUI editor that would be compatible with Python 3.0. I've tried installing Glade, but the one I've got works only with Python 2.5. What could I possibly use w... | About GUI editor that would be compatible with Python 3.0 | 0 | 0 | 0 | 1,811 |
800,769 | 2009-04-29T03:37:00.000 | 1 | 0 | 1 | 0 | python,user-interface,python-3.x | 800,824 | 6 | false | 0 | 1 | There are many useful libraries (not to mention educational material, cookbook snippets, etc.) that have yet to be ported to Python 3.0, so I recommend using Python 2.x for now (where, currently, 5 <= x <= 6). Doubly so if you're a beginner to Python. Triply so if you're actually planning on releasing some software--ma... | 4 | 3 | 0 | I would like to start learning Python (zero past experience). I am a bit inclined to start with Python 3.0. However, I am not sure if at this time there exists a GUI editor that would be compatible with Python 3.0. I've tried installing Glade, but the one I've got works only with Python 2.5. What could I possibly use w... | About GUI editor that would be compatible with Python 3.0 | 0.033321 | 0 | 0 | 1,811 |
800,769 | 2009-04-29T03:37:00.000 | 0 | 0 | 1 | 0 | python,user-interface,python-3.x | 800,941 | 6 | false | 0 | 1 | WING 3.2 beta work in python 3.
ricnar | 4 | 3 | 0 | I would like to start learning Python (zero past experience). I am a bit inclined to start with Python 3.0. However, I am not sure if at this time there exists a GUI editor that would be compatible with Python 3.0. I've tried installing Glade, but the one I've got works only with Python 2.5. What could I possibly use w... | About GUI editor that would be compatible with Python 3.0 | 0 | 0 | 0 | 1,811 |
800,769 | 2009-04-29T03:37:00.000 | 0 | 0 | 1 | 0 | python,user-interface,python-3.x | 800,918 | 6 | false | 0 | 1 | The only GUI toolkit currently available in Python3.0 is Tkinter, and I don't think there are any Python3.0 GUI-builders available yet. | 4 | 3 | 0 | I would like to start learning Python (zero past experience). I am a bit inclined to start with Python 3.0. However, I am not sure if at this time there exists a GUI editor that would be compatible with Python 3.0. I've tried installing Glade, but the one I've got works only with Python 2.5. What could I possibly use w... | About GUI editor that would be compatible with Python 3.0 | 0 | 0 | 0 | 1,811 |
800,849 | 2009-04-29T04:17:00.000 | 2 | 0 | 0 | 0 | python,user-interface,ide,wxpython,tkinter | 17,740,395 | 8 | false | 0 | 1 | I use Eclipse with PyDev as my Python IDE (Which is probably not the best solution out there, but it is quite decent)
For GUI developement, I have used wxGlade for a mid-sized project and found it to be quite easy to use one you've grasped the concepts of WxPython. The XML generation is very useful for separating actua... | 2 | 43 | 0 | I have a little experience developing small command-line applications with Python. I want to move on to developing GUIs with Python. From the available GUI toolkits for Python, the ones I feel the most inclined to are wxPython and Tkinter; but I don't want to code all of the GUI by myself all of the time.
Are there any... | Nice IDE with GUI designer for wxPython or Tkinter | 0.049958 | 0 | 0 | 70,190 |
800,849 | 2009-04-29T04:17:00.000 | 0 | 0 | 0 | 0 | python,user-interface,ide,wxpython,tkinter | 801,176 | 8 | false | 0 | 1 | I've used wxGlade for a few mission-critical apps. If you're a little weak in wx, it can be rough, but once you get used to it, its a great tool. | 2 | 43 | 0 | I have a little experience developing small command-line applications with Python. I want to move on to developing GUIs with Python. From the available GUI toolkits for Python, the ones I feel the most inclined to are wxPython and Tkinter; but I don't want to code all of the GUI by myself all of the time.
Are there any... | Nice IDE with GUI designer for wxPython or Tkinter | 0 | 0 | 0 | 70,190 |
801,090 | 2009-04-29T06:17:00.000 | -5 | 1 | 0 | 0 | php,python,vcl4php | 801,196 | 14 | false | 1 | 0 | The good news is that you won't miss it as soon as you familiarize yourself with a way of work when the responsibilities are shared.
Think it over: really the programmer is the right person to assemble the user interface? I think not even in case of a desktop application.
Programmer should write good code, separated di... | 5 | 6 | 0 | I am looking for RAD like environment for PHP and/or Python free or not does not matter.
It should have a visual environment where one can use a point and click interface so that it is possible to select objects with mouse and move them around.
I have looked at Delphi4PHP. The RAD part is fantastic, but I don't like th... | Looking for a PHP and/or Python RAD | -1 | 0 | 0 | 3,848 |
801,090 | 2009-04-29T06:17:00.000 | 2 | 1 | 0 | 0 | php,python,vcl4php | 801,278 | 14 | false | 1 | 0 | I just remenbered some more tools that might be useful to you, besides WebDev:
PHPMaker
WaveMaker
For Python I'm gonna try the DialogBlocks later this evening. | 5 | 6 | 0 | I am looking for RAD like environment for PHP and/or Python free or not does not matter.
It should have a visual environment where one can use a point and click interface so that it is possible to select objects with mouse and move them around.
I have looked at Delphi4PHP. The RAD part is fantastic, but I don't like th... | Looking for a PHP and/or Python RAD | 0.028564 | 0 | 0 | 3,848 |
801,090 | 2009-04-29T06:17:00.000 | 0 | 1 | 0 | 0 | php,python,vcl4php | 1,256,441 | 14 | false | 1 | 0 | Let me elaborate on CodeCharge Studio. I think you still can consider this system.
Personally, I've been using it to develop very complex high-load data-base driven CRM applications, with 4.x version it even generates AJAX-based code and autocomplete, ajax-form submittion are piece of cake.
With CCS you will need some... | 5 | 6 | 0 | I am looking for RAD like environment for PHP and/or Python free or not does not matter.
It should have a visual environment where one can use a point and click interface so that it is possible to select objects with mouse and move them around.
I have looked at Delphi4PHP. The RAD part is fantastic, but I don't like th... | Looking for a PHP and/or Python RAD | 0 | 0 | 0 | 3,848 |
801,090 | 2009-04-29T06:17:00.000 | 1 | 1 | 0 | 0 | php,python,vcl4php | 4,500,774 | 14 | false | 1 | 0 | I don't think Yogi is a PITA. He is discerning and this is very helpful. Since none of these tools quite hit the mark for him when one does it will be the right one and then all of us will benefit from his studied decision. | 5 | 6 | 0 | I am looking for RAD like environment for PHP and/or Python free or not does not matter.
It should have a visual environment where one can use a point and click interface so that it is possible to select objects with mouse and move them around.
I have looked at Delphi4PHP. The RAD part is fantastic, but I don't like th... | Looking for a PHP and/or Python RAD | 0.014285 | 0 | 0 | 3,848 |
801,090 | 2009-04-29T06:17:00.000 | 1 | 1 | 0 | 0 | php,python,vcl4php | 801,096 | 14 | false | 1 | 0 | Delphi4PHP is the only I know of, back in the old days I also used Macromedia (now Adobe) Dreamweaver to generate some code, and if you set up a live site it kinda acts like a RAD IDE. Kinda.
For Python, I asked a similar question a couple of hours ago, I'm also interested in knowing such tool. | 5 | 6 | 0 | I am looking for RAD like environment for PHP and/or Python free or not does not matter.
It should have a visual environment where one can use a point and click interface so that it is possible to select objects with mouse and move them around.
I have looked at Delphi4PHP. The RAD part is fantastic, but I don't like th... | Looking for a PHP and/or Python RAD | 0.014285 | 0 | 0 | 3,848 |
801,432 | 2009-04-29T08:28:00.000 | 0 | 0 | 1 | 0 | c#,winforms,ironpython | 801,447 | 5 | false | 0 | 0 | IronRuby comes with a command line interpreter. Doesn't IronPython also have one? If so, the source code would be a good start :)
Oh, and if it doesn't, be sure to look at the IronRuby interpreter, because both languages are based on the DLR and are therefore similar enough to learn from both. | 1 | 0 | 0 | I'd like to add "IDLE-like functionality" to C# WinForms application, but I don't quite have an idea how to do that and couldn't find anything useful with Google.
So basically I want interactive command line interface, where user could enter some Python code and execute it (not just expressions, should be possible to d... | How to create IDLE -like functionality to WinForms application | 0 | 0 | 0 | 975 |
801,515 | 2009-04-29T09:01:00.000 | 0 | 0 | 0 | 0 | python,informix | 823,474 | 2 | false | 0 | 0 | Does other way to connect to database work?
Can you use (configure in control panel) ODBC? If ODBC works then you can use Python win32 extensions (ActiveState distribution comes with it) and there is ODBC support. You can also use Jython which can work with ODBC via JDBC-ODBC bridge or with Informix JDBC driver. | 2 | 1 | 0 | I have downloaded & installed the latest Python InformixDB package, but when I try to import it from the shell, I am getting the following error in the form of a Windows dialog box!
"A procedure entry point sqli_describe_input_stmt could not be located in the dynamic link isqlit09a.dll"
Any ideas what's happening?
Plat... | Why Python informixdb package is throwing an error! | 0 | 1 | 0 | 435 |
801,515 | 2009-04-29T09:01:00.000 | 1 | 0 | 0 | 0 | python,informix | 803,958 | 2 | false | 0 | 0 | Which version of IBM Informix Connect (I-Connect) or IBM Informix ClientSDK (CSDK) are you using? The 'describe input' function is a more recent addition, but it is likely that you have it.
Have you been able to connect to any Informix DBMS from the command shell? If not, then the suspicion must be that you don't hav... | 2 | 1 | 0 | I have downloaded & installed the latest Python InformixDB package, but when I try to import it from the shell, I am getting the following error in the form of a Windows dialog box!
"A procedure entry point sqli_describe_input_stmt could not be located in the dynamic link isqlit09a.dll"
Any ideas what's happening?
Plat... | Why Python informixdb package is throwing an error! | 0.099668 | 1 | 0 | 435 |
801,931 | 2009-04-29T11:31:00.000 | 5 | 1 | 0 | 1 | python,architecture,containers,notifications | 802,084 | 5 | true | 0 | 0 | You're over-thinking this. Seriously. Python isn't C++; your concerns are non-issues in Python. Just write what makes sense in your problem domain.
" Not absolutely good because of circular references."
Why not? Circularity is of no relevance here at all. Bidirectional relationships are great things. Use them. P... | 2 | 4 | 0 | I have two classes: Account and Operator. Account contains a list of Operators. Now, whenever an operator (in the list) receives a message I want to notify Account object to perform some business logic as well.
I think of three alternatives on how to achieve this:
1) Hold a reference within Operator to the container [A... | Notifying container object: best practices | 1.2 | 0 | 0 | 403 |
801,931 | 2009-04-29T11:31:00.000 | 3 | 1 | 0 | 1 | python,architecture,containers,notifications | 802,031 | 5 | false | 0 | 0 | There is no "one-size-fits-all" solution for the Observer pattern. But usually, it's better to define an EventManager object where interested parties can register themselves for certain events and post these events whenever they happen. It simply creates less dependencies.
Note that you need to use a global EventManage... | 2 | 4 | 0 | I have two classes: Account and Operator. Account contains a list of Operators. Now, whenever an operator (in the list) receives a message I want to notify Account object to perform some business logic as well.
I think of three alternatives on how to achieve this:
1) Hold a reference within Operator to the container [A... | Notifying container object: best practices | 0.119427 | 0 | 0 | 403 |
802,499 | 2009-04-29T14:02:00.000 | 8 | 0 | 1 | 0 | c++,python,winapi,enumeration | 803,056 | 7 | false | 0 | 0 | Control Panel uses Win32 COM api, which is the official method (see Google Groups, Win32)
Never rely on registry. | 1 | 9 | 0 | When I say "installed application", I basically mean any application visible in [Control Panel]->[Add/Remove Programs].
I would prefer to do it in Python, but C or C++ is also fine. | How can I enumerate/list all installed applications in Windows XP? | 1 | 0 | 0 | 33,683 |
802,578 | 2009-04-29T14:21:00.000 | 7 | 0 | 1 | 0 | java,python,keyword,final | 802,622 | 11 | false | 0 | 0 | There is no such thing. In general, the Python attitude is "if you don't want this modified, just don't modify it". Clients of an API are unlikely to just poke around your undocumented internals anyway.
You could, I suppose, work around this by using tuples or namedtuples for the relevant bits of your model, which are ... | 2 | 78 | 0 | I couldn't find documentation on an equivalent of Java's final in Python, is there such a thing?
I'm creating a snapshot of an object (used for restoration if anything fails); once this backup variable is assigned, it should not be modified -- a final-like feature in Python would be nice for this. | `final` keyword equivalent for variables in Python? | 1 | 0 | 0 | 83,113 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.