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
3,292,238
2010-07-20T16:36:00.000
2
0
0
1
python,google-app-engine,email
3,292,433
2
false
1
0
When sending email, you can designate the sender as either the currently logged in user or any registered administrator. It does not have to be the administrator who created the app. Also note that you can add any email address as an administrator on your app (from the permissions tab in the admin console). It does not...
1
2
0
I have a domain xyz.com and right now it is pointing to my app in appspot. I want to send email alerts to users for various events. However, appengine restricts email sender to admin email address which was used to create the google app engine account. Can I send emails on behalf of user@xyz.com using app engine? If no...
Sending email from my domain vs from the admin google account?
0.197375
0
0
497
3,292,631
2010-07-20T17:26:00.000
4
1
1
0
python,inheritance,interface,attributes,abstract-class
3,292,765
5
false
0
0
You've missed the point. It isn't the lack of encapsulation that removes the need for accessors, it's the fact that, by changing from a direct attribute to a property, you can add an accessor at a later time without changing the published interface in any way. In many other languages, if you expose an attribute as publ...
3
10
0
I realize that in most cases, it's preferred in Python to just access attributes directly, since there's no real concept of encapsulation like there is in Java and the like. However, I'm wondering if there aren't any exceptions, particularly with abstract classes that have disparate implementations. Let's say I'm writi...
Are accessors in Python ever justified?
0.158649
0
0
5,980
3,292,631
2010-07-20T17:26:00.000
0
1
1
0
python,inheritance,interface,attributes,abstract-class
6,562,247
5
false
0
0
The discussion already ended a year ago, but this snippet seemed telltale, it's worth discussing: However, an implementation of the class that satisfies all of the abstract methods will almost certainly fail, because the author won't know that they need attributes called 'author' and 'date' and so on, so cod...
3
10
0
I realize that in most cases, it's preferred in Python to just access attributes directly, since there's no real concept of encapsulation like there is in Java and the like. However, I'm wondering if there aren't any exceptions, particularly with abstract classes that have disparate implementations. Let's say I'm writi...
Are accessors in Python ever justified?
0
0
0
5,980
3,292,631
2010-07-20T17:26:00.000
1
1
1
0
python,inheritance,interface,attributes,abstract-class
3,292,748
5
false
0
0
"they should be able to do so just by looking at the abstract class" Don't know what this should be true. A "programmer's guide", a "how to extend" document, plus some training seems appropriate to me. "the author won't know that they need attributes called 'author' and 'date' and so on". In that case, the docume...
3
10
0
I realize that in most cases, it's preferred in Python to just access attributes directly, since there's no real concept of encapsulation like there is in Java and the like. However, I'm wondering if there aren't any exceptions, particularly with abstract classes that have disparate implementations. Let's say I'm writi...
Are accessors in Python ever justified?
0.039979
0
0
5,980
3,292,973
2010-07-20T18:11:00.000
1
0
0
0
python,xml,serialization,xml-serialization,python-2.4
3,294,357
5
false
0
0
Grey's link includes some solutions that look pretty robust. If you want to roll your own though, you could use xml.dom.node's childNode member recursively, terminating when node.childNode = None.
1
4
0
I need to use Python 2.4.4 to convert XML to and from a Python dictionary. All I need are the node names and values, I'm not worried about attributes because the XML I'm parsing doesn't have any. I can't use ElementTree because that isn't available for 2.4.4, and I can't use 3rd party libraries due to my work environme...
XML to/from a Python dictionary
0.039979
0
1
24,276
3,293,788
2010-07-20T19:50:00.000
0
0
0
0
python,macos,selenium,selenium-rc
4,579,133
1
false
0
0
You might be able to make this work by setting ridiculously large timeout values on your Selenium commands. But, you may still run into a problem where MacOS X kills the network connection when it goes to sleep. Once the connection is severed, you're only real option would be to grab the test session ID and try to re...
1
2
0
When I put my Mac to sleep while an interactive Python session with a selenium instance and corresponding browser is running, after waking up the browser (or selenium server?) are no longer responding to any commands from the Python shell. This forces me to restart the browser, losing the state of my test. Is there a w...
How to resume a Selenium RC test after a computer sleep?
0
0
1
429
3,294,349
2010-07-20T21:04:00.000
0
0
1
0
python,select,system-calls
3,294,568
2
false
0
0
It seems unlikely to me that this is going to work well, but it depends on the libraries, and what you need them to do. Some thoughts: The libraries might provide APIs to open up the select loop, either by letting you plug into their select loop with your own file descriptors, or by providing APIs that return their ow...
2
0
0
I'm using a couple of Python libraries, and they both use a select() syscall. I was wondering if it was safe to have two select() syscalls from within the same thread (assuming there are no shared descriptors between them)?
Multiple select() syscalls from one thread in Python
0
0
0
393
3,294,349
2010-07-20T21:04:00.000
2
0
1
0
python,select,system-calls
3,294,552
2
false
0
0
Well, within a single thread you can't really have "two select() syscalls", because the first call has to end before you can start the second call. But yes, it's perfectly safe, even if they do share descriptors: both calls create new objects to return, there's no variable re-use that might affect them (like it might w...
2
0
0
I'm using a couple of Python libraries, and they both use a select() syscall. I was wondering if it was safe to have two select() syscalls from within the same thread (assuming there are no shared descriptors between them)?
Multiple select() syscalls from one thread in Python
0.197375
0
0
393
3,294,526
2010-07-20T21:30:00.000
5
1
1
0
python,c,unit-testing
3,298,479
4
true
0
0
Tests through the Python interface will be valuable acceptance tests for your library. They will not however be unit tests. Unit tests are written by the same coders, in the same language, on the same platform as the unit which they test. These should be written too! You're right, though, unit testing in Python is far ...
4
3
0
If I'm writing a library in C that includes a Python interface, is it OK to just write unit tests for the functions, etc in the Python interface? Assuming the Python interface is complete, it should imply the C code works. Mostly I'm being lazy in that the Python unit test thing takes almost zero effort to use. thanks,...
trickle down unit tests
1.2
0
0
217
3,294,526
2010-07-20T21:30:00.000
0
1
1
0
python,c,unit-testing
3,294,592
4
false
0
0
Ideally, you'd write unit tests for each. Your Python library calls probably (hopefully?) don't have a one-to-one correspondence to your C library calls, because that wouldn't be a very Pythonic interface, so if you only unit test your Python interface, there would be variations and sequences of C library calls that we...
4
3
0
If I'm writing a library in C that includes a Python interface, is it OK to just write unit tests for the functions, etc in the Python interface? Assuming the Python interface is complete, it should imply the C code works. Mostly I'm being lazy in that the Python unit test thing takes almost zero effort to use. thanks,...
trickle down unit tests
0
0
0
217
3,294,526
2010-07-20T21:30:00.000
1
1
1
0
python,c,unit-testing
3,294,582
4
false
0
0
If you only care if the Python library works, then test that. This will give you significant confirmation that the C library is robust, but the maxim "if you didn't test it, it doesn't work" still mostly applies and I wouldn't export the library without the test harness. You could, in theory, test that the processor mi...
4
3
0
If I'm writing a library in C that includes a Python interface, is it OK to just write unit tests for the functions, etc in the Python interface? Assuming the Python interface is complete, it should imply the C code works. Mostly I'm being lazy in that the Python unit test thing takes almost zero effort to use. thanks,...
trickle down unit tests
0.049958
0
0
217
3,294,526
2010-07-20T21:30:00.000
0
1
1
0
python,c,unit-testing
3,298,110
4
false
0
0
I see two mains restrictions to unit testing thru the Python interface. Whether it is OK to testing with those restrictions or not depends on what the library does, how it is implemented, and on the alignment of the Python interface on the interface of the C library. the library can only be exercised the way the Pytho...
4
3
0
If I'm writing a library in C that includes a Python interface, is it OK to just write unit tests for the functions, etc in the Python interface? Assuming the Python interface is complete, it should imply the C code works. Mostly I'm being lazy in that the Python unit test thing takes almost zero effort to use. thanks,...
trickle down unit tests
0
0
0
217
3,294,682
2010-07-20T21:50:00.000
5
0
0
0
python,django,cron
3,294,995
2
true
1
0
Running a scheduled task to perform updates in your game, at any interval, will give you a spike of heavy database use. If your game logic relies on all of those database values to be up to date at the same time (which is very likely, if you're running an interval based update), you'll have to have scheduled downtime f...
1
3
0
I am developing an online browser game, based on google maps, with Django backend, and I am getting close to the point where I need to make a decision on how to implement the (backend) timed events - i.e. NPC possession quantity raising (e.g. city population should grow based on some variables - city size, application ...
Browser-based MMO best-practice
1.2
0
1
770
3,294,850
2010-07-20T22:17:00.000
0
0
1
0
python,python-2.7,pyscripter
10,901,899
4
false
0
0
I have a somewhat old version of PyScripter installed, v2.4.1.0, and it works with the Python 2.7.3 I also have installed.
3
1
0
How to run PyScripter if you have Python 2.7 installed? There is a command line parameter for Pyscipter to tell it which pythonXX.dll to use, but I can't get this working.
PyScripter for Python 2.7
0
0
0
11,652
3,294,850
2010-07-20T22:17:00.000
1
0
1
0
python,python-2.7,pyscripter
15,868,418
4
false
0
0
I know this is an old question, but searching led me here and the answers contain misinformation with regard to current version of Pyscripter. I'm pleased to say 2.5.3 works fine with Python 2.7.4 and doesn't require any command line parameters to do so.
3
1
0
How to run PyScripter if you have Python 2.7 installed? There is a command line parameter for Pyscipter to tell it which pythonXX.dll to use, but I can't get this working.
PyScripter for Python 2.7
0.049958
0
0
11,652
3,294,850
2010-07-20T22:17:00.000
1
0
1
0
python,python-2.7,pyscripter
3,490,209
4
false
0
0
Try Pyscripter v2 from pyscripter.googlecode.com
3
1
0
How to run PyScripter if you have Python 2.7 installed? There is a command line parameter for Pyscipter to tell it which pythonXX.dll to use, but I can't get this working.
PyScripter for Python 2.7
0.049958
0
0
11,652
3,295,268
2010-07-20T23:45:00.000
5
0
0
0
python,django,structure
24,850,556
3
false
1
0
Here is another way to do it: If the utility functions can be a stand-alone module and you are using a virtualenv environment for your django app then you can bundle the functionality as a package and install it in your virtualenv. This makes it easy to import where ever you need it in your django app.
1
59
0
Where should utility functions live in Django? Functions like custom encrypting/decrypting a number, sending tweets, sending email, verifying object ownership, custom input validation, etc. Repetitive and custom stuff that I use in a number of places in my app. I'm definitely breaking DRY right now. I saw some demos wh...
Where should utility functions live in Django?
0.321513
0
0
31,416
3,295,270
2010-07-20T23:46:00.000
2
0
0
0
python,button,tkinter
3,295,508
4
false
0
1
The command you are looking for is wm_protocol, giving it "WM_DELETE_WINDOW" as the protocol to bind to. It lets you define a procedure to call when the window manager closes the window (which is what happens when you click the [x]).
1
29
0
When the user presses a close Button that I created, some tasks are performed before exiting. However, if the user clicks on the [X] button in the top-right of the window to close the window, I cannot perform these tasks. How can I override what happens when the user clicks [X] button?
Overriding Tkinter "X" button control (the button that close the window)
0.099668
0
0
56,249
3,295,448
2010-07-21T00:27:00.000
2
1
0
0
python,ide
3,296,442
2
true
0
0
One way to get around this, as it seems there is no built in way is to bind a key to save the file (ctrl+s), then run the script (F2), and finally hit enter (to close the settings window and run the code).
2
5
0
I've got 2 problems with Eric4 IDE. Can't find an option in preferences to autosave my changed files before running script. It's very annoying that I have to save my file and then run script. Second problem is running a script. I can't find any button to run a script/project instantly. 'Run Script' button always opens ...
Eric4 Python IDE - autosave and quick script/project start, run
1.2
0
0
2,425
3,295,448
2010-07-21T00:27:00.000
2
1
0
0
python,ide
10,222,754
2
false
0
0
This bothered me a lot too, and I know this is 2 years late but it might help some else who comes here looking for this very solution, like I did. Here are the actual answers, ERIC v4.4: Press F4 instead of F2. The first time you have to use F2 to 'Start' the script, so dismiss the settings window. After that you can ...
2
5
0
I've got 2 problems with Eric4 IDE. Can't find an option in preferences to autosave my changed files before running script. It's very annoying that I have to save my file and then run script. Second problem is running a script. I can't find any button to run a script/project instantly. 'Run Script' button always opens ...
Eric4 Python IDE - autosave and quick script/project start, run
0.197375
0
0
2,425
3,296,268
2010-07-21T04:13:00.000
0
0
0
0
python,django,django-models,django-views
3,296,578
1
true
1
0
Text or data has no color or creed. If you have data as text, just store it in text field, if it is binary store it as a blob. It doesn't matter what that data represents, it can be richtext, pdf, a flash file etc database doesn't care.
1
0
0
If csv file has rich text in it. Using csv.reader() can the same format stored in the Mysql database using django and retrieved back to html pages? Thanks..
Rich text to be stored using django
1.2
0
0
724
3,297,110
2010-07-21T07:34:00.000
0
0
0
0
php,javascript,python,ajax,extjs
3,309,648
1
true
1
0
I would change it this way: make PHP block and wait until Python daemon finishes processing the transaction increase the timeout in the Ext.data.Connection() so it would wait until PHP responds remove the Ext.MessageBox and handle possible errors in the callback handler in Ext.data.Connection() I.e. instead of waitin...
1
1
0
I developed a system that consists of software and hardware interaction. Basically its a transaction system where the transaction details are encrypted on a PCI device then returned back to my web based system where it is stored in a DB then displayed using javascript/extjs in the browser. How I do this now is the foll...
I need help with messaging and queuing middleware systems for extjs
1.2
0
1
362
3,298,464
2010-07-21T10:59:00.000
1
0
1
0
python,python-3.x,internals
3,299,533
6
false
0
0
should I go for a top-down or a bottom-up approach? Both! Seriously.
1
57
0
I have been programming using Python for slightly more than half an year now and I am more interested in Python internals rather than using Python to develop applications. Currently I am working on porting a few libraries from Python2 to Python3. However, I have a rather abstract view on how to make port stuff over fro...
How can I learn more about Python’s internals?
0.033321
0
0
22,228
3,299,067
2010-07-21T12:18:00.000
0
1
0
0
c++,python,binding,lua,scriptable
3,299,189
5
false
0
1
My experience may not be much, but I figure it's at least worth what you paid for it ;) I've done some basic "hello world" python modules, and I couldn't really get into swig - it seemed like a lot of overhead for what I was doing. Of course it's also possible that it's just the right amount for your needs.
3
12
0
I'm confronted with the task of making a C++ app scriptable by users. The app has been in development for several years with no one wasting a thought on this before. It contains all sorts of niceties like multithreading, template wizardry and multiple inheritance. As the scripting language, Python is preferred, but Lua...
How do I make a nasty C++ program scriptable with Python and/or Lua?
0
0
0
1,926
3,299,067
2010-07-21T12:18:00.000
0
1
0
0
c++,python,binding,lua,scriptable
3,299,415
5
false
0
1
Try Boost::Python, it has somewhat of a learning curve associated with it but it is the best tool for the job in my view, we have a huge real time system and developed the scripting library for the QA in Boost::Python.
3
12
0
I'm confronted with the task of making a C++ app scriptable by users. The app has been in development for several years with no one wasting a thought on this before. It contains all sorts of niceties like multithreading, template wizardry and multiple inheritance. As the scripting language, Python is preferred, but Lua...
How do I make a nasty C++ program scriptable with Python and/or Lua?
0
0
0
1,926
3,299,067
2010-07-21T12:18:00.000
12
1
0
0
c++,python,binding,lua,scriptable
3,299,174
5
false
0
1
I wouldn't recommend swig as it's hard to get it to generate satisfactory binding in complex situations: been there, done that. I had to write a horrible script that "parsed" the original C++ code to generate some acceptable C++ code that swig could chew and generate acceptable bindings. So, in general: avoid ANY sol...
3
12
0
I'm confronted with the task of making a C++ app scriptable by users. The app has been in development for several years with no one wasting a thought on this before. It contains all sorts of niceties like multithreading, template wizardry and multiple inheritance. As the scripting language, Python is preferred, but Lua...
How do I make a nasty C++ program scriptable with Python and/or Lua?
1
0
0
1,926
3,300,182
2010-07-21T14:15:00.000
0
0
1
0
python,pyqt
10,767,981
5
false
0
1
you need to see the orginal pyqt Examples you need time for practice you get Experience you must specify a goal and start Researching about it.
1
12
0
For a college project, I need to implement a GUI for a console app I wrote. For this I decided to use PyQt. I need only basic functionalities, such as designing a simple form with basic elements and displaying some texts on it. Can anyone point me to a nice tutorial for learning PyQt? I really don't want to get into th...
Learning PyQt Quickly
0
0
0
9,748
3,300,665
2010-07-21T14:59:00.000
8
0
1
0
python,python-idle
3,301,128
1
true
0
0
start IDLE open eggs, open ham set desired breakpoints in both files go to IDLE's shell, select Debug=>Debugger go back to eggs and to run. You should stop at break points in each file. (It works, I just tested it.)
1
5
0
If I edit two modules, eggs and ham, and module eggs imports ham, how do I run module eggs such that IDLE stops at breakpoints set in ham? So far, I have only been able to get IDLE to recognize breakpoints set in the module actually being run, not those being imported.
How do I set a breakpoint in a module other than the one I am running in Python IDLE?
1.2
0
0
5,900
3,300,903
2010-07-21T15:21:00.000
1
1
0
0
python,eclipse,pydev
8,374,480
3
false
1
0
It seems like some sort of cache issue in PyDev... in which case you could try to remove the interpreter, add it again and restart Eclipse.
3
2
0
I've installed pydev to my eclipse 3.5.2. Everything was working smoothly, create projects, execute, test, autocomplete. But then I realized that importing modules from /usr/lib/pymodules/python2.6, such as django, causes error "Unresolved import: xxxx". Of course, PYTHONPATH SYSTEM includes the directories I want. Wha...
Pydev, eclipse and pythonpath problem
0.066568
0
0
9,880
3,300,903
2010-07-21T15:21:00.000
1
1
0
0
python,eclipse,pydev
3,459,938
3
true
1
0
If you're using virtualenv you should setup an interpreter using the python build inside. ie., default python interpreter for th project will be /usr/bin/python but change it to something like "{project name} python" and point it to your virtual env path. In my case it's ~/.virtualenvs/acme/bin/python
3
2
0
I've installed pydev to my eclipse 3.5.2. Everything was working smoothly, create projects, execute, test, autocomplete. But then I realized that importing modules from /usr/lib/pymodules/python2.6, such as django, causes error "Unresolved import: xxxx". Of course, PYTHONPATH SYSTEM includes the directories I want. Wha...
Pydev, eclipse and pythonpath problem
1.2
0
0
9,880
3,300,903
2010-07-21T15:21:00.000
2
1
0
0
python,eclipse,pydev
32,353,403
3
false
1
0
In eclipse you can add django folder in you python path. Window->Preferences-> PyDev-> Interpreters->Python Interpreter -> Lirararies -> New Folder And browse till the parent folder of modules you are searching.
3
2
0
I've installed pydev to my eclipse 3.5.2. Everything was working smoothly, create projects, execute, test, autocomplete. But then I realized that importing modules from /usr/lib/pymodules/python2.6, such as django, causes error "Unresolved import: xxxx". Of course, PYTHONPATH SYSTEM includes the directories I want. Wha...
Pydev, eclipse and pythonpath problem
0.132549
0
0
9,880
3,305,250
2010-07-22T01:58:00.000
10
0
0
0
python,http,urllib,httplib
3,305,508
6
false
0
0
urllib/urllib2 is built on top of httplib. It offers more features than writing to httplib directly. however, httplib gives you finer control over the underlying connections.
3
56
0
When would someone use httplib and when urllib? What are the differences? I think I ready urllib uses httplib, I am planning to make an app that will need to make http request and so far I only used httplib.HTTPConnection in python for requests, and reading about urllib I see I can use that for request too, so whats th...
Python urllib vs httplib?
1
0
1
42,140
3,305,250
2010-07-22T01:58:00.000
6
0
0
0
python,http,urllib,httplib
3,305,339
6
false
0
0
If you're dealing solely with http/https and need access to HTTP specific stuff, use httplib. For all other cases, use urllib2.
3
56
0
When would someone use httplib and when urllib? What are the differences? I think I ready urllib uses httplib, I am planning to make an app that will need to make http request and so far I only used httplib.HTTPConnection in python for requests, and reading about urllib I see I can use that for request too, so whats th...
Python urllib vs httplib?
1
0
1
42,140
3,305,250
2010-07-22T01:58:00.000
46
0
0
0
python,http,urllib,httplib
3,305,261
6
true
0
0
urllib (particularly urllib2) handles many things by default or has appropriate libs to do so. For example, urllib2 will follow redirects automatically and you can use cookiejar to handle login scripts. These are all things you'd have to code yourself if you were using httplib.
3
56
0
When would someone use httplib and when urllib? What are the differences? I think I ready urllib uses httplib, I am planning to make an app that will need to make http request and so far I only used httplib.HTTPConnection in python for requests, and reading about urllib I see I can use that for request too, so whats th...
Python urllib vs httplib?
1.2
0
1
42,140
3,305,787
2010-07-22T04:30:00.000
0
0
0
1
python,windows,home-directory
3,309,135
4
false
0
0
This seems to be only applicable to the current user, but on my (winxp) machine, os.path.expanduser('~') returns my home directory.
1
8
0
The Python pwd module provides access to getpwnam(3) POSIX API, which can be used to get the home directory for a particular user by username, as well determining if the username is valid at all. pwd.getpwnam will raise an exception if called with a non-existent username. At first it seems like the same result can be ...
What is the Windows equivalent of pwd.getpwnam(username).pw_dir?
0
0
0
6,669
3,306,518
2010-07-22T07:07:00.000
13
1
0
1
python,arguments,shebang
3,306,575
9
false
0
0
Passing arguments to the shebang line is not standard and in as you have experimented do not work in combination with env in Linux. The solution with bash is to use the builtin command "set" to set the required options. I think you can do the same to set unbuffered output of stdin with a python command. my2c
2
90
0
I needed to have a directly executable python script, so i started the file with #!/usr/bin/env python. However, I also need unbuffered output, so i tried #!/usr/bin/env python -u, but that fails with python -u: no such file or directory. I found out that #/usr/bin/python -u works, but I need it to get the python in PA...
Cannot pass an argument to python with "#!/usr/bin/env python"
1
0
0
27,298
3,306,518
2010-07-22T07:07:00.000
17
1
0
1
python,arguments,shebang
8,921,497
9
false
0
0
When you use shebang on Linux, the entire rest of the line after the interpreter name is interpreted as a single argument. The python -u gets passed to env as if you'd typed: /usr/bin/env 'python -u'. The /usr/bin/env searches for a binary called python -u, which there isn't one.
2
90
0
I needed to have a directly executable python script, so i started the file with #!/usr/bin/env python. However, I also need unbuffered output, so i tried #!/usr/bin/env python -u, but that fails with python -u: no such file or directory. I found out that #/usr/bin/python -u works, but I need it to get the python in PA...
Cannot pass an argument to python with "#!/usr/bin/env python"
1
0
0
27,298
3,307,083
2010-07-22T08:38:00.000
0
0
1
0
python,macos,python-3.x
5,049,583
1
false
0
1
py2app claims to support Python 3, so you should be able to use it.
1
1
0
for python2.x py2app will do the work. But for python3 code which one is alternate to go ahead? Or is there any other way to get single .app file?
How to convert python3-pyqt code into .app file for mac os x?
0
0
0
231
3,307,813
2010-07-22T10:20:00.000
2
0
0
0
python
3,683,128
1
true
0
1
Tools\buildbot\external.bat must be run from py3k root, not from Tools\buildbot\ subdir as you did. Also to build release version of python with Tkinter support you have to edit or copy Tools\buildbot\external.bat to remove DEBUG=1 so it can build tclXY.dll/tkXY.dll (without -g suffix).
1
1
0
When I compiled Python using PCBuild\build.bat I discovered that several Python external projects like ssl, bz2, ... were not compiled because the compiler did not find them. I did run the Tools\Buildbot\external.bat and it did download them inside \Tools\ but it looks that the build is not looking for them in this lo...
How to compile Python with all externals under Windows?
1.2
0
0
872
3,307,966
2010-07-22T10:45:00.000
26
0
1
0
python,pyinstaller,cx-freeze
3,368,456
2
false
0
1
I tried both for a current project and decided to use cx_freeze. I found it easier to get started. It has an option to bundle dependencies in a zip archive, which makes it easy to check that everything was properly included. I had trouble getting PyInstaller to include certain egg dependencies. It couldn't handle condi...
1
37
0
Could someone tell me which is better of the two for bundling Python applications — cx_Freeze or PyInstaller? I'm looking for a comparison based on factors such as: Popularity (i.e. larger user base) Footprint of the built binary Cross platform compatibility Ease of use
Which is better - PyInstaller or cx_Freeze?
1
0
0
20,447
3,309,695
2010-07-22T14:05:00.000
3
0
0
1
python,google-app-engine,feedparser
3,309,766
3
false
1
0
It is not possible to get the 'final' URL by parsing, in order to resolve it, you would need to at least perform an HTTP HEAD operation
2
1
0
i am using google app engine for fetching the feed url bur few of the urls are 301 redirect i want to get the final url which returns me the result i am usign the universal feed reader for parsing the url is there any way or any function which can give me the final url.
how to get final redirected url
0.197375
0
1
1,704
3,309,695
2010-07-22T14:05:00.000
0
0
0
1
python,google-app-engine,feedparser
3,309,853
3
false
1
0
You can do this by handling redirects manually. When calling fetch, pass in follow_redirects=False. If your response object's HTTP status is a redirect code, either 301 or 302, grab the Location response header and fetch again until the HTTP status is something else. Add a sanity check (perhaps 5 redirects max) to avoi...
2
1
0
i am using google app engine for fetching the feed url bur few of the urls are 301 redirect i want to get the final url which returns me the result i am usign the universal feed reader for parsing the url is there any way or any function which can give me the final url.
how to get final redirected url
0
0
1
1,704
3,309,957
2010-07-22T14:29:00.000
0
0
0
0
python,image,sqlite,blob,pysqlite
3,310,034
4
false
0
0
It's never a good idea to record raw types in databases. Couldn't you just save the file on the filesystem, and record the path to it in database?
2
8
0
I need to save an image file into sqlite database in python. I could not find a solution. How can I do it? Thanks in advance.
pysqlite - how to save images
0
1
0
15,288
3,309,957
2010-07-22T14:29:00.000
11
0
0
0
python,image,sqlite,blob,pysqlite
3,310,995
4
true
0
0
write - cursor.execute('insert into File (id, name, bin) values (?,?,?)', (id, name, sqlite3.Binary(file.read()))) read - file = cursor.execute('select bin from File where id=?', (id,)).fetchone() if you need to return bin data in web app - return cStringIO.StringIO(file['bin'])
2
8
0
I need to save an image file into sqlite database in python. I could not find a solution. How can I do it? Thanks in advance.
pysqlite - how to save images
1.2
1
0
15,288
3,311,255
2010-07-22T16:49:00.000
5
0
1
0
python,logging
3,311,510
5
true
0
0
logging.config.fileConfig('some.log') is going to try to read logging configuration from some.log. I don't believe there is a general way to retrieve the destination file -- it isn't always guaranteed to even be going to a file. (It may go to syslog, over the network, etc.)
1
12
0
Is there a way to do this? If logging.config.fileConfig('some.log') is the setter, what's the getter? Just curious if this exists.
How to get file the Python logging module is currently logging to?
1.2
0
0
16,139
3,311,480
2010-07-22T17:13:00.000
0
0
1
0
python,priority-queue,task-queue
3,311,615
3
false
0
0
You can do this by adding a dict object to the class, and search it inside.
1
0
0
I would like to build a priority queue in python in which the queue contains different dictionaries with their priority numbers. So when a "get function" is called, the dictionary with the highest priority(lowest number) will be pulled out of the queue and when "add function" is called, the new dictionary will be added...
Creating a python priority Queue
0
0
0
6,532
3,311,622
2010-07-22T17:28:00.000
1
0
1
0
python,twisted,deferred
3,313,676
1
true
0
0
It blocks until the Deferred fires. If you want it to unblock, fire the Deferred. If you're stopping your application and stopping the reactor, then you might want to fire the Deferred before you do that. You probably want to fire it with a Failure since presumably you haven't been able to come up with a successful ...
1
1
0
it seems threads.blockingCallFromThread keeps blocking even when the reactor stops. is there any way to un-block it? the deferred that it is blocking on relies on an RPC coming from the other end, and that definitely won't come in with the reactor stopped.
twisted, unblock a threads.blockingCallFromThread when the reactor stops
1.2
0
0
678
3,311,973
2010-07-22T18:13:00.000
4
0
0
0
python,django,url,reverse
3,312,255
1
true
1
0
The problem will be in whatever regex you are using in your urls.py to match feed_user. Presumably you are using something like r'(?P<username>\w+)/$', which only matches on alphanumeric characters and doesn't match on punctuation. Instead, use this: r'(?P<username>[\w.]+)/$'
1
2
0
I didn't expect this to occur [since I didn't know when django changed to allow _ and . in usernames], but when I attempt {% url feed_user entry.username %} I will get a 500 error when the username contains a '.' In this case rob.e as a username will fail. Any ideas how to deal with this?
django URL reverse: When URL reversig a username it fails when username has a '.' literal in it
1.2
0
0
216
3,314,598
2010-07-23T00:43:00.000
5
0
0
0
python,gimp
3,314,736
1
true
0
0
Nevermind, got it. It's layer.offsets (property) for future reference. :)
1
2
0
i'm coding in python-fu and i need to get the layer position relative to the image (eg. the layer starts at x=35, y=50) Is this possible? I haven't found anything in the gimp pdb docs
GIMP get layer position relative to the image
1.2
0
0
2,323
3,315,346
2010-07-23T04:12:00.000
0
0
1
0
python
3,315,907
3
false
0
0
Don't get confused. In python single quotes and double quotes are same. The creates an string object.
2
1
0
Thanks in advance for your help. When entering "example" at the command line, Python returns 'example'. I can not find anything on the web to explain this. All reference materials speaks to strings in the context of the print command, and I get all of the material about using double quotes, singles quotes, triple quot...
Python Command Line "characters" returns 'characters'
0
0
0
389
3,315,346
2010-07-23T04:12:00.000
1
0
1
0
python
3,315,372
3
false
0
0
In python, single quotes and double quotes are semantically the same. It struck me as strange at first, since in C++ and other strongly-typed languages single quotes are a char and doubles are a string. Just get used to the fact that python doesn't care about types, and so there's no special syntax for marking a string...
2
1
0
Thanks in advance for your help. When entering "example" at the command line, Python returns 'example'. I can not find anything on the web to explain this. All reference materials speaks to strings in the context of the print command, and I get all of the material about using double quotes, singles quotes, triple quot...
Python Command Line "characters" returns 'characters'
0.066568
0
0
389
3,319,261
2010-07-23T14:46:00.000
3
1
1
0
php,python
3,323,632
8
false
0
0
I run a self-developed private social site for 100+ users. Python was absolutely fantastic for making and running this. did you have more fun with python? Most definitely. are you as productive as when you're using PHP? Mostly yes. Python coding style, at least for me is so much quicker and easier. But python d...
6
21
0
I'm planning on moving to Python and I have a couple of additional questions along with the title: did you have more fun with python? are you as productive as when you're using PHP? what made you change to python? Would you do a project again in PHP? If so, why? Your answers would really be useful for us PHP devs wan...
PHP devs that moved to Python, is the experience better?
0.07486
0
0
9,531
3,319,261
2010-07-23T14:46:00.000
4
1
1
0
php,python
3,319,941
8
false
0
0
I'll try my best to answer your questions as best I can: Did you have more fun with python? I really enjoy how minimalist python is, having modules with non-redundant naming conventions is really nice. I found this to be especially convenient when reading/debugging other peoples code. I also love all of the python...
6
21
0
I'm planning on moving to Python and I have a couple of additional questions along with the title: did you have more fun with python? are you as productive as when you're using PHP? what made you change to python? Would you do a project again in PHP? If so, why? Your answers would really be useful for us PHP devs wan...
PHP devs that moved to Python, is the experience better?
0.099668
0
0
9,531
3,319,261
2010-07-23T14:46:00.000
1
1
1
0
php,python
3,319,485
8
false
0
0
I've never really worked with PHP (nothing major) and come from the .NET world. The project I am currently on requires a lot of Python work and I must say I love it. Very easy and "cool" language, ie. FUN! .NET will always be my wife but Python is my mistress ;)
6
21
0
I'm planning on moving to Python and I have a couple of additional questions along with the title: did you have more fun with python? are you as productive as when you're using PHP? what made you change to python? Would you do a project again in PHP? If so, why? Your answers would really be useful for us PHP devs wan...
PHP devs that moved to Python, is the experience better?
0.024995
0
0
9,531
3,319,261
2010-07-23T14:46:00.000
1
1
1
0
php,python
3,319,291
8
false
0
0
yes yes curiosity, search for better languages, etc. (actually, I learned them somewhat in parallel many years ago) yes, if a project requires it explicitly disclaimer: I never really moved from php.
6
21
0
I'm planning on moving to Python and I have a couple of additional questions along with the title: did you have more fun with python? are you as productive as when you're using PHP? what made you change to python? Would you do a project again in PHP? If so, why? Your answers would really be useful for us PHP devs wan...
PHP devs that moved to Python, is the experience better?
0.024995
0
0
9,531
3,319,261
2010-07-23T14:46:00.000
3
1
1
0
php,python
3,319,318
8
false
0
0
Well, I started with PHP, and have delved into Python recently. I wouldn't say that I've "moved to", but I do use both (still PHP more, but a fair bit of Python as well). I wouldn't say that I have more "fun" with Python. There are a lot of really cool and easy things that I really wish I could take to PHP. So I gue...
6
21
0
I'm planning on moving to Python and I have a couple of additional questions along with the title: did you have more fun with python? are you as productive as when you're using PHP? what made you change to python? Would you do a project again in PHP? If so, why? Your answers would really be useful for us PHP devs wan...
PHP devs that moved to Python, is the experience better?
0.07486
0
0
9,531
3,319,261
2010-07-23T14:46:00.000
1
1
1
0
php,python
3,325,047
8
false
0
0
did you have more fun with python? Yes. Lot more. are you as productive as when you're using PHP? No. I think more. what made you change to python? Django. Would you do a project again in PHP? If so, why? Only if it is required.
6
21
0
I'm planning on moving to Python and I have a couple of additional questions along with the title: did you have more fun with python? are you as productive as when you're using PHP? what made you change to python? Would you do a project again in PHP? If so, why? Your answers would really be useful for us PHP devs wan...
PHP devs that moved to Python, is the experience better?
0.024995
0
0
9,531
3,319,890
2010-07-23T15:51:00.000
2
0
0
0
python,django
3,320,111
2
false
1
0
Mozilla is currently rewriting two of our largest sites on Django. These are both fairly complex applications that interact with numerous online and offline services. With Python's large collection of libraries, anything Django doesn't do itself we've usually been able to find, or create pretty easily. For example, we ...
1
1
0
I'm tasked to create a simple CRUD MVC application, and I thought it's a good opportunity to learn python. Because of its great documentation, I'm thinking now that I'll go with Django. Now, this simple CRUD MVC application could become quite complicated in the future. I might have receive and issue JMS messages, dis...
How complicate can a Django application go?
0.197375
0
0
399
3,320,374
2010-07-23T16:43:00.000
2
0
1
0
python,datetime
3,320,438
1
false
0
0
I'd use the DB's native datetime format rather than this "9-tuple" format. It'll make queries easier, and it's probably more space-efficient too. Shouldn't be too hard to convert from that back into a Python datetime object. You can use the dateutil module if you're having trouble. I think you're right about keeping a ...
1
1
0
In a side project I have to manage, compare and display dates from different formats. What's the best design strategy to follow? I planned: All dates are parsed according their format and stored in the db in 9-tuple python format using UTC When I have to do calculations and compares I transform 9-tuple in date...
Dealing with dates and timezones in a python project
0.379949
0
0
179
3,320,514
2010-07-23T16:58:00.000
13
0
1
0
python,multithreading,locking,mutex
3,320,532
1
true
0
0
Locks of any nature would be rather useless if they weren't atomic - the whole point of the lock is to allow for higher-level atomic operations. All of threading's synchronization objects (locks, rlocks, semaphores, boundedsemaphores) utilize atomic instructions, as do mutexes. You should use threading, since mutex is ...
1
8
0
My main question is does the Threading lock object create atomic locks? It doesn't say that the lock is atomic in the module documentation. in pythons mutex documentation it does say the mutex lock is atomic but it seems that I read somewhere that in fact it isn't. I am wondering if someone could could give me a bit of...
Mutex locks vs Threading locks. Which to use?
1.2
0
0
8,474
3,322,052
2010-07-23T20:19:00.000
3
0
0
0
python,django,apache,django-admin,deployment
3,322,601
2
false
1
0
Set DEBUG = True so that you can see the Django traceback
2
1
0
Im getting 500 internal server error everytime I try access my admin or login page. There's nothing in my error.log Any ideas ?
Internal Server Error on Django Deploy
0.291313
0
0
2,142
3,322,052
2010-07-23T20:19:00.000
3
0
0
0
python,django,apache,django-admin,deployment
3,391,645
2
true
1
0
My DEBUG was set True. I found the error on my apache_log. The problem was that my sqlite3 database was a read only file.
2
1
0
Im getting 500 internal server error everytime I try access my admin or login page. There's nothing in my error.log Any ideas ?
Internal Server Error on Django Deploy
1.2
0
0
2,142
3,322,272
2010-07-23T20:54:00.000
1
0
1
0
python,syntax-error
14,853,274
3
false
0
0
If you are using math functions a lot and the three parameter version of pow infrequently a way around this in python 2.7 is to import __builtin__ and call __builtin__.pow for the 3 paramete
2
11
0
Why is python telling me "TypeError: pow expected 2 arguments, got 3" despite it working in IDLE (sometimes it tells me that in IDLE as well)? im simply doing pow(a,b,c). my program is very short and i do not change the definition of pow at any time since i need to use it for some exponentiation. NOTE: This is the pow ...
Why is Python saying pow only has 2 arguments
0.066568
0
0
10,488
3,322,272
2010-07-23T20:54:00.000
19
0
1
0
python,syntax-error
3,322,334
3
true
0
0
Built-in pow takes two or three arguments. If you do from math import * then it is replaced by math's pow, which takes only two arguments. My recommendation is to do import math, or explicitly list functions you use in import list. Similar issue happens with open vs. os.open.
2
11
0
Why is python telling me "TypeError: pow expected 2 arguments, got 3" despite it working in IDLE (sometimes it tells me that in IDLE as well)? im simply doing pow(a,b,c). my program is very short and i do not change the definition of pow at any time since i need to use it for some exponentiation. NOTE: This is the pow ...
Why is Python saying pow only has 2 arguments
1.2
0
0
10,488
3,323,139
2010-07-23T23:43:00.000
1
0
0
0
python,django,frameworks,turbogears
3,323,179
1
true
1
0
The latter: build a model with a one to one relationship to the User. Don't modify the django one directly or you'll likely run into trouble sooner or later. The django team won't be taking your changes into account after all and you could be adversely impacted if any internal changes are made. (Though you needn't w...
1
0
0
I am new to using Frameworks for web development and I have noticed that frameworks like django, turbogears etc come with auth packages which contains user models. Am I supposed to directly modify these and use them as my User models or am I supposed to associate my own user models to these and use them just for authen...
Am I supposed to directly modify User models in auth modules in frameworks?
1.2
0
0
56
3,324,108
2010-07-24T06:41:00.000
6
0
0
1
python,deployment,dependency-management
4,560,558
5
false
1
0
It's good to use virtualenv to create standalone project environment and use pip/easy_install to management dependencies.
1
162
0
I'm a java developer/python beginner, and I'm missing my maven features, particularly dependency management and build automation (I mean you don't build, but how to create a package for deployment?) Is there a python equivalent to achieve these features? Note: I use python 2.x Thanks.
Maven equivalent for python
1
0
0
113,883
3,324,306
2010-07-24T07:59:00.000
6
0
1
0
python,math,puzzle
3,324,796
6
false
0
0
Here is proof that a solution exists: Assuming you ever get to 21 digit numbers, you will start losing a sticker with every DVD you purchase and label ((+20) + (-21)). It doesn't matter how many stickers you have accumulated until this point. From here on it is all downhill for your sticker stash and you will even...
1
13
0
I bought a blank DVD to record my favorite TV show. It came with 20 digit stickers. 2 of each of '0'-'9'. I thought it would be a good idea to numerically label my new DVD collection. I taped the '1' sticker on my first recorded DVD and put the 19 leftover stickers in a drawer. The next day I bought another blank DVD (...
Puzzle that defies the brute force approach?
1
0
0
715
3,324,490
2010-07-24T09:08:00.000
0
1
0
0
c++,python,perforce
3,324,560
1
true
0
1
Woops! Forgot I still needed to install python-dev...
1
0
0
I am compiling on Ubuntu 10.04 LTS. The Perforce Python API uses their C++ API for some of it. So, I point the setup.py at the C++'s API directory using the --apidir= they say to use. When it starts to compile the C++, I get a whole load of errors (temporary error list link is now gone). No one else has had these error...
Perforce P4Python API Bug
1.2
0
0
290
3,324,683
2010-07-24T10:16:00.000
1
1
0
0
c#,java,python
3,324,710
5
false
1
0
I kinda think this is almost more like a religious problem, than a real technical issue. For almost every programming language you can find a big website that's using it. .NET -> Microsoft Ruby -> Twitter (yes, they have a few issues, but still) PHP -> Facebook Java -> Lots of finance companies Don't know about Phyton,...
2
0
0
I have couple of ideas in my brain which I would like to bring out before it's too late. Basically I want to develop a web application which I could sell it to clients. So which technology shall I use to accomplish this? I have been a C and C++ software developer but it's been a very long time since I have developed on...
Which technology should I use to develop a high performance web application
0.039979
0
0
3,428
3,324,683
2010-07-24T10:16:00.000
6
1
0
0
c#,java,python
3,324,720
5
false
1
0
Usually the programming language doesn't really matter. All have their own strengths and weaknesses. All come up with their own best-practices and frameworks. It's really up to you what's your preference. If you are coming from Microsoft C/C++ I'd use .NET, if you are from Linux world I'd use Java. Back in the 90s Jav...
2
0
0
I have couple of ideas in my brain which I would like to bring out before it's too late. Basically I want to develop a web application which I could sell it to clients. So which technology shall I use to accomplish this? I have been a C and C++ software developer but it's been a very long time since I have developed on...
Which technology should I use to develop a high performance web application
1
0
0
3,428
3,324,788
2010-07-24T10:52:00.000
3
0
1
0
python
3,329,265
2
false
0
0
Python's internal mapping of "<" to __lt__ (and so on) isn't exposed anywhere in the standard library. There's a lot about Python's internals that aren't exposed as a toolkit. I'm not even sure in general how such a mapping would be created. What maps onto __getitem__? You'll just have to create your own mapping. I...
2
8
0
I'm building a DSL for form validation in Python, and one of the requirements is to be able to specify that a field should be greater than or less than a constant or another field value. As a result, I'm trying to easily map operators like <, >, <= and >= to their equivalent functions in the operator module, so that th...
Map comparison operators to function call
0.291313
0
0
834
3,324,788
2010-07-24T10:52:00.000
5
0
1
0
python
3,334,652
2
true
0
0
As far as I'm aware, there is no built-in dictionary mapping the string ">" to the function operator.lt, etc. As others have pointed out, the Python interpreter itself does not make use of such a dictionary, since the process of parsing and executing Python code will first translate the character sequence ">" to a toke...
2
8
0
I'm building a DSL for form validation in Python, and one of the requirements is to be able to specify that a field should be greater than or less than a constant or another field value. As a result, I'm trying to easily map operators like <, >, <= and >= to their equivalent functions in the operator module, so that th...
Map comparison operators to function call
1.2
0
0
834
3,324,870
2010-07-24T11:17:00.000
1
1
0
0
python,windows,performance,comparison
3,324,905
1
false
0
1
Pythons shutil module does not use the Windows API, but instead uses an open/read/write loop. This may or may not be slower than using CopyFile(Ex). Please measure it, everything else is just guessing.
1
0
0
Is there any difference in speed of copying files from one location to another betwen python or delphi or c++ ? I guess that all 3 laguages uses same or similar win api calls and that there is not much performance difference.
python file copying
0.197375
0
0
78
3,324,920
2010-07-24T11:33:00.000
2
1
1
0
c#,python,properties
3,325,757
3
false
0
0
If you make an attribute public in C# then later need to change it into a property you also need to recompile all code that uses the original class. This is bad, so make any public attributes into properties from day one 'just in case'. If you have an attribute that is used from other code then later need to change it ...
1
10
0
I currently work with Python for a while and I came to the point where I questioned myself whether I should use "Properties" in Python as often as in C#. In C# I've mostly created properties for the majority of my classes. It seems that properties are not that popular in python, am I wrong? How to use properties in Pyt...
Use of properties in python like in example C#
0.132549
0
0
3,192
3,325,161
2010-07-24T12:54:00.000
3
0
0
0
python,linux,repository,packaging
3,325,182
1
false
0
1
As long as the ugly hack works, use it. It will have drawbacks local to your package. Additionally, you can phase it out (significantly) later by requiring a bug-free version of your dependency, when it is released and is available for some time so that distros have a chance to start shipping it.
1
2
0
I'm a developer on a software project for Linux that uses Python and PyGTK. The program we are writing depends on a number of third-party packages that are available through all mayor distro repositories. One of these is a python binding (written in C) that allows our program to chat with a common C library. Unfortunat...
Bug in third-party dependency creates python packaging dilemma
0.53705
0
0
115
3,325,343
2010-07-24T13:47:00.000
2
1
1
0
python,oop
3,325,399
7
false
0
0
What exactly is full object oriented? Alan Kay said "Actually I made up the term "object-oriented", and I can tell you I did not have C++ in mind.". Admittedly, he probably did not have python in mind either, but it is worth noting that Smalltalk also protects classes by convention, no mandate.
5
63
0
I want to know why Python is not fully object-oriented. For example, it does not support private, public, protected access level modifiers. What are the advantages and disadvantages of this? By these expressions, Python is suitable for what applications (Desktop, Scientific, Web or other)?
Why is Python not fully object-oriented?
0.057081
0
0
80,955
3,325,343
2010-07-24T13:47:00.000
2
1
1
0
python,oop
3,325,363
7
false
0
0
I believe Python is more of a very practical, pragmatic language. Concepts which offer value to the developer are put in, without too much consideration about theological concepts like "proper OO design" and stuff. It's a language for people who have real work to do. I think Python is suitable for all kinds of environ...
5
63
0
I want to know why Python is not fully object-oriented. For example, it does not support private, public, protected access level modifiers. What are the advantages and disadvantages of this? By these expressions, Python is suitable for what applications (Desktop, Scientific, Web or other)?
Why is Python not fully object-oriented?
0.057081
0
0
80,955
3,325,343
2010-07-24T13:47:00.000
4
1
1
0
python,oop
3,325,355
7
false
0
0
I think Python is designed to be a hybrid. You can write in object oriented or functional styles. The hallmarks of object-orientation are abstraction, encapsulation, inheritance, and polymorphism. Which of these are missing from Python? Object-orientation is a continuum. We might say that Smalltalk is the purest o...
5
63
0
I want to know why Python is not fully object-oriented. For example, it does not support private, public, protected access level modifiers. What are the advantages and disadvantages of this? By these expressions, Python is suitable for what applications (Desktop, Scientific, Web or other)?
Why is Python not fully object-oriented?
0.113791
0
0
80,955
3,325,343
2010-07-24T13:47:00.000
-5
1
1
0
python,oop
4,521,644
7
false
0
0
A language is said to Full Objective Oriented if it has no primitive data types. Each data type we need to construct.
5
63
0
I want to know why Python is not fully object-oriented. For example, it does not support private, public, protected access level modifiers. What are the advantages and disadvantages of this? By these expressions, Python is suitable for what applications (Desktop, Scientific, Web or other)?
Why is Python not fully object-oriented?
-1
0
0
80,955
3,325,343
2010-07-24T13:47:00.000
100
1
1
0
python,oop
3,325,353
7
true
0
0
Python doesn't support strong encapsulation, which is only one of many features associated with the term "object-oriented". The answer is simply philosophy. Guido doesn't like hiding things, and many in the Python community agree with him.
5
63
0
I want to know why Python is not fully object-oriented. For example, it does not support private, public, protected access level modifiers. What are the advantages and disadvantages of this? By these expressions, Python is suitable for what applications (Desktop, Scientific, Web or other)?
Why is Python not fully object-oriented?
1.2
0
0
80,955
3,325,602
2010-07-24T15:12:00.000
6
0
1
1
python,c,posix,gnu,limits
3,325,616
1
true
0
0
PATH_MAX is the maximum length of a filesystem path. NAME_MAX is the maximum length of a filename (in a particular spot). So, /foo/bar is restricted by PATH_MAX, and only the bar portion has its length limited by NAME_MAX. You can get these at run time via pathconf, as _PC_PATH_MAX and _PC_NAME_MAX, although standard...
1
6
0
In limits.h, and in various places in the POSIX manpages, there are references to PATH_MAX and NAME_MAX. How do these relate to one another? Where is the official documentation for them? How can I obtain them at run time, and (where relevant) compile time for the C, Python, and GNU (shell) environments?
What is the relation between PATH_MAX and NAME_MAX, and how do I obtain?
1.2
0
0
2,365
3,325,817
2010-07-24T16:15:00.000
2
0
0
0
python,html,text,screen-scraping
3,325,874
4
false
1
0
A general solution to this problem is a non-trivial problem to solve. To put this in context, a large part of Google's success with search has come from their ability to automatically discern some semantic meaning from arbitrary Web pages, namely figuring out where the "content" is. One idea that springs to mind is if ...
1
2
0
The big mission: I am trying to get a few lines of summary of a webpage. i.e. I want to have a function that takes a URL and returns the most informative paragraph from that page. (Which would usually be the first paragraph of actual content text, in contrast to "junk text", like the navigation bar.) So I managed to re...
Python: Detecting the actual text paragraphs in a string
0.099668
0
1
2,958
3,325,906
2010-07-24T16:36:00.000
1
0
0
1
python,google-app-engine,authentication,openid
3,325,984
2
false
1
0
Not using the built in authentication support - users have to authenticate separately with each application.
1
0
0
Let's say I had a root app and multiple sub-apps. Would it be possible to share authenticated sessions across them? I'm using Google App Engine (Python).
GAE - Sharing Authentication Across Apps
0.099668
0
0
263
3,326,740
2010-07-24T20:20:00.000
0
0
1
0
python,eclipse,pydev
3,329,153
3
false
0
0
Same problem here, I am on MacOs 10.6. I tried to reinitialize the configured interpreters, it did not fix the problem. I switched between the built-in Python 2.6 and the newer 2.6.5 provided by MacPorts, this also did not fix it. Looks like it needs another update? Update: I just tried the same upgrade on Linux (this ...
2
3
0
My Eclipse 3.6 /PyDev setup just did a pydev upgrade to 1.6.0.2010071813 and debugging no longer works. My default python interpreter is 3.1 although I doubt that matters. Until the Eclipse upgrade of pydev, it was working very nicely.
pydev importerror: no module named thread, debugging no longer works after pydev upgrade
0
0
0
12,007
3,326,740
2010-07-24T20:20:00.000
1
0
1
0
python,eclipse,pydev
3,332,518
3
false
0
0
Downgrade to 1.5.9. Eclipse updates has the option to show all versions, but by default it shows only the latest version. Turn off that setting, and install 1.5.9. It works with python 3.1
2
3
0
My Eclipse 3.6 /PyDev setup just did a pydev upgrade to 1.6.0.2010071813 and debugging no longer works. My default python interpreter is 3.1 although I doubt that matters. Until the Eclipse upgrade of pydev, it was working very nicely.
pydev importerror: no module named thread, debugging no longer works after pydev upgrade
0.066568
0
0
12,007
3,327,244
2010-07-24T22:55:00.000
4
1
0
0
php,python,facebook
3,327,259
6
false
1
0
Check out the Facebook API. It will more than likely show that the wall post came from your application. As far as the language you implement in, I think you could use Python.
2
3
0
I was wondering if i could possible write an app, that could be a list of all my friends and just simply posting a message to their walls on the friends i select. Not a message, a wall post. So it appears that i went to their wall and wrote a message, they have no idea that an app is pushing the message to them. also c...
Facebook wall writing application
0.132549
0
0
1,795
3,327,244
2010-07-24T22:55:00.000
3
1
0
0
php,python,facebook
3,327,248
6
false
1
0
There are a couple of Facebook APIs that could tie in to. I'm at work and any website that makes mention of facebook is blocked so I can't provide links, but Google 'Facebook API'.
2
3
0
I was wondering if i could possible write an app, that could be a list of all my friends and just simply posting a message to their walls on the friends i select. Not a message, a wall post. So it appears that i went to their wall and wrote a message, they have no idea that an app is pushing the message to them. also c...
Facebook wall writing application
0.099668
0
0
1,795
3,327,279
2010-07-24T23:11:00.000
2
0
0
0
python,access-control
3,327,313
4
false
1
0
This problem is not really new; it's basically the general problem of authorization and access rights/control. In order to avoid having to model and maintain a complete graph of exactly what objects each user can access in each possible way, you have to make decisions (based on what your application does) about how to ...
3
2
0
This is a tricky question, we've been talking about this for a while (days) and haven't found a convincingly good solution. This is the situation: We have users and groups. A user can belong to many groups (many to many relation) There are certain parts of the site that need access control, but: There are certain ROWS...
Control access to parts of a system, but also to certain pieces of information
0.099668
1
0
214
3,327,279
2010-07-24T23:11:00.000
0
0
0
0
python,access-control
3,327,325
4
false
1
0
It's hard to be specific without knowing more about your setup and about why exactly you need different users to have different permissions on different rows. But generally, I would say that whenever you access any data in the database in your code, you should precede it by an authorization check, which examines the cu...
3
2
0
This is a tricky question, we've been talking about this for a while (days) and haven't found a convincingly good solution. This is the situation: We have users and groups. A user can belong to many groups (many to many relation) There are certain parts of the site that need access control, but: There are certain ROWS...
Control access to parts of a system, but also to certain pieces of information
0
1
0
214
3,327,279
2010-07-24T23:11:00.000
0
0
0
0
python,access-control
3,327,726
4
false
1
0
Add additional column "category" or "type" to the table(s), that will categorize the rows (or if you will, group/cluster them) - and then create a pivot table that defines the access control between (rowCategory, userGroup). So for each row, by its category you can pull which userGroups have access (and what kind of ac...
3
2
0
This is a tricky question, we've been talking about this for a while (days) and haven't found a convincingly good solution. This is the situation: We have users and groups. A user can belong to many groups (many to many relation) There are certain parts of the site that need access control, but: There are certain ROWS...
Control access to parts of a system, but also to certain pieces of information
0
1
0
214
3,327,590
2010-07-25T01:12:00.000
2
0
0
0
python,django,django-cms
3,356,666
1
false
1
0
Sounds like you need to modify your urls.py, not your settings or middleware.
1
2
0
hey guys, im trying to internationalize my site, so i have the django cms multilingual middleware class in my settings.py , when viewed from brasil, the url changes to www.ashtangayogavideo.com/pt/ash/homepage/ resulting in a 404, because my site is in www.ashtangayogavideo.com/ash/en/homepage, how can i configure the ...
How to modify django cms multilingual middleware
0.379949
0
0
444
3,327,799
2010-07-25T02:49:00.000
2
0
0
0
python,radio-button,toggle,tkinter
3,327,963
2
true
0
1
Use a checkbutton with "indicatoron" set to False. This will turn off the little checkbox so you only see the image (or text), and the relief will toggle between raised and sunken each time it is clicked. Another way is to use a label widget and manage the button clicks yourself. Add a binding for <1> and change the r...
1
0
0
I know how to make an image a button in Tkinter, now how do I make th image a toggle button similar to a radio button?
Making a Toggle Button with an image in Tkinter
1.2
0
0
1,795
3,328,059
2010-07-25T04:49:00.000
3
0
1
1
python,twisted
3,328,795
1
false
0
0
You must use Range HTTP header: Range. Request only part of an entity. Bytes are numbered from 0. Range: bytes=500-999 Ie. If you want download 1000 file in 4 parts, you will starts 4 downloads: 0-2499 2500-4999 5000-7499 7500-9999 And then simply join data from responses. To check file size you can use HEAD...
1
2
0
How do you create multiple HTTPDownloader instance with partial download asynchronously? and does it assemble the file automatically after all download is done?
How to create partial download in twisted?
0.53705
0
0
597
3,328,241
2010-07-25T06:03:00.000
0
0
0
0
python,gtk,pygtk
8,647,405
1
false
0
1
(Friendly reminder, please stop putting answers in the comments, people.) To summarize: It depends on the size of the TextView, size of the window, size of the font, and as Alex Martelli said, the particular font and the usage of letters..."i" is a narrow letter, "m" is a wide letter, thus you can fit more "i"s than yo...
1
0
0
I have a gtk TextView in a maximized window and I want to know how many characters a line can fit before you have to scroll.
Get the length in characters of a PyGTK TextView
0
0
0
214
3,328,315
2010-07-25T06:40:00.000
1
1
0
0
python,irc
3,329,252
5
false
0
0
Again, this is an utterly personal suggestion, but I would really like to see eggdrop rewritten in Python. Such a project could use Twisted to provide the base IRC interaction, but would then need to support add-on scripts. This would be great for allowing easy IRC bot functionality to be built upon using python, inste...
4
4
0
I'm learning Python and would like to start a small project. It seems that making IRC bots is a popular project amongst beginners so I thought I would implement one. Obviously, there are core functionalities like being able to connect to a server and join a channel but what are some good functionalities that are usuall...
IRC bot functionalities
0.039979
0
1
3,546
3,328,315
2010-07-25T06:40:00.000
0
1
0
0
python,irc
3,328,343
5
false
0
0
That is very subjective and totally depends upon where the bot will be used. I'm sure others will have nice suggestions. But whatever you do, please do not query users arbitrarily. And do not spam the main chat periodically.
4
4
0
I'm learning Python and would like to start a small project. It seems that making IRC bots is a popular project amongst beginners so I thought I would implement one. Obviously, there are core functionalities like being able to connect to a server and join a channel but what are some good functionalities that are usuall...
IRC bot functionalities
0
0
1
3,546
3,328,315
2010-07-25T06:40:00.000
1
1
0
0
python,irc
3,328,322
5
false
0
0
I'm also in the process of writing a bot in node.js. Here are some of my goals/functions: map '@' command so the bot detects the last URI in message history and uses the w3 html validation service setup a trivia game by invoking !ask, asks a question with 3 hints, have the ability to load custom questions based on cat...
4
4
0
I'm learning Python and would like to start a small project. It seems that making IRC bots is a popular project amongst beginners so I thought I would implement one. Obviously, there are core functionalities like being able to connect to a server and join a channel but what are some good functionalities that are usuall...
IRC bot functionalities
0.039979
0
1
3,546
3,328,315
2010-07-25T06:40:00.000
0
1
0
0
python,irc
3,328,376
5
false
0
0
Make a google search to get a library that implements IRC protocol for you. That way you only need to add the features, those are already something enough to bother you. Common functions: Conduct a search from a wiki or google Notify people on project/issue updates Leave a message Toy for spamming the channel Pick a t...
4
4
0
I'm learning Python and would like to start a small project. It seems that making IRC bots is a popular project amongst beginners so I thought I would implement one. Obviously, there are core functionalities like being able to connect to a server and join a channel but what are some good functionalities that are usuall...
IRC bot functionalities
0
0
1
3,546
3,329,165
2010-07-25T12:21:00.000
2
0
0
1
python,linux,io,monitoring
3,329,904
4
false
0
0
What's wrong with just periodically reading /proc/diskstats, e.g. using sched to repeat the operation every minute or whatever? Linux's procfs is nice exactly because it provides a textual way for the kernel to supply info to userland programs, as text is easiest to read and use in a huge variety of languages...!
1
5
0
I would like to monitor system IO load from a python program, accessing statistics similar to those provided in /proc/diskstats in linux (although obviously a cross-platform library would be great). Is there an existing python library that I could use to query disk IO statistics on linux?
Python library for monitoring /proc/diskstats?
0.099668
0
0
5,882
3,329,762
2010-07-25T15:30:00.000
2
0
0
0
python,wxpython,wxwidgets
3,345,554
3
false
0
1
Here are a few of the most popular wxPython related GUI builders: Boa Constructor (mostly dead) wxGlade wxFormBuilder XRCed wxDesigner (not FOSS) Dabo - one of their videos shows a way to interactively design an app... I personally just use a Python IDE to hand code my applications. My current favorite IDE is Wing...
2
2
0
What are the usable tools? I am aware of wxformbuilder and wxGlade, but none of them seems to be complete yet.
What are the existing open-source Python WxWidgets designers?
0.132549
0
0
831