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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1,994,403 | 2010-01-03T09:12:00.000 | 1 | 0 | 0 | 1 | python,mysql | 1,994,987 | 1 | true | 0 | 0 | .pyd files are DLLs. You can't usefully open them in text editors. | 1 | 0 | 0 | My IDE is 'ulipad', and when I open the file, it can't be shown. How can I get it? | How can I open '_mysql.pyd' in 'D:\Python25\Lib\site-packages'? | 1.2 | 0 | 0 | 468 |
1,994,488 | 2010-01-03T10:06:00.000 | 5 | 1 | 0 | 1 | python | 42,249,637 | 6 | false | 0 | 0 | shutil.copy and shutil.copy2 are copying files.
shutil.copytree copies a folder with all the files and all subfolders. shutil.copytree is using shutil.copy2 to copy the files.
So the analog to cp -r you are saying is the shutil.copytree because cp -r targets and copies a folder and its files/subfolders like shutil.copy... | 1 | 143 | 0 | Python seems to have functions for copying files (e.g. shutil.copy) and functions for copying directories (e.g. shutil.copytree) but I haven't found any function that handles both. Sure, it's trivial to check whether you want to copy a file or a directory, but it seems like a strange omission.
Is there really no standa... | Copy file or directories recursively in Python | 0.16514 | 0 | 0 | 192,392 |
1,994,507 | 2010-01-03T10:14:00.000 | 7 | 0 | 0 | 0 | python,django,multithreading | 1,994,563 | 2 | false | 1 | 0 | Why would you want to do that? runserver is for development only, it should never be used in production. And if you're running via Apache, it should manage threads/processes for you anyway. | 2 | 0 | 0 | I want to start a thread when django project runserver successfully.
where can I put the create-thread-and-start code? Is there any hook for the django runserver? | how to start a thread when django runserver? | 1 | 0 | 0 | 2,758 |
1,994,507 | 2010-01-03T10:14:00.000 | 0 | 0 | 0 | 0 | python,django,multithreading | 1,997,921 | 2 | false | 1 | 0 | Agree with the above answer, you probably don't want to do this. Runserver should be used for development only. Once you deploy, you'll want to move to Apache/WSGI. On my dev machine (where I do use runserver), I usually throw it in a screen session, so it doesn't get in the way, but I can pull it back up if I need to ... | 2 | 0 | 0 | I want to start a thread when django project runserver successfully.
where can I put the create-thread-and-start code? Is there any hook for the django runserver? | how to start a thread when django runserver? | 0 | 0 | 0 | 2,758 |
1,994,703 | 2010-01-03T11:35:00.000 | 0 | 0 | 0 | 0 | java,python,android,scala,dalvik | 56,733,101 | 8 | false | 1 | 0 | 1) Angular + nativeScript
2) Reactnative | 2 | 65 | 0 | In theory, Dalvik executes any virtual machine byte code, created for example with the compilers of
AspectJ
ColdFusion
Clojure
Groovy
JavaFX Script
JRuby
Jython
Rhino
Scala
Are there already working versions of bytecode compilers for Dalvik available for other languages than Java? | Which programming languages can I use on Android Dalvik? | 0 | 0 | 0 | 20,672 |
1,994,703 | 2010-01-03T11:35:00.000 | 0 | 0 | 0 | 0 | java,python,android,scala,dalvik | 1,994,959 | 8 | false | 1 | 0 | The dynamically typed languages wont be possible until Dalvik supports JIT (Just In Time) compiling. I believe there is JIT support in one of the experimental Eclair branches, but it is not yet officially available/supported in Android. | 2 | 65 | 0 | In theory, Dalvik executes any virtual machine byte code, created for example with the compilers of
AspectJ
ColdFusion
Clojure
Groovy
JavaFX Script
JRuby
Jython
Rhino
Scala
Are there already working versions of bytecode compilers for Dalvik available for other languages than Java? | Which programming languages can I use on Android Dalvik? | 0 | 0 | 0 | 20,672 |
1,994,760 | 2010-01-03T11:58:00.000 | 0 | 0 | 1 | 0 | python,tkinter | 27,392,691 | 2 | false | 0 | 1 | If you are using linux just open your terminal and type python and in the python interpreter type from Tkinter import* if it doesn't show any error messages you are good to go. You can try this to check every package of python like Pygame just replace Tkinter by Pygame | 1 | 0 | 0 | I have downloaded python 2.5. I would like to know if Tkinter is included with python or is it a separate download? | Is Tkinter included with Python 2.5? | 0 | 0 | 0 | 1,047 |
1,995,102 | 2010-01-03T14:21:00.000 | 0 | 1 | 1 | 1 | python,runlevel | 1,996,354 | 2 | false | 0 | 0 | Yes. The scripts that control daemons are (normally) plain old bash scripts and can run whatever a bash script can run. The only difference is that in a low runlevel, lots of other system services will not be running, so if the program tries to do something that depends on another daemon, that may fail. | 1 | 1 | 0 | Is it possible for a python script to execute at a low run level?
Edit:
To clarify, is it possible for a python script to run in the background, kind of like a daemon. | Python execution | 0 | 0 | 0 | 523 |
1,995,615 | 2010-01-03T17:30:00.000 | 1 | 0 | 1 | 0 | python,string-formatting | 58,435,357 | 13 | false | 0 | 0 | The Easiest way example to show you how to do that is :
Code :
>>> points = 19.5
>>> total = 22
>>>'Correct answers: {:.2%}'.format(points/total)
`
Output : Correct answers: 88.64% | 2 | 320 | 0 | I want to display:
49 as 49.00
and:
54.9 as 54.90
Regardless of the length of the decimal or whether there are are any decimal places, I would like to display a Decimal with 2 decimal places, and I'd like to do it in an efficient way. The purpose is to display money values.
eg, 4898489.00 | How can I format a decimal to always show 2 decimal places? | 0.015383 | 0 | 0 | 614,899 |
1,995,615 | 2010-01-03T17:30:00.000 | 3 | 0 | 1 | 0 | python,string-formatting | 63,473,022 | 13 | false | 0 | 0 | This is the same solution as you have probably seen already, but by doing it this way it's more clearer:
>>> num = 3.141592654
>>> print(f"Number: {num:.2f}") | 2 | 320 | 0 | I want to display:
49 as 49.00
and:
54.9 as 54.90
Regardless of the length of the decimal or whether there are are any decimal places, I would like to display a Decimal with 2 decimal places, and I'd like to do it in an efficient way. The purpose is to display money values.
eg, 4898489.00 | How can I format a decimal to always show 2 decimal places? | 0.046121 | 0 | 0 | 614,899 |
1,995,734 | 2010-01-03T18:06:00.000 | 4 | 1 | 1 | 0 | c++,python,c,exception | 1,996,011 | 10 | false | 0 | 0 | The key thing an exception implementation needs to handle is how to return to the exception handler once an exception has been thrown. Since you may have made an arbitrary number of nested function calls since the try statement in C++, it must unwind the call stack searching for the handler. However implemented, this m... | 4 | 71 | 0 | Just about everyone uses them, but many, including me simply take it for granted that they just work.
I am looking for high-quality material. Languages I use are: Java, C, C#, Python, C++, so these are of most interest to me.
Now, C++ is probably a good place to start since you can throw anything in that language.
Als... | How are exceptions implemented under the hood? | 0.07983 | 0 | 0 | 9,676 |
1,995,734 | 2010-01-03T18:06:00.000 | 49 | 1 | 1 | 0 | c++,python,c,exception | 1,995,979 | 10 | true | 0 | 0 | Exceptions are just a specific example of a more general case of advanced non-local flow control constructs. Other examples are:
notifications (a generalization of exceptions, originally from some old Lisp object system, now implemented in e.g. CommonLisp and Ioke),
continuations (a more structured form of GOTO, popu... | 4 | 71 | 0 | Just about everyone uses them, but many, including me simply take it for granted that they just work.
I am looking for high-quality material. Languages I use are: Java, C, C#, Python, C++, so these are of most interest to me.
Now, C++ is probably a good place to start since you can throw anything in that language.
Als... | How are exceptions implemented under the hood? | 1.2 | 0 | 0 | 9,676 |
1,995,734 | 2010-01-03T18:06:00.000 | 1 | 1 | 1 | 0 | c++,python,c,exception | 1,995,769 | 10 | false | 0 | 0 | Regarding performance - sparse use of exceptions will probably have negligible effects, but do not abuse them.
I have personally seen Java code which performed two orders of magnitude worse than it could have (took about x100 the time) because exceptions were used in an important loop instead of more standard if/return... | 4 | 71 | 0 | Just about everyone uses them, but many, including me simply take it for granted that they just work.
I am looking for high-quality material. Languages I use are: Java, C, C#, Python, C++, so these are of most interest to me.
Now, C++ is probably a good place to start since you can throw anything in that language.
Als... | How are exceptions implemented under the hood? | 0.019997 | 0 | 0 | 9,676 |
1,995,734 | 2010-01-03T18:06:00.000 | 5 | 1 | 1 | 0 | c++,python,c,exception | 1,995,737 | 10 | false | 0 | 0 | setjmp() and longjmp() usually.
Exception catching does have a non-trivial cost, but for most purposes it's not a big deal. | 4 | 71 | 0 | Just about everyone uses them, but many, including me simply take it for granted that they just work.
I am looking for high-quality material. Languages I use are: Java, C, C#, Python, C++, so these are of most interest to me.
Now, C++ is probably a good place to start since you can throw anything in that language.
Als... | How are exceptions implemented under the hood? | 0.099668 | 0 | 0 | 9,676 |
1,996,377 | 2010-01-03T21:25:00.000 | 3 | 0 | 0 | 0 | python,tkinter,fsm | 1,997,043 | 2 | false | 0 | 1 | Tkinter is perfectly fine for this sort of application. In the past I've worked on tools that were boxes connected with arrows that stayed connected as you move the boxes around (which is what I think you are asking about). Don't let people who don't know much about Tkinter sway you -- it's a perfectly fine toolkit and... | 1 | 3 | 0 | I am currently writing a fsm editor with tkinter. But, I stuck on connecting two states. I have two questions:
1) How can make the transition arrow growable according to mouse movement?
2) How can I stick the starting point of the arrow on a state and the end point of the arrow on another state?
PS. Do you think the do... | How to connect two state circles with an arrow in tkinter? | 0.291313 | 0 | 0 | 2,543 |
1,997,449 | 2010-01-04T04:01:00.000 | 0 | 1 | 1 | 0 | python,package | 1,997,473 | 4 | false | 0 | 0 | A real simple method is to delete all .pyc files from the package or folder, and then run the application. Once you've played a bit, do a directory listing and see which files have .pyc files now. Those are modules which were imported by the application.
(Note: the __main__ module, whichever one you invoke as the "m... | 1 | 44 | 0 | What's an easy way of finding all the python modules from a particular package that are being used in an application? | Find which python modules are being imported | 0 | 0 | 0 | 20,841 |
1,997,663 | 2010-01-04T05:37:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine | 1,997,676 | 1 | true | 1 | 0 | Later requests that happen to be served on the same process (you can't control that) would access just the same mod1.my_data object (unless you take pains to reassign it as a fresh object at the start of each request, of course). | 1 | 1 | 0 | To share a state(e.g. user) between a module in django people sometime use thread local storage, but as google app engine follows CGI standard and keeps state of a request in os.environ , can I share objects between two modules just by setting it e.g.
mod1.my_data = {} and now any other module can get handle to my_data... | sharing objects between module in GAE | 1.2 | 0 | 0 | 130 |
1,997,710 | 2010-01-04T05:49:00.000 | 4 | 0 | 0 | 0 | python,pygame | 52,403,647 | 9 | false | 0 | 1 | Replace if event.type == pygame.quit(): by if event.type == pygame.QUIT: | 3 | 8 | 0 | Can anyone tell me why my app quits with:
pygame error: display Surface quit. | Pygame error: display surface quit: Why? | 0.088656 | 0 | 0 | 28,022 |
1,997,710 | 2010-01-04T05:49:00.000 | 2 | 0 | 0 | 0 | python,pygame | 59,687,711 | 9 | false | 0 | 1 | Make sure if you write pygame.QUIT: and not pygame.quit():
I know it sounds weird, but I had the same problem. | 3 | 8 | 0 | Can anyone tell me why my app quits with:
pygame error: display Surface quit. | Pygame error: display surface quit: Why? | 0.044415 | 0 | 0 | 28,022 |
1,997,710 | 2010-01-04T05:49:00.000 | 11 | 0 | 0 | 0 | python,pygame | 4,317,744 | 9 | false | 0 | 1 | I had similar problem and discovered that Surface objects don't like to be deepcopied. When I used copy.deepcopy() on such object and then accessed the copy, I got that strange error message (without calling pygame.quit()). Maybe you experience similar behavior? | 3 | 8 | 0 | Can anyone tell me why my app quits with:
pygame error: display Surface quit. | Pygame error: display surface quit: Why? | 1 | 0 | 0 | 28,022 |
1,998,104 | 2010-01-04T07:58:00.000 | 22 | 0 | 1 | 0 | python,regex,user-input,sanitize | 1,998,507 | 6 | true | 0 | 0 | I have worked on a program that allows users to enter their own regex and you are right - they can (and do) enter regex that can take a long time to finish - sometimes longer than than the lifetime of the universe. What is worse, while processing a regex Python holds the GIL, so it will not only hang the thread that i... | 3 | 16 | 0 | I would like to let my users use regular expressions for some features. I'm curious what the implications are of passing user input to re.compile(). I assume there is no way for a user to give me a string that could let them execute arbitrary code. The dangers I have thought of are:
The user could pass input that r... | Is it safe to use user input for Python's regular expressions? | 1.2 | 0 | 0 | 3,068 |
1,998,104 | 2010-01-04T07:58:00.000 | 1 | 0 | 1 | 0 | python,regex,user-input,sanitize | 1,998,499 | 6 | false | 0 | 0 | It's not necessary to use compile() except when you need to reuse a lot of different regular expressions. The module already caches the last expressions.
The point 2 (at execution) could be a very difficult one if you allow the user to input any regular expression. You can make a complex regexp with few characters, lik... | 3 | 16 | 0 | I would like to let my users use regular expressions for some features. I'm curious what the implications are of passing user input to re.compile(). I assume there is no way for a user to give me a string that could let them execute arbitrary code. The dangers I have thought of are:
The user could pass input that r... | Is it safe to use user input for Python's regular expressions? | 0.033321 | 0 | 0 | 3,068 |
1,998,104 | 2010-01-04T07:58:00.000 | 0 | 0 | 1 | 0 | python,regex,user-input,sanitize | 1,998,350 | 6 | false | 0 | 0 | You technically don't need to use re.compile() to perform a regular expression operation on a string. In fact, the compile method can often be slower if you're only executing the operation once since there's overhead associated with the initial compiling.
If you're worried about the word "compile" then avoid it all to... | 3 | 16 | 0 | I would like to let my users use regular expressions for some features. I'm curious what the implications are of passing user input to re.compile(). I assume there is no way for a user to give me a string that could let them execute arbitrary code. The dangers I have thought of are:
The user could pass input that r... | Is it safe to use user input for Python's regular expressions? | 0 | 0 | 0 | 3,068 |
2,000,331 | 2010-01-04T15:52:00.000 | 2 | 0 | 0 | 1 | java,python,ram | 2,000,424 | 3 | true | 1 | 0 | It's hard to be sure without knowing more detail - like which OS you're on - but my guess is that you're using a 32-bit version of Python which means that when you launch Java, you're also getting the 32-bit version which has a heap size limit of 4GB.
To test if this is the case, compare the output of java -version whe... | 2 | 1 | 0 | I am using using os.system call from python to run jar file.
The jar file requires large heap space and thus i am allocating 4 Gb heap space using Xmx.
When i execute the command
"java -Xms4096m -Xmx4096m -jar camXnet.jar net.txt"
from command line it executes properly, however when i call it from a python program vi... | Problem allocating heap space over 4 GB when calling java "from Python" | 1.2 | 0 | 0 | 1,663 |
2,000,331 | 2010-01-04T15:52:00.000 | 1 | 0 | 0 | 1 | java,python,ram | 2,122,159 | 3 | false | 1 | 0 | I was having the same problem launching 64bit Java from 32bit python. I solved the problem using Dave Webb's suggestiong of putting the full path to 64bit Java.exe in the python script. This worked fine so it is not necessary to use 64 bit Python | 2 | 1 | 0 | I am using using os.system call from python to run jar file.
The jar file requires large heap space and thus i am allocating 4 Gb heap space using Xmx.
When i execute the command
"java -Xms4096m -Xmx4096m -jar camXnet.jar net.txt"
from command line it executes properly, however when i call it from a python program vi... | Problem allocating heap space over 4 GB when calling java "from Python" | 0.066568 | 0 | 0 | 1,663 |
2,000,631 | 2010-01-04T16:39:00.000 | 8 | 0 | 0 | 0 | python,django | 2,001,956 | 9 | false | 1 | 0 | I would pay a reasonable amount for a Django-tailored IDE or plug-in. I don't know what I mean by reasonable, but maye it helps to know that I would not pay more than $75, and I would only pay the $75 if the tool was really awesome.
Now, Django specific features:
Seamless integration with Google Apps
(get me the urchi... | 6 | 8 | 0 | My company is evaluating the possibility of developing a specialized IDE for Django.
So we would like to ask Django users:
Do you feel the need for a specialized IDE for Django?
Would you be willing to pay for it, or would you only consider free a open-source product?
What Django-specific features are you missing c... | Does Django need an IDE? | 1 | 0 | 0 | 3,510 |
2,000,631 | 2010-01-04T16:39:00.000 | 0 | 0 | 0 | 0 | python,django | 2,012,679 | 9 | false | 1 | 0 | I would definitely pay or donate for a pure Django IDE, even tho there are already some existing plugins, I feel something is always "floating". | 6 | 8 | 0 | My company is evaluating the possibility of developing a specialized IDE for Django.
So we would like to ask Django users:
Do you feel the need for a specialized IDE for Django?
Would you be willing to pay for it, or would you only consider free a open-source product?
What Django-specific features are you missing c... | Does Django need an IDE? | 0 | 0 | 0 | 3,510 |
2,000,631 | 2010-01-04T16:39:00.000 | 1 | 0 | 0 | 0 | python,django | 2,001,415 | 9 | true | 1 | 0 | It's great that your company wants to contribute to the community, but I have to say that I don't see what a 'Django IDE' would achieve. There are already plugins for all the main editors and IDEs to support Django - from Vim to TextMate to NetBeans - and these provide syntax highlighting, indentation, shortcuts and sn... | 6 | 8 | 0 | My company is evaluating the possibility of developing a specialized IDE for Django.
So we would like to ask Django users:
Do you feel the need for a specialized IDE for Django?
Would you be willing to pay for it, or would you only consider free a open-source product?
What Django-specific features are you missing c... | Does Django need an IDE? | 1.2 | 0 | 0 | 3,510 |
2,000,631 | 2010-01-04T16:39:00.000 | 2 | 0 | 0 | 0 | python,django | 2,000,657 | 9 | false | 1 | 0 | I use NotePad++, and have yet to need a fully-fledged IDE specifically for Django (though I do wish NotePad++ would stop periodically crashing).
I wouldn't, unless it was really really good (and I have no idea what features it'd need to make me enthusiastic enough to pay for it).
Maybe a neater way to tie together code... | 6 | 8 | 0 | My company is evaluating the possibility of developing a specialized IDE for Django.
So we would like to ask Django users:
Do you feel the need for a specialized IDE for Django?
Would you be willing to pay for it, or would you only consider free a open-source product?
What Django-specific features are you missing c... | Does Django need an IDE? | 0.044415 | 0 | 0 | 3,510 |
2,000,631 | 2010-01-04T16:39:00.000 | 2 | 0 | 0 | 0 | python,django | 2,002,644 | 9 | false | 1 | 0 | This question comes up a lot in various forms. I suspect it's because there just isn't a Python IDE which is universally accepted to be awesome.
If I could have:
some of the features of PyDev, like like real code completion, module navigation, live syntax checking and pylint
a fantastic (and fast) text editor (like e... | 6 | 8 | 0 | My company is evaluating the possibility of developing a specialized IDE for Django.
So we would like to ask Django users:
Do you feel the need for a specialized IDE for Django?
Would you be willing to pay for it, or would you only consider free a open-source product?
What Django-specific features are you missing c... | Does Django need an IDE? | 0.044415 | 0 | 0 | 3,510 |
2,000,631 | 2010-01-04T16:39:00.000 | 4 | 0 | 0 | 0 | python,django | 2,000,679 | 9 | false | 1 | 0 | I am using Komodo Edit and it's very good. There is a lot of good open-sources product so i don't think that I would buy a commercial product.
Maybe a very good and easy-to-use debugger would make me change my mind.
I hope it helps. | 6 | 8 | 0 | My company is evaluating the possibility of developing a specialized IDE for Django.
So we would like to ask Django users:
Do you feel the need for a specialized IDE for Django?
Would you be willing to pay for it, or would you only consider free a open-source product?
What Django-specific features are you missing c... | Does Django need an IDE? | 0.088656 | 0 | 0 | 3,510 |
2,001,504 | 2010-01-04T19:13:00.000 | 0 | 0 | 1 | 0 | python,lex,ply | 2,001,553 | 5 | false | 0 | 0 | It really depends on how big your project is going to end up being: If you're looking at creating a new language or something that's parsing more interesting grammars than just + then I'd say lex would be a fun and entertaining way to spend an afternoon.
On the other hand, writing your own parser is extremely informat... | 2 | 4 | 0 | I'm in the process of writing a small, rule-based 'math' engine. I realize this is unclear, so I'll provide a small example.
Let's say you have some variable a, that holds an integer. You also have some functions you can apply to the number, i.e.
sqr - square the number
flp - flip the bits of the number
dec - decremen... | Should I use Lex or a home-brewed solution to parse a formula? | 0 | 0 | 0 | 183 |
2,001,504 | 2010-01-04T19:13:00.000 | -1 | 0 | 1 | 0 | python,lex,ply | 2,001,562 | 5 | false | 0 | 0 | If you have some free time and want to learn a new programming paradigm, give Prolog a spin! | 2 | 4 | 0 | I'm in the process of writing a small, rule-based 'math' engine. I realize this is unclear, so I'll provide a small example.
Let's say you have some variable a, that holds an integer. You also have some functions you can apply to the number, i.e.
sqr - square the number
flp - flip the bits of the number
dec - decremen... | Should I use Lex or a home-brewed solution to parse a formula? | -0.039979 | 0 | 0 | 183 |
2,002,055 | 2010-01-04T20:33:00.000 | 9 | 1 | 0 | 0 | python,pdf,image | 2,002,436 | 6 | false | 1 | 0 | You could call e.g. pdftoppm from the command-line (or using Python's subprocess module) and then convert the resulting PPM files to the desired format using e.g. ImageMagick (again, using subprocess or some bindings if they exist). | 1 | 34 | 0 | So the state I'm in released a bunch of data in PDF form, but to make matters worse, most (all?) of the PDFs appear to be letters typed in Office, printed/fax, and then scanned (our government at its best eh?). At first I thought I was crazy, but then I started seeing numerous pdfs that are 'tilted', like someone didn'... | Converting PDF to images automatically | 1 | 0 | 0 | 70,011 |
2,002,180 | 2010-01-04T20:57:00.000 | 3 | 1 | 0 | 0 | python,cgi | 2,002,206 | 1 | true | 1 | 0 | Same as you should do with every POST: don't send output, but put the output in a session variable and redirect to a pure-GET request. This one looks in the session for messages, and clears+displays those. | 1 | 1 | 0 | I have a Python CGI handling a payment transaction. When the user submits the form, the CGI is called. After submission, the CGI takes a while to perform the credit card transaction. During that time, a user might hit the ESC or refresh button. Doing that will not "kill" the CGI, meaning, the script will keep running c... | Python CGI transaction | 1.2 | 0 | 0 | 262 |
2,003,506 | 2010-01-05T01:12:00.000 | 1 | 1 | 0 | 0 | c++,boost,build-process,makefile,boost-python | 2,003,592 | 4 | false | 0 | 0 | Run bjam from the makefile, just for building that part | 1 | 8 | 0 | I'm working on a c++ project, and we recently needed to include a small part of boost in it. The boost part is really minimal (Boost::Python), thus, using bjam to build everything looks like an overkill (besides, everyone working on the project feels comfortable with make, and has no knowloedge of jam).
I made quite so... | How to build a boost dependent project using regular makefiles? | 0.049958 | 0 | 0 | 2,460 |
2,003,527 | 2010-01-05T01:17:00.000 | 1 | 0 | 0 | 0 | python,django | 2,007,779 | 4 | true | 1 | 0 | The core of a project is a settings.py and a root urls.py. Both of those are Python modules, thus they need to be importable somehow. You can put the project directory directly on the Python path and thus make them importable as top-level modules, but that's arguably even worse practice. Better to have the project be a... | 4 | 2 | 0 | Why aren't they simply directories? Any good advice says to keep as much as possible in the apps and not to couple them to the project. The very ability to import an app as project.application discourages this. Why does django-admin.py create the __init__.py at all? The project is perfectly useful without it. What is t... | Why are django projects python packages? | 1.2 | 0 | 0 | 306 |
2,003,527 | 2010-01-05T01:17:00.000 | 0 | 0 | 0 | 0 | python,django | 2,003,806 | 4 | false | 1 | 0 | I think the idea is that you can reuse the applications but you don't need to move them from the project where they were initially created. If the project weren't a package you would need to copy/move the application you want to reuse to a python package. Because of that being the project itself a proper python package... | 4 | 2 | 0 | Why aren't they simply directories? Any good advice says to keep as much as possible in the apps and not to couple them to the project. The very ability to import an app as project.application discourages this. Why does django-admin.py create the __init__.py at all? The project is perfectly useful without it. What is t... | Why are django projects python packages? | 0 | 0 | 0 | 306 |
2,003,527 | 2010-01-05T01:17:00.000 | 1 | 0 | 0 | 0 | python,django | 2,003,748 | 4 | false | 1 | 0 | There isn't a requirement that apps be inside the project's namespace, to my knowledge. Just that they be on the $PYTHONPATH. As such, they are usable by any other code on the system which shares the same PYTHONPATH. | 4 | 2 | 0 | Why aren't they simply directories? Any good advice says to keep as much as possible in the apps and not to couple them to the project. The very ability to import an app as project.application discourages this. Why does django-admin.py create the __init__.py at all? The project is perfectly useful without it. What is t... | Why are django projects python packages? | 0.049958 | 0 | 0 | 306 |
2,003,527 | 2010-01-05T01:17:00.000 | 2 | 0 | 0 | 0 | python,django | 2,003,550 | 4 | false | 1 | 0 | We have a single project that we "subclass" of sorts for other projects. So we have other projects that import stuff from the main project. I guess for us it provides the common namespace that contains all the other apps.
We could move to a package with all our apps in it separate from the projects i guess. Our system ... | 4 | 2 | 0 | Why aren't they simply directories? Any good advice says to keep as much as possible in the apps and not to couple them to the project. The very ability to import an app as project.application discourages this. Why does django-admin.py create the __init__.py at all? The project is perfectly useful without it. What is t... | Why are django projects python packages? | 0.099668 | 0 | 0 | 306 |
2,003,630 | 2010-01-05T01:44:00.000 | 1 | 0 | 0 | 1 | python,ajax,image,google-app-engine | 2,041,528 | 4 | false | 1 | 0 | As an improvement to Alex's answer, there's no need to use memcache: Simply do a keys-only query to get a list of keys of images you want to send to the client, then use db.get() to fetch the image corresponding to the required key for each image request. This requires roughly the same amount of effort as a single regu... | 4 | 0 | 0 | I am working on a social-network type of application on App Engine, and would like to send multiple images to the client based on a single get request. In particular, when a client loads a page, they should see all images that are associated with their account.
I am using python on the server side, and would like to u... | AppEngine/Python, query database and send multiple images to the client as a response to a single get request | 0.049958 | 0 | 0 | 856 |
2,003,630 | 2010-01-05T01:44:00.000 | 2 | 0 | 0 | 1 | python,ajax,image,google-app-engine | 2,003,692 | 4 | true | 1 | 0 | The App Engine part isn't much of a problem (as long as the number of images and total size doesn't exceed GAE's limits), but the user's browser is unlikely to know what to do in order to receive multiple payloads per GET request -- that's just not how the web works. I guess you could concatenate all the blobs/bytestr... | 4 | 0 | 0 | I am working on a social-network type of application on App Engine, and would like to send multiple images to the client based on a single get request. In particular, when a client loads a page, they should see all images that are associated with their account.
I am using python on the server side, and would like to u... | AppEngine/Python, query database and send multiple images to the client as a response to a single get request | 1.2 | 0 | 0 | 856 |
2,003,630 | 2010-01-05T01:44:00.000 | 0 | 0 | 0 | 1 | python,ajax,image,google-app-engine | 2,003,690 | 4 | false | 1 | 0 | Send the client URLs for all the images in one hit, and deal with it on the client. That fits with the design of the protocol, and still lets you only make one query. The client might, if you're lucky, be able to stream those back in its next request, but the neat thing is that it'll work (eventually) even if it can'... | 4 | 0 | 0 | I am working on a social-network type of application on App Engine, and would like to send multiple images to the client based on a single get request. In particular, when a client loads a page, they should see all images that are associated with their account.
I am using python on the server side, and would like to u... | AppEngine/Python, query database and send multiple images to the client as a response to a single get request | 0 | 0 | 0 | 856 |
2,003,630 | 2010-01-05T01:44:00.000 | 0 | 0 | 0 | 1 | python,ajax,image,google-app-engine | 2,003,652 | 4 | false | 1 | 0 | Trying to send all of the images in one request means that you will be fighting very hard against some of the fundamental assumptions of the web and browser technology. If you don't have a really, really compelling reason to do this, you should consider delivering one image per request. That already works now, no sweat... | 4 | 0 | 0 | I am working on a social-network type of application on App Engine, and would like to send multiple images to the client based on a single get request. In particular, when a client loads a page, they should see all images that are associated with their account.
I am using python on the server side, and would like to u... | AppEngine/Python, query database and send multiple images to the client as a response to a single get request | 0 | 0 | 0 | 856 |
2,003,693 | 2010-01-05T01:57:00.000 | 2 | 0 | 1 | 0 | python,json,sqlite,pickle | 2,176,880 | 4 | false | 0 | 0 | What are your criteria for "best" ?
pickle can do most Python structures, deeply nested ones too
sqlite dbs can be easily queried (if you know sql :)
speed / memory ? trust no benchmarks that you haven't faked yourself.
(Fine print:
cPickle.dump(protocol=-1) compresses, in one case 15M pickle / 60M sqlite, but can br... | 2 | 10 | 0 | Looking for advice on the best technique for saving complex Python data structures across program sessions.
Here's a list of techniques I've come up with so far:
pickle/cpickle
json
jsonpickle
xml
database (like SQLite)
Pickle is the easiest and fastest technique, but my understanding is that there is no guarantee th... | Best way to save complex Python data structures across program sessions (pickle, json, xml, database, other) | 0.099668 | 0 | 0 | 3,167 |
2,003,693 | 2010-01-05T01:57:00.000 | 15 | 0 | 1 | 0 | python,json,sqlite,pickle | 2,003,704 | 4 | true | 0 | 0 | You have a misconception about pickles: they are guaranteed to work across Python versions. You simply have to choose a protocol version that is supported by all the Python versions you care about.
The technique you left out is marshal, which is not guaranteed to work across Python versions (and btw, is how .pyc files... | 2 | 10 | 0 | Looking for advice on the best technique for saving complex Python data structures across program sessions.
Here's a list of techniques I've come up with so far:
pickle/cpickle
json
jsonpickle
xml
database (like SQLite)
Pickle is the easiest and fastest technique, but my understanding is that there is no guarantee th... | Best way to save complex Python data structures across program sessions (pickle, json, xml, database, other) | 1.2 | 0 | 0 | 3,167 |
2,005,150 | 2010-01-05T09:45:00.000 | 16 | 0 | 0 | 0 | python,django,class | 2,007,514 | 2 | true | 1 | 0 | I believe that there is no real reason (including history, since new-style classes exist since Python 2.2) and that not only can you choose to use a new-style class instead, but that it would probably be a good idea for you to do so (for all the usual reasons). | 2 | 19 | 0 | I noticed that in Django models, there is a class Meta which makes some additional definitions about the model.
My question is, why is this done as an old-style class? (i.e. not subclassing object?) Is there a reason for this or is this just a custom? Could I do it as a new-style class in my projects? | Why is Django's Meta an old-style class? | 1.2 | 0 | 0 | 1,752 |
2,005,150 | 2010-01-05T09:45:00.000 | 9 | 0 | 0 | 0 | python,django,class | 2,007,686 | 2 | false | 1 | 0 | Since class Meta is never anything but a simple namespace container, there is zero advantage to subclassing object; just eight extra characters to type. Won't hurt anything to do so if you feel like it, though. | 2 | 19 | 0 | I noticed that in Django models, there is a class Meta which makes some additional definitions about the model.
My question is, why is this done as an old-style class? (i.e. not subclassing object?) Is there a reason for this or is this just a custom? Could I do it as a new-style class in my projects? | Why is Django's Meta an old-style class? | 1 | 0 | 0 | 1,752 |
2,005,443 | 2010-01-05T10:46:00.000 | 1 | 0 | 0 | 0 | python,inotify,pyinotify | 2,005,571 | 1 | true | 0 | 1 | Could it be that it is a polling mechanism with a timeout of about 4 seconds? And that the thread is only really stopped when it is entering the run() stage?
That might have something to do with the threading library.
You could test that by using a notifier with a different timeout. | 1 | 0 | 0 | I have a wxPython application that uses pyinotify (via ThreadedNotifier) to check when a certain file gets modified. When this happens, the application stops watching the file and does some stuff. Everything works fine, except that often the call to ThreadedNotifier.stop() takes a noticeable time, about 4 seconds... Ot... | Slow pyinotify.ThreadedNotifier.stop() | 1.2 | 0 | 0 | 408 |
2,007,299 | 2010-01-05T16:09:00.000 | 0 | 0 | 0 | 0 | python,pygtk | 2,016,770 | 3 | false | 0 | 1 | Instead of creating windows you could put a notebook in the right pane. Then create all the previous windows as pages. Click on the button can then show the appropriate page in the notebook. | 1 | 2 | 0 | I'm working on a project that has a glade GUI.
I need the main window to have 2 section, divided by a gtk.Hpaned widget (horizontal panes).
The left pane would have a tool-bar like layout of buttons, maybe 3 or more.
What I need is a way to create different windows and display them on the right pane of the main window.... | pygtk: cannot set parent on toplevel widget | 0 | 0 | 0 | 1,643 |
2,007,908 | 2010-01-05T17:36:00.000 | 0 | 0 | 0 | 0 | c#,python,django,soap,wsdl | 2,008,000 | 2 | false | 1 | 0 | One thing you can do is start by building a manual proxy using WebClient, or WebRequest/WebResponse. Construct your manual proxy to send the desired data to the WS for testing.
Couple of things to check on the WSDL implementation:
The WSDL definition needs to match exactly, including case, for the C# proxy to recogniz... | 2 | 3 | 0 | I have a C# command-line client that I'm testing the consumption of SOAP/WSDL via Django/Python/soaplib created WSDL. I've managed to successfully connect to the web service by adding a service reference. I then call one of service's methods, and the service processes the data I send, but it returns null instead of the... | How to use C# client to consume Django/Python web service (all methods are returning null)? | 0 | 0 | 0 | 1,555 |
2,007,908 | 2010-01-05T17:36:00.000 | 0 | 0 | 0 | 0 | c#,python,django,soap,wsdl | 2,008,062 | 2 | false | 1 | 0 | We faced the similar problem while consuming a web service it was the type of data returned we were getting data in UTF-16 format.
Please check if you have proper data type in use. | 2 | 3 | 0 | I have a C# command-line client that I'm testing the consumption of SOAP/WSDL via Django/Python/soaplib created WSDL. I've managed to successfully connect to the web service by adding a service reference. I then call one of service's methods, and the service processes the data I send, but it returns null instead of the... | How to use C# client to consume Django/Python web service (all methods are returning null)? | 0 | 0 | 0 | 1,555 |
2,008,055 | 2010-01-05T18:01:00.000 | 2 | 1 | 0 | 0 | python,amazon-ec2 | 2,008,170 | 2 | false | 0 | 0 | If you can get by with using the Amazon provided ones, I'd recommend it. I tend to use ami-84db39ed.
Honestly though, if you plan on leaving this running all the time, you would probably save a bit of money by just going with a VPS. Amazon tends to be cheaper if you are turning the service on and off over time. | 1 | 4 | 0 | I want to remove as much complexity as I can from administering Python in on Amazon EC2 following some truly awful experiences with hosting providers who claim support for Python. I am looking for some guidance on which AMI to choose so that I have a stable and easily managed environment which already included Python ... | Can you recommend an Amazon AMI for Python? | 0.197375 | 0 | 0 | 2,510 |
2,008,816 | 2010-01-05T20:23:00.000 | 1 | 1 | 0 | 0 | python,django,facebook | 2,012,448 | 1 | true | 0 | 0 | Use the Python Facebook module on Google Code. | 1 | 1 | 0 | I have a need to display some basic info about a facebook group on a website i am building. All i am really looking to show is the total number of members, and maybe a list of the few most recent people who joined.
I would like to not have to login to FB to accomplish this, is there an API for groups that allows anony... | Python + Facebook, getting info about a group easily | 1.2 | 0 | 1 | 342 |
2,009,194 | 2010-01-05T21:24:00.000 | 1 | 0 | 1 | 0 | python,ruby,go | 2,009,289 | 10 | false | 0 | 0 | Python is a available for most operating systems, it's generally accepted as a scriptin language, and it has matured to production quality.
Go is a research language that's only available in beta quality on Linux and OS X. Nowhere else. It's interesting from an intellectual point of view in that you can learn and apply... | 9 | 5 | 0 | I was reading about Go, and I can see that it's very good and can be a language used by many developers in some months, but I want to decide a simple thing: Learn Go or improve my Python or Ruby knowledge?
Years developing with Python: 1
Years developing with Ruby: 0.3 | Learn Go Or Improve My Python/Ruby Knowledge | 0.019997 | 0 | 0 | 5,601 |
2,009,194 | 2010-01-05T21:24:00.000 | 19 | 0 | 1 | 0 | python,ruby,go | 2,009,485 | 10 | true | 0 | 0 | If you're just looking to have fun and expand your horizons, then I'd learn Go, since you already know some Python.
If you're looking to improve as a developer, I'd personally recommend working on an actual project (using Python, as it's the language you have the most experience with):
This will take your (Python and ... | 9 | 5 | 0 | I was reading about Go, and I can see that it's very good and can be a language used by many developers in some months, but I want to decide a simple thing: Learn Go or improve my Python or Ruby knowledge?
Years developing with Python: 1
Years developing with Ruby: 0.3 | Learn Go Or Improve My Python/Ruby Knowledge | 1.2 | 0 | 0 | 5,601 |
2,009,194 | 2010-01-05T21:24:00.000 | 8 | 0 | 1 | 0 | python,ruby,go | 2,009,489 | 10 | false | 0 | 0 | It depends on what your goals and your needs are.
If you're looking to develop your skills for a job, then go with Python or Ruby. You're unlikely to see Go show up in the workplace for quite some time (if ever) unless you're working at Google. (Even then it's questionable.)
If you want to have fun, do what you want. I... | 9 | 5 | 0 | I was reading about Go, and I can see that it's very good and can be a language used by many developers in some months, but I want to decide a simple thing: Learn Go or improve my Python or Ruby knowledge?
Years developing with Python: 1
Years developing with Ruby: 0.3 | Learn Go Or Improve My Python/Ruby Knowledge | 1 | 0 | 0 | 5,601 |
2,009,194 | 2010-01-05T21:24:00.000 | 1 | 0 | 1 | 0 | python,ruby,go | 2,009,216 | 10 | false | 0 | 0 | These two languages accomplish different goals. Go is only 20% slower than C. If you want crazy speed and easy parallelism, then learn Go. However, readability was not a design goal. Also, it has no exceptions. It can be used for real-time products though ... | 9 | 5 | 0 | I was reading about Go, and I can see that it's very good and can be a language used by many developers in some months, but I want to decide a simple thing: Learn Go or improve my Python or Ruby knowledge?
Years developing with Python: 1
Years developing with Ruby: 0.3 | Learn Go Or Improve My Python/Ruby Knowledge | 0.019997 | 0 | 0 | 5,601 |
2,009,194 | 2010-01-05T21:24:00.000 | 9 | 0 | 1 | 0 | python,ruby,go | 2,009,206 | 10 | false | 0 | 0 | In reality, you should do both; if it's what you want. For me though, out of the two, I'd only look at Python. I have no real interest in languages that are so new. | 9 | 5 | 0 | I was reading about Go, and I can see that it's very good and can be a language used by many developers in some months, but I want to decide a simple thing: Learn Go or improve my Python or Ruby knowledge?
Years developing with Python: 1
Years developing with Ruby: 0.3 | Learn Go Or Improve My Python/Ruby Knowledge | 1 | 0 | 0 | 5,601 |
2,009,194 | 2010-01-05T21:24:00.000 | 2 | 0 | 1 | 0 | python,ruby,go | 2,009,251 | 10 | false | 0 | 0 | It's up to you. You should probably do both if you can, because that way you will have more tools on your metaphorical programmer's belt.
There are a number of things that I think are worth considering whenever I'm in a similar dilemma.
Is a new language (not just unfamiliar, but actually new, like Go) likely to catch ... | 9 | 5 | 0 | I was reading about Go, and I can see that it's very good and can be a language used by many developers in some months, but I want to decide a simple thing: Learn Go or improve my Python or Ruby knowledge?
Years developing with Python: 1
Years developing with Ruby: 0.3 | Learn Go Or Improve My Python/Ruby Knowledge | 0.039979 | 0 | 0 | 5,601 |
2,009,194 | 2010-01-05T21:24:00.000 | 2 | 0 | 1 | 0 | python,ruby,go | 2,009,509 | 10 | false | 0 | 0 | First of all, it's a very very personal question, and my first recommendation will be , if you think so, try Go for one month or so, learning the basics, and then deciding... Each one has the mind fitted more to some particular languages than another...
I also would recommend keep using both Python and Ruby, if you're ... | 9 | 5 | 0 | I was reading about Go, and I can see that it's very good and can be a language used by many developers in some months, but I want to decide a simple thing: Learn Go or improve my Python or Ruby knowledge?
Years developing with Python: 1
Years developing with Ruby: 0.3 | Learn Go Or Improve My Python/Ruby Knowledge | 0.039979 | 0 | 0 | 5,601 |
2,009,194 | 2010-01-05T21:24:00.000 | 3 | 0 | 1 | 0 | python,ruby,go | 2,009,214 | 10 | false | 0 | 0 | How long have you been working with Python?
If it were me, I'd do my best to maybe get a working knowledge of Go (basic syntax, some familiarity with unique language features), and continue with Python as I normally would.
Eventually you might come up with a small project that Go seems suited for (or you can come up wi... | 9 | 5 | 0 | I was reading about Go, and I can see that it's very good and can be a language used by many developers in some months, but I want to decide a simple thing: Learn Go or improve my Python or Ruby knowledge?
Years developing with Python: 1
Years developing with Ruby: 0.3 | Learn Go Or Improve My Python/Ruby Knowledge | 0.059928 | 0 | 0 | 5,601 |
2,009,194 | 2010-01-05T21:24:00.000 | 1 | 0 | 1 | 0 | python,ruby,go | 2,009,218 | 10 | false | 0 | 0 | IMO you should improve your Python knowledge. Python is a widely adopted language, whereas
Go is still at a very, very early stage and there's no reason to believe that it will become successful.
From a purely utilitarian perspective, you will get a lot more value from learning Python. | 9 | 5 | 0 | I was reading about Go, and I can see that it's very good and can be a language used by many developers in some months, but I want to decide a simple thing: Learn Go or improve my Python or Ruby knowledge?
Years developing with Python: 1
Years developing with Ruby: 0.3 | Learn Go Or Improve My Python/Ruby Knowledge | 0.019997 | 0 | 0 | 5,601 |
2,010,255 | 2010-01-06T00:47:00.000 | 4 | 1 | 1 | 0 | python | 2,010,309 | 5 | false | 0 | 0 | The first things that come to mind are:
Try a smaller path
Make sure your modules are pyc's so they'll load faster
Make sure you don't double import, or import too much
Other than that, are you sure that the disk operations are what's bogging you down? Is your disk/operating system really busy or old and slow?
Mayb... | 3 | 24 | 0 | I'm getting seriously frustrated at how slow python startup is. Just importing more or less basic modules takes a second, since python runs down the sys.path looking for matching files (and generating 4 stat() calls - ["foo", "foo.py", "foo.pyc", "foo.so"] - for each check). For a complicated project environment, wit... | Speeding up the python "import" loader | 0.158649 | 0 | 0 | 12,690 |
2,010,255 | 2010-01-06T00:47:00.000 | 1 | 1 | 1 | 0 | python | 2,010,759 | 5 | false | 0 | 0 | Something's missing from your premise--I've never seen some "more-or-less" basic modules take over a second to import, and I'm not running Python on what I would call cutting-edge hardware. Either you're running on some seriously old hardware, or you're running on an overloaded machine, or either your OS or Python ins... | 3 | 24 | 0 | I'm getting seriously frustrated at how slow python startup is. Just importing more or less basic modules takes a second, since python runs down the sys.path looking for matching files (and generating 4 stat() calls - ["foo", "foo.py", "foo.pyc", "foo.so"] - for each check). For a complicated project environment, wit... | Speeding up the python "import" loader | 0.039979 | 0 | 0 | 12,690 |
2,010,255 | 2010-01-06T00:47:00.000 | 11 | 1 | 1 | 0 | python | 2,010,354 | 5 | false | 0 | 0 | zipping up as many pyc files as feasible (with proper directory structure for packages), and putting that zipfile as the very first entry in sys.path (on the best available local disk, ideally) can speed up startup times a lot. | 3 | 24 | 0 | I'm getting seriously frustrated at how slow python startup is. Just importing more or less basic modules takes a second, since python runs down the sys.path looking for matching files (and generating 4 stat() calls - ["foo", "foo.py", "foo.pyc", "foo.so"] - for each check). For a complicated project environment, wit... | Speeding up the python "import" loader | 1 | 0 | 0 | 12,690 |
2,010,816 | 2010-01-06T03:40:00.000 | 0 | 1 | 0 | 1 | python,linux,networking,mac-address | 2,010,975 | 7 | false | 0 | 0 | Many years ago, I was tasked with gathering various machine info from all machines on a corporate campus. One desired piece of info was the MAC address, which is difficult to get on a network that spanned multiple subnets. At the time, I used the Windows built-in "nbtstat" command.
Today there is a Unix utility calle... | 1 | 6 | 0 | How do I get the MAC address of a remote host on my LAN? I'm using Python and Linux. | Get remote MAC address using Python and Linux | 0 | 0 | 1 | 22,526 |
2,011,048 | 2010-01-06T05:00:00.000 | 7 | 0 | 1 | 0 | python,size,character | 2,011,063 | 5 | false | 0 | 0 | If you want the unicode character count for a text file given a specific encoding, you will have to read in the entire file to do that.
However, if you want the byte count for a given file, you want os.path.getsize(), which should only need to do a stat on the file as long as your OS has stat() or an equivalent call (a... | 1 | 6 | 0 | I have a python code which reads many files.
but some files are extremely large due to which i have errors coming in other codes.
i want a way in which i can check for the character count of the files so that i avoid reading those extremely large files.
Thanks. | how to check the character count of a file in python | 1 | 0 | 0 | 3,366 |
2,013,736 | 2010-01-06T14:56:00.000 | 2 | 0 | 0 | 0 | python,django,django-admin | 2,013,798 | 3 | true | 1 | 0 | Revised. Up until you want per-object permission, the answer is yes.
As soon as you want permission on a Blog, where a blog is just a row, you're going to have to do some coding.
You can totally reuse the admin interface elements. You have all the source, which you can read.
Much of what you want is done with "wrap... | 3 | 3 | 0 | I'm very new to Django, having never developed on it.
I'm trying to develop a site which has functionality exposed only to authenticated users (typical enterprise thing: for this discussion, let's say it's a private blogging platform).
The functionality I'm looking for is:
Users can create a new blog.
each user can ... | Is it possible to create an end-user facing site using Django admin alone? | 1.2 | 0 | 0 | 528 |
2,013,736 | 2010-01-06T14:56:00.000 | 0 | 0 | 0 | 0 | python,django,django-admin | 2,014,321 | 3 | false | 1 | 0 | As for row-level permissions in the admin, in the SVN version of Django you can override the has_add_permission, has_change_permission, and has_delete_permission methods on the ModelAdmin object to implement the custom permissions logic yourself in a way that will apply across the entire admin. I'm pretty sure this fea... | 3 | 3 | 0 | I'm very new to Django, having never developed on it.
I'm trying to develop a site which has functionality exposed only to authenticated users (typical enterprise thing: for this discussion, let's say it's a private blogging platform).
The functionality I'm looking for is:
Users can create a new blog.
each user can ... | Is it possible to create an end-user facing site using Django admin alone? | 0 | 0 | 0 | 528 |
2,013,736 | 2010-01-06T14:56:00.000 | 0 | 0 | 0 | 0 | python,django,django-admin | 2,014,338 | 3 | false | 1 | 0 | As a point of sense you really shouldn't be basing a potentially large scale project on Django-Admin. It's kind of silly, and so many people are fascinated with Django-Admin that they literally have a chapter in their books about when and when not to use it for evil.
It seems to me that for all the hacking you will hav... | 3 | 3 | 0 | I'm very new to Django, having never developed on it.
I'm trying to develop a site which has functionality exposed only to authenticated users (typical enterprise thing: for this discussion, let's say it's a private blogging platform).
The functionality I'm looking for is:
Users can create a new blog.
each user can ... | Is it possible to create an end-user facing site using Django admin alone? | 0 | 0 | 0 | 528 |
2,013,835 | 2010-01-06T15:09:00.000 | 1 | 0 | 0 | 0 | python,django,django-models,decimal,currency | 2,013,893 | 10 | false | 1 | 0 | You store it as a DecimalField and manually add the decimals if you need to, as Valya said, using basic formatting techniques.
You can even add a Model Method to you product or transaction model that will spit out the DecimalField as an appropriately formatted string. | 2 | 66 | 0 | I'm running into a paradigm problem here. I don't know whether I should store money as a Decimal(), or if I should store it as a string and convert it to a decimal myself. My reasoning is this:
PayPal requires 2 decimal places, so if I have a product that is 49 dollars even, PayPal wants to see 49.00 come across the wi... | Django: How should I store a money value? | 0.019997 | 0 | 0 | 37,694 |
2,013,835 | 2010-01-06T15:09:00.000 | 10 | 0 | 0 | 0 | python,django,django-models,decimal,currency | 2,013,866 | 10 | false | 1 | 0 | I suggest to avoid mixing representation with storage. Store the data as a decimal value with 2 places.
In the UI layer, display it in a form which is suitable for the user (so maybe omit the ".00").
When you send the data to PayPal, format it as the interface requires. | 2 | 66 | 0 | I'm running into a paradigm problem here. I don't know whether I should store money as a Decimal(), or if I should store it as a string and convert it to a decimal myself. My reasoning is this:
PayPal requires 2 decimal places, so if I have a product that is 49 dollars even, PayPal wants to see 49.00 come across the wi... | Django: How should I store a money value? | 1 | 0 | 0 | 37,694 |
2,015,065 | 2010-01-06T17:57:00.000 | 2 | 0 | 0 | 0 | jquery,python,ajax,asynchronous,cherrypy | 2,015,344 | 2 | true | 1 | 0 | The same way you would do them using any other webserver - by getting your javascript to call a URL which is handled by the server-side application. | 1 | 1 | 0 | I'm using cherrypy's standalone server (cherrypy.quickstart()) and sqlite3 for a database.
I was wondering how one would do ajax/jquery asynchronous calls to the database while using cherrypy? | How does one do async ajax calls using cherrypy? | 1.2 | 1 | 0 | 3,741 |
2,016,292 | 2010-01-06T21:14:00.000 | 3 | 0 | 0 | 0 | python,django,decimal | 2,016,387 | 2 | true | 1 | 0 | I think it would be more correct to say those are different representations of the same value '5'.
Internally, the value saved (unless you're actually storing a string) is 5.
When the value is displayed, ie converted to a string representation for the screen, it might be shown as 5, 5.00 or 5.000 but internally, it's ... | 2 | 0 | 0 | If 5 and 5.00 and 5.000 are all different, then why does Django's decimal field save without the .00 even when I have decimal_places=2
?
More importantly, how can I save a value 5.00 as 5.00 in Django without using String. | Python/Django: If 5 and 5.00 are different values (when expressed in Decimal), then | 1.2 | 0 | 0 | 388 |
2,016,292 | 2010-01-06T21:14:00.000 | 2 | 0 | 0 | 0 | python,django,decimal | 2,016,478 | 2 | false | 1 | 0 | You have an argument that Django ought to enforce a certain precision on its Python objects, but decimal_places is probably more about maximum precision. I believe precision is not stored in the database, so it will be lost in any case.
In any case, if you want to enforce precision, use something like: Decimal(5).quant... | 2 | 0 | 0 | If 5 and 5.00 and 5.000 are all different, then why does Django's decimal field save without the .00 even when I have decimal_places=2
?
More importantly, how can I save a value 5.00 as 5.00 in Django without using String. | Python/Django: If 5 and 5.00 are different values (when expressed in Decimal), then | 0.197375 | 0 | 0 | 388 |
2,016,609 | 2010-01-06T22:02:00.000 | 2 | 0 | 0 | 0 | php,python,mysql,widget | 2,016,648 | 6 | false | 0 | 0 | Adobe Air is the popular solution to this problem these days | 4 | 0 | 0 | I have seen mention of Java and Python. I need something that can be installed on a users desktop without them having to also install Java or anything else. User simplicity is a must.
This widget will log into an online php based calendar that accesses mySQL. Any pointers on what I should be reading up on? Python?... | What programs are used to build standalone desktop widgets that interact with online php and mysql? | 0.066568 | 0 | 0 | 570 |
2,016,609 | 2010-01-06T22:02:00.000 | 1 | 0 | 0 | 0 | php,python,mysql,widget | 2,016,684 | 6 | false | 0 | 0 | The others here are basically right. You don't specify what the platform you want to put this on. You have a couple of options:
Native program. This can be made to require no installation. This would be Win32/MFC and C/C++, or Cocoa and Objective-C. Not necessarily easy to program (fetching a web page in Win32?), not ... | 4 | 0 | 0 | I have seen mention of Java and Python. I need something that can be installed on a users desktop without them having to also install Java or anything else. User simplicity is a must.
This widget will log into an online php based calendar that accesses mySQL. Any pointers on what I should be reading up on? Python?... | What programs are used to build standalone desktop widgets that interact with online php and mysql? | 0.033321 | 0 | 0 | 570 |
2,016,609 | 2010-01-06T22:02:00.000 | 3 | 0 | 0 | 0 | php,python,mysql,widget | 2,016,620 | 6 | true | 0 | 0 | Sounds like something like Adobe Air, Microsoft's Silverlight, or Appcelerators Titanium is what you want. | 4 | 0 | 0 | I have seen mention of Java and Python. I need something that can be installed on a users desktop without them having to also install Java or anything else. User simplicity is a must.
This widget will log into an online php based calendar that accesses mySQL. Any pointers on what I should be reading up on? Python?... | What programs are used to build standalone desktop widgets that interact with online php and mysql? | 1.2 | 0 | 0 | 570 |
2,016,609 | 2010-01-06T22:02:00.000 | 0 | 0 | 0 | 0 | php,python,mysql,widget | 2,016,639 | 6 | false | 0 | 0 | Should it be OS independent? Widgets for Apple's dashboard are just HTML, CSS and Javascript. | 4 | 0 | 0 | I have seen mention of Java and Python. I need something that can be installed on a users desktop without them having to also install Java or anything else. User simplicity is a must.
This widget will log into an online php based calendar that accesses mySQL. Any pointers on what I should be reading up on? Python?... | What programs are used to build standalone desktop widgets that interact with online php and mysql? | 0 | 0 | 0 | 570 |
2,017,381 | 2010-01-07T00:27:00.000 | 18 | 0 | 1 | 0 | python,memory-leaks | 2,017,432 | 6 | false | 0 | 0 | The classic definition of a memory leak is memory that was used once, and now is not, but has not been reclaimed. That nearly impossible with pure Python code. But as Antoine points out, you can easily have the effect of consuming all your memory inadvertently by allowing data structures to grow without bound, even i... | 3 | 69 | 0 | I don't have a code example, but I'm curious whether it's possible to write Python code that results in essentially a memory leak. | Is it possible to have an actual memory leak in Python because of your code? | 1 | 0 | 0 | 24,763 |
2,017,381 | 2010-01-07T00:27:00.000 | 11 | 0 | 1 | 0 | python,memory-leaks | 2,017,407 | 6 | false | 0 | 0 | Of course you can. The typical example of a memory leak is if you build a cache that you never flush manually and that has no automatic eviction policy. | 3 | 69 | 0 | I don't have a code example, but I'm curious whether it's possible to write Python code that results in essentially a memory leak. | Is it possible to have an actual memory leak in Python because of your code? | 1 | 0 | 0 | 24,763 |
2,017,381 | 2010-01-07T00:27:00.000 | 0 | 0 | 1 | 0 | python,memory-leaks | 54,374,892 | 6 | false | 0 | 0 | Since many modules are written in C , yes, it is possible to have memory leaks.
imagine you are using a gui paint drawing context (eg with wxpython) , you can create memory buffers but if you forgot to release it. you will have memory leaks...
in this case, C++ functions of wx api are wrapped to python.
a bigger wrong... | 3 | 69 | 0 | I don't have a code example, but I'm curious whether it's possible to write Python code that results in essentially a memory leak. | Is it possible to have an actual memory leak in Python because of your code? | 0 | 0 | 0 | 24,763 |
2,017,930 | 2010-01-07T02:56:00.000 | 1 | 0 | 0 | 0 | python,database-design,google-app-engine,schema | 2,017,958 | 5 | false | 1 | 0 | My first cut (I assumed the questions were multiple choice):
I'd have a table of Questions, with ID_Question as the PK, the question text, and a category (if you want).
I'd have a table of Answers, with ID_Answer as the PK, QuestionID as a FK back to the Questions table, the answer text, and a flag as to whether it's ... | 2 | 1 | 0 | I'm making a trivia webapp that will feature both standalone questions, and 5+ question quizzes. I'm looking for suggestions for designing this model.
Should a quiz and its questions be stored in separate tables/objects, with a key to tie them together, or am I better off creating the quiz as a standalone entity, with... | Database Design Inquiry | 0.039979 | 1 | 0 | 642 |
2,017,930 | 2010-01-07T02:56:00.000 | 0 | 0 | 0 | 0 | python,database-design,google-app-engine,schema | 2,017,943 | 5 | false | 1 | 0 | Have a table of questions, a table of quizzes and a mapping table between them. That will give you the most flexibility. This is simple enough that you wouldn't even necessarily need a whole relational database management system. I think people tend to forget that relations are pretty simple mathematical/logical concep... | 2 | 1 | 0 | I'm making a trivia webapp that will feature both standalone questions, and 5+ question quizzes. I'm looking for suggestions for designing this model.
Should a quiz and its questions be stored in separate tables/objects, with a key to tie them together, or am I better off creating the quiz as a standalone entity, with... | Database Design Inquiry | 0 | 1 | 0 | 642 |
2,018,210 | 2010-01-07T04:28:00.000 | 2 | 0 | 1 | 0 | python,io | 2,018,389 | 1 | true | 0 | 0 | The trouble with reading the block device directly is that there is no guarantee that the blocks of any given file are contiguous. That means that even if you find your magic marker bytes 0xFFD8 in block 13, say, there is no guarantee that block 14 belongs to the same file, whether or not it contains the 0xFFD9 end ma... | 1 | 1 | 0 | I currently have a Python app I am developing which will data carve a block device for jpeg files. Let's just say that it sometimes works and sometimes doesn't. I have created it so that I read the block device till I find a ffd8, then I keep the stream open and search via looping for the ffd9 closure. Though I alwa... | Data Carving loop improvements | 1.2 | 0 | 0 | 942 |
2,020,318 | 2010-01-07T12:45:00.000 | 0 | 1 | 0 | 1 | python,tar | 2,020,334 | 5 | false | 0 | 0 | This answer seems irrelevant, since I seem to have misunderstood the question, which has now been clarified. However, should someone find this question, while searching with pretty much the same terms, this answer may still be relevant:
Just open the file in binary mode
f = open(filename, 'rb')
read/skip a bunch and pr... | 2 | 1 | 0 | i am facing some problem with files with huge data.
i need to skip doing some execution on those files.
i get the data of the file into a variable.
now i need to get the byte of the variable and if it is greater than 102400 , then print a message.
update : i cannot open the files , since it is present in a tar file.
... | how do i get the byte count of a variable in python just like wc -c gives in unix | 0 | 0 | 0 | 1,889 |
2,020,318 | 2010-01-07T12:45:00.000 | 1 | 1 | 0 | 1 | python,tar | 2,020,425 | 5 | false | 0 | 0 | len(data) gives you the size in bytes if it's binary data. With strings the size depends on the encoding used. | 2 | 1 | 0 | i am facing some problem with files with huge data.
i need to skip doing some execution on those files.
i get the data of the file into a variable.
now i need to get the byte of the variable and if it is greater than 102400 , then print a message.
update : i cannot open the files , since it is present in a tar file.
... | how do i get the byte count of a variable in python just like wc -c gives in unix | 0.039979 | 0 | 0 | 1,889 |
2,021,051 | 2010-01-07T14:48:00.000 | 0 | 0 | 0 | 0 | django,timeout,apache2,mod-python,infinite-loop | 2,021,249 | 2 | false | 1 | 0 | Hmmm.
I wonder if you can use mod_cgi to run your Python script for development. And then go back to mod_python for deployment.
Then you can use the Apache core TimeOut directive to limit how long Apache waits for the mod_cgi response. N.B. Apache 2.2 that is, this extension to the TimeOut directive only came with the... | 2 | 2 | 0 | I recently spent a long while debugging something that turned out to be an infinite loop bug in my own code. Since I can't guarantee I'll never make that sort of mistake again, how can I configure my web server to terminate any apache2 subprocess that remains waiting for my python app to return a response for over N se... | How can I configure Apache2/mod_python/Django to abort request processing after N seconds? | 0 | 0 | 0 | 894 |
2,021,051 | 2010-01-07T14:48:00.000 | 0 | 0 | 0 | 0 | django,timeout,apache2,mod-python,infinite-loop | 2,034,804 | 2 | true | 1 | 0 | The short answer is no, there is no builtin ability within mod_python to have timeouts on individual requests. | 2 | 2 | 0 | I recently spent a long while debugging something that turned out to be an infinite loop bug in my own code. Since I can't guarantee I'll never make that sort of mistake again, how can I configure my web server to terminate any apache2 subprocess that remains waiting for my python app to return a response for over N se... | How can I configure Apache2/mod_python/Django to abort request processing after N seconds? | 1.2 | 0 | 0 | 894 |
2,021,252 | 2010-01-07T15:15:00.000 | 2 | 0 | 0 | 0 | python,reporting | 2,022,186 | 6 | false | 1 | 0 | Most reporting tools are stuck in the '80s: a time when you 'painted' a report intended to be printed that completely lacked integration with other reports.
Sometimes we still need that. If you need to print an invoice, you're pretty much stuck with that kind of functionality. But in general, most reporting these day... | 1 | 5 | 0 | I have a question for those of you doing web work with python. Is
anyone familiar with a python based reporting tool? I am about to
start on a pretty big web app and will need the ability to do some end
user reporting (invoices, revenue reports, etc). It can be an existing
django app or anything python based so I can ... | Python based web reporting tool? | 0.066568 | 0 | 0 | 21,339 |
2,021,764 | 2010-01-07T16:14:00.000 | 7 | 0 | 0 | 0 | python,pdf-generation,reportlab | 2,621,635 | 1 | false | 0 | 0 | Apparently reportlab does not support creating fillable pdf forms. The only thing I found about it being present in the API dates from 2003, afterwards all statements clearly say no.
I'm answering this so late because this is one of the highest hits when you enter 'reportlab forms' in google. I do agree with Travis you... | 1 | 3 | 0 | can anyone please help me with creating forms in python using the reportlab lib.
i am totally new to this and i would appreciate sample code
thanks | how to make fillable forms with reportlab in python | 1 | 0 | 0 | 1,976 |
2,021,803 | 2010-01-07T16:21:00.000 | 0 | 0 | 0 | 1 | python,windows,linux,preferences | 2,021,876 | 9 | false | 0 | 0 | Most major distributions will include Python and Apache, so it's really just a matter of choice. If you're new to Linux, I'd suggest either Ubuntu or Fedora. Both are great for new users and have excellent community support. | 7 | 7 | 0 | Which linux distro is better suited for Python web development?
Background:
I currently develop on Windows and it's fine, but I am looking to move my core Python development to Linux. I'm sure most any distro will work fine, but does anyone have any reasons to believe one distro is better than another? | What linux distro is better suited for Python web development? | 0 | 0 | 0 | 11,243 |
2,021,803 | 2010-01-07T16:21:00.000 | 0 | 0 | 0 | 1 | python,windows,linux,preferences | 2,021,840 | 9 | false | 0 | 0 | I use RHEL and have been very happy, so from that I would say Fedora would be fine. I use Debian at home, and it's great (headless though, so no web there).
That said, I think you should probably just pick one based on what your company uses, or any number of non-Python reasons. I don't think you are going to find Py... | 7 | 7 | 0 | Which linux distro is better suited for Python web development?
Background:
I currently develop on Windows and it's fine, but I am looking to move my core Python development to Linux. I'm sure most any distro will work fine, but does anyone have any reasons to believe one distro is better than another? | What linux distro is better suited for Python web development? | 0 | 0 | 0 | 11,243 |
2,021,803 | 2010-01-07T16:21:00.000 | 0 | 0 | 0 | 1 | python,windows,linux,preferences | 28,327,632 | 9 | false | 0 | 0 | i think i remember a podcast with Guido Van Rossum and his core team python developers back in the days, and one of that core python developer is now employed by Canonical to take care of python integration for the ubuntu distro. So that explains why ubuntu is a much more pythonic distro compared to other distro.
On t... | 7 | 7 | 0 | Which linux distro is better suited for Python web development?
Background:
I currently develop on Windows and it's fine, but I am looking to move my core Python development to Linux. I'm sure most any distro will work fine, but does anyone have any reasons to believe one distro is better than another? | What linux distro is better suited for Python web development? | 0 | 0 | 0 | 11,243 |
2,021,803 | 2010-01-07T16:21:00.000 | 13 | 0 | 0 | 1 | python,windows,linux,preferences | 2,021,832 | 9 | true | 0 | 0 | Largely distribution won't matter, as Python is present and largely self sufficient on virtually all Linux distributions.
If you're wanting to focus on development, I'd recommend Ubuntu. Ubuntu is arguably one of the most fully featured "ready for the user" distributions that makes system administration a snap, so you... | 7 | 7 | 0 | Which linux distro is better suited for Python web development?
Background:
I currently develop on Windows and it's fine, but I am looking to move my core Python development to Linux. I'm sure most any distro will work fine, but does anyone have any reasons to believe one distro is better than another? | What linux distro is better suited for Python web development? | 1.2 | 0 | 0 | 11,243 |
2,021,803 | 2010-01-07T16:21:00.000 | 0 | 0 | 0 | 1 | python,windows,linux,preferences | 2,975,353 | 9 | false | 0 | 0 | I am working with Python on Cento 5.4 and Fedora 12 and I am very happy.
I also use Eclipse IDE for python and other languages without having any major issues. | 7 | 7 | 0 | Which linux distro is better suited for Python web development?
Background:
I currently develop on Windows and it's fine, but I am looking to move my core Python development to Linux. I'm sure most any distro will work fine, but does anyone have any reasons to believe one distro is better than another? | What linux distro is better suited for Python web development? | 0 | 0 | 0 | 11,243 |
2,021,803 | 2010-01-07T16:21:00.000 | 0 | 0 | 0 | 1 | python,windows,linux,preferences | 2,022,173 | 9 | false | 0 | 0 | As the other answers have mentioned so far, the Python 2.6 interpreter will be available on all recent Linux distribution releases. That shouldn't influence your choice.
However, your choice of IDE may eliminate some possibilities. You should make sure the distribution you select has a package for the latest version of... | 7 | 7 | 0 | Which linux distro is better suited for Python web development?
Background:
I currently develop on Windows and it's fine, but I am looking to move my core Python development to Linux. I'm sure most any distro will work fine, but does anyone have any reasons to believe one distro is better than another? | What linux distro is better suited for Python web development? | 0 | 0 | 0 | 11,243 |
2,021,803 | 2010-01-07T16:21:00.000 | 0 | 0 | 0 | 1 | python,windows,linux,preferences | 5,528,749 | 9 | false | 0 | 0 | Any desktop distribution like Ubuntu, OpenSUSE, Fedora, ... is OK, But if you want to always have the latest versions, I recommend ArchLinux. | 7 | 7 | 0 | Which linux distro is better suited for Python web development?
Background:
I currently develop on Windows and it's fine, but I am looking to move my core Python development to Linux. I'm sure most any distro will work fine, but does anyone have any reasons to believe one distro is better than another? | What linux distro is better suited for Python web development? | 0 | 0 | 0 | 11,243 |
2,022,067 | 2010-01-07T17:01:00.000 | 2 | 0 | 0 | 0 | python,payment-gateway,payment | 2,023,105 | 5 | false | 1 | 0 | It sounds like you want something like Worldpay or even Google Checkout. But it all depends what your turnover is, because these sorts of providers (who host the payment page themselves), tend to take a percentage of every transaction, rather than a fixed monthly fee that you can get from elsewhere.
The other thing to ... | 3 | 9 | 0 | I'm looking for a payment gateway company so we can avoid tiresome PCI-DSS certification and its associated expenses. I'll get this out the way now, I don't want Paypal. It does what I want but it's really not a company I want to trust with any sort of money.
It needs to support the following flow:
User performs actio... | Looking for a payment gateway | 0.07983 | 0 | 1 | 3,656 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.