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
397,337
2008-12-29T08:41:00.000
0
0
0
0
python,scripting,wxpython,wxwidgets,maya
30,247,511
3
false
0
1
The best way to go is creating a QWidget with what you need, and using it from within a MPxCommand thru the C++ API. That way you also have the chance to inject complete custom editors into Maya via scriptedPanels. But if you're bound to Python, pyQt is the way to go.
2
8
0
I develop tools in Autodesk Maya. Many of the tools I build have simple windowed GUIs for the animators and modellers to use. These GUIs often contain what you'd normally expect to see in any basic window; labels, lists, menus, buttons, textfields, etc. However, there are limitations to the complexity of the UIs you...
Using external GUI libraries to make user interfaces in Autodesk Maya
0
0
0
3,503
397,337
2008-12-29T08:41:00.000
0
0
0
0
python,scripting,wxpython,wxwidgets,maya
398,469
3
false
0
1
I don't know if there is a way around a mainloop for the gui, since it is needed to handle all event chains and redraw queues. But there are several means of inter-process communication, like pipes or semaphores. Maybe it is an option to split your Maya extension into the actual plugin, being tight into maya, and a se...
2
8
0
I develop tools in Autodesk Maya. Many of the tools I build have simple windowed GUIs for the animators and modellers to use. These GUIs often contain what you'd normally expect to see in any basic window; labels, lists, menus, buttons, textfields, etc. However, there are limitations to the complexity of the UIs you...
Using external GUI libraries to make user interfaces in Autodesk Maya
0
0
0
3,503
399,326
2008-12-30T01:57:00.000
0
0
1
0
python,python-3.x,tix
400,066
3
false
0
0
Generally speaking, if you're using third-party modules, you're better off avoiding Python 3.0 for now. If you're working on a third-party module yourself, porting forward to Python 3.0 is a good idea, but for the time being general development in it is just going to be a recipe for pain.
1
0
0
Has anyone seen anything in Tix work under python 3.0? I've tried to work through the examples but when creating anything it states that cnf is unsubscriptable. I also noticed that none of the Dir Select stuff (DirList DirTree) works under 2.6.1. Why doesn't Python either dump Tix or support it? Its got a lot of good...
Tix and Python 3.0
0
0
0
1,490
399,980
2008-12-30T10:48:00.000
3
0
0
0
python,xml,minidom
400,669
3
false
0
0
It should be noted that while HTML looks like XML it is not XML. XHTML is an XML form of HTML.
1
6
0
I am using XML minidom (xml.dom.minidom) in Python, but any error in the XML will kill the parser. Is it possible to ignore them, like a browser for example? I am trying to write a browser in Python, but it just throws an exception if the tags aren't fully compatible.
Ignoring XML errors in Python
0.197375
0
1
4,564
400,050
2008-12-30T11:22:00.000
2
0
1
0
python
400,060
6
false
0
0
If you are receiving an expression as a string you'll need to parse it into its operators and operands and then process the resulting tree. This isn't a python problem per se. but a general issue of how to deal with mathematical expressions delivered as strings. A quick google reveals a bunch of lexical parsers for py...
1
5
0
Using Python, how would I go about reading in (be from a string, file or url) a mathematical expression (1 + 1 is a good start) and executing it? Aside from grabbing a string, file or url I have no idea of where to start with this.
Reading and running a mathematical expression in Python
0.066568
0
0
4,016
401,215
2008-12-30T19:30:00.000
1
0
1
0
python,web-services,rate-limiting
401,826
6
false
1
0
SO I am assuming something simple like import time time.sleep(2) will not work for waiting 2 seconds between requests
3
18
0
I'm working on a Python library that interfaces with a web service API. Like many web services I've encountered, this one requests limiting the rate of requests. I would like to provide an optional parameter, limit, to the class instantiation that, if provided, will hold outgoing requests until the number of seconds sp...
How to limit rate of requests to web services in Python?
0.033321
0
1
17,294
401,215
2008-12-30T19:30:00.000
1
0
1
0
python,web-services,rate-limiting
401,332
6
false
1
0
Your rate limiting scheme should be heavily influenced by the calling conventions of the underlying code (syncronous or async), as well as what scope (thread, process, machine, cluster?) this rate-limiting will operate at. I would suggest keeping all the variables within the instance, so you can easily implement multip...
3
18
0
I'm working on a Python library that interfaces with a web service API. Like many web services I've encountered, this one requests limiting the rate of requests. I would like to provide an optional parameter, limit, to the class instantiation that, if provided, will hold outgoing requests until the number of seconds sp...
How to limit rate of requests to web services in Python?
0.033321
0
1
17,294
401,215
2008-12-30T19:30:00.000
2
0
1
0
python,web-services,rate-limiting
401,390
6
false
1
0
Queuing may be overly complicated. A simpler solution is to give your class a variable for the time the service was last called. Whenever the service is called (!1), set waitTime to delay - Now + lastcalltime. delay should be equal to the minimum allowable time between requests. If this number is positive, sleep fo...
3
18
0
I'm working on a Python library that interfaces with a web service API. Like many web services I've encountered, this one requests limiting the rate of requests. I would like to provide an optional parameter, limit, to the class instantiation that, if provided, will hold outgoing requests until the number of seconds sp...
How to limit rate of requests to web services in Python?
0.066568
0
1
17,294
402,217
2008-12-31T03:18:00.000
2
0
0
0
python,django,django-models,orm,persistence
402,387
14
false
1
0
Think it over, and find the commonalities of each data set... then define your model. It may require the use of subclasses or not. Foreign keys representing commonalities aren't to be avoided, but encouraged when they make sense. Stuffing random data into a SQL table is not smart, unless it's truly non-relational dat...
1
66
0
I need to store some data in a Django model. These data are not equal to all instances of the model. At first I thought about subclassing the model, but I’m trying to keep the application flexible. If I use subclasses, I’ll need to create a whole class each time I need a new kind of object, and that’s no good. I’ll als...
How to store a dictionary on a Django Model?
0.028564
0
0
73,533
402,359
2008-12-31T05:26:00.000
2
0
1
0
python
928,621
12
false
0
0
I just uninstalled a python package, and even though I'm not certain I did so perfectly, I'm reasonably confident. I started by getting a list of all python-related files, ordered by date, on the assumption that all of the files in my package will have more or less the same timestamp, and no other files will. Luckily...
6
95
0
Can you simply delete the directory from your python installation, or are there any lingering files that you must delete?
How do you uninstall a python package that was installed using distutils?
0.033321
0
0
124,156
402,359
2008-12-31T05:26:00.000
3
0
1
0
python
4,524,074
12
false
0
0
For Windows 7, Control Panel --> Programs --> Uninstall , then choose the python package to remove.
6
95
0
Can you simply delete the directory from your python installation, or are there any lingering files that you must delete?
How do you uninstall a python package that was installed using distutils?
0.049958
0
0
124,156
402,359
2008-12-31T05:26:00.000
-1
0
1
0
python
61,750,221
12
false
0
0
ERROR: flake8 3.7.9 has requirement pycodestyle<2.6.0,>=2.5.0, but you'll have pycodestyle 2.3.1 which is incompatible. ERROR: nuscenes-devkit 1.0.8 has requirement motmetrics<=1.1.3, but you'll have motmetrics 1.2.0 which is incompatible. Installing collected packages: descartes, future, torch, cachetools, torchvision...
6
95
0
Can you simply delete the directory from your python installation, or are there any lingering files that you must delete?
How do you uninstall a python package that was installed using distutils?
-0.016665
0
0
124,156
402,359
2008-12-31T05:26:00.000
20
0
1
0
python
403,563
12
false
0
0
The three things that get installed that you will need to delete are: Packages/modules Scripts Data files Now on my linux system these live in: /usr/lib/python2.5/site-packages /usr/bin /usr/share But on a windows system they are more likely to be entirely within the Python distribution directory. I have no idea ab...
6
95
0
Can you simply delete the directory from your python installation, or are there any lingering files that you must delete?
How do you uninstall a python package that was installed using distutils?
1
0
0
124,156
402,359
2008-12-31T05:26:00.000
9
0
1
0
python
405,406
12
false
0
0
Yes, it is safe to simply delete anything that distutils installed. That goes for installed folders or .egg files. Naturally anything that depends on that code will no longer work. If you want to make it work again, simply re-install. By the way, if you are using distutils also consider using the multi-version featur...
6
95
0
Can you simply delete the directory from your python installation, or are there any lingering files that you must delete?
How do you uninstall a python package that was installed using distutils?
1
0
0
124,156
402,359
2008-12-31T05:26:00.000
14
0
1
0
python
8,471,143
12
false
0
0
Another time stamp based hack: Create an anchor: touch /tmp/ts Reinstall the package to be removed: python setup.py install --prefix=<PREFIX> Remove files what are more recent than the anchor file: find <PREFIX> -cnewer /tmp/ts | xargs rm -r
6
95
0
Can you simply delete the directory from your python installation, or are there any lingering files that you must delete?
How do you uninstall a python package that was installed using distutils?
1
0
0
124,156
402,504
2008-12-31T07:58:00.000
-36
0
1
0
python,types
54,771,749
19
false
0
0
Just do not do it. Asking for something's type is wrong in itself. Instead use polymorphism. Find or if necessary define by yourself the method that does what you want for any possible type of input and just call it without asking about anything. If you need to work with built-in types or types defined by a third-party...
3
2,000
0
How do I see the type of a variable? (e.g. unsigned 32 bit)
How to determine a Python variable's type?
-1
0
0
3,479,491
402,504
2008-12-31T07:58:00.000
12
0
1
0
python,types
403,093
19
false
0
0
It really depends on what level you mean. In Python 2.x, there are two integer types, int (constrained to sys.maxint) and long (unlimited precision), for historical reasons. In Python code, this shouldn't make a bit of difference because the interpreter automatically converts to long when a number is too large. If you ...
3
2,000
0
How do I see the type of a variable? (e.g. unsigned 32 bit)
How to determine a Python variable's type?
1
0
0
3,479,491
402,504
2008-12-31T07:58:00.000
17
0
1
0
python,types
402,516
19
false
0
0
Python doesn't have such types as you describe. There are two types used to represent integral values: int, which corresponds to platform's int type in C, and long, which is an arbitrary precision integer (i.e. it grows as needed and doesn't have an upper limit). ints are silently converted to long if an expression pro...
3
2,000
0
How do I see the type of a variable? (e.g. unsigned 32 bit)
How to determine a Python variable's type?
1
0
0
3,479,491
403,527
2008-12-31T17:20:00.000
0
0
0
0
python,sql
403,848
6
false
0
0
Here is an example of inner joining two tables based on a common field in both tables. SELECT table1.Products FROM table1 INNER JOIN table2 on table1.barcode = table2.barcode WHERE table1.Products is not null
2
0
0
I'm wondering, is it possible to make an sql query that does the same function as 'select products where barcode in table1 = barcode in table2'. I am writing this function in a python program. Once that function is called will the table be joined permanently or just while that function is running? thanks.
Making a SQL Query in two tables
0
1
0
680
403,527
2008-12-31T17:20:00.000
0
0
0
0
python,sql
403,904
6
false
0
0
Here's a way to talk yourself through table design in these cases, based on Object Role Modeling. (Yes, I realize this is only indirectly related to the question.) You have products and barcodes. Products are uniquely identified by Product Code (e.g. 'A2111'; barcodes are uniquely identified by Value (e.g. 1002155061)....
2
0
0
I'm wondering, is it possible to make an sql query that does the same function as 'select products where barcode in table1 = barcode in table2'. I am writing this function in a python program. Once that function is called will the table be joined permanently or just while that function is running? thanks.
Making a SQL Query in two tables
0
1
0
680
404,346
2009-01-01T00:55:00.000
5
0
1
0
python,math
404,587
11
false
0
0
Just a footnote on the other answers that used floating point; starting with the largest divisor and iterating downward (toward the reciprocals with largest value) will put off accumulated round-off error as much as possible.
2
8
0
Does anyone know how to write a program in Python that will calculate the addition of the harmonic series. i.e. 1 + 1/2 +1/3 +1/4...
Python program to calculate harmonic series
0.090659
0
0
22,477
404,346
2009-01-01T00:55:00.000
4
0
1
0
python,math
404,364
11
false
0
0
The harmonic series diverges, i.e. its sum is infinity.. edit: Unless you want partial sums, but you weren't really clear about that.
2
8
0
Does anyone know how to write a program in Python that will calculate the addition of the harmonic series. i.e. 1 + 1/2 +1/3 +1/4...
Python program to calculate harmonic series
0.072599
0
0
22,477
405,165
2009-01-01T17:12:00.000
0
1
0
0
python,ruby,lisp
405,577
12
false
1
0
pick the most popular one for your domain so your work gets the most visibility. some might say ruby/rails for web, python for everything else. picking a language just because its like lisp is really not appropriate for a professional.
6
21
0
I am a C++ developer, slowly getting into web development. I like LISP a lot but don't like AllegroCL and web-frameworks available for LISP. I am looking for more freedom and ability to do cool hacks on language level. I don't consider tabs as a crime against nature. Which one is closer to LISP: Python or Ruby? I can'...
Please advise on Ruby vs Python, for someone who likes LISP a lot
0
0
0
5,716
405,165
2009-01-01T17:12:00.000
3
1
0
0
python,ruby,lisp
405,382
12
false
1
0
I am a Pythonista; however, based on your requirements, especially the "cool hacks on the language level", I would suggest you work on Ruby. Ruby is more flexible in the Perl way and you can do a lot of hacks; Python is targeted towards readability, which is a very good thing, and generally language hacks are a little ...
6
21
0
I am a C++ developer, slowly getting into web development. I like LISP a lot but don't like AllegroCL and web-frameworks available for LISP. I am looking for more freedom and ability to do cool hacks on language level. I don't consider tabs as a crime against nature. Which one is closer to LISP: Python or Ruby? I can'...
Please advise on Ruby vs Python, for someone who likes LISP a lot
0.049958
0
0
5,716
405,165
2009-01-01T17:12:00.000
1
1
0
0
python,ruby,lisp
405,317
12
false
1
0
If you need Unicode support, remember to check how well supported it is. AFAIK, Python's support for Unicode is better than Ruby's, especially since Python 3.0. On the other hand, Python 3 is still missing some popular packages and 3rd party libraries, so that might play against.
6
21
0
I am a C++ developer, slowly getting into web development. I like LISP a lot but don't like AllegroCL and web-frameworks available for LISP. I am looking for more freedom and ability to do cool hacks on language level. I don't consider tabs as a crime against nature. Which one is closer to LISP: Python or Ruby? I can'...
Please advise on Ruby vs Python, for someone who likes LISP a lot
0.016665
0
0
5,716
405,165
2009-01-01T17:12:00.000
0
1
0
0
python,ruby,lisp
405,474
12
false
1
0
I'm a Rubyist who chose the language based on very similar criteria. Python is a good language and I enjoy working with it too, but I think Ruby is somewhat more Lispy in the degree of freedom it gives to the programmer. Python seems to impose its opinions a little bit more (which can be a good thing, but isn't accordi...
6
21
0
I am a C++ developer, slowly getting into web development. I like LISP a lot but don't like AllegroCL and web-frameworks available for LISP. I am looking for more freedom and ability to do cool hacks on language level. I don't consider tabs as a crime against nature. Which one is closer to LISP: Python or Ruby? I can'...
Please advise on Ruby vs Python, for someone who likes LISP a lot
0
0
0
5,716
405,165
2009-01-01T17:12:00.000
8
1
0
0
python,ruby,lisp
405,310
12
false
1
0
Both Ruby and Python are fairly distant from the Lisp traditions of immutable data, programs as data, and macros. But Ruby is very nearly a clone of Smalltalk (and I hope will grow more like Smalltalk as the Perlish cruft is deprecated), and Smalltalk, like Lisp, is a language that takes one idea to extremes. Based o...
6
21
0
I am a C++ developer, slowly getting into web development. I like LISP a lot but don't like AllegroCL and web-frameworks available for LISP. I am looking for more freedom and ability to do cool hacks on language level. I don't consider tabs as a crime against nature. Which one is closer to LISP: Python or Ruby? I can'...
Please advise on Ruby vs Python, for someone who likes LISP a lot
1
0
0
5,716
405,165
2009-01-01T17:12:00.000
12
1
0
0
python,ruby,lisp
405,228
12
false
1
0
Speaking as a "Rubyist", I'd agree with Kiv. The two languages both grant a nice amount of leeway when it comes to programming paradigms, but are also have benefits/shortcomings. I think that the compromises you make either way are a lot about your own programming style and taste. Personally, I think Ruby can read more...
6
21
0
I am a C++ developer, slowly getting into web development. I like LISP a lot but don't like AllegroCL and web-frameworks available for LISP. I am looking for more freedom and ability to do cool hacks on language level. I don't consider tabs as a crime against nature. Which one is closer to LISP: Python or Ruby? I can'...
Please advise on Ruby vs Python, for someone who likes LISP a lot
1
0
0
5,716
405,282
2009-01-01T18:47:00.000
8
0
1
0
python,class,object,multiple-instances
405,292
5
false
0
0
Hm, well you normally just stuff all those instances in a list and then iterate over that list if you want to do something with them. If you want to automatically keep track of each instance created you can also make the adding to the list implicit in the class' constructor or create a factory method that keeps track o...
1
4
0
I am trying to write a life simulation in python with a variety of animals. It is impossible to name each instance of the classes I am going to use because I have no way of knowing how many there will be. So, my question: How can I automatically give a name to an object? I was thinking of creating a "Herd" class which ...
Many instances of a class
1
0
0
6,007
408,039
2009-01-02T21:08:00.000
-2
0
0
1
python,windows,subprocess,popen
408,049
2
false
0
0
I don't have a windows box around, so this is untested, but I'd be tempted to try the os.dup and os.dup2 methods; duplicate the file descriptors and use those instead of the parent ones.
1
1
0
Python's subprocess module by default passes all open file descriptors to any child processes it spawns. This means that if the parent process is listening on a port, and is killed, it cannot restart and begin listening again (even using SO_REUSEADDR) because the child is still in possession of that descriptor. I hav...
Prevent Python subprocess from passing fds on Windows?
-0.197375
0
0
671
408,334
2009-01-02T23:49:00.000
2
0
0
0
python,windows,winapi,controls
409,110
2
true
0
1
Above answers are completely wrong and don't even know what is a PAS. This has been answered hundreds of times for 20 years on Usenet. You must use IPC of course (RPM) ask on news://comp.os.ms-windows.programmer.win32 for code.
1
1
0
More particularly - I have a window handle of another running application. This application contains a TListControl.UnicodeClass control somewhere (I know this from Winspector). How can I, using the Windows API and that window handle, go through all the items in that list control and get the text from all of the items?...
In Windows, how can I enumerate and get text from another window's controls?
1.2
0
0
1,808
409,677
2009-01-03T19:37:00.000
3
0
0
1
python,macos,wxpython,compatibility
409,702
1
true
0
0
Tiger shipped with Python 2.3.5 and wxPython 2.5.3, Leopard ships with python 2.5.1 and wxPython 2.8.4. wxPython was not shipped with previous versions. OSX Lion has 2.7.1
1
0
0
I'd like to know what versions of Python and wxPython correspond to each version of OSX. I'm interested to know exactly how far back some of my apps will remain compatible on a mac before having to install newer versions of Python and wxPython.
What versions of Python and wxPython correspond to each version of OSX?
1.2
0
0
412
409,949
2009-01-03T21:59:00.000
0
1
0
0
python,mp3,metadata,id3,albumart
1,961,919
5
false
0
0
A nice small CLI tool which helped me a lot with checking what I did while developing id3 stuff is mid3v2 which is the mutagen version of id3v2. It comes bundled with the Python mutagen library. The source of this little tool gave me also lots of answers about how to use mutagen.
1
32
0
I've been using mutagen for reading and writing MP3 tags, but I want to be able to embed album art directly into the file.
How do you embed album art into an MP3 using Python?
0
0
0
21,737
410,183
2009-01-04T00:49:00.000
0
1
0
0
php,python,ruby,artificial-intelligence,recommendation-engine
7,620,095
5
false
1
0
I happen to know a world-class expert in machine learning. He likes Prolog, especially for the higher level logic of the system. Hadn't even heard anyone mention that in a long time. Personally, I like Java. But if you're going to do intensive machine learning, you should be concerned about the speed of math processing...
4
0
0
For something like a personal recommendation system, machine learning type of stuff on a website, what language would be best?
Interested in Collective Programming for the web -- Ruby or Python or PHP?
0
0
0
2,360
410,183
2009-01-04T00:49:00.000
-2
1
0
0
php,python,ruby,artificial-intelligence,recommendation-engine
636,664
5
false
1
0
I recently did some research into this for a project at my day job. It was for a recommendation system and the options were php,perl or python. PHP was out almost immediately, there were no good 3rd party open source libraries and the language itself is not as well suited to any kind of complex real programming. Python...
4
0
0
For something like a personal recommendation system, machine learning type of stuff on a website, what language would be best?
Interested in Collective Programming for the web -- Ruby or Python or PHP?
-0.07983
0
0
2,360
410,183
2009-01-04T00:49:00.000
0
1
0
0
php,python,ruby,artificial-intelligence,recommendation-engine
636,639
5
false
1
0
All of the points that Bill Karwin have brought up are entirely valid: You should really operate in what you are most comfortable with. If that isn't a factor, I would personally suggest Ruby. It's an incredibly powerful language that draws a lot of commonalities with Lisp and is probably just as good, if not better, f...
4
0
0
For something like a personal recommendation system, machine learning type of stuff on a website, what language would be best?
Interested in Collective Programming for the web -- Ruby or Python or PHP?
0
0
0
2,360
410,183
2009-01-04T00:49:00.000
16
1
0
0
php,python,ruby,artificial-intelligence,recommendation-engine
410,193
5
false
1
0
The language you know best would be best. I mean that half-seriously. Given the brief description of your project, there's no reason to believe any of the languages you list would be any better or worse than the others. Those three languages are adequate for approximately similar tasks, so you should pick the one you...
4
0
0
For something like a personal recommendation system, machine learning type of stuff on a website, what language would be best?
Interested in Collective Programming for the web -- Ruby or Python or PHP?
1
0
0
2,360
412,214
2009-01-05T03:36:00.000
4
0
0
1
python,qt
413,073
3
false
0
1
Check if KWin is configured to prevent focus stealing. There might be nothing wrong with your code -- but we linux people don't like applications bugging us when we work, so stealing focus is kinda frowned upon, and difficult under some window managers.
1
1
0
I would like to force my python app to the front if a condition occurs. I'm using Kubuntu & QT3.1 I've tried setActiveWindow(), but it only flashes the task bar in KDE. I think Windows has a function bringwindowtofront() for VB. Is there something similar for KDE?
How to bring program to front using python
0.26052
0
0
2,418
412,475
2009-01-05T07:17:00.000
2
0
1
0
python
412,555
5
false
0
0
I think what you are interested in is still topic of research. You won't find any module ready that will do that for you. Besides it is not clear what you mean with "notes and octaves"? What information exaclty would you like to extract?
2
2
0
Are there any modules in Python that help us to construct or obtain the musical notes and octaves from a given original song? Thanks for the help
How to construct notes from a given song file?
0.07983
0
0
1,896
412,475
2009-01-05T07:17:00.000
2
0
1
0
python
412,505
5
false
0
0
This question has far too few details to give any kind of meaningful answers. Questions: By song file, do you mean like an MP3? Is it a "song" or a "instrumental"? I would gather trying to decipher notes behind a voice would be harder Is it a simple song, like a single voice played on a simple instrument, like a piano...
2
2
0
Are there any modules in Python that help us to construct or obtain the musical notes and octaves from a given original song? Thanks for the help
How to construct notes from a given song file?
0.07983
0
0
1,896
412,482
2009-01-05T07:23:00.000
1
1
1
0
python
412,584
9
false
0
0
Search "Alex Martelli - Python For Programmers" on Google Video. Good introductory (but fast-paced) talk. Related videos are also worth watching.
1
2
0
What are good online resources to learn Python, quickly, for some who can code decently in other languages? edit: It'll help if you could explain why you think that resource is useful.
Resources for moving to Python
0.022219
0
0
5,777
413,228
2009-01-05T14:21:00.000
5
0
0
0
python,postgresql
413,259
5
true
1
0
For what it's worth, django uses psycopg2.
4
13
0
What is the difference between these two apis? Which one faster, reliable using Python DB API? Upd: I see two psql drivers for Django. The first one is psycopg2. What is the second one? pygresql?
PyGreSQL vs psycopg2
1.2
1
0
15,364
413,228
2009-01-05T14:21:00.000
0
0
0
0
python,postgresql
413,508
5
false
1
0
psycopg2 is partly written in C so you can expect a performance gain, but on the other hand, a bit harder to install. PyGreSQL is written in Python only, easy to deployed but slower.
4
13
0
What is the difference between these two apis? Which one faster, reliable using Python DB API? Upd: I see two psql drivers for Django. The first one is psycopg2. What is the second one? pygresql?
PyGreSQL vs psycopg2
0
1
0
15,364
413,228
2009-01-05T14:21:00.000
4
0
0
0
python,postgresql
592,846
5
false
1
0
"PyGreSQL is written in Python only, easy to deployed but slower." PyGreSQL contains a C-coded module, too. I haven't done speed tests, but they're not likely to be much different, as the real work will happen inside the database server.
4
13
0
What is the difference between these two apis? Which one faster, reliable using Python DB API? Upd: I see two psql drivers for Django. The first one is psycopg2. What is the second one? pygresql?
PyGreSQL vs psycopg2
0.158649
1
0
15,364
413,228
2009-01-05T14:21:00.000
2
0
0
0
python,postgresql
413,537
5
false
1
0
Licensing may be an issue for you. PyGreSQL is MIT license. Psycopg2 is GPL license. (as long as you are accessing psycopg2 in normal ways from Python, with no internal API, and no direct C calls, this shouldn't cause you any headaches, and you can release your code under whatever license you like - but I am not a lawy...
4
13
0
What is the difference between these two apis? Which one faster, reliable using Python DB API? Upd: I see two psql drivers for Django. The first one is psycopg2. What is the second one? pygresql?
PyGreSQL vs psycopg2
0.07983
1
0
15,364
413,446
2009-01-05T15:27:00.000
1
0
0
0
python,django
413,549
3
false
1
0
It depends on how you want to use it. Let's say you have length value and two possible units, cm and mm. If you want only to print the value later, you can always print it as [value]&nbsp;[unit]. However, if you want to do some calculations with the value, for instance, calculate the area, you need to convert the value...
1
1
0
I need to store some values in the database, distance, weight etc. In my model, I have field that contains quantity of something and IntegerField with choices option, that determines what this quantity means (length, time duration etc). Should I create a model for units and physical quantity or should I use IntegerFie...
Django and units conversion
0.066568
0
0
3,399
415,015
2009-01-06T00:15:00.000
2
1
0
0
log4net,ironpython,dynamic-language-runtime
417,084
1
true
0
0
I was able to solve the problem by using absolute reference paths rather than relative ones.
1
0
0
I've got an IronPython script that configures log4net, then calls .NET code that uses log4net. log4net is properly configured, as I log a message to indicate that it is initialized. But when I try to use my .NET class, it reports "could not load file or assembly 'log4net, ...'. Some useful facts: log4net is not inst...
Calling .NET code from IronPython, getting error loading the log4net assembly
1.2
0
0
1,015
415,511
2009-01-06T04:54:00.000
0
0
1
0
python,datetime,time
71,589,047
51
false
0
0
This should work import time now = datetime.now() current_time = now.strftime("%H:%M:%S") print("The current time is", current_time)
1
3,537
0
How do I get the current time?
How do I get the current time?
0
0
0
3,880,994
417,265
2009-01-06T16:44:00.000
-3
0
0
0
python,django,django-templates
417,273
3
false
1
0
It's a bitwise "or". It means escape if the property doesn't exist/is null.
1
8
0
I often see something like that: something.property|escape something is an object, property is it's string property. escape - i don't know :) What does this mean? And what min python version it is used in? EDIT: The question was asked wrongly, it said "What does | mean in Python", so the bitwise or answers are corre...
What does "|" sign mean in a Django template?
-0.197375
0
0
4,913
417,584
2009-01-06T18:14:00.000
0
0
0
0
python,google-app-engine
420,416
4
false
0
0
I may be misunderstanding your question, but if you have a list of properties you expect to find, why not just use a standard db.Model, instead of an Expando? You can add additional properties to a Model class, as long as you either provide a default or don't make them required.
1
0
0
I'm creating an app that I want to have an expandable set of properties (each a RatingProperty) I also want to validate that any dynamic properties are of the RatingProperty type. In the Expando documentation it says: Tip: If you want to validate a dynamic property value using a Property class, you can instantiate th...
How can I tell if an Expando subclass has a property defined?
0
0
0
466
418,835
2009-01-07T01:12:00.000
1
0
0
0
python,python-3.x,plot,graphing,scatter-plot
421,947
5
false
0
0
Maybe you can use Python Imaging Library (PIL). Also have a look at PyX, but this library is meant to output to PDF, ...
1
3
1
As per the title. I am trying to create a simple scater plot, but haven't found any Python 3.0 libraries that can do it. Note, this isn't for a website, so the web ones are a bit useless.
Are there any graph/plotting/anything-like-that libraries for Python 3.0?
0.039979
0
0
1,540
419,010
2009-01-07T02:39:00.000
0
1
1
0
python,versioning
420,029
5
false
0
0
You should be using setuptools: It allows you to lock the dependancies of an application, so even if multiple versions of an egg or package exist on a system only the right one will ever be used. This is a better way of working: Rather than fail if the wrong version of a dependancy is present it is better to ensure t...
1
4
0
How can you raise an exception when you import a module that is less or greater than a given value for its __version__? There are a lot of different ways you could do it, but I feel like there must be some really simple way that eludes me at the moment. In this case the version number is of the format x.x.x
How to raise an exception on the version number of a module
0
0
0
453
419,197
2009-01-07T04:33:00.000
0
0
0
1
python,google-app-engine,google-apps,gql,gqlquery
426,287
4
false
1
0
Yeah, there's no way to get information about people who haven't logged into your application.
1
1
0
If you have a Google App Engine project you can authenticate based on either a) anyone with a google account or b) a particular google app domain. Since you can connect these two entities I would assume there is some way to query the list of users that can be authenticated. The use case is outputting a roster of all me...
How do you query the set of Users in Google App Domain within your Google App Engine project?
0
0
0
1,636
419,260
2009-01-07T05:14:00.000
0
0
0
0
python,c,text,webpage
419,273
8
false
0
0
As long as the layout of the web page your trying to 'scrape' doesnt regularly change, you should be able to parse the html with any modern day programming language.
2
3
0
I would like to write a program that will find bus stop times and update my personal webpage accordingly. If I were to do this manually I would Visit www.calgarytransit.com Enter a stop number. ie) 9510 Click the button "next bus" The results may look like the following: 10:16p Route 154 10:46p Route 154 11:...
Grabbing text from a webpage
0
0
1
24,102
419,260
2009-01-07T05:14:00.000
1
0
0
0
python,c,text,webpage
419,271
8
false
0
0
That site doesnt offer an API for you to be able to get the appropriate data that you need. In that case you'll need to parse the actual HTML page returned by, for example, a CURL request .
2
3
0
I would like to write a program that will find bus stop times and update my personal webpage accordingly. If I were to do this manually I would Visit www.calgarytransit.com Enter a stop number. ie) 9510 Click the button "next bus" The results may look like the following: 10:16p Route 154 10:46p Route 154 11:...
Grabbing text from a webpage
0.024995
0
1
24,102
419,908
2009-01-07T11:05:00.000
0
0
0
0
javascript,python,html,google-app-engine,drop-down-menu
7,284,763
4
false
1
0
The problem with using onchange is that not all users are using a mouse. If you have a combo-box and change the value with the keyboard, you'd never be able to get past the first value without the form submitting. ~Cyrix
1
1
0
How to get the text of selected item from a drop down box element in html forms? (using python) How can I store the value to a variable, when I select one item from the drop down box using mouse? (ie. without using a submit button) This is for a application which I am doing in app engine which only supports Python.
Getting selected value from drop down box in a html form without submit
0
0
1
13,168
423,379
2009-01-08T05:45:00.000
26
0
1
0
python,global-variables,scope
427,818
24
false
0
0
You're not actually storing the global in a local variable, just creating a local reference to the same object that your original global reference refers to. Remember that pretty much everything in Python is a name referring to an object, and nothing gets copied in usual operation. If you didn't have to explicitly spec...
2
3,667
0
How can I create or use a global variable in a function? If I create a global variable in one function, how can I use that global variable in another function? Do I need to store the global variable in a local variable of the function which needs its access?
Using global variables in a function
1
0
0
3,715,726
423,379
2009-01-08T05:45:00.000
70
0
1
0
python,global-variables,scope
423,641
24
false
0
0
If you want to refer to a global variable in a function, you can use the global keyword to declare which variables are global. You don't have to use it in all cases (as someone here incorrectly claims) - if the name referenced in an expression cannot be found in local scope or scopes in the functions in which this func...
2
3,667
0
How can I create or use a global variable in a function? If I create a global variable in one function, how can I use that global variable in another function? Do I need to store the global variable in a local variable of the function which needs its access?
Using global variables in a function
1
0
0
3,715,726
423,404
2009-01-08T06:00:00.000
1
0
0
0
python,ctypes
423,479
3
true
0
0
I'm not sure you can do it without modifying the C code. ctypes seems to have really bad support for long doubles - you can't manipulate them like numbers at all, all you can do is convert them back and forth between the native float Python type. You can't even use a byte array as the return value instead of a c_longd...
1
9
0
i have a c function which returns a long double. i'd like to call this function from python using ctypes, and it mostly works. setting so.func.restype = c_longdouble does the trick -- except that python's float type is a c_double so if the returned value is larger than a double, but well within the bounds of a long d...
long double returns and ctypes
1.2
0
0
2,877
423,916
2009-01-08T11:12:00.000
0
0
0
0
python,django,content-management-system,joomla
1,062,921
9
false
1
0
Thanks for that. The system has been chosen behind my back by higher management. It's SilverStripe. Slow Admin interface No experienced programmer in the company knowing this product Implemented by a graphic designer who's leaving in about two weeks, but "he can do consulting as he's going to be a freelancer" I'm no...
6
3
0
In my company we are thinking of moving from wiki style intranet to a more bespoke CMS solution. Natural choice would be Joomla, but we have a specific architecture. There is a few hundred people who will use the system. System should be self explainable (easier than wiki). We use a lot of tools web, applications and i...
Which software for intranet CMS - Django or Joomla?
0
0
0
14,680
423,916
2009-01-08T11:12:00.000
0
0
0
0
python,django,content-management-system,joomla
428,028
9
false
1
0
Thank you for all the answers. Plone option cancelled on today's meeting. Using Joomla will involve quite a lot of coding to make it act as the rest of the intranet. I think that writing a CMS in Django (with "stealing" some code from existing cms solutions) will win. Newforms are very interesting and it shouldn't be t...
6
3
0
In my company we are thinking of moving from wiki style intranet to a more bespoke CMS solution. Natural choice would be Joomla, but we have a specific architecture. There is a few hundred people who will use the system. System should be self explainable (easier than wiki). We use a lot of tools web, applications and i...
Which software for intranet CMS - Django or Joomla?
0
0
0
14,680
423,916
2009-01-08T11:12:00.000
0
0
0
0
python,django,content-management-system,joomla
424,091
9
false
1
0
Django CMS way of work requires using a built-in ORM model and an admin interface.
6
3
0
In my company we are thinking of moving from wiki style intranet to a more bespoke CMS solution. Natural choice would be Joomla, but we have a specific architecture. There is a few hundred people who will use the system. System should be self explainable (easier than wiki). We use a lot of tools web, applications and i...
Which software for intranet CMS - Django or Joomla?
0
0
0
14,680
423,916
2009-01-08T11:12:00.000
2
0
0
0
python,django,content-management-system,joomla
424,377
9
false
1
0
Joomla! has authentication plugins; you can write your own without hacking the core. When someone attempts to log into your site, it will go through all published authentication plugins (in the order you set) until one returns true. If you only want to use one method, unpublish all of the other plugins except for your ...
6
3
0
In my company we are thinking of moving from wiki style intranet to a more bespoke CMS solution. Natural choice would be Joomla, but we have a specific architecture. There is a few hundred people who will use the system. System should be self explainable (easier than wiki). We use a lot of tools web, applications and i...
Which software for intranet CMS - Django or Joomla?
0.044415
0
0
14,680
423,916
2009-01-08T11:12:00.000
1
0
0
0
python,django,content-management-system,joomla
2,631,681
9
false
1
0
If you use FLEXIcontent and FLEXiaccess you can get granular level permissions on Joomla
6
3
0
In my company we are thinking of moving from wiki style intranet to a more bespoke CMS solution. Natural choice would be Joomla, but we have a specific architecture. There is a few hundred people who will use the system. System should be self explainable (easier than wiki). We use a lot of tools web, applications and i...
Which software for intranet CMS - Django or Joomla?
0.022219
0
0
14,680
423,916
2009-01-08T11:12:00.000
8
0
0
0
python,django,content-management-system,joomla
423,947
9
true
1
0
Django isn't a CMS. If you want to build an application then you'd use Django (by the sound of your post you understand that though). If you just want to be able to edit/store content and have permissions for your users - a CMS would be the way to go. I really don't know anything about Joomla though. It should be easy ...
6
3
0
In my company we are thinking of moving from wiki style intranet to a more bespoke CMS solution. Natural choice would be Joomla, but we have a specific architecture. There is a few hundred people who will use the system. System should be self explainable (easier than wiki). We use a lot of tools web, applications and i...
Which software for intranet CMS - Django or Joomla?
1.2
0
0
14,680
425,343
2009-01-08T18:38:00.000
4
0
1
1
python,cross-platform
425,383
4
true
0
0
In general: Be careful with paths. Use os.path wherever possible. Don't assume that HOME points to the user's home/profile directory. Avoid using things like unix-domain sockets, fifos, and other POSIX-specific stuff. More specific stuff: If you're using wxPython, note that there may be differences in things like wh...
4
4
0
I am about to start a personal project using python and I will be using it on both Linux(Fedora) and Windows(Vista), Although I might as well make it work on a mac while im at it. I have found an API for the GUI that will work on all 3. The reason I am asking is because I have always heard of small differences that are...
Python and different Operating Systems
1.2
0
0
1,173
425,343
2009-01-08T18:38:00.000
1
0
1
1
python,cross-platform
425,403
4
false
0
0
You should take care of the Python version you are developing against. Especially, on a Mac, the default version of Python installed with the OS, is rather old (of course, newer versions can be installed) Don't use the OS specific libraries Take special care of 'special' UI elements, like taskbar icons (windows), ... U...
4
4
0
I am about to start a personal project using python and I will be using it on both Linux(Fedora) and Windows(Vista), Although I might as well make it work on a mac while im at it. I have found an API for the GUI that will work on all 3. The reason I am asking is because I have always heard of small differences that are...
Python and different Operating Systems
0.049958
0
0
1,173
425,343
2009-01-08T18:38:00.000
3
0
1
1
python,cross-platform
425,409
4
false
0
0
Some things I've noticed in my cross platform development in Python: OSX doesn't have a tray, so application notifications usually happen right in the dock. So if you're building a background notification service you may need a small amount of platform-specific code. os.startfile() apparently only works on Windows. ...
4
4
0
I am about to start a personal project using python and I will be using it on both Linux(Fedora) and Windows(Vista), Although I might as well make it work on a mac while im at it. I have found an API for the GUI that will work on all 3. The reason I am asking is because I have always heard of small differences that are...
Python and different Operating Systems
0.148885
0
0
1,173
425,343
2009-01-08T18:38:00.000
0
0
1
1
python,cross-platform
425,465
4
false
0
0
Some filename problems: This.File and this.file are different files on Linux, but point to the same file on Windows. Troublesome if you manage some file repository and access it from both platforms. Less frequent related problem is that of names like NUL or LPT being files on Windows. Binary distribution code (if any) ...
4
4
0
I am about to start a personal project using python and I will be using it on both Linux(Fedora) and Windows(Vista), Although I might as well make it work on a mac while im at it. I have found an API for the GUI that will work on all 3. The reason I am asking is because I have always heard of small differences that are...
Python and different Operating Systems
0
0
0
1,173
425,722
2009-01-08T20:17:00.000
4
0
0
0
python,drag-and-drop,wxpython
425,740
1
true
0
1
If you want to graphically represent the drag, one good way to do this is to create a borderless Frame that follows the mouse during a drag. You remove the button from your source Frame, temporarily put it in this "drag Frame", and then, when the user drops, add it to your destination Frame.
1
1
0
Does anyone know of an example where it is shown how to drag a button from one panel to another in wxPython? I have created a bitmap button in a panel, and I would like to be able to drag it to a different panel and drop I there. I haven't found any examples using buttons, just text and files. I am using the latest ve...
Drag button between panels in wxPython
1.2
0
0
1,052
426,607
2009-01-09T00:16:00.000
3
1
0
0
python,ruby,cocoa,pyobjc,ruby-cocoa
426,733
5
false
1
0
Both are roughly equal, I'd say. Better in some places, worse in others. But I wouldn't recommend learning Cocoa with either. Like Chris said, Cocoa requires some understanding of Objective-C. I like Ruby better than Objective-C, but I still don't recommend using it to learn Cocoa. Once you have a solid foundation (no ...
3
8
0
I've been wanting to have a play with either Ruby or Python while at the same time I've been wanting to do a bit of Cocoa programming. So I thought the best way to achieve both these goals is to develop something using either a Ruby or Python to Objective-C bridge (PyObjc or RubyCocoa). I know that ideally to get the ...
PyObjc vs RubyCocoa for Mac development: Which is more mature?
0.119427
0
0
2,518
426,607
2009-01-09T00:16:00.000
12
1
0
0
python,ruby,cocoa,pyobjc,ruby-cocoa
426,703
5
false
1
0
While you say you "don't have time" to learn technologies independently the fastest route to learning Cocoa will still be to learn it in its native language: Objective-C. Once you understand Objective-C and have gotten over the initial learning curve of the Cocoa frameworks you'll have a much easier time picking up ei...
3
8
0
I've been wanting to have a play with either Ruby or Python while at the same time I've been wanting to do a bit of Cocoa programming. So I thought the best way to achieve both these goals is to develop something using either a Ruby or Python to Objective-C bridge (PyObjc or RubyCocoa). I know that ideally to get the ...
PyObjc vs RubyCocoa for Mac development: Which is more mature?
1
0
0
2,518
426,607
2009-01-09T00:16:00.000
1
1
0
0
python,ruby,cocoa,pyobjc,ruby-cocoa
3,930,584
5
false
1
0
ObjectiveC is nowhere near as much fun or as productive as either Python or Ruby. That is why people want to pick a python or ruby with good Objective C access. Advising them to learn Objective C first misses the point imo. I have really good things to say about pyobjc. Its ability to interoperate painlessly with ...
3
8
0
I've been wanting to have a play with either Ruby or Python while at the same time I've been wanting to do a bit of Cocoa programming. So I thought the best way to achieve both these goals is to develop something using either a Ruby or Python to Objective-C bridge (PyObjc or RubyCocoa). I know that ideally to get the ...
PyObjc vs RubyCocoa for Mac development: Which is more mature?
0.039979
0
0
2,518
428,308
2009-01-09T14:46:00.000
0
0
0
0
java,python,image,ms-word
430,717
4
false
0
0
You want to do this in Java or Python. Try OpenOffice. In OpenOffice, you can insert Java or Python code as a "Makro". I'm sure there will be a possibility to change the image URLs.
1
1
0
I have a set of word documents that contains a lot of non-embedded images in them. The url that the images point to no longer exist. I would like to programmatically change the domain name of the url to something else. How can I go about doing this in Java or Python ?
How to programmatically change urls of images in word documents
0
0
1
1,351
428,704
2009-01-09T16:19:00.000
1
1
0
0
python,html,css,browser,cgi
428,832
2
false
1
0
with that much html to render I would also consider the speed of the computer. you can test this by saving the html file and opening it from your local hard drive :)
2
2
0
I use python cgi for our intranet application. When I measure time, the script takes 4s to finish. But after that, it still takes another 11s to show the screen in the browser. The screen is build with tables (size: 10 KB, 91 KB uncompressed) and has a large css file (5 KB, 58 KB uncompressed). I used YSlow and did as...
Measure load time for python cgi script?
0.099668
0
0
653
428,704
2009-01-09T16:19:00.000
1
1
0
0
python,html,css,browser,cgi
428,767
2
false
1
0
I think I'd grab a copy of Ethereal and watch the TCP connection between the browser and the script, if I were concerned about whether the server is not getting its job done in an acceptable amount of time. If you see the TCP socket close before that 11s gap, you know that your issue is entirely on the browser side. ...
2
2
0
I use python cgi for our intranet application. When I measure time, the script takes 4s to finish. But after that, it still takes another 11s to show the screen in the browser. The screen is build with tables (size: 10 KB, 91 KB uncompressed) and has a large css file (5 KB, 58 KB uncompressed). I used YSlow and did as...
Measure load time for python cgi script?
0.099668
0
0
653
428,895
2009-01-09T17:11:00.000
6
0
0
0
python,http
431,411
6
false
0
0
Take into account that 'last-modified' may not be present: >>> from urllib import urlopen >>> f=urlopen('http://google.com/') >>> i=f.info() >>> i.keys() ['set-cookie', 'expires', 'server', 'connection', 'cache-control', 'date', 'content-type'] >>> i.getdate('date') (2009, 1, 10, 16, 17, 8, 0, 1, 0) >>> i.getheader('d...
2
3
0
I have a python application that relies on a file that is downloaded by a client from a website. The website is not under my control and has no API to check for a "latest version" of the file. Is there a simple way to access the file (in python) via a URL and check it's date (or size) without having to download it to t...
How can I get the created date of a file on the web (with Python)?
1
0
1
12,198
428,895
2009-01-09T17:11:00.000
7
0
0
0
python,http
428,951
6
false
0
0
There is no reliable way to do this. For all you know, the file can be created on the fly by the web server and the question "how old is this file" is not meaningful. The webserver may choose to provide Last-Modified header, but it could tell you whatever it wants.
2
3
0
I have a python application that relies on a file that is downloaded by a client from a website. The website is not under my control and has no API to check for a "latest version" of the file. Is there a simple way to access the file (in python) via a URL and check it's date (or size) without having to download it to t...
How can I get the created date of a file on the web (with Python)?
1
0
1
12,198
429,162
2009-01-09T18:29:00.000
2
0
0
1
python,command-line,streaming,yaml
429,305
2
false
0
0
All of the references to stream in the the documentation seem to be referring to a stream of documents... I've never tried to use it in the way you describe, but it seems like chunking the data into such a stream of documents is a reasonable approach.
1
6
0
I have a command line app the continuously outputs YAML data in the form: - col0: datum0 col1: datum1 col2: datum2 - col0: datum0 col1: datum1 col2: datum2 ... It does this for all of eternity. I would like to write a Python script that continuously reads each of these records. The PyYAML library seems best a...
How to process a YAML stream in Python
0.197375
0
0
2,564
429,443
2009-01-09T19:49:00.000
1
0
0
0
python,django,google-apps,monkeypatching
605,174
4
false
1
0
Have you considered subclassing the User model? This may create a different set of problems, and is only available with newer releases (not sure when the change went in, I'm on trunk).
3
1
0
I am writing a Django app, and I would like an account to be created on our Google Apps hosted email using the Provisioning API whenever an account is created locally. I would solely use signals, but since I would like the passwords to be synchronized across sites, I have monkeypatched User.objects.create_user and User...
Syncing Django users with Google Apps without monkeypatching
0.049958
0
0
428
429,443
2009-01-09T19:49:00.000
0
0
0
0
python,django,google-apps,monkeypatching
959,044
4
false
1
0
Monkeypatching is definitely bad. Hard to say anything since you've given so little code/information. But I assume you have the password in cleartext at some point (in a view, in a form) so why not sync manually then?
3
1
0
I am writing a Django app, and I would like an account to be created on our Google Apps hosted email using the Provisioning API whenever an account is created locally. I would solely use signals, but since I would like the passwords to be synchronized across sites, I have monkeypatched User.objects.create_user and User...
Syncing Django users with Google Apps without monkeypatching
0
0
0
428
429,443
2009-01-09T19:49:00.000
0
0
0
0
python,django,google-apps,monkeypatching
749,860
4
false
1
0
Subclassing seems the best route, as long as you can change all of your code to use the new class. I think that's supported in the latest release of Django.
3
1
0
I am writing a Django app, and I would like an account to be created on our Google Apps hosted email using the Provisioning API whenever an account is created locally. I would solely use signals, but since I would like the passwords to be synchronized across sites, I have monkeypatched User.objects.create_user and User...
Syncing Django users with Google Apps without monkeypatching
0
0
0
428
430,226
2009-01-10T00:10:00.000
0
1
0
0
python,twitter,polling
430,245
2
false
0
0
You should have a page that is like a Ping or Heartbeat page. The you have another process that "tickles" or hits that page, usually you can do this in your Control Panel of your web host, or use a cron if you have a local access. Then this script can keep statistics of how often it has polled in a database or some dat...
1
5
0
I need to poll a web service, in this case twitter's API, and I'm wondering what the conventional wisdom is on this topic. I'm not sure whether this is important, but I've always found feedback useful in the past. A couple scenarios I've come up with: The querying process starts every X seconds, eg a cron job runs a p...
Best way to poll a web service (eg, for a twitter app)
0
0
1
5,380
430,379
2009-01-10T02:00:00.000
0
0
0
0
python,python-imaging-library,rounded-corners
430,410
2
false
0
1
Might it not be a better idea (assuming HTML is the output) to use HTML and CSS to put some rounded borders on those pictures? That way, if you want to change the look of your site, you don't have to do any image reprocessing, and you don't have to do any image processing in the first place.
1
0
0
My site is full of rounded corners on every box and picture, except for the thumbnails of user uploaded photos. How can I use the Python Imaging Library to 'draw' white or transparent rounded corners onto each thumbnail?
Draw rounded corners on photo with PIL
0
0
0
3,944
431,432
2009-01-10T17:56:00.000
0
0
1
0
python,interpreter
431,685
5
false
0
0
If you know in advance the modules, classes, functions, variables, etc... in use, you could pickle them to disk and reload. I'm not sure off the top of my head the best way to tackle the issue if your environment contains many unknowns. Though, it may suffice to pickle globals and locals.
4
7
0
I have a python interpreter embedded inside an application. The application takes a long time to start up and I have no ability to restart the interpreter without restarting the whole application. What I would like to do is to essentially save the state of the interpreter and return to that state easily. I started by s...
Restarting a Python Interpreter Quietly
0
0
0
6,441
431,432
2009-01-10T17:56:00.000
1
0
1
0
python,interpreter
432,034
5
false
0
0
storing the names of all modules in sys.modules that the python interpreter started with and then deleting all new modules from sys.modules when requested. This appears to make the interpreter prepared to re-import the same modules even though it has already imported them before. The module-reload-forcing approach can...
4
7
0
I have a python interpreter embedded inside an application. The application takes a long time to start up and I have no ability to restart the interpreter without restarting the whole application. What I would like to do is to essentially save the state of the interpreter and return to that state easily. I started by s...
Restarting a Python Interpreter Quietly
0.039979
0
0
6,441
431,432
2009-01-10T17:56:00.000
1
0
1
0
python,interpreter
431,829
5
false
0
0
I'd suggest tackling the root cause problem. "The application takes a long time to start up and I have no ability to restart the interpreter without restarting the whole application" I doubt this is actually 100% true. If the overall application is the result of an act of Congress, okay, it can't be changed....
4
7
0
I have a python interpreter embedded inside an application. The application takes a long time to start up and I have no ability to restart the interpreter without restarting the whole application. What I would like to do is to essentially save the state of the interpreter and return to that state easily. I started by s...
Restarting a Python Interpreter Quietly
0.039979
0
0
6,441
431,432
2009-01-10T17:56:00.000
0
0
1
0
python,interpreter
431,460
5
false
0
0
One very hacky and bug prone approach might be a c module that simply copies the memory to a file so it can be loaded back the next time. But since I can't imagine that this would always work properly, would pickling be an alternative? If you are able to make all of your modules pickleable than you should be able to pi...
4
7
0
I have a python interpreter embedded inside an application. The application takes a long time to start up and I have no ability to restart the interpreter without restarting the whole application. What I would like to do is to essentially save the state of the interpreter and return to that state easily. I started by s...
Restarting a Python Interpreter Quietly
0
0
0
6,441
431,684
2009-01-10T20:28:00.000
4
0
0
1
python,cd
39,964,190
14
false
0
0
If You would like to perform something like "cd.." option, just type: os.chdir("..") it is the same as in Windows cmd: cd.. Of course import os is neccessary (e.g type it as 1st line of your code)
3
797
0
cd is the shell command to change the working directory. How do I change the current working directory in Python?
Equivalent of shell 'cd' command to change the working directory?
0.057081
0
0
1,317,026
431,684
2009-01-10T20:28:00.000
12
0
0
1
python,cd
431,694
14
false
0
0
os.chdir() is the Pythonic version of cd.
3
797
0
cd is the shell command to change the working directory. How do I change the current working directory in Python?
Equivalent of shell 'cd' command to change the working directory?
1
0
0
1,317,026
431,684
2009-01-10T20:28:00.000
12
0
0
1
python,cd
431,695
14
false
0
0
os.chdir() is the right way.
3
797
0
cd is the shell command to change the working directory. How do I change the current working directory in Python?
Equivalent of shell 'cd' command to change the working directory?
1
0
0
1,317,026
431,996
2009-01-10T23:57:00.000
1
0
1
0
python,data-structures,sudoku
432,008
8
false
0
0
The simplest way to do it is to represent the board by a 2D 9x9 array. You'll want to have references to each row, column and 3x3 box as a separate object, so storing each cell in a String makes more sense (in Java) than using a primitive. With a String you can keep references to the same object in multiple container...
5
0
0
I'm trying to create a sudoku solver program in Java (maybe Python). I'm just wondering how I should go about structuring this... Do I create a class and make each box a object of that class (9x9=81 objects)? If yes, how do I control all the objects - in other words, how do I make them all call a certain method in the ...
Programming Design Help - How to Structure a Sudoku Solver program?
0.024995
0
0
10,048
431,996
2009-01-10T23:57:00.000
0
0
1
0
python,data-structures,sudoku
432,001
8
false
0
0
Maybe a design that had a box per square, and another class to represent the puzzle itself that would have a collection of boxes, contain all the rules for box interactions, and control the overall game would be a good design.
5
0
0
I'm trying to create a sudoku solver program in Java (maybe Python). I'm just wondering how I should go about structuring this... Do I create a class and make each box a object of that class (9x9=81 objects)? If yes, how do I control all the objects - in other words, how do I make them all call a certain method in the ...
Programming Design Help - How to Structure a Sudoku Solver program?
0
0
0
10,048
431,996
2009-01-10T23:57:00.000
2
0
1
0
python,data-structures,sudoku
432,003
8
false
0
0
Well, I would use one class for the sudoku itself, with a 9 x 9 array and all the functionality to add numbers and detect errors in the pattern. Another class will be used to solve the puzzle.
5
0
0
I'm trying to create a sudoku solver program in Java (maybe Python). I'm just wondering how I should go about structuring this... Do I create a class and make each box a object of that class (9x9=81 objects)? If yes, how do I control all the objects - in other words, how do I make them all call a certain method in the ...
Programming Design Help - How to Structure a Sudoku Solver program?
0.049958
0
0
10,048
431,996
2009-01-10T23:57:00.000
0
0
1
0
python,data-structures,sudoku
432,052
8
false
0
0
First, it looks like there are two kinds of cells. Known calls; those with a fixed value, no choices. Unknown cells; those with a set of candidate values that reduces down to a single final value. Second, there are several groups of cells. Horizontal rows and Vertical columns which must have one cell of each value. ...
5
0
0
I'm trying to create a sudoku solver program in Java (maybe Python). I'm just wondering how I should go about structuring this... Do I create a class and make each box a object of that class (9x9=81 objects)? If yes, how do I control all the objects - in other words, how do I make them all call a certain method in the ...
Programming Design Help - How to Structure a Sudoku Solver program?
0
0
0
10,048
431,996
2009-01-10T23:57:00.000
12
0
1
0
python,data-structures,sudoku
432,000
8
false
0
0
Don't over-engineer it. It's a 2-D array or maybe a Board class that represents a 2-D array at best. Have functions that calculate a given row/column and functions that let you access each square. Additional methods can be used validate that each sub-3x3 and row/column don't violate the required constraints.
5
0
0
I'm trying to create a sudoku solver program in Java (maybe Python). I'm just wondering how I should go about structuring this... Do I create a class and make each box a object of that class (9x9=81 objects)? If yes, how do I control all the objects - in other words, how do I make them all call a certain method in the ...
Programming Design Help - How to Structure a Sudoku Solver program?
1
0
0
10,048
432,115
2009-01-11T01:23:00.000
1
0
0
0
python,session
432,200
3
false
1
0
A cron job to clean up any expired session data in the database is a good thing. Depending on how long your sessions last, and how big your database is, you might want to cleanup more often than once per day. But one cleanup pass per day is usually fine.
3
1
0
I'm writing a webapp that will only be used by authenticated users. Some temporary databases and log files will be created during each user session. I'd like to erase all these temp files when the session is finished. Obviously, a logout or window close event would be sufficient to close the session, but in some cases...
when to delete user's session
0.066568
0
0
988
432,115
2009-01-11T01:23:00.000
1
0
0
0
python,session
432,126
3
true
1
0
User sessions should have a timeout value and should be closed when the timeout expires or the user logs out. Log out is an obvious time to do this and the time out needs to be there in case the user navigates away from your application without logging out.
3
1
0
I'm writing a webapp that will only be used by authenticated users. Some temporary databases and log files will be created during each user session. I'd like to erase all these temp files when the session is finished. Obviously, a logout or window close event would be sufficient to close the session, but in some cases...
when to delete user's session
1.2
0
0
988
432,115
2009-01-11T01:23:00.000
0
0
0
0
python,session
432,170
3
false
1
0
Delete User's Session during: 1) Logout 2) Automatic timeout (the length of the timeout can be set through the web.config) 3) As part of any other routine maintenance methods you already have running by deleting any session information which hasn't been accessed for some defined period of time (likely shorter than your...
3
1
0
I'm writing a webapp that will only be used by authenticated users. Some temporary databases and log files will be created during each user session. I'd like to erase all these temp files when the session is finished. Obviously, a logout or window close event would be sufficient to close the session, but in some cases...
when to delete user's session
0
0
0
988
433,945
2009-01-11T23:03:00.000
4
0
1
0
java,python,jfilechooser
433,967
6
false
0
1
wxPython (www.wxpython.org) provides the wx.FileDialog class which will give you a native file selection dialog on any of the supported platforms (Mac, Linux or Windows).
2
4
0
I was wondering if there is something similar to Java's JFileChooser for Python? JFileChooser is a graphical front end to choose a file. Preferably something that is already with Python. Maybe with Tkinter.
JFileChooser for Python?
0.132549
0
0
2,182