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,641,152
2010-09-04T06:25:00.000
1
0
1
0
python,django,string,nlp
3,644,860
6
false
1
0
If some false positives/negatives are ok, search for bloom filter on wikipedia. If not look at CDB, (yum install tinycdb, in Fedora -- no python API atm).
2
9
0
Stackoverflow implemented its "Related Questions" feature by taking the title of the current question being asked and removing from it the 10,000 most common English words according to Google. The remaining words are then submitted as a fulltext search to find related questions. I want to do something similar in my Dja...
How to efficiently filter a string against a long list of words in Python/Django?
0.033321
0
0
4,500
3,641,152
2010-09-04T06:25:00.000
2
0
1
0
python,django,string,nlp
3,641,324
6
false
1
0
I think a much simpler solution and still reasonably fast is to use sqlite and regular expressions. Put the long list of words in an sqlite table and build a b-tree index. This gives you log(n) time exists queries. Split the smaller string with a regular expression and loop over the words running an exists query for ...
2
9
0
Stackoverflow implemented its "Related Questions" feature by taking the title of the current question being asked and removing from it the 10,000 most common English words according to Google. The remaining words are then submitted as a fulltext search to find related questions. I want to do something similar in my Dja...
How to efficiently filter a string against a long list of words in Python/Django?
0.066568
0
0
4,500
3,641,483
2010-09-04T08:35:00.000
7
0
0
0
python,django
3,641,584
3
true
1
0
this doesn't seem to be possible without changing the User model source code. Correct. Unless you are willing to change (or replace) User there isn't a way. One (tenuous, hackish) way to do this would be to attach an UserProfile for each User instance. Each User should have exactly one UserProfile. You can then add yo...
1
9
0
Django by default makes a primary key field on each model named "id", with a type of AutoField. On my models, I'm overriding this to use a custom UUIDField as the primary key by using the "primary_key" attribute. I would also like the User model in django.contrib.auth to have a UUIDField as the primary key, but this do...
django user model and custom primary key field
1.2
0
0
16,452
3,641,538
2010-09-04T08:54:00.000
2
0
0
1
python,google-app-engine
3,643,164
3
false
0
0
Just place the package's folder in the root directory of your GAE application, easy!
1
2
0
I understand that if you want to include external packages you have to include them in your project. So I was wondering how do you do this? Do people use one general script that auto imports them from a location. Maybe some kind of config file that lists all the external packages? Do you always zip the packages and us...
Google App Engine: Including external packages
0.132549
0
0
506
3,643,065
2010-09-04T16:20:00.000
3
0
1
0
python,regex,string
3,745,035
6
false
0
0
filter(str.isdigit, s) is faster and IMO clearer than anything else listed here. It will also throw a TypeError if s is a unicode type. Depending on what definition of "digits" you want, this can be more or less useful than the alternative filter(type(s).isdigit, s), slightly slower but still faster than the re and com...
1
10
0
I need to replace non-numeric chars from a string. For example, "8-4545-225-144" needs to be "84545225144"; "$334fdf890==-" must be "334890". How can I do this?
Replace non-numeric characters
0.099668
0
0
9,355
3,643,500
2010-09-04T18:35:00.000
-3
0
1
1
python,operating-system
8,959,919
11
false
0
0
Buddy, here is the answer you have been looking for: Writting an Operating System is not different than writting any other application, actually it is far easier than writing any other code for the reason an Operating System is an ALL-PURPOSE software or what is meant as a platform... and you know it!. All of the previ...
7
15
0
I have been asked to choose a project for my Operating System course at my university. I was bubbled with the idea of making an Operating System from scratch in Python. I have a few limitations: I have only 3 months. I want to do it in Python. I can put in say 20-30 hours every week into it. I want to know, how ...
Operating System from scratch
-0.054491
0
0
13,899
3,643,500
2010-09-04T18:35:00.000
16
0
1
1
python,operating-system
3,643,520
11
false
0
0
Scale this down a lot. I would recommend looking at one very small piece of an operating system that you would want to do, perhaps parallel processing. There is no feasible way you will be able to write an entire operating system in under 500 hours, let only 5000 hours. The real question is is this for an undergradua...
7
15
0
I have been asked to choose a project for my Operating System course at my university. I was bubbled with the idea of making an Operating System from scratch in Python. I have a few limitations: I have only 3 months. I want to do it in Python. I can put in say 20-30 hours every week into it. I want to know, how ...
Operating System from scratch
1
0
0
13,899
3,643,500
2010-09-04T18:35:00.000
9
0
1
1
python,operating-system
3,643,598
11
false
0
0
Does your professor require a "low-level" component in the project? For example, anything that deals with the hardware or the instruction architecture. If so, your professor will not allow you to do the project in Python. The project must be written in C and assembly. And you will invariably be working on modifying the...
7
15
0
I have been asked to choose a project for my Operating System course at my university. I was bubbled with the idea of making an Operating System from scratch in Python. I have a few limitations: I have only 3 months. I want to do it in Python. I can put in say 20-30 hours every week into it. I want to know, how ...
Operating System from scratch
1
0
0
13,899
3,643,500
2010-09-04T18:35:00.000
1
0
1
1
python,operating-system
3,644,442
11
false
0
0
You could probably code a small embedded-system OS in the timeframe you indicate, using concepts that are over a decade old. Many newer operating systems require many more complicated scheduling and memory-management heuristics than would be typical in a small embedded OS; designing an entire modern OS would not be a ...
7
15
0
I have been asked to choose a project for my Operating System course at my university. I was bubbled with the idea of making an Operating System from scratch in Python. I have a few limitations: I have only 3 months. I want to do it in Python. I can put in say 20-30 hours every week into it. I want to know, how ...
Operating System from scratch
0.01818
0
0
13,899
3,643,500
2010-09-04T18:35:00.000
0
0
1
1
python,operating-system
3,643,741
11
false
0
0
Developing an operating system in Python is possible. However, you might want to choose C or Assembly because there's an huge code base developed in those languages.
7
15
0
I have been asked to choose a project for my Operating System course at my university. I was bubbled with the idea of making an Operating System from scratch in Python. I have a few limitations: I have only 3 months. I want to do it in Python. I can put in say 20-30 hours every week into it. I want to know, how ...
Operating System from scratch
0
0
0
13,899
3,643,500
2010-09-04T18:35:00.000
2
0
1
1
python,operating-system
3,643,534
11
false
0
0
I don't get how you think you can write an operating system in Python. You need native code to at least load an interpreter during bootup, not to mention hardware communication, drivers etc., all of which would be nearly impossible to do given current Python interpreters when running on a bare machine. I'm also ponderi...
7
15
0
I have been asked to choose a project for my Operating System course at my university. I was bubbled with the idea of making an Operating System from scratch in Python. I have a few limitations: I have only 3 months. I want to do it in Python. I can put in say 20-30 hours every week into it. I want to know, how ...
Operating System from scratch
0.036348
0
0
13,899
3,643,500
2010-09-04T18:35:00.000
1
0
1
1
python,operating-system
3,644,477
11
false
0
0
In our university we have operating systems course where we too are supposed to develop something on linux. Not entire OS. We did our own scheduling policy and file system for linux. But this will be done in C since linux is in C.
7
15
0
I have been asked to choose a project for my Operating System course at my university. I was bubbled with the idea of making an Operating System from scratch in Python. I have a few limitations: I have only 3 months. I want to do it in Python. I can put in say 20-30 hours every week into it. I want to know, how ...
Operating System from scratch
0.01818
0
0
13,899
3,644,113
2010-09-04T21:43:00.000
0
0
0
0
python,windows,transparency,tkinter,alpha
3,644,372
2
true
0
1
If you change the override redirect flag you need to withdraw and then deiconify the window to give the window manager a chance to make the change. You might try that. Also, when you say "close out" the option menu top-level, what exactly do you mean? Are you sure destroying this second top-level window?
1
0
0
I have a python program that has no windows frame and doesn't show up in the taskbar because of self.overrideredirect(1). This program has an options menu (a top level widget) that allows for the alpha to be adjusted with self.attributes("-alpha", 0.85). However when I close out of the options menu my program shows up ...
Help with Tkinter Alpha
1.2
0
0
2,723
3,644,777
2010-09-05T02:32:00.000
2
0
0
0
python,pygtk
3,644,788
1
true
0
1
Answering my own question, it makes sense after 45 minutes of googling I solve my own problem 30 seconds after posting on StackOverflow. I needed to use the get_iter function, not the get_iter_from_string function.
1
1
0
I'm trying to retrieve the row data from a treemodel when the row_activated callback is fired. When row_activated is called, the 'path' variable it passes is a tuple. How do I easily use this tuple to retrieve an iter and ultimately the data itself? The treemodel class has a function to convert a string into an iter, b...
PyGTK treeview and row_activated callback
1.2
0
0
262
3,646,002
2010-09-05T12:11:00.000
6
0
0
0
python,django,frameworks,web2py,turbogears
4,338,367
7
false
1
0
I have to say as not particularly skilled developer, the speed at which I have been able to create using web2py has blown my mind. In large part due to the amazing community and the core value Massimo has of making the framework accessible. When I started I had written 0 lines of code in Python Never heard of web2py I'...
3
20
0
I got a project in mind that makes it worth to finally take the plunge into programming. After reading a lot of stuff, here and elsewhere, I'm set on making Python the one I learn for now, over C# or java. What convinced me the most was actually Paul Graham's excursions on programming languages and Lisp, though Arc is...
Django, Turbo Gears, Web2Py, which is better for what?
1
0
0
15,591
3,646,002
2010-09-05T12:11:00.000
2
0
0
0
python,django,frameworks,web2py,turbogears
15,945,257
7
false
1
0
I've used both web2py and RoR extensively, and while RoR has gotten a lot of popularity and support in the past few years, web2py is simpler, cleaner, less "magical", and yet also offers more (useful) out-of-the-box functionality. I'd say that web2py has more potential than RoR, but it is a relatively new framework and...
3
20
0
I got a project in mind that makes it worth to finally take the plunge into programming. After reading a lot of stuff, here and elsewhere, I'm set on making Python the one I learn for now, over C# or java. What convinced me the most was actually Paul Graham's excursions on programming languages and Lisp, though Arc is...
Django, Turbo Gears, Web2Py, which is better for what?
0.057081
0
0
15,591
3,646,002
2010-09-05T12:11:00.000
2
0
0
0
python,django,frameworks,web2py,turbogears
3,757,753
7
false
1
0
Django: Heard it has the best administrative interface. But uses it's own ORM, i.e. doesn't use SQL-Alchemy. Web2py: Didn't research this. Turbogears2: Uses SQL-Alchemy by default, uses Catwalk for admin interface, but documentation isn't as great. I chose Turbogears2 because it uses popular components, so I didn't h...
3
20
0
I got a project in mind that makes it worth to finally take the plunge into programming. After reading a lot of stuff, here and elsewhere, I'm set on making Python the one I learn for now, over C# or java. What convinced me the most was actually Paul Graham's excursions on programming languages and Lisp, though Arc is...
Django, Turbo Gears, Web2Py, which is better for what?
0.057081
0
0
15,591
3,646,205
2010-09-05T13:28:00.000
0
1
0
0
php,python,fastcgi
3,646,236
3
false
0
0
Python is compiled to bytecode when executed (the .pyc files), and the bytecode is kept around, not discarded. The compiled python is used instead of the source if it is present. Therefore, there is no need for additional opcode caching in python as it is already built in.
1
4
0
I'm a newbie to web technology, and still on a learning curve. Heard that, fastcgi would keep the compiled(interpreted) php code in memory, so why would one has to use op-code caching (apc or eaccelerators) for PHP? But I never heard of any such accelerators for Python. I'd expect as python and php are both interprete...
Why would one use accelerators with fastcgi for PHP?
0
0
0
583
3,647,368
2010-09-05T19:08:00.000
2
0
0
0
python,wxpython
3,647,374
3
true
0
1
If you run a .py file from the harddisk, the harddisk will be accessed. In your GUI, just import your code and it will be loaded once and you can access it later.
3
0
0
I am starting to use python,more. Is there a good way to keep python disk access to a minimum. Seems to me that everytime a *.py file runs, it hits a hard disk. Is there way to avoid hitting the harddisk, and keep *.py file in memory and access it there. Would creating a small gui using Wxframe, keep code in memory...
Python Software design
1.2
0
0
181
3,647,368
2010-09-05T19:08:00.000
2
0
0
0
python,wxpython
3,647,570
3
false
0
1
Modern operating systems cache file access pretty efficiently, as long as there is enough spare RAM available. You most likely won't notice any difference, fi you're not loading thousand of python files at once. And as always, before trying to optimize one aspect, make sure that this is really the bottleneck. Chances a...
3
0
0
I am starting to use python,more. Is there a good way to keep python disk access to a minimum. Seems to me that everytime a *.py file runs, it hits a hard disk. Is there way to avoid hitting the harddisk, and keep *.py file in memory and access it there. Would creating a small gui using Wxframe, keep code in memory...
Python Software design
0.132549
0
0
181
3,647,368
2010-09-05T19:08:00.000
0
0
0
0
python,wxpython
3,647,549
3
false
0
1
I think if you took the time to measure how much time it takes to load your python code from disk you would end up with a very, very tiny number unless you are doing something very wrong. And if you are doing something really wrong, solving that problem will be a better use of your time. Using wxpython to create a guy ...
3
0
0
I am starting to use python,more. Is there a good way to keep python disk access to a minimum. Seems to me that everytime a *.py file runs, it hits a hard disk. Is there way to avoid hitting the harddisk, and keep *.py file in memory and access it there. Would creating a small gui using Wxframe, keep code in memory...
Python Software design
0
0
0
181
3,647,518
2010-09-05T19:46:00.000
33
0
1
0
python,coding-style,pyqt,pyqt4,pep8
3,647,541
6
false
0
0
In your shoes, I wouldn't fight your framework, just like, as a general principle, I don't fight City Hall;-). I happen to share your preference for lowercase-with-underscore function names as PEP 8 specifies, but when I'm programming in a framework that forces a different capitalization style, I resign myself to adop...
4
35
0
I'm starting to use PyQt in some projects and I'm running into a stylistic dilemma. PyQt's functions use camel case, but PEP8, which I prefer to follow, says to use underscores and all lowercase for function names. So on the one hand, I can continue to follow PEP8, meaning that my code will have mixed functions calls ...
PEP8 and PyQt, how to reconcile function capitalization?
1
0
0
3,416
3,647,518
2010-09-05T19:46:00.000
6
0
1
0
python,coding-style,pyqt,pyqt4,pep8
3,647,555
6
false
0
0
Use what fits best. If you're subclassing Qt classes, or have a function heavily integrated with them UseCamelCase. Otherwise, use_underscores.
4
35
0
I'm starting to use PyQt in some projects and I'm running into a stylistic dilemma. PyQt's functions use camel case, but PEP8, which I prefer to follow, says to use underscores and all lowercase for function names. So on the one hand, I can continue to follow PEP8, meaning that my code will have mixed functions calls ...
PEP8 and PyQt, how to reconcile function capitalization?
1
0
0
3,416
3,647,518
2010-09-05T19:46:00.000
14
0
1
0
python,coding-style,pyqt,pyqt4,pep8
5,201,198
6
false
0
0
The pep8 document says what to do in this case (emphasis mine): New modules and packages (including third party frameworks) should be written to these standards, but where an existing library has a different style, internal consistency is preferred.
4
35
0
I'm starting to use PyQt in some projects and I'm running into a stylistic dilemma. PyQt's functions use camel case, but PEP8, which I prefer to follow, says to use underscores and all lowercase for function names. So on the one hand, I can continue to follow PEP8, meaning that my code will have mixed functions calls ...
PEP8 and PyQt, how to reconcile function capitalization?
1
0
0
3,416
3,647,518
2010-09-05T19:46:00.000
0
0
1
0
python,coding-style,pyqt,pyqt4,pep8
3,647,955
6
false
0
0
Maybe sensible use of modules to separate the styles in different modules can help. At least try to modularize basic PEP8 style code to own module of helper functions.
4
35
0
I'm starting to use PyQt in some projects and I'm running into a stylistic dilemma. PyQt's functions use camel case, but PEP8, which I prefer to follow, says to use underscores and all lowercase for function names. So on the one hand, I can continue to follow PEP8, meaning that my code will have mixed functions calls ...
PEP8 and PyQt, how to reconcile function capitalization?
0
0
0
3,416
3,647,692
2010-09-05T20:32:00.000
18
0
1
0
python,comparison,equality
3,647,786
4
false
0
0
== and is are always conceptually distinct: the former delegates to the left-hand object's __eq__ [1], the latter always checks identity, without any delegation. What seems to be confusing you is that object.__eq__ (which gets inherited by default by user-coded classes that don't override it, of course!) is implemente...
1
12
0
I noticed I can use the == operator to compare all the native data types (integers, strings, booleans, floating point numbers etc) and also lists, tuples, sets and dictionaries which contain native data types. In these cases the == operator checks if two objects are equal. But in some other cases (trying to compare ins...
When is the `==` operator not equivalent to the `is` operator? (Python)
1
0
0
4,561
3,648,339
2010-09-06T00:04:00.000
1
0
1
0
python,namespaces,module
3,648,494
4
false
0
0
Not sure if it is a good practice but maybe you could pass the objects and variables you need as parameters to the methods or classes you call in the imported module.
1
21
0
Specifically, I need to get at some objects and globals from the main module in an imported module. I know how to find those things when the parent module wants some particular thing from a child module, but I can't figure out how to go in the other direction.
In Python, how can I access the namespace of the main module from an imported module?
0.049958
0
0
8,627
3,648,525
2010-09-06T01:19:00.000
1
0
0
0
python,web-crawler,http-status-code-403
3,648,748
1
true
0
0
Looks like you've been blacklisted at the router level in that subnet, perhaps because you (or somebody else in the subnet) was violating terms of use, robots.txt, max crawling frequency as specified in a site-map, or something like that. The solution is not technical, but social: contact the webmaster, be properly apo...
1
0
0
i'm crawling an SNS with crawler written in python it works for a long time, but few days ago, the webpages got from my severs were ERROR 403 FORBIDDEN. i tried to change the cookie, change the browser, change the account, but all failed. and it seems that are the forbidden severs are in the same network segment. what ...
how to crawl a 403 forbidden SNS
1.2
0
1
2,076
3,649,577
2010-09-06T06:54:00.000
1
0
0
0
java,python
6,258,169
3
false
1
1
Edit the Setup.py and remove the /EHsc option.
1
3
0
I'm having a right old nightmare with JPype. I have got my dev env on Windows and so tried installing it there with no luck. I then tried on Ubunto also with no luck. I'm getting a bit desperate now. I am using Mingw32 since I tried installing VS2008 but it told me I had to install XP SP2 but I am on Vista. I tried VS2...
JPype compile problems
0.066568
1
0
3,736
3,649,607
2010-09-06T06:59:00.000
2
1
0
1
python,performance,caching,bytecode,web2py
3,649,957
2
false
1
0
I don't know web2py particularly, but it runs via WSGI like most other Python frameworks. This means that code is only interpreted when the process starts, and is otherwise kept in memory. Processes are dynamically started and killed by the web server itself, but usually last for multiple requests. In any case, the Pyt...
2
4
0
If so, What is the advantage ? (sure it will avoid restarting webserver). But isn't it a perfomance bottleneck? For production, is it possible to make web2py run directly from bytecode skipping interpreting stage (Caching) (except for the first request) ?
Is code interpreted at every call in Web2Py?
0.197375
0
0
814
3,649,607
2010-09-06T06:59:00.000
6
1
0
1
python,performance,caching,bytecode,web2py
3,653,081
2
false
1
0
In web2py, by default, all code in models, views and controllers (not web2py code, not code in modules imported by your models, views, controllers) is interpreted at every request. This allows to use a third party web server (for example apache) and still be able to see changes in your code reflected immediately withou...
2
4
0
If so, What is the advantage ? (sure it will avoid restarting webserver). But isn't it a perfomance bottleneck? For production, is it possible to make web2py run directly from bytecode skipping interpreting stage (Caching) (except for the first request) ?
Is code interpreted at every call in Web2Py?
1
0
0
814
3,650,194
2010-09-06T09:04:00.000
25
1
0
0
python,performance,numpy
3,650,761
3
false
0
0
You should use numpy function to deal with numpy's types and use regular python function to deal with regular python types. Worst performance usually occurs when mixing python builtins with numpy, because of types conversion. Those type conversion have been optimized lately, but it's still often better to not use them....
1
67
1
I have a function defined by a combination of basic math functions (abs, cosh, sinh, exp, ...). I was wondering if it makes a difference (in speed) to use, for example, numpy.abs() instead of abs()?
Are NumPy's math functions faster than Python's?
1
0
0
39,385
3,651,031
2010-09-06T11:23:00.000
1
0
0
0
python,ruby,unicode,xml-rpc
3,698,942
2
false
1
0
This issue comes from Kettle. My program is using Kettle to get an Excel file, get the active sheet and transfer the data in that sheet to TerminateOOOR for further handling. At the phase of reading data from Excel file, Kettle can not recognize the encoding then it gives bad data to TerminateOOOR. My work around sol...
1
1
0
I have to migrate data to OpenERP through XMLRPC by using TerminatOOOR. I send a name with value "Rotule right Aurélia". In Python the name with be encoded with value : 'Rotule right Aur\xc3\xa9lia ' But in TerminatOOOR (xmlrpc client) the data is encoded with value 'Rotule middle Aur\357\277\275lia' So in the server s...
Handling unicode data in XMLRPC
0.099668
0
1
1,981
3,651,125
2010-09-06T11:38:00.000
1
0
0
0
python,django
3,651,185
1
false
1
0
When i click 2nd page it again sending a request. Ideally it should not send the request. What do you mean by request? Is it a request to Google? Your application apparently does not cache the results. If your request to Google returns 100 pages then you should cache those hundred. When you request the second page th...
1
0
0
My google search application making a request each time while i am using paginator. Suppose i have a 100 records. Each page have to show 10 records so ten pages. When i click 2nd page it again sending a request. Ideally it should not send the request.
going to next page using django paginator sends request again.
0.197375
0
0
79
3,651,609
2010-09-06T12:55:00.000
5
0
0
1
python,database,google-app-engine,indexing
3,651,774
2
true
1
0
The App Engine SDK tracks this for its automatic index creation. Delete your index.yaml, then give your app a good workout. As long as you hit every distinct query in your testing, the SDK will generate a new index.yaml that contains only the indexes you need.
1
3
0
I have a App Engine/Python/Django application which has grown and been modified over the past year and currently has 175 indexes. The problem is that I have not been thourough in cleaning up/removing indexes that are no longer needed. Now, I am not sure which indexes are active and which are essentially dead, but I am...
Google App Engine - Tracking which indexes are used
1.2
0
0
226
3,653,239
2010-09-06T17:26:00.000
1
1
0
1
python,django,nginx,subdomain
3,653,270
2
false
0
0
I think directories are the way to go. I believe it would be easier to adapt Django to the directories way much easier than to subdomains. And as one user commented you can avoid restarting your server each time. I prefer to keep subdomains reserved for system use. Users should get their own directories instead. This i...
2
3
0
I'm currently building a web application and I would like my users to have their own URLs to identify them. I could either do this using subdomains or using folders and am wondering what are the advantages and disadvantages of either one. I really like the folder solution because my URL mapping would be fairly easy. I ...
Subdomains vs folders/directories
0.099668
0
0
286
3,653,239
2010-09-06T17:26:00.000
0
1
0
1
python,django,nginx,subdomain
3,653,257
2
false
0
0
Use something like mod_wsgi instead of cgi scripts, they allow you to use arbitrary URL configs (example: Django, web.py, Zope ...)
2
3
0
I'm currently building a web application and I would like my users to have their own URLs to identify them. I could either do this using subdomains or using folders and am wondering what are the advantages and disadvantages of either one. I really like the folder solution because my URL mapping would be fairly easy. I ...
Subdomains vs folders/directories
0
0
0
286
3,654,770
2010-09-06T23:12:00.000
1
0
1
0
c++,python
30,151,439
6
false
0
0
Look at bintrees module (pip install bintrees). This package provides Binary- RedBlack- and AVL-Trees written in Python and Cython/C.
3
29
0
Is there a structure in Python which supports similar operations to C++ STL map and complexity of operations correspond to C++ STL map?
Is there a structure in Python similar to C++ STL map?
0.033321
0
0
25,127
3,654,770
2010-09-06T23:12:00.000
18
0
1
0
c++,python
3,654,782
6
true
0
0
dict is usually close enough - what do you want that it doesn't do? If the answer is "provide order", then what's actually wrong with for k in sorted(d.keys())? Uses too much memory, maybe? If you're doing lots of ordered traversals interspersed with inserts then OK, point taken, you really do want a tree. dict is actu...
3
29
0
Is there a structure in Python which supports similar operations to C++ STL map and complexity of operations correspond to C++ STL map?
Is there a structure in Python similar to C++ STL map?
1.2
0
0
25,127
3,654,770
2010-09-06T23:12:00.000
9
0
1
0
c++,python
3,654,778
6
false
0
0
I believe that the standard python type dict() will do the trick in most cases. The difference from C++'s std::map is that dict is impemented as a hash map and C++'s map is tree-based.
3
29
0
Is there a structure in Python which supports similar operations to C++ STL map and complexity of operations correspond to C++ STL map?
Is there a structure in Python similar to C++ STL map?
1
0
0
25,127
3,654,830
2010-09-06T23:29:00.000
492
0
1
0
python,operators
3,654,936
21
true
0
0
It's not because it doesn't make sense; it makes perfect sense to define "x++" as "x += 1, evaluating to the previous binding of x". If you want to know the original reason, you'll have to either wade through old Python mailing lists or ask somebody who was there (eg. Guido), but it's easy enough to justify after the f...
9
493
0
Why are there no ++ and -- operators in Python?
Why are there no ++ and --​ operators in Python?
1.2
0
0
319,375
3,654,830
2010-09-06T23:29:00.000
0
0
1
0
python,operators
71,851,212
21
false
0
0
This is not the answer, (just a log from me) but I believe: it should be there. It is true that there is a python way of doing things and it is not needed for loop counters, However: there are few cases where one needs to manipulate other variable besides the one which is looping. Looking at views for this thread.. the...
9
493
0
Why are there no ++ and -- operators in Python?
Why are there no ++ and --​ operators in Python?
0
0
0
319,375
3,654,830
2010-09-06T23:29:00.000
1
0
1
0
python,operators
3,654,981
21
false
0
0
Maybe a better question would be to ask why do these operators exist in C. K&R calls increment and decrement operators 'unusual' (Section 2.8page 46). The Introduction calls them 'more concise and often more efficient'. I suspect that the fact that these operations always come up in pointer manipulation also has played...
9
493
0
Why are there no ++ and -- operators in Python?
Why are there no ++ and --​ operators in Python?
0.009524
0
0
319,375
3,654,830
2010-09-06T23:29:00.000
68
0
1
0
python,operators
3,661,417
21
false
0
0
I always assumed it had to do with this line of the zen of python: There should be one — and preferably only one — obvious way to do it. x++ and x+=1 do the exact same thing, so there is no reason to have both.
9
493
0
Why are there no ++ and -- operators in Python?
Why are there no ++ and --​ operators in Python?
1
0
0
319,375
3,654,830
2010-09-06T23:29:00.000
17
0
1
0
python,operators
3,655,022
21
false
0
0
Because, in Python, integers are immutable (int's += actually returns a different object). Also, with ++/-- you need to worry about pre- versus post- increment/decrement, and it takes only one more keystroke to write x+=1. In other words, it avoids potential confusion at the expense of very little gain.
9
493
0
Why are there no ++ and -- operators in Python?
Why are there no ++ and --​ operators in Python?
1
0
0
319,375
3,654,830
2010-09-06T23:29:00.000
6
0
1
0
python,operators
3,654,980
21
false
0
0
I'm very new to python but I suspect the reason is because of the emphasis between mutable and immutable objects within the language. Now, I know that x++ can easily be interpreted as x = x + 1, but it LOOKS like you're incrementing in-place an object which could be immutable. Just my guess/feeling/hunch.
9
493
0
Why are there no ++ and -- operators in Python?
Why are there no ++ and --​ operators in Python?
1
0
0
319,375
3,654,830
2010-09-06T23:29:00.000
2
0
1
0
python,operators
21,724,247
21
false
0
0
The ++ class of operators are expressions with side effects. This is something generally not found in Python. For the same reason an assignment is not an expression in Python, thus preventing the common if (a = f(...)) { /* using a here */ } idiom. Lastly I suspect that there operator are not very consistent with Pytho...
9
493
0
Why are there no ++ and -- operators in Python?
Why are there no ++ and --​ operators in Python?
0.019045
0
0
319,375
3,654,830
2010-09-06T23:29:00.000
1
0
1
0
python,operators
17,702,839
21
false
0
0
as i understood it so you won't think the value in memory is changed. in c when you do x++ the value of x in memory changes. but in python all numbers are immutable hence the address that x pointed as still has x not x+1. when you write x++ you would think that x change what really happens is that x refrence is changed...
9
493
0
Why are there no ++ and -- operators in Python?
Why are there no ++ and --​ operators in Python?
0.009524
0
0
319,375
3,654,830
2010-09-06T23:29:00.000
3
0
1
0
python,operators
3,657,707
21
false
0
0
I believe it stems from the Python creed that "explicit is better than implicit".
9
493
0
Why are there no ++ and -- operators in Python?
Why are there no ++ and --​ operators in Python?
0.028564
0
0
319,375
3,655,306
2010-09-07T02:06:00.000
7
0
0
1
python,ubuntu-9.04
66,512,967
7
false
0
0
@mchid's answer is the one you should go for it. just FYI, if you do this: $ python it will say Command 'python' not found ... But if you do this: $ python3, it should work. So, just modify the shebang line from !#/usr/bin/env python to !#/usr/bin/env python3, you're good to go. (which is automatically done by doing su...
1
91
0
I update the kernel, after that the Ubuntu doesn't work well, PS: I try to exec "meld" command, it will report that "/usr/bin/env: python: No such file or directory", then I exec "sudo apt-get install python" and get the result "python is already the newest version.", what should I do for it. I'm not good at linux, c...
ubuntu /usr/bin/env: python: No such file or directory
1
0
0
161,757
3,656,500
2010-09-07T07:16:00.000
0
1
0
1
python
3,656,550
3
false
0
0
Just some basic ideas, with important python functions for that: read the file; open go through all lines and sum up the number of occurences of a line; for, dict in case you only want to check parts of a command (for example treat cd XY and cd .. the same), normalize the lines by removing the command arguments after ...
1
1
0
I want to write a python script which reads the '.bash_history' file and prints the statistics. Also, I would like to print the command which was used the most. I was able to read the bash history through the terminal but I'm not able to do it through python programming. Can someone please help me with how to start wit...
reading .bash_history file through python script
0
0
0
696
3,657,165
2010-09-07T08:51:00.000
1
1
0
0
python
3,657,249
3
false
0
0
grep your codebase for from xml import or import xml.
1
2
0
I have a python code base and want to know whether pyxml is really used in the code any where. The python version i have is 2.6. pyxml's last binary distribution ended with 2.4 python version. Any clues or ideas to judge the code whether it is free of pyxml 0.8.4 on python 2.6 ? Thanks in Advance.
Best way to know that my Python Code base is using PyXML or not?
0.066568
0
0
364
3,657,271
2010-09-07T09:07:00.000
1
0
0
1
python,sql-server,twisted
4,059,366
2
false
0
0
If you want to have portable mssql server library, you can try the module from www.pytds.com. It works with 2.5+ and 3.1, have a good stored procedure support. It's api is more "functional", and has some good features you won't find anywhere else.
1
0
0
I have a Twisted application that runs in an x86 64bit machine with Win 2008 server. It needs to be connected to a SQL Server database that runs in another machine (in a cloud actually but I have IP, port, db name, credentials). Do I need to install anything more that Twisted to my machine? And which API should be use...
Twisted and connection to SQL Server
0.099668
1
0
1,128
3,657,955
2010-09-07T10:51:00.000
2
0
1
1
python,debugging,command-line,runpy
3,658,022
4
false
0
0
Do you have control over another.py? It would be a good idea to change it and add a main() method. Main() can then be invoked if __name__ == '__main__'. This will alleviate your problems a great deal. It is also unit testing friendly.
1
11
0
You have wrapper python script that is calling another python script, currently using os.system('python another.py some-params'). You want to be able to debug both scripts and if you use os.system() you'll loose the debugger, so it does make sense to load the second script using the same interpretor instead of starting...
How to execute another python script from your script and be able to debug?
0.099668
0
0
7,883
3,659,382
2010-09-07T14:07:00.000
1
0
0
1
python,windows,streaming,gstreamer
3,661,651
2
true
0
0
For Windows streaming, I would suggest VLC.
1
0
0
I very new to the world of gstreamer. I was wondering, if it's possible to stream windows webcam via gstreamer? The only package i have seen so far is for linux. v4l2 (video for linux). Is there also a package for windows webcams? what is the correct python syntax? DJ
Is it possible to stream a windows (7 / vista / xp) webcams via Gstreamer
1.2
0
0
1,416
3,659,687
2010-09-07T14:41:00.000
1
0
0
0
php,python,ruby-on-rails,django,zend-framework
3,660,249
7
false
1
0
A web framework is supposed to provide means to handle certain kind of interaction. If you have site with no interaction or no "adaptation", you don't need either framework or programming language, you simply write HTML files and publish your files. As you start to add features for the back-end (like publishing more pl...
6
3
0
When a Web framework ( like django, ruby on rails, zend, etc ) isn't convenient to use ? And so... When a Web programming language ( like PHP, Asp, Python, etc ) is better than a Web Framework ?
When a Web framework isn't convenient to use?
0.028564
0
0
295
3,659,687
2010-09-07T14:41:00.000
0
0
0
0
php,python,ruby-on-rails,django,zend-framework
3,659,996
7
false
1
0
I'm at that stage where, because I spent so much time learning a framework recently, even if I do a one page "website", I will still use one, need to get my ROI up :p
6
3
0
When a Web framework ( like django, ruby on rails, zend, etc ) isn't convenient to use ? And so... When a Web programming language ( like PHP, Asp, Python, etc ) is better than a Web Framework ?
When a Web framework isn't convenient to use?
0
0
0
295
3,659,687
2010-09-07T14:41:00.000
0
0
0
0
php,python,ruby-on-rails,django,zend-framework
3,659,760
7
false
1
0
When you have to build a very complex site, and the functionality is already exists in a CMS (eg Drupal, it has amazingly lot contrib for everything).
6
3
0
When a Web framework ( like django, ruby on rails, zend, etc ) isn't convenient to use ? And so... When a Web programming language ( like PHP, Asp, Python, etc ) is better than a Web Framework ?
When a Web framework isn't convenient to use?
0
0
0
295
3,659,687
2010-09-07T14:41:00.000
1
0
0
0
php,python,ruby-on-rails,django,zend-framework
3,659,776
7
false
1
0
The rule that I have is that if whatever I'm building is only going to be a single page, I'll usually do it in just PHP. Whenever I need more than one page, I go with a framework (Symfony), because that usually means that I'm going to want things like routing and proper dispatching of requests. This does however depend...
6
3
0
When a Web framework ( like django, ruby on rails, zend, etc ) isn't convenient to use ? And so... When a Web programming language ( like PHP, Asp, Python, etc ) is better than a Web Framework ?
When a Web framework isn't convenient to use?
0.028564
0
0
295
3,659,687
2010-09-07T14:41:00.000
3
0
0
0
php,python,ruby-on-rails,django,zend-framework
3,659,712
7
false
1
0
You don't need frameworks when you don't plan to use their features.
6
3
0
When a Web framework ( like django, ruby on rails, zend, etc ) isn't convenient to use ? And so... When a Web programming language ( like PHP, Asp, Python, etc ) is better than a Web Framework ?
When a Web framework isn't convenient to use?
0.085505
0
0
295
3,659,687
2010-09-07T14:41:00.000
1
0
0
0
php,python,ruby-on-rails,django,zend-framework
3,659,725
7
false
1
0
The difference is, in my opinion, the simpleness of what you are trying to build. Are you trying to make a difficult, complicated web app, or are you making a simple script that performs a trivial task? In the first case you absolutely need a framework, in the second case.. don't even bother.
6
3
0
When a Web framework ( like django, ruby on rails, zend, etc ) isn't convenient to use ? And so... When a Web programming language ( like PHP, Asp, Python, etc ) is better than a Web Framework ?
When a Web framework isn't convenient to use?
0.028564
0
0
295
3,660,503
2010-09-07T16:17:00.000
2
1
1
0
python
3,660,592
2
false
0
0
This is pretty much the same as for any language. What projects have you done with Python? What is your favorite Python reference? Have you worked with other people on code written in Python? That's how I would judge. If I wanted to test, it would depend on whether I were looking for someone to write in 2.x or 3.x. S...
2
0
0
If you had to judge someones level of Python understand in just 3 questions, what would you ask?
Top 3 questions to test someones Python level, what would they be?
0.197375
0
0
1,711
3,660,503
2010-09-07T16:17:00.000
1
1
1
0
python
3,660,564
2
false
0
0
Explain generators. Write unit tests for <important-piece-of-code>. Who is Alex Martelli?
2
0
0
If you had to judge someones level of Python understand in just 3 questions, what would you ask?
Top 3 questions to test someones Python level, what would they be?
0.099668
0
0
1,711
3,661,827
2010-09-07T19:06:00.000
1
0
0
0
ironpython
3,661,888
2
false
1
0
I would definitely try to limit the number of script engines you instantiate. It is a slow process (from my experience), so the fewer times you have to wait for it, the better. On that note, I would be careful with only 1. I think that scripts might (just might) have the potential to interfere with eachother if you hav...
2
3
0
Generally speaking, should I keep one ScriptEngine for the life of the application or should I create and destroy them as needed?
IronPython: How many script engines should I have?
0.099668
0
0
401
3,661,827
2010-09-07T19:06:00.000
3
0
0
0
ironpython
3,664,939
2
true
1
0
One ScriptEngine per AppDomain is fine. To isolate your scripts, make sure that each one is executed in its own ScriptScope. By reusing the ScriptEngine, IronPython won't have to recompile any imported modules, which is generally the slowest part of IronPython, especially if they are short-running scripts.
2
3
0
Generally speaking, should I keep one ScriptEngine for the life of the application or should I create and destroy them as needed?
IronPython: How many script engines should I have?
1.2
0
0
401
3,662,134
2010-09-07T19:47:00.000
4
0
0
0
python,oop
3,662,258
3
false
0
0
It's propably just me and my FP fetish, but I think a function executed solely for side effects is very different from a non-destructive function that fetches some data, and therefore have different names. Especially if the generic function would do something different depending on exactly that (the part on the commit ...
1
3
0
I'm creating a basic database utility class in Python. I'm refactoring an old module into a class. I'm now working on an executeQuery() function, and I'm unsure of whether to keep the old design or change it. Here are the 2 options: (The old design:) Have one generic executeQuery method that takes the query to execute...
Design question in Python: should this be one generic function or two specific ones?
0.26052
1
0
174
3,662,475
2010-09-07T20:30:00.000
1
0
1
0
python
3,666,355
12
false
0
0
Python does not have arrays. It has other sequence types ranging from lists to dictionaries without forgetting sets - the right one depends on your specific needs. Assuming your "array" is actually a list, and "initialize" means allocate a list of lists of NxM elements, you can (pseudocode): for N times: for M times: ...
1
9
0
Is there a way in Python to initialize a multi-dimensional array / list without using a loop?
Python multi-dimensional array initialization without a loop
0.016665
0
0
31,050
3,664,016
2010-09-08T01:27:00.000
1
1
0
0
php,c++,python,web-crawler
3,664,065
7
false
0
0
You could consider using a combination of python and PyGtkMozEmbed or PyWebKitGtk plus javascript to create your spider. The spidering could be done in javascript after the page and all other scripts have loaded. You'd have one of the few web spiders that supports javascript, and might pick up some hidden stuff the oth...
4
3
0
I have substantial PHP experience, although I realize that PHP probably isn't the best language for a large-scale web crawler because a process can't run indefinitely. What languages do people suggest?
What languages are good for writing a web crawler?
0.028564
0
1
6,849
3,664,016
2010-09-08T01:27:00.000
-3
1
0
0
php,c++,python,web-crawler
3,664,086
7
false
0
0
C# and C++ are probably the best two languages for this, it's just a matter of which you know better and which is faster (C# is probably easier). I wouldn't recommend Python, Javascript, or PHP. They will usually be slower in text processing compared to a C-family language. If you're looking to crawl any significant ch...
4
3
0
I have substantial PHP experience, although I realize that PHP probably isn't the best language for a large-scale web crawler because a process can't run indefinitely. What languages do people suggest?
What languages are good for writing a web crawler?
-0.085505
0
1
6,849
3,664,016
2010-09-08T01:27:00.000
6
1
0
0
php,c++,python,web-crawler
3,664,054
7
false
0
0
Any language you can easily use with a good network library and support for parsing the formats you want to crawl. Those are really the only qualifications.
4
3
0
I have substantial PHP experience, although I realize that PHP probably isn't the best language for a large-scale web crawler because a process can't run indefinitely. What languages do people suggest?
What languages are good for writing a web crawler?
1
0
1
6,849
3,664,016
2010-09-08T01:27:00.000
0
1
0
0
php,c++,python,web-crawler
3,664,049
7
true
0
0
C++ - if you know what you're doing. You will not need a web server and a web application, because a web crawler is just a client, after all.
4
3
0
I have substantial PHP experience, although I realize that PHP probably isn't the best language for a large-scale web crawler because a process can't run indefinitely. What languages do people suggest?
What languages are good for writing a web crawler?
1.2
0
1
6,849
3,664,438
2010-09-08T03:23:00.000
2
1
0
0
python,email,smtp,vmware
3,668,622
1
true
0
0
The phrase "...because the target machine actively refused it" usually means there's a firewall that drops any unauthorized connections. Is there a firewall service on the SMTP server that's blocking the WinXP VM's IP address? Or, more likely: Is the SMTP server not configured to accept relays from the WinXP VM's IP ad...
1
1
0
I m trying to use smtp class from Python 2.6.4 to send smtp email from a WinXP VMware machine. After the send method is called, I always got this error: socket.error: [Errno 10061] No connection could be made because the target machine actively refused it. Few stuff I noticed: The same code works in the physical WinXP...
Python smtp connection is always failed in a VMware Windows machine
1.2
0
1
828
3,664,519
2010-09-08T03:48:00.000
0
0
0
0
python,django,security,permissions,chat
3,664,632
1
false
1
0
I think I could just make a room model with a ManytoMany Field indicating users, a queue for the chat history, and as users leave, I'd just remove their username from that model. So, when submitting post requests, I could just use the cookie in django.contrib.auth for sessions to validate data transfer. I think that sh...
1
1
0
If I wanted to implement some sort of chat tool in my django webapp, implemented with basic ajax polling as opposed to comet, what should I do to secure it, besides running over SSL. Should I just use the permissions app for each chat session and generate a random token to be accessed in my urlconf? Are there better/di...
Django Permissions and Security for Basic Chat App
0
0
0
154
3,665,656
2010-09-08T07:55:00.000
17
1
1
0
python,ruby,oop
3,665,937
4
false
0
0
One example that's commonly given is len, which in Python is a built-in function. You may implement a special __len__ method in your objects which will be called by len, but len is still a function. In Ruby, objects just have the .length property/method so it appears more object oriented when you say obj.length rather ...
2
23
0
Matz, who invented Ruby, said that he designed the language to be more object-oriented than Python. How is Ruby more object-oriented than Python?
How is Ruby more object-oriented than Python?
1
0
0
5,970
3,665,656
2010-09-08T07:55:00.000
-2
1
1
0
python,ruby,oop
3,666,873
4
false
0
0
It's simple, nearly everything in Ruby (including numbers) is an object; there are no scalar values.
2
23
0
Matz, who invented Ruby, said that he designed the language to be more object-oriented than Python. How is Ruby more object-oriented than Python?
How is Ruby more object-oriented than Python?
-0.099668
0
0
5,970
3,666,328
2010-09-08T09:31:00.000
0
0
0
0
python,string,sqlite,unicode
25,273,292
3
false
0
0
Use Python 3.2+. It will automatically return string instead of unicode (as in Python 2.7)
2
3
0
AFAIK SQLite returns unicode objects for TEXT in Python. Is it possible to get SQLite to return string objects instead?
Can I get SQLite to string instead of unicode for TEXT in Python?
0
1
0
7,275
3,666,328
2010-09-08T09:31:00.000
4
0
0
0
python,string,sqlite,unicode
3,666,433
3
false
0
0
TEXT is intended to store text. Use BLOB if you want to store bytes.
2
3
0
AFAIK SQLite returns unicode objects for TEXT in Python. Is it possible to get SQLite to return string objects instead?
Can I get SQLite to string instead of unicode for TEXT in Python?
0.26052
1
0
7,275
3,666,676
2010-09-08T10:17:00.000
0
0
0
0
python,single-sign-on,plone,zope
3,698,638
2
false
1
0
If both sites are on the same domain (but different subdomain), you can try to set the cookie on ".domain.tld". But I'm not sure if that will work - sending the original credentials as cookies is highly insecure, a session should be used in stead, and you can't share this session between two different instances. Have y...
1
2
0
I'm installing an environment where I had two Zope/Plone servers: plone1 -> for web content & user authentication plone2 -> for web applications I want to implement SSO around both servers but I don't know how to do it. I try to modify login_next and setAuthCookie(..) to share the __ac cookie in the domain, but didn'...
Two Zope/Plone machines and SSO
0
0
0
560
3,666,750
2010-09-08T10:27:00.000
0
0
1
0
python,version,backwards-compatibility
3,668,628
2
false
0
0
Mac OS X 10.6 (Snow Leopard) has 2.6.1 as the installed version. IIRC, 10.5 (Leopard) has 2.5 as the installed version.
1
5
0
Is there an officially updated recommendation indicating which versions of Python should be supported by released modules? Or perhaps a page giving a survey of production usage of various versions? It's difficult to know how much use to make of newish features like context managers, class decorators, etc. when writin...
earliest commonly used version of Python
0
0
0
323
3,668,373
2010-09-08T13:50:00.000
2
0
1
0
python,dll,static-libraries
3,668,484
4
false
0
0
Unfortunately, no. Dynamic Link Libraries are required for runtime loading.
2
9
0
is it possible to import modules from .lib library to Python program (as simple as .dll)?
Static library (.lib) to Python project
0.099668
0
0
8,992
3,668,373
2010-09-08T13:50:00.000
4
0
1
0
python,dll,static-libraries
3,677,075
4
false
0
0
In theory, yes; in practice, probably not -- and certainly not as simply as a DLL. Static libraries are essentially just collections of object files, and need a full linker to correctly resolve all relocation references they may contain. It might be possible to take your static library and simply link its contents to...
2
9
0
is it possible to import modules from .lib library to Python program (as simple as .dll)?
Static library (.lib) to Python project
0.197375
0
0
8,992
3,671,466
2010-09-08T20:06:00.000
0
0
0
1
python,linux,binary,compilation
3,674,482
3
false
0
0
In linux, try to avoid such things. Most package managers handle dependencies quite fine, just distribute your script and tell what dependencies it needs.
1
7
0
So I have a python script that relies on a couple modules. Specifically pexpect and pyinoitify. I know you can compile a python script into a .exe in windows, but is there something relatively equivalent in linux? I don't care about it being a binary, I'd just like to be able to distribute my script without requiring t...
compile python script in linux
0
0
0
12,788
3,671,535
2010-09-08T20:14:00.000
2
0
0
1
python,pylons,cassandra
3,687,133
2
true
0
0
Well. I worked a little more. In fact, using a connection manager was probably not a good idea as this should be the template context. Additionally, opening a connection for each thread is not really a big deal. Opening a connection per request would be. I ended up with just pycassa.connect_thread_local() in app_global...
1
10
0
I created a new Pylons project, and would like to use Cassandra as my database server. I plan on using Pycassa to be able to use cassandra 0.7beta. Unfortunately, I don't know where to instantiate the connection to make it available in my application. The goal would be to : Create a pool when the application is launc...
How to connect to Cassandra inside a Pylons app?
1.2
1
0
885
3,672,330
2010-09-08T22:19:00.000
5
0
1
0
python,list,trim
3,672,351
4
false
0
0
Is that a list of strings or tuples? Assuming they're tuples: [t[0] for t in [('ABC', ), ('Abc', ), ('xyz', ), ('ABC', ), ('Abc', )]]
1
0
0
I have this: Lt = [('ABC', ), ('Abc', ), ('xyz', ), ('ABC', ), ('Abc', )] I want this: Lt = ('Abc', 'Abc', 'xyz', 'ABC', 'ABc') remove the extra "(",")" and ",".... How do i do this.
Python: Trim a list
0.244919
0
0
1,820
3,673,418
2010-09-09T02:43:00.000
0
0
0
0
python,wxpython
3,677,070
2
false
0
1
I usually use my close button's event handler to close connections and what-not before closing the frame. If you want to catch the upper right "x" button, then you'll need to bind to EVT_CLOSE. Unfortunately, when you do that, you need to call your frame's Destroy() method rather than its Close() method or you'll end u...
1
2
0
I'm working on a wxPython app which has multiple frames and a serial connection. I need to be able to exit the app cleanly, closing the serial connection as the app terminates. What is the best way to do this? Should this be handled by a subclass of wxApp? Thanks, Josh
Terminating a wxPython app cleanly
0
0
0
1,263
3,673,487
2010-09-09T03:04:00.000
15
0
1
0
python
3,673,678
11
true
0
0
I'd say the main reason is because Python isn't horribly verbose like, e.g., Java. You don't need an IDE to generate 100s of lines of boilerplate because you don't need 100s of lines of boilerplate in Python. You tend to automate stuff within the language instead of further up the toolchain. A second reason is that y...
9
10
0
I have heard before that many Python developers don't use an IDE like Eclipse because it is unnecessary with a language like Python. What are the reasons people use to justify this claim?
Why don't you need a powerful ide for writing Python?
1.2
0
0
3,313
3,673,487
2010-09-09T03:04:00.000
1
0
1
0
python
3,673,779
11
false
0
0
Python uses dynamic typing and interpreting, rather than compiling. The interpreter itself will output comprehensive error messages, similar to Perl. If you look at dynamically typed programming languages in general, you'll find that most of them are not really suitable for IDEs. RAD components (code completion, code g...
9
10
0
I have heard before that many Python developers don't use an IDE like Eclipse because it is unnecessary with a language like Python. What are the reasons people use to justify this claim?
Why don't you need a powerful ide for writing Python?
0.01818
0
0
3,313
3,673,487
2010-09-09T03:04:00.000
1
0
1
0
python
3,673,506
11
false
0
0
Python is dynamically typed and the way it handles modules as objects makes it impossible to determine what a name will resolve to at a certain time without actually running the code. Therefore, the 'tab completion' feature of IDEs is pretty useless. Also, since Python doesn't have a build step, an IDE isn't needed to ...
9
10
0
I have heard before that many Python developers don't use an IDE like Eclipse because it is unnecessary with a language like Python. What are the reasons people use to justify this claim?
Why don't you need a powerful ide for writing Python?
0.01818
0
0
3,313
3,673,487
2010-09-09T03:04:00.000
0
0
1
0
python
3,673,557
11
false
0
0
Well I use an IDE when programming in Python on my computer. Its easier that way . But when on the run or on university's terminal , I prefer terminal .
9
10
0
I have heard before that many Python developers don't use an IDE like Eclipse because it is unnecessary with a language like Python. What are the reasons people use to justify this claim?
Why don't you need a powerful ide for writing Python?
0
0
0
3,313
3,673,487
2010-09-09T03:04:00.000
1
0
1
0
python
3,673,659
11
false
0
0
IDE's assist in developer productivity and can equally apply to Python. The defining thing about an IDE is the ability to not have to "mode switch" between tasks such as editing, compiling, testing, running and debugging etc.
9
10
0
I have heard before that many Python developers don't use an IDE like Eclipse because it is unnecessary with a language like Python. What are the reasons people use to justify this claim?
Why don't you need a powerful ide for writing Python?
0.01818
0
0
3,313
3,673,487
2010-09-09T03:04:00.000
0
0
1
0
python
3,673,739
11
false
0
0
I'm still fairly new to Python and use an IDE with code completion but find myself rarely needing it, Python does a really good job of not having an uncessarily large number of verbose calls, as dsimcha pointed out above. I find that just using a basic IDE I can work efficiently in it and the fact that the code is a lo...
9
10
0
I have heard before that many Python developers don't use an IDE like Eclipse because it is unnecessary with a language like Python. What are the reasons people use to justify this claim?
Why don't you need a powerful ide for writing Python?
0
0
0
3,313
3,673,487
2010-09-09T03:04:00.000
0
0
1
0
python
3,673,832
11
false
0
0
The problems is IDEs dont work very well with dynamic languages. The IDE cannot second guess runtime duck typing so other than some basic syntax checking and displaying the keywords in pretty colours they ar enot much help. My personal experience is with groovy and eclipse where eclipse is actually pretty annoying. Met...
9
10
0
I have heard before that many Python developers don't use an IDE like Eclipse because it is unnecessary with a language like Python. What are the reasons people use to justify this claim?
Why don't you need a powerful ide for writing Python?
0
0
0
3,313
3,673,487
2010-09-09T03:04:00.000
2
0
1
0
python
3,674,002
11
false
0
0
Two Main Reasons Because of the dynamic typing and generally super-powerful functionality, there just isn't much extra typing that the IDE can do for you. Implementing a Java interface in a package is a lot of work and dozens of lines of boilerplate. In Python or Ruby it just doesn't have to be typed in the first pla...
9
10
0
I have heard before that many Python developers don't use an IDE like Eclipse because it is unnecessary with a language like Python. What are the reasons people use to justify this claim?
Why don't you need a powerful ide for writing Python?
0.036348
0
0
3,313
3,673,487
2010-09-09T03:04:00.000
1
0
1
0
python
3,673,648
11
false
0
0
It sounds like 'You don't need vehicle to go to work' to me. It might be true or not, depends on how far your workplace is.
9
10
0
I have heard before that many Python developers don't use an IDE like Eclipse because it is unnecessary with a language like Python. What are the reasons people use to justify this claim?
Why don't you need a powerful ide for writing Python?
0.01818
0
0
3,313
3,674,568
2010-09-09T07:27:00.000
0
0
1
0
php,python,mysql,ruby-on-rails
3,675,235
3
false
1
0
I would go the vitual road (VMware or virtual box). Multiple enviroments have a lot of dependencies, so its just much much easier with vitual hosts.
2
0
0
Beginner here, stuck wondering what I need to do to learn development in different web environments. Say, for instance I want to play around in PHP & MySQL. But I also want to try things with Ruby on Rails and maybe even server things with Python. Do I need a different environment for each platform? Am I required t...
Multiple Web Development Environments on Windows
0
0
0
225
3,674,568
2010-09-09T07:27:00.000
1
0
1
0
php,python,mysql,ruby-on-rails
3,675,212
3
true
1
0
I started off with php and mysql, it's a lower-level then the rest of the environments like Django and Ruby on Rails; so it's much easier to understand what is really happening. If you want to get into web development, php is a solid foundation and has easy bundle installers such as WAMP, and has a massive community. ...
2
0
0
Beginner here, stuck wondering what I need to do to learn development in different web environments. Say, for instance I want to play around in PHP & MySQL. But I also want to try things with Ruby on Rails and maybe even server things with Python. Do I need a different environment for each platform? Am I required t...
Multiple Web Development Environments on Windows
1.2
0
0
225
3,675,659
2010-09-09T10:17:00.000
2
0
0
1
java,python,linux,perl,tcl
3,675,682
5
false
0
0
On Linux you should use the distribution's native package format (DEB, RPM, …) to deploy applications. The package managers included in the distributions can handle dependencies automatically. Apart from that, I think Perl is the only language that is available in most Linux systems out of the box. Python is very popul...
1
1
0
When deploy java app on linux, we don't need to install anything, all third-party libs are jar files and we only update classpath in script file. But java needs jre which is quite large. So is there any other language supported by linux can do that? By default our server only support perl/python/tcl, no gcc available, ...
which language (python/perl/tcl) on linux doesn't need to install the third-party libs?
0.07983
0
0
317
3,675,999
2010-09-09T11:17:00.000
2
0
1
0
python,python-3.x,osx-snow-leopard,upgrade,pythonpath
3,676,173
1
true
0
0
Python 2 and Python 3 are sufficiently different that you cannot in general share modules between them. You will need new, Python-3-compatible modules instead of re-using the Python 2 ones. (It's possible with a great deal of care to make scripts that will work in both, but it's not usually the done thing. Python 3 was...
1
0
0
I am trying to switch from using Python 2.6.5 to using Python 3.2a2. I am using OSX 10.6.4. However, when I open Idle in the Python 3.2a2 folder it cannot import any of the modules I installed to Python 2.6.5. Is there a way that I can share the same folders on Python 3.2a2 ?
Howto change Pythonpath in Python 3
1.2
0
0
1,141
3,676,344
2010-09-09T12:05:00.000
5
1
0
0
python,email,imap,imaplib
3,676,393
2
true
0
0
"attachment" is quite a broad term. Is an image for HTML message an attachment? In general, you can try analyzing content-type header. If it's multipart/mixed, most likely the message contains an attachment.
1
4
0
I am developing an email client in Python. Is it possible to check if an email contains an attachement just from the e-mail header without downloading the whole E-Mail?
Is it possible to check if an email contains an attachement just from the e-mail header?
1.2
0
1
2,147
3,678,221
2010-09-09T15:49:00.000
2
1
0
0
python,pylons,textmate
3,679,180
2
false
1
0
If you look under the Bundles menu in TextMate there is a Python-specific sub-menu that exposes a bunch of helpful things like syntax checking, script debugging, insertion of oft used code blocks, manual look ups and so on. Most of them are bound to keyboard shortcuts (or can be bound if they are not). Also, under the ...
1
0
0
I have textmate, but honestly the only thing I can do with it is simply edit a file. The handy little file browser is aslo useful. (how can I show/hide that file browser anyhow!) But I have no other knowledge/tricks up my sleeve, care to help me out?
How can textmate make my python (pylons) development easier?
0.197375
0
0
274