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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,812,520 | 2010-05-11T16:32:00.000 | 0 | 0 | 1 | 0 | python,pip | 56,779,686 | 25 | false | 0 | 0 | For windows specifically:
\path\to\python.exe -m pip install PackageName works. | 4 | 662 | 0 | Is there any way to make pip play well with multiple versions of Python? For example, I want to use pip to explicitly install things to either my site 2.5 installation or my site 2.6 installation.
For example, with easy_install, I use easy_install-2.{5,6}.
And, yes — I know about virtualenv, and no — it's not a solutio... | Dealing with multiple Python versions and PIP? | 0 | 0 | 0 | 806,792 |
2,812,520 | 2010-05-11T16:32:00.000 | 0 | 0 | 1 | 0 | python,pip | 49,317,258 | 25 | false | 0 | 0 | You can go to for example C:\Python2.7\Scripts and then run cmd from that path. After that you can run pip2.7 install yourpackage...
That will install package for that version of Python. | 4 | 662 | 0 | Is there any way to make pip play well with multiple versions of Python? For example, I want to use pip to explicitly install things to either my site 2.5 installation or my site 2.6 installation.
For example, with easy_install, I use easy_install-2.{5,6}.
And, yes — I know about virtualenv, and no — it's not a solutio... | Dealing with multiple Python versions and PIP? | 0 | 0 | 0 | 806,792 |
2,812,520 | 2010-05-11T16:32:00.000 | 31 | 0 | 1 | 0 | python,pip | 37,308,766 | 25 | false | 0 | 0 | It worked for me in windows this way:
I changed the name of python files python.py and pythonw.exe to python3.py pythonw3.py
Then I just ran this command in the prompt:
python3 -m pip install package | 4 | 662 | 0 | Is there any way to make pip play well with multiple versions of Python? For example, I want to use pip to explicitly install things to either my site 2.5 installation or my site 2.6 installation.
For example, with easy_install, I use easy_install-2.{5,6}.
And, yes — I know about virtualenv, and no — it's not a solutio... | Dealing with multiple Python versions and PIP? | 1 | 0 | 0 | 806,792 |
2,812,520 | 2010-05-11T16:32:00.000 | 76 | 0 | 1 | 0 | python,pip | 2,812,627 | 25 | false | 0 | 0 | /path/to/python2.{5,6} /path/to/pip install PackageName doesn't work?
For this to work on any python version that doesn't have pip already installed you need to download pip and do python*version* setup.py install. For example python3.3 setup.py install. This resolves the import error in the comments. (As suggested by... | 4 | 662 | 0 | Is there any way to make pip play well with multiple versions of Python? For example, I want to use pip to explicitly install things to either my site 2.5 installation or my site 2.6 installation.
For example, with easy_install, I use easy_install-2.{5,6}.
And, yes — I know about virtualenv, and no — it's not a solutio... | Dealing with multiple Python versions and PIP? | 1 | 0 | 0 | 806,792 |
2,812,954 | 2010-05-11T17:27:00.000 | 4 | 1 | 1 | 0 | python,lisp,compilation,dynamic-languages | 2,819,922 | 4 | false | 0 | 0 | Actually, there isn't anything that stops you from statically compile a Python program, it's just that no-one wrote such a compiler so far (I personally find Python's runtime to be very easy compared to CL's).
You could say that the difference lies in details like "how much time was spent on actually writing compilers... | 3 | 13 | 0 | Why can Lisp with all its dynamic features be statically compiled but Python cannot (without losing all its dynamic features)? | Lisp vs Python -- Static Compilation | 0.197375 | 0 | 0 | 2,658 |
2,812,954 | 2010-05-11T17:27:00.000 | 13 | 1 | 1 | 0 | python,lisp,compilation,dynamic-languages | 2,813,126 | 4 | true | 0 | 0 | There is nothing that prevents static compilation of Python. It's a bit less efficient because Python reveals more mutable local scope, also, to retain some of the dynamic properties (e.g. eval) you need to include the compiler with the compiled program but nothing prevents that too.
That said, research shows that most... | 3 | 13 | 0 | Why can Lisp with all its dynamic features be statically compiled but Python cannot (without losing all its dynamic features)? | Lisp vs Python -- Static Compilation | 1.2 | 0 | 0 | 2,658 |
2,812,954 | 2010-05-11T17:27:00.000 | 4 | 1 | 1 | 0 | python,lisp,compilation,dynamic-languages | 2,854,477 | 4 | false | 0 | 0 | Python can be 'compiled', where compilation is seen as a translation from one Turing Complete language (source code) to another (object code). However in Lisp, the object is assembly, something which is theoretically possible with Python (proven) but not feasible.
The true reason however is less flattening. Lisp is in ... | 3 | 13 | 0 | Why can Lisp with all its dynamic features be statically compiled but Python cannot (without losing all its dynamic features)? | Lisp vs Python -- Static Compilation | 0.197375 | 0 | 0 | 2,658 |
2,815,094 | 2010-05-11T23:15:00.000 | 0 | 0 | 0 | 0 | python,django,eclipse,ide,pydev | 44,662,580 | 2 | false | 1 | 0 | Navigate to
Window->Preferences->PyDev->Interpreters–>Python Interpreter
From Libraries (System PYTHONPATH),
make sure ..lib/site-packages is listed.
Remove any mention of lib/site-packages/Django | 2 | 4 | 0 | I'm using PyDev with Django. The autocomplete works nicely in the shell - I start typing, and it suggests completions. However, this doesn't work in the main code editor window. How can I fix this?
I'm using:
Eclipse build #20100218-1602
PyDev 1.5.6
Eclipse IDE for Java Devs 1.2.2 | PyDev and Django: Autocomplete not detecting Django? | 0 | 0 | 0 | 3,244 |
2,815,094 | 2010-05-11T23:15:00.000 | 8 | 0 | 0 | 0 | python,django,eclipse,ide,pydev | 2,816,189 | 2 | true | 1 | 0 | You might need to set the editor code completion settings. They are under:
Window->Preferences->PyDev->Editor->Code Completion
You might also need to add the Django install or your Django project to your path. You can set this under:
Window->Preferences->PyDev->Interpreter - Python
Hope this helps. | 2 | 4 | 0 | I'm using PyDev with Django. The autocomplete works nicely in the shell - I start typing, and it suggests completions. However, this doesn't work in the main code editor window. How can I fix this?
I'm using:
Eclipse build #20100218-1602
PyDev 1.5.6
Eclipse IDE for Java Devs 1.2.2 | PyDev and Django: Autocomplete not detecting Django? | 1.2 | 0 | 0 | 3,244 |
2,819,134 | 2010-05-12T13:21:00.000 | 3 | 0 | 0 | 0 | asp.net,asp.net-mvc,ironpython,dynamic-language-runtime | 2,820,043 | 1 | true | 1 | 0 | I've just started using IronPython as extensibility point in my ASP.NET MVC aplication. I have one ipy engine (in static property) and for each request I create new scope and execute the script in that scope.
Each scope should be independent on other scopes, no locking is needed.
If I run into issues, I'll post it her... | 1 | 2 | 0 | I would like to create an ASP.NET MVC web application which has extensible logic that does not require a re-build. I was thinking of creating a filter which had an instance of the IronPython engine. What I would like to know is: how much overhead is there in creating a new engine during each web request, and would it b... | Eval IronPython Scripts during ASP.NET Web Request; Static Engine or Not | 1.2 | 0 | 0 | 310 |
2,819,832 | 2010-05-12T14:41:00.000 | 6 | 0 | 1 | 0 | python,restructuredtext,python-sphinx,docutils | 2,837,522 | 9 | false | 0 | 0 | vi is very good at this. I was just editing some .rst files right now and it colors the headings, monospaced text, etc. The macros let you very quickly turn text into headings and whatnot. | 2 | 14 | 0 | I'm just learning Sphinx, and I need to edit ReST files. Is there an intelligent editor for it? Like, an editor that gives me code coloration, easy indentation, code completion (hopefully), etc. | Is there an intelligent editor for ReST files? | 1 | 0 | 0 | 4,719 |
2,819,832 | 2010-05-12T14:41:00.000 | 1 | 0 | 1 | 0 | python,restructuredtext,python-sphinx,docutils | 2,991,618 | 9 | false | 0 | 0 | jEdit also has ReST highlighting, but no ReST specific auto-completion features (it does support macros though).
I would opt for vim or Cream, personally. | 2 | 14 | 0 | I'm just learning Sphinx, and I need to edit ReST files. Is there an intelligent editor for it? Like, an editor that gives me code coloration, easy indentation, code completion (hopefully), etc. | Is there an intelligent editor for ReST files? | 0.022219 | 0 | 0 | 4,719 |
2,820,705 | 2010-05-12T16:16:00.000 | 3 | 0 | 1 | 0 | python,language-features,language-comparisons | 2,820,886 | 4 | false | 0 | 0 | Probably the prime reason I use Python is because it's very good at self-documenting. There are lots of other reasons too, but probably the best way to find out is to do something with it. Find a project and see what it takes to do it in Python. It may not be great Python code, but you'll learn more about how it suits ... | 1 | 1 | 0 | Is there any article/paper on what features the Python language has to offer? Why should one go with Python instead of any other language? What are the strong and the weak points of Python? | Python features | 0.148885 | 0 | 0 | 714 |
2,821,702 | 2010-05-12T18:33:00.000 | 9 | 0 | 0 | 0 | python,django,django-models | 2,824,112 | 7 | true | 1 | 0 | I just used my own subclass of Site and created a custom admin for it.
Basically, when you subclass a model in django it creates FK pointing to parent model and allows to access parent model's fields transparently- the same way you'd access parent class attributes in pyhon.
Built in admin won't suffer in any way, but... | 2 | 12 | 0 | What is the best approach to extending the Site model in django? Creating a new model and ForeignKey the Site or there another approach that allows me to subclass the Site model?
I prefer subclassing, because relationally I'm more comfortable, but I'm concerned for the impact it will have with the built-in Admin. | How do you extend the Site model in django? | 1.2 | 0 | 0 | 4,589 |
2,821,702 | 2010-05-12T18:33:00.000 | 3 | 0 | 0 | 0 | python,django,django-models | 45,414,164 | 7 | false | 1 | 0 | You can have another model like SiteProfile which has a OneToOne relation with Site. | 2 | 12 | 0 | What is the best approach to extending the Site model in django? Creating a new model and ForeignKey the Site or there another approach that allows me to subclass the Site model?
I prefer subclassing, because relationally I'm more comfortable, but I'm concerned for the impact it will have with the built-in Admin. | How do you extend the Site model in django? | 0.085505 | 0 | 0 | 4,589 |
2,822,677 | 2010-05-12T20:51:00.000 | 11 | 0 | 1 | 0 | python,multithreading,runtime-error | 2,822,737 | 3 | true | 0 | 0 | Threads cannot be restarted. You must re-create the Thread in order to start it again. | 1 | 6 | 0 | I have a thread that gets executed when some action occurs. Given the logic of the program, the thread cannot possibly be started while another instance of it is still running. Yet when I call it a second time, I get a "RuntimeError: thread already started" error. I added a check to see if it is actually alive using th... | Python Terminated Thread Cannot Restart | 1.2 | 0 | 0 | 4,756 |
2,823,907 | 2010-05-13T01:22:00.000 | -1 | 0 | 0 | 0 | python,opengl,graphics | 2,826,036 | 5 | false | 0 | 1 | I used openGL with C++ a few years back - found it quite low level. I also have used Java3D which seemed to be a bit higher level. If you are not stuck on using python - try Java3D - very simple to get up and running. | 1 | 3 | 0 | I am looking for a graphics library for 3D reconstruction research to develop my specific viewer based on some library. OpenGL seems in a low level and I have to remake the wheel everywhere. And I also tried VTK(visualization toolkit). However, it seems too abstract that I need to master many conceptions before I start... | Is there any graphics library in a higher level than OpenGL | -0.039979 | 0 | 0 | 2,730 |
2,823,983 | 2010-05-13T01:45:00.000 | 6 | 0 | 0 | 0 | python,oop | 2,824,002 | 4 | true | 0 | 1 | I find that the best way to learn a new language is by doing something like this (small project of your own). Python is no different.
Everything you wrote can be done in Python, so I can't find any reason not to use it, if you want to learn. | 4 | 2 | 0 | I have a project idea, but unsure if using Python would be a good idea.
Firstly, I'm a C++ and C# developer with some SQL experience. My day job is C++. I have a project idea i'd like to create and was considering developing it in a language I don't know. Python seems to be popular and has piqued my interests. I de... | Idea for a small project, should I use Python? | 1.2 | 0 | 0 | 823 |
2,823,983 | 2010-05-13T01:45:00.000 | 3 | 0 | 0 | 0 | python,oop | 2,824,090 | 4 | false | 0 | 1 | I've already voted for del-boy's answer, but I would like to go further and say that if your goals are to (1) have fun, (2) learn a new language, and (3) write your own game, then Python is a slam-dunk, no-brainer, awesome choice to achieve all three.
The language excels at all the things you seem to be looking for (se... | 4 | 2 | 0 | I have a project idea, but unsure if using Python would be a good idea.
Firstly, I'm a C++ and C# developer with some SQL experience. My day job is C++. I have a project idea i'd like to create and was considering developing it in a language I don't know. Python seems to be popular and has piqued my interests. I de... | Idea for a small project, should I use Python? | 0.148885 | 0 | 0 | 823 |
2,823,983 | 2010-05-13T01:45:00.000 | 1 | 0 | 0 | 0 | python,oop | 2,824,020 | 4 | false | 0 | 1 | Well, if you do C++/C#, I'd say go for it - I personally love C++ because it is (in my opinion) self-intuitive and easy. The 'grammar' of Python doesn't make much sense. Plus, if you already know another language, why learn Python for fun? I mean, if you want to create a simple project for fun, it's really not worth it... | 4 | 2 | 0 | I have a project idea, but unsure if using Python would be a good idea.
Firstly, I'm a C++ and C# developer with some SQL experience. My day job is C++. I have a project idea i'd like to create and was considering developing it in a language I don't know. Python seems to be popular and has piqued my interests. I de... | Idea for a small project, should I use Python? | 0.049958 | 0 | 0 | 823 |
2,823,983 | 2010-05-13T01:45:00.000 | 5 | 0 | 0 | 0 | python,oop | 2,824,031 | 4 | false | 0 | 1 | Python seems very suitable to your purposes (e.g., pygame and other popular third party extensions make it easy to achieve nice graphics, and you can also choose curses for structured textual I/O, etc) with the single exception of what you probably mean by "strongly typed".
Python is strongly typed (there is no way you... | 4 | 2 | 0 | I have a project idea, but unsure if using Python would be a good idea.
Firstly, I'm a C++ and C# developer with some SQL experience. My day job is C++. I have a project idea i'd like to create and was considering developing it in a language I don't know. Python seems to be popular and has piqued my interests. I de... | Idea for a small project, should I use Python? | 0.244919 | 0 | 0 | 823 |
2,824,244 | 2010-05-13T03:23:00.000 | 2 | 0 | 0 | 0 | python,sql,sqlalchemy | 2,828,580 | 2 | true | 0 | 0 | "or some kind of parser"
I've found MySQL to be a great parser for MySQL dump files :)
You said it yourself: "so it has quite a few commands/syntax that sqlite3 does not understand correctly." Clearly then, SQLite is not the tool for this task.
As for your particular error: without context (i.e. a traceback) there's no... | 2 | 5 | 0 | I have a large sql dump file ... with multiple CREATE TABLE and INSERT INTO statements. Is there any way to load these all into a SQLAlchemy sqlite database at once. I plan to use the introspected ORM from sqlsoup after I've created the tables. However, when I use the engine.execute() method it complains: sqlite3.Wa... | How can I load a sql "dump" file into sql alchemy | 1.2 | 1 | 0 | 3,406 |
2,824,244 | 2010-05-13T03:23:00.000 | 0 | 0 | 0 | 0 | python,sql,sqlalchemy | 2,828,621 | 2 | false | 0 | 0 | The SQL recognized by MySQL and the SQL in SQLite are quite different. I suggest dumping the data of each table individually, then loading the data into equivalent tables in SQLite.
Create the tables in SQLite manually, using a subset of the "CREATE TABLE" commands given in your raw-dump file. | 2 | 5 | 0 | I have a large sql dump file ... with multiple CREATE TABLE and INSERT INTO statements. Is there any way to load these all into a SQLAlchemy sqlite database at once. I plan to use the introspected ORM from sqlsoup after I've created the tables. However, when I use the engine.execute() method it complains: sqlite3.Wa... | How can I load a sql "dump" file into sql alchemy | 0 | 1 | 0 | 3,406 |
2,824,579 | 2010-05-13T05:26:00.000 | 3 | 1 | 1 | 0 | c++,python | 2,824,708 | 4 | false | 0 | 0 | I can't comment on Python, but in C++, structs provide public access by default.
The primary reason you want a private part of your class is that, without one, it is impossible to guarantee your invariants are satisfied. If you have a string class, for instance, that is supposed to keep track of the length of the st... | 3 | 2 | 0 | In c++ instance variables are private by default,in Python variables are public by default
i have two questions regarding the same:-
1: why Python have all the members are public by default?
2: People say you should your member data should be private
what if i make my data to be public?
what are the disadvantag... | what if i keep my class members are public? | 0.148885 | 0 | 0 | 303 |
2,824,579 | 2010-05-13T05:26:00.000 | 1 | 1 | 1 | 0 | c++,python | 2,824,800 | 4 | false | 0 | 0 | It's really a question of language design philosophies. I favour the Python camp so might come down a little heavy handedly on the C++ style but the bottom line is that in C++ it's possible to forcibly prevent users of your class from accessing certain internal parts.
In Python, it's a matter of convention and stating... | 3 | 2 | 0 | In c++ instance variables are private by default,in Python variables are public by default
i have two questions regarding the same:-
1: why Python have all the members are public by default?
2: People say you should your member data should be private
what if i make my data to be public?
what are the disadvantag... | what if i keep my class members are public? | 0.049958 | 0 | 0 | 303 |
2,824,579 | 2010-05-13T05:26:00.000 | 13 | 1 | 1 | 0 | c++,python | 2,824,654 | 4 | true | 0 | 0 | You can use a leading underscore in the name to tell readers of the code that the name in question is an internal detail and they must not rely on it remaining in future versions. Such a convention is really all you need -- why weigh the language down with an enforcement mechanism?
Data, just like methods, should be p... | 3 | 2 | 0 | In c++ instance variables are private by default,in Python variables are public by default
i have two questions regarding the same:-
1: why Python have all the members are public by default?
2: People say you should your member data should be private
what if i make my data to be public?
what are the disadvantag... | what if i keep my class members are public? | 1.2 | 0 | 0 | 303 |
2,825,100 | 2010-05-13T07:38:00.000 | 1 | 0 | 0 | 1 | python | 2,825,228 | 3 | false | 0 | 0 | As xitrium mentioned, it would be better if you used telnetlib. You can dispense with the whole mess of shell redirection etc.
If you do something like telnet foo | process.py, you can read your programs stdin (sys.stdin) to get the output of the telnet program. When you're happy, you can exit and terminate the pipelin... | 1 | 1 | 0 | My problem is that i want to do something like this in linux console
telnet 192.168.255.28 > process.py
i.e i would like to do some transformation with console telnet output using python script. I'm see Popen in python for this case, but i can't understand how can i get input from telnet if it do not stop all time..
P... | catch output from linux telnet to a python script | 0.066568 | 0 | 0 | 1,408 |
2,826,387 | 2010-05-13T11:37:00.000 | 0 | 0 | 0 | 0 | python,mysql | 2,827,845 | 4 | false | 0 | 0 | I'd add a "todelete tinyint(1) not null default 1" column to the table, update it to 0 for those id's which have to be kept, then delete from table where todelete;. It's faster than not in.
Or, create a table with the same structure as yours, insert the kept rows there and rename tables. Then, drop the old one. | 1 | 3 | 0 | I want to delete all records in a mysql db except the record id's I have in a list. The length of that list can vary and could easily contain 2000+ id's, ...
Currently I convert my list to a string so it fits in something like this:
cursor.execute("""delete from table where id not in (%s)""",(list))
Which doesn't feel... | delete all records except the id I have in a python list | 0 | 1 | 0 | 3,327 |
2,826,734 | 2010-05-13T12:32:00.000 | 0 | 1 | 0 | 0 | python,testing,automated-tests,system-testing | 6,698,351 | 3 | false | 0 | 0 | The TTCN3 is a quite good test framework for black-box testing. The comercial tools are having lot of reporting stuff there. It is not in python. | 1 | 16 | 0 | I am looking for good End to End testing framework under python, where the tests can be written in python and managed in a comfortable way. I know there are many unit testing frameworks, but I am looking for bigger scope, something like test director with support for reports etc,where a whole system is under test. | Good automated system testing framework in python | 0 | 0 | 0 | 22,530 |
2,829,637 | 2010-05-13T19:21:00.000 | -3 | 0 | 0 | 0 | c++,python,c,perl,socks | 2,829,664 | 2 | false | 0 | 1 | VC++ has extensive support if you want to try on Windows.
Google "Windows sockets for beginners msdn", great info for windows sockets...
If linux, try C sockets by beej... Just google beej's guide for sockets... | 1 | 2 | 0 | How do i add SOCKS support to my application? and where can i get the libs?
any help appreciated thanks | SOCKS in C/C++ or another language? | -0.291313 | 0 | 0 | 867 |
2,829,993 | 2010-05-13T20:17:00.000 | 0 | 0 | 0 | 0 | python,wxpython | 5,441,284 | 1 | false | 0 | 1 | Use wx.FindWindowById(wx.ID_FORWARD) this will return a wxWindow object representing the Next button. Call methods on it. e.g.
wx.FindWindowById(wx.ID_FORWARD).disable() would disable the Next Button. | 1 | 0 | 0 | I'm using the wxWizard widget in wxPython. Is there any way I could change the text of the next button on a page? Can i change the visibility of the navigation buttons on any page? Can I enable/disable the navigation buttons?
I tried looking for answers to these questions on the wxPython site but it doesn't seem to be ... | Access properties of navigation buttons in wxPython's wxWizard | 0 | 0 | 0 | 211 |
2,830,326 | 2010-05-13T21:09:00.000 | 0 | 1 | 0 | 0 | python | 2,830,485 | 1 | false | 0 | 0 | Basically what you need to do is create a raw socket, receive a datagram, and examine the destination address in the header. If that address is a broadcast address for the network adapter the socket is bound to, then you're golden.
I don't know how to do this in Python, so I suggest looking for examples of raw sockets ... | 1 | 0 | 0 | How can I distinguish between a broadcasted message and a direct message for my ip?
I'm doing this in python. | Distinguishing between broadcasted messages and direct messages | 0 | 0 | 1 | 83 |
2,830,358 | 2010-05-13T21:14:00.000 | 38 | 1 | 1 | 0 | python,optimization | 2,830,411 | 4 | true | 0 | 0 | assert statements are completely eliminated, as are statement blocks of the form if __debug__: ... (so you can put your debug code in such statements blocks and just run with -O to avoid that debug code).
With -OO, in addition, docstrings are also eliminated. | 1 | 45 | 0 | I cannot seem to find a good simple explanation of what python does differently when running with the -O or optimize flag. | What are the implications of running python with the optimize flag? | 1.2 | 0 | 0 | 17,421 |
2,830,880 | 2010-05-13T23:02:00.000 | 8 | 0 | 1 | 0 | python,multithreading,gil | 2,830,905 | 5 | false | 0 | 0 | The GIL is not held by the Python interpreter when doing network operations. If you are doing work that is network-bound (like a crawler), you can safely ignore the effects of the GIL.
On the other hand, you may want to measure your performance if you create lots of threads doing processing (after downloading). Limitin... | 2 | 10 | 0 | Was looking to write a little web crawler in python. I was starting to investigate writing it as a multithreaded script, one pool of threads downloading and one pool processing results. Due to the GIL would it actually do simultaneous downloading? How does the GIL affect a web crawler? Would each thread pick some data ... | Does a multithreaded crawler in Python really speed things up? | 1 | 0 | 1 | 5,361 |
2,830,880 | 2010-05-13T23:02:00.000 | 1 | 0 | 1 | 0 | python,multithreading,gil | 2,830,933 | 5 | false | 0 | 0 | Another consideration: if you're scraping a single website and the server places limits on the frequency of requests your can send from your IP address, adding multiple threads may make no difference. | 2 | 10 | 0 | Was looking to write a little web crawler in python. I was starting to investigate writing it as a multithreaded script, one pool of threads downloading and one pool processing results. Due to the GIL would it actually do simultaneous downloading? How does the GIL affect a web crawler? Would each thread pick some data ... | Does a multithreaded crawler in Python really speed things up? | 0.039979 | 0 | 1 | 5,361 |
2,831,212 | 2010-05-14T00:55:00.000 | 1 | 0 | 1 | 0 | python,list,performance,data-structures,set | 50,210,108 | 10 | false | 0 | 0 | I would recommend a Set implementation where the use case is limit to referencing or search for existence and Tuple implementation where the use case requires you to perform iteration. A list is a low-level implementation and requires significant memory overhead. | 1 | 238 | 0 | In Python, which data structure is more efficient/speedy? Assuming that order is not important to me and I would be checking for duplicates anyway, is a Python set slower than a Python list? | Python Sets vs Lists | 0.019997 | 0 | 0 | 203,899 |
2,831,779 | 2010-05-14T04:10:00.000 | 3 | 0 | 0 | 0 | python,gtk,pygtk,gtktreeview | 2,835,863 | 2 | true | 0 | 1 | There is no way to do that in PyGTK currently. "rows-reordered" is the correct signal, but it is impossible to derive any information from it in PyGTK other than "somehow reordered". In C GTK+ you could use the same signal and get the required information in callback, but not in Python. | 1 | 1 | 0 | I have a simple gtk.TreeView with a gtk.ListStore model and set_reorderable(True), I want to catch the signal/event emited when the user reorder through drag&drop the list, but the documentation does not help much:
"The application can listen to these changes by connecting to the model's signals"
So I tried to connect... | Catch PyGTK TreeView reorder | 1.2 | 0 | 0 | 1,654 |
2,832,064 | 2010-05-14T05:45:00.000 | 0 | 1 | 1 | 0 | javascript,jquery,python,google-apps | 2,832,539 | 3 | false | 0 | 0 | If speed is the issue, and you by profiling discover that js is the culprit, then I would look into replacing the jQuery with vanilla javascript, or a more optimized library.
As jQuery tries to do 'everything' and trains its users into wrapping everything in $(), its bound to introduce unnecessary method calls (I've se... | 2 | 3 | 0 | I want to make my component faster, I am using Javascript and JQuery to build that.
I am using JSON object to communicate with component and back-end is python.
Is there any suggestion to make component faster? | how to increase Speed of a component made from Javascript or JQuery? | 0 | 0 | 0 | 141 |
2,832,064 | 2010-05-14T05:45:00.000 | 1 | 1 | 1 | 0 | javascript,jquery,python,google-apps | 2,832,159 | 3 | true | 0 | 0 | Setup some analysis to see what takes time to process. Then decide if you want to try to optimize the javascript and client code, the communication up/down with the server or the actual speed of the python execution. When you have decided what you want to make faster, you can post samples of that to this site and peopl... | 2 | 3 | 0 | I want to make my component faster, I am using Javascript and JQuery to build that.
I am using JSON object to communicate with component and back-end is python.
Is there any suggestion to make component faster? | how to increase Speed of a component made from Javascript or JQuery? | 1.2 | 0 | 0 | 141 |
2,832,915 | 2010-05-14T09:02:00.000 | 1 | 0 | 0 | 0 | python,templates | 2,897,474 | 5 | false | 1 | 0 | You don't need a streaming templating engine - I do this all the time, and long before you run into anything vaguely heavy server-side, the browser will start to choke. Rendering a 10000 row table will peg the CPU for several seconds in pretty much any browser; scrolling it will be bothersomely choppy in chrome, and t... | 2 | 4 | 0 | Recently I needed to generate a huge HTML page containing a report with several thousand row table. And, obviously, I did not want to build the whole HTML (or the underlying tree) in memory. As result, I built the page with the old good string interpolation, but I do not like the solution.
Thus, I wonder whether there ... | Python templates for huge HTML/XML | 0.039979 | 0 | 1 | 1,055 |
2,832,915 | 2010-05-14T09:02:00.000 | 2 | 0 | 0 | 0 | python,templates | 2,832,958 | 5 | false | 1 | 0 | It'd be more user-friendly (assuming they have javascript enabled) to build the table via javascript by using e.g. a jQuery plugin which allows automatical loading of contents as soon as you scroll down. Then only few rows are loaded initially and when the user scrolls down more rows are loaded on demand.
If that's not... | 2 | 4 | 0 | Recently I needed to generate a huge HTML page containing a report with several thousand row table. And, obviously, I did not want to build the whole HTML (or the underlying tree) in memory. As result, I built the page with the old good string interpolation, but I do not like the solution.
Thus, I wonder whether there ... | Python templates for huge HTML/XML | 0.07983 | 0 | 1 | 1,055 |
2,833,312 | 2010-05-14T10:10:00.000 | 3 | 1 | 0 | 1 | php,python,perl,shell,data-munging | 2,833,559 | 3 | true | 0 | 0 | import data from a file and possibly reformat it
Python excels at this. Be sure to read up on the csv module so you don't waste time inventing it yourself.
For binary data, you may have to use the struct module. [If you wrote the C++ program that produces the binary data, consider rewriting that program to stop us... | 1 | 0 | 0 | I need to write some scripts to carry out some tasks on my server (running Ubuntu server 8.04 TLS). The tasks are to be run periodically, so I will be running the scripts as cron jobs.
I have divided the tasks into "group A" and "group B" - because (in my mind at least), they are a bit different.
Task Group A
import d... | Data munging and data import scripting | 1.2 | 0 | 0 | 819 |
2,835,472 | 2010-05-14T15:44:00.000 | 3 | 0 | 0 | 1 | java,python,google-app-engine,xmpp | 2,836,255 | 1 | true | 1 | 0 | No. App Engine apps can only directly handle HTTP requests - you can't run arbitrary servers on App Engine. | 1 | 3 | 0 | Google App Engine has a great XMPP service built in. One of the few limitations it has is that it doesn't support receiving messages from a group chat. That's the one thing I want to do with it. :(
Can I run a 3rd party XMPP/Jabber server on App Engine that supports group chat?
If so, which one? | Group Chat XMPP with Google App Engine | 1.2 | 0 | 0 | 1,577 |
2,836,838 | 2010-05-14T19:01:00.000 | 0 | 0 | 0 | 0 | javascript,jquery,python,django,console | 2,837,019 | 4 | false | 1 | 0 | Why don't you output the data to a HTML file? You could run a cron job to run your script which would in turn spurt out a HTML file which could be accesses from the browser. | 1 | 8 | 0 | I've created a Python script that monitors a logfile for changes (like tail -f) and displays it on a console. I would like to access the output of the Python script in a webbrowser. What would I need to create this? I was thinking about using Django and jQuery. Any tips or examples are greatly appreciated. | tail -f in a webbrowser | 0 | 0 | 0 | 12,000 |
2,837,850 | 2010-05-14T21:50:00.000 | 0 | 0 | 0 | 0 | python,r,statistics | 53,035,704 | 2 | false | 0 | 0 | 45% of the data have at least one missing value, you say. This is impressive. I would first look if there is no pattern. You say they are missing at random. Have you tested for MAR ? Have you tested for MAR for sub-groups ?
Not knowing your data I would first look if there are not cases with many missing values and se... | 1 | 24 | 1 | I have a regression model in which the dependent variable is continuous but ninety percent of the independent variables are categorical(both ordered and unordered) and around thirty percent of the records have missing values(to make matters worse they are missing randomly without any pattern, that is, more that forty f... | Dimension Reduction in Categorical Data with missing values | 0 | 0 | 0 | 16,303 |
2,838,856 | 2010-05-15T03:53:00.000 | 10 | 0 | 1 | 0 | javascript,python | 2,838,869 | 6 | false | 0 | 0 | Depends what you want to do. If you're just interested in learning a programming language, I would recommend Python because:
The interactive prompt is great for learning a language
It's simple and well-designed, whereas JavaScript has a number of design flaws that can be confusing to newbies
There is a particularly hi... | 5 | 5 | 0 | Which language will allow a beginner to get up to speed quicker?
Basically which language of the two is easier to learn | Javascript or Python? beginner getting up to speed | 1 | 0 | 0 | 16,223 |
2,838,856 | 2010-05-15T03:53:00.000 | 2 | 0 | 1 | 0 | javascript,python | 2,839,047 | 6 | false | 0 | 0 | The two languages are used for two completely different purposes. JavaScript does work in the browser,1 Python does work everywhere else. Pick the language based on which you want; it's useless to learn a language if you can't even use it for your project. If you want to make a website, for example, you'll have to lear... | 5 | 5 | 0 | Which language will allow a beginner to get up to speed quicker?
Basically which language of the two is easier to learn | Javascript or Python? beginner getting up to speed | 0.066568 | 0 | 0 | 16,223 |
2,838,856 | 2010-05-15T03:53:00.000 | 0 | 0 | 1 | 0 | javascript,python | 6,636,999 | 6 | false | 0 | 0 | I would say JavaScript is easy to learn. I had to learn it to program the Karotz. It only took about 2 months of Youtube tutorials to learn most of it. | 5 | 5 | 0 | Which language will allow a beginner to get up to speed quicker?
Basically which language of the two is easier to learn | Javascript or Python? beginner getting up to speed | 0 | 0 | 0 | 16,223 |
2,838,856 | 2010-05-15T03:53:00.000 | 4 | 0 | 1 | 0 | javascript,python | 2,838,867 | 6 | false | 0 | 0 | They're both pretty straightforward to learn. They more differ in terms of their typical project space - Javascript is usually utilized more for the client-side portion of web applications, while Python is often utilized for the server side of web applications and also standalone non-web apps.
What do you want to make? | 5 | 5 | 0 | Which language will allow a beginner to get up to speed quicker?
Basically which language of the two is easier to learn | Javascript or Python? beginner getting up to speed | 0.132549 | 0 | 0 | 16,223 |
2,838,856 | 2010-05-15T03:53:00.000 | 1 | 0 | 1 | 0 | javascript,python | 2,838,956 | 6 | false | 0 | 0 | PHP is my thing, but I've played with Python and worked with JS. Being only somewhat skilled in both languages, Python feels nice and clean (although a little wierd) with the forced tabbing conventions and lack of semicolons. JS, on the other hand makes me feel like I need a shower. Especially after debugging in IE.
Bu... | 5 | 5 | 0 | Which language will allow a beginner to get up to speed quicker?
Basically which language of the two is easier to learn | Javascript or Python? beginner getting up to speed | 0.033321 | 0 | 0 | 16,223 |
2,839,130 | 2010-05-15T06:18:00.000 | 1 | 0 | 1 | 0 | python,performance,algorithm,data-structures,collections | 2,841,467 | 7 | false | 0 | 0 | If you can really allow O(log n) for pop, dequeue, and insert, then a simple balanced search tree like red-black tree is definitely sufficient.
You can optimize this of course by maintaining a direct pointer to the smallest and largest element in the tree, and then updating it when you (1) insert elements into the tree... | 2 | 3 | 0 | I need a collection data-structure that can do the following:
Be sorted
Allow me to quickly pop values off the front and back of the list O(log n)
Remain sorted after I insert a new value
Allow a user-specified comparison function, as I will be storing tuples and want to sort on a particular value
Thread-safety is no... | Best data-structure to use for two ended sorted list | 0.028564 | 0 | 0 | 1,183 |
2,839,130 | 2010-05-15T06:18:00.000 | -1 | 0 | 1 | 0 | python,performance,algorithm,data-structures,collections | 2,839,138 | 7 | false | 0 | 0 | If this were Java I'd use a TreeSet with the NavigableSet interface.
This is implemented as a Red-Black-Tree. | 2 | 3 | 0 | I need a collection data-structure that can do the following:
Be sorted
Allow me to quickly pop values off the front and back of the list O(log n)
Remain sorted after I insert a new value
Allow a user-specified comparison function, as I will be storing tuples and want to sort on a particular value
Thread-safety is no... | Best data-structure to use for two ended sorted list | -0.028564 | 0 | 0 | 1,183 |
2,839,663 | 2010-05-15T09:53:00.000 | 0 | 1 | 0 | 0 | php,javascript,python,programming-languages,certificate | 2,840,048 | 5 | false | 1 | 0 | For linux (implies perl/bash)
Comptia+
Red Hat Certified Engineer | 3 | 4 | 0 | I would like to know what are the certificates available for programming, like
Zend for PHP
SUN Certification for java
What are the others? Javascript? C++? Python? etc...
Please give me some suggestion for other available certifications. | What are the most valuable certification available for Programming? | 0 | 0 | 0 | 3,805 |
2,839,663 | 2010-05-15T09:53:00.000 | 16 | 1 | 0 | 0 | php,javascript,python,programming-languages,certificate | 2,839,684 | 5 | false | 1 | 0 | Most valuable thing for a developer: being able to show you can convert requirements into working and maintainable software.
Certifications generally are worth very little, except in a few niches that demand them (or at least ask, until they give up and get someone who puts practice before pieces of paper). | 3 | 4 | 0 | I would like to know what are the certificates available for programming, like
Zend for PHP
SUN Certification for java
What are the others? Javascript? C++? Python? etc...
Please give me some suggestion for other available certifications. | What are the most valuable certification available for Programming? | 1 | 0 | 0 | 3,805 |
2,839,663 | 2010-05-15T09:53:00.000 | 7 | 1 | 0 | 0 | php,javascript,python,programming-languages,certificate | 2,839,748 | 5 | false | 1 | 0 | Let me be bold and say that your Experience is your best certificate. | 3 | 4 | 0 | I would like to know what are the certificates available for programming, like
Zend for PHP
SUN Certification for java
What are the others? Javascript? C++? Python? etc...
Please give me some suggestion for other available certifications. | What are the most valuable certification available for Programming? | 1 | 0 | 0 | 3,805 |
2,840,144 | 2010-05-15T12:46:00.000 | 2 | 0 | 1 | 0 | python,python-3.x | 2,840,151 | 2 | false | 0 | 0 | PyUnicodeObject is a subset of PyObject so there shouldn't be any problem passing it. | 1 | 1 | 0 | A value which is a PyUnicodeObject need to be passed to PyObject variable.
Is there any conversion method for that?
thanks
karnol | Is there a method to convert PyUnicodeObject variable to PyObject type? | 0.197375 | 0 | 0 | 416 |
2,840,201 | 2010-05-15T13:07:00.000 | 5 | 1 | 0 | 0 | python,caching,web2py | 2,840,650 | 2 | false | 1 | 0 | web2py does cache your code, except for Google App Engine (for speed). That is not the problem. If you you edit code in models, views or controllers, you see the effect immediately.
The problem may be modules; if you edit code in modules you will not see the effect immediately, unless you import them with local_import(... | 1 | 5 | 0 | I'm working with web2py and for some reason web2py seems to fail to notice when code has changed in certain cases. I can't really narrow it down, but from time to time changes in the code are not reflected, web2py obviously has the old version cached somewhere.
The only thing that helps is quitting web2py and restarti... | Prevent web2py from caching? | 0.462117 | 0 | 0 | 1,547 |
2,840,329 | 2010-05-15T13:46:00.000 | 1 | 0 | 0 | 0 | python,django | 2,840,883 | 2 | true | 1 | 0 | I use the middleware because this way I don't have to change the app's code.
If I want to migrate my app to other hosting servers, I only need to modify the middleware without affecting other parts.
Security is not an issue because on WebFaction you can trust what comes in from the front end server. | 1 | 0 | 0 | I'm trying to develop an app using Django 1.1 on Webfaction. I'd like to get the IP address of the incoming request, but when I use request.META['REMOTE_ADDR'] it returns 127.0.0.1. There seems to be a number of different ways of getting the address, such as using
HTTP_X_FORWARDED_FOR or plugging in some middleware ca... | Django: What's the correct way to get the requesting IP address? | 1.2 | 0 | 1 | 748 |
2,840,932 | 2010-05-15T16:54:00.000 | 4 | 1 | 0 | 1 | python,c,objective-c,linux,macos | 2,840,981 | 5 | false | 0 | 0 | It's frequently helpful to learn programming languages in the order they were created. The folks that wrote Objective-C clearly had C and its syntax, peculiarities, and features in mind when they defined the language. It can't hurt you to learn C now. You may have some insight into why Objective-C is structured the ... | 4 | 0 | 0 | I know Ruby right now, however I want to learn a new language. I am running Ubuntu 10.04 right now but I am going to get a Mac later this summer. Anyways I want something more for GUI development. I was wondering if I should learn C on Ubuntu right now, and then learn Objective-C when I get an iMac? Will learning C giv... | If I start learning C on Ubuntu will it give me an edge when I start learning Objective-C later this summer? | 0.158649 | 0 | 0 | 835 |
2,840,932 | 2010-05-15T16:54:00.000 | 1 | 1 | 0 | 1 | python,c,objective-c,linux,macos | 2,840,961 | 5 | false | 0 | 0 | Sure Objective-C is quite easier to learn if you know C and quite a few books on Objective-C even asume you know C.
Also consider learning a bit about MacRuby for GUI development ;) | 4 | 0 | 0 | I know Ruby right now, however I want to learn a new language. I am running Ubuntu 10.04 right now but I am going to get a Mac later this summer. Anyways I want something more for GUI development. I was wondering if I should learn C on Ubuntu right now, and then learn Objective-C when I get an iMac? Will learning C giv... | If I start learning C on Ubuntu will it give me an edge when I start learning Objective-C later this summer? | 0.039979 | 0 | 0 | 835 |
2,840,932 | 2010-05-15T16:54:00.000 | 0 | 1 | 0 | 1 | python,c,objective-c,linux,macos | 2,909,728 | 5 | false | 0 | 0 | Learning C will definitely be of help, as Objective C inherits its many properties and adds to it.
You could learn Objective C either from 'Learn Objective C on the Mac', this one's really a great book, and then if you plan to learn cocoa, get 'Learn Cocoa on the Mac' or the one by James Davidson, they should give you ... | 4 | 0 | 0 | I know Ruby right now, however I want to learn a new language. I am running Ubuntu 10.04 right now but I am going to get a Mac later this summer. Anyways I want something more for GUI development. I was wondering if I should learn C on Ubuntu right now, and then learn Objective-C when I get an iMac? Will learning C giv... | If I start learning C on Ubuntu will it give me an edge when I start learning Objective-C later this summer? | 0 | 0 | 0 | 835 |
2,840,932 | 2010-05-15T16:54:00.000 | 0 | 1 | 0 | 1 | python,c,objective-c,linux,macos | 5,783,941 | 5 | false | 0 | 0 | Yes. Learn how to program in C. | 4 | 0 | 0 | I know Ruby right now, however I want to learn a new language. I am running Ubuntu 10.04 right now but I am going to get a Mac later this summer. Anyways I want something more for GUI development. I was wondering if I should learn C on Ubuntu right now, and then learn Objective-C when I get an iMac? Will learning C giv... | If I start learning C on Ubuntu will it give me an edge when I start learning Objective-C later this summer? | 0 | 0 | 0 | 835 |
2,841,863 | 2010-05-15T21:40:00.000 | 1 | 1 | 1 | 0 | python,git | 2,844,342 | 1 | false | 0 | 0 | That's the basic algorithm that git uses to track changes to a particular file. That's why "git log -- some/path/to/file.txt" is a comparatively slow operation, compared to many other SCM systems where it would be simple (e.g. in CVS, P4 et al each repo file is a server file with the file's history).
It shouldn't take ... | 1 | 2 | 0 | I'm writing a simple parser of .git/* files. I covered almost everything, like objects, refs, pack files etc. But I have a problem. Let's say I have a big 300M repository (in a pack file) and I want to find out all the commits which changed /some/deep/inside/file file. What I'm doing now is:
fetching last commit
findi... | How does git fetches commits associated to a file? | 0.197375 | 0 | 0 | 75 |
2,842,629 | 2010-05-16T04:52:00.000 | 0 | 0 | 0 | 0 | python,web-crawler,scrapy | 2,843,118 | 3 | false | 1 | 0 | Set PYTHONPATH environment variable to python26/scripts. | 3 | 2 | 0 | I just downloaded Scrapy (web crawler) on Windows 32 and have just created a new project folder using the "scrapy-ctl.py startproject dmoz" command in dos. I then proceeded to created the first spider using the command:
scrapy-ctl.py genspider myspider myspdier-domain.com
but it did not work and returns the error:
Erro... | Creating a spider using Scrapy, Spider generation error | 0 | 0 | 0 | 2,058 |
2,842,629 | 2010-05-16T04:52:00.000 | 1 | 0 | 0 | 0 | python,web-crawler,scrapy | 3,312,950 | 3 | false | 1 | 0 | use the scrapy-ctl.py in the project's dir. that script will know about that project's settings. the main scrapy-ctl.py doesn't have a clue about that specific project's settings. | 3 | 2 | 0 | I just downloaded Scrapy (web crawler) on Windows 32 and have just created a new project folder using the "scrapy-ctl.py startproject dmoz" command in dos. I then proceeded to created the first spider using the command:
scrapy-ctl.py genspider myspider myspdier-domain.com
but it did not work and returns the error:
Erro... | Creating a spider using Scrapy, Spider generation error | 0.066568 | 0 | 0 | 2,058 |
2,842,629 | 2010-05-16T04:52:00.000 | 2 | 0 | 0 | 0 | python,web-crawler,scrapy | 2,842,952 | 3 | true | 1 | 0 | There is a difference between PATH and PYTHON_PATH. Is your PYTHON_PATH set correctly? This path is where python looks to include packages / modules. | 3 | 2 | 0 | I just downloaded Scrapy (web crawler) on Windows 32 and have just created a new project folder using the "scrapy-ctl.py startproject dmoz" command in dos. I then proceeded to created the first spider using the command:
scrapy-ctl.py genspider myspider myspdier-domain.com
but it did not work and returns the error:
Erro... | Creating a spider using Scrapy, Spider generation error | 1.2 | 0 | 0 | 2,058 |
2,843,545 | 2010-05-16T11:32:00.000 | 0 | 0 | 1 | 0 | python,windows,console | 51,686,360 | 4 | false | 0 | 0 | The way that I do it is i right click the script that I saved from notepad to a .py file, then i click edit with IDLE, This is an editing thingy, but you can also run modules from it | 1 | 10 | 0 | File associations on my machine (winxp home) are such that a python script is directly opened with the python interpreter. If I double click on a python script a console window runs and every thing is fine - as long as there is no syntax error in the script.
In that case the console window opens up for a moment but it ... | Keep Windows Console open after a Python Error | 0 | 0 | 0 | 7,295 |
2,844,105 | 2010-05-16T14:28:00.000 | 1 | 0 | 0 | 0 | java,python,nlp,hadoop,nltk | 2,844,449 | 4 | false | 1 | 0 | no actual answers; i'd have put this as a comment but on this site you're forced to only answer if you're still a noob
if it's genuinely as parallel as that, and it's only a couple of computers, could you not split the dataset up manually ahead of time?
have you confirmed that there isn't going to be a firewall or simi... | 3 | 5 | 0 | I have a large dataset (c. 40G) that I want to use for some NLP (largely embarrassingly parallel) over a couple of computers in the lab, to which i do not have root access, and only 1G of user space.
I experimented with hadoop, but of course this was dead in the water-- the data is stored on an external usb hard drive,... | Java or Python distributed compute job (on a student budget)? | 0.049958 | 0 | 0 | 334 |
2,844,105 | 2010-05-16T14:28:00.000 | 3 | 0 | 0 | 0 | java,python,nlp,hadoop,nltk | 2,844,538 | 4 | false | 1 | 0 | Speak with the IT dept at your school (especially if you are in college), if it is for an assignment or research I bet they would be more than happy to give you more disk space. | 3 | 5 | 0 | I have a large dataset (c. 40G) that I want to use for some NLP (largely embarrassingly parallel) over a couple of computers in the lab, to which i do not have root access, and only 1G of user space.
I experimented with hadoop, but of course this was dead in the water-- the data is stored on an external usb hard drive,... | Java or Python distributed compute job (on a student budget)? | 0.148885 | 0 | 0 | 334 |
2,844,105 | 2010-05-16T14:28:00.000 | 0 | 0 | 0 | 0 | java,python,nlp,hadoop,nltk | 2,847,116 | 4 | false | 1 | 0 | If more resources in your computing department are a no go, you're going to have to consider breaking down your data set into manageable chunks before you do any work on it, ad reduce the results down into a meaningful set.
More resources from IT would be the way to go.
Good luck !
Ben | 3 | 5 | 0 | I have a large dataset (c. 40G) that I want to use for some NLP (largely embarrassingly parallel) over a couple of computers in the lab, to which i do not have root access, and only 1G of user space.
I experimented with hadoop, but of course this was dead in the water-- the data is stored on an external usb hard drive,... | Java or Python distributed compute job (on a student budget)? | 0 | 0 | 0 | 334 |
2,844,121 | 2010-05-16T14:32:00.000 | 3 | 0 | 0 | 1 | python,exception,exception-handling,ctypes,abort | 2,844,132 | 1 | true | 0 | 0 | You might be able to setup a signal handler on SIGABRT to handle the signal caused by abort().
However, failed assertions might go along with corrupted memory and other bad things - there's usually a reason why an assertion failed. So usually terminating the applications is the best thing you can do (except displaying/... | 1 | 3 | 0 | I am working with some C code called from Python using ctypes. Somewhere in the bowels of the C library, an exception is occurring and/or abort() is being called. Is there any way I can catch this in my Python caller code? (Platform is Linux) | How to catch an exception thrown in ctypes? | 1.2 | 0 | 0 | 1,439 |
2,844,635 | 2010-05-16T17:06:00.000 | 5 | 0 | 0 | 1 | python,google-app-engine,logging | 20,735,387 | 4 | false | 1 | 0 | Many of these answers are now outdated. :)
In today's devappserver, use --logs_path=LOGS_FILE if you want to log to a file (in its native sqlite database format). Or as suggested in a comment, simply pipe the output if that's too complicated.
Since there's a log API, it actually now stores log entries in a file in --st... | 1 | 9 | 0 | GoogleAppEngineLauncher can display the local log file of my app while it is running on my Mac during development. However, I can't change the font size there so I would like to use the tail command to watch the log file myself.
It's a shame but I can't find the log files. They are not under /var/log/, ~/Library/Logs o... | Where does GoogleAppEngineLauncher keep the local log files? | 0.244919 | 0 | 0 | 7,373 |
2,845,717 | 2010-05-16T22:21:00.000 | 4 | 0 | 1 | 0 | python,debugging,ide,ipython,pdb | 2,845,865 | 7 | false | 0 | 0 | Btw, I've seen Spyder (formerly Pydee), and that indeed will have iPython integration in September, but it still lacks a debugger. ::sigh:: | 1 | 12 | 0 | Does anyone know of a python IDE that has iPython as the interpreter?
Using the standard interpreter just drives me nuts, as I've just grown to love using iPython and all the features it provides. To be honest, I'd rather code with a simple text editor + ipython than an IDE, but I love being able to set breakpoints ... | A Python IDE with Debugging and iPython Integration? | 0.113791 | 0 | 0 | 8,537 |
2,846,308 | 2010-05-17T02:14:00.000 | 0 | 0 | 1 | 0 | python,reference,stdout | 2,846,344 | 5 | false | 0 | 0 | This can't be done. Pass the desired attribute as a string and use getattr() and setattr(). | 1 | 1 | 0 | I am traditionally a Perl and C++ programmer, so apologies in advance if I am misunderstanding something trivial about Python!
I would like to create a reference to a reference.
Huh? Ok. All objects in Python are actually references to the real object.
So, how do I create a reference to this reference?
Why do I need/... | Python: How do I create a reference to a reference? | 0 | 0 | 0 | 382 |
2,846,431 | 2010-05-17T03:04:00.000 | 1 | 0 | 1 | 0 | python,list | 2,846,492 | 5 | false | 0 | 0 | Dicts and sets will be just as fast (and O(N), as you surmise). Lists, which you only mention in your Q's title and never in its text, might be slower, depending what you mean by "merging".
Given the json downstream requirements, dicts with values all set to 1 will be fastest overall -- not for the merging, but for th... | 2 | 0 | 0 | I'm working with an app that is cpu-bound more than memory bound, and I'm trying to merge two things whether they be lists or dicts.
Now the thing is i can choose either one, but I'm wondering if merging dicts would be faster since it's all in memory? Or is it always going to be O(n), n being the size of the smaller l... | what's faster: merging lists or dicts in python? | 0.039979 | 0 | 0 | 326 |
2,846,431 | 2010-05-17T03:04:00.000 | 0 | 0 | 1 | 0 | python,list | 2,846,833 | 5 | false | 0 | 0 | I'd be more worried about correctness. If you have duplicate keys, the list will duplicate your keys and values. A dictionary will only keep one of the values. Also, a list will keep the order consistent. Which do you prefer?
My gut reaction is that if you are searching for keys the dictionary will be faster. But how w... | 2 | 0 | 0 | I'm working with an app that is cpu-bound more than memory bound, and I'm trying to merge two things whether they be lists or dicts.
Now the thing is i can choose either one, but I'm wondering if merging dicts would be faster since it's all in memory? Or is it always going to be O(n), n being the size of the smaller l... | what's faster: merging lists or dicts in python? | 0 | 0 | 0 | 326 |
2,847,593 | 2010-05-17T08:31:00.000 | 2 | 0 | 0 | 0 | python,wsgi | 2,847,694 | 6 | true | 1 | 0 | You can run an django application in 20 mb memory easily. probably a django application will use less memory than 20mb.
I want to advise you to check webpy and cherrypy
but I'm big fan of django. if you have 20 mb memory to run application, django will give you everythig it has. | 1 | 1 | 0 | I'm looking for some recommendations for a python web application. We have some memory restrictions and we try to keep it small and lean.
We thought about using WSGI (and a python webserver) and build the rest ourself. We already have a template engine we'd like to use, but we are open for some suggestions regarding th... | Stack recommendations for small/medium-sized web application in Python | 1.2 | 0 | 0 | 368 |
2,848,098 | 2010-05-17T10:00:00.000 | 5 | 0 | 0 | 0 | python | 2,848,539 | 1 | false | 0 | 0 | I don't think it's possible with Python's socket module. UDP is a very minimalistic protocol, and the only way to distinguish between a broadcast and a non-broadcast UDP packet is by looking at the destination address. However, you cannot inspect that part of the packet with the BSD socket API (if I remember it correct... | 1 | 2 | 0 | Sometimes I have to send a message to a specific IP and sometimes I have to broadcast the message to all the IP's in my network. At the other end I have to distinguish between a broadcast and a normal one, but recvfrom() just returns the address the message came from;
there is no difference between them. Can anyone hel... | How to identify a broadcasted message? | 0.761594 | 0 | 1 | 116 |
2,848,686 | 2010-05-17T11:43:00.000 | 3 | 0 | 1 | 0 | python,twisted,twisted.web | 2,849,252 | 1 | false | 0 | 0 | I'm assuming you want this API in order to save and retrieve per-request state. If not, then you might want to clarify your question.
Twisted Web doesn't offer any API along these lines. Since you're in control for the completely lifetime of the request, it's possible for you to store any per-request state yourself: ... | 1 | 6 | 0 | In asynchronous environments, threading.local is not guaranteed to be context-local anymore, because several contexts may coexist within a single thread. Most asynchronous frameworks (gevent, eventlet) provide a get_current_context() functionality to identify the current context. Some offer a way to monkey-patch thread... | threading.local equivalent for twisted.web? | 0.53705 | 0 | 0 | 263 |
2,849,118 | 2010-05-17T12:48:00.000 | 0 | 0 | 0 | 0 | python,django,plugins | 2,849,724 | 1 | false | 1 | 0 | I would make an app with a very abstract definition of a Task model. The Task model might contain properties for:
the input arguments,
the function to run,
the time that the task was submitted,
the time that the task has been actually running, and
the result (which would be something like a singleton Task.NotFinis... | 1 | 0 | 0 | I am developing a website which is aimed at being a GUI for several image processing algorithms (referred to as 'tasks').
At the moment, only one of these algorithms is finished, but there are more to come (which will have a similar, but not quite the same, workflow)
Basically, the algorithm works as follows (not that ... | Suggestions for a pluggable task framework in Django | 0 | 0 | 0 | 160 |
2,850,084 | 2010-05-17T14:56:00.000 | 4 | 0 | 1 | 0 | python,config,filenames,file-extension | 2,850,809 | 3 | false | 0 | 0 | The docs seem to use .cfg
On Windows, many people (such as mercurial) use .ini | 3 | 11 | 0 | I'm creating a config file to hold configuration/properties settings for my project that frequently change, such as file paths. What's the standard name/extension for such a file? (e.g. in Java I've used config.xml, in VB.NET I've used App.config...) | What's the standard config file name and extension in Python? | 0.26052 | 0 | 0 | 8,345 |
2,850,084 | 2010-05-17T14:56:00.000 | 12 | 0 | 1 | 0 | python,config,filenames,file-extension | 2,850,523 | 3 | false | 0 | 0 | Ok, I've asked around where I work and researched a little, and this is what I've come up with as suggestions:
settings.ini
applicationName.config
applicationName.cfg
If anyone has any other suggestions, feel free to add... | 3 | 11 | 0 | I'm creating a config file to hold configuration/properties settings for my project that frequently change, such as file paths. What's the standard name/extension for such a file? (e.g. in Java I've used config.xml, in VB.NET I've used App.config...) | What's the standard config file name and extension in Python? | 1 | 0 | 0 | 8,345 |
2,850,084 | 2010-05-17T14:56:00.000 | 7 | 0 | 1 | 0 | python,config,filenames,file-extension | 2,850,268 | 3 | true | 0 | 0 | First, consider using ConfigParser (configparser in 3.0, so the documentation says). That doesn't solve the naming problem, but it is a readable alternative to xml for most configuration needs.
Whatever name you use, make all the parts meaningful. I would probably use something like appName.cfg, where appName identifi... | 3 | 11 | 0 | I'm creating a config file to hold configuration/properties settings for my project that frequently change, such as file paths. What's the standard name/extension for such a file? (e.g. in Java I've used config.xml, in VB.NET I've used App.config...) | What's the standard config file name and extension in Python? | 1.2 | 0 | 0 | 8,345 |
2,850,534 | 2010-05-17T15:47:00.000 | 1 | 0 | 0 | 0 | python,html,xml,ajax,xslt | 2,850,582 | 4 | false | 1 | 0 | I would go with the PHP option. The reason being is that when the XML changes your site content "should" automatically change without you having to touch your PHP code.
Creating a Python script to generate lots of static pages just seems like a bad idea to me and with javascript you will have your cross-browser headac... | 3 | 3 | 0 | I have a long document in XML from which I need to produce static HTML pages (for distribution via CD). I know (to varying degrees) JavaScript, PHP and Python. The current options I've considered are listed here:
I'm not ruling out JavaScript, so one option would be to use ajax to dynamically load the XML content into... | Producing a static HTML site from XML content | 0.049958 | 0 | 1 | 1,365 |
2,850,534 | 2010-05-17T15:47:00.000 | 2 | 0 | 0 | 0 | python,html,xml,ajax,xslt | 2,850,603 | 4 | false | 1 | 0 | I would go with the XSLT option, controlled via parameters to generate different pages from the same XML source if needed. It's really the tool made for XML transformations. | 3 | 3 | 0 | I have a long document in XML from which I need to produce static HTML pages (for distribution via CD). I know (to varying degrees) JavaScript, PHP and Python. The current options I've considered are listed here:
I'm not ruling out JavaScript, so one option would be to use ajax to dynamically load the XML content into... | Producing a static HTML site from XML content | 0.099668 | 0 | 1 | 1,365 |
2,850,534 | 2010-05-17T15:47:00.000 | 0 | 0 | 0 | 0 | python,html,xml,ajax,xslt | 2,850,635 | 4 | false | 1 | 0 | Go with what you are most comfortable with.
If it's straightforward you could use (for example) php to generate a page and then use a command line script (in python or php) to create cached files for you. | 3 | 3 | 0 | I have a long document in XML from which I need to produce static HTML pages (for distribution via CD). I know (to varying degrees) JavaScript, PHP and Python. The current options I've considered are listed here:
I'm not ruling out JavaScript, so one option would be to use ajax to dynamically load the XML content into... | Producing a static HTML site from XML content | 0 | 0 | 1 | 1,365 |
2,850,566 | 2010-05-17T15:50:00.000 | 0 | 1 | 1 | 0 | python,multithreading,smtp,cgi | 2,851,122 | 2 | false | 0 | 0 | You might want to use threading.enumerate, if you have multiple workers and want to see which one(s) are still running.
Other alternatives include using threading.Event---the main thread sets the event to True and starts the worker thread off. The worker thread unsets the event when if finishes work, and the main ch... | 1 | 2 | 0 | I'm using Python in a webapp (CGI for testing, FastCGI for production) that needs to send an occasional email (when a user registers or something else important happens). Since communicating with an SMTP server takes a long time, I'd like to spawn a thread for the mail function so that the rest of the app can finish u... | Parent Thread exiting before Child Threads [python] | 0 | 0 | 0 | 3,627 |
2,851,499 | 2010-05-17T18:03:00.000 | 7 | 0 | 1 | 0 | python | 2,854,703 | 1 | true | 0 | 0 | Your understanding is correct: "green" threads are not actually threads, they don't get pre-empted at unpredictable points (esp. not "in the middle" of an operation), so you have full control of when execution moves away from one (and can thus get dispatched to another) and can save yourself the trouble/overhead of loc... | 1 | 4 | 0 | Since Eventlet uses green threading and asynchronous I/O, do I still need to set locks before accessing objects? My understanding is that greenlets are all part of one thread and locking isn't necessary. Can anyone confirm or deny this? | Eventlet and locking | 1.2 | 0 | 0 | 1,531 |
2,851,632 | 2010-05-17T18:21:00.000 | 2 | 0 | 1 | 0 | python,django,virtualenv | 2,851,741 | 2 | true | 1 | 0 | If you have easy_install, or better yet pip installed, should be as easy as:
easy_install/pip install virtualenv
mkdir django1.2
virtualenv django1.2
This will put the python binary in a bin folder inside the django1.2 folder. Just use that python binary, and you've got a nice little self-contained environment. You c... | 1 | 1 | 0 | Since I have Django 1.1x on my Debian setup - how can I use virtualenv or similar and not have it mess up my system's default django version which in turn would break all my sites?
Detailed instructions or a great tutorial link would very much be appreciated - please don't offer vague advice since I'm still a noob.
Cur... | Using virtualenv to install different versions of same package | 1.2 | 0 | 0 | 381 |
2,852,056 | 2010-05-17T19:20:00.000 | 3 | 0 | 0 | 0 | python,frameworks | 2,852,087 | 4 | false | 1 | 0 | Checkout web2py. Seems to be about the simplest python based webserver I can think of.
Django might do, it's hefty, but it comes with it's own development server. | 2 | 2 | 0 | Is there any lightweight mvc webframework which is not necessary to install to the server?
I need something simple, that i could just copy to the shared hosting. And it must handle urls other that localhost/test.py, something like this localhost/Blog/test | Simple python mvc framework | 0.148885 | 0 | 0 | 4,528 |
2,852,056 | 2010-05-17T19:20:00.000 | 2 | 0 | 0 | 0 | python,frameworks | 2,853,387 | 4 | false | 1 | 0 | web2py includes everything (ssl-enabled web server, sqlite sql based transaction safe database, web based Integrated Development Enviroment, web based database interface) in one package. The web2py binaries for windows and mac also include Python itself. web2py does not require configuration or installation and can run... | 2 | 2 | 0 | Is there any lightweight mvc webframework which is not necessary to install to the server?
I need something simple, that i could just copy to the shared hosting. And it must handle urls other that localhost/test.py, something like this localhost/Blog/test | Simple python mvc framework | 0.099668 | 0 | 0 | 4,528 |
2,852,301 | 2010-05-17T19:59:00.000 | 1 | 0 | 1 | 0 | python,netbeans,feedparser | 2,856,391 | 2 | true | 0 | 0 | Netbeans by default uses Jython,
if you go to Tools>Python Platforms and see that Jython is the default.
Switch it to Python and so the installed libraries would work.
If you already have a project, you should right click on it, choose Python and on the platform choose Python instead of Jython. | 1 | 0 | 0 | I recently downloaded and installed feedparser with python,
I tried to run it but Netbeans shouts on import:
ImportError: No module named feedparser
restarted the Netbeans, still no go. | adding the feedparser module to python | 1.2 | 0 | 1 | 1,032 |
2,852,397 | 2010-05-17T20:13:00.000 | 0 | 1 | 1 | 1 | python,linux,bash,scripting | 2,853,719 | 4 | false | 0 | 0 | Certain scripts that I write simply involving looping over a glob in some directories, and then executing some a piped series of commands on them. This kind of thing is much more tedious in python. | 3 | 1 | 0 | I decided to rewrite all our Bash scripts in Python (there are not so many of them) as my first Python project. The reason for it is that although being quite fluent in Bash I feel it's somewhat archaic language and since our system is in the first stages of its developments I think switching to Python now will be the ... | What scripts should not be ported from bash to python? | 0 | 0 | 0 | 387 |
2,852,397 | 2010-05-17T20:13:00.000 | 3 | 1 | 1 | 1 | python,linux,bash,scripting | 2,852,418 | 4 | true | 0 | 0 | It is OK in the sense that you can do it. But the scripts in /etc/init.d usually need to load config data and some functions (for example to print the nice green OK on the console) which will be hard to emulate in Python.
So try to convert those which make sense (i.e. those which contain complex logic). If you need job... | 3 | 1 | 0 | I decided to rewrite all our Bash scripts in Python (there are not so many of them) as my first Python project. The reason for it is that although being quite fluent in Bash I feel it's somewhat archaic language and since our system is in the first stages of its developments I think switching to Python now will be the ... | What scripts should not be ported from bash to python? | 1.2 | 0 | 0 | 387 |
2,852,397 | 2010-05-17T20:13:00.000 | 1 | 1 | 1 | 1 | python,linux,bash,scripting | 2,853,661 | 4 | false | 0 | 0 | Every task has languages that are better suited for it and less so. Replacing the backtick ` quote of sh is pretty ponderous in Python as would be myriad quoting details, just to name a couple. There are likely better projects to cut your teeth on.
And all that they said above about Python being relatively heavyweight ... | 3 | 1 | 0 | I decided to rewrite all our Bash scripts in Python (there are not so many of them) as my first Python project. The reason for it is that although being quite fluent in Bash I feel it's somewhat archaic language and since our system is in the first stages of its developments I think switching to Python now will be the ... | What scripts should not be ported from bash to python? | 0.049958 | 0 | 0 | 387 |
2,852,784 | 2010-05-17T21:01:00.000 | 60 | 1 | 0 | 0 | php,python,language-comparisons | 2,852,795 | 6 | true | 0 | 0 | Just leave the bracket's empty...
Python has the pass word because they don't use brackets to define the body part of classes, function, and other statement. PHP doesn't have this dilemma , and therefore doesn't need something to say that a body statement is empty. | 1 | 28 | 0 | Do you know any PHP statement that works like Python's pass statement? | What is the equivalent in PHP for Python's pass statement? | 1.2 | 0 | 0 | 22,582 |
2,852,912 | 2010-05-17T21:23:00.000 | 1 | 0 | 1 | 0 | python,arrays,search,string,duplicates | 2,852,951 | 5 | true | 0 | 0 | Is this array sorted?
I think the fastest solution can be a heap sort or quick sort, and after go through the array, and find the duplicates. | 4 | 0 | 0 | how would i search through a list with ~5 mil 128bit (or 256, depending on how you look at it) strings quickly and find the duplicates (in python)? i can turn the strings into numbers, but i don't think that's going to help much. since i haven't learned much information theory, is there anything about this in informati... | Searching through large data set | 1.2 | 0 | 0 | 1,366 |
2,852,912 | 2010-05-17T21:23:00.000 | 2 | 0 | 1 | 0 | python,arrays,search,string,duplicates | 2,852,962 | 5 | false | 0 | 0 | Load them into memory (5M x 64B = 320MB), sort them, and scan through them finding the duplicates. | 4 | 0 | 0 | how would i search through a list with ~5 mil 128bit (or 256, depending on how you look at it) strings quickly and find the duplicates (in python)? i can turn the strings into numbers, but i don't think that's going to help much. since i haven't learned much information theory, is there anything about this in informati... | Searching through large data set | 0.07983 | 0 | 0 | 1,366 |
2,852,912 | 2010-05-17T21:23:00.000 | 0 | 0 | 1 | 0 | python,arrays,search,string,duplicates | 2,853,423 | 5 | false | 0 | 0 | You say you have a list of about 5 million strings, and the list may contain duplicates. You don't say (1) what you want to do with the duplicates (log them, delete all but one occurrence, ...) (2) what you want to do with the non-duplicates (3) whether this list is a stand-alone structure or whether the strings are ke... | 4 | 0 | 0 | how would i search through a list with ~5 mil 128bit (or 256, depending on how you look at it) strings quickly and find the duplicates (in python)? i can turn the strings into numbers, but i don't think that's going to help much. since i haven't learned much information theory, is there anything about this in informati... | Searching through large data set | 0 | 0 | 0 | 1,366 |
2,852,912 | 2010-05-17T21:23:00.000 | 4 | 0 | 1 | 0 | python,arrays,search,string,duplicates | 2,853,142 | 5 | false | 0 | 0 | If it fits into memeory, use set(). I think it will be faster than sort. O(n log n) for 5 million items is going to cost you.
If it does not fit into memory, say you've lot more than 5 million record, divide and conquer. Break the records at the mid point like 1 x 2^127. Apply any of the above methods. I guess informat... | 4 | 0 | 0 | how would i search through a list with ~5 mil 128bit (or 256, depending on how you look at it) strings quickly and find the duplicates (in python)? i can turn the strings into numbers, but i don't think that's going to help much. since i haven't learned much information theory, is there anything about this in informati... | Searching through large data set | 0.158649 | 0 | 0 | 1,366 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.