Q_Id int64 337 49.3M | CreationDate stringlengths 23 23 | Users Score int64 -42 1.15k | Other int64 0 1 | Python Basics and Environment int64 0 1 | System Administration and DevOps int64 0 1 | Tags stringlengths 6 105 | A_Id int64 518 72.5M | AnswerCount int64 1 64 | is_accepted bool 2
classes | Web Development int64 0 1 | GUI and Desktop Applications int64 0 1 | Answer stringlengths 6 11.6k | Available Count int64 1 31 | Q_Score int64 0 6.79k | Data Science and Machine Learning int64 0 1 | Question stringlengths 15 29k | Title stringlengths 11 150 | Score float64 -1 1.2 | Database and SQL int64 0 1 | Networking and APIs int64 0 1 | ViewCount int64 8 6.81M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,223,557 | 2010-07-11T15:28:00.000 | 13 | 1 | 0 | 0 | php,python,jsp | 3,223,581 | 7 | true | 1 | 0 | Before learning either of these, spend some real time and learn HTML and CSS in depth. Also learn Javascript and JQuery (or your favorite client side library). The O'Reilly books on the topic are pretty much all good IMO.
I say that because I think that you'll find that for most modern web sites, a lot of richness is moving to the client side, and away from the server side. Under this model, your code in PHP or JSP is probably going to look pretty similar (ie, fetch data from the database and serve it to your view or into JSON for the client to consume). | 6 | 5 | 0 | Friends,
I've got some exp in c++ and now kind of starting my way to J2EE (to survive:))). Meanwhile, I've got a plan to venture in to a web portal my own. But with very little experience in web technology, I'd need to start from scratch. I'm little confused on which way to go and I'm here.
PHP, Python or JSP, considering the fact that, anyway I've got to learn J2EE at my work.
Would that be worth to learn PHP or Python to develop a portal which I expect to get 80-100K
hits per day "IF" everything goes well OR jsp would be sufficient?
Many thanks | Which web technology to learn for an experienced C++ developer? | 1.2 | 0 | 0 | 1,073 |
3,223,557 | 2010-07-11T15:28:00.000 | 0 | 1 | 0 | 0 | php,python,jsp | 3,223,646 | 7 | false | 1 | 0 | There are many options.
Since you already know (and is learning about) Java, one option is to use GWT for both server and client. This can help you in that you do not need to learn another language (JS/HTML/Python/PHP etc). If your portal is going to be big, using Java can help you organise the application better - usually JS/HTML based applications are not very suitable for proper organisation, even if you use good JS Libraries like jQuery or YUI. Having a good organisation can help a lot - during updation and modification later.
If your planned venture is a single/two person venture or if it is time bound - where time to market is everything - then I would not suggest the earlier approach - especially if your server side part is expected to be big.
Java is a slow language to write code in. A project which you will take say 6 months to write in Python will take you close to 1 year + in Java. In such a scneario, I would prefer Python - it is a proper language - unlike PHP, and you create code with good organisation there too - albeit a little less organised than using Java.
Please note that if your client side code is much more complex than your server side code, then going with GWT will do you no harm. But if your server side code is very complex compared to the client side, then I would suggest Python.
Another point is to use existing Web Frameworks to ease your work. For Python, Django is an excellent choice. This itself will decrease your work time by 50% or more, while making your code much more secure and scalable. | 6 | 5 | 0 | Friends,
I've got some exp in c++ and now kind of starting my way to J2EE (to survive:))). Meanwhile, I've got a plan to venture in to a web portal my own. But with very little experience in web technology, I'd need to start from scratch. I'm little confused on which way to go and I'm here.
PHP, Python or JSP, considering the fact that, anyway I've got to learn J2EE at my work.
Would that be worth to learn PHP or Python to develop a portal which I expect to get 80-100K
hits per day "IF" everything goes well OR jsp would be sufficient?
Many thanks | Which web technology to learn for an experienced C++ developer? | 0 | 0 | 0 | 1,073 |
3,223,557 | 2010-07-11T15:28:00.000 | 0 | 1 | 0 | 0 | php,python,jsp | 3,224,044 | 7 | false | 1 | 0 | It really isn't that similar to C++, but I would recommend PHP. You really can't expect a server-side scripting language to be similar to a compiled language like C++. Personally, I find PHP to be an ugly, messy looking language, but once you get into it, it's very rewarding. Other languages have too many drawbacks. ASP.Net is too Microsoft-centric, Python and Ruby on Rails are too obscure, and are also non-curly bracket languages, meaning it will require a lot of adjustment to change to them. Hope this helps. | 6 | 5 | 0 | Friends,
I've got some exp in c++ and now kind of starting my way to J2EE (to survive:))). Meanwhile, I've got a plan to venture in to a web portal my own. But with very little experience in web technology, I'd need to start from scratch. I'm little confused on which way to go and I'm here.
PHP, Python or JSP, considering the fact that, anyway I've got to learn J2EE at my work.
Would that be worth to learn PHP or Python to develop a portal which I expect to get 80-100K
hits per day "IF" everything goes well OR jsp would be sufficient?
Many thanks | Which web technology to learn for an experienced C++ developer? | 0 | 0 | 0 | 1,073 |
3,225,397 | 2010-07-12T01:45:00.000 | 1 | 0 | 0 | 0 | python,google-app-engine | 3,225,411 | 4 | false | 1 | 0 | Keep a counter object for your application stored in the database, and update it whenever you create and delete objects. | 2 | 5 | 0 | What is the best way to determine how many models of a certain kind are in my app's datastore? The documentation says that MyKind.all().count() is only marginally better than retrieving all of the data, and has a limit of 1000. This is not helpful, because I am expecting to have 6000+ instances of MyKind stored.
Is there a better way to do this? What if I just get the keys, and count those?
I'm using Python. | GAE: Best way to determine how many of a Kind is stored? | 0.049958 | 0 | 0 | 121 |
3,225,397 | 2010-07-12T01:45:00.000 | 3 | 0 | 0 | 0 | python,google-app-engine | 3,225,480 | 4 | false | 1 | 0 | If you do keys-only it should be pretty fast, since this only has to read the index and doesn't actually fetch any entities. Use a cursor and loop until count() returns less than 1000. | 2 | 5 | 0 | What is the best way to determine how many models of a certain kind are in my app's datastore? The documentation says that MyKind.all().count() is only marginally better than retrieving all of the data, and has a limit of 1000. This is not helpful, because I am expecting to have 6000+ instances of MyKind stored.
Is there a better way to do this? What if I just get the keys, and count those?
I'm using Python. | GAE: Best way to determine how many of a Kind is stored? | 0.148885 | 0 | 0 | 121 |
3,225,712 | 2010-07-12T03:37:00.000 | 0 | 0 | 1 | 0 | python,list,tuples | 3,225,718 | 3 | false | 0 | 0 | If you mean what the maximum size of a tuple or list is, I assume that it is very large. Most likely you would run out of memory before hitting some limit. Someone else can add to this if they have specific knowledge of the indexing, possible 2.1 or 4.2 billion items in 32-bit and 8 or 16 sextillion in 64-bit. | 1 | 3 | 0 | How many items can contain tuple or list in python? What will be if it is 10 000? | How many can a tuple or list contain in Python? | 0 | 0 | 0 | 8,999 |
3,226,529 | 2010-07-12T07:22:00.000 | 0 | 0 | 0 | 0 | python,django,django-authentication,django-contrib | 3,229,364 | 2 | false | 1 | 0 | My recommendation is to not re-solve a problem that django-registration solves quite nicely. It has a pluggable backend system that lets you customize it as much or as little as needed. | 1 | 0 | 0 | I'm rolling my own custom registration module in Django based on django.contrib.auth. My registration module will have some extra functionality and help me reduce my dependency on other django modules that I'm currently using like django-registration and django-emailchange. I've run into a what-the-best-way-to-do-it problem here.
Note: All the user accounts are based on django.contrib.auth.models.User model.
When the user clicks the "sign-up" link, the request gets passed to my view named register. I have a custom form which has four fields — username, email, password1 and password2. The form is based on django.forms.Form. The form provides basic validation e.g. passoword1 and password2 are the email; the email/username do not exist.
When the data gets POSTed back to my register view, I call the is_valid() method of the form, after which, I create a new user by calling a Manager method called create_user() in django.contrib.auth.models.UserManager. I need to add more custom functionality at this point like sending activation emails, etc. As a best-practice method, where should this logic be? Should this be in a method of the User Model? Should it be where it is currently - the Manager of the Model? Or should this be placed into a custom save() method of my sign-up Form?
Thanks. | Should I place custom registration code in Views, Models or Managers? | 0 | 0 | 0 | 152 |
3,227,789 | 2010-07-12T10:49:00.000 | 4 | 0 | 0 | 1 | python,programming-languages,prototype | 3,227,900 | 5 | false | 0 | 0 | I started twelve years ago to replace my Perl scripts -- and the new ones were shorter and way more readable. So, readability and the gentle learning curve was the main reason to use it.
After version 2, the language has got more and more flexible, and with it my programming needs and I got used to do metaprogramming without even noticing.
To see what I mean, have a look at the examples in SQLAlchemy's documentation.
You point to lack of tools -- but the last time I've seen a code generator has been ... I guess 10 years ago, and it was a bad idea even at the time, because you just don't need it.
The development team cares a lot about compatibility -- they ponder for years before introducing new syntax. Only mature modules go in the standard library, and python 3 has been discussed for ages. On top of the porting facilities, there is now a moratorium -- no new features to the language for at least two years.
As for performance - since I don't have to think about which methods throws which exception or having explicit interfaces for everything, and I have a lot more design patterns embedded in the language.. well, I am free to experiment with the architecture and optimize where it makes sense. Most of the time, for me, it's the network or the DB. | 3 | 5 | 0 | Coming from an enterprise systems background (think Java and Windows) - I'm surprised at the popularity of python as a prototyping language and am trying to put my finger on the precise reason for this. Examples include being listed as one of the four languages Google uses. Possible reasons include:
enables rapid systems application prototyping using of c++ libraries using swig wrappers
built to a well defined language specification
innovative features at the syntax level enabling high level of expressiveness
highly flexible web frameworks built long before other languages (django)
The questions is what makes it so popular/highly regarded, but to give some balance I'm going to give some reasons it might not be popular:
less tool support
less enterprise support (ie a vendor helpdesk)
lower performance
BDFL not caring about backward compatibility in version upgrades
Or was it just the best at a particular point in time (about 8 years ago) and other languages and frameworks have since caught up? | What is the dominant reason for Python's popularity as a systems and application programming language? | 0.158649 | 0 | 0 | 3,307 |
3,227,789 | 2010-07-12T10:49:00.000 | 6 | 0 | 0 | 1 | python,programming-languages,prototype | 3,227,836 | 5 | false | 0 | 0 | enables rapid systems application prototyping using of c++ libraries using swig wrappers
... What?
Most people doing Python programming aren't doing C++ programming, they're doing Python programming. And they're doing it fast, because they don't need to worry about things like memory management, or templates, or... the sort of namespace support C++ uses. | 3 | 5 | 0 | Coming from an enterprise systems background (think Java and Windows) - I'm surprised at the popularity of python as a prototyping language and am trying to put my finger on the precise reason for this. Examples include being listed as one of the four languages Google uses. Possible reasons include:
enables rapid systems application prototyping using of c++ libraries using swig wrappers
built to a well defined language specification
innovative features at the syntax level enabling high level of expressiveness
highly flexible web frameworks built long before other languages (django)
The questions is what makes it so popular/highly regarded, but to give some balance I'm going to give some reasons it might not be popular:
less tool support
less enterprise support (ie a vendor helpdesk)
lower performance
BDFL not caring about backward compatibility in version upgrades
Or was it just the best at a particular point in time (about 8 years ago) and other languages and frameworks have since caught up? | What is the dominant reason for Python's popularity as a systems and application programming language? | 1 | 0 | 0 | 3,307 |
3,227,789 | 2010-07-12T10:49:00.000 | 19 | 0 | 0 | 1 | python,programming-languages,prototype | 3,227,809 | 5 | true | 0 | 0 | Highly expressive language. People often say, "Python works the way my brain does".
Dynamic typing means you spend zero time appeasing the compiler.
A large standard library means you often have the tools you need at your fingertips.
An even larger stable of third-party packages (PIL, Numpy, NLTK, Django) mean that large problem domains are often well-supported.
Open-source implementation means you don't have to grovel at the vendor helpdesk, you can find answers yourself, and get solutions from a large community of users. | 3 | 5 | 0 | Coming from an enterprise systems background (think Java and Windows) - I'm surprised at the popularity of python as a prototyping language and am trying to put my finger on the precise reason for this. Examples include being listed as one of the four languages Google uses. Possible reasons include:
enables rapid systems application prototyping using of c++ libraries using swig wrappers
built to a well defined language specification
innovative features at the syntax level enabling high level of expressiveness
highly flexible web frameworks built long before other languages (django)
The questions is what makes it so popular/highly regarded, but to give some balance I'm going to give some reasons it might not be popular:
less tool support
less enterprise support (ie a vendor helpdesk)
lower performance
BDFL not caring about backward compatibility in version upgrades
Or was it just the best at a particular point in time (about 8 years ago) and other languages and frameworks have since caught up? | What is the dominant reason for Python's popularity as a systems and application programming language? | 1.2 | 0 | 0 | 3,307 |
3,227,843 | 2010-07-12T10:57:00.000 | 2 | 0 | 0 | 0 | python,image-processing | 3,227,905 | 5 | false | 0 | 0 | First do thresholding, then segmentation. Then you can more easily detect edges. | 2 | 25 | 1 | We have a web-cam in our office kitchenette focused at our coffee maker. The coffee pot is clearly visible. Both the location of the coffee pot and the camera are static. Is it possible to calculate the height of coffee in the pot using image recognition? I've seen image recognition used for quite complex stuff like face-recognition. As compared to those projects, this seems to be a trivial task of measuring the height.
(That's my best guess and I have no idea of the underlying complexities.)
How would I go about this? Would this be considered a very complex job to partake? FYI, I've never done any kind of imaging-related work. | Determine height of Coffee in the pot using Python imaging | 0.07983 | 0 | 0 | 1,297 |
3,227,843 | 2010-07-12T10:57:00.000 | 0 | 0 | 0 | 0 | python,image-processing | 3,231,205 | 5 | false | 0 | 0 | make pictures of the pot with different levels of coffe in it.
downsample the image to maybe 4*10 pixels.
make the same in a loop for each new live picture.
calculate the difference of each pixels value compared to the reference images.
take the reference image with the least difference sum and you get the state of your coffe machine.
you might experiment if a grayscale version or only red or green might give better results.
if it gives problems with different light settings this aproach is useless. just buy a spotlight for the coffe machine, or lighten up, or darken each picture till the sum of all pixels reaches a reference value. | 2 | 25 | 1 | We have a web-cam in our office kitchenette focused at our coffee maker. The coffee pot is clearly visible. Both the location of the coffee pot and the camera are static. Is it possible to calculate the height of coffee in the pot using image recognition? I've seen image recognition used for quite complex stuff like face-recognition. As compared to those projects, this seems to be a trivial task of measuring the height.
(That's my best guess and I have no idea of the underlying complexities.)
How would I go about this? Would this be considered a very complex job to partake? FYI, I've never done any kind of imaging-related work. | Determine height of Coffee in the pot using Python imaging | 0 | 0 | 0 | 1,297 |
3,228,212 | 2010-07-12T11:48:00.000 | 0 | 0 | 0 | 0 | python,django,django-cms | 57,008,799 | 4 | false | 1 | 0 | It's located inside the djangocms_admin_style module, the path is djangocms_admin_style/static/djanogcms_admin_style/img/django-cms-logo.png. It's better to clone it, customize it and then simply add it to your project under the
INSTALLED_APPS=[]. | 3 | 4 | 0 | Is there a way to change the Django CMS logo, for my own company logo? | Django CMS logo change | 0 | 0 | 0 | 3,098 |
3,228,212 | 2010-07-12T11:48:00.000 | 2 | 0 | 0 | 0 | python,django,django-cms | 3,230,427 | 4 | true | 1 | 0 | Replace /media/cms/images/cms_toolbar.png
Or edit the #cms_toolbar definition in the media/cms/css/toolbar.css stylesheet. | 3 | 4 | 0 | Is there a way to change the Django CMS logo, for my own company logo? | Django CMS logo change | 1.2 | 0 | 0 | 3,098 |
3,228,212 | 2010-07-12T11:48:00.000 | 1 | 0 | 0 | 0 | python,django,django-cms | 3,228,229 | 4 | false | 1 | 0 | Which logo do you mean?
I think logo is just an image inside the template, right?
Check out the template in cms/templates/cms/new.html | 3 | 4 | 0 | Is there a way to change the Django CMS logo, for my own company logo? | Django CMS logo change | 0.049958 | 0 | 0 | 3,098 |
3,229,102 | 2010-07-12T13:44:00.000 | 1 | 0 | 1 | 0 | python,compiler-construction,parsing,stack-trace,abstract-syntax-tree | 3,498,493 | 3 | false | 0 | 0 | From what I have figured out in the meantime, this is not possible. At least not block-wise. It is possible to recompile the code per function but not per code-block because Python generates the code objects per function.
So the only way is to write an own Python compiler. | 1 | 3 | 0 | Sorry for the kind of general question. More details about what I want:
I want the user to be able to write some Python code and execute it. Once there is an exception which is not handled, I want the debugger to pause the execution, show information about the current state/environment/stack/exception and make it possible to edit the code.
I only want to have the special code block editable where the exception occurred and nothing else (for now). I.e. if it occurred inside a for loop, I only want to have the code block inside the for loop editable. It should be the latest/most recent code block which is in the user editor scope (and not inside some other libs or the Python libs). Under this conditions, it is always clear what code block to edit.
I already tried to investigate a bit how to do this, though I feel a bit lost.
The Python traceback doesn't give me directly the code block, just the function and the code line. I could calculate that back but that seems a bit hacky to me. Better (and more natural) would be if I could somehow get a reference to the code block in the AST of the code.
To get the AST (and operate on it, i.e. manipulate/edit), I probably will use the compiler (which is deprecated?) and/or the parser module. Or the ast module. Not sure though how I could recompile special nodes / code blocks in the AST. Or if I only can recompile whole functions. | how to write a Python debugger/editor | 0.066568 | 0 | 0 | 2,309 |
3,231,910 | 2010-07-12T20:17:00.000 | 4 | 1 | 0 | 0 | python,ftplib | 3,232,065 | 3 | false | 0 | 0 | Ftplib can get the size of a file before downloading. As the documentation says:
FTP.size(filename)
Request the size of
the file named filename on the server.
On success, the size of the file is
returned as an integer, otherwise None
is returned. Note that the SIZE
command is not standardized, but is
upported by many common server
implementations
Apparently your server doesn't support this feature. | 1 | 12 | 0 | I'm using ftplib to transfer files. Everything is working great. Now I'm trying to get the size of the target file before downloading.
First, I tried just getting size with ftp.size(filename). Server complained that I can't do that in ascii mode.
Then I tried setting binary mode using ftp.sendcmd("binary") and ftp.sendcmd("bin"). In both cases the server complained "500 binary Not understood"
Can ftplib get size of a file before downloading in this instance? I don't control the FTP server and can't change how it's behaving.
Thanks | Python ftplib can't get size of file before download? | 0.26052 | 0 | 0 | 12,384 |
3,232,613 | 2010-07-12T21:57:00.000 | 16 | 0 | 0 | 1 | python,subprocess,signals,intercept,sigint | 3,731,948 | 3 | false | 0 | 0 | Signal handlers are inherited when you start a subprocess, so if you use the signal module to ignore SIGINT (signal.signal(signal.SIGINT, signal.SIG_IGN)), then your child process automatically will also.
There are two important caveats, though:
You have to set the ignore handler before you spawn the child process
Custom signal handlers are reset to the default handlers, since the child process won't have access to the handler code to run it.
So if you need to customise your handling of SIGINT rather than just ignoring it, you probably want to temporarily ignore SIGINT while you spawn your child process, then (re)set your custom signal handler.
If you're trying to catch SIGINT and set a flag so you can exit at a safe point rather than immediately, remember that when you get to that safe point your code will have to manually clean up its descendants, since your child process and any processes it starts will be ignoring the SIGINT. | 1 | 16 | 0 | My python script intercepts the SIGINT signal with the signal process module to prevent premature exit, but this signal is passed to a subprocess that I open with Popen. is there some way to prevent passing this signal to the subprocess so that it also is not exited prematurely when the user presses ctrl-c? | How to stop SIGINT being passed to subprocess in python? | 1 | 0 | 0 | 5,099 |
3,232,833 | 2010-07-12T22:38:00.000 | 2 | 0 | 0 | 1 | python,google-app-engine | 3,232,948 | 2 | false | 1 | 0 | This would be difficult to use as-is on app engine because many copies of your application could be running at once. Each copy would need access to the "last identifier" and be able to update it atomically. This would likely require too much overhead, unless you only need to generate new IDs in this fashion rather infrequently.
Why not use GAE's built-in numeric IDs? They are guaranteed to be unique and are also easy to communicate. They are also generally sequential and increasing, though this is not guaranteed. | 1 | 2 | 0 | Using an alphabet like "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ" I'd like to generate 2 to 4 letter codes to identify unique datastore entries. I have a python function capable of doing this when passed an list indicating the letter positions of the last code [7,17,11] -> "7GA". the next code can be made by incrementing that right most element by one and carrying one up when the alphabet length is exceeded.
This method has the advantage of keeping codes short, sequential, consistent, easy to communicate, and looking how I want them to.
I'm wondering though if this would work on app engine since the function must hold onto or be passed the last identifier to enforce uniqueness which may not play well with the non-continuous nature of Google's infrastructure. Alternate ways to make this happen or reasoned arguments against it are welcome. | App Engine Unique Non Numeric Code | 0.197375 | 0 | 0 | 215 |
3,233,246 | 2010-07-13T00:09:00.000 | 0 | 0 | 0 | 0 | python,apache,xampp,plone,zope | 3,247,954 | 2 | true | 1 | 0 | sorry for wrong site but I just figured out that it was not a problem at all. I installed XAMPP (a snap) and downloaded and ran the plone install script. Both sites XAMPP on port 80 and zope/plone on 8080 are working without problems. Just to let everyone know. I don't know why I got nervous about this :) | 1 | 0 | 0 | Is there a good step by step online guide to install xampp (apache server,mysql server) together with zope-plone on the same linux machine and make it play nicely or do I have to go through their confusing documentations?
Or how can I install this configuration in the best way? I can install and use both seperately but in tandem is an issue for me. Any help is appreciated. | Guide to install xampp with zope-plone on the same linux machine? | 1.2 | 1 | 0 | 486 |
3,233,584 | 2010-07-13T01:31:00.000 | 0 | 0 | 1 | 0 | python,ide,todo | 47,774,966 | 2 | false | 0 | 0 | I know this is a very old post, but I thought I'd share the following.
Any line starting "#TODO: " will add text to the to-do list/tab (the keyword is case insensitive). You can add one or more exclamation marks - these act as a priority ordering mechanism, the number appearing in the "!" column. Further, the entry (or entries) that have the largest exclamation count are highlighted with a yellow background.
When I discovered how to use this feature, I consigned all my scrappy notes of 'things to fix' to the bin and kept them all 'online' so to speak. It is a very useful feature. | 1 | 0 | 0 | How do I add a todo list item in Stani's Python Editor? I think it's something you type in together with the code and it automatically shows up the the todo list panel. However, I do not know the syntax. | Add a todo list item in SPE (Stani's Python Editor) | 0 | 0 | 0 | 465 |
3,234,402 | 2010-07-13T05:24:00.000 | 1 | 0 | 0 | 0 | python,django | 3,235,021 | 5 | false | 1 | 0 | Starting from Django it's good way to learn Python in fact. Django allows you to do nice things in a short time, which might be good motivation to dive into that language. | 2 | 2 | 0 | Now, I'm learning python but I'm PHP web developer. I don't interest about terminal and windows programming. I only want to do web development. So, Can I learn Django ? | Can we learn Django for a python beginner? | 0.039979 | 0 | 0 | 5,268 |
3,234,402 | 2010-07-13T05:24:00.000 | 9 | 0 | 0 | 0 | python,django | 3,234,410 | 5 | true | 1 | 0 | Yes, you can. I started learning Django with very little Python knowledge too. As long as you have another language behind your belt, preferably a web based one (as you do), I don't think you're biting off too much at once.
Python's a pretty easy language to pick up too. Just have to get used to the significant white space and lack of semi-colons :P | 2 | 2 | 0 | Now, I'm learning python but I'm PHP web developer. I don't interest about terminal and windows programming. I only want to do web development. So, Can I learn Django ? | Can we learn Django for a python beginner? | 1.2 | 0 | 0 | 5,268 |
3,235,133 | 2010-07-13T07:51:00.000 | 5 | 0 | 1 | 0 | python,date-format | 3,235,166 | 2 | true | 0 | 0 | struct_time is the old way of representing times, modeled after the C standard library. datetime came later, is more pythonic, is more featureful, and has more predictable behavior in edge cases than the struct_time functions. I would use datetime except in the rare cases where a measured performance difference is significant enough to matter, or where it makes the code significantly less readable. | 1 | 5 | 0 | Is one preferred over the other? If so, in all cases or just a few?
I am intending to use some form of date class for keeping long lists of date and time data, e.g. '2009-01-01 10:12:00'. | What are the differences between struct_time and datetime? | 1.2 | 0 | 0 | 1,328 |
3,235,684 | 2010-07-13T09:14:00.000 | 0 | 0 | 1 | 0 | python,import,importerror | 3,235,798 | 3 | false | 0 | 0 | Apart from breaking the circular dependency you can try moving the locations of your import calls. Don't forget that imports in Python are just regular statements, so you can import inside functions for example.
The trouble is that import (as a side-effect) will actually run the module being imported (the first time you call import). So if you are importing a module, which imports the original module things get confused.
You may find that you can ease the problem by only importing errors/file_operations at the point you actually need to use it. This could be inside a function. So maybe wrap the call to the function in errors:
def print_error_message(err):
from errors import print_error_message as _print_error_message
_print_error_message(err)
That way you will only import errors after the regular imports have run. | 3 | 1 | 0 | I have a series of python modules written which are held in the same directory and I am having trouble with an ImportError.
The three modules I am using are draw_menu.py, errors.py and file_operations.py.
In errors.py I requires a list of error codes, I am using a custom method defined in file_operations.py to open a file containing the codes therefore I am using import file_operations just below the she-bang (above the class definition).
In file_operations.py I use a method defined in error.py to print error messages upon errors (e.g. file not found etc.). I therefore import errors in the same way here.
The above has been working fine but when I come to using draw_menu.py which uses a file to define the options in an ascii menu (therefore I am using import file_operations) an ImportError is encountered.
ImportError: cannot import name file_operations
I understand that this is because the 'import tree' if you like flows as follows:
draw_menu <- file_operations <- errors <- file_operations
It is important that each module can be used individually, why is this an issue and how can I overcome this without removing import file_operations from errors.py?
Thankyou
Tom | Why am I encountering an ImportError when I try to 're-import' a module? | 0 | 0 | 0 | 253 |
3,235,684 | 2010-07-13T09:14:00.000 | 2 | 0 | 1 | 0 | python,import,importerror | 3,235,767 | 3 | true | 0 | 0 | Circular imports can cause issues in Python (as you might expect). It's probably worth checking if:
A) errors.py and file_operation.py should be single module (if they both rely so heavily on each other, do they need to be separate?)
B) you can delay the import in one or the other module. An import statement in a function will not run until the function is called, and while it's normally good practice to import at the beginning of a module there is no requirement to in Python. In situations like this it can avoid the circular reference during import. | 3 | 1 | 0 | I have a series of python modules written which are held in the same directory and I am having trouble with an ImportError.
The three modules I am using are draw_menu.py, errors.py and file_operations.py.
In errors.py I requires a list of error codes, I am using a custom method defined in file_operations.py to open a file containing the codes therefore I am using import file_operations just below the she-bang (above the class definition).
In file_operations.py I use a method defined in error.py to print error messages upon errors (e.g. file not found etc.). I therefore import errors in the same way here.
The above has been working fine but when I come to using draw_menu.py which uses a file to define the options in an ascii menu (therefore I am using import file_operations) an ImportError is encountered.
ImportError: cannot import name file_operations
I understand that this is because the 'import tree' if you like flows as follows:
draw_menu <- file_operations <- errors <- file_operations
It is important that each module can be used individually, why is this an issue and how can I overcome this without removing import file_operations from errors.py?
Thankyou
Tom | Why am I encountering an ImportError when I try to 're-import' a module? | 1.2 | 0 | 0 | 253 |
3,235,684 | 2010-07-13T09:14:00.000 | 1 | 0 | 1 | 0 | python,import,importerror | 3,235,771 | 3 | false | 0 | 0 | The problem is not the imports themselves, but the dependencies. file_operations cannot be processed until it has imported errors, but errors cannot be processed until it has imported file_operations. Python recognises this as an impossible situation, and raises an error.
The best solution to this is to refactor your files so that you don't have this circular dependency any more. If this really isn't possible, the alternative solution is to change one of the modules so that the offending import happens inside the function that needs it, rather than at the top level. This means the initial processing of the module isn't dependent on the import, so it will succeed. | 3 | 1 | 0 | I have a series of python modules written which are held in the same directory and I am having trouble with an ImportError.
The three modules I am using are draw_menu.py, errors.py and file_operations.py.
In errors.py I requires a list of error codes, I am using a custom method defined in file_operations.py to open a file containing the codes therefore I am using import file_operations just below the she-bang (above the class definition).
In file_operations.py I use a method defined in error.py to print error messages upon errors (e.g. file not found etc.). I therefore import errors in the same way here.
The above has been working fine but when I come to using draw_menu.py which uses a file to define the options in an ascii menu (therefore I am using import file_operations) an ImportError is encountered.
ImportError: cannot import name file_operations
I understand that this is because the 'import tree' if you like flows as follows:
draw_menu <- file_operations <- errors <- file_operations
It is important that each module can be used individually, why is this an issue and how can I overcome this without removing import file_operations from errors.py?
Thankyou
Tom | Why am I encountering an ImportError when I try to 're-import' a module? | 0.066568 | 0 | 0 | 253 |
3,236,983 | 2010-07-13T12:10:00.000 | 0 | 0 | 1 | 1 | python | 3,236,999 | 5 | false | 0 | 0 | Maybe "Open with..." + 'Remember my choice' in context menu of explorer? | 2 | 2 | 0 | My program has been written on python 3.1 (it was the biggest mistake I've ever made). Now I want to use a few modules that were written on 2.6.
I know that it's possible to specify the interpreter in Unix #!/usr/bin/python2.6. But what if I use Windows? Does any way to specify the interpreter exist in Windows?
Edit: I want to be able to use both interpreters simultaneously. | How to specify python interpreter on Windows | 0 | 0 | 0 | 2,736 |
3,236,983 | 2010-07-13T12:10:00.000 | 0 | 0 | 1 | 1 | python | 3,237,236 | 5 | false | 0 | 0 | If you go into Control Panel -> System -> Advanced -> Environment Variables, and then add Python 2.6 to the PATH variable (it's probably located at C:\Python26 or C:\Program Files\Python26) -- and make sure Python 3.1 isn't in it -- then if you type python at the command prompt, you'll get 2.6 instead. As for Explorer, you'll want to associate it by using the Open With... dialog. Browse to the path (probably C:\Python26\python.exe) and set it. Make sure you check to make it the default before you hit OK.
To add the to PATH variable, you'll have to add a ; on the end of the current PATH variable and then add the folder's path after it (remove 3.1 if needed). For example:
PATH="C:\Program Files\Emacs23\bin;C:\Cygwin\bin;C:\Python31"
would become:
PATH="C:\Program Files\Emacs23\bin;C:\Cygwin\bin;C:\Python26" | 2 | 2 | 0 | My program has been written on python 3.1 (it was the biggest mistake I've ever made). Now I want to use a few modules that were written on 2.6.
I know that it's possible to specify the interpreter in Unix #!/usr/bin/python2.6. But what if I use Windows? Does any way to specify the interpreter exist in Windows?
Edit: I want to be able to use both interpreters simultaneously. | How to specify python interpreter on Windows | 0 | 0 | 0 | 2,736 |
3,237,252 | 2010-07-13T12:43:00.000 | 1 | 1 | 0 | 0 | php,python,gimp | 11,170,196 | 3 | false | 0 | 0 | One important thing regarding running gimp python plugin in batch mode.
Option -i means no interface. But in gimp documentation there is another option with same explanation --no-interface. User could though that they have same effect.
But when you try to run batch script on remote linux machine, with option -i you will get 'no display'. With option --no-interface, batch script will run without error. My colleague discovered that this is undocumented gimp 2.6.11 feature.
Regards, Karlo. | 2 | 3 | 0 | is there any way to connect GIMP with python or PHP and use its libraries? It seems that all i can find on the web is pygimp which is not supported anymore.
ps. i do my development on mac and i use linux as a production server | Connect GIMP with PHP or Python | 0.066568 | 0 | 0 | 3,456 |
3,237,252 | 2010-07-13T12:43:00.000 | 1 | 1 | 0 | 0 | php,python,gimp | 3,237,353 | 3 | false | 0 | 0 | Probably not directly, but I'll bet you can access some functions via 'exec()' on the command line. What are you trying to do? Can the GD or ImageMagic tools help? | 2 | 3 | 0 | is there any way to connect GIMP with python or PHP and use its libraries? It seems that all i can find on the web is pygimp which is not supported anymore.
ps. i do my development on mac and i use linux as a production server | Connect GIMP with PHP or Python | 0.066568 | 0 | 0 | 3,456 |
3,237,558 | 2010-07-13T13:23:00.000 | 4 | 0 | 0 | 1 | python,windows,linux,twisted | 3,238,241 | 5 | false | 0 | 0 | Another option is paramiko. It's a Python library that implements SSH. I've used it to remotely execute commands and transfer files to windows boxes running an SSH server. The problem is it doesn't properly capture stdout on windows due to the peculiarities of the windows command shell. You may have the same problem with a solution based on twisted.
What kind of results are you trying to capture? | 2 | 4 | 0 | I'm re-writing a legacy Windows application using Python and running on Linux. Initially, the new application needs to call the legacy application so that we have consistent results between customers still using the legacy application and customers using the new application.
So I have a Linux box, sitting right next to a Windows box and I want a process on the Linux box to execute a command on the Windows box and capture the result (synchronously).
My initial thought was to write a web service on the Windows box, but that would mean running a web server on the Windows machine in addition to the legacy application.
So then I thought that using Twisted.Conch might allow me to just execute a command over the network without the additional overhead of running a web server, but I assume there is also overhead with running an ssh server on the Windows machine.
What are some alternative ways that I can initiate a synchronous process on a different machine, using Python, besides a web service or ssh, or is a web service or ssh the best approach? Also, if a web service or ssh are the best routes to pursue, is Twisted something that I should consider using? | python execute remote program | 0.158649 | 0 | 0 | 2,814 |
3,237,558 | 2010-07-13T13:23:00.000 | 1 | 0 | 0 | 1 | python,windows,linux,twisted | 3,255,382 | 5 | false | 0 | 0 | RPC is the right answer IMO.
I think:
using SimpleXMLRPCServer for the windows machine
using xmlrpclib for the linux machine
from the standard library would give you the most freedom. You implement what you need and you don't have to worry about windows APIs, overblown technologies as DCOM, etc., you are in python land, even on the windows machine.
Sidenote:
Twisted is of course always an excellent option, so don't worry about that; I think Apples CalDav server runs on Twisted too. | 2 | 4 | 0 | I'm re-writing a legacy Windows application using Python and running on Linux. Initially, the new application needs to call the legacy application so that we have consistent results between customers still using the legacy application and customers using the new application.
So I have a Linux box, sitting right next to a Windows box and I want a process on the Linux box to execute a command on the Windows box and capture the result (synchronously).
My initial thought was to write a web service on the Windows box, but that would mean running a web server on the Windows machine in addition to the legacy application.
So then I thought that using Twisted.Conch might allow me to just execute a command over the network without the additional overhead of running a web server, but I assume there is also overhead with running an ssh server on the Windows machine.
What are some alternative ways that I can initiate a synchronous process on a different machine, using Python, besides a web service or ssh, or is a web service or ssh the best approach? Also, if a web service or ssh are the best routes to pursue, is Twisted something that I should consider using? | python execute remote program | 0.039979 | 0 | 0 | 2,814 |
3,240,990 | 2010-07-13T20:01:00.000 | 2 | 0 | 0 | 1 | python,google-app-engine,authentication | 3,241,208 | 2 | false | 1 | 0 | If you have handlers which are only accessible to admins, then app.yaml certainly seems like the easiest way to secure the pages those handlers expose.
However, if you have some handlers which serve both admin and non-admin views (e.g., your main.py), then you'll have to use something more fine-grained than app.yaml (e.g., google.appengine.api.users.is_current_user_admin()).
I'd expect performance to be roughly equivalent once your application is running (a negligible fraction of the time it takes to load your page). | 1 | 4 | 0 | I am writing a small app that uses the GAE. I have parts of my app that are for administrative use only. I have two options using login: admin option in the app.yaml or google.appengine.api.users.is_current_user_admin() in python code. The basic authentication is sufficient for my case.
Which solution is better?
The advantage of using app.yaml is that the python code is a bit cleaner. Plus it may be the case that app.yaml may be more efficient, since it can be handled in the server. (In worst case it is equal in terms of performance.) The only drawback is that I do not display a custom page, but I don't care to much for that.
I am unsure if my assertions are correct. | Authentication in Google App Engine: app.yaml vs. python code | 0.197375 | 0 | 0 | 1,616 |
3,242,114 | 2010-07-13T22:39:00.000 | 2 | 0 | 1 | 0 | python | 3,242,136 | 3 | false | 0 | 0 | Use Python's urllib module to fetch the content, and its re module to look for the word (make sure you use search instead of match; it's a common noob slip-up). | 1 | 0 | 0 | am looking for method and function watch i can search in web page !
ok I'll explain it :
i tell my python file .. go to www.example.com and search for that world "Hello guest"
and if my python file found that world "Hello guest" my python file print "the world found!"
and if he don't found he print "the world not found" | python and search? | 0.132549 | 0 | 0 | 194 |
3,242,382 | 2010-07-13T23:37:00.000 | 1 | 0 | 0 | 0 | python,numpy,scipy,interpolation | 3,242,538 | 6 | false | 0 | 0 | There's a bunch of options here, which one is best will depend on your data...
However I don't know of an out-of-the-box solution for you
You say your input data is from tripolar data. There are three main cases for how this data could be structured.
Sampled from a 3d grid in tripolar space, projected back to 2d LAT, LON data.
Sampled from a 2d grid in tripolar space, projected into 2d LAT LON data.
Unstructured data in tripolar space projected into 2d LAT LON data
The easiest of these is 2. Instead of interpolating in LAT LON space, "just" transform your point back into the source space and interpolate there.
Another option that works for 1 and 2 is to search for the cells that maps from tripolar space to cover your sample point. (You can use a BSP or grid type structure to speed up this search) Pick one of the cells, and interpolate inside it.
Finally there's a heap of unstructured interpolation options .. but they tend to be slow.
A personal favourite of mine is to use a linear interpolation of the nearest N points, finding those N points can again be done with gridding or a BSP. Another good option is to Delauney triangulate the unstructured points and interpolate on the resulting triangular mesh.
Personally if my mesh was case 1, I'd use an unstructured strategy as I'd be worried about having to handle searching through cells with overlapping projections. Choosing the "right" cell would be difficult. | 1 | 27 | 1 | So, I have three numpy arrays which store latitude, longitude, and some property value on a grid -- that is, I have LAT(y,x), LON(y,x), and, say temperature T(y,x), for some limits of x and y. The grid isn't necessarily regular -- in fact, it's tripolar.
I then want to interpolate these property (temperature) values onto a bunch of different lat/lon points (stored as lat1(t), lon1(t), for about 10,000 t...) which do not fall on the actual grid points. I've tried matplotlib.mlab.griddata, but that takes far too long (it's not really designed for what I'm doing, after all). I've also tried scipy.interpolate.interp2d, but I get a MemoryError (my grids are about 400x400).
Is there any sort of slick, preferably fast way of doing this? I can't help but think the answer is something obvious... Thanks!! | Interpolation over an irregular grid | 0.033321 | 0 | 0 | 28,537 |
3,242,448 | 2010-07-13T23:59:00.000 | 0 | 0 | 0 | 0 | c#,javascript,python,sql,database | 3,249,163 | 2 | false | 0 | 0 | Some suggestions:
1) ASP.NET Gridview
---use the free Visual Studio to create an asp.net page
...can do VB, C#, etc.
---drag/drop a gridview control on your page, then connect it to your data and display fields, all via wizard (you did say quick and dirty, correct?). No coding required if you can live within the wizard's limitations (which aren't too bad actually).
The type of database (mySQL or otherwise) isn't relevant.
Other quick and dirty approach might be Access itself -- it can create 'pages', I think, that are web publishable.
If you want to put a little more work into it, ASP.NET has some other great controls / layout capability (non-wizard derived).
Also, you could look at SSRS if you have access to it. More initial setup work, but has the option to let your users create their own reports in a semi-Access-like fashion. Web accessible.
Good luck. | 1 | 0 | 0 | I never thought I'd ever say this but I'd like to have something like the report generator in Microsoft Access. Very simple, just list data from a SQL query.
I don't really care what language is used as long as I can get it done fast.
C#,C++,Python,Javascript...
I want to know the quickest (development sense) way to display data from a database.
edit :
I'm using MySQL with web interface for data input. I would be much better if the user had some kind of GUI. | Quick and dirty reports based on a SQL query | 0 | 1 | 0 | 325 |
3,243,073 | 2010-07-14T02:49:00.000 | 1 | 0 | 0 | 0 | python,django,mysql | 23,076,238 | 10 | false | 1 | 0 | Try this if you are using
linux:- sudo apt-get install python-mysqldb
windows:- pip install python-mysqldb or
easy_install python-mysqldb
Hope this should work | 1 | 19 | 0 | Installed Django from source (python setup.py install and such), installed MySQLdb from source (python setup.py build, python setup.py install). Using Python 2.4 which came installed on the OS (CentOS 5.5). Getting the following error message after launching the server:
Error loading MySQLdb module: No module named MySQLdb
The pythonpath the debug info provides includes
'/usr/lib/python2.4/site-packages'
and yet, if I ls that directory, I can plainly see
MySQL_python-1.2.3-py2.4-linux-i686.egg
Using the python interactive shell, I can type import MySQLdb and it produces no errors. This leads me to believe it's a Django pathing issue, but I haven't the slightest clue where to start looking as I'm new to both Django and python.
EDIT: And to be a bit more specific, everything is currently running as root. I haven't setup any users yet on the machine, so none exist other than root.
EDITx2: And to be even more specific, web server is Cherokee, and deploying using uWSGI. All installed from source. | Django unable to find MySQLdb python module | 0.019997 | 1 | 0 | 38,547 |
3,243,529 | 2010-07-14T05:13:00.000 | 1 | 1 | 1 | 0 | python,programming-languages,scripting | 5,289,422 | 13 | false | 0 | 0 | I can't say that I agree with wiping Ruby off the map... Ruby fixed every problem that perl had as far as syntax goes... I loved Python first but let ruby get a little more mature and it will get in the the fray more and more... Why do I support Ruby strongly? just step away from python for a few months and then give Ruby a chance... I was a Ruby hater when I was a python guy. But I can't hardly stand to use python at this point. One day someone is gonna clean up the GC and toss in some native threads and everybody better watch out.
off the rant, Python is a full featured, not just good, Great Language... Perl... what a mess... I don't know how Perl can look at itself in the mirror standing next to any other mainstream scripting language... PHP is much prettier... At least Perl is fast, right...(CPAN never hurt it either) if Speed is the real issue there are other interpreters that juice it up a bit... Jython, jRuby, PyPy... the list goes one, screw Bash... | 10 | 9 | 0 | Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences?
I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python? | Learn a scripting language besides Python | 0.015383 | 0 | 0 | 3,435 |
3,243,529 | 2010-07-14T05:13:00.000 | 3 | 1 | 1 | 0 | python,programming-languages,scripting | 3,243,558 | 13 | false | 0 | 0 | I'll give an honest answer from my perspective.
No.
Having started scripting using batch, bash, and Perl, discovering Python was discovering precisely what I'd want from a scripting language (and more, but that's off topic). It integrates with familiar Unix interfaces, is modular, doesn't force any particular paradigm, cross platform and under active development. The same can be said of no other scripting language I know of.
The only other scripting languages I'd consider using is Lua or Scheme, for their smaller footprints and suitability for embedding, Python can be a little hefty. However they're hardly suitable for the more general purpose shell and other forms of scripting.
Update0
I just noticed mentions of Ruby and PHP in other answers, these both slipped my mind, because I'd never consider using them. Ruby is slower and not quite as popular, and PHP is more C/Perl like, with flatter interfaces, which comes with performance boons of its own. Using these alternatives to Python is a matter of taste. | 10 | 9 | 0 | Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences?
I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python? | Learn a scripting language besides Python | 0.046121 | 0 | 0 | 3,435 |
3,243,529 | 2010-07-14T05:13:00.000 | 1 | 1 | 1 | 0 | python,programming-languages,scripting | 3,243,568 | 13 | false | 0 | 0 | If you are already familiar with Python, you are unlikely to find something compelling in the same niche, although Ruby does have a very strong and vocal following that seems to like it very much. Perhaps you should consider a scripting language that fills a different role, such as BASH shell script for quick, simple scripts that don't need the complexity of Python or JavaScript which runs in the browser. | 10 | 9 | 0 | Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences?
I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python? | Learn a scripting language besides Python | 0.015383 | 0 | 0 | 3,435 |
3,243,529 | 2010-07-14T05:13:00.000 | 3 | 1 | 1 | 0 | python,programming-languages,scripting | 3,243,929 | 13 | false | 0 | 0 | To answer your first question: Do people learn one language and then ignore or dislike others?
Well, if you know one language well, you will need to see great advantages to move to another.
I started out using perl and eventually thought that there must be easier way to do some things. I picked up python and stopped using perl almost at once.
A little while later I thought I'd try ruby and learned a bit about that. The advantages over using python weren't big enough to switch, so I decided to stick with python. If I had started out using ruby, I'd probably be using that still.
If you are using python, I don't think you will easily find another scripting language that will win you over.
On the other hand, if you learn functional programming, you will probably learn a few new things, some of them will even be useful in your python programming, since a few things in python seems to be inspired by functional programming and knowing how to use them will make you a better programmer in general and a better python programmer too. | 10 | 9 | 0 | Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences?
I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python? | Learn a scripting language besides Python | 0.046121 | 0 | 0 | 3,435 |
3,243,529 | 2010-07-14T05:13:00.000 | 4 | 1 | 1 | 0 | python,programming-languages,scripting | 3,244,435 | 13 | false | 0 | 0 | The only relatively unbiased answer you can really look for is probably statistical, and you would still have to account for the natural tendency of people to follow the path of least resistance once one is found or carved.
How many people learnt Python to a decent level, found the language resonates with the way they want to work, then move to something else because the language or the ecosystem, or both, don't support their needs?
I'd say probably a single digit percentage of the educated userbase, wouldn't be surprised if it amounted to less than 5%.
Unless you have work related prospects that involve a different language, or you need to move sideways for similar reasons, I'd say you're probably best off learning something complimentary to Python rather than similar or equivalent.
C++ for low-level or computationally intensive tasks, CUDA if your field can take advantage of it (med-viz, CGI etc.), whatever flavour of shell/sysadmin oriented scripting and hacks float where you work (bash, tcl, awk or whatever else) and so on.
Personally the reason I haven't bothered past a first glance with ruby, php, or a number of other languages is simply that it's better ROI to keep working on my python skills than picking up something that offers mostly the same qualities just in different forms.
If you really want to learn something else for the sake of opening your mind up a bit, and want to stick to "scripting", then LUA was an interesting toy for me for a while, mostly for the ridiculous performance you can squeeze out of a relatively easy integration process, and because it is a rather different set of tracks compared to Python. That, and the fact WoW plugins had to be written in LUA ;) | 10 | 9 | 0 | Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences?
I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python? | Learn a scripting language besides Python | 0.061461 | 0 | 0 | 3,435 |
3,243,529 | 2010-07-14T05:13:00.000 | 3 | 1 | 1 | 0 | python,programming-languages,scripting | 5,289,622 | 13 | false | 0 | 0 | I would learn a statically typed language with very powerful type expression capabilities and awesome concurrency.
One of the following would be a good choice (in order of my preference):
Scala
F#
Haskell
Ocaml
Erlang
Typed languages like the above make you think different. Also these languages have REPLs so they can be used as a scripting language although truthfully I'm not really sure what the definition is of "scripting" language is.
Python is missing good concurrency builtin to the language so knowing how to deal with concurrency for many python programmers is a challenge.
I have found that strongly typed languages scale better for big projects for many reasons:
Because types are so important they become an invaluable way to communicate the problem
Refactoring in these languages is much much easier.
Automatic Serialization is sometimes easier too (although for Haskell thats less true).
A lot less time spent on writing assertions on type checking.
Browsing the code is easier because most IDEs will allow you click on and go to different types | 10 | 9 | 0 | Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences?
I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python? | Learn a scripting language besides Python | 0.046121 | 0 | 0 | 3,435 |
3,243,529 | 2010-07-14T05:13:00.000 | 1 | 1 | 1 | 0 | python,programming-languages,scripting | 3,243,557 | 13 | false | 0 | 0 | Ruby/Groovy/Perl if you'd like to stick to traditional scripting practices.
Otherwise I'd heartily recommend you Clojure and Scala - two of the more innovative programing languages of the past few years. | 10 | 9 | 0 | Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences?
I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python? | Learn a scripting language besides Python | 0.015383 | 0 | 0 | 3,435 |
3,243,529 | 2010-07-14T05:13:00.000 | 6 | 1 | 1 | 0 | python,programming-languages,scripting | 3,243,565 | 13 | false | 0 | 0 | Ruby - what it enables and does with blocks is really interesting, and quite foreign to python based programming
Erlang - the functional language has a lot of interesting examples and it will definitely make your head work differently afterwards (in a good way)
Javascript - yes, I'm serious. ALthough there's a fair number of grips to be had with this prototype language, it does some really interesting things with that prototyping and just slightly differently than Ruby and/or Python. And a ton of folks are pouring big money into making Javascript a outstandingly fast scripting language. | 10 | 9 | 0 | Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences?
I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python? | Learn a scripting language besides Python | 1 | 0 | 0 | 3,435 |
3,243,529 | 2010-07-14T05:13:00.000 | 6 | 1 | 1 | 0 | python,programming-languages,scripting | 3,243,541 | 13 | false | 0 | 0 | I would recommend learning Haskell and a dialect of Lisp such as Scheme or Common Lisp, if you master either of those you'll gain insight into how things are accomplished with the functional paradigm and it'll help out your Python as well.
Here are some languages categorized by paradigms I'd learn:
Imperative/Procedural languages:
C
Functional paradigm languages:
Haskell
Common Lisp/Scheme
Similar object oriented languages:
Ruby
ECMAScript
Other:
Perl
I would advise you to stay away from PHP unless you really need the work. You would probably want to run back to Python. | 10 | 9 | 0 | Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences?
I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python? | Learn a scripting language besides Python | 1 | 0 | 0 | 3,435 |
3,243,529 | 2010-07-14T05:13:00.000 | 3 | 1 | 1 | 0 | python,programming-languages,scripting | 3,540,040 | 13 | false | 0 | 0 | Learn a Lisp. Whether it's "scripting" or not, Eric Raymond had the right of it when he wrote:
"Lisp is worth learning for the
profound enlightenment experience you
will have when you finally get it;
that experience will make you a better
programmer for the rest of your days,
even if you never actually use Lisp
itself a lot."
The programming paradigm needed to be highly effective in Lisp is sufficiently unlike what you use with Python day-to-day that the perspective it gives is very, very much worth it.
And within Lisps, my choice? Clojure; like other Lisps, its macro system gives you capabilities comparable (actually superior) to the excellent metaprogramming in Python, but Clojure in particular has a focus on batteries-included practicality (and an intelligent, opinionated design) which will be familiar to anyone fond of GvR's instincts. Moreover, Clojure's strengths are extremely disjoint from Python's -- in particular, it shines at highly-multithreaded, CPU-bound concurrent programming, which is one of Python's weaknesses -- so having both in your toolbox increases the chance you'll have the right tool when a tricky job comes along.
(Is it scripting? In my view, that's pretty academic these days; if you have a REPL where you can type code and get an immediate response, modify the state of a running program, or experiment with an API, I see a language as "scripting" enough). | 10 | 9 | 0 | Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences?
I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python? | Learn a scripting language besides Python | 0.046121 | 0 | 0 | 3,435 |
3,244,335 | 2010-07-14T08:05:00.000 | 0 | 0 | 0 | 0 | python,parsing | 3,244,345 | 4 | false | 1 | 0 | Well, if you're not duty-bound to python, you could always use a TagSoup parser. It's a Java library, but it gives very good results. You could also just use Tidy to clean your input before trying to parse it. | 1 | 3 | 0 | I have been using BeautifulSoup but as I understand it that library is no longer being maintained. So what should I use ? I have heard about Xpath but what else is there ? | No more BeautifulSoup | 0 | 0 | 1 | 653 |
3,244,570 | 2010-07-14T08:45:00.000 | 6 | 0 | 0 | 0 | python,django,coding-style,constants | 3,244,614 | 4 | false | 1 | 0 | There's already a project-wide settings.py file. This is the perfect place to put your own custom setttings. | 2 | 5 | 0 | It is sometimes beneficial to share certain constants between various code files in a django application.
Examples:
- Name or location of dump file used in various modules\commands etc
- Debug mode on\off for the entire app
- Site specific configuration
What would be the elegant\pythonic way of doing this? | Django - How to share configuration constants within an app? | 1 | 0 | 0 | 1,651 |
3,244,570 | 2010-07-14T08:45:00.000 | 0 | 0 | 0 | 0 | python,django,coding-style,constants | 3,245,074 | 4 | false | 1 | 0 | Django apps are meant to be (more or less) pluggable. Therefore, you are not supposed to hack into the code of an app in order to parametrize what you want (it would be quite a mess if you had to do this ! Imagine you want to upgrade an app you downloaded on internet... you would have to re-hack into the code of the new version ?!?).
For this reason you shouldn't add app-level settings at the app level, but rather put them together somewhere in your project-wide settings.py. | 2 | 5 | 0 | It is sometimes beneficial to share certain constants between various code files in a django application.
Examples:
- Name or location of dump file used in various modules\commands etc
- Debug mode on\off for the entire app
- Site specific configuration
What would be the elegant\pythonic way of doing this? | Django - How to share configuration constants within an app? | 0 | 0 | 0 | 1,651 |
3,246,262 | 2010-07-14T12:52:00.000 | 0 | 0 | 1 | 0 | python,string,mapping,letters | 3,246,297 | 10 | false | 0 | 0 | Why not just make a list of each letter in the alphabet and then use the index values as the return value | 1 | 6 | 0 | I want to assign a value to each letter in the alphabet, so that a -> 1, b -> 2, c -> 3, ... z -> 26. Something like a function which returns the value of the letter, for example:
value('a') = 1
value('b') = 2
etc...
How would I go about doing this in python? | python: How do I assign values to letters? | 0 | 0 | 0 | 56,654 |
3,246,506 | 2010-07-14T13:22:00.000 | 0 | 1 | 0 | 0 | python | 3,246,550 | 1 | false | 1 | 0 | I don't understand exactly what you mean or why you want to test Java in Python but Jython may be helpful. | 1 | 0 | 0 | is there any frame-work or tool to test java-applets in python | java-applet gui testing with python | 0 | 0 | 0 | 312 |
3,247,202 | 2010-07-14T14:35:00.000 | 1 | 0 | 1 | 0 | python,file | 3,247,393 | 5 | false | 0 | 0 | I'm not sure this is even possible. Even at the VFS or filesystem level, there is no guarantee that a directory entry count is even maintained. For instance many filesystems simply record the combined byte size of the directory entry structures contained in a given directory.
Estimation may be made if directory entries are fixed size structures, but this is uncommon now (consider LFN for FAT32). Even if a given filesystem did provide an entry count without needing to iterate through a directory, or if the VFS cached a record of a directories length, these would definitely be operating system, filesystem, and kernel specific. | 1 | 12 | 0 | I have a directory with a large number of files (~1mil). I need to choose a random file from this directory. Since there are so many files, os.listdir naturally takes an eternity to finish.
Is there a way I can circumvent this problem? Maybe somehow get to know the number of files in the directory (without listing it) and choose the 'n'th file where n is randomly generated?
The files in the directory are randomly named. | Choosing a random file from a directory (with a large number of files) in Python | 0.039979 | 0 | 0 | 1,774 |
3,247,516 | 2010-07-14T15:06:00.000 | 1 | 0 | 0 | 0 | python,xml,configuration,xsd,upgrade | 3,247,629 | 1 | true | 1 | 0 | For all configuration settings that remain the same between configurations, have your installation script copy those over from the old config file if it exists. For the rest, just have some defaults that the user can change if necessary, as usual for a config file. Unless I've misunderstood the question, it sounds like you're making a bigger deal out of this than it needs to be.
By the way, you'd really only need one "updater" script, because you could parametrize the XML tagging such that it go through your new config file/config layout file, and then just check the tags in the old file against that and copy the data from the ones that are present in the new file. I haven't worked with XSD files before, so I don't know the specifics of working with them, but I don't think it should be that difficult. | 1 | 0 | 0 | My application has a xml based configuration. It has also a xsd file. Before my application starts, xmllint will check the configuration against the xsd file.
With the growth of my application, the configuration structure has changed a bit. Now I have to face this problem: When I provide a new version of my application to customer, I have to upgrade the existing configuration.
How to make this done easy and clever?
My idea is to build a configuration object using python, and then read configuration v1 from file and save it as v2. But if later the structure is changed again, I have to build another configuration object model. | Approach to upgrade application configuration | 1.2 | 0 | 1 | 102 |
3,247,971 | 2010-07-14T15:48:00.000 | 1 | 0 | 0 | 0 | python,google-app-engine | 3,281,505 | 1 | false | 1 | 0 | This isn't possible in the standard db framework, as there's not enough information present to find your models. The only information the framework has to work with is the kind name, which doesn't include the fully qualified package - so it has no way to figure out what package your model definition might be in.
If you're writing an admin interface, though, you probably want to use the low-level google.appengine.api.datastore interface, instead, which operates on dicts instead of model classes, and doesn't require a model definition. | 1 | 1 | 0 | I have a models in different files (blog/models.py, forum/models.py, article/models.py). In each of this files I have defined model classes with application prefix (BlobPost, BlogTag, ForumPost, ForumThread, Article, ArticleCategory).
Also I have appliation - comment, for adding comment attached to any model object. For example, I want to comment BlogPost, or add comment referenced to ForumPost. For this I use property with type ReferenceProperty() - without specify type of references. Any model can attached to comment.
What a problem? If I have show all comments in administration section, I see a problem with autoloading models for ReferenceProperty. I don't know, what type of model used for current comment. I need to autoload package with model, if this need.
Yes, exists simple solution - include all models from all applications. But, this is not good solution. I need load only need models. How to do this autoloading?
My idea is based on detect kind of property, and by first part of this name detect application name for load all models in this application. For example, I have comment with Reference to BlogPost model. I get name of application - Blog and load all models from blog.models import *
For implement my idea I need to understand - how to intercept creating property instances. In my case, if I loop over comments, I see that App Engine automatically (thanks, but not in my case) create instances for properties.
How to inject my logic for loading my models before creating property instance?
Thank you! | How to preload model for ReferenceProperty? | 0.197375 | 0 | 0 | 213 |
3,247,973 | 2010-07-14T15:48:00.000 | 0 | 0 | 1 | 0 | python,overflow,range | 3,248,032 | 2 | false | 0 | 0 | The size of your lists is only limited by your memory. Note that, depending on your version of Python, range(1, 9999999999999999) needs only a few bytes of RAM since it always only creates a single element of the virtual list it returns.
If you want to instantiate the list, use list(range(1,n)) (this will copy the virtual list). | 1 | 5 | 0 | I'm quite new to python, so I'm doing my usual of going through Project Euler to work out the logical kinks in my head.
Basically, I need the largest list size possible, ie range(1,n), without overflowing.
Any ideas? | Python: Range() maximum size; dynamic or static? | 0 | 0 | 0 | 16,736 |
3,249,977 | 2010-07-14T20:01:00.000 | 1 | 0 | 0 | 0 | php,python,django,orm,doctrine | 8,543,708 | 4 | false | 1 | 0 | Ive used Doctrine over a 2 year project that ended 1.5 years ago, since then i've been doing mostly Django.
I prefer Djangos ORM over Doctrine any day, more features, more consistency, faster and shinier. | 3 | 3 | 0 | I am a PHP guy. In PHP I mainly use Doctrine ORM to deal with database issues. I am considering move to Python + Django recently. I know Python but don't have experience with Django. Can anyone who has good knowledge of both Doctrine and ORM in Django give me a comparison of features of these two ORM implementations? | ORM in Django vs. PHP Doctrine | 0.049958 | 1 | 0 | 5,103 |
3,249,977 | 2010-07-14T20:01:00.000 | 5 | 0 | 0 | 0 | php,python,django,orm,doctrine | 12,267,439 | 4 | false | 1 | 0 | I am a rare person who had to switch from Django 1.4 to Symfony 2.1 so I had to use Doctrine 2 instead of current Django ORM.
Maybe Doctrine can do many things but let me tell you that it is a nightmare for me to use it coming from Django.
I'm bored with the verbosity of php/Symfony/Doctrine ...
Also I never needed something that Django's ORM didn't manage already (maybe projects not big enough to reach the limits).
Simply compare the description of data between both orms (including setters & getters)... | 3 | 3 | 0 | I am a PHP guy. In PHP I mainly use Doctrine ORM to deal with database issues. I am considering move to Python + Django recently. I know Python but don't have experience with Django. Can anyone who has good knowledge of both Doctrine and ORM in Django give me a comparison of features of these two ORM implementations? | ORM in Django vs. PHP Doctrine | 0.244919 | 1 | 0 | 5,103 |
3,249,977 | 2010-07-14T20:01:00.000 | -1 | 0 | 0 | 0 | php,python,django,orm,doctrine | 3,250,203 | 4 | false | 1 | 0 | Django isn't just an orm. It is a web framework like symfony. The form framework in symfony is modeled on django for example. It's orm part is more like doctrine 2 I think, but I haven't played with either much. | 3 | 3 | 0 | I am a PHP guy. In PHP I mainly use Doctrine ORM to deal with database issues. I am considering move to Python + Django recently. I know Python but don't have experience with Django. Can anyone who has good knowledge of both Doctrine and ORM in Django give me a comparison of features of these two ORM implementations? | ORM in Django vs. PHP Doctrine | -0.049958 | 1 | 0 | 5,103 |
3,252,568 | 2010-07-15T04:56:00.000 | 6 | 1 | 1 | 0 | python,ruby,performance,programming-languages | 3,252,589 | 6 | false | 0 | 0 | Because Ruby 1.8 was not really designed with performance in mind, while Python was more optimized. In particular, Ruby 1.8 did real interpretation rather than compiling for a virtual machine like most languages these days. Ruby 1.9 (with the YARV VM) is about as fast as Python 3 (maybe a little bit slower, but much closer), and other implementations are even faster. | 3 | 13 | 0 | They seem to share a lot of the same characteristics but as far as I can tell, Python 2.5 is faster than 1.8.7 by a lot.
Is there a deeper underlying reason behind this? | Why is Python faster than Ruby? | 1 | 0 | 0 | 9,141 |
3,252,568 | 2010-07-15T04:56:00.000 | 0 | 1 | 1 | 0 | python,ruby,performance,programming-languages | 3,253,302 | 6 | false | 0 | 0 | More people have been working on Python development for more years, so more optimization has been done. The languages are similarly flexible and expressive, so their performance should converge as all the good optimization ideas get used in both. As noted above, Ruby 1.9 substantially narrows the performance gap with Python. | 3 | 13 | 0 | They seem to share a lot of the same characteristics but as far as I can tell, Python 2.5 is faster than 1.8.7 by a lot.
Is there a deeper underlying reason behind this? | Why is Python faster than Ruby? | 0 | 0 | 0 | 9,141 |
3,252,568 | 2010-07-15T04:56:00.000 | 0 | 1 | 1 | 0 | python,ruby,performance,programming-languages | 67,204,842 | 6 | false | 0 | 0 | It depends on the implementation. Crystal is basically C compiled Ruby that can even call C libraries. Then you also have Elixir on the Beam side and let's not forget the Java and C# counterparts. But yes, Ruby, the defacto standard, is indeed slower than Python and is also aimed at web development. | 3 | 13 | 0 | They seem to share a lot of the same characteristics but as far as I can tell, Python 2.5 is faster than 1.8.7 by a lot.
Is there a deeper underlying reason behind this? | Why is Python faster than Ruby? | 0 | 0 | 0 | 9,141 |
3,252,671 | 2010-07-15T05:20:00.000 | 1 | 0 | 0 | 0 | python,wxpython,alignment,spinner | 3,261,410 | 1 | true | 0 | 1 | Actually, there is a control you can use. It's called FloatSpin, which is in the agw sub-library. If you don't already have it, download the wxPython demo and check it out!
Mike | 1 | 0 | 0 | A primary reason to use wx.SpinCtrl is to restrict the user to input integers, therefore I think that the text inside it would look better if right-aligned.
Is there a way to do this in wxPython? | wxPython: Right-align the numbers in a wx.SpinCtrl | 1.2 | 0 | 0 | 435 |
3,252,725 | 2010-07-15T05:34:00.000 | 0 | 0 | 1 | 0 | python | 3,252,763 | 4 | false | 0 | 0 | The code you listed above is a list of tuples - which pretty much matches what you're asking for.
From the example above, list[0][0] returns the state from the first tuple, list[0][1] the action, and list[0][2] the cost.
You can extract the values with something like (state, action, cost)= list[i] too. | 1 | 2 | 0 | I need to put 3 items in the list.
state..eg(1,2)
action...eg..west
cost....5
list=[(state,action,cost), (state,action,cost).........]
how can i make it in a form of list. For a particular state , action and cost is there. Moreover, if i need only state from the list, i should be able to extract it from the list.same thing goes for action too. | List formation in python | 0 | 0 | 0 | 390 |
3,253,430 | 2010-07-15T07:40:00.000 | 8 | 0 | 1 | 0 | python,python-3.x | 3,253,444 | 5 | false | 0 | 0 | Because 3.x isn't backwards compatible with 2.x and a lot of apps and libraries are written for the 2.x series. 3.x was their attempt at cleaning up all the crud that never should have been in Python in the first place.... and they had to make some breaking changes. Probably best to stick with 2.x for now, til 3.x gains a bit more popularity. | 3 | 7 | 0 | Since there is a python 3.x, why don't we use it?
Why do we still use 2.x?What's the difference? | python 2.x or 3.x | 1 | 0 | 0 | 3,076 |
3,253,430 | 2010-07-15T07:40:00.000 | 2 | 0 | 1 | 0 | python,python-3.x | 3,253,452 | 5 | false | 0 | 0 | Because lots of libraries are not yet ported to 3.x I guess... And because lots of application still run on 2.x | 3 | 7 | 0 | Since there is a python 3.x, why don't we use it?
Why do we still use 2.x?What's the difference? | python 2.x or 3.x | 0.07983 | 0 | 0 | 3,076 |
3,253,430 | 2010-07-15T07:40:00.000 | 14 | 0 | 1 | 0 | python,python-3.x | 3,253,511 | 5 | true | 0 | 0 | Python 2.6 and 2.7 have been written to ease the transition to Python 3.
It will take some more time to port the more complex packages (i.e. those with many dependencies, or libraries written in C).
So if you are starting new projects, and all the libraries you need are there, it makes sense to start with 3.1. One of the more welcome changes is the handling of Unicode strings by default - it will prevent a lot of bugs.
But if you were to port a complete ERP application, or anything big, from 2.6 to 3.x, it could be a bloodbath right now. The unicode changes for instance are the hardest to apply from 2.x -> 3.x, and the low level C APIs have changed a lot as well. | 3 | 7 | 0 | Since there is a python 3.x, why don't we use it?
Why do we still use 2.x?What's the difference? | python 2.x or 3.x | 1.2 | 0 | 0 | 3,076 |
3,255,330 | 2010-07-15T12:02:00.000 | 0 | 0 | 0 | 0 | java,php,python,mysql,delphi | 3,255,344 | 3 | false | 0 | 0 | Why not use the XMPP protocol (aka Jabbber) ? | 2 | 4 | 0 | We need to be able to inform a Delphi application in case there are changes to some of our tables in MySQL.
Delphi clients are in the Internet behind a firewall, and they have to be authenticated before connecting to the notification server we need to implement. The server can be programmed using for example Java, PHP or Python, and it has to support thousands of clients.
Typically one change in the database needs to be informed only to a single client, and I don't believe performance will be a bottleneck. It just has to be possible to inform any of those thousands of clients when a change affecting the specific client occurs.
I have been thinking of a solution where:
MySQL trigger would inform to notification server
Delphi client connects to a messaging queue and gets the notification using it
My questions:
What would be the best to way from the trigger to inform the external server of the change
Which message queue solution to pick? | How to create a notification server which informs Delphi application when database changes? | 0 | 1 | 0 | 1,596 |
3,255,330 | 2010-07-15T12:02:00.000 | 1 | 0 | 0 | 0 | java,php,python,mysql,delphi | 3,255,395 | 3 | false | 0 | 0 | There is apache camel and spring intergration, both provides some ways to send messages across. | 2 | 4 | 0 | We need to be able to inform a Delphi application in case there are changes to some of our tables in MySQL.
Delphi clients are in the Internet behind a firewall, and they have to be authenticated before connecting to the notification server we need to implement. The server can be programmed using for example Java, PHP or Python, and it has to support thousands of clients.
Typically one change in the database needs to be informed only to a single client, and I don't believe performance will be a bottleneck. It just has to be possible to inform any of those thousands of clients when a change affecting the specific client occurs.
I have been thinking of a solution where:
MySQL trigger would inform to notification server
Delphi client connects to a messaging queue and gets the notification using it
My questions:
What would be the best to way from the trigger to inform the external server of the change
Which message queue solution to pick? | How to create a notification server which informs Delphi application when database changes? | 0.066568 | 1 | 0 | 1,596 |
3,255,925 | 2010-07-15T13:28:00.000 | 0 | 1 | 1 | 0 | python,paradigms | 3,255,961 | 5 | false | 0 | 0 | Haskell or Ocaml, or maybe a Lisp dialect such as Common Lisp or Scheme. | 2 | 2 | 0 | Ok so I know the basics of programming languages, I've studied python and liked it a lot. I'm studying now the intermediate parts of python and I'm catching the concepts already. I'm working with a project and at the same time solving computer problems that practices algorithm use. I've learned that python has limitations and wants to compensate that limitations by learning another programming language.
What programming language do you suggest that synergizes well with python? I want something who can give me their actual experience while working with python and the language that complements well with it. Answers like "try iron python or jython blah blah blah" won't help, if you can give me it's pros and cons, it's maturity it's problems then that's good enough for me... Thanks a lot
EDIT -
Sorry guys, I think I need to add some details in this. I'll be using python mainly for web programming or game development. So if you think this language A would help me in python for web programming then that's it. | What other Language synergizes well with Python? Need Advice | 0 | 0 | 0 | 874 |
3,255,925 | 2010-07-15T13:28:00.000 | 1 | 1 | 1 | 0 | python,paradigms | 3,255,977 | 5 | false | 0 | 0 | What is wrong with IronPython or Jython? You can learn how to write libraries in Java or .Net to alleviate some of Python's speed problems. Learning to write your own Python libraries will certainly help you better understand and overcome the limitations you mentioned. | 2 | 2 | 0 | Ok so I know the basics of programming languages, I've studied python and liked it a lot. I'm studying now the intermediate parts of python and I'm catching the concepts already. I'm working with a project and at the same time solving computer problems that practices algorithm use. I've learned that python has limitations and wants to compensate that limitations by learning another programming language.
What programming language do you suggest that synergizes well with python? I want something who can give me their actual experience while working with python and the language that complements well with it. Answers like "try iron python or jython blah blah blah" won't help, if you can give me it's pros and cons, it's maturity it's problems then that's good enough for me... Thanks a lot
EDIT -
Sorry guys, I think I need to add some details in this. I'll be using python mainly for web programming or game development. So if you think this language A would help me in python for web programming then that's it. | What other Language synergizes well with Python? Need Advice | 0.039979 | 0 | 0 | 874 |
3,256,731 | 2010-07-15T14:48:00.000 | 2 | 0 | 0 | 0 | python,django | 3,256,766 | 1 | true | 1 | 0 | You would do this by setting up different WSGI for each domain using a setting SITE_ID corresponding to the site id from the django.contrib.site app. | 1 | 0 | 0 | I have one ip for two domain name, e.g. "www.example.com" and "example.info", and I want each of them to be handled as a different domain (e.g. www.example.com/photos and example.info/photos will be ahndled each by its corresponding function). Is there an elegant way to do this in django? | How do I redirect different domain names requests to the same ip in django | 1.2 | 0 | 0 | 133 |
3,257,869 | 2010-07-15T16:45:00.000 | 27 | 0 | 1 | 1 | python,windows,file,file-io | 3,262,082 | 4 | false | 0 | 0 | Well this is for historical (or as i like to say it, hysterical) reasons. The file open modes are inherited from C stdio library and hence we follow it.
For Windows, there is no difference between text and binary files, just like in any of the Unix clones. No, i mean it! - there are (were) file systems/OSes in which text file is completely different beast from object file and so on. In some you had to specify the maximum length of lines in advance and fixed size records were used... fossils from the times of 80-column paper punch-cards and such. Luckily, not so in Unices, Windows and Mac.
However - all other things equal - Unix, Windows and Mac hystorically differ in what characters they use in output stream to mark end of one line (or, same thing, as separator between lines). In Unix, \x0A (\n) is used. In Windows, sequence of two characters \x0D\x0A (\r\n) is used; on Mac - just \xOD (\r). Here are some clues on the origin of use of those two symbols - ASCII code 10 is called Line Feed (LF) and when sent to teletype, would cause it to move down one line (Y++), without changing its horizontal (X) position. Carriage Return (CR) - ASCII 13 - on the other hand, would cause the printing carriage to return to the beginning of the line (X=0) without scrolling one line down. So when sending output to the printer, both \r and \n had to be send, so that the carriage will move to the beginning of a new line. Now when typing on terminal keyboard, operators naturally are expected to press one key and not two for end of line. That on Apple][ was the key 'Return' (\r).
At any rate, this is how things settled. C's creators were concerned about portability - much of Unix was written in C, unlike before, when OSes were written in assembler. So they did not want to deal with each platform quirks about text representation, so they added this evil hack to their I/O library depending on the platform, the input and output to that file will be "patched" on the fly so that the program will see the new lines the righteous, Unix-way - as '\n' - no matter if it was '\r\n' from Windows or '\r' from Mac. So the developer need not worry on what OS the program ran, it could still read and write text files in native format.
There was a problem, however - not all files are text, there are other formats and in they are very sensitive to replacing one character with another. So they though, we will call those "binary files" and indicate that to fopen() by including 'b' in the mode - and this will flag the library not to do any behind-the-scenes conversion. And that's how it came to be the way it is :)
So to recap, if file is open with 'b' in binary mode, no conversions will take place. If it was open in text mode, depending on the platform, some conversions of the new line character(s) may occur - towards Unix point of view. Naturally, on Unix platform there is no difference between reading/writing to "text" or "binary" file. | 4 | 23 | 0 | I know that I should open a binary file using "rb" instead of "r" because Windows behaves differently for binary and non-binary files.
But I don't understand what exactly happens if I open a file the wrong way and why this distinction is even necessary. Other operating systems seem to do fine by treating both kinds of files the same. | Difference between binary and text I/O in python on Windows | 1 | 0 | 0 | 7,560 |
3,257,869 | 2010-07-15T16:45:00.000 | -2 | 0 | 1 | 1 | python,windows,file,file-io | 3,257,905 | 4 | false | 0 | 0 | For reading files there should be no difference. When writing to text-files Windows will automatically mess up your line-breaks (it will add \r's before the \n's). That's why you should use "wb". | 4 | 23 | 0 | I know that I should open a binary file using "rb" instead of "r" because Windows behaves differently for binary and non-binary files.
But I don't understand what exactly happens if I open a file the wrong way and why this distinction is even necessary. Other operating systems seem to do fine by treating both kinds of files the same. | Difference between binary and text I/O in python on Windows | -0.099668 | 0 | 0 | 7,560 |
3,257,869 | 2010-07-15T16:45:00.000 | 25 | 0 | 1 | 1 | python,windows,file,file-io | 3,257,886 | 4 | true | 0 | 0 | This mode is about conversion of line endings.
When reading in text mode, the platform's native line endings (\r\n on Windows) are converted to Python's Unix-style \n line endings. When writing in text mode, the reverse happens.
In binary mode, no such conversion is done.
Other platforms usually do fine without the conversion, because they store line endings natively as \n. (An exception is Mac OS, which used to use \r in the old days.) Code relying on this, however, is not portable. | 4 | 23 | 0 | I know that I should open a binary file using "rb" instead of "r" because Windows behaves differently for binary and non-binary files.
But I don't understand what exactly happens if I open a file the wrong way and why this distinction is even necessary. Other operating systems seem to do fine by treating both kinds of files the same. | Difference between binary and text I/O in python on Windows | 1.2 | 0 | 0 | 7,560 |
3,257,869 | 2010-07-15T16:45:00.000 | 1 | 0 | 1 | 1 | python,windows,file,file-io | 3,257,903 | 4 | false | 0 | 0 | In Windows, text mode will convert the newline \n to a carriage return followed by a newline \r\n.
If you read text in binary mode, there are no problems. If you read binary data in text mode, it will likely be corrupted. | 4 | 23 | 0 | I know that I should open a binary file using "rb" instead of "r" because Windows behaves differently for binary and non-binary files.
But I don't understand what exactly happens if I open a file the wrong way and why this distinction is even necessary. Other operating systems seem to do fine by treating both kinds of files the same. | Difference between binary and text I/O in python on Windows | 0.049958 | 0 | 0 | 7,560 |
3,259,322 | 2010-07-15T19:41:00.000 | 9 | 1 | 1 | 0 | python,lambda | 3,259,428 | 16 | false | 0 | 0 | Yes, you're right — it is a structural choice. It probably does not make your programs more correct by just using lambda expressions. Nor does it make them more reliable, and this has nothing to do with speed.
It is only about flexibility and the power of expression. Like list comprehension. You can do most of that defining named functions (possibly polluting namespace, but that's again purely stylistic issue).
It can aid to readability by the fact, that you do not have to define a separate named function, that someone else will have to find, read and understand that all it does is to call a method blah() on its argument.
It may be much more interesting when you use it to write functions that create and return other functions, where what exactly those functions do, depends on their arguments. This may be a very concise and readable way of parameterizing your code behaviour. You can just express more interesting ideas.
But that is still a structural choice. You can do that otherwise. But the same goes for object oriented programming ;) | 5 | 86 | 0 | I can find lots of stuff showing me what a lambda function is, and how the syntax works and what not. But other than the "coolness factor" (I can make a function in middle a call to another function, neat!) I haven't seen something that's overwelmingly compelling to say why I really need/want to use them.
It seems to be more of a stylistic or structual choice in most examples I've seen. And kinda breaks the "Only one correct way to do something" in python rule. How does it make my programs, more correct, more reliable, faster, or easier to understand? (Most coding standards I've seen tend to tell you to avoid overly complex statements on a single line. If it makes it easier to read break it up.) | Why use lambda functions? | 1 | 0 | 0 | 54,149 |
3,259,322 | 2010-07-15T19:41:00.000 | 14 | 1 | 1 | 0 | python,lambda | 3,259,370 | 16 | false | 0 | 0 | For me it's a matter of the expressiveness of the code. When writing code that people will have to support, that code should tell a story in as concise and easy to understand manner as possible. Sometimes the lambda expression is more complicated, other times it more directly tells what that line or block of code is doing. Use judgment when writing.
Think of it like structuring a sentence. What are the important parts (nouns and verbs vs. objects and methods, etc.) and how should they be ordered for that line or block of code to convey what it's doing intuitively. | 5 | 86 | 0 | I can find lots of stuff showing me what a lambda function is, and how the syntax works and what not. But other than the "coolness factor" (I can make a function in middle a call to another function, neat!) I haven't seen something that's overwelmingly compelling to say why I really need/want to use them.
It seems to be more of a stylistic or structual choice in most examples I've seen. And kinda breaks the "Only one correct way to do something" in python rule. How does it make my programs, more correct, more reliable, faster, or easier to understand? (Most coding standards I've seen tend to tell you to avoid overly complex statements on a single line. If it makes it easier to read break it up.) | Why use lambda functions? | 1 | 0 | 0 | 54,149 |
3,259,322 | 2010-07-15T19:41:00.000 | 6 | 1 | 1 | 0 | python,lambda | 3,734,989 | 16 | false | 0 | 0 | Lambda, while useful in certain situations, has a large potential for abuse. lambda's almost always make code more difficult to read. And while it might feel satisfying to fit all your code onto a single line, it will suck for the next person who has to read your code.
Direct from PEP8
"One of Guido's key insights is that code is read much more often than it is written." | 5 | 86 | 0 | I can find lots of stuff showing me what a lambda function is, and how the syntax works and what not. But other than the "coolness factor" (I can make a function in middle a call to another function, neat!) I haven't seen something that's overwelmingly compelling to say why I really need/want to use them.
It seems to be more of a stylistic or structual choice in most examples I've seen. And kinda breaks the "Only one correct way to do something" in python rule. How does it make my programs, more correct, more reliable, faster, or easier to understand? (Most coding standards I've seen tend to tell you to avoid overly complex statements on a single line. If it makes it easier to read break it up.) | Why use lambda functions? | 1 | 0 | 0 | 54,149 |
3,259,322 | 2010-07-15T19:41:00.000 | 3 | 1 | 1 | 0 | python,lambda | 48,674,765 | 16 | false | 0 | 0 | Lambdas are anonymous functions (function with no name) that can be assigned to a variable or that can be passed as an argument to another function. The usefulness of lambda will be realized when you need a small piece of function that will be run one in a while or just once. Instead of writing the function in global scope or including it as part of your main program you can toss around few lines of code when needed to a variable or another function. Also when you pass the function as an argument to another function during the function call you can change the argument (the anonymous function) making the function itself dynamic. Suppose if the anonymous function uses variables outside its scope it is called closure. This is useful in callback functions. | 5 | 86 | 0 | I can find lots of stuff showing me what a lambda function is, and how the syntax works and what not. But other than the "coolness factor" (I can make a function in middle a call to another function, neat!) I haven't seen something that's overwelmingly compelling to say why I really need/want to use them.
It seems to be more of a stylistic or structual choice in most examples I've seen. And kinda breaks the "Only one correct way to do something" in python rule. How does it make my programs, more correct, more reliable, faster, or easier to understand? (Most coding standards I've seen tend to tell you to avoid overly complex statements on a single line. If it makes it easier to read break it up.) | Why use lambda functions? | 0.037482 | 0 | 0 | 54,149 |
3,259,322 | 2010-07-15T19:41:00.000 | -1 | 1 | 1 | 0 | python,lambda | 3,259,570 | 16 | false | 0 | 0 | Lambdas allow you to create functions on the fly. Most of the examples I've seen don't do much more than create a function with parameters passed at the time of creation rather than execution. Or they simplify the code by not requiring a formal declaration of the function ahead of use.
A more interesting use would be to dynamically construct a python function to evaluate a mathematical expression that isn't known until run time (user input). Once created, that function can be called repeatedly with different arguments to evaluate the expression (say you wanted to plot it). That may even be a poor example given eval(). This type of use is where the "real" power is - in dynamically creating more complex code, rather than the simple examples you often see which are not much more than nice (source) code size reductions. | 5 | 86 | 0 | I can find lots of stuff showing me what a lambda function is, and how the syntax works and what not. But other than the "coolness factor" (I can make a function in middle a call to another function, neat!) I haven't seen something that's overwelmingly compelling to say why I really need/want to use them.
It seems to be more of a stylistic or structual choice in most examples I've seen. And kinda breaks the "Only one correct way to do something" in python rule. How does it make my programs, more correct, more reliable, faster, or easier to understand? (Most coding standards I've seen tend to tell you to avoid overly complex statements on a single line. If it makes it easier to read break it up.) | Why use lambda functions? | -0.012499 | 0 | 0 | 54,149 |
3,261,030 | 2010-07-16T00:13:00.000 | 0 | 0 | 0 | 0 | python,interface,mapping | 3,261,668 | 2 | true | 1 | 0 | From a strictly philosophical point of view, I don't think that there is a line you can cross with this. If some tool provides the needed functionality, but its API is different, adapt away. The only time you shouldn't do this is if the adapted to API simply is not expressive enough to manipulate the adapted component in a way that is needed.
I wouldn't hesitate to adapt a database into a dict, because that's a great way to manipulate collections, and it's already compatible with a heck of a lot of other code. If I find that my particular application must make calls to the database connections begin(), commit(), and rollback() methods to work right, then a dict won't do, since dict's don't have transaction semantics. | 1 | 2 | 0 | I find that I have recently been implementing Mapping interfaces on classes which on the surface fit the model (they are essentially just key-value stores with no more meta-data), but underneath they are sometimes quite complex.
Here are a couple examples of increasing severity:
An object which wraps another mapping converting all objects to strings when set.
An object which uses a local database as a back-end to store the key-value pairs.
An object which makes HTTP requests to remote servers to get/set data.
Lets suppose all of these examples seamlessly implement the Mapping interface, and the only indication that there is something fishy going on is that item access potentially could take a few seconds, and an item may not be retrievable in the same form as stored (if at all). I'm perfectly content with something like the first example, pretty okay with the second, but I'm getting kinda uncomfortable with the last.
The question is, is there a line at which the API for these models should not use item access, even though the underlying structure may feel like it fits on the surface? | Are there reasons to use get/put methods instead of item access? | 1.2 | 0 | 0 | 108 |
3,261,198 | 2010-07-16T00:56:00.000 | 1 | 0 | 0 | 0 | c#,python,ironpython | 3,261,217 | 2 | false | 0 | 0 | The easiest way would be to pass the HTML page into an XML/HTML parser, and then call getElementsByTagName("A") on the root node. Once you get that, iterate through the list and pull out the href parameter. | 1 | 0 | 0 | Some web pages, having their urls, have "Download" Text, which are hyperlinks.
How can I get the hyperlinks form the urls/pages by python or ironpython.
And can I download the files with these hyperlinks by python or ironpython?
How can I do that?
Are there any C# tools?
I am not native english speaker, so sorry for my english. | How can I download files form web pages? | 0.099668 | 0 | 1 | 210 |
3,262,473 | 2010-07-16T06:38:00.000 | 0 | 0 | 0 | 0 | javascript,python,html | 3,262,533 | 8 | false | 1 | 0 | You would need to keep track of each XMLHttpRequest and monitor whether it completes or the asynchronous callback is executed. | 2 | 17 | 0 | How do i check if the page has pending AJAX or HTTP GET/POST requests? I use javascript and/or python for this checking.
what i wanted to do is execute a script if a page has finished all requests. onload doesn't work for me, if you used firebugs net panel, you would know. onload fires when the page is loaded but there is a possibility that there are still pending request hanging around somewhere.
thank you in advance. | Check Pending AJAX requests or HTTP GET/POST request | 0 | 0 | 1 | 25,834 |
3,262,473 | 2010-07-16T06:38:00.000 | 4 | 0 | 0 | 0 | javascript,python,html | 3,263,704 | 8 | false | 1 | 0 | I see you mention you are using Prototype.js. You can track active requests with Prototype by checking the Ajax.activeRequestCount value. You could check this using setTimeout or setInterval to make sure that any requests triggered on page load have completed (if that's what you're looking to do) | 2 | 17 | 0 | How do i check if the page has pending AJAX or HTTP GET/POST requests? I use javascript and/or python for this checking.
what i wanted to do is execute a script if a page has finished all requests. onload doesn't work for me, if you used firebugs net panel, you would know. onload fires when the page is loaded but there is a possibility that there are still pending request hanging around somewhere.
thank you in advance. | Check Pending AJAX requests or HTTP GET/POST request | 0.099668 | 0 | 1 | 25,834 |
3,263,672 | 2010-07-16T09:53:00.000 | 2 | 0 | 1 | 0 | python,printing,stdout | 52,988,120 | 15 | false | 0 | 0 | In Python 3 there is valid reason to use print over sys.stdout.write, but this reason can also be turned into a reason to use sys.stdout.write instead.
This reason is that, now print is a function in Python 3, you can override this. So you can use print everywhere in a simple script and decide those print statements need to write to stderr instead. You can now just redefine the print function, you could even change the print function global by changing it using the builtins module. Off course with file.write you can specify what file is, but with overwriting print you can also redefine the line separator, or argument separator.
The other way around is. Maybe you are absolutely certain you write to stdout, but also know you are going to change print to something else, you can decide to use sys.stdout.write, and use print for error log or something else.
So, what you use depends on how you intend to use it. print is more flexible, but that can be a reason to use and to not use it. I would still opt for flexibility instead, and choose print. Another reason to use print instead is familiarity. More people will now what you mean by print and less know sys.stdout.write. | 2 | 475 | 0 | Are there situations in which sys.stdout.write() is preferable to print?
(Examples: better performance; code that makes more sense) | The difference between sys.stdout.write and print? | 0.02666 | 0 | 0 | 713,487 |
3,263,672 | 2010-07-16T09:53:00.000 | 45 | 0 | 1 | 0 | python,printing,stdout | 3,264,118 | 15 | false | 0 | 0 | My question is whether or not there
are situations in which
sys.stdout.write() is preferable to
print
After finishing developing a script the other day, I uploaded it to a unix server. All my debug messages used print statements, and these do not appear on a server log.
This is a case where you may need sys.stdout.write instead. | 2 | 475 | 0 | Are there situations in which sys.stdout.write() is preferable to print?
(Examples: better performance; code that makes more sense) | The difference between sys.stdout.write and print? | 1 | 0 | 0 | 713,487 |
3,263,769 | 2010-07-16T10:06:00.000 | 0 | 0 | 1 | 0 | python,installation,windows-installer | 3,264,133 | 2 | false | 0 | 0 | Based on one of your comments, it looks like you don't actually need to install it, you just need it on the computer so your program can run. In that case you can take a page from Dropbox's book and include the interpreter, DLL, and standard library in one of your directories, and just use it from there. | 1 | 4 | 0 | I want to install the new Python 2.7 on my Windows XP 32bit PC.
having CDO (thats OCD with initials sorted in alphabetical order) I want to install it multiple times on the same computer (to different TARGETDIRs).
how do i do that ? double clicking on the installer, or running msiexec multiple times did not work for me
Coincidentally, I noticed that the windows python installation does not ask me if I want to add a Start Menu option. I want my installations of python not to show up on the Start Menu. How do I do that?
be well | Multiple Python Installations of the same python version on a single computer | 0 | 0 | 0 | 479 |
3,263,847 | 2010-07-16T10:21:00.000 | 3 | 0 | 0 | 1 | java,python,google-app-engine | 3,266,220 | 6 | true | 1 | 0 | Most people here are missing the fact that the question is really about App Engine, not java or python in general.
The Java and Python SDKs and App Engine runtimes have pretty much the same abilities at this point. One caveat with the current java runtime is that if you use a lot of external libraries, your loading hits (the first time someone hits your website, and app engine has to spin up your app) can be a bit slow. | 6 | 2 | 0 | Basically I am coding websites in PHP from last year.
But now I want to use something else and GAE looks a good option.
So I want to know if GAE is good for making a little website to share favorite youtube videos ?
I have done single website in Python+Django few months back, it looks good to me.
But JAVA is the language that I want to learn too (never coded in JAVA since School days ).
Phew, it is hard to choose, so I need opinions !!
Specifically : Want to know if any glitch/problem in using either python or Java under GAE. Or if GAE is preferred or not. Not gonna make website for learning only, it will be for a client. | GAE is any good ? if yes then JAVA or Python? | 1.2 | 0 | 0 | 652 |
3,263,847 | 2010-07-16T10:21:00.000 | 2 | 0 | 0 | 1 | java,python,google-app-engine | 3,265,021 | 6 | false | 1 | 0 | You'll be able to accomplish the exact same results using either Python or Java. Java is much more verbose than Python, which can make it have a bit of a steeper learning curve. The fact that you have some experience in Django (which GAE's webapp is largely based on and which you can even use directly if you want) will make it easier for you to get the website up and running in the immediate term.
So again, it does depend on what you want to accomplish. If your goal is to learn Java, then doing a project in Java is the best way to learn it. If your main goal is to get the site up and running, Python will be a better choice as it will let you focus less on struggling with learning new Java syntax and more on simply getting the website off the ground. | 6 | 2 | 0 | Basically I am coding websites in PHP from last year.
But now I want to use something else and GAE looks a good option.
So I want to know if GAE is good for making a little website to share favorite youtube videos ?
I have done single website in Python+Django few months back, it looks good to me.
But JAVA is the language that I want to learn too (never coded in JAVA since School days ).
Phew, it is hard to choose, so I need opinions !!
Specifically : Want to know if any glitch/problem in using either python or Java under GAE. Or if GAE is preferred or not. Not gonna make website for learning only, it will be for a client. | GAE is any good ? if yes then JAVA or Python? | 0.066568 | 0 | 0 | 652 |
3,263,847 | 2010-07-16T10:21:00.000 | 1 | 0 | 0 | 1 | java,python,google-app-engine | 3,264,425 | 6 | false | 1 | 0 | You need an IRL mentor. | 6 | 2 | 0 | Basically I am coding websites in PHP from last year.
But now I want to use something else and GAE looks a good option.
So I want to know if GAE is good for making a little website to share favorite youtube videos ?
I have done single website in Python+Django few months back, it looks good to me.
But JAVA is the language that I want to learn too (never coded in JAVA since School days ).
Phew, it is hard to choose, so I need opinions !!
Specifically : Want to know if any glitch/problem in using either python or Java under GAE. Or if GAE is preferred or not. Not gonna make website for learning only, it will be for a client. | GAE is any good ? if yes then JAVA or Python? | 0.033321 | 0 | 0 | 652 |
3,263,847 | 2010-07-16T10:21:00.000 | 1 | 0 | 0 | 1 | java,python,google-app-engine | 3,263,926 | 6 | false | 1 | 0 | I would personally go with a Java based solution. If this is just a little website for yourself, then it would be a good idea to learn a new technology, in this case Java. Little projects like this are ideal for learning new technologies and seeing if they are suitable for you as a developer and other projects you may decide to do in the future | 6 | 2 | 0 | Basically I am coding websites in PHP from last year.
But now I want to use something else and GAE looks a good option.
So I want to know if GAE is good for making a little website to share favorite youtube videos ?
I have done single website in Python+Django few months back, it looks good to me.
But JAVA is the language that I want to learn too (never coded in JAVA since School days ).
Phew, it is hard to choose, so I need opinions !!
Specifically : Want to know if any glitch/problem in using either python or Java under GAE. Or if GAE is preferred or not. Not gonna make website for learning only, it will be for a client. | GAE is any good ? if yes then JAVA or Python? | 0.033321 | 0 | 0 | 652 |
3,263,847 | 2010-07-16T10:21:00.000 | 2 | 0 | 0 | 1 | java,python,google-app-engine | 3,263,908 | 6 | false | 1 | 0 | If you want to learn Java, then use Java!
If you feel that Java is too verbose compared to Python, you could try Scala, which runs on the JVM like Java. Scala is more concise and well designed. | 6 | 2 | 0 | Basically I am coding websites in PHP from last year.
But now I want to use something else and GAE looks a good option.
So I want to know if GAE is good for making a little website to share favorite youtube videos ?
I have done single website in Python+Django few months back, it looks good to me.
But JAVA is the language that I want to learn too (never coded in JAVA since School days ).
Phew, it is hard to choose, so I need opinions !!
Specifically : Want to know if any glitch/problem in using either python or Java under GAE. Or if GAE is preferred or not. Not gonna make website for learning only, it will be for a client. | GAE is any good ? if yes then JAVA or Python? | 0.066568 | 0 | 0 | 652 |
3,263,847 | 2010-07-16T10:21:00.000 | 3 | 0 | 0 | 1 | java,python,google-app-engine | 3,264,075 | 6 | false | 1 | 0 | Java and Python are both excellent languages. It is a matter of taste and believe which you choose.
If you prefer a lightweight solution, use Python.
If you have enterprise needs, whatever that means, use Java.
If you ask for my personal believe, my subjective stand-of-point is:
Use Python wherever possible and stick to other languages if there is a need to.
So this is my opinion, but as S.Lott commented on your question:
Opinions are going to be useless. | 6 | 2 | 0 | Basically I am coding websites in PHP from last year.
But now I want to use something else and GAE looks a good option.
So I want to know if GAE is good for making a little website to share favorite youtube videos ?
I have done single website in Python+Django few months back, it looks good to me.
But JAVA is the language that I want to learn too (never coded in JAVA since School days ).
Phew, it is hard to choose, so I need opinions !!
Specifically : Want to know if any glitch/problem in using either python or Java under GAE. Or if GAE is preferred or not. Not gonna make website for learning only, it will be for a client. | GAE is any good ? if yes then JAVA or Python? | 0.099668 | 0 | 0 | 652 |
3,264,024 | 2010-07-16T10:44:00.000 | 1 | 0 | 1 | 0 | python,ubuntu,pygame,python-idle | 9,820,042 | 4 | false | 0 | 1 | If you don't like to download an unpack then install manually, you can use apt to install setuptools . After that you can use easy_install(or easy_install-2.7?) to install many python packages, including pygame, of course. | 3 | 3 | 0 | I am running in ubuntu and I can code in python, without problem. I have tried to install pygame and to do make it so, I did:
sudo apt-get instal python-pygame
When I go into the python IDLE and write:
import pygame
I get:
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named pygame
What can I do to solve this problem? I am forgetting something, or doing something wrong? | pygame not found | 0.049958 | 0 | 0 | 9,872 |
3,264,024 | 2010-07-16T10:44:00.000 | 1 | 0 | 1 | 0 | python,ubuntu,pygame,python-idle | 14,076,665 | 4 | false | 0 | 1 | I just had this same problem!
I read this and while it works to do the sys.path.append thing, I decided to try and get it to work with out.
What I did was went to the Ubuntu Software center uninstalled the python IDLE i had installed and then installed the IDLE.
This seems confusing the way I said it so to clarify you want to download the IDLE that doesn't come with its own version of python, it'll then use the python that already comes with Ubuntu!
If this doesn't make since or doesn't help fix your problem let me know! | 3 | 3 | 0 | I am running in ubuntu and I can code in python, without problem. I have tried to install pygame and to do make it so, I did:
sudo apt-get instal python-pygame
When I go into the python IDLE and write:
import pygame
I get:
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named pygame
What can I do to solve this problem? I am forgetting something, or doing something wrong? | pygame not found | 0.049958 | 0 | 0 | 9,872 |
3,264,024 | 2010-07-16T10:44:00.000 | 0 | 0 | 1 | 0 | python,ubuntu,pygame,python-idle | 17,222,436 | 4 | false | 0 | 1 | check that you are installing pygame for the right version of python. I think the pygame for python 2.7 won't work on python 3.3. I had the same problem but even after installing the right version it didn't work. So after a little googling I found that I was installing pygame meant for 32-bit but my os is 64-bit. so try to google "pygame for window 64-bit" or something like that. I hope it helps. | 3 | 3 | 0 | I am running in ubuntu and I can code in python, without problem. I have tried to install pygame and to do make it so, I did:
sudo apt-get instal python-pygame
When I go into the python IDLE and write:
import pygame
I get:
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named pygame
What can I do to solve this problem? I am forgetting something, or doing something wrong? | pygame not found | 0 | 0 | 0 | 9,872 |
3,264,029 | 2010-07-16T10:45:00.000 | 3 | 0 | 1 | 0 | .net,ironpython,dynamic-language-runtime | 3,269,071 | 1 | true | 1 | 0 | You need to subclass the PlatformAdaptationLayer class and implement the "file system" calls. IronPython will then go to the PAL to do I/O for the files. This also involves implementing a ScriptHost which returns the type for the PAL. A good example of this is the Silverlight host which redirects file I/O to a XAP file.
If you browse the IronPython source on IronPython.CodePlex.com you'll find the Silverlight host in IronPython_Main\Hosts\Silverlight\Microsoft.Scripting.Silverlight. | 1 | 3 | 0 | I'm writing a C# client application which is intended to have strong support for customisation via scripting, and I have chosen IronPython as my target scripting language. I would like to keep the user's code in the application's database with the rest of its state, but I need the user to be able to split their scripts into files and modules.
How can I configure the IronPython engine so that it will use strings (with corresponding virtual paths) as the source for imports, rather than specifying a directory in the user's filesystem? Is this possible? | How can I set up dynamic imports when hosting IronPython? | 1.2 | 0 | 0 | 180 |
3,264,828 | 2010-07-16T12:31:00.000 | 4 | 0 | 1 | 0 | python,python-3.x,floating-point,string-formatting | 3,264,847 | 7 | false | 0 | 0 | No, because that would require modifying float.__str__(), but you aren't allowed to monkeypatch C types. Use string interpolation or formatting instead. | 1 | 17 | 0 | I've some lists and more complex structures containing floats. When printing them, I see the floats with a lot of decimal digits, but when printing, I don't need all of them.
So I would like to define a custom format (e.g. 2 or 3 decimals) when floats are printed.
I need to use floats and not Decimal. Also, I'm not allowed to truncate/round floats.
Is there a way to change the default behavior? | Change default float print format | 0.113791 | 0 | 0 | 29,211 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.