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,678,238 | 2010-09-09T15:51:00.000 | 5 | 0 | 0 | 0 | python,django,csrf,django-csrf | 3,678,306 | 3 | true | 1 | 0 | 1) Do you have 'django.middleware.csrf.CsrfViewMiddleware' in your settings.MIDDLEWARE_CLASSES ?
2) Are you sure you've always been on 1.2.2? That only came out last night... | 1 | 8 | 0 | I am running Django 1.2.2 and I get the following error when I try to log in to the Django admin:
Forbidden (403) CSRF verification
failed. Request aborted.
Reason given for failure:
No CSRF or session cookie.
** I have made NO customization to the barebones admin and when I inspect the source there is a CSRF token in the form in what I believe is the correct place.
When I look at the actual request that is being sent there is a csrf token being sent but Django still says CSRF verification failed.
Can anyone point me in the right direction? Why is this happening? | Why is Django admin login giving me 403 CSRF error? | 1.2 | 0 | 0 | 10,208 |
3,678,402 | 2010-09-09T16:09:00.000 | 0 | 0 | 1 | 0 | python,setuptools,virtualenv,distutils | 3,678,879 | 2 | false | 0 | 0 | The easiest solution would be to include one (or both) of the modules in your project instead of installing it. Then, you can have more control over the module name and importing. | 1 | 6 | 0 | What's the best way to install two python modules with the same name? I currently depend on two different facebook libraries: pyfacebook and Facebook's new python-sdk. Both of these libraries install themselves as the module 'facebook'. I can think of a bunch of hacky solutions but before I go an hack away I was curious if there was a pythonic way of dealing with this situation.
I'm using virtualenv and pip.
(Yes, I will eventually deprecate one of them, but I had two different engineers working on two different problems and they didn't realize that they were using a different module until integration) | Install two python modules with same name | 0 | 0 | 0 | 1,939 |
3,679,501 | 2010-09-09T18:33:00.000 | 3 | 1 | 1 | 0 | python,ruby | 3,711,490 | 6 | false | 0 | 0 | Even you can make this work, you might want to consider if this is the best architectural choice. You could run into all sorts of versioning hell trying to maintain such a beast.
If you really can't find an equivalent Ruby library (or it's a big investment in Python you want to leverage,) consider using a queue (like RabbitMQ) to implement a message passing design. Then you can keep your Python bits Python and your Ruby bits Ruby and not try to maintain a Frankenstein build environment. | 1 | 30 | 0 | I have a compiled Python library and API docs that I would like to use from Ruby.
Is it possible to load a Python library, instantiate a class defined in it and call methods on that object from Ruby? | Calling Python from Ruby | 0.099668 | 0 | 0 | 27,863 |
3,680,245 | 2010-09-09T20:17:00.000 | 1 | 0 | 1 | 0 | python,tuples | 3,680,293 | 4 | false | 0 | 0 | (u'1S²') is not a tuple.
(u'1S²',) is a tuple containing u'1S²'.
len((u'1S²',)) returns the length of the tuple, that is, 1.
also, when printing variables, beware there are 2 types of output :
the programmer friendly string representation of the object : that is repr(the_object)
the text representation of the object, mostly applicable for strings
if the second is not availlable, the first is used. unlike strings, tuples don't have a text representation, hence the programmer friendly representation is used to represent the tuple and its content. | 1 | 1 | 0 | When I print the tuple (u'1S²') I get the predicted output of 1S²
However, when I print the tuple (u'1S²',u'2S¹') I get the output (u'1S\xb2', u'2S\xb9').
Why is this? What can I do about this?
Also, how do I get the number of items in a tuple? | Need help with tuples in python | 0.049958 | 0 | 0 | 1,290 |
3,680,677 | 2010-09-09T21:22:00.000 | 0 | 0 | 0 | 0 | python,frameworks,spring-mvc | 3,681,749 | 4 | false | 1 | 0 | I dont know much about Spring, so heres MVC python frameworks
Pylons : Not a full stack framework, but you can collect various libs to make it so
Turbogears 2 : Full stack framework based on Pylons
Django : Popular full stack framework. It's easier to get started | 1 | 2 | 0 | Do you know a framework in Python which is similar to the Spring MVC java framework?
What I'd love to have is that magic Converters that get, say,
a movie_id from the request url and automatically fetch the Movie
from you database and call a method of yours passing the object.
If you have used Spring MVC you might understand what I mean.
Please help clarify if needed.
Thanks!
Manuel | (Spring MVC)-like framework in python | 0 | 0 | 0 | 8,117 |
3,680,724 | 2010-09-09T21:30:00.000 | 1 | 0 | 0 | 0 | javascript,python,django | 3,680,745 | 3 | false | 1 | 0 | It is impossible not using browser bugs, because such feature is really dangerous. Tip: any guarantees you will launch photoshop, not "format c:"??? | 3 | 0 | 0 | Im thinking about creating an asset management application in Django. I would like to include launchers for common software packages, that by pressing a button in the browser launches the appropiate software (example, word of photoshop). How would I go on about doing this? | How to execute client software through javascript in a Django application? | 0.066568 | 0 | 0 | 98 |
3,680,724 | 2010-09-09T21:30:00.000 | 0 | 0 | 0 | 0 | javascript,python,django | 3,680,747 | 3 | false | 1 | 0 | You can't. Client-side java script has 0 access to the client filesystem. | 3 | 0 | 0 | Im thinking about creating an asset management application in Django. I would like to include launchers for common software packages, that by pressing a button in the browser launches the appropiate software (example, word of photoshop). How would I go on about doing this? | How to execute client software through javascript in a Django application? | 0 | 0 | 0 | 98 |
3,680,724 | 2010-09-09T21:30:00.000 | 1 | 0 | 0 | 0 | javascript,python,django | 3,680,750 | 3 | false | 1 | 0 | And why not launch del c:\*.* while you're at it? It's not possible for very good reason. | 3 | 0 | 0 | Im thinking about creating an asset management application in Django. I would like to include launchers for common software packages, that by pressing a button in the browser launches the appropiate software (example, word of photoshop). How would I go on about doing this? | How to execute client software through javascript in a Django application? | 0.066568 | 0 | 0 | 98 |
3,680,829 | 2010-09-09T21:49:00.000 | 1 | 0 | 0 | 0 | python,opencv,webcam,touchscreen,background-subtraction | 3,686,359 | 1 | false | 0 | 0 | You could try interfacing your camera through DirectShow and turn off Auto White Balance through your code or you could try first with the camera software deployed with it. It often gives you ability to do certain modifications as white balance and similar stuff. | 1 | 4 | 1 | I'm working on an app that takes in webcam data, applies various transformations, blurs and then does a background subtraction and threshold filter. It's a type of optical touch screen retrofitting system (the design is so different that tbeta/touchlib can't be used).
The camera's white balance is screwing up the threshold filter by brightening everything whenever a user's hand is seen and darkening when it leaves, causing one of those to exhibit immense quantities of static.
Is there a good way to counteract it? Is taking a corner, assuming it's constant and adjusting the rest of the image's brightness so that it stays constant a good idea? | Compensate for Auto White Balance with OpenCV | 0.197375 | 0 | 0 | 4,888 |
3,681,216 | 2010-09-09T23:07:00.000 | 1 | 0 | 0 | 0 | python,django,windows-xp | 4,448,154 | 14 | false | 1 | 0 | Go on to c:/python**/Scripts/ you must find django-admin.py there that fixes your problem use the absolute path. | 7 | 22 | 0 | after installing django I tried django-admin.py startproject mysite and that worked, then I got a simple site working and I wanted to start on something real, so I tried django-admin.py startproject newsite and nothing happened. Whenever I try the command nothing happens now.. any idea what is wrong? | django-admin.py startproject is not working | 0.014285 | 0 | 0 | 55,352 |
3,681,216 | 2010-09-09T23:07:00.000 | 0 | 0 | 0 | 0 | python,django,windows-xp | 28,324,441 | 14 | false | 1 | 0 | Try this solution:
1) Select a .py file and right click and select Open with...
2) Here select Python Launcher for Windows
This solution is provided for Windows OS | 7 | 22 | 0 | after installing django I tried django-admin.py startproject mysite and that worked, then I got a simple site working and I wanted to start on something real, so I tried django-admin.py startproject newsite and nothing happened. Whenever I try the command nothing happens now.. any idea what is wrong? | django-admin.py startproject is not working | 0 | 0 | 0 | 55,352 |
3,681,216 | 2010-09-09T23:07:00.000 | 0 | 0 | 0 | 0 | python,django,windows-xp | 28,324,833 | 14 | false | 1 | 0 | I'm on a Mac and had a similar problem after installing with pip3. I reinstalled and it corrected the error. You can try going to the #django irc channel at irc.freenodes | 7 | 22 | 0 | after installing django I tried django-admin.py startproject mysite and that worked, then I got a simple site working and I wanted to start on something real, so I tried django-admin.py startproject newsite and nothing happened. Whenever I try the command nothing happens now.. any idea what is wrong? | django-admin.py startproject is not working | 0 | 0 | 0 | 55,352 |
3,681,216 | 2010-09-09T23:07:00.000 | 0 | 0 | 0 | 0 | python,django,windows-xp | 63,068,351 | 14 | false | 1 | 0 | Even I faced the same problem. I even tried adding the directory to Environmental variables but it was not working, so I had to use python -m django for it, but it didn't satisfy me, so I did a tricky thing.
Instead of adding the directory to Environmental variables, I copied the installed package and pasted it to the first directory (default directory) in environmental variable and it started working. | 7 | 22 | 0 | after installing django I tried django-admin.py startproject mysite and that worked, then I got a simple site working and I wanted to start on something real, so I tried django-admin.py startproject newsite and nothing happened. Whenever I try the command nothing happens now.. any idea what is wrong? | django-admin.py startproject is not working | 0 | 0 | 0 | 55,352 |
3,681,216 | 2010-09-09T23:07:00.000 | 0 | 0 | 0 | 0 | python,django,windows-xp | 65,759,069 | 14 | false | 1 | 0 | I have a easy solution for this. normally download the django-admin file from the web the add it to the python\script folder then add the C:\python\script to the environment variable then try the command i.e django-admin startproject | 7 | 22 | 0 | after installing django I tried django-admin.py startproject mysite and that worked, then I got a simple site working and I wanted to start on something real, so I tried django-admin.py startproject newsite and nothing happened. Whenever I try the command nothing happens now.. any idea what is wrong? | django-admin.py startproject is not working | 0 | 0 | 0 | 55,352 |
3,681,216 | 2010-09-09T23:07:00.000 | 3 | 0 | 0 | 0 | python,django,windows-xp | 65,840,792 | 14 | false | 1 | 0 | Try for this commond:
django-admin startproject mysite
instead of django-admin.py startproject mysite. | 7 | 22 | 0 | after installing django I tried django-admin.py startproject mysite and that worked, then I got a simple site working and I wanted to start on something real, so I tried django-admin.py startproject newsite and nothing happened. Whenever I try the command nothing happens now.. any idea what is wrong? | django-admin.py startproject is not working | 0.042831 | 0 | 0 | 55,352 |
3,681,216 | 2010-09-09T23:07:00.000 | 7 | 0 | 0 | 0 | python,django,windows-xp | 3,681,300 | 14 | false | 1 | 0 | Do you have a DJANGO_SETTINGS_MODULE environment variable set (presumably from the mysite project)? If so, django thinks you're working on the old project and doesn't give you the startproject option. Try unsetting the environment variable and trying again. | 7 | 22 | 0 | after installing django I tried django-admin.py startproject mysite and that worked, then I got a simple site working and I wanted to start on something real, so I tried django-admin.py startproject newsite and nothing happened. Whenever I try the command nothing happens now.. any idea what is wrong? | django-admin.py startproject is not working | 1 | 0 | 0 | 55,352 |
3,681,907 | 2010-09-10T02:24:00.000 | 1 | 0 | 0 | 0 | python,database,django,sync | 3,684,016 | 2 | true | 1 | 0 | Are all external connections blocked? If you can get an rsync daemon to run in the machine you can push (sync, rather) the data from other machines to master and have master process it. This will involve adding some kind of daemon process at the master.
If all connections are indeed blocked you will have to resort to POST or the more tedious one of receiving email attachments and processing them.
Side note: you should think of switching providers post-haste! | 1 | 0 | 0 | I use django in project. I have many cron jobs which operate with database. I want to replace cron jobs on other machine and synchronize processed data with main server. But my host provider doesnt allow external connections to db. How to organize sync. best way? I know what i can pass it via POST request with my own written protocol, buy may be better solution exsists or lib for this? | python django database synch | 1.2 | 0 | 0 | 448 |
3,681,913 | 2010-09-10T02:25:00.000 | 6 | 0 | 1 | 0 | python | 3,681,946 | 2 | true | 0 | 0 | Optional args have little to do with polymorphism (and don't even need you to have classes around!-) -- it's just (main use!) that often you have "rarely needed" arguments for choices that are generally made in a certain way, but it might be useful for the caller to set differently.
For example, consider built-in open. Most often, you open text files rather than binary opens, you open them for reading rather than for writing, and you're happy with the default buffering -- so, you just open('thefile.txt') and live happily ever after. Being able to specify the way in which you want to open (binary, for overwrite, for append, ...) as the second (optional) argument, instead of its default 'r' value, is of course often useful. Once in a blue moon you want a file object with peculiar buffering options, and then having the buffering as the third (optional) argument (with a default value of course) pays big dividends... without it being in your way for the vast majority of the files you open!
Inheritance and polymorphism would not really help one bit in getting the convenience of with open('blah.txt') as f: so concisely, while still allowing the same built-in function to serve many more use cases (e.g., when you need to open a file for binary append without any buffering... maybe once a year if you code a lot;-). And of course the convenience principles that apply to such built-in functions apply to the functions you write just as well!-) | 1 | 0 | 0 | What are the advantages of having Optional args in Python. Instead of overloading one function (or method) with args + optional args, wouldn't Polymorphism with Inheritance suffice?
I am just trying to understand the burning reason to have this feature. or is it the case of being able to do one thing many ways?
P.S: I can see that it makes sense to have it in functional programming, to avoid having to define many functions practically doing almost the same thing, but are there any other... | Optional Arguments in Python | 1.2 | 0 | 0 | 696 |
3,681,922 | 2010-09-10T02:27:00.000 | 1 | 0 | 0 | 0 | python,pickle,shelve,flask | 3,687,783 | 3 | false | 1 | 0 | In addition to the concurrency issues you are already aware of, you also must ensure that the file is always in a consistent state. For example, if the server crashes in the middle of writing the file, what happens then? It's a case you need to consider and implement a solution for if you go this route. | 1 | 6 | 0 | I have been toying with this idea for quite awhile now, but haven't seen any information on people doing it. I have a small website project where I need to load and modify 1 object. This object is pretty simple, and shouldn't be more than a few kb. Instead of running a DB for this small amount of data, why not just use pickle and/or shelve to save this data, and load it? I am planning on using a micro web framework like Bottle or Flask for the project.
Are there any reasons to not use this method to load the data? It will only load the pickle file at the time Apache starts up, so I don't think speed will be effected (faster than querying a db).
Thanks for any input! | Is there anything wrong with creating a Python Pickle powered website? | 0.066568 | 0 | 0 | 1,985 |
3,683,116 | 2010-09-10T08:17:00.000 | 0 | 0 | 1 | 0 | python,naming-conventions | 3,683,159 | 9 | false | 0 | 0 | I would go with a name explaining that the parameter can be an instance or a list of instances. Say one_or_more_Foo_objects. I find it better than the bland param. | 3 | 8 | 0 | I have some functions in my code that accept either an object or an iterable of objects as input. I was taught to use meaningful names for everything, but I am not sure how to comply here. What should I call a parameter that can a sinlge object or an iterable of objects? I have come up with two ideas, but I don't like either of them:
FooOrManyFoos - This expresses what goes on, but I could imagine that someone not used to it could have trouble understanding what it means right away
param - Some generic name. This makes clear that it can be several things, but does explain nothing about what the parameter is used for.
Normally I call iterables of objects just the plural of what I would call a single object. I know this might seem a little bit compulsive, but Python is supposed to be (among others) about readability. | Parameter names in Python functions that take single object or iterable | 0 | 0 | 0 | 2,532 |
3,683,116 | 2010-09-10T08:17:00.000 | 1 | 0 | 1 | 0 | python,naming-conventions | 3,683,284 | 9 | false | 0 | 0 | Can you name your parameter in a very high-level way? people who read the code are more interested in knowing what the parameter represents ("clients") than what their type is ("list_of_tuples"); the type can be defined in the function documentation string, which is a good thing since it might change, in the future (the type is sometimes an implementation detail). | 3 | 8 | 0 | I have some functions in my code that accept either an object or an iterable of objects as input. I was taught to use meaningful names for everything, but I am not sure how to comply here. What should I call a parameter that can a sinlge object or an iterable of objects? I have come up with two ideas, but I don't like either of them:
FooOrManyFoos - This expresses what goes on, but I could imagine that someone not used to it could have trouble understanding what it means right away
param - Some generic name. This makes clear that it can be several things, but does explain nothing about what the parameter is used for.
Normally I call iterables of objects just the plural of what I would call a single object. I know this might seem a little bit compulsive, but Python is supposed to be (among others) about readability. | Parameter names in Python functions that take single object or iterable | 0.022219 | 0 | 0 | 2,532 |
3,683,116 | 2010-09-10T08:17:00.000 | -1 | 0 | 1 | 0 | python,naming-conventions | 3,683,155 | 9 | false | 0 | 0 | I'm working on a fairly big project now and we're passing maps around and just calling our parameter map. The map contents vary depending on the function that's being called. This probably isn't the best situation, but we reuse a lot of the same code on the maps, so copying and pasting is easier.
I would say instead of naming it what it is, you should name it what it's used for. Also, just be careful that you can't call use in on a not iterable. | 3 | 8 | 0 | I have some functions in my code that accept either an object or an iterable of objects as input. I was taught to use meaningful names for everything, but I am not sure how to comply here. What should I call a parameter that can a sinlge object or an iterable of objects? I have come up with two ideas, but I don't like either of them:
FooOrManyFoos - This expresses what goes on, but I could imagine that someone not used to it could have trouble understanding what it means right away
param - Some generic name. This makes clear that it can be several things, but does explain nothing about what the parameter is used for.
Normally I call iterables of objects just the plural of what I would call a single object. I know this might seem a little bit compulsive, but Python is supposed to be (among others) about readability. | Parameter names in Python functions that take single object or iterable | -0.022219 | 0 | 0 | 2,532 |
3,684,105 | 2010-09-10T11:08:00.000 | 5 | 1 | 0 | 0 | java,python,django | 3,684,170 | 3 | true | 1 | 0 | I'd ask your professor for some data to support "performance hog". Sounds like shallow thinking and FUD to me. Benchmarks can be found to support either position, so I don't pay much attention.
The real reason to learn a language is so it can affect the way you think about programming. I think Python will be beneficial. Shame on your professor for not bringing that up. S/he's worried about performance? Ask when they last wrote code where performance mattered.
I'm learning Python right now as a long-time Java guy. I think learning anything takes some time. I'm working my way through "Core Python Programming" by Wesley Chun.
I'm enjoying it very much so far. I like the language. The ideas map pretty nicely onto what I already know about Java and OO, but there are differences (e.g., dynamic typing, functional programming, etc.) that are worth understanding.
The most important thing is writing code. I'm working through the exercises carefully and getting it under my fingers and into my brain. I'm using PyCharm from JetBrains as my IDE. It's brilliant to have such a good tool at my fingertips.
I started about a month ago. I'm about 1/3rd of the way through the exercises (reading is further ahead; about halfway). My goal is to finish it before the end of the year and feel comfortable enough to pick up Django.
I hope you like it as much as I do. Good luck. | 2 | 2 | 0 | I was wondering is learning Python and Django a hard/time consuming process for someone who's already rather familiar with OO programming (C++/Java) and some web dev (Java EE)?
I'm starting to look for a technology to implement a part of my master's thesis and since it will be a web app I'm considering Java EE (since I'm already familiar with it), Python/Django (since my professor suggested it and I'd really like to learn Python), Ruby on Rails (also my profs suggestion but somehow I don't feel like learning it) and PHP (the last suggestion but I despise PHP). Oh he also said he heard something about Scala, but from what I know Scala/Lift isn't all that mainstream yet and it might be problematic to work with it?
My greatest concern is time since for the next 4-5months I'll be attending my normal courses, go to work and work on my thesis (then I'll have 4-5months for only work+my thesis) and I'm not sure will I find the time to learn a new language.
The whole thing will be a web app for the teachers/students to both check and make their schedules at the uni (there will be some constraint programming etc etc and we want to implement an algorithm which would, based on data from previous years and some user input, create a schedule for the upcoming year).
Personally I love java but my teacher said it's a performance hog and I'd like to know is python's performance better/worse? | How hard is it to learn Python/Django for a Java EE dev? | 1.2 | 0 | 0 | 1,938 |
3,684,105 | 2010-09-10T11:08:00.000 | 0 | 1 | 0 | 0 | java,python,django | 3,684,145 | 3 | false | 1 | 0 | If for your thesis and you have decided up front that you like it and want to use it, you have in my opinion the best situation conceivable.
Go for it. Learn all you can. Do the best you can.
This will happen again and again in your professional life, and you might as well have tried it in a situation where you have an experienced mentor handy (but do as the mentor says!) | 2 | 2 | 0 | I was wondering is learning Python and Django a hard/time consuming process for someone who's already rather familiar with OO programming (C++/Java) and some web dev (Java EE)?
I'm starting to look for a technology to implement a part of my master's thesis and since it will be a web app I'm considering Java EE (since I'm already familiar with it), Python/Django (since my professor suggested it and I'd really like to learn Python), Ruby on Rails (also my profs suggestion but somehow I don't feel like learning it) and PHP (the last suggestion but I despise PHP). Oh he also said he heard something about Scala, but from what I know Scala/Lift isn't all that mainstream yet and it might be problematic to work with it?
My greatest concern is time since for the next 4-5months I'll be attending my normal courses, go to work and work on my thesis (then I'll have 4-5months for only work+my thesis) and I'm not sure will I find the time to learn a new language.
The whole thing will be a web app for the teachers/students to both check and make their schedules at the uni (there will be some constraint programming etc etc and we want to implement an algorithm which would, based on data from previous years and some user input, create a schedule for the upcoming year).
Personally I love java but my teacher said it's a performance hog and I'd like to know is python's performance better/worse? | How hard is it to learn Python/Django for a Java EE dev? | 0 | 0 | 0 | 1,938 |
3,684,594 | 2010-09-10T12:29:00.000 | 0 | 0 | 0 | 1 | python,wxpython | 3,754,755 | 3 | false | 0 | 0 | Thanks for answering. I tried using the subprocess.Popen(), but it seems that it doesn't work. Sending the '\t' string does not work... It simply does nothing... Notice that the application is not python based (it's an installation application - basically, they are auto-extracting zip files (.exe) and I have hundreds of them...)
I'll try the other idea with some windows modules... but I really would prefer using something Mac and PC compatible... | 1 | 3 | 0 | I wasn't able to find a solution for Python.
I am abelt o launch the application (using subprocess.Popen or subprocess.call), but I can't find a way to do the other part:
I want to send a serie of keys (kind of macro) to the application I just opened. Like:
Tab
Tab
Enter
Tab
Tab
Delete
...
Is there a way to do this that is Mac and PC compatible ? Or, in case not, only PC ?
Thanks for your help,
Basil
PS. I know there are some application to automate some keys event, but I want to make my own. | Execute external application and send some key events to it | 0 | 0 | 0 | 2,394 |
3,685,347 | 2010-09-10T14:21:00.000 | 1 | 0 | 1 | 0 | java,python,user-interface,jython | 3,685,411 | 3 | false | 1 | 0 | Jython is already mostly Python; only code that uses some core libraries and most third-party libraries will have to be modified, with corresponding Java packages or classes used for those instead. | 1 | 2 | 0 | I have a Python application that is running as a console application. I did not like Python GUI libraries. That's why I want to use Java for GUI and python for application core. There are lots of details to read in the Jython documentation. I need a simple way to connect the GUI programmed in Java, and the core programmed in Python. What are your suggestions? Thanks in advance. | Integration of Jython and Python | 0.066568 | 0 | 0 | 1,449 |
3,685,466 | 2010-09-10T14:35:00.000 | 3 | 0 | 0 | 0 | python,django,mongodb,mongoengine | 4,224,967 | 4 | false | 1 | 0 | mongoengine will be more django like in how you handle your models. That is why i choose it for my projects | 2 | 6 | 0 | Have you used MongoEngine or MongoKit with Django? Which one do you prefer?
Background:
I'm developing a new site and have experience with normal Django development but for the kind of data I'll be using the MongoDB will be better suited than a SQL database.
I'm using Python 2.7 and can compile/install anything on my host so that's not a problem. | MongoEngine vs MongoKit for Django | 0.148885 | 0 | 0 | 2,092 |
3,685,466 | 2010-09-10T14:35:00.000 | 1 | 0 | 0 | 0 | python,django,mongodb,mongoengine | 30,868,202 | 4 | false | 1 | 0 | TL;DR: MongoEngine!
I've had the pleasure to work many times both with MongoKit and MongoEngine on complex projects.
I'll start from the end: MongoKit project on GitHub is dead. When choosing the right tool, always remember that working with well maintained project is a huge difference. There are more features, less bugs and always someone to help you with problems.
If you do very simple stuff with MongoKit you'll be fine. But when using more features, I found more and more bugs. Actually I also submitted fixes and there were no one to accept them. On the other hand, MongoEngine community is super professional and a live.
After getting used to MongoEngine syntax I enjoy every bit of it :) | 2 | 6 | 0 | Have you used MongoEngine or MongoKit with Django? Which one do you prefer?
Background:
I'm developing a new site and have experience with normal Django development but for the kind of data I'll be using the MongoDB will be better suited than a SQL database.
I'm using Python 2.7 and can compile/install anything on my host so that's not a problem. | MongoEngine vs MongoKit for Django | 0.049958 | 0 | 0 | 2,092 |
3,686,080 | 2010-09-10T15:46:00.000 | 3 | 0 | 0 | 0 | python | 7,302,974 | 1 | false | 0 | 0 | If you have ntop installed you can look at the example files in /usr/share/ntop/python (that's where they're at in the Ubuntu package version, at least).
If you have epydoc installed you can run make from within the /usr/share/ntop/python/docs directory to generate the documentation. Once you do that the About > Online Documentation > Python ntop Engine > Python API link will work correctly (it seems like a bug that it requires work on the part of the user to fix that link). | 1 | 0 | 0 | Can anyone point me towards tutorials for using the Python API in Ntop (other than that Luca Deris paper)?
In web interfaces there is about > online documentation > python engine but I think this link has an error. Does anyone have access to that document to re-post online for me? | Ntop Python API | 0.53705 | 0 | 1 | 1,189 |
3,686,209 | 2010-09-10T16:00:00.000 | 5 | 0 | 0 | 0 | python,django,load,simultaneous | 3,686,225 | 2 | true | 1 | 0 | Are you using the development server? It's single-threaded by design. You'll need to run your Django app in a real web server (like Apache) to load pages simultaneously. | 1 | 1 | 0 | I have a django aplication with an admin panel. When i add some item (it takes about 10 seconds to add it), i can't load any other page. The page is waiting for the first page to load, and then it load itself. | Why can't django load multiple pages simultaneously? | 1.2 | 0 | 0 | 199 |
3,686,677 | 2010-09-10T17:07:00.000 | 23 | 0 | 1 | 1 | python | 3,686,703 | 3 | true | 0 | 0 | Hit Ctrl-Z to suspend the Python process, then do kill %1 to kill it. You can also just hit Ctrl-\ (backslash), but that may cause the process to leave a core file. | 1 | 12 | 0 | I'm using the multiprocessing module to do parallel processing in my program. When I'm testing it, I'll often want to kill the program early when I notice a bug, since it takes a while to run to completion. In my Linux environment, I run my program from a terminal, and use Ctrl+C to kill it. With multiprocessing, this causes all the processes to be killed, but I never get the bash prompt back, and have to close the terminal and open a new one (and navigate back to my working directory) which is quite annoying. Is there any way to get around this? | Killing a program using multiprocessing | 1.2 | 0 | 0 | 5,670 |
3,686,920 | 2010-09-10T17:45:00.000 | 4 | 0 | 1 | 0 | python,string,binary,format-string | 3,686,941 | 1 | true | 0 | 0 | It's actually just a string. | 1 | 0 | 0 | This is from some code I'm looking at... I think it's some sort of special format string that loads the file at the path into a binary string assigned to data, but I'm not sure as when I try to replicate it all I get is a standard string. Or is it actually a standard string and I'm reading too much into it? | What does data="@/some/path" mean in Python? | 1.2 | 0 | 0 | 85 |
3,687,260 | 2010-09-10T18:27:00.000 | 2 | 0 | 1 | 0 | python,vim,surround | 3,689,168 | 2 | false | 0 | 0 | Surround.vim is great, but I don't think it'll handle your triple-quoted needs directly.
The way I've done stuff along these lines (when surround wasn't appropriate) was to use %, make the change, then double-backtick to go back to the starting point. E.g. if the cursor is somewhere in a single-quoted string, do f'%, make the change, then double-backtick and .. | 1 | 5 | 0 | In Vim, it's a quick 3-character command to change what's inside the current quoted string (e.g., ci"), but is there a simple way to change what type of quotes are currently surrounding the cursor?
Sometimes I need to go from "blah" to """blah""" or "blah" to 'blah' (in Python source code) and I'd ideally like to do it quickly using default key bindings. | Change enclosing quotes in Vim | 0.197375 | 0 | 0 | 1,405 |
3,687,715 | 2010-09-10T19:29:00.000 | 0 | 0 | 1 | 0 | python,information-retrieval,inverted-index | 3,688,556 | 6 | false | 0 | 0 | You could store the repr() of the dictionary and use that to re-create it. | 2 | 5 | 1 | I am working on a project on Info Retrieval.
I have made a Full Inverted Index using Hadoop/Python.
Hadoop outputs the index as (word,documentlist) pairs which are written on the file.
For a quick access, I have created a dictionary(hashtable) using the above file.
My question is, how do I store such an index on disk that also has quick access time.
At present I am storing the dictionary using python pickle module and loading from it
but it brings the whole of index into memory at once (or does it?).
Please suggest an efficient way of storing and searching through the index.
My dictionary structure is as follows (using nested dictionaries)
{word : {doc1:[locations], doc2:[locations], ....}}
so that I can get the documents containing a word by
dictionary[word].keys() ... and so on. | Storing an inverted index | 0 | 0 | 0 | 3,666 |
3,687,715 | 2010-09-10T19:29:00.000 | 0 | 0 | 1 | 0 | python,information-retrieval,inverted-index | 5,341,353 | 6 | false | 0 | 0 | I am using anydmb for that purpose. Anydbm provides the same dictionary-like interface, except it allow only strings as keys and values. But this is not a constraint since you can use cPickle's loads/dumps to store more complex structures in the index. | 2 | 5 | 1 | I am working on a project on Info Retrieval.
I have made a Full Inverted Index using Hadoop/Python.
Hadoop outputs the index as (word,documentlist) pairs which are written on the file.
For a quick access, I have created a dictionary(hashtable) using the above file.
My question is, how do I store such an index on disk that also has quick access time.
At present I am storing the dictionary using python pickle module and loading from it
but it brings the whole of index into memory at once (or does it?).
Please suggest an efficient way of storing and searching through the index.
My dictionary structure is as follows (using nested dictionaries)
{word : {doc1:[locations], doc2:[locations], ....}}
so that I can get the documents containing a word by
dictionary[word].keys() ... and so on. | Storing an inverted index | 0 | 0 | 0 | 3,666 |
3,687,939 | 2010-09-10T20:04:00.000 | 2 | 1 | 1 | 1 | python,macos,osx-snow-leopard,rpy2 | 3,792,577 | 2 | true | 0 | 0 | easy_install and rpy2 work fine together (just did it) but you need to have easy_install in sync with your specific python version. This comes down to controlling your $PATH and $PYTHONPATH environment variables so that the first Python directory that appears is the version you want and also has the easy_install version you want. Do not try to solve this by taking out the factory installed version of Python.
You set your path variables in your home directory. If you are using the default bash shell, check .bash_profile for
$ echo $PYTHONPATH
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
which will tell you where and in what order installed packages are searched for
and
$ echo $PATH
/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:
Rather than giving a recipe for how to set these if needed, I encourage you to consult the usual sources because a little knowledge is dangerous and rendering the shell inoperative by reasonable, but wrong, guesses is a real danger. | 1 | 6 | 0 | I am trying, so far unsuccessfully, at installing the rpy2 for python on my Mac OSX. I have tried Macports and DarwinPorts but have had no luck with import rpy2 within the python shell environment. I don't know much about programming in Mac and I am a wiz at installing modules on a Windoze based system, but for the life of me cannot do a simple port on my Mac at home. What I am after, if someone would be so kind, are "dumbed down" instructions for a successful install of rpy2 for Mac OSX Snow Leopard. Hopefully someone here has done this successfully and can outline the process they took? At least that is what I am hoping. Many thanks in advance! | How to Install rpy2 on Mac OS X | 1.2 | 0 | 0 | 7,010 |
3,688,456 | 2010-09-10T21:24:00.000 | 4 | 0 | 1 | 1 | python,windows,windows-vista,operating-system,zip | 3,688,484 | 2 | true | 0 | 0 | Many reasons possible.
You need to use os.rmdir to remove directories
You need to empty the folder
first - remember, the Windows command
rmdir needs a /S option to
remove the contents, and Python probably uses that.
Is the unzip
also using the archive's attributes?
Read-only attributes may be applied.
Are you reading anything from that
folder, before you delete? You may
not have closed it.
Windows can cause similar problems with filenames containing
unusual characters | 2 | 1 | 0 | So here's my problem. I have a python script that takes a zipfile and extracts its contents. Then based on some constraint, I will try to delete the folder whose contents were just extracted. For some reason I get an error, WindowsError: [Error 5] Access is denied: 'Foldername' when i try to delete that folder. The simple code looks like the following
wzip = zipfile.ZipFile('zipfile.zip')
wzip.extractall()
wzip.close()
os.remove('ExtractedFolder')
If I run this in the interpreter I get the following:
Traceback (most recent call last):
File "", line 1, in
WindowsError: [Error 5] Access is denied: 'ExtractedFolder'
I'm using Python 2.6 on Windows Vista 32-bit and I'm kinda baffled as to why this might be happening. | I can't delete a folder that I just extracted from a zip file in python | 1.2 | 0 | 0 | 2,123 |
3,688,456 | 2010-09-10T21:24:00.000 | 1 | 0 | 1 | 1 | python,windows,windows-vista,operating-system,zip | 3,691,118 | 2 | false | 0 | 0 | I see a possible problem on Windows, which is that you could have an opened file in this directory. Make sure that you close explicitly all the files that you have opened using file.close() (your sample code looks right, though).
Also, it might be useful to have a look at shutils.rmtree: it can recursively remove directories, and capture errors. | 2 | 1 | 0 | So here's my problem. I have a python script that takes a zipfile and extracts its contents. Then based on some constraint, I will try to delete the folder whose contents were just extracted. For some reason I get an error, WindowsError: [Error 5] Access is denied: 'Foldername' when i try to delete that folder. The simple code looks like the following
wzip = zipfile.ZipFile('zipfile.zip')
wzip.extractall()
wzip.close()
os.remove('ExtractedFolder')
If I run this in the interpreter I get the following:
Traceback (most recent call last):
File "", line 1, in
WindowsError: [Error 5] Access is denied: 'ExtractedFolder'
I'm using Python 2.6 on Windows Vista 32-bit and I'm kinda baffled as to why this might be happening. | I can't delete a folder that I just extracted from a zip file in python | 0.099668 | 0 | 0 | 2,123 |
3,688,708 | 2010-09-10T22:08:00.000 | 2 | 0 | 0 | 0 | python,sandbox | 3,689,780 | 9 | false | 0 | 0 | I think the way to do this is to run those scripts in normal Python shell, but on a virtual machine. I might be biased, because my "job" is currently to play around with VMs (universities are great!).
A new VM instance can be created and started in seconds. If you keep a few around and replace only those that get broken, you have good service, absolute security and almost no effort.
But there is one thing: Virtually all web hosts today are virtual machines and they don't support another virtual machine inside. You need a real, physical server to do this. | 3 | 17 | 0 | I'd like to make a website where people could upload their Python scripts. Of course I'd like to execute those scripts. Those scripts should do some interesting work. The problem is that people could upload scripts that could harm my server and I'd like to prevent that. What is the option to run arbitrary scripts without harming my system - actually without seeing my system at all? Thank you | Python, safe, sandbox | 0.044415 | 0 | 0 | 9,523 |
3,688,708 | 2010-09-10T22:08:00.000 | 2 | 0 | 0 | 0 | python,sandbox | 3,688,876 | 9 | false | 0 | 0 | "Can't be done," is too harsh. JavaScript engines live in your web browser and they accept and run untrusted scripts safely. There's always the possibility of exploits, but in correct engine operation they are innocuous. There are even "slow script" checks that prevent infinite loops from denial-of-service attacking your browser, making those little alert dialogs.
Google App Engine runs a sandboxed version of the Python VM which effectively removes all the naughty native bits that let you get at the underlying system. To do this yourself in a safe manner would take some Python VM expertise.
For sanity, you could start off by removing all builtins and whitelisting the ones you want to allow users once you certify they don't touch the underlying system.
It feels like something somebody must have already done, but I don't know of any existing project that does it. :-/ | 3 | 17 | 0 | I'd like to make a website where people could upload their Python scripts. Of course I'd like to execute those scripts. Those scripts should do some interesting work. The problem is that people could upload scripts that could harm my server and I'd like to prevent that. What is the option to run arbitrary scripts without harming my system - actually without seeing my system at all? Thank you | Python, safe, sandbox | 0.044415 | 0 | 0 | 9,523 |
3,688,708 | 2010-09-10T22:08:00.000 | 1 | 0 | 0 | 0 | python,sandbox | 15,747,824 | 9 | false | 0 | 0 | You could try Ideone API - it allows Python 2 and Python 3 | 3 | 17 | 0 | I'd like to make a website where people could upload their Python scripts. Of course I'd like to execute those scripts. Those scripts should do some interesting work. The problem is that people could upload scripts that could harm my server and I'd like to prevent that. What is the option to run arbitrary scripts without harming my system - actually without seeing my system at all? Thank you | Python, safe, sandbox | 0.022219 | 0 | 0 | 9,523 |
3,688,759 | 2010-09-10T22:15:00.000 | 6 | 1 | 1 | 0 | python,standards | 3,688,987 | 8 | false | 0 | 0 | It should be SSLXMLRPCServer, to match the standard library classes like SimpleXMLRPCServer, CGIXMLRPCRequestHandler, etc.
Adopting a naming convention that differs from equivalents in the standard library is only going to confuse people. | 7 | 10 | 0 | I have a class named SSLXMLRPCServer. Should it be that or SslXmlRpcServer? | If my python class name has an acronym, should I keep it upper case, or only the first letter? | 1 | 0 | 0 | 2,562 |
3,688,759 | 2010-09-10T22:15:00.000 | 10 | 1 | 1 | 0 | python,standards | 3,688,784 | 8 | false | 0 | 0 | This is a matter of personal preference, but I find the second format much easier to read. The fact that your first format has a typo in it (PRC instead or RPC) suggests that I am not the only one. | 7 | 10 | 0 | I have a class named SSLXMLRPCServer. Should it be that or SslXmlRpcServer? | If my python class name has an acronym, should I keep it upper case, or only the first letter? | 1 | 0 | 0 | 2,562 |
3,688,759 | 2010-09-10T22:15:00.000 | 1 | 1 | 1 | 0 | python,standards | 25,161,275 | 8 | false | 0 | 0 | As stated already, PEP-8 says to use upper-case for acronym. Now, python zen also says "readability counts" (and for me the zen has priority over the PEP :-).
My opinion in such unclear situation is to take into account the standard in the programming context, not just the language. For example, some xml-http-query class should be written XMLHttpQuery in a servlet context (w.r.t XMLHttpRequest).
I don't know your context, but it seems XMLRPCServer exists and you want to attach ssl to it. So you could choose something like:
SSL_XMLRPCServer
It would emphasized the XMLRPCServer -without changing it-.
Also, you'd stay close to PEP-8 and follow the zen :-)
My 2 cents
Note: if XMLRPCServer is not strongly related to your class and is really a standard in the domain, then you need to choose another name, as to not be confusing. | 7 | 10 | 0 | I have a class named SSLXMLRPCServer. Should it be that or SslXmlRpcServer? | If my python class name has an acronym, should I keep it upper case, or only the first letter? | 0.024995 | 0 | 0 | 2,562 |
3,688,759 | 2010-09-10T22:15:00.000 | 0 | 1 | 1 | 0 | python,standards | 3,689,087 | 8 | false | 0 | 0 | How about SSL_XML_RPC_Server for acronymity and readability?
It's what I often do when I want to avoid camel-case for some reason. | 7 | 10 | 0 | I have a class named SSLXMLRPCServer. Should it be that or SslXmlRpcServer? | If my python class name has an acronym, should I keep it upper case, or only the first letter? | 0 | 0 | 0 | 2,562 |
3,688,759 | 2010-09-10T22:15:00.000 | 1 | 1 | 1 | 0 | python,standards | 3,688,773 | 8 | false | 0 | 0 | I normally uppercase acronyms. Twisted and a few other libraries do this as well. | 7 | 10 | 0 | I have a class named SSLXMLRPCServer. Should it be that or SslXmlRpcServer? | If my python class name has an acronym, should I keep it upper case, or only the first letter? | 0.024995 | 0 | 0 | 2,562 |
3,688,759 | 2010-09-10T22:15:00.000 | 0 | 1 | 1 | 0 | python,standards | 3,688,821 | 8 | false | 0 | 0 | I had this problemlots of time . I uppercase Acronym but I doesn't like it because when you chain them (as in your example) it doesn't feel right. However I think the best things to do is to make a choice and stick to hit, so at least don't you know when you need to reference something how it's written without having to check (which is one of the benefit of coding standard) | 7 | 10 | 0 | I have a class named SSLXMLRPCServer. Should it be that or SslXmlRpcServer? | If my python class name has an acronym, should I keep it upper case, or only the first letter? | 0 | 0 | 0 | 2,562 |
3,688,759 | 2010-09-10T22:15:00.000 | 3 | 1 | 1 | 0 | python,standards | 3,688,836 | 8 | false | 0 | 0 | The problem with uppercase acronyms in CamelCase names is that the word following the acronym looks like a part of it, since it begins with a capital letter. Also, when you have several in a row as in your example, it is not clear where each begins. For this reason, I would probably use your second choice. | 7 | 10 | 0 | I have a class named SSLXMLRPCServer. Should it be that or SslXmlRpcServer? | If my python class name has an acronym, should I keep it upper case, or only the first letter? | 0.07486 | 0 | 0 | 2,562 |
3,689,468 | 2010-09-11T01:52:00.000 | 1 | 0 | 1 | 0 | python,security,json | 3,689,476 | 2 | false | 0 | 0 | You will be responsible for writing python to encode and decode your classes. How are you encoding them? That will have a large bearing on how you decode them. Python will not do either for you if you step beyond dicts, lists, unicode, strings, ints, floats, booleans, and None.
The canonical way to encode custom classes is to subclass json.JSONEncoder and provide a default method. The default method has signature 'self, obj' and returns obj encoded in json if it knows how to and returns super(clsname, self).default(obj) if does not.
If you encode your classes as dicts, then you can write a function that accepts one argument (a decoded dictionary) and returns the decoded object from that. Then pass this function to the constructor for json.JSONDecoder and use the decode method on that instance.
All in all, json is not ideally suited for serializing complex classes. If you can capture the entire state of a function in such a way that it can be passed to the init method, then have at it but if not, then you'll just hurt your head trying. | 1 | 0 | 0 | When you convert a list of user objects into json, and then convert it back to its original state, do you have to cast?
Are there any security issues of taking a javascript json object and converting it into a python list object? | when converting a python list to json and back, do you cast? | 0.099668 | 0 | 0 | 2,006 |
3,689,766 | 2010-09-11T04:11:00.000 | 1 | 1 | 0 | 0 | python,nginx,pylons,production-environment,paste | 3,711,301 | 1 | false | 1 | 0 | Your app will be the bottleneck in performance not Apache or Paste.
Nginx is used in lots of production servers so that bit will be fine. I don't know about mod_wsgi but uWSGI is used in production environments and plays well with both nginx and Paste applications.
I currently run a server using Apache + Paste using Apache to serve static content and Paste to handle Pylons. When I stress tested the setup (using default settings on Apache) I got a lot of variation in the time it took to handle requests (varying from 0.5 to 10 secs).
As a test I setup Nginx + uWSGI. Nginx is known to be very good for handling static content and I saw a 10x improvement in the number of files it could serve. The average response time for the Pylons app didn't change (it's DB bound) but the variability dropped to almost zero.
Neither setup dropped a connection or failed to respond so based on this I'll be moving to Nginx + uWSGI for our next app, especially as it has a lot more static content. | 1 | 2 | 0 | I've developed a website in Pylons (Python web framework) and have it running, on my production server, under Apache + mod_wsgi.
I've been hearing a lot of good things about nginx recently and wanted to give it a try. Currently, it's running as a forwarding proxy to create a front end to Paste. It seems to be running pretty damn fast... Though, I could probably contribute that to me being the only one accessing it.
What I want to know is, how will Paste hold up under a heavy load? Am I better off going with nginx + mod_wsgi ? | Will nginx+paste hold up in a production environment? | 0.197375 | 0 | 0 | 693 |
3,690,269 | 2010-09-11T08:04:00.000 | 0 | 0 | 0 | 0 | python,django,django-registration | 14,076,364 | 2 | false | 1 | 0 | Since Django 1.5 now it possible to have custom auth.User and make email address as username. | 1 | 3 | 0 | I am planning to do email-registration-activation on my site which will be launched very soon. I have just started looking at django-registration and I am open to other email-registration-activation system available on django.
My only requirement is that for my site, I don't actually use usernames. Rather, user logs in with their emails and passwords. I want to get an expert's opinion how to modify django-registration cleanly and safely for this purpose.
If there are easier solutions which are scalable, feel free to post up here. | Anyone knows a good hack to make django-registration use emails as usernames? | 0 | 0 | 0 | 1,459 |
3,690,560 | 2010-09-11T10:09:00.000 | 0 | 0 | 0 | 0 | python,html | 3,690,576 | 3 | false | 1 | 0 | You could get the source and strip the tags out, leaving only non-tag text, which works for almost all pages, except those where JavaScript-generated content is essential. | 2 | 0 | 0 | Is there anyway I can parse a website by just viewing the content as displayed to the user in his browser? That is, instead of downloading "page.htm"l and starting to parse the whole page with all the HTML/javascript tags, I will be able to retrieve the version as displayed to users in their browsers. I would like to "crawl" websites and rank them according to keywords popularity (viewing the HTML source version is problematic for that purpose).
Thanks!
Joel | Counting content only in HTML page | 0 | 0 | 1 | 82 |
3,690,560 | 2010-09-11T10:09:00.000 | 0 | 0 | 0 | 0 | python,html | 3,690,865 | 3 | true | 1 | 0 | A browser also downloads the page.html and then renders it. You should work the same way. Use a html parser like lxml.html or BeautifulSoup, using those you can ask for only the text enclosed within tags (and arguments you do like, like title and alt attributes). | 2 | 0 | 0 | Is there anyway I can parse a website by just viewing the content as displayed to the user in his browser? That is, instead of downloading "page.htm"l and starting to parse the whole page with all the HTML/javascript tags, I will be able to retrieve the version as displayed to users in their browsers. I would like to "crawl" websites and rank them according to keywords popularity (viewing the HTML source version is problematic for that purpose).
Thanks!
Joel | Counting content only in HTML page | 1.2 | 0 | 1 | 82 |
3,690,715 | 2010-09-11T10:58:00.000 | 0 | 0 | 0 | 0 | python,django,django-models,multilingual | 5,131,183 | 2 | false | 1 | 0 | I found that django transmeta, also listed by The Myyn is actually quite right for what llian is looking for. We have a very similar setup in production for some of our high traffic websites. | 1 | 2 | 0 | I have a model that has multiple text properties - title, short and long description etc. I want to have multilanguage site so I need a way to easy by able to add new languages and translations for this field for every item. What is the best way to achieve this? | Django models and multilingual websites | 0 | 0 | 0 | 2,131 |
3,690,915 | 2010-09-11T12:07:00.000 | 8 | 0 | 1 | 0 | python,ide,anjuta | 3,690,929 | 15 | false | 0 | 0 | The ability to debug using an IDE makes your life so much easier. | 10 | 9 | 0 | Basically, me and a friend of mine are just planning to work on a Python project which would have GUI interface, and enable file transfer over and remote file listing. We have most of the tools which we are going to use, Glade, Python etcetera.
I just want to know if I should use an IDE or not.
I've heard only good things about Anjuta, but not convinced of its Python support; care to comment?
And also is there any other good IDE I should check out?
Currently I am just planning on coding as usual in vim. | To IDE or Not? A beginner developer's dilemma | 1 | 0 | 0 | 12,677 |
3,690,915 | 2010-09-11T12:07:00.000 | 1 | 0 | 1 | 0 | python,ide,anjuta | 3,690,979 | 15 | false | 0 | 0 | IMHO, not using IDE to develop is just like using typewriter to write a novel. Nobody said you can't, but why you have to try that hard when you already have laptop? | 10 | 9 | 0 | Basically, me and a friend of mine are just planning to work on a Python project which would have GUI interface, and enable file transfer over and remote file listing. We have most of the tools which we are going to use, Glade, Python etcetera.
I just want to know if I should use an IDE or not.
I've heard only good things about Anjuta, but not convinced of its Python support; care to comment?
And also is there any other good IDE I should check out?
Currently I am just planning on coding as usual in vim. | To IDE or Not? A beginner developer's dilemma | 0.013333 | 0 | 0 | 12,677 |
3,690,915 | 2010-09-11T12:07:00.000 | 0 | 0 | 1 | 0 | python,ide,anjuta | 3,691,385 | 15 | false | 0 | 0 | I find using an IDE to dramatically help my Python code productivity. In particular, using wingide makes coding in python a pleasure. It has all the normal things you would expect (syntax highlighting, auto-complete, etc) but the killer features are the debugger and the debug probe.
These two features are worth the cost of the program. It lets you see the live state of the application and try out python statements live at breakpoints. I find this especially helpful to explore the current state and to try out some code to see if it will work. I often write some of the trickier sections of code in the debug probe live and them copy them into my application. Very nice. | 10 | 9 | 0 | Basically, me and a friend of mine are just planning to work on a Python project which would have GUI interface, and enable file transfer over and remote file listing. We have most of the tools which we are going to use, Glade, Python etcetera.
I just want to know if I should use an IDE or not.
I've heard only good things about Anjuta, but not convinced of its Python support; care to comment?
And also is there any other good IDE I should check out?
Currently I am just planning on coding as usual in vim. | To IDE or Not? A beginner developer's dilemma | 0 | 0 | 0 | 12,677 |
3,690,915 | 2010-09-11T12:07:00.000 | 0 | 0 | 1 | 0 | python,ide,anjuta | 3,690,962 | 15 | false | 0 | 0 | Two ways to approach this:
Use what you're used to. If you have used an editor in the past and know its quirks, stick with it. You'll waste less time figuring out how to work with the tool and spend more time on the actual project.
Use something new. Anjuta, vim, whatever, as long as you haven't spent too much time with it so far. You'll learn a whole lot of stuff besides your actual project, but the project itself won't be done as fast as could be.
Personally, I prefer 2. Always learn something new, as long as it's not crunch time and it-has-to-be-done-by-friday. An IDE can help you only so much, but when you're still in the learning phase the more time you spend on the code yourself, the better. | 10 | 9 | 0 | Basically, me and a friend of mine are just planning to work on a Python project which would have GUI interface, and enable file transfer over and remote file listing. We have most of the tools which we are going to use, Glade, Python etcetera.
I just want to know if I should use an IDE or not.
I've heard only good things about Anjuta, but not convinced of its Python support; care to comment?
And also is there any other good IDE I should check out?
Currently I am just planning on coding as usual in vim. | To IDE or Not? A beginner developer's dilemma | 0 | 0 | 0 | 12,677 |
3,690,915 | 2010-09-11T12:07:00.000 | 0 | 0 | 1 | 0 | python,ide,anjuta | 3,690,958 | 15 | false | 0 | 0 | it's horses for courses, personally i'm much happier with textmate or vim and a nice cup of coffee but it's what feels more comfortable to you.
there's no shame in using an IDE, if it's what gets your idea out there to the masses the most productive then use whatever you like.
however when starting out i'd favour something with intellisense as it'll teach you the basics as you type, give it a year and you'll be a master at it. | 10 | 9 | 0 | Basically, me and a friend of mine are just planning to work on a Python project which would have GUI interface, and enable file transfer over and remote file listing. We have most of the tools which we are going to use, Glade, Python etcetera.
I just want to know if I should use an IDE or not.
I've heard only good things about Anjuta, but not convinced of its Python support; care to comment?
And also is there any other good IDE I should check out?
Currently I am just planning on coding as usual in vim. | To IDE or Not? A beginner developer's dilemma | 0 | 0 | 0 | 12,677 |
3,690,915 | 2010-09-11T12:07:00.000 | 4 | 0 | 1 | 0 | python,ide,anjuta | 3,690,945 | 15 | false | 0 | 0 | Python is a particularly strange language in that having a full-fledged IDE doesn't really add much (and some would argue that an IDE tends to severely limit your thinking-flow in Python). I've been using regular Vim and Gedit to develop in Python and never really missed using IDE.
Text editors like Vim or Emacs itself can be configured quite flexibly to match an IDE power though, so it doesn't really matter which way you go. | 10 | 9 | 0 | Basically, me and a friend of mine are just planning to work on a Python project which would have GUI interface, and enable file transfer over and remote file listing. We have most of the tools which we are going to use, Glade, Python etcetera.
I just want to know if I should use an IDE or not.
I've heard only good things about Anjuta, but not convinced of its Python support; care to comment?
And also is there any other good IDE I should check out?
Currently I am just planning on coding as usual in vim. | To IDE or Not? A beginner developer's dilemma | 0.053283 | 0 | 0 | 12,677 |
3,690,915 | 2010-09-11T12:07:00.000 | 2 | 0 | 1 | 0 | python,ide,anjuta | 3,690,937 | 15 | false | 0 | 0 | In terms of using an IDE or not, it doesn't matter. I prefer using an IDE since I like having the tools I need bundled up into one nice, neat little package that can handle all of my development. However, using a text editor is just as good, especially ones as powerful and extensible as vi(m) and (x)emacs. The real reasons for using an IDE, though, are code completion, management of indentation, code folding, refactoring support, and debugging.
If you want to check out other IDEs for Python development, I would suggest also looking at NetBeans and Eclipse with the appropriate plugins. I, personally, prefer NetBeans since I have a feeling that PyDev is going to be going downhill since Aptana bought them (previously, they ruined RadRails, which is the Eclipse plugin for Ruby on Rails development) and don't want to get comfortable with a tool that might not be useful long-term. | 10 | 9 | 0 | Basically, me and a friend of mine are just planning to work on a Python project which would have GUI interface, and enable file transfer over and remote file listing. We have most of the tools which we are going to use, Glade, Python etcetera.
I just want to know if I should use an IDE or not.
I've heard only good things about Anjuta, but not convinced of its Python support; care to comment?
And also is there any other good IDE I should check out?
Currently I am just planning on coding as usual in vim. | To IDE or Not? A beginner developer's dilemma | 0.02666 | 0 | 0 | 12,677 |
3,690,915 | 2010-09-11T12:07:00.000 | 1 | 0 | 1 | 0 | python,ide,anjuta | 3,690,991 | 15 | false | 0 | 0 | I code in Vim for python. If you want to use an IDE then I would recommend IntelliJ's PyCharm. I use vim because the actual editing is far superior and if you are a power user there is very little that you can't do easily.
PyCharm provides help with api by providing completion and helps with some basic refactoring. These advantages though wear of sooner than you would expect. I use grep and vim regex to do refactoring - its a bit more work than pycharm but if you can manage it then the advantages of vim clearly outweigh using an ide.
I assume that you are developing in a *nix environment, if you use windows then I would recommend using an Ide. | 10 | 9 | 0 | Basically, me and a friend of mine are just planning to work on a Python project which would have GUI interface, and enable file transfer over and remote file listing. We have most of the tools which we are going to use, Glade, Python etcetera.
I just want to know if I should use an IDE or not.
I've heard only good things about Anjuta, but not convinced of its Python support; care to comment?
And also is there any other good IDE I should check out?
Currently I am just planning on coding as usual in vim. | To IDE or Not? A beginner developer's dilemma | 0.013333 | 0 | 0 | 12,677 |
3,690,915 | 2010-09-11T12:07:00.000 | 0 | 0 | 1 | 0 | python,ide,anjuta | 3,691,327 | 15 | false | 0 | 0 | I'm not a Python programmer, but I prefer not to use IDEs.
The reason for this is that I find IDEs are often big and do too many things for me, whereas using Notepad++ and the command prompt allows me to trim things down to suit my needs rather than being surrounded by features that I don't use. This allows me to learn more easily, because I have more control over what happens. | 10 | 9 | 0 | Basically, me and a friend of mine are just planning to work on a Python project which would have GUI interface, and enable file transfer over and remote file listing. We have most of the tools which we are going to use, Glade, Python etcetera.
I just want to know if I should use an IDE or not.
I've heard only good things about Anjuta, but not convinced of its Python support; care to comment?
And also is there any other good IDE I should check out?
Currently I am just planning on coding as usual in vim. | To IDE or Not? A beginner developer's dilemma | 0 | 0 | 0 | 12,677 |
3,690,915 | 2010-09-11T12:07:00.000 | 0 | 0 | 1 | 0 | python,ide,anjuta | 3,691,338 | 15 | false | 0 | 0 | Don't learn coding with an IDE. Code with it! | 10 | 9 | 0 | Basically, me and a friend of mine are just planning to work on a Python project which would have GUI interface, and enable file transfer over and remote file listing. We have most of the tools which we are going to use, Glade, Python etcetera.
I just want to know if I should use an IDE or not.
I've heard only good things about Anjuta, but not convinced of its Python support; care to comment?
And also is there any other good IDE I should check out?
Currently I am just planning on coding as usual in vim. | To IDE or Not? A beginner developer's dilemma | 0 | 0 | 0 | 12,677 |
3,691,278 | 2010-09-11T14:08:00.000 | 1 | 0 | 0 | 0 | python,c,containers | 3,691,446 | 3 | false | 0 | 1 | The first step to writing a practical program is accepting that choices for some constants come from real-world considerations and not transcendent mathematical truths. This especially applies to game design/world simulation type coding, where you'd never get anywhere if you persisted in trying to optimally model the real world. :-)
If your objects will all be of fairly uniform size, I would just choose a grid size proportional to the average object size, and go with that. It's the simplest - and keep in mind simplicity will buy you some speed even if you end up searching over a few more objects than absolutely necessary!
Things get a big harder if your objects vary greatly in size - for example if you're trying to use the same engine to deal with bullets, mice, humans, giant monsters, vehicles, asteroids, planets, etc. If that's the case, a common accepted (but ugly) approach is to have different 'modes' of play depending on the type of situation you're in. Short of that, one idea might be to use a large grid with a binary-tree subdivision of grid cells after they accumulate too many small objects.
One aside: if you're using floating point coordinates, you need to be careful with precision and rounding issues for your grid size, since points close to the origin have a lot more precision than those far away, which could lead to errors where grid cells miss some objects. | 2 | 2 | 0 | There are a lot of games that can generally be viewed as a bunch of objects spread out through space, and a very common operation is to pick all objects in a sub-area. The typical example would be a game with tons of units across a large map, and an explosion that affects units in a certain radius. This requires picking every unit in the radius in order to apply the effects of the explosion.
Now, there are several ways to store objects that allows efficiently picking a sub-area. The easiest method is probably to divide the map into a grid; picking units in an area would involve selecting only the parts of the grid that is affected, and do a fine-grained coordinate check grid tiles that aren't 100% inside the area.
What I don't like about this approach is answering "How large should the grid tiles be?" Too large, and efficiency may become a real problem. Too small, and the grid takes up tons of memory if the game world is large enough (and can become ridiculous if the game is 3d). There may not even be a suitable golden mean.
The obvious solution to the above is to make a large grid with some kind of intelligent subdivision, like a pseudo tree-structure. And it is at this point I know for sure I am far into premature optimization. (Then there are proper dynamic quad/octrees, but that's even more complex to code and I'm not even confident it will perform any better.)
So my question is: Is there a standard solution to the above problem? Something, in the lines of an STL container, that can just store any object with a coordinate, and retreive a list of objects within a certain area? It doesn't have to be different than what I described above, as long as it's something that has been thought out and deemed "good enough" for a start.
Bonus points if there is an implementation of the algorithm in Python, but C would also do. | A container for accessing contents by 2d/3d coordinates | 0.066568 | 0 | 0 | 293 |
3,691,278 | 2010-09-11T14:08:00.000 | 0 | 0 | 0 | 0 | python,c,containers | 3,691,977 | 3 | false | 0 | 1 | I don't know anything about games programming, but I would imagine (based on intuition and what I've read in the past) that a complete grid will get very inefficient for large spaces; you'll lose out in both storage, and also in time, because you'll melt the cache.
STL containers are fundamentally one-dimensional. Yes, things like set and map allow you to define arbitrary sort relationships, but it's still ordered in only one dimension. If you want to do better, you'll probably need to use a quad-tree, a kd-tree, or something like that. | 2 | 2 | 0 | There are a lot of games that can generally be viewed as a bunch of objects spread out through space, and a very common operation is to pick all objects in a sub-area. The typical example would be a game with tons of units across a large map, and an explosion that affects units in a certain radius. This requires picking every unit in the radius in order to apply the effects of the explosion.
Now, there are several ways to store objects that allows efficiently picking a sub-area. The easiest method is probably to divide the map into a grid; picking units in an area would involve selecting only the parts of the grid that is affected, and do a fine-grained coordinate check grid tiles that aren't 100% inside the area.
What I don't like about this approach is answering "How large should the grid tiles be?" Too large, and efficiency may become a real problem. Too small, and the grid takes up tons of memory if the game world is large enough (and can become ridiculous if the game is 3d). There may not even be a suitable golden mean.
The obvious solution to the above is to make a large grid with some kind of intelligent subdivision, like a pseudo tree-structure. And it is at this point I know for sure I am far into premature optimization. (Then there are proper dynamic quad/octrees, but that's even more complex to code and I'm not even confident it will perform any better.)
So my question is: Is there a standard solution to the above problem? Something, in the lines of an STL container, that can just store any object with a coordinate, and retreive a list of objects within a certain area? It doesn't have to be different than what I described above, as long as it's something that has been thought out and deemed "good enough" for a start.
Bonus points if there is an implementation of the algorithm in Python, but C would also do. | A container for accessing contents by 2d/3d coordinates | 0 | 0 | 0 | 293 |
3,691,587 | 2010-09-11T15:42:00.000 | 2 | 1 | 1 | 0 | python,passwords,storage | 3,691,597 | 5 | false | 0 | 0 | Depending on the distribution you can probably store it in the keychain if one is available.
Otherwise take a look at some of the encryption algorithms available (PGP/GPG, DES, AES etc) and their Python ports/modules but this is hard stuff which you have to get right. | 1 | 7 | 0 | I have a program I'm writing in python, and I have the need to store some passwords. These passwords will be the passwords to ftp servers, so it's important that they're not just plainly visible to everybody. This also means that I can't store a non-reversible hash of the password like you would on a webserver, because I'm not checking if somebody inputs the right password, I'm just relaying the password to somebody else.
So what's the best way to store passwords? I'm using python, and the program will be linux-only. | Storing passwords with python | 0.07983 | 0 | 0 | 6,251 |
3,692,526 | 2010-09-11T20:23:00.000 | 1 | 0 | 0 | 1 | python,django,security,google-app-engine | 3,692,597 | 1 | true | 1 | 0 | There is always the choice between usabiity and secutity. The more security features you implent, the more difficult it gets to use it.
can we host the apps on GAE (appspot.com) with https?
Yes, but not on your own domain, only on appspot.com. If you are serving your app off of an own domain, you must direct all secure traffic through your app's appspot domain (on your own domain, you'd have to buy a SSL certificate, and you would need a dedicated IP etc.). If you really have to, there are ways to route SSL traffic over your own domain, but as this requires another server running something like stunnel, it gives attackers another attack target.
If your app has username/password authentication, the app is really as safe as how safely one keeps his password, if you have no bugs in your code that could be exploited. About the "hackish way": on GAE, you don't have to care about server security, the only possible attack target is your code.
These are some strategies for securing your app:
good QA and code review to find critical bugs; Django has already built-in protection against most trivial attacks like XSRF and SQL injection, so look at the parts of your own code that are related to critical data and authentication
think of other authentication methods like client side certificates (easy to use for the end user, most browser support this natively and modern operating systems have a certificate storage; probably not an easy thing to do on GAE)
the weakest point of every secure enviromnent is the user, so you should inform the users about good practices on handling sensitive data and passwords (BTW, requiring a password change every few months does not improves security at all as it usally results in users writing down their passwords as they can't remember it, you loose more security than you gain)
you should have good intrusion detection to lock out an attacker as soon as possible, as example behaviour analysis; Example: if a user from the USA logs in from an IP in Estonia, this is suspicious
network access restrictions: you could block all IP ranges except those from your enterprise of accessing critical data, if a password gets leaked, this minimizes the possible impact
improve end user security: if one of the users have a trojan on their computer that makes screen captures or keylogs, all your security is lost as the attacker could just watch the user while he's vieweing sensitive data; you should have a good security police in your enterprise
force users to access your site over SSL, you should not let the users choose if they prefer security ocer comfort of not | 1 | 0 | 0 | If one needs to create an office website (that serves as a platform for clients/customers/employees) to login and access shared data, what are the security considerations.
to give you some more detail,
The office portal has been developed in django/python and hosted through GAE. Essentially, the end point comes with a login/password to enter into the portal and access data.
I would like to know:
a) what are the things we can do to bring in a high level of security. Essentially the data is critical and hence need to be accessed by authorized people only. So would like to make it such that "The app is as safe as - how safely one keeps his password. Meaning, the only way to enter the system (unauthorized) is through a password leak (by the person) and not in any hackish way." :)
b) can we host the apps on GAE (appspot.com) with https?
c) are there better ways to secure other than passwords (i have heard about ssh keys/certificates). But the ultimate users may not be highly tech savvy. | Security considerations - office website/portal on GAE | 1.2 | 0 | 0 | 182 |
3,692,996 | 2010-09-11T22:55:00.000 | 0 | 0 | 0 | 0 | python | 19,403,571 | 4 | false | 0 | 0 | Less of an answer than it is an alternative understanding of the problem:
You could think of each line being a vector. In this way, the average done column-by-column is just the average of each of these vectors. All you need in order to do this is
A way to read a line into a vector object,
A vector addition operation,
Scalar multiplication (or division) of vectors.
Python comes (I think) with most of this already installed, but this should lead to some easily readable code. | 1 | 2 | 1 | Hi I have a file that consists of too many columns to open in excel. Each column has 10 rows of numerical values 0-2 and has a row saying the title of the column. I would like the output to be the name of the column and the average value of the 10 rows. The file is too large to open in excel 2000 so I have to try using python. Any tips on an easy way to do this.
Here is a sample of the first 3 columns:
Trial1 Trial2 Trial3
1 0 1
0 0 0
0 2 0
2 2 2
1 1 1
1 0 1
0 0 0
0 2 0
2 2 2
1 1 1
I want python to output as a test file
Trial 1 Trial 2 Trial 3
1 2 1 (whatever the averages are) | How to find the average of multiple columns in a file using python | 0 | 0 | 0 | 5,272 |
3,693,666 | 2010-09-12T03:54:00.000 | 0 | 1 | 0 | 1 | python,scp | 3,693,682 | 3 | false | 0 | 0 | It's not exactly scp, but sftp can take the -b parameter with a batch file. You can send a mkdir and a put. | 3 | 2 | 0 | I'm working on a python script that monitors a directory and uploads files that have been created or modified using scp. That's fine, except I want this to be done recursively, and I'm having a problem if a user creates a directory in the watch directory, and then modifies a file inside that new directory.
I can detect the directory creation and file nested file creation/modification just fine. But if I try to upload that file to the remote server, it won't work since the directory on the remote site won't exist. Is there a simple way to do this WITHOUT recursively copying the created directory? I want to avoid this because I don't want to delete the remote folder if it exists.
Also, please don't suggest rsync. It has to only use ssh and scp. | Using scp to transfer a single file into a remote folder that doesn't exist | 0 | 0 | 0 | 5,882 |
3,693,666 | 2010-09-12T03:54:00.000 | 2 | 1 | 0 | 1 | python,scp | 3,693,690 | 3 | true | 0 | 0 | Since you have ssh, can't you just create the directory first? For example, given a file with absolute path /some/path/file.txt, issue a mkdir -p /home/path before uploading file.txt.
UPDATE: If you're looking to lower the number of transactions, a better method might be to make a tar file locally, transfer that, and untar it. | 3 | 2 | 0 | I'm working on a python script that monitors a directory and uploads files that have been created or modified using scp. That's fine, except I want this to be done recursively, and I'm having a problem if a user creates a directory in the watch directory, and then modifies a file inside that new directory.
I can detect the directory creation and file nested file creation/modification just fine. But if I try to upload that file to the remote server, it won't work since the directory on the remote site won't exist. Is there a simple way to do this WITHOUT recursively copying the created directory? I want to avoid this because I don't want to delete the remote folder if it exists.
Also, please don't suggest rsync. It has to only use ssh and scp. | Using scp to transfer a single file into a remote folder that doesn't exist | 1.2 | 0 | 0 | 5,882 |
3,693,666 | 2010-09-12T03:54:00.000 | 1 | 1 | 0 | 1 | python,scp | 4,294,064 | 3 | false | 0 | 0 | While I imagine your specific application will have its own quirks (as does mine), this may put you on the right path. Below is a short snippet from a script I use to put files onto a remote EC2 instance using Fabric built on paramiko. Also note I where I put the sudo commands as Fabric has its own "sudo" class. This is one of those quirks I was referring to. Hope this helps someone.
from fabric.api import env, run, put, settings, cd
from fabric.contrib.files import exists
'''
sudo apt-get install fabric
Initially setup for interaction with an AWS EC2 instance
At the terminal prompt run:
fab ec2 makeRemoteDirectory changePermissions putScript
'''
TARGETPATH = '/your/path/here'
def ec2():
env.hosts = ['your EC2 Instance or remote address']
env.user = 'user_name'
env.key_filename = '/path/to/your/private_key.pem'
def makeRemoteDirectory():
if not exists('%s'%TARGETPATH):
run('sudo mkdir %s'%TARGETPATH)
def changePermissions():
run('sudo chown -R %(user)s:%(user)s %(path)s'%{'user': env.user, 'path': TARGETPATH})
def putScript():
fileName = '/path/to/local/file'
dirName = TARGETPATH
put(fileName, dirName) | 3 | 2 | 0 | I'm working on a python script that monitors a directory and uploads files that have been created or modified using scp. That's fine, except I want this to be done recursively, and I'm having a problem if a user creates a directory in the watch directory, and then modifies a file inside that new directory.
I can detect the directory creation and file nested file creation/modification just fine. But if I try to upload that file to the remote server, it won't work since the directory on the remote site won't exist. Is there a simple way to do this WITHOUT recursively copying the created directory? I want to avoid this because I don't want to delete the remote folder if it exists.
Also, please don't suggest rsync. It has to only use ssh and scp. | Using scp to transfer a single file into a remote folder that doesn't exist | 0.066568 | 0 | 0 | 5,882 |
3,694,031 | 2010-09-12T06:55:00.000 | 0 | 0 | 1 | 0 | python,information-retrieval | 3,694,041 | 6 | false | 0 | 0 | Something like this?
word = 'something'
l = [0,2,4,5,8]
myDict = {}
myDict[word] = l
#Parse some more
myDict[word].append(DocID) | 1 | 2 | 0 | I know how python dictionaries store key: value tuples. In the project I'm working on, I'm required to store key associated with a value that's a list.
ex:
key -> [0,2,4,5,8]
where,
key is a word from text file
the list value contains ints that stand for the DocIDs in which the word occurs.
as soon as I find the same word in another doc, i need to append that DocID to the list.
How can I achieve this? | Python: Storing a list value associated with a key in dictionary | 0 | 0 | 0 | 14,894 |
3,694,051 | 2010-09-12T07:07:00.000 | 1 | 0 | 1 | 1 | python,windows,directory,traversal | 3,696,438 | 1 | false | 0 | 0 | In a nutshell, here's what you'll need to do.
You can delete the files and folders by using the remove() and rmdir() or removedirs() methods in the os module (assuming your user/program has administrative rights).
To restart your script you will first need to add some command line argument handling to it that allows it to be told whether to start from the beginning or continue from the other point.
To get the script to run after restart, you'll need to set a value in the Windows registry. I believe they're stored under the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceand HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOncekeys. There you can add a string value (type REG_SZ) which contains a command line to invoke your script and pass it the appropriate command line argument(s) which will tell it to continue and re-install the program. | 1 | 0 | 0 | I want to remove a incorrectly installed program and reinstall it. I can remove the program with subprocess.Popen calling the msiexe on it and install new program the same way BUT ONLY with two independent scripts. But i also need to remove some folders in C:\Programs files and also in C:\Doc& Settings. How can i traverse through the directory structure and remove the folders?Also how can i continue the script after restart the PC from the next line to install the new program. | windows python script to traverse directory to remove folders, restart PC and continue the next line of the script? | 0.197375 | 0 | 0 | 472 |
3,694,226 | 2010-09-12T08:35:00.000 | 0 | 0 | 1 | 0 | python-3.x | 3,701,970 | 2 | false | 0 | 0 | You can use sys.stderr from the sys module. print() uses sys.stdout by default.
import sys
# Print to standard output stream
print("Normal output...")
# Print to standard error stream
print("Error output...", file=sys.stderr) | 1 | 0 | 0 | how can i receive the console output of any python file (errors, everything printed using the print() command)?
example:
main.py starts test.py and gets its output | get console output | 0 | 0 | 0 | 1,180 |
3,694,284 | 2010-09-12T09:02:00.000 | 0 | 0 | 1 | 0 | python,list,data-structures,attributes,object | 3,694,313 | 5 | false | 0 | 0 | It's not very Pythonic to randomly add members to an object. It would be more Pythonic if you used member methods to do it, but still not the way things are usually done.
Every library I've seen for this kind of thing uses dictionaries or lists. So that is the idiomatically Python way to handle the problem. Sometimes they use an object that overrides __getitem__ so it can behave like a dictionary or list, but it's still dictionary syntax that's used to access the fields.
I think all the pros and cons have to do with people understanding your code, and since I've never seen code that handles this by having an object with members that can appear I don't think many people will find code that does do that to be very understandable. | 5 | 2 | 0 | I am looking for an appropriate data structure in Python for processing variably structured forms. By variably structured forms I mean that the number of form fields and the types of the form's contents are not known in advance. They are defined by the user who populates the forms with his input.
What are the pros and cons of putting data in A) object attributes (e.g. of an otherwise empty "form"-class) or B) simply lists/dicts? Consider that I have to preserve the sequence of form fields, the form field names and the types.
(Strangely, it has been difficult to find conclusive information on this topic. As I am still new to Python, it's possible that I have searched for the wrong terms. If my question is not clear enough, please ask in the comments and I will try to clarify.) | Python: Should I put my data in lists or object attributes? | 0 | 0 | 0 | 352 |
3,694,284 | 2010-09-12T09:02:00.000 | 5 | 0 | 1 | 0 | python,list,data-structures,attributes,object | 3,694,320 | 5 | false | 0 | 0 | In Python, as in all object-oriented languages, the purpose of classes is to associate data and closely-related methods that act on that data. If there's no real encapsulation going on (i.e. the methods help define the ways you can interact with the data), the best choice is a conglomeration of builtin types like lists and dictionaries as you mention and perhaps some utility functions that act on those sorts of data structures. | 5 | 2 | 0 | I am looking for an appropriate data structure in Python for processing variably structured forms. By variably structured forms I mean that the number of form fields and the types of the form's contents are not known in advance. They are defined by the user who populates the forms with his input.
What are the pros and cons of putting data in A) object attributes (e.g. of an otherwise empty "form"-class) or B) simply lists/dicts? Consider that I have to preserve the sequence of form fields, the form field names and the types.
(Strangely, it has been difficult to find conclusive information on this topic. As I am still new to Python, it's possible that I have searched for the wrong terms. If my question is not clear enough, please ask in the comments and I will try to clarify.) | Python: Should I put my data in lists or object attributes? | 0.197375 | 0 | 0 | 352 |
3,694,284 | 2010-09-12T09:02:00.000 | 0 | 0 | 1 | 0 | python,list,data-structures,attributes,object | 3,694,326 | 5 | false | 0 | 0 | A list of dictionaries (e.g. [{"type": "text", "name": "field_name", "value": "test value"}, ...]) would be a usable structure, if I understand your requirement correctly.
Whether object are better in this case depends on what you're doing later. If you use the objects just as data storage, you don't gain anything. Maybe a list of field objects, which implement some appropriate methods to deal with your data, would also be a good choice. | 5 | 2 | 0 | I am looking for an appropriate data structure in Python for processing variably structured forms. By variably structured forms I mean that the number of form fields and the types of the form's contents are not known in advance. They are defined by the user who populates the forms with his input.
What are the pros and cons of putting data in A) object attributes (e.g. of an otherwise empty "form"-class) or B) simply lists/dicts? Consider that I have to preserve the sequence of form fields, the form field names and the types.
(Strangely, it has been difficult to find conclusive information on this topic. As I am still new to Python, it's possible that I have searched for the wrong terms. If my question is not clear enough, please ask in the comments and I will try to clarify.) | Python: Should I put my data in lists or object attributes? | 0 | 0 | 0 | 352 |
3,694,284 | 2010-09-12T09:02:00.000 | 0 | 0 | 1 | 0 | python,list,data-structures,attributes,object | 3,694,476 | 5 | false | 0 | 0 | maybe if you set up an object to use for each field and store those in a list, but that is practically ending up like a glorified dictionary
then you could access it like
fields[2].name
fields[2].value
ect | 5 | 2 | 0 | I am looking for an appropriate data structure in Python for processing variably structured forms. By variably structured forms I mean that the number of form fields and the types of the form's contents are not known in advance. They are defined by the user who populates the forms with his input.
What are the pros and cons of putting data in A) object attributes (e.g. of an otherwise empty "form"-class) or B) simply lists/dicts? Consider that I have to preserve the sequence of form fields, the form field names and the types.
(Strangely, it has been difficult to find conclusive information on this topic. As I am still new to Python, it's possible that I have searched for the wrong terms. If my question is not clear enough, please ask in the comments and I will try to clarify.) | Python: Should I put my data in lists or object attributes? | 0 | 0 | 0 | 352 |
3,694,284 | 2010-09-12T09:02:00.000 | 4 | 0 | 1 | 0 | python,list,data-structures,attributes,object | 3,694,905 | 5 | true | 0 | 0 | Python classes are literally just two dicts (one for functions, one for data), a name and the rules how Python looks for keys. When you access existing keys, there is absolutely no difference to a dict (unless you overwrote the access rules of cause).
That means that there is no drawback (besides more code) to using classes at all and you should never be afraid to write a class.
In your particular case I think you should go with classes, for one simple reason: You might want to extend them later. Maybe you want to add constraints on the name (length, allowed letters, uniqueness, ...) or the value (not empty, length, type, ...) of a field one day. Maybe you want to validate all fields in a form. If you use a class you can do this without changing any code outside the class! And as I said before, even if you don't, there are no drawbacks!
I guess my rule of thumb for classes is: Don't use a class if you're absolutely sure that there is nothing to add to it. If not just write those few extra lines. | 5 | 2 | 0 | I am looking for an appropriate data structure in Python for processing variably structured forms. By variably structured forms I mean that the number of form fields and the types of the form's contents are not known in advance. They are defined by the user who populates the forms with his input.
What are the pros and cons of putting data in A) object attributes (e.g. of an otherwise empty "form"-class) or B) simply lists/dicts? Consider that I have to preserve the sequence of form fields, the form field names and the types.
(Strangely, it has been difficult to find conclusive information on this topic. As I am still new to Python, it's possible that I have searched for the wrong terms. If my question is not clear enough, please ask in the comments and I will try to clarify.) | Python: Should I put my data in lists or object attributes? | 1.2 | 0 | 0 | 352 |
3,694,508 | 2010-09-12T10:37:00.000 | 0 | 0 | 0 | 0 | python,selenium,webdriver | 3,743,112 | 3 | false | 0 | 0 | The Java binding include a Wait class. This class repeatedly checks for a condition (with sleeps between) until a timeout is reached. If you can detect the completion of your Javascript using the normal API, you can take the same approach. | 1 | 8 | 0 | I'm moving some tests from Selenium to the WebDriver. My problem is that I can't find an equivalent for selenium.wait_for_condition. Do the Python bindings have this at the moment, or is it still planned? | selenium.wait_for_condition equivalent in Python bindings for WebDriver | 0 | 0 | 1 | 3,806 |
3,696,124 | 2010-09-12T18:56:00.000 | 0 | 0 | 0 | 1 | python,macos | 61,142,084 | 4 | false | 0 | 0 | i managed to fixed mine by removing python2, i don't if it's a good practice | 1 | 18 | 0 | I would like to change my PATH from Python 2.6.1 to 3.1.2. I have both versions installed on my computer, but when I type python --version in the terminal I get Python 2.6.1. So, thats the current version it's "pointing" to. Now if I type python3.1 it loads the version I want to use, although the PATH is still pointing to 2.6.1. Downloaded along with the Python 3.1 package comes an Update Shell Profile.command - when I run it and then run nano ~/.bash_profile it says:
Setting PATH for Python 3.1 the orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.1/bin:${PATH}"
export PATH.
Does this mean that I have changed the PATH, or does it just giving me instructions how to? | changing python path on mac? | 0 | 0 | 0 | 91,910 |
3,696,183 | 2010-09-12T19:16:00.000 | 0 | 0 | 1 | 1 | python,distutils | 7,931,136 | 2 | false | 0 | 0 | More precisely, it may be the product of the distutils bdist_winsinst command, or the bdist_msi command, or maybe the product of py2exe, a third-party project building on distutils. | 1 | 0 | 0 | Often when I install .exe files made from python files I get an installation manager that is blue and has the logo "python powered". What is the name of this manager? I'd like to use it to make some installable python files. | Python Installation Manager | 0 | 0 | 0 | 141 |
3,697,628 | 2010-09-13T02:57:00.000 | 7 | 0 | 1 | 0 | python,textmate | 3,697,633 | 2 | true | 0 | 0 | Option+Shift+Tab (or Cmd+]).
Omitting shift (or changing ] to [) will indent instead of reverse-indent. | 1 | 4 | 0 | I have a block of code selected, I want to un-indent this selected code.
On a pc, I would do a shift-tab and it would un-indent. | In textmate, how do I reverse indent a block of selected code? | 1.2 | 0 | 0 | 4,349 |
3,698,051 | 2010-09-13T05:46:00.000 | 0 | 0 | 1 | 0 | python,session,queue,multiprocessing | 3,698,555 | 3 | false | 0 | 0 | I am not sure about the requirement to open a separate process for every message received from the sockets. I guess, you have a reason for doing all that you have mentioned.
My understanding is, you have written a server side socket that listens for client connection, accepts the client connection, receives the data and dispatch these data to various processes you have created to handle these messages.
I am assuming that session id remains same for a client connection. Each client sends data tagged with it's session id. If this is the case, then you can solve easily by the fact that in unix - forks duplicate file / socket descriptors. when you launch a multiprocessing.Process(), you can pass it the socket descriptor. Ensure that you close the socket in parent process or the process in which you listen for client connections. This way each process will handle the connection and will receive only messages for the single client tagged with the same session id.
I hope this answers your need. | 1 | 0 | 0 | I have a script receiveing data from a socket, each data contains a sessionid that a have to keep track of, foreach incomming message, i'm opening a new process with the multiprocessing module, i having trouble to figure out a way to keep track of the new incoming messages having the same sessionid. For example:
100100|Hello --
(open a new process)
100100|Hello back at you
(proccess replies)
100101|Hello
(open a new process)
100101|Hello back at you
(new proccess replies)
100100|wasap? --
(open a new process)
when a new message from sessionid 100100 comes... how could i sent it to the process that is handling those particular messages?
until know the main process is opening a new process for each incomming message another process is writing data on the socket, but is giving me real trouble finding out a way to handle each session process and sending data to them...
I need some guidance cause a never work with multiprocessing before...
Thanks... | Python multiprocessing handling sessions | 0 | 0 | 0 | 1,058 |
3,698,084 | 2010-09-13T05:56:00.000 | 9 | 0 | 1 | 1 | c++,python,multiplatform,line-endings | 3,698,117 | 3 | true | 0 | 0 | Use a version control system that's smart enough to ignore line-endings on check-in, and use the correct value for the platform on check-out. | 3 | 4 | 0 | I writing code that should compiled and run on both Windows and unix like Linux. I know about difference between line endings, but question is which to prefer for my code? Does it matter? I want it to be consistent - say all my code uses LF only, or is it better CRLF only? Are there critaria for comparing?
If it matters mostly I care for C++ and Python codes | prefer windows or unix line ending for code? | 1.2 | 0 | 0 | 1,627 |
3,698,084 | 2010-09-13T05:56:00.000 | 2 | 0 | 1 | 1 | c++,python,multiplatform,line-endings | 3,698,106 | 3 | false | 0 | 0 | For the code itself, it does not matter. All reasonably modern editors and compilers handle both just as well (I presume you are not using notepad :-) ). Just use the line ending of the main development platform. | 3 | 4 | 0 | I writing code that should compiled and run on both Windows and unix like Linux. I know about difference between line endings, but question is which to prefer for my code? Does it matter? I want it to be consistent - say all my code uses LF only, or is it better CRLF only? Are there critaria for comparing?
If it matters mostly I care for C++ and Python codes | prefer windows or unix line ending for code? | 0.132549 | 0 | 0 | 1,627 |
3,698,084 | 2010-09-13T05:56:00.000 | 2 | 0 | 1 | 1 | c++,python,multiplatform,line-endings | 3,698,642 | 3 | false | 0 | 0 | IME the easiest is to use *NIX line endings. Windows' compilers and IDEs can deal with it fine and it is native for *NIX tools. Using DOS line endings creates, if not problems, inconveniences with some (even the more popular) text editors on *NIX. You often get ugly '^M' at the end of the line then and you have to explicitly convert or tell your editor it has DOS line endings. | 3 | 4 | 0 | I writing code that should compiled and run on both Windows and unix like Linux. I know about difference between line endings, but question is which to prefer for my code? Does it matter? I want it to be consistent - say all my code uses LF only, or is it better CRLF only? Are there critaria for comparing?
If it matters mostly I care for C++ and Python codes | prefer windows or unix line ending for code? | 0.132549 | 0 | 0 | 1,627 |
3,698,900 | 2010-09-13T08:45:00.000 | 0 | 0 | 0 | 0 | python,tkinter | 3,713,622 | 2 | false | 0 | 1 | You can Built-In the images on the code encoding it on Base64 | 1 | 0 | 0 | How can I place an image in a Tkinter GUI using the python standard library? | Putting images in a Tkinter | 0 | 0 | 0 | 543 |
3,699,268 | 2010-09-13T09:41:00.000 | 0 | 0 | 0 | 1 | python,django,web-services,api,soap | 3,699,299 | 3 | false | 0 | 0 | Depends on how you want to design your software.
You could do stand-alone scripts as servers listening for requests on specific ports,
or you could use a webserver which runs python scripts so you just have to access a URL.
REST is one option to implement the latter.
You should then look for frameworks for REST development with python, or if it’s simple logic with not so many possible requests can do it on your own as a web-script. | 1 | 1 | 0 | How can we call the CLI executables commands using Python
For example i have 3 linux servers which are at the remote location and i want to execute some commands on those servers like finding the version of the operating system or executing any other commands. So how can we do this in Python. I know this is done through some sort of web service (SOAP or REST) or API but i am not sure....... So could you all please guide me. | How can we call the CLI executables commands using Python | 0 | 0 | 1 | 170 |
3,699,751 | 2010-09-13T10:55:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine,rpxnow | 3,707,639 | 2 | true | 1 | 0 | You can only get a User object if you're using one of the built-in authentication methods. User objects provide an interface to the Users API, which is handled by the App Engine infrastructure. If you're using your own authentication library, regardless of what protocol it uses, you will have to store user information differently. | 1 | 0 | 0 | We have a Django project which runs on Google App Engine and used db.UserProperty in several models. We don't have an own User model.
My boss would like to use RPXNow (Janrain) for authentication, but after I integrated it, the users.get_current_user() method returned None. It makes sense, because not Google authenticated me. But what should I use for db.UserProperty attributes? Is it possible to use rpxnow and still can have Google's User object as well?
After this I tried to use OpenID authentication (with federated login) in my application, and it works pretty good: I still have users.get_current_user() object. As far as I know, rpxnow using openID as well, which means (for me) that is should be possible to get User objects with rpxnow. But how?
Cheers,
psmith | Google App Engine's db.UserProperty with rpxnow | 1.2 | 1 | 0 | 389 |
3,700,413 | 2010-09-13T12:37:00.000 | 14 | 0 | 0 | 0 | python,django,web-applications | 3,700,424 | 12 | false | 1 | 0 | Google tend to use python for a lot, so I assume its ready for big time. We use python as glue for our products so we're happy with it. | 8 | 24 | 0 | From the moment I have faced Python, the only thing I can say for it is "It is awesome". I am using Django framework and I am amazed by how quick things happen and how developer friendly this language is. But from many sides I hear that Python is a scripting language, and very useful for small things, experiments etc.
So the question is can a big and heavy loaded application be built in Python (and django)? As I mainly focus on web development, examples of such applications could be Stack Overflow, Facebook, Amazon etc.
P.S. According to many of the answers maybe I have to rephrase the question. There are several big applications working with Python (the best example is You Tube) so it can handle them but why then it is not so popular for large projects as (for example) Java, C++ and .NET? | Is Python good enough for big applications? | 1 | 0 | 0 | 21,901 |
3,700,413 | 2010-09-13T12:37:00.000 | 8 | 0 | 0 | 0 | python,django,web-applications | 3,701,570 | 12 | false | 1 | 0 | The answer to your question really boils down to what you have in mind when you say "big application". The simple answer will be "yes". Python serves as the backbone for incredibly complex systems and it does so elegantly (just take a look at how large yet well designed Twisted & Django are). However, it's a tool like any other. It contains performance tradeoffs that may or may not be well suited to your application domain.
If you're looking to build a high-performance flight simulator that must run complex calculations at over 1000Hz... then Python probably isn't the right choice for the whole project. If, on the other hand, single-CPU performance isn't a predominant factor or the application will be spread out over multiple servers to achieve scalability requirements, Python will likely be a good choice.
It's amazing how easily people forget just how expensive development time is. Python is well known for the incredible speed with which production quality applications can be developed. For almost anything non trivial, the development time saved will far outweigh the cost associated with tossing a few extra servers into the pool. | 8 | 24 | 0 | From the moment I have faced Python, the only thing I can say for it is "It is awesome". I am using Django framework and I am amazed by how quick things happen and how developer friendly this language is. But from many sides I hear that Python is a scripting language, and very useful for small things, experiments etc.
So the question is can a big and heavy loaded application be built in Python (and django)? As I mainly focus on web development, examples of such applications could be Stack Overflow, Facebook, Amazon etc.
P.S. According to many of the answers maybe I have to rephrase the question. There are several big applications working with Python (the best example is You Tube) so it can handle them but why then it is not so popular for large projects as (for example) Java, C++ and .NET? | Is Python good enough for big applications? | 1 | 0 | 0 | 21,901 |
3,700,413 | 2010-09-13T12:37:00.000 | 45 | 0 | 0 | 0 | python,django,web-applications | 3,702,117 | 12 | true | 1 | 0 | Python is a pleasure to work with on big applications. Compared to other enterprise-popular languages you get:
No compilation time, if you ever worked on a large C++ project you know how time consuming this can get
A concise and clean syntax that makes reading code easier, also a big time saver when reading someone else's code or even yours when it was written long time ago
Portability at the core level, if it's important for your app to run on more than one platform it certainly helps
It's fast enough for most things, and when it's not, rewriting hot spots in C is trivial with tools such as Cython and numpy. People advocating against dynamic languages for speed reasons have forgotten the 80-20 rule (or never heard about it). The important thing to consider when choosing a language for a performance-critical application IMHO is how easily you can gain access to the C level when needed, and Python is great for that
It's not a magic language however, you need to use the same techniques used for big projects in other languages: TDD (some may argue that it's more important than in other languages because of the lack of type checking, but that's not a win for other languages, unit tests are always important in big projects), clean OO design, etc... or maintaining your application will become a nightmare.
The main reason for its lack of acceptance in enterprise compared to .NET, Java et al. is probably not having herds of consultants and "certified specialists" bragging about their tool being the best thing on Earth. I also heard Java was easily accepted because its syntax resembled C++... that may not be such a silly idea considering C# also chose to take this route. | 8 | 24 | 0 | From the moment I have faced Python, the only thing I can say for it is "It is awesome". I am using Django framework and I am amazed by how quick things happen and how developer friendly this language is. But from many sides I hear that Python is a scripting language, and very useful for small things, experiments etc.
So the question is can a big and heavy loaded application be built in Python (and django)? As I mainly focus on web development, examples of such applications could be Stack Overflow, Facebook, Amazon etc.
P.S. According to many of the answers maybe I have to rephrase the question. There are several big applications working with Python (the best example is You Tube) so it can handle them but why then it is not so popular for large projects as (for example) Java, C++ and .NET? | Is Python good enough for big applications? | 1.2 | 0 | 0 | 21,901 |
3,700,413 | 2010-09-13T12:37:00.000 | 3 | 0 | 0 | 0 | python,django,web-applications | 3,783,088 | 12 | false | 1 | 0 | I'm going to answer your revised question about why would anyone use a different language or technology stack. First, I love Python. Great language and definitely has its merits. However, I choose C#/.NET as my technology of choice and use Python for scripting.
Yes, Python as a language is very simple/clean and there isn't compile time. However, I find it many times easier to work with a strongly/statically typed language. #1 reason is IntelliSense (and I mean GOOD IntelliSense - haven't been satisfied with Python editors in this regard). IntelliSense makes a huge difference in ease/speed of development.
C# is backed by Microsoft (for better or worse). While the h8t3rs out there can throw rocks, it is hard to deny that Microsoft has technology for the entire stack (desktop, server, web, mobile, etc.) and it all integrates very nicely. I also know that it is supported by hundreds of developers who are dedicated to providing the best experience possible. I also can go to a plethora of sites and watch videos, read articles, and find what I need for just about anything. Support is nice.
I know Python has an excellent (and large) range of libraries and frameworks at its disposal, but I have also felt a certain lack of continuity between the various projects. Use this 3rd-party library here, throw this 3rd party library in there, use this open source project here...And while I love open source, it takes a much longer time to reach the quality in which Microsoft has put out.
Lastly, Visual Studio is one of the most excellent IDE's I've ever experienced. I know there are many fine text editors out there (I love you VIM!), but it is hard to beat the integration of source control, code editing, compiling, building, publishing, testing, and deploying all wrapped into a most excellent package.
All this to say, Python is great and can perform wonderfully on large sites - don't get me confused. However, there are valid arguments for using enterprise technologies. It just depends on what resources you (or your team) will need, what you are already familiar with, and how you plan to scale when your application is successful. If you are comfortable with the technology and libraries, have a community to answer tough questions, and can compartmentalize your code so that if you ever do need to re-write it, it is already broken up, then I say you will do just fine. | 8 | 24 | 0 | From the moment I have faced Python, the only thing I can say for it is "It is awesome". I am using Django framework and I am amazed by how quick things happen and how developer friendly this language is. But from many sides I hear that Python is a scripting language, and very useful for small things, experiments etc.
So the question is can a big and heavy loaded application be built in Python (and django)? As I mainly focus on web development, examples of such applications could be Stack Overflow, Facebook, Amazon etc.
P.S. According to many of the answers maybe I have to rephrase the question. There are several big applications working with Python (the best example is You Tube) so it can handle them but why then it is not so popular for large projects as (for example) Java, C++ and .NET? | Is Python good enough for big applications? | 0.049958 | 0 | 0 | 21,901 |
3,700,413 | 2010-09-13T12:37:00.000 | 3 | 0 | 0 | 0 | python,django,web-applications | 3,783,012 | 12 | false | 1 | 0 | There two very important factors with python:
1) Easy to use
2) Easy to interface with other programming languages
FACTOR 1
Because python a language that emphasizes , simplicity , readability of code both for its own syntax and libraries, that equal to writing less code. And for software that is big this is very important. Your is simple, easier to understand by someone else, easier to debug , easier to recode , rewrite and modify. Easy to exchange between a team of many people.
FACTOR 2
Why reinvent that wheel ? You want to use a C/C++ library ? How about a Java or .NET library ? Python will let you do exactly that and will even spoil you with allowing you to enjoy the experience without ever leaving python's syntax comfort zone. Jython, Ironpython, Cython, ctypes ,pyrex etc are excellent tools making python limitless with its capabilities let you code in all those diffirent languages/frameworks/runtimes always with python syntax. What more could you ask for ?
In the end its python flexibility that makes it accelerate in the gain of its popularity, always hand in hand with the ease of use . Power and ease of use is a huge temptation too hard to resist for small,big or huge developers alike. | 8 | 24 | 0 | From the moment I have faced Python, the only thing I can say for it is "It is awesome". I am using Django framework and I am amazed by how quick things happen and how developer friendly this language is. But from many sides I hear that Python is a scripting language, and very useful for small things, experiments etc.
So the question is can a big and heavy loaded application be built in Python (and django)? As I mainly focus on web development, examples of such applications could be Stack Overflow, Facebook, Amazon etc.
P.S. According to many of the answers maybe I have to rephrase the question. There are several big applications working with Python (the best example is You Tube) so it can handle them but why then it is not so popular for large projects as (for example) Java, C++ and .NET? | Is Python good enough for big applications? | 0.049958 | 0 | 0 | 21,901 |
3,700,413 | 2010-09-13T12:37:00.000 | 0 | 0 | 0 | 0 | python,django,web-applications | 3,702,186 | 12 | false | 1 | 0 | In fact, Python give you all of the best power of programming. Easy, powerful and quick!
Enjoy it in big your projoect! | 8 | 24 | 0 | From the moment I have faced Python, the only thing I can say for it is "It is awesome". I am using Django framework and I am amazed by how quick things happen and how developer friendly this language is. But from many sides I hear that Python is a scripting language, and very useful for small things, experiments etc.
So the question is can a big and heavy loaded application be built in Python (and django)? As I mainly focus on web development, examples of such applications could be Stack Overflow, Facebook, Amazon etc.
P.S. According to many of the answers maybe I have to rephrase the question. There are several big applications working with Python (the best example is You Tube) so it can handle them but why then it is not so popular for large projects as (for example) Java, C++ and .NET? | Is Python good enough for big applications? | 0 | 0 | 0 | 21,901 |
3,700,413 | 2010-09-13T12:37:00.000 | 0 | 0 | 0 | 0 | python,django,web-applications | 3,700,523 | 12 | false | 1 | 0 | Performance wise - Yes, certainly for web frontends. The performance bottleneck is always the database. | 8 | 24 | 0 | From the moment I have faced Python, the only thing I can say for it is "It is awesome". I am using Django framework and I am amazed by how quick things happen and how developer friendly this language is. But from many sides I hear that Python is a scripting language, and very useful for small things, experiments etc.
So the question is can a big and heavy loaded application be built in Python (and django)? As I mainly focus on web development, examples of such applications could be Stack Overflow, Facebook, Amazon etc.
P.S. According to many of the answers maybe I have to rephrase the question. There are several big applications working with Python (the best example is You Tube) so it can handle them but why then it is not so popular for large projects as (for example) Java, C++ and .NET? | Is Python good enough for big applications? | 0 | 0 | 0 | 21,901 |
3,700,413 | 2010-09-13T12:37:00.000 | 4 | 0 | 0 | 0 | python,django,web-applications | 3,700,480 | 12 | false | 1 | 0 | Python is ideal for web development. It's light, easy, and excels at gluing other bits together, and working with high level interfaces. If and when I do "web" development, I wouldn't use anything else.
Update0
It's also a superior language for scripting, small cross platform applications and prototyping. It only really starts to crumble when extreme performance requirements are stringent. That is, it's holding things up in a big way. I also find it's difficult to refactor (a property of dynamic typing), and to utilize platform specific bindings. These things can be worked around (quite easily, due to Python's C implementation, and numerous modules for this purpose), just as in most other good languages.
Python is the best high level language, the only language it can't replace is C. | 8 | 24 | 0 | From the moment I have faced Python, the only thing I can say for it is "It is awesome". I am using Django framework and I am amazed by how quick things happen and how developer friendly this language is. But from many sides I hear that Python is a scripting language, and very useful for small things, experiments etc.
So the question is can a big and heavy loaded application be built in Python (and django)? As I mainly focus on web development, examples of such applications could be Stack Overflow, Facebook, Amazon etc.
P.S. According to many of the answers maybe I have to rephrase the question. There are several big applications working with Python (the best example is You Tube) so it can handle them but why then it is not so popular for large projects as (for example) Java, C++ and .NET? | Is Python good enough for big applications? | 0.066568 | 0 | 0 | 21,901 |
3,701,646 | 2010-09-13T15:04:00.000 | 5 | 0 | 0 | 1 | python,windows,environment-variables,pythonpath | 15,379,528 | 22 | false | 1 | 0 | To augment PYTHONPATH, run regedit and navigate to KEY_LOCAL_MACHINE
\SOFTWARE\Python\PythonCore and then select the folder for the python
version you wish to use. Inside this is a folder labelled PythonPath,
with one entry that specifies the paths where the default install
stores modules. Right-click on PythonPath and choose to create a new
key. You may want to name the key after the project whose module
locations it will specify; this way, you can easily compartmentalize
and track your path modifications.
thanks | 5 | 435 | 0 | I have a directory which hosts all of my Django apps (C:\My_Projects). I want to add this directory to my PYTHONPATH so I can call the apps directly.
I tried adding C:\My_Projects\; to my Windows Path variable from the Windows GUI (My Computer > Properties > Advanced System Settings > Environment Variables). But it still doesn't read the coltrane module and generates this error:
Error: No module named coltrane | How to add to the PYTHONPATH in Windows, so it finds my modules/packages? | 0.045423 | 0 | 0 | 1,708,519 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.