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.copytree. Without the -r cp copies files like shutil.copy and shutil.copy2 do.
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 standard function that works like the unix cp -r command, i.e. supports both directories and files and copies recursively? What would be the most elegant way to work around this problem in Python?
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 see a traceback.
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 must incur the code size cost of maintaining sufficient information in order to perform this operation (and generally means a table of data for calls that can take exceptions). It also means that the dynamic code execution path will be longer than simply returning from functions calls (which is a fairly inexpensive operation on most platforms). There may be other costs as well depending on the implementation. The relative cost will vary depending on the language used. The higher-level language used, the less likely the code size cost will matter, and the information may be retained regardless of whether exceptions are used. An application where the use of exceptions (and C++ in general) is often avoided for good reasons is embedded firmware. In typical small bare metal or RTOS platforms, you might have 1MB of code space, or 64K, or even smaller. Some platforms are so small, even C is not practical to use. In this kind of environment, the size impact is relevant because of the cost mentioned above. It also impacts the standard library itself. Embedded toolchain vendors will often produce a library without exception capability, which has a huge impact on code size. Highly optimizing compilers may also analyze the callgraph and optimize away needed call frame information for the unwind operation for considerable space reduction. Exceptions also make it more difficult to analyze hard real-time requirements. In more typical environments, the code size cost is almost certainly irrelevant and the performance factor is likely key. Whether you use them will depend on your performance requirements and how you want to use them. Using exceptions in non-exceptional cases can make an elegant design, but at a performance cost that may be unacceptable for high performance systems. Implementations and relative cost will vary by platform and compiler, so the best way to truly understand if exceptions are a problem is to analyze your own code's performance.
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. Also, C is close to assembly. How would one emulate exceptions using pure C constructs and no assembly? Finally, I heard a rumor that Google employees do not use exceptions for some projects due to speed considerations. Is this just a rumor? How can anything substantial be accomplished without them? Thank you.
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, popular in high-level, higher-order languages), coroutines (a generalization of subroutines, popular especially in Lua), generators à la Python (essentially a restricted form of coroutines), fibers (cooperative light-weight threads) and of course the already mentioned GOTO. (I'm sure there's many others I missed.) An interesting property of these constructs is that they are all roughly equivalent in expressive power: if you have one, you can pretty easily build all the others. So, how you best implement exceptions depends on what other constructs you have available: Every CPU has GOTO, therefore you can always fall back to that, if you must. C has setjmp/longjmp which are basically MacGyver continuations (built out of duct-tape and toothpicks, not quite the real thing, but will at least get you out of the immediate trouble if you don't have something better available). The JVM and CLI have exceptions of their own, which means that if the exception semantics of your language match Java's/C#'s, you are home free (but if not, then you are screwed). The Parrot VM as both exceptions and continuations. Windows has its own framework for exception handling, which language implementors can use to build their own exceptions on top. A very interesting use case, both of the usage of exceptions and the implementation of exceptions is Microsoft Live Lab's Volta Project. (Now defunct.) The goal of Volta was to provide architectural refactoring for Web applications at the push of a button. So, you could turn your one-tier web application into a two- or three-tier application just by putting some [Browser] or [DB] attributes on your .NET code and the code would then automagically run on the client or in the DB. In order to do that, the .NET code had to be translated to JavaScript source code, obviously. Now, you could just write an entire VM in JavaScript and run the bytecode unmodified. (Basically, port the CLR from C++ to JavaScript.) There are actually projects that do this (e.g. the HotRuby VM), but this is both inefficient and not very interoperable with other JavaScript code. So, instead, they wrote a compiler which compiles CIL bytecode to JavaScript sourcecode. However, JavaScript lacks certain features that .NET has (generators, threads, also the two exception models aren't 100% compatible), and more importantly it lacks certain features that compiler writers love (either GOTO or continuations) and that could be used to implement the above-mentioned missing features. However, JavaScript does have exceptions. So, they used JavaScript Exceptions to implement Volta Continuations and then they used Volta Continuations to implement .NET Exceptions, .NET Generators and even .NET Managed Threads(!!!) So, to answer your original question: How are exceptions implemented under the hood? With Exceptions, ironically! At least in this very specific case, anyway. Another great example is some of the exception proposals on the Go mailing list, which implement exceptions using Goroutines (something like a mixture of concurrent coroutines ans CSP processes). Yet another example is Haskell, which uses Monads, lazy evaluation, tail call optimization and higher-order functions to implement exceptions. Some modern CPUs also support basic building blocks for exceptions (for example the Vega-3 CPUs that were specifically designed for the Azul Systems Java Compute Accelerators).
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. Also, C is close to assembly. How would one emulate exceptions using pure C constructs and no assembly? Finally, I heard a rumor that Google employees do not use exceptions for some projects due to speed considerations. Is this just a rumor? How can anything substantial be accomplished without them? Thank you.
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/returns.
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. Also, C is close to assembly. How would one emulate exceptions using pure C constructs and no assembly? Finally, I heard a rumor that Google employees do not use exceptions for some projects due to speed considerations. Is this just a rumor? How can anything substantial be accomplished without them? Thank you.
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. Also, C is close to assembly. How would one emulate exceptions using pure C constructs and no assembly? Finally, I heard a rumor that Google employees do not use exceptions for some projects due to speed considerations. Is this just a rumor? How can anything substantial be accomplished without them? Thank you.
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 the canvas is very flexible. The solution to your problem is simple math. You merely need to compute the coordinates of the edges or corners of boxes to know where to anchor your arrows. To make it "grow" as you say, simply make a binding on mouse movements and update the coordinates appropriately. To make the line growable all you have to do is adjust the coordinates of the line each time the mouse moves. The easiest thing to do is make liberal use of canvas tags. With the tags you can know which arrows connect to which boxes so that when you move the box you adjust the coordinates of any arrows that point to or from it.
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 documentation of tkinter is good enough?
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 "main" script, never gets compiled, so you should not expect to see a .pyc file for it unless something imported it from within the application. This is often a sign of a problem if it does happen.)
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? without worrying about other threads/requests sharing/overwriting it?
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 is running the regex, but the entire program. Limiting the length of the regex will not work, since the problem is backtracking. For example, matching the regex r"(\S+)+x" on a string of length N that does not contain an "x" will backtrack 2**N times. On my system this takes about a second to match against "a"*21 and the time doubles for each additional character, so a string of 100 characters would take approximately 19167393131891000 years to complete (this is an estimate, I have not timed it). For more information read the O'Reilly book "Mastering Regular Expressions" - this has a couple of chapters on performance. edit To get round this we wrote a regex analysing function that tried to catch and reject some of the more obvious degenerate cases, but it is impossible to get all of them. Another thing we looked at was patching the re module to raise an exception if it backtracks too many times. This is possible, but requires changing the Python C source and recompiling, so is not portable. We also submitted a patch to release the GIL when matching against python strings, but I don't think it was accepted into the core (python only holds the GIL because regex can be run against mutable buffers).
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 raises an exception. The user could pass input that causes the regex engine to take a long time, or to use a lot of memory. The solution to 1. is easy: catch exceptions. I'm not sure if there is a good solution to 2. Perhaps just limiting the length of the regex would work. Is there anything else I need to worry about?
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, like the famous (x+x+)+y one. I think it's a problem yet to be resolved in a general way. A workaround could be launching a different thread and monitor it, if it exceeds the allowed time, kill the thread and return with an error.
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 raises an exception. The user could pass input that causes the regex engine to take a long time, or to use a lot of memory. The solution to 1. is easy: catch exceptions. I'm not sure if there is a good solution to 2. Perhaps just limiting the length of the regex would work. Is there anything else I need to worry about?
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 together and simply pass the raw expression to match, search, etc. You may wind up improving the performance of your code slightly anyways.
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 raises an exception. The user could pass input that causes the regex engine to take a long time, or to use a lot of memory. The solution to 1. is easy: catch exceptions. I'm not sure if there is a good solution to 2. Perhaps just limiting the length of the regex would work. Is there anything else I need to worry about?
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 when run from the command line and when run from your Python script.
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 via os.system, it works only if memory allocated is less than 4Gb, otherwise it fails to execute. Any solutions? By fails to execute i mean that A command window appears indicating that os.system has been called and then it disappears, i will check for the error code if any being returned. however no problems are encountered if xmx,xms are set to lower value. Ok i checked both version and there is a difference The one being called via python is Java HotSpot Client VM mixed mode,sharing while one being called via normal command line is Java HotSpot 64 bit server How do make os.system in python call the correct one that is the 64 bit server. UPDATE: I tried using subprocess module as yet the version of java return is same as that from os.system
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 via os.system, it works only if memory allocated is less than 4Gb, otherwise it fails to execute. Any solutions? By fails to execute i mean that A command window appears indicating that os.system has been called and then it disappears, i will check for the error code if any being returned. however no problems are encountered if xmx,xms are set to lower value. Ok i checked both version and there is a difference The one being called via python is Java HotSpot Client VM mixed mode,sharing while one being called via normal command line is Java HotSpot 64 bit server How do make os.system in python call the correct one that is the 64 bit server. UPDATE: I tried using subprocess module as yet the version of java return is same as that from os.system
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 urchin, the license for Google Maps, and put it in my templates) Full support for the templating engine (details in the other answers you have received) Lorem ipsum generation (Django has it, just make it simpler) Prepackaged modules for common tasks (e.g. give me a full login page with template an all) Link within the code for Django documentation and examples (e.g. Django snippets) One-click for multi-browser comparison Full CSS support An object explorer (along the lines of the Django-admin, but off-line) A color palette with cool combinations (say, blue-based, orange-based) Wizard for uploading the local project to Webfaction or similar hosting solution If I can think of anything else I will edit the answer. Good luck in designing your product!
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 currently in your development tools?
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 currently in your development tools?
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 snippets for both Python source and Django templates. These can always do with more work, of course, so perhaps your efforts would be best focused on improving one of these.
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 currently in your development tools?
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 for a specific app within a project (models, views and template code). NotePad++'s File->Open dialog is the Windows one, which picks up the directory from the currently open file. It'd be nice if it allowed me to switch quickly between related files.
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 currently in your development tools?
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 eric4's scintilla-based editor) support for django templates (maybe with gui support for wx or glade or whatever), awesome debugging (like C# on Visual Studio) a reasonable footprint (i.e., not Eclipse/Aptana or NetBeans) cross platform (Mac OS X, Linux, and Windows) sane version control support auto doctests and unit tests Then I'd buy it. All of the python IDEs come close, but all miss the mark by a bit. (Better yet, it would be open source and I'd download it and donate / contribute to it).
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 currently in your development tools?
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 currently in your development tools?
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 informative and not particularly hard if you've really thought out the grammar beforehand. The question really ends up being which language to do the parsing in? Haskell would be a really fun choice and provided a lot of interesting revelations for me when I wrote my first parser a couple years ago.
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 - decrement the number inc - increment the number You can then say, do_formula(a, "2sqr+inc+flp"). If a were 3, it'd square it twice (81), increment it (82), and flip the bits of it (~82 -- which is -83, if dealing with signed integers, I believe). What would be the best way of parsing the formula? It's relatively simple, and I'm thinking of making all the opcodes be 3 characters... would it be overkill to use Lex? Should I just write a simple home-brewed solution or use something else entirely? I realize the above example is silly; I'm not building a calculator that'll do that, but it illustrates what I'm trying to do well enough.
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 - decrement the number inc - increment the number You can then say, do_formula(a, "2sqr+inc+flp"). If a were 3, it'd square it twice (81), increment it (82), and flip the bits of it (~82 -- which is -83, if dealing with signed integers, I believe). What would be the best way of parsing the formula? It's relatively simple, and I'm thinking of making all the opcodes be 3 characters... would it be overkill to use Lex? Should I just write a simple home-brewed solution or use something else entirely? I realize the above example is silly; I'm not building a calculator that'll do that, but it illustrates what I'm trying to do well enough.
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't get them on the scanner properly. So, I figured the next best thing to getting the actual text out of them, would be to turn each page into an image. Obviously this needs to be automated, and I'd prefer to stick with Python if possible. If Ruby or Perl have some form of implementation that's just too awesome to pass up, I can go that route. I've tried pyPDF for text extraction, that obviously didn't do me much good. I've tried swftools, but the images I'm getting from that are just shy of completely unusable. It just seems like the fonts get ruined in the conversion. I also don't even really care about the image format on the way out, just as long as they're relatively lightweight, and readable.
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 completing the transaction but the CGI's HTML output will never reach the client. This means the user will not know the transaction was completed. How can I solve this problem?
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 some tests already, but I cant find a way to include the formerly mentioned library in my makefile and make the build succesful. All your help is deeply apreciated. :)
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 package and the settings and urls be modules within it.
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 the justification?
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 you can reuse the applications in it without moving the applications to other place.
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 the justification?
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 the justification?
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 has grown rather than been planned. So I guess my answer is, it provides a good root namespace. (for our needs) :)
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 the justification?
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 regular query.
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 use Javascript/JQuery on the client side to decode/display the received images. The difficulty is that I would like to only perform a single query on the server side (ie. query for all images associated with a single user) and send all of the images resulting from the query to the client as a single unit, which will then be broken up into the individual images. Ideally, I would like to use something similar to JSON, but while JSON appears to allow multiple "objects" to be sent as a JSON response, it does not appear to have the ability to allow multiple images (or binary files) to be sent as a JSON response. Is there another way that I should be looking at this problem, or perhaps a different technology that I should be considering that might allow me to send multiple images to the client, in response to a single get request? Thank you and Kind Regards Alexander
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/bytestreams (together with metadata needed for the client to reconstruct them) and send that (it will still have to be a separate payload from the HTML / CSS / Javascript that you're also sending), as long as you can cajole Javascript into separating the megablob into the needed images again (but for that part you should open a separate question and tag it Javascript, as Python has little to do with it, and GAE nothing at all). I would instead suggest just accepting the fact that the browser (presumably via ajax, as you mention in tags) will be sending multiple requests, just as it does to every other webpage on the WWW, and focus on optimizing the serving side -- the requests will be very close in time, so you should just use memcache to keep the yet-unsent images to avoid multiple fetch-from-storage requests in your GAE app.
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 use Javascript/JQuery on the client side to decode/display the received images. The difficulty is that I would like to only perform a single query on the server side (ie. query for all images associated with a single user) and send all of the images resulting from the query to the client as a single unit, which will then be broken up into the individual images. Ideally, I would like to use something similar to JSON, but while JSON appears to allow multiple "objects" to be sent as a JSON response, it does not appear to have the ability to allow multiple images (or binary files) to be sent as a JSON response. Is there another way that I should be looking at this problem, or perhaps a different technology that I should be considering that might allow me to send multiple images to the client, in response to a single get request? Thank you and Kind Regards Alexander
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't reuse the connection for some reason (usually a busted proxy in the way).
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 use Javascript/JQuery on the client side to decode/display the received images. The difficulty is that I would like to only perform a single query on the server side (ie. query for all images associated with a single user) and send all of the images resulting from the query to the client as a single unit, which will then be broken up into the individual images. Ideally, I would like to use something similar to JSON, but while JSON appears to allow multiple "objects" to be sent as a JSON response, it does not appear to have the ability to allow multiple images (or binary files) to be sent as a JSON response. Is there another way that I should be looking at this problem, or perhaps a different technology that I should be considering that might allow me to send multiple images to the client, in response to a single get request? Thank you and Kind Regards Alexander
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, no effort, no wheels reinvented. I can't think of a sensible way to do what you ask, but I can tell you that you are asking for pain in trying to implement the solution that you are describing.
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 use Javascript/JQuery on the client side to decode/display the received images. The difficulty is that I would like to only perform a single query on the server side (ie. query for all images associated with a single user) and send all of the images resulting from the query to the client as a single unit, which will then be broken up into the individual images. Ideally, I would like to use something similar to JSON, but while JSON appears to allow multiple "objects" to be sent as a JSON response, it does not appear to have the ability to allow multiple images (or binary files) to be sent as a JSON response. Is there another way that I should be looking at this problem, or perhaps a different technology that I should be considering that might allow me to send multiple images to the client, in response to a single get request? Thank you and Kind Regards Alexander
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 break. Strings that occur many times, e.g. country names, may take more memory than you expect; see the builtin intern(). )
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 that pickle output will work across various versions of Python 2.x/3.x or across 32 and 64 bit implementations of Python. Json only works for simple data structures. Jsonpickle seems to correct this AND seems to be written to work across different versions of Python. Serializing to XML or to a database is possible, but represents extra effort since we would have to do the serialization ourselves manually. Thank you, Malcolm
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 are written).
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 that pickle output will work across various versions of Python 2.x/3.x or across 32 and 64 bit implementations of Python. Json only works for simple data structures. Jsonpickle seems to correct this AND seems to be written to work across different versions of Python. Serializing to XML or to a database is possible, but represents extra effort since we would have to do the serialization ourselves manually. Thank you, Malcolm
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... Other times, it exits immediately. Anyone else experienced this? Is this expected? (Xubuntu 9.04)
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. This way, when I click button 1, subwindow1 will appear in the right pane. Click button2, subwindow2 will appear on the right pane. Instead of having windows pop-up left and right, I want to reparent them to the right pane of this gtk.Hpaned widged. How do you do this in python with pygtk?
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 recognize the values Namespace definitions need to match exactly, including trailing slashes Check the profile of the generated proxy and make sure it conforms with what your desired profile is (i.e. basic or none if needed) If you post your generated proxy we can look at it and see if there is anything out of the ordinary.
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 integer I'm expecting. Any ideas on how to get back something other than a null response? Thanks for any help or suggestions!
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 integer I'm expecting. Any ideas on how to get back something other than a null response? Thanks for any help or suggestions!
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 and ideally an Apache web server and a database. I am agnostic to Python version, web server, DB and OS as I am still early enough in my development cycle that I can influence those choices. Cost is not a consideration (within bounds) so Windows will work fine if it means easy administration. Anyone have any practical experience or recommendations they can share?
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 anonymous access? or do i have to go the screen scraping route?
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 a few concepts (typed channels combined with easy multitasking) that are otherwise difficult to use. As for Go, you might perhaps take a look at AT&T's "Plan 9" operating system first. It comes with a programming language called "Aleph" with also is C-based, has channels and multitasking. Looks to me like Go is a reimplementation of Aleph on more main-stream operating systems.
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 general) programming skills to a whole new level If you choose an interesting project, for example a semi-popular open source project, you'll even have some concrete result to show for your extra work. This will help your resume, help you meet other people interested in programming, etc. I personally believe that spending the time you would have spent learning a new language by coding actual things you can use, is usually a net win (unless of course, like I said, you're just doing it for some fun recreation or relaxation).
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 think the best decider is, pick a project you want to work on and then choose the language that is best suited for that project. Other things to consider: Each language is suited to certain tasks. Go is compiled into machine code, whereas Python and Ruby run in interpreters. Go lends itself to somewhat lower level work. It's also good for concurrent tasks. Higher level tasks might be more suited for Python or Ruby. Go is an experimental language that's likely to experience changes. These changes may be backward incompatible. If you learn it now, in 6 months or a year you may have to re-learn some of it because it's changed. That said, it can be fun to be a part of something that's on the bleeding edge. And if it does happen to become "the next big thing," you're in on the ground level.
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 on? (If so, it will become practically NECESSARY to learn it, rather than just a good idea.) You will need to spend some time to learn the unfamiliar language. Will this time investment result in some sort of positive return? The obvious one here is development time (i.e., can you eventually get more done and get back the time you spent to learn it), but if the language is superior in other ways (runs faster or with less memory, is best for your particular problem domain) those might factor in too. Will learning the unfamiliar language allow you to solve a relevant/important/urgent problem that cannot be solved with what you already know? Unfortunately, none of us can tell you how to weigh each of these concerns. You'll need to think about it really carefully and come to the answer on your own.
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 interested, you have enough experience to use them comfortably (I think), so the next months you could experience a great boost in your experience using them... For an strict utilitarian point of view, learning Go extensively could be a risk move, but worthy if begins to being using and you're one of the very few people with some experience when everyone are just beginning to learn the syntax...
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 with one now!) and really dive into the language that way. There's no reason to limit yourself to just one. :)
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? Maybe a defrag is in order?
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, with tons of different directories, this can take around 5 seconds -- all to run a script that might fail instantly. Do folks have suggestions for how to speed up this process? For instance, one hack I've seen is to set the LD_PRELOAD_32 environment variable to a library that caches the result of ENOENT calls (e.g. failed stat() calls) between runs. Of course, this has all sorts of problems (potentially confusing non-python programs, negative caching, etc.).
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 installation is broken in some way. Or you're not really importing "basic" modules. If it's any of the first three issues, you need to look at the root problem for a solution. If it's the last, we really need to know what the specific packages are to be of any help.
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, with tons of different directories, this can take around 5 seconds -- all to run a script that might fail instantly. Do folks have suggestions for how to speed up this process? For instance, one hack I've seen is to set the LD_PRELOAD_32 environment variable to a library that caches the result of ENOENT calls (e.g. failed stat() calls) between runs. Of course, this has all sorts of problems (potentially confusing non-python programs, negative caching, etc.).
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, with tons of different directories, this can take around 5 seconds -- all to run a script that might fail instantly. Do folks have suggestions for how to speed up this process? For instance, one hack I've seen is to set the LD_PRELOAD_32 environment variable to a library that caches the result of ENOENT calls (e.g. failed stat() calls) between runs. Of course, this has all sorts of problems (potentially confusing non-python programs, negative caching, etc.).
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 called "nbtscan" that provides similar info. If you do not wish to use an external tool, maybe there are NetBIOS libraries for python that could be used to gather the info for you?
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 (all Unixes and Windows do).
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 "wrappers" around the admin functions. You write a "wrapper" view function checks object permissions. Your wrapper view function calls the admin view function. After that, you'll want to fix the style sheets in the admin pages to be your preferred look and feel.
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 belong to multiple groups: the user can only view/comment on blogposts created by member of groups (s)he belongs to. Each user can modify/delete only the posts (s)he creates. As I see it, this is essentially a CRUD application with access control, and the admin app seems to have a lot of this functionality builtin. Is it feasible to develop this complete application using the admin application alone (not as a prototype, as a release-quality solution), or should I look beyond (Generic views? ModelForms?) I'm trying to estimate how long this will take (learning + implementation), so your feedback could give me a good idea, in addition to teaching me the ways of this new Django-world :) Edit: specifically, one of my worries is per-object/per-row permissions. The django wiki says the Permissions system doesn't support that, so can I still use the admin app?
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 feature is going to be in the 1.2 release this year. It doesn't seem to be in the documentation yet, but if you can find the default methods in the django/contrib/admin/options.py file of the Django source, exact instructions are in the docstrings. I wouldn't recommend doing the entire app in the admin, though. It would work fine for the parts of the app where people are writing their posts and creating their blogs, but the admin wouldn't be suited for just displaying the data, unless you write lots of custom code. Writing views that can display objects and submit comments in Django isn't very hard - most of the work is in the templates.
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 belong to multiple groups: the user can only view/comment on blogposts created by member of groups (s)he belongs to. Each user can modify/delete only the posts (s)he creates. As I see it, this is essentially a CRUD application with access control, and the admin app seems to have a lot of this functionality builtin. Is it feasible to develop this complete application using the admin application alone (not as a prototype, as a release-quality solution), or should I look beyond (Generic views? ModelForms?) I'm trying to estimate how long this will take (learning + implementation), so your feedback could give me a good idea, in addition to teaching me the ways of this new Django-world :) Edit: specifically, one of my worries is per-object/per-row permissions. The django wiki says the Permissions system doesn't support that, so can I still use the admin app?
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 have to do to get the admin to look like a reasonably presentable site in terms of personalization, you might as well take the weekend off, actually LEARN the tools you are trying to bastardize, and make a real site. What you are describing wouldn't be heroic by any means in terms of logic. This scenario reminds me of the old Garfield cartoon where the guy buys the cat an incredibly expensive and awesome looking bed, and the cat chooses to sleep in the box that the bed came in.
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 belong to multiple groups: the user can only view/comment on blogposts created by member of groups (s)he belongs to. Each user can modify/delete only the posts (s)he creates. As I see it, this is essentially a CRUD application with access control, and the admin app seems to have a lot of this functionality builtin. Is it feasible to develop this complete application using the admin application alone (not as a prototype, as a release-quality solution), or should I look beyond (Generic views? ModelForms?) I'm trying to estimate how long this will take (learning + implementation), so your feedback could give me a good idea, in addition to teaching me the ways of this new Django-world :) Edit: specifically, one of my worries is per-object/per-row permissions. The django wiki says the Permissions system doesn't support that, so can I still use the admin app?
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 wire. Django's DecimalField() doesn't set a decimal amount. It only stores a maximum decimal places amount. So, if you have 49 in there, and you have the field set to 2 decimal places, it'll still store it as 49. I know that Django is basically type casting when it deserializes back from the database into a Decimal (since Databases don't have decimal fields), so I'm not completely concerned with the speed issues as much as I am with the design issues of this problem. I want to do what's best for extensibility. Or, better yet, does anyone know how to configure a django DecimalField() to always format with the TWO_PLACES formatting style.
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 wire. Django's DecimalField() doesn't set a decimal amount. It only stores a maximum decimal places amount. So, if you have 49 in there, and you have the field set to 2 decimal places, it'll still store it as 49. I know that Django is basically type casting when it deserializes back from the database into a Decimal (since Databases don't have decimal fields), so I'm not completely concerned with the speed issues as much as I am with the design issues of this problem. I want to do what's best for extensibility. Or, better yet, does anyone know how to configure a django DecimalField() to always format with the TWO_PLACES formatting style.
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 still 5 The two decimal places do not appear (if I can put it that way) until the value is output. You can't save a number with 2 decimal places unless you use a string.
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).quantize(Decimal(10)**-DECIMAL_PLACES) You can overload the to_python method in a custom django.db.models.DecimalField to ensure that a python Decimal object with the correct precision is returned.
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? Thanks! Joel Update: Thanks for the comments so far. This will eventually need to be for any OS, but certainly Windows. To clarify, I'm wanting something the user will download from me, install, and then it'll show up in the system tray (windows) For Mac-I guess it'll show up in the dashboard?
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 portable, but it will work. Python/Ruby/Perl/etc. These are easier, but require either the runtime, or the runtime to be bundled up in the application, which makes it rather large. Flash applications can bundle the runtime, I think. Java/.NET. A good way to do it, but they will need the runtime, which can't be put inside the executable. A widget. A special web page, recent OSes support it. See below. I would go with the widget, if possible. It's just HTML and JavaScript. They're easy to write, and work well. OS X, Vista, Windows 7, and Linux all have support for widgets and won't need additional software. Windows XP would need a runtime (like Yahoo! Widgets) to be installed first. Each OS does things slightly differently, so changes would have to be made to make a widget run in Dashboard in OS X and as a Gadget in Windows Vista/7. I hope this helps. I made a widget to interact with a web application that company made. I made is for OS X (my OS), and it was quite easy. It just uses XMLHttpRequest to load some XML, parses it out, and updates it's self. It's quite simple. The same server side code can serve any kind of widget, as well as real applications.
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? Thanks! Joel Update: Thanks for the comments so far. This will eventually need to be for any OS, but certainly Windows. To clarify, I'm wanting something the user will download from me, install, and then it'll show up in the system tray (windows) For Mac-I guess it'll show up in the dashboard?
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? Thanks! Joel Update: Thanks for the comments so far. This will eventually need to be for any OS, but certainly Windows. To clarify, I'm wanting something the user will download from me, install, and then it'll show up in the system tray (windows) For Mac-I guess it'll show up in the dashboard?
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? Thanks! Joel Update: Thanks for the comments so far. This will eventually need to be for any OS, but certainly Windows. To clarify, I'm wanting something the user will download from me, install, and then it'll show up in the system tray (windows) For Mac-I guess it'll show up in the dashboard?
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 if you don't need to keep all of the data around. With C extensions, of course, you are back in unmanaged territory, and anything is possible.
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 usage , imagine you overload these wx widgets methods within python... memoryleaks assured.
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 the correct answer or not. I'd have a table of Quizzes, with ID_Quiz as the PK, and a description of the quiz, and a category (if you want). I'd have a table of QuizQuestions, with ID_QuizQuestion as the PK, QuizID as a FK back to the Quizzes table, and QuestionID as a FK back to the Questions table. This model lets you: Use questions standalone or in quizzes Lets you have as many or few questions in a quiz as you want Lets you have as many of few choices for questions as you want (or even multiple correct answers) Use questions in several different quizzes
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 lists stored for each of a question's characteristics? Or perhaps someone has another idea... Thank you in advance. It would probably help to say that I am using Google App Engine, which typically frowns upon relational db models, but I'm willing to go my own route if it makes sense.
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 concepts. An RDBMS just handles a lot of the messy book keeping for you.
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 lists stored for each of a question's characteristics? Or perhaps someone has another idea... Thank you in advance. It would probably help to say that I am using Google App Engine, which typically frowns upon relational db models, but I'm willing to go my own route if it makes sense.
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 marker or not. (Most files will start on a block boundary; the end of the file may be anywhere, possibly even across block boundaries.) What's the better way to deal with it? Well, it depends what you're after - but if you're looking only at currently allocated blocks, then scan the file system using the Python analog of the POSIX C function ftw (nftw), and read each file in turn. This won't find evidence of deleted JPEG files in the free list - if that's what you are after, then you'll need to do as you are doing, more or less, but correlate that information with what you find in the file system proper. Mapping those blocks will (at best) be hard.
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 always need to take into account all ffd9 closures even after the first. So it tends to be a really intensive operation. Given a device with let's say 25 jpegs as well as lots of other data, the looping is pretty dramatic and it runs though a lot. The program is not the slowest thing in the world, but I think it could be much faster and much more efficient. I am looking for a better way to search the block device and extract the data in a more efficient manner. I also don't want to kill the HDD or the drive holding the image of the block device. So does anybody knew of a better way to systematically handle the searching and extraction of the data?
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 print the next byte(s). I used the same method to 'fix' the n-th byte in a zillion images once.
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. the content is already getting copied to a variable called 'data' i am able to print contents of the variable data. i just need to check if it has more than 102400 bytes. thanks
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. the content is already getting copied to a variable called 'data' i am able to print contents of the variable data. i just need to check if it has more than 102400 bytes. thanks
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 release. HTH
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 seconds? In this case, I didn't even notice the bug until the site started feeling slow, at which point one apache2 process had been running inside an infinite loop for hours. If there were a timeout (even a long one, like 10min) that could have caught this and emailed me, I'd have known about the problem sooner, and it wouldn't have impacted site performance for as many users. Googling, I've found some suggestions of similar things in a mod_wsgi configuration, but if there's a way to do this under my current setup I'd prefer that. Thanks!
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 seconds? In this case, I didn't even notice the bug until the site started feeling slow, at which point one apache2 process had been running inside an infinite loop for hours. If there were a timeout (even a long one, like 10min) that could have caught this and emailed me, I'd have known about the problem sooner, and it wouldn't have impacted site performance for as many users. Googling, I've found some suggestions of similar things in a mod_wsgi configuration, but if there's a way to do this under my current setup I'd prefer that. Thanks!
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 days consists of multiple queries/charts/graphs/tables per page with drill-down built directly into it. If you've got enough of a need go with an OLAP tool - then you don't even code the reports, your users (theoretically) can. If not, I've seldom seen a scenario in which a "reporting tool" was better than using something like Chart Director with a language like php, perl, python, ruby, etc.
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 hook into it. Thanks! Mark
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 should google easy questions yourself, but this isn't really clearly answered anywhere.
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 Python tool availability an issue with any Linux distribution.
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 the other hand, the gentoo linux distro also has python integrated in its Portage package management system. So gentoo and ubuntu I would say are good for python development system and each represent both ends of the spectrum.
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 can focus on the development tasks you want to tackle. If you have a Linux environment that's a target for your code (like say, RedHat or something), then go with the desktop distribution that matches your target environment (like, say, Fedora for RedHat, Gentoo for Gentoo, Ubuntu for Ubuntu Server, etc.) Otherwise, all of them are suitable.
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 your IDE, and that it is updated often enough. As an example, I like to use Eclipse with PyDev for developing Python apps in either OS, but Ubuntu's official repositories had only Eclipse 3.2 (from 2006) until October of last year, when they finally updated to 3.5 in the latest distribution.
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 consider is, if you have any way of taking orders over the phone, and the phone operators need to take customers' credit card details, then your whole internal network will need to be PCI compliant, too. If you JUST need it for a website, then that makes it easier. If you have a low turnover, then check out the sites mentioned above. If you have a high turnover, then it may work out more cost effective in the long run to get PCI-DSS certified and still keep control of credit card transactions in-house, giving you more flexibility, and cheaper transaction costs.
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 actions on our site, generating an amount that needs to be paid. Our server contacts the gateway asynchronously (no hidden inputs) and tells it about the user, how much they need to pay. The gateway returns a URL and perhaps a tentative transaction ID. Our server stores the transaction ID and redirects the user to the URL provided by the gateway. The user fills out their payment details on the remote server. When they have completed that, the gateway asynchronously contacts our server with the outcome, transaction id, etc and forwards them back to us (at a predestined URL). We can show the user their order is complete/failed/etc. Fin. If at all possible, UK or EU based and developer friendly. We don't need any concept of a shopping basket as we have that all handled in our code already. We have (or at least will have by launch) a proper merchant banking account - so cover services like Paypay aren't needed. If their API covers Python (we're using Django) explicitly, all the better but I think I'm capable enough to decipher any other examples and transcode them into Python myself.
Looking for a payment gateway
0.07983
0
1
3,656