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,068,843 | 2010-06-18T10:30:00.000 | 2 | 0 | 0 | 0 | python,django,django-admin | 3,180,399 | 12 | false | 1 | 0 | You can do this by following way:
1)You can make the fields read only if the object has been created.But doing this noone will be able to change the fields
2)You can use databrowse
3)You can use form validation ,if user is not in the selected list throw validation error if any field is changed
4)you can create a view ,... | 3 | 27 | 0 | is it possible to give users the permission to view, but not to change or delete.
currently in the only permissions I see are "add", "change" and "delete"... but there is no "read/view" in there.
I really need this as some users will only be able to consult the admin panel, in order to see what has been added in. | Permission to view, but not to change! - Django | 0.033321 | 0 | 0 | 25,793 |
3,068,843 | 2010-06-18T10:30:00.000 | 0 | 0 | 0 | 0 | python,django,django-admin | 5,363,776 | 12 | false | 1 | 0 | You may also override ModelAdmin.change_view (as stated in the Django docs). Just make sure you also override save_model to make sure the user can't update the data | 3 | 27 | 0 | is it possible to give users the permission to view, but not to change or delete.
currently in the only permissions I see are "add", "change" and "delete"... but there is no "read/view" in there.
I really need this as some users will only be able to consult the admin panel, in order to see what has been added in. | Permission to view, but not to change! - Django | 0 | 0 | 0 | 25,793 |
3,069,583 | 2010-06-18T12:34:00.000 | 0 | 0 | 0 | 0 | python,django | 3,069,642 | 2 | true | 1 | 0 | Personnaly, I use the exception mechanism for this kind of stuff and I don't really see why I shouldn't | 2 | 0 | 0 | I have a view my Django application which when invoked calls my backend. My backend logic sometimes reaches a point when it needs user input to continue. When this happens, I pickle dump my backend data into the session so that i can resume it later on.
Currently i have defined the scenario when user input is required ... | Some kind of event functionality in Django? | 1.2 | 0 | 0 | 79 |
3,069,583 | 2010-06-18T12:34:00.000 | 0 | 0 | 0 | 0 | python,django | 3,070,920 | 2 | false | 1 | 0 | I'd say there are two ways: You assume that data should be present and if they are not, custom exception should be raised as mentioned.
However, if it's part of expected workflow and it may just be present in a state, I'd handle it accordingly, i.e. by checking results from view calls.
(And I'd say that continuations f... | 2 | 0 | 0 | I have a view my Django application which when invoked calls my backend. My backend logic sometimes reaches a point when it needs user input to continue. When this happens, I pickle dump my backend data into the session so that i can resume it later on.
Currently i have defined the scenario when user input is required ... | Some kind of event functionality in Django? | 0 | 0 | 0 | 79 |
3,070,094 | 2010-06-18T13:40:00.000 | 1 | 0 | 0 | 0 | python,mysql,excel,csv,import-from-excel | 3,072,109 | 5 | false | 0 | 0 | As far as I know, there is no tool that can automate this process (I would love for someone to prove me wrong as I've had this exact problem before).
When I did this, I came up with two options:
(1) Manually create the columns in the db with the appropriate types and then import, or
(2) Write some kind of filter that... | 3 | 6 | 0 | How would I go around creating a MYSQL table schema inspecting an Excel(or CSV) file.
Are there any ready Python libraries for the task?
Column headers would be sanitized to column names. Datatype would be estimated based on the contents of the spreadsheet column. When done, data would be loaded to the table.
I have an... | Generate table schema inspecting Excel(CSV) and import data | 0.039979 | 1 | 0 | 7,011 |
3,070,094 | 2010-06-18T13:40:00.000 | 1 | 0 | 0 | 0 | python,mysql,excel,csv,import-from-excel | 3,071,074 | 5 | false | 0 | 0 | Quick and dirty workaround with phpmyadmin:
Create a table with the right amount of columns. Make sure the data fits the columns.
Import the CSV into the table.
Use the propose table structure. | 3 | 6 | 0 | How would I go around creating a MYSQL table schema inspecting an Excel(or CSV) file.
Are there any ready Python libraries for the task?
Column headers would be sanitized to column names. Datatype would be estimated based on the contents of the spreadsheet column. When done, data would be loaded to the table.
I have an... | Generate table schema inspecting Excel(CSV) and import data | 0.039979 | 1 | 0 | 7,011 |
3,070,094 | 2010-06-18T13:40:00.000 | 1 | 0 | 0 | 0 | python,mysql,excel,csv,import-from-excel | 3,169,710 | 5 | true | 0 | 0 | Just for (my) reference, I documented below what I did:
XLRD is practical, however I've just saved the Excel data as CSV, so I can use LOAD DATA INFILE
I've copied the header row and started writing the import and normalization script
Script does: CREATE TABLE with all columns as TEXT, except for Primary key
query mys... | 3 | 6 | 0 | How would I go around creating a MYSQL table schema inspecting an Excel(or CSV) file.
Are there any ready Python libraries for the task?
Column headers would be sanitized to column names. Datatype would be estimated based on the contents of the spreadsheet column. When done, data would be loaded to the table.
I have an... | Generate table schema inspecting Excel(CSV) and import data | 1.2 | 1 | 0 | 7,011 |
3,070,210 | 2010-06-18T13:59:00.000 | 1 | 0 | 0 | 1 | python,windows,linux,pdf,file-io | 3,073,958 | 2 | true | 0 | 0 | I ended up resolving it for our situation. As it turns out the process that was writing the files out had them opened exclusively so all we had to do was try opening them for read access - when denied they were in use. | 2 | 8 | 0 | The situation I'm in is this - there's a process that's writing to a file, sometimes the file is rather large say 400 - 500MB. I need to know when it's done writing. How can I determine this? If I look in the directory I'll see it there but it might not be done being written. Plus this needs to be done remotely - as... | Need a way to determine if a file is done being written to | 1.2 | 0 | 1 | 8,480 |
3,070,210 | 2010-06-18T13:59:00.000 | 8 | 0 | 0 | 1 | python,windows,linux,pdf,file-io | 3,070,749 | 2 | false | 0 | 0 | There are probably many approaches you can take. I would try to open the file with write access. If that succeeds then no-one else is writing to that file.
Build a web service around this concept if you don't have direct access to the file between machines. | 2 | 8 | 0 | The situation I'm in is this - there's a process that's writing to a file, sometimes the file is rather large say 400 - 500MB. I need to know when it's done writing. How can I determine this? If I look in the directory I'll see it there but it might not be done being written. Plus this needs to be done remotely - as... | Need a way to determine if a file is done being written to | 1 | 0 | 1 | 8,480 |
3,072,934 | 2010-06-18T20:43:00.000 | 0 | 0 | 0 | 1 | python,linux,bonjour,zeroconf,chatbot | 3,072,977 | 2 | false | 0 | 0 | The easiest thing to do is to use Telepathy Salut or Pidgin/libpurple, and talk with it over D-Bus. | 1 | 0 | 0 | I am trying to set up a Bonjour (or Ahavi) chatbot for our helpdesk system that would answer basic questions based on a menu system. The basis of my question is how do I get python to create the bot so that it connects to the network as a chat client.
Basically, anyone on my network with iChat or Empathy (or any chat p... | ZeroConf Chat with Python | 0 | 0 | 0 | 1,923 |
3,073,151 | 2010-06-18T21:17:00.000 | 0 | 1 | 0 | 0 | python,pamie | 3,098,190 | 1 | true | 0 | 0 | Browsing the CPamie.py file did the trick. Turns out, I didn't even need the page content - PAMIE's findText method lets you match any string on the page. Works great! | 1 | 0 | 0 | I'm using PAMIE to control IE to automatically browse to a list of URLs. I want to find which URLs return IE's malware warning and which ones don't. I'm new to PAMIE, and PAMIE's documentation is non-existent or cryptic at best. How can I get a page's content from PAMIE so I can work with it in Python? | How do I get the page content from PAMIE? | 1.2 | 0 | 1 | 256 |
3,073,429 | 2010-06-18T22:22:00.000 | 0 | 0 | 1 | 0 | python,software-distribution | 4,171,309 | 3 | false | 0 | 0 | While I also use version control to do this, another approach you might consider is to package up the source using whatever package management your host systems use (for example RPMs or dpkgs), and set up the systems to use a custom repository Then an "apt-get upgrade" or "yum update" will update the software on the s... | 1 | 4 | 0 | I have a directory of python programs, classes and packages that I currently distribute to 5 servers. It seems I'm continually going to be adding more servers and right now I'm just doing a basic rsync over from my local box to the servers.
What would a better approach be for distributing code across n servers?
thanks | What is the best way to distribute code across servers? | 0 | 0 | 0 | 486 |
3,073,572 | 2010-06-18T23:02:00.000 | 0 | 0 | 0 | 0 | python,file-upload,pylons | 3,198,887 | 2 | false | 0 | 0 | It's not the file name that's used as a key in request.params, it's the field name that was used in the HTML: <input type="file" name="fieldname"> | 1 | 0 | 0 | Currently, I'm using request.params["filename"] to access uploaded files.
In Pylons, what is the syntax to access a file if you don't know the filename, something like request.files[0]? | pylons file uploading - access 1st file | 0 | 0 | 0 | 596 |
3,074,103 | 2010-06-19T02:38:00.000 | 0 | 1 | 0 | 0 | php,javascript,python | 3,074,113 | 6 | false | 1 | 0 | Looking at your tags, web games are mostly client side, and since you aren't going to use flash, i would say JavaScript would work for 2D. With all the libraries and plug-ins out there, JavaScript can actually handle it. | 4 | 6 | 0 | I'm a basic web developer. I know PHP, a little bit of Python and Ruby. JavaScript as well [some stuff]. I'm not a hardcore developer. I know what it takes do develop most of web cases.
Now, I have this desire to go deeper and start developing games. I know it sounds a huge leap, but that is why I'm asking here. I alre... | From the web to games | 0 | 0 | 0 | 471 |
3,074,103 | 2010-06-19T02:38:00.000 | 0 | 1 | 0 | 0 | php,javascript,python | 3,074,138 | 6 | false | 1 | 0 | Taking a look at OpenGL may not be a terrible idea. You can use the library in many languages, and is supported with in HTML5 (WebGL). There are several excellent tutorials out there. | 4 | 6 | 0 | I'm a basic web developer. I know PHP, a little bit of Python and Ruby. JavaScript as well [some stuff]. I'm not a hardcore developer. I know what it takes do develop most of web cases.
Now, I have this desire to go deeper and start developing games. I know it sounds a huge leap, but that is why I'm asking here. I alre... | From the web to games | 0 | 0 | 0 | 471 |
3,074,103 | 2010-06-19T02:38:00.000 | 0 | 1 | 0 | 0 | php,javascript,python | 3,074,736 | 6 | false | 1 | 0 | If you want to learn more Python while doing so, you may want to take PyGame or an equivalent program. PHP, Ruby and JavaScript aren't going to help you in the video game section, though. They're all related to the internet.
If you want to start of real easy, try out Genesis3D. you can make awesome 3D FPS games, and i... | 4 | 6 | 0 | I'm a basic web developer. I know PHP, a little bit of Python and Ruby. JavaScript as well [some stuff]. I'm not a hardcore developer. I know what it takes do develop most of web cases.
Now, I have this desire to go deeper and start developing games. I know it sounds a huge leap, but that is why I'm asking here. I alre... | From the web to games | 0 | 0 | 0 | 471 |
3,074,103 | 2010-06-19T02:38:00.000 | 3 | 1 | 0 | 0 | php,javascript,python | 3,075,334 | 6 | false | 1 | 0 | Python's Pygame is certainly a good choice as others have said. If you want to get in to deep video game programming though.. move on to something like C++ or another lower level language.. from experience, most higher level languages tend to put artificial hurdles up in regards to decent video games. Though for a simp... | 4 | 6 | 0 | I'm a basic web developer. I know PHP, a little bit of Python and Ruby. JavaScript as well [some stuff]. I'm not a hardcore developer. I know what it takes do develop most of web cases.
Now, I have this desire to go deeper and start developing games. I know it sounds a huge leap, but that is why I'm asking here. I alre... | From the web to games | 0.099668 | 0 | 0 | 471 |
3,074,175 | 2010-06-19T03:15:00.000 | 0 | 0 | 0 | 0 | python,wxpython,virtual,listctrl,treecontrol | 3,074,866 | 3 | false | 0 | 1 | One thing you might do is leave the sub-nodes empty, and catch the expand-node event. Then you check to see if the node's sub-nodes are populated. If they aren't, you add them before expanding the node. If they are populated, you simply ignore the event. | 3 | 0 | 0 | I would like to add 1,000,000+ entries to the root node of a TreeListCtrl. Therefore I would like to make it "virtual", i.e. work just like a virtual ListCtrl so that it's still fast and I can easily scroll around due to the currently-displayed items being loaded on-demand. But I can't use a virtual ListCtrl because I ... | wxPython: VirtualTreeListCtrl with millions of items | 0 | 0 | 0 | 762 |
3,074,175 | 2010-06-19T03:15:00.000 | 0 | 0 | 0 | 0 | python,wxpython,virtual,listctrl,treecontrol | 3,074,875 | 3 | false | 0 | 1 | You're right that the treemixin doesn't make the TreeListCtrl really virtual. I thought about that when I was developing treemixin, but the one thing I didn't know how to solve was how to know which lines to draw to the left of items when the user is looking at items deep down the tree, e.g. 10000 to 10030. If you know... | 3 | 0 | 0 | I would like to add 1,000,000+ entries to the root node of a TreeListCtrl. Therefore I would like to make it "virtual", i.e. work just like a virtual ListCtrl so that it's still fast and I can easily scroll around due to the currently-displayed items being loaded on-demand. But I can't use a virtual ListCtrl because I ... | wxPython: VirtualTreeListCtrl with millions of items | 0 | 0 | 0 | 762 |
3,074,175 | 2010-06-19T03:15:00.000 | 0 | 0 | 0 | 0 | python,wxpython,virtual,listctrl,treecontrol | 3,087,197 | 3 | false | 0 | 1 | I think what I'll do is use a virtual ListCtrl along with a skip-list for the data model. Initially, the data model will contain the 1 million top-layer nodes. When a node is expanded, I can insert its children into the skip-list in log time (much better than the linear time for an array). I will indent the names of th... | 3 | 0 | 0 | I would like to add 1,000,000+ entries to the root node of a TreeListCtrl. Therefore I would like to make it "virtual", i.e. work just like a virtual ListCtrl so that it's still fast and I can easily scroll around due to the currently-displayed items being loaded on-demand. But I can't use a virtual ListCtrl because I ... | wxPython: VirtualTreeListCtrl with millions of items | 0 | 0 | 0 | 762 |
3,076,263 | 2010-06-19T16:27:00.000 | 2 | 0 | 0 | 0 | python,netcat | 3,076,282 | 2 | false | 0 | 0 | Are you sending a "\r\n\r\n" to indicate the end of the request? If you're not, the server's still waiting for the rest of the request. | 1 | 1 | 0 | I am interested in making an HTTP Banner Grabber, but when i connect to a server on port 80 and i send something (e.g. "HEAD / HTTP/1.1") recv doesn't return anything to me like when i do it in let's say netcat..
How would i go about this?
Thanks! | HTTP Banner Grabbing with Python | 0.197375 | 0 | 1 | 2,102 |
3,076,348 | 2010-06-19T16:47:00.000 | 1 | 0 | 1 | 0 | python,pylons | 3,076,407 | 1 | true | 0 | 0 | Do the connections have to belong to a single thread for their lifetime?
If not, you could consider implementing your own connection pool for this resource. The pool would be responsible for initializing connections and each thread would acquire and release the connections as they are needed.
If you want to limit ... | 1 | 1 | 0 | I have a connection to an external resource that I need to make for my Pylons app (think along the lines of a database connection.) There is a modest amount of overhead involved in establishing the connection.
I could setup a piece of middleware that opens and closes the connection with every request but that seems was... | Pylons: Proper Way to Establish Per-Thread/Per-Request Resource? | 1.2 | 0 | 0 | 192 |
3,076,365 | 2010-06-19T16:52:00.000 | 2 | 0 | 0 | 0 | python,ajax,django,django-users | 3,076,590 | 4 | false | 1 | 0 | Django messages might seem like a good starting point, but require contortions to get to where you want to go, and I wouldn't trust that future release of Django wouldn't break your hacks.
Implementing your own UserMessage model will probably serve you better in the long run. That gives you complete, unambiguous contro... | 2 | 11 | 0 | I'd like to use Django's Messages module, however, I would like my messages to persist until the user clicks an X next to the message as opposed to having messages disappear as soon as the user reloads the page.
I am stumped with two issues:
How do I make the messages' context processor not delete the messages once the... | How to make django messages StackOverflow style? | 0.099668 | 0 | 0 | 4,960 |
3,076,365 | 2010-06-19T16:52:00.000 | 8 | 0 | 0 | 0 | python,ajax,django,django-users | 3,084,273 | 4 | true | 1 | 0 | In your case django.contrib.messages won't bring you anywhere good. It's a message system inspired by RoR flash system, where messages aren't supposed to stay around
You should create your own messaging system (django-persistent-messages maybe?) that would save messages for registered users in database.
It's a fairly ... | 2 | 11 | 0 | I'd like to use Django's Messages module, however, I would like my messages to persist until the user clicks an X next to the message as opposed to having messages disappear as soon as the user reloads the page.
I am stumped with two issues:
How do I make the messages' context processor not delete the messages once the... | How to make django messages StackOverflow style? | 1.2 | 0 | 0 | 4,960 |
3,077,010 | 2010-06-19T19:53:00.000 | 0 | 0 | 1 | 0 | python,lxml | 3,077,047 | 2 | true | 0 | 0 | getiterator is the ElementTree standard spelling for this method; iter is an equivalent lxml-only method that will stop your code from working in ElementTree if you need it, and appears to have no redeeming qualities whatsoever except saving you from typing 7 more characters for the method name;-). | 1 | 5 | 0 | As the question says, what would be the difference between:
x.getiterator() and x.iter(), where x is an ElementTree or an Element? Cause it seems to work for both, I have tried it.
If I am wrong somewhere, correct me please. | What is the difference between getiterator() and iter() wrt to lxml | 1.2 | 0 | 1 | 1,970 |
3,077,156 | 2010-06-19T20:38:00.000 | 4 | 0 | 0 | 1 | python,google-app-engine,gql | 3,078,018 | 3 | false | 1 | 0 | An object has a Key, part of which is either an automatically-generated numeric ID, or an assigned key name. IDs are not guaranteed to be increasing, and they're almost never going to be consecutive because they're allocated to an instance in big chunks, and IDs unused by the instance to which they're allocated will n... | 2 | 1 | 0 | I currently work with Google's AppEngine and I could not find out, whether a Google DataStorage Object Entry has an ID by default, and if not, how I add such a field and let it increase automatically?
regards, | Does GQL automatically add an "ID" Property | 0.26052 | 1 | 0 | 282 |
3,077,156 | 2010-06-19T20:38:00.000 | 3 | 0 | 0 | 1 | python,google-app-engine,gql | 3,077,170 | 3 | true | 1 | 0 | Yes, they have id's by default, and it is named ID as you mentioned. | 2 | 1 | 0 | I currently work with Google's AppEngine and I could not find out, whether a Google DataStorage Object Entry has an ID by default, and if not, how I add such a field and let it increase automatically?
regards, | Does GQL automatically add an "ID" Property | 1.2 | 1 | 0 | 282 |
3,078,189 | 2010-06-20T04:15:00.000 | 2 | 1 | 0 | 0 | java,php,python,email,parsing | 3,078,197 | 3 | false | 0 | 0 | Yes... For each language you pointed out, I've used the one in Python myself. Try perusing the library documentation for your chosen library.
(Note: You may be expecting a "nice", high-level library for this parsing... That's a tricky area, email has evolved and grown without much design, there are a lot of dark corn... | 1 | 2 | 0 | Is there a free open-source solution taking raw e-mail message (as a piece of text) and returning each header field, each attachment and the message body as separate fields? | Is there an open-source eMail message (headers, attachments, etc.) parser? | 0.132549 | 0 | 1 | 873 |
3,078,364 | 2010-06-20T05:58:00.000 | 1 | 1 | 0 | 0 | python,lamp | 3,078,415 | 2 | false | 0 | 0 | Language choice is important as you must choose language that you and your team feel the most comfortable with as you must develop mid-large size application. Of course use framework with Python it must be Django, with ASP.NET .NET or MVC.NET whatever you feel better with with Ruby ROR and with PHP there are too large ... | 2 | 3 | 0 | Portal Technology Assessment in which we will be creating a placement portal for the campuses and industry to help place students. The portal will handle large volumes of data and people logging in, approximately 1000 users/day in a concurrent mode.
What technology should i use? PHP with CakePHP as a framework, Ruby on... | How to make a cost effective but scalable site? | 0.099668 | 0 | 0 | 182 |
3,078,364 | 2010-06-20T05:58:00.000 | 2 | 1 | 0 | 0 | python,lamp | 3,078,371 | 2 | true | 0 | 0 | Any of those will do, it really depends on what you know. If you're comfortable with Python, use Django. If you like Ruby go with ROR. These modern frameworks are built to scale, assuming you're not going to be developing something on the scale of facebook then they should suffice.
I personally recommend nginx as your ... | 2 | 3 | 0 | Portal Technology Assessment in which we will be creating a placement portal for the campuses and industry to help place students. The portal will handle large volumes of data and people logging in, approximately 1000 users/day in a concurrent mode.
What technology should i use? PHP with CakePHP as a framework, Ruby on... | How to make a cost effective but scalable site? | 1.2 | 0 | 0 | 182 |
3,078,487 | 2010-06-20T07:17:00.000 | 2 | 0 | 0 | 0 | python,ssl,openssl,m2crypto | 3,078,518 | 2 | false | 1 | 0 | You will need a SSL cert, and let the web server handle the HTTPS. | 1 | 1 | 0 | I'm looking to create an application in Django which will allow for each client to point their domain to my server. At this point, I would want their domain to be accessed via https protocol and have a valid SSL connection. With OpenSSL, more specifically M2Crypto, can I do this right out the gate? Or, do I still need ... | OpenSSL for HTTPS without a certificate | 0.197375 | 0 | 1 | 703 |
3,078,680 | 2010-06-20T08:47:00.000 | 24 | 0 | 1 | 1 | python,c,perl | 3,078,693 | 2 | false | 0 | 0 | Just pass -finstrument-functions to gcc when compiling. See the gcc(1) man page for details. | 1 | 9 | 0 | I have some very large C files, having lots of functions. I need to trace the execution path at run time. There is no way I can trace it through debugging as its a hypervisor code currently running over qemu and doing a lot of binary translations.
Can anyone point me to some script in Perl or Python which can add a pri... | Adding printf to the starting of all functions in a file | 1 | 0 | 0 | 937 |
3,078,704 | 2010-06-20T09:03:00.000 | 0 | 1 | 0 | 0 | python,sockets,proxy | 3,078,730 | 3 | false | 0 | 0 | An IP address corresponds to a device. You can't "connect" to a device in the general sense. You can connect to services on the device identified by ports. So, you find the ip address and port of the proxy server you're interested in and then try connecting to it using a simple socket.connect. If it connects fine, you ... | 2 | 2 | 0 | How can I check if a specific ip address or proxy is alive or dead | how to check if an ip address or proxy is working or not | 0 | 0 | 1 | 4,148 |
3,078,704 | 2010-06-20T09:03:00.000 | 3 | 1 | 0 | 0 | python,sockets,proxy | 3,078,719 | 3 | true | 0 | 0 | Because there may be any level of filtering or translation between you and the remote host, the only way to determine whether you can connect to a specific host is to actually try to connect. If the connection succeeds, then you can, else you can't.
Pinging isn't sufficient because ICMP ECHO requests may be blocked yet... | 2 | 2 | 0 | How can I check if a specific ip address or proxy is alive or dead | how to check if an ip address or proxy is working or not | 1.2 | 0 | 1 | 4,148 |
3,079,344 | 2010-06-20T13:16:00.000 | 17 | 1 | 1 | 0 | python,scons | 3,083,882 | 2 | true | 0 | 0 | You can modify the scons Environment() by just choosing
the version you want:
env = Environment(MSVC_VERSION=<someversion>)
From the scons manpage:
MSVC_VERSION Sets the preferred
version of Microsoft Visual C/C++ to
use.
If $MSVC_VERSION is not set, SCons
will (by default) select the latest
version of Visu... | 1 | 9 | 0 | I have a C++ project which is using boost. The whole project is built using scons + Visual Studio 2008. We've installed Visual Studio 2010 and it turned out scons was attempting to use the later compiler instead of the old one - and failed to build the project as boost and visual studio 2010 don't like each other very ... | Forcing scons to use older compiler? | 1.2 | 0 | 0 | 2,641 |
3,079,368 | 2010-06-20T13:24:00.000 | 0 | 0 | 0 | 0 | python,ruby,django,haml | 3,144,408 | 4 | false | 1 | 0 | While this could end up being more trouble than it is worth, it is PROBABLY possible to leverage the Java or .NET platform and still run your Django application in Jython or IronPython (with some minor adjustments I'm sure) and also be able to leverage Ruby's HAML gem via jRuby or IronRuby.
I'm sure there will be some ... | 2 | 19 | 0 | Ok, so I really love HAML. Particularly, I love the integration with RedCloth and BlueCloth, so I can use Markdown and Textile intermixed with my HAML.
I also love Python and Django.
So, I would like to use HAML with Django. Now, I already understand that there are some attempts at cloning HAML-like syntax in Python ... | Ruby HAML with Django? | 0 | 0 | 0 | 3,831 |
3,079,368 | 2010-06-20T13:24:00.000 | 1 | 0 | 0 | 0 | python,ruby,django,haml | 7,147,104 | 4 | false | 1 | 0 | I strongly recommend that you do not fork any processes out of your django views, because the overhead is significant.
You should have a persistent ruby process to serve your templates for you, and invoke it from your django code. I leave the IPC technology to you, but the obvious choices would either be some kind of ... | 2 | 19 | 0 | Ok, so I really love HAML. Particularly, I love the integration with RedCloth and BlueCloth, so I can use Markdown and Textile intermixed with my HAML.
I also love Python and Django.
So, I would like to use HAML with Django. Now, I already understand that there are some attempts at cloning HAML-like syntax in Python ... | Ruby HAML with Django? | 0.049958 | 0 | 0 | 3,831 |
3,079,409 | 2010-06-20T13:36:00.000 | 0 | 0 | 0 | 0 | python,image,wxpython,image-manipulation | 11,616,749 | 2 | false | 0 | 1 | You could always use PIL, it has a function to do this. Save the image in memory and convert it into an wx.Bitmap. | 1 | 1 | 0 | I have one wx.emptybitmap (1) and one wx.bitmap (2). I want to merge(join) them..
I want to create a single wx.bitmap that consists on the wx.emptybitmap (1) on the top and wx.bitmap (2) on the bottom.
How can I do that?
Thanks in advance! :D | How to merge (join) two wx.bitmap using wxpython? | 0 | 0 | 0 | 1,043 |
3,079,531 | 2010-06-20T14:15:00.000 | 8 | 1 | 0 | 0 | python,ruby | 3,079,547 | 4 | true | 1 | 0 | If you develop for the .NET Framework Version 4.0, you can write code in IronRuby that calls methods that were written in IronPython and vice versa. | 1 | 8 | 0 | Is there something like JRuby but for Ruby and Python?
Not that it would actually be useful to me, but just wondering. | Can I use Ruby and Python together? | 1.2 | 0 | 0 | 662 |
3,080,019 | 2010-06-20T16:40:00.000 | 0 | 0 | 1 | 1 | python,macos | 3,081,478 | 4 | false | 0 | 0 | FWIW, mod_wsgi is developed on MacOS X. My experience in supporting users of mod_wsgi is however that MacPorts and fink are an absolute PITA. Specifically, trying to use Python and Apache from those third party systems usually causes nothing but hurt. This is based on problems encountered over the last couple of years.... | 3 | 3 | 0 | I am programming a django based website. I actually use a small computer under Ubuntu 10.04.
I would like to buy something more professional, so I am wondering whether an iMac is good for that, because :
Is there a free IDE as good as eclipse on MacOS ?
Is there a remote python debugger like pydev for eclipse ?
Is the... | is mac good for python programming? | 0 | 0 | 0 | 3,465 |
3,080,019 | 2010-06-20T16:40:00.000 | 5 | 0 | 1 | 1 | python,macos | 3,080,040 | 4 | false | 0 | 0 | All of the things you mentioned (Eclipse+plugins, Python, Apache, mod_wsgi) can run fine on OS X. | 3 | 3 | 0 | I am programming a django based website. I actually use a small computer under Ubuntu 10.04.
I would like to buy something more professional, so I am wondering whether an iMac is good for that, because :
Is there a free IDE as good as eclipse on MacOS ?
Is there a remote python debugger like pydev for eclipse ?
Is the... | is mac good for python programming? | 0.244919 | 0 | 0 | 3,465 |
3,080,019 | 2010-06-20T16:40:00.000 | 6 | 0 | 1 | 1 | python,macos | 3,080,121 | 4 | true | 0 | 0 | Why do you consider iMac to be more or less professional than anything else? Hardware? System?
Note: I'm myself a MacOSX and Linux user.
Unless it's a requisite, most times I'd say it's only a matter of personal taste.
As said by others earlier, everything you cited works fine on MacOSX.
However, you should consider th... | 3 | 3 | 0 | I am programming a django based website. I actually use a small computer under Ubuntu 10.04.
I would like to buy something more professional, so I am wondering whether an iMac is good for that, because :
Is there a free IDE as good as eclipse on MacOS ?
Is there a remote python debugger like pydev for eclipse ?
Is the... | is mac good for python programming? | 1.2 | 0 | 0 | 3,465 |
3,080,185 | 2010-06-20T17:19:00.000 | 0 | 1 | 1 | 0 | c++,boost,boost-python | 3,139,385 | 2 | false | 0 | 0 | I don't know well shared library, but what works for me is to import all my modules, which can reference with each others, within python: import libA; import libB.
It is of course possible to put these imports in an __init__.py file, so that whitin python you just have to do: import myLib. | 1 | 5 | 0 | I have wondered about this on and off but I never really got a definite answer. Is it possible within the boost.python framework to link against another boost.python module.
For example I have exported class A within boost_python_module(libA) and function B(A a) within boost_python_module(libB). Is it possible to spec... | How to link to existing boost python module | 0 | 0 | 0 | 1,552 |
3,080,563 | 2010-06-20T19:05:00.000 | 2 | 0 | 0 | 1 | python | 38,031,055 | 2 | false | 0 | 0 | Other options to exit the help screen would be to type any one of the following(as described in the help section)
q,:q,Q,:Q and ZZ
.These can be seen when you press 'h' once you are on the help screen | 1 | 44 | 0 | when the help window pops up, what are the basic commands (mac os) to page up/down, end of document and exiting the help screen?
I just had to close my terminal as I couldn't figure it out! | How to exit when viewing python help like help(os.listdir) | 0.197375 | 0 | 0 | 40,312 |
3,080,918 | 2010-06-20T20:58:00.000 | 12 | 0 | 1 | 0 | python,python-3.x,tkinter | 3,081,089 | 4 | false | 0 | 1 | Tkinter in python 2.6 is capitalized, in python 3 it is lowercase, tkinter | 1 | 18 | 0 | When I type from Tkinter import ttk it says that there is no module named ttk, and also on many websites online the t in tkinter is always lowercase, but when I type tkinter in Python it throws an error. Why is that? | Why can't I use ttk in Python? | 1 | 0 | 0 | 54,493 |
3,081,412 | 2010-06-20T23:58:00.000 | 1 | 0 | 0 | 0 | python | 3,081,567 | 3 | false | 1 | 0 | +1 for a good question.
Web development is not much different to any other development.
P.20 of that venerable classic breaks a typical project down into 1/3 planning, 1/6 coding, 1/4 component test and 1/4 system test. I might catch some flak for that, YMMV and all, but that looks about right to me.
Whether or not you... | 2 | 5 | 0 | Note: I use TRAC integrated with SVN, framework testing tools, an excellent mixture of staging servers, development servers, and other tools to speed development and keep track of tasks.
I am asking about the specific process of design, and even more specifically, the design of functionality and flow in a web applicati... | What methods and tools do you use to design and analyze the workflow in a web application (for a tiny team) | 0.066568 | 0 | 0 | 141 |
3,081,412 | 2010-06-20T23:58:00.000 | 1 | 0 | 0 | 0 | python | 3,097,921 | 3 | true | 1 | 0 | Pencils!
Seriously, we use JIRA to track work/issue, Confluence to track requirements before they're baked enough to put in JIRA.. Anything to scratch together wire-frames, etc. (Including OmniGraffle, and Pencils).
I find the combination of JIRA and Confluence for tracking chunks of work and longer-lived concepts and ... | 2 | 5 | 0 | Note: I use TRAC integrated with SVN, framework testing tools, an excellent mixture of staging servers, development servers, and other tools to speed development and keep track of tasks.
I am asking about the specific process of design, and even more specifically, the design of functionality and flow in a web applicati... | What methods and tools do you use to design and analyze the workflow in a web application (for a tiny team) | 1.2 | 0 | 0 | 141 |
3,081,500 | 2010-06-21T00:25:00.000 | 0 | 0 | 1 | 0 | python | 3,081,579 | 4 | false | 0 | 0 | I'm a bit late to the party, but also check out the namedtuple function in the collections module. It lets you access fields of a tuple as if they were named members of a class, and it's nice when all you want is a C-style "structure". Of course, tuples are immutable so you'd probably have to rearrange your existing co... | 1 | 2 | 0 | This is a silly question, but I can't figure it out so I had to ask.
I'm editing some Python code and to avoid getting too complicated, I need to be able to define a new variable along the lines of : Car.store = False.
Variable Car has not been defined in this situation. I know I can do dicts (Car['store'] = False) etc... | using 'variable.xyz' format in Python | 0 | 0 | 0 | 372 |
3,081,661 | 2010-06-21T01:27:00.000 | -2 | 1 | 1 | 0 | ironpython | 3,082,237 | 4 | false | 0 | 1 | Based on my understanding both languages will be compiled into MSIL so theoretically the performance of the application should be identical or very close, but there is a lot more to it, the human factor.
I can assure you that a program I write in C# could be a lot faster that the same program in iron-python not because... | 1 | 7 | 0 | Am trying to provide a response from a Managers perspective to the question: What overall performance penalty will we incur if we write the application in IronPython instead of C#?
This question is directed at those who might have already undertaken some testing, benchmarking or have completed a migration from C# to Ir... | Speed of code execution: IronPython vs C#? | -0.099668 | 0 | 0 | 8,794 |
3,081,749 | 2010-06-21T02:05:00.000 | 0 | 0 | 0 | 0 | python,tkinter | 3,084,235 | 1 | false | 0 | 0 | Every object in a canvas has an id. You can reference that object by that id to delete it, modify it, move it, etc.
Objects can also have one or more tags. A tag can be associated with a single object, in which case it is just another name for that object. For example, if you draw a red rectangle and a blue rectangle, ... | 1 | 1 | 0 | i tried to figure out what tags were in canvas however i am having a hard time understanding it. can someone explain what tags do and how to use them in canvas when using python. | can someone help me with tags in canvas? | 0 | 0 | 0 | 186 |
3,082,107 | 2010-06-21T04:25:00.000 | 1 | 1 | 0 | 0 | python,mercurial,bitbucket | 3,082,132 | 3 | false | 0 | 0 | If you don't have mercurial available locally then you may as well pull the tarball instead, available behind the "get source" option towards the top-right corner of various pages, underneath "Forks/Queues". | 1 | 3 | 0 | I was wondering if it was possible to pull a private mercurial repo to a server without access to hg. I have SSH access, but do not have the ability to install HG. I was thinking some kind of Python script that used http access or something, but I wasn't sure. I was also thinking this might only be possible with public... | How to pull a BitBucket repository without access to hg | 0.066568 | 0 | 0 | 3,457 |
3,082,502 | 2010-06-21T06:25:00.000 | 0 | 0 | 0 | 0 | python,pyqt,document | 3,082,556 | 5 | false | 1 | 0 | Creating XML documents, transforming them to XSL/fo and rendering with Fop or RenderX. If you use docbook as the primary input, there are toolchains freely available for converting that to PDF, RTF, HTML and so forth.
It is rather quirky to use and not my idea of fun, but is does deliver and can be embedded in an appl... | 1 | 3 | 0 | I'm writing a program that requires input in the form of a document, it needs to replace a few values, insert a table, and convert it to PDF. It's written in Python + Qt (PyQt). Is there any well known document standard which can be easily used programmatically? It must be cross platform, and preferably open.
I have l... | What's a good document standard to use programmatically? | 0 | 0 | 0 | 581 |
3,083,167 | 2010-06-21T08:47:00.000 | 0 | 1 | 1 | 0 | c#,python,cpython | 3,083,261 | 1 | true | 0 | 1 | If you need strict CPython behavior and do not want to change Python program I am afraid that in this case you should spawn separate CPython process and interact with it via some RPC protocol (there are plenty to choose from) via pipe or network connection to localhost.
As alternative to "serialized" RPC you might use... | 1 | 0 | 0 | If it doesn't use ironpython, how C# use cpython program(py file)?
Because there are some bugs that ironpython load cpython code. | How C# use python program? | 1.2 | 0 | 0 | 189 |
3,083,366 | 2010-06-21T09:16:00.000 | 1 | 0 | 0 | 0 | python,django,aes,pycrypto | 3,085,685 | 1 | false | 1 | 0 | You'll need to build pycrypto before you upload it. This will need to be done on a machine with as similar an environment to your server as possible.
To build, run python setup.py build from inside the pycrypto-2.1.0 directory. This will create build\lib.win32-2.6\Crypto (the name of the libxxx directory might be a lit... | 1 | 0 | 0 | I'm using Django in order to serve a web service. I have only access to FTP and code refresh at the moment. No access to command-line or executing any kind of executable.
I am using a Windows Server 2005 machine.
Would I be able to use Crypto just by placing the folder within my Django project?
Are there any good alter... | Using Crypto by placing folder in python path? - Python | 0.197375 | 0 | 0 | 317 |
3,083,784 | 2010-06-21T10:17:00.000 | 0 | 0 | 0 | 0 | python,tags,visualization,keyword | 3,250,807 | 1 | false | 1 | 0 | What you have is a rough 1st order approximation. I think if you then go back through the data and search for frequency of 2-word phrases, then 3 word phrases, up till the total number of words that can be considered a tag, you'll get a better representation of keyword frequency.
You can refine this rough search patter... | 1 | 1 | 0 | I have to build a tag cloud out of a webpage/feed. Once you get the word frequency table of tags, it's easy to build the tagcloud. But my doubt is how do I retrieve the tags/keywords from the webpage/feed?
This is what I'm doing now:
Get the content -> strip HTML -> split them with \s\n\t(space,newline,tab) -> Keyword... | How do I get tags/keywords from a webpage/feed? | 0 | 0 | 1 | 226 |
3,084,303 | 2010-06-21T11:41:00.000 | -1 | 1 | 0 | 0 | php,python | 69,296,576 | 5 | false | 0 | 0 | Better you have to do, use api, different application like one application on python server having python application and one server having php application with api. Like you store or delete data by using api in android or ios. | 1 | 14 | 0 | I have a VPS Linux webserver with PHP installed.
I want to code some search engine or data mining stuff in one application which I am thinking of building in python.
I want to know if it is possible to use python and php together like calling functions of python in php and vice versa.
As it is my VPS server, I can inst... | Is it possible to use Python with php | -0.039979 | 0 | 0 | 31,647 |
3,084,627 | 2010-06-21T12:34:00.000 | 1 | 0 | 0 | 0 | python,lxml | 3,084,858 | 1 | true | 0 | 0 | XPath is usually preferable to an explicit iteration over elements. XPath is more succinct, and will likely be faster since it is implemented inside the XML engine.
You'd want to use an explicit iteration if there were complex criteria that couldn't be expressed easily (or at all) in XPath, or if you needed to visit a... | 1 | 1 | 0 | This follows my previous questions on using lxml and Python.
I have a question, as to when I have a choice between using the methods provided by the lxml.etree and where I can make use of XPath, what should I use?
For example, to get a list of all the X tags in a XML document, I could either iterate through it using t... | Confused about using XPath or not | 1.2 | 0 | 1 | 96 |
3,084,850 | 2010-06-21T13:01:00.000 | 1 | 0 | 0 | 0 | python,selenium | 3,103,295 | 3 | false | 1 | 0 | as far as I know you have to use always in alerts
selenium.get_confirmation()
from python doc:
If an confirmation is generated but you do not consume it with getConfirmation, the next Selenium action will fail. | 1 | 2 | 0 | I'm working with selenium.
while trying to click a button it creates a pop up (alert) and doesn’t return a page object.
Because of that I can’t use “click” alone as this method expects a page object and eventually fails because of a timeout.
I can use the “chooseOkOnNextConfirmation()” but this will click the pop up an... | How to click and verify the existence of a pop up (alert) | 0.066568 | 0 | 1 | 3,169 |
3,085,029 | 2010-06-21T13:26:00.000 | 6 | 0 | 0 | 0 | python,json,xml,google-app-engine,configuration-files | 3,086,515 | 4 | false | 1 | 0 | Note, this is pure opinion and speculation on my part but I suspect that the single biggest reason for the plethora of formats is likely due to the lack of a readily available, omnipresent configuration file parsing library. Lacking that, most programs have to write their own parsers so it would often come down to bala... | 4 | 52 | 0 | I've seen people using *.cfg (Python Buildout), *.xml (Gnome), *.json (Chrome extension), *.yaml (Google App Engine), *.ini and even *.py for app configuration files (like Django).
My question is: why there are so many different configuration file formats? I can see an advantage from a xml vs json approach (much less v... | Pros and cons for different configuration formats? | 1 | 0 | 0 | 21,947 |
3,085,029 | 2010-06-21T13:26:00.000 | 32 | 0 | 0 | 0 | python,json,xml,google-app-engine,configuration-files | 3,086,617 | 4 | true | 1 | 0 | It's mostly personal preference, purpose, and available libraries. Personally I think xml is way too verbose for config files, but it is popular and has great libraries.
.cfg, .ini are legacy formats that work well and many languages have an included library that reads them. I've used it in Java, Python, C++ without is... | 4 | 52 | 0 | I've seen people using *.cfg (Python Buildout), *.xml (Gnome), *.json (Chrome extension), *.yaml (Google App Engine), *.ini and even *.py for app configuration files (like Django).
My question is: why there are so many different configuration file formats? I can see an advantage from a xml vs json approach (much less v... | Pros and cons for different configuration formats? | 1.2 | 0 | 0 | 21,947 |
3,085,029 | 2010-06-21T13:26:00.000 | 1 | 0 | 0 | 0 | python,json,xml,google-app-engine,configuration-files | 59,535,927 | 4 | false | 1 | 0 | It really depends on whether the reader/writer of the configuration file is, or can be, a non-programmer human or if it has strictly programmatic access.
XML, JSON, etc., are totally unsuitable for human consumption, while the INI format is half-way reasonable for humans.
If the configuration file has only programmatic... | 4 | 52 | 0 | I've seen people using *.cfg (Python Buildout), *.xml (Gnome), *.json (Chrome extension), *.yaml (Google App Engine), *.ini and even *.py for app configuration files (like Django).
My question is: why there are so many different configuration file formats? I can see an advantage from a xml vs json approach (much less v... | Pros and cons for different configuration formats? | 0.049958 | 0 | 0 | 21,947 |
3,085,029 | 2010-06-21T13:26:00.000 | 0 | 0 | 0 | 0 | python,json,xml,google-app-engine,configuration-files | 62,036,718 | 4 | false | 1 | 0 | According to Python official docs, 'future enhancements to configuration functionality will
be added to dictConfig()'.
So any config file which can be used with dictconfig() should be fine. | 4 | 52 | 0 | I've seen people using *.cfg (Python Buildout), *.xml (Gnome), *.json (Chrome extension), *.yaml (Google App Engine), *.ini and even *.py for app configuration files (like Django).
My question is: why there are so many different configuration file formats? I can see an advantage from a xml vs json approach (much less v... | Pros and cons for different configuration formats? | 0 | 0 | 0 | 21,947 |
3,086,467 | 2010-06-21T16:29:00.000 | 17 | 0 | 1 | 0 | java,python,ruby,multithreading | 3,088,843 | 13 | false | 1 | 0 | A confused question with a lot of confused answers...
First, threading and concurrent execution are different things. Python supports threads just fine; it doesn't support concurrent execution in any real-world implementation. (In all serious implementations, only one VM thread can execute at a time; the many attempt... | 9 | 61 | 0 | I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server h... | Confused, are languages like python, ruby single threaded? unlike say java? (for web apps) | 1 | 0 | 0 | 37,252 |
3,086,467 | 2010-06-21T16:29:00.000 | 6 | 0 | 1 | 0 | java,python,ruby,multithreading | 3,086,520 | 13 | false | 1 | 0 | Certainly the webserver will have a pool of threads. That's only outside the control of your program. Those threads are used to handle HTTP requests. Each HTTP request is handled in a separate thread and the thread is released back to pool when the associated HTTP response is finished. If the webserver doesn't have suc... | 9 | 61 | 0 | I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server h... | Confused, are languages like python, ruby single threaded? unlike say java? (for web apps) | 1 | 0 | 0 | 37,252 |
3,086,467 | 2010-06-21T16:29:00.000 | 60 | 0 | 1 | 0 | java,python,ruby,multithreading | 3,086,582 | 13 | true | 1 | 0 | Both Python and Ruby have full support for multi-threading. There are some implementations (e.g. CPython, MRI, YARV) which cannot actually run threads in parallel, but that's a limitation of those specific implementations, not the language. This is similar to Java, where there are also some implementations which cannot... | 9 | 61 | 0 | I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server h... | Confused, are languages like python, ruby single threaded? unlike say java? (for web apps) | 1.2 | 0 | 0 | 37,252 |
3,086,467 | 2010-06-21T16:29:00.000 | 4 | 0 | 1 | 0 | java,python,ruby,multithreading | 3,086,550 | 13 | false | 1 | 0 | Most languages don't define single or multithreading. Usually, that is left up to the libraries to implement.
That being said, some languages are better at it than others. CPython, for instance, has issues with interpreter locking during multithreading, Jython (python running on the JVM) does not.
Some of the real powe... | 9 | 61 | 0 | I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server h... | Confused, are languages like python, ruby single threaded? unlike say java? (for web apps) | 0.061461 | 0 | 0 | 37,252 |
3,086,467 | 2010-06-21T16:29:00.000 | 0 | 0 | 1 | 0 | java,python,ruby,multithreading | 3,086,571 | 13 | false | 1 | 0 | How to untangle the knots in al those threads...
Clojure did not invent threading, however it has particularly strong support for it with Software Transactional Memory, Atoms, Agents, parallel map operations, ...
All other have accumulated threading support. Ruby is a special case as it has green threads in some implem... | 9 | 61 | 0 | I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server h... | Confused, are languages like python, ruby single threaded? unlike say java? (for web apps) | 0 | 0 | 0 | 37,252 |
3,086,467 | 2010-06-21T16:29:00.000 | 5 | 0 | 1 | 0 | java,python,ruby,multithreading | 3,086,584 | 13 | false | 1 | 0 | The short answer is yes, they are single threaded.
The long answer is it depends.
JRuby is multithreaded and can be run in tomcat like other java code. MRI (default ruby) and Python both have a GIL (Global Interpreter Lock) and are thus single threaded.
The way it works for web servers is further complicated by the ... | 9 | 61 | 0 | I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server h... | Confused, are languages like python, ruby single threaded? unlike say java? (for web apps) | 0.076772 | 0 | 0 | 37,252 |
3,086,467 | 2010-06-21T16:29:00.000 | 0 | 0 | 1 | 0 | java,python,ruby,multithreading | 3,086,920 | 13 | false | 1 | 0 | Reading these answers here... A lot of them try to sound smarter than they really are imho (im mostly talking about Ruby related stuff as thats the one i'm most familiar with).
In fact, JRuby is currently the only Ruby implementation that supports true concurrency. On JVM Ruby threads are mapped to OS native threads, w... | 9 | 61 | 0 | I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server h... | Confused, are languages like python, ruby single threaded? unlike say java? (for web apps) | 0 | 0 | 0 | 37,252 |
3,086,467 | 2010-06-21T16:29:00.000 | 0 | 0 | 1 | 0 | java,python,ruby,multithreading | 3,087,997 | 13 | false | 1 | 0 | Yes Ruby and Python can handle multi-threading, but for many cases (web) is better to rely on the threads generated by the http requests from the client to the server. Even if you generate many threads on a same application to low the runtime cost or to handle many task at time, in a web application case that's usually... | 9 | 61 | 0 | I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server h... | Confused, are languages like python, ruby single threaded? unlike say java? (for web apps) | 0 | 0 | 0 | 37,252 |
3,086,467 | 2010-06-21T16:29:00.000 | 1 | 0 | 1 | 0 | java,python,ruby,multithreading | 60,181,609 | 13 | false | 1 | 0 | keeping this very short..
Python supports Multi Threading.
Python does NOT support parallel execution of its Threads.
Exception:
Above statement may vary with implementations of Python not using GIL (Global Interpreter Locking).
If a particular implementation is not using GIL, then, that would be Multi Threaded as we... | 9 | 61 | 0 | I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server h... | Confused, are languages like python, ruby single threaded? unlike say java? (for web apps) | 0.015383 | 0 | 0 | 37,252 |
3,088,449 | 2010-06-21T20:55:00.000 | 1 | 0 | 1 | 0 | multithreading,background,python | 3,089,339 | 1 | true | 0 | 0 | You don't have to explicitly join threads -- just make sure they're not "daemonized" (leave their daemon attribute to the default, False) so they'll keep the process alive until they're all done (if you make your threads daemons, then you must make sure the main thread does not terminate until all relevant threads are ... | 1 | 2 | 0 | I need to start some threads in a python program. The threads perform a background task which might take a long time, so I don't want to block the main thread waiting on the task to happen.
Python provides the ability to 'reap' threads using Thread.join() and Thread.isAlive(). But I don't actually care about finding ou... | explicit joining of python threads? | 1.2 | 0 | 0 | 341 |
3,088,493 | 2010-06-21T21:01:00.000 | 8 | 0 | 1 | 1 | python,arguments | 3,088,518 | 2 | true | 0 | 0 | It takes any options for python.exe itself, then the name of the file (or command or module), then any arguments to be passed to your program.
If no file is specified, it puts you in interactive mode.
As indicated in the comments by Adam, type python -h to see the full list. | 1 | 7 | 0 | does it take the filename of the .py and then what? | what does python.exe take as arguments? | 1.2 | 0 | 0 | 12,210 |
3,089,450 | 2010-06-22T00:41:00.000 | 0 | 1 | 0 | 0 | python | 3,089,472 | 6 | false | 0 | 0 | You could also use Google App Engine with Python and Django | 1 | 2 | 0 | I have read in the documentation that there are 4 or 5 ways in which i can python for web pages. Like
With CGI
Mod_python : mod_python does have some problems. Unlike the PHP interpreter, the Python interpreter uses caching when executing files, so changes to a file will require the web server to be restarted
FastCGI... | How to use python on webserver for web pages | 0 | 0 | 0 | 825 |
3,091,166 | 2010-06-22T07:39:00.000 | 0 | 0 | 0 | 1 | python,fuse | 7,040,661 | 3 | false | 0 | 0 | Copy is as Weholt said: difficult to trap because it is basically the same as creating a new file and writing to it.
Move is the same operation as a rename. | 2 | 2 | 0 | I`m implementing a custom filesystem on Ubuntu using Fuse, but I need to trap when a copy or move operation occur. Right now all I see are when some file are opened for writing or reading, but I need to see these operations in context so I can see what file are being copied or moved.
Any hints? | How to trap a copy/move-file operation in a custom filesystem based on Fuse? | 0 | 0 | 0 | 1,016 |
3,091,166 | 2010-06-22T07:39:00.000 | 0 | 0 | 0 | 1 | python,fuse | 3,091,286 | 3 | false | 0 | 0 | What you want to do is probably not easily done, considering that a "copy" or "move" program could do just what you see - open a file and write to it. That's a perfectly good way of copying a file.
Even if you can see what actual binary is doing it, that wouldn't give you enough information to know if this was a copy, ... | 2 | 2 | 0 | I`m implementing a custom filesystem on Ubuntu using Fuse, but I need to trap when a copy or move operation occur. Right now all I see are when some file are opened for writing or reading, but I need to see these operations in context so I can see what file are being copied or moved.
Any hints? | How to trap a copy/move-file operation in a custom filesystem based on Fuse? | 0 | 0 | 0 | 1,016 |
3,093,598 | 2010-06-22T13:36:00.000 | 1 | 1 | 0 | 0 | python,continuous-integration,build-automation,buildbot,nightly-build | 12,307,055 | 2 | true | 0 | 0 | If you use Nightly, then you can specify that the scheduler only trigger if there are interesting changes to build. Presumably, you won't have commits during that period either, so it will not trigger builds then. | 2 | 0 | 0 | Buildbots Periodic scheduler triggers builds at fixed intervals (e.g. every 30 minutes). But there are certain times (e.g. at night, during the weekend or while regular maintenance is performed) where I'd like it to relax.
Is there a way to have a more fine-grained description for the Periodic scheduler? Or should I ra... | Exceptions from Buildbots PeriodicScheduler intervals? | 1.2 | 0 | 0 | 56 |
3,093,598 | 2010-06-22T13:36:00.000 | 0 | 1 | 0 | 0 | python,continuous-integration,build-automation,buildbot,nightly-build | 6,169,869 | 2 | false | 0 | 0 | One way to solve this would of course be to write a piece of python code that generates the build times for up the nightly scheduler according to some rules. | 2 | 0 | 0 | Buildbots Periodic scheduler triggers builds at fixed intervals (e.g. every 30 minutes). But there are certain times (e.g. at night, during the weekend or while regular maintenance is performed) where I'd like it to relax.
Is there a way to have a more fine-grained description for the Periodic scheduler? Or should I ra... | Exceptions from Buildbots PeriodicScheduler intervals? | 0 | 0 | 0 | 56 |
3,094,331 | 2010-06-22T14:51:00.000 | 9 | 0 | 1 | 0 | python,vim | 3,098,250 | 7 | true | 0 | 0 | This is a bit of a dirty hack, but you can go through the python syntax file (:sp $VIMRUNTIME/syntax/python.vim) and find all the syntax regions for triple-quoted strings (search for ''' and """) and add the fold keyword to the end of those statements. Then just set foldmethod=syntax for python files and the comments s... | 2 | 9 | 0 | Does anybody know of a method, or perhaps a plugin, that will
automatically fold long docstrings in Python? I have docstrings in my
code that span several pages, so it is troublesome to keep paging
through them. The other tricky part is that there is embedded python
testing code in the docstrings, so that might mak... | How to fold long docstrings in python source code in VIM? | 1.2 | 0 | 0 | 2,528 |
3,094,331 | 2010-06-22T14:51:00.000 | 0 | 0 | 1 | 0 | python,vim | 3,098,317 | 7 | false | 0 | 0 | You can do this with :set foldmethod=marker foldmarker=""",""", I think. I haven't tested it, but that should do the trick. The arguments to foldmarker are start and end markers. | 2 | 9 | 0 | Does anybody know of a method, or perhaps a plugin, that will
automatically fold long docstrings in Python? I have docstrings in my
code that span several pages, so it is troublesome to keep paging
through them. The other tricky part is that there is embedded python
testing code in the docstrings, so that might mak... | How to fold long docstrings in python source code in VIM? | 0 | 0 | 0 | 2,528 |
3,094,618 | 2010-06-22T15:29:00.000 | 1 | 0 | 1 | 0 | python,file | 3,094,661 | 3 | false | 0 | 0 | A 4MB file is very small, it fits in memory for sure. The fastest approach would be to read it all and then iterate over each line searching for the pattern, writing out the line to the appropriate file depending on the pattern (your approach for small files.) | 1 | 1 | 0 | I have file about 4MB (which i called as big one)...this file has about 160000 lines..in a specific format...and i need to cut them at regular interval(not at equal intervals) i.e at the end of a certain format and write the part into another file..
Basically,what i wanted is to copy the information for the big file in... | how to load a big file and cut it into smaller files? | 0.066568 | 0 | 0 | 246 |
3,094,693 | 2010-06-22T15:37:00.000 | 0 | 1 | 1 | 0 | visual-studio-2010,ironpython | 3,094,718 | 2 | false | 0 | 0 | You should be able to just right click the folder, choose "Exclude from Project"
Then, make sure "Show all files" is NOT on at the top, by the solution. | 2 | 2 | 0 | I'm working on an IronPython project on VS2010 and I've notice that for the python project (which is setup as a Console project, but really just contains a number of scripts that are hosted in a C# app), everything that is in the project directory will show up in the VS solution explorer under that project. So, for ex... | Hide .svn folders in a VS2010 IronPython project | 0 | 0 | 0 | 284 |
3,094,693 | 2010-06-22T15:37:00.000 | 2 | 1 | 1 | 0 | visual-studio-2010,ironpython | 3,098,784 | 2 | true | 0 | 0 | Currently we have a directory based project system - which as you have seen includes all of the files in the project dir. We were planning on having an exclude option but the feedback we've been hearing so far is that we should move to a normal VS project model where you need to explicitly add the files. The next CTP... | 2 | 2 | 0 | I'm working on an IronPython project on VS2010 and I've notice that for the python project (which is setup as a Console project, but really just contains a number of scripts that are hosted in a C# app), everything that is in the project directory will show up in the VS solution explorer under that project. So, for ex... | Hide .svn folders in a VS2010 IronPython project | 1.2 | 0 | 0 | 284 |
3,095,057 | 2010-06-22T16:23:00.000 | 0 | 1 | 0 | 0 | php,python,sql,regex,perl | 3,209,792 | 5 | false | 0 | 0 | If you wanted to do this a lot and with some reliability, you might want to use a semi-advanced approach like a "bag of words" technique. I actually sat down and wrote a sketch of a more-or-less working (if horribly unoptimized) algorithm to do it, but I'm not sure if it would really be appropriate to include here. The... | 2 | 4 | 0 | somewhat open ended question here as I am mostly looking for opinions. I am grabbing some data from craigslist for apt ads in my area since I am looking to move. My goal is to be able to compare items to see when something is a duplicate so that I don't spend all day looking at the same 3 ads. The problem is that th... | What is the easiest method to compare large amounts of similar text? | 0 | 0 | 0 | 387 |
3,095,057 | 2010-06-22T16:23:00.000 | 2 | 1 | 0 | 0 | php,python,sql,regex,perl | 3,209,571 | 5 | true | 0 | 0 | You could calculate the Levenshtein difference between both strings - after some sane normalizing like minimizing duplicate whitespace and what not. After you run through enough "duplicates" you should get an idea of what your threshold is - then you can run Levenshtein on all new incoming data and if its less-than-equ... | 2 | 4 | 0 | somewhat open ended question here as I am mostly looking for opinions. I am grabbing some data from craigslist for apt ads in my area since I am looking to move. My goal is to be able to compare items to see when something is a duplicate so that I don't spend all day looking at the same 3 ads. The problem is that th... | What is the easiest method to compare large amounts of similar text? | 1.2 | 0 | 0 | 387 |
3,095,071 | 2010-06-22T16:24:00.000 | 7 | 1 | 1 | 0 | python,python-import | 3,095,108 | 6 | false | 0 | 0 | Importing inside a function will effectively import the module once.. the first time the function is run.
It ought to import just as fast whether you import it at the top, or when the function is run. This isn't generally a good reason to import in a def. Pros? It won't be imported if the function isn't called.. This i... | 5 | 222 | 0 | What are the pros and cons of importing a Python module and/or function inside of a function, with respect to efficiency of speed and of memory?
Does it re-import every time the function is run, or perhaps just once at the beginning whether or not the function is run? | In Python, what happens when you import inside of a function? | 1 | 0 | 0 | 145,145 |
3,095,071 | 2010-06-22T16:24:00.000 | 8 | 1 | 1 | 0 | python,python-import | 3,096,179 | 6 | false | 0 | 0 | Might I suggest in general that instead of asking, "Will X improve my performance?" you use profiling to determine where your program is actually spending its time and then apply optimizations according to where you'll get the most benefit?
And then you can use profiling to assure that your optimizations have actually ... | 5 | 222 | 0 | What are the pros and cons of importing a Python module and/or function inside of a function, with respect to efficiency of speed and of memory?
Does it re-import every time the function is run, or perhaps just once at the beginning whether or not the function is run? | In Python, what happens when you import inside of a function? | 1 | 0 | 0 | 145,145 |
3,095,071 | 2010-06-22T16:24:00.000 | 3 | 1 | 1 | 0 | python,python-import | 3,095,106 | 6 | false | 0 | 0 | It imports once when the function is called for the first time.
I could imagine doing it this way if I had a function in an imported module that is used very seldomly and is the only one requiring the import. Looks rather far-fetched, though... | 5 | 222 | 0 | What are the pros and cons of importing a Python module and/or function inside of a function, with respect to efficiency of speed and of memory?
Does it re-import every time the function is run, or perhaps just once at the beginning whether or not the function is run? | In Python, what happens when you import inside of a function? | 0.099668 | 0 | 0 | 145,145 |
3,095,071 | 2010-06-22T16:24:00.000 | 20 | 1 | 1 | 0 | python,python-import | 3,095,095 | 6 | false | 0 | 0 | It imports once when the function executes first time.
Pros:
imports related to the function they're used in
easy to move functions around the package
Cons:
couldn't see what modules this module might depend on | 5 | 222 | 0 | What are the pros and cons of importing a Python module and/or function inside of a function, with respect to efficiency of speed and of memory?
Does it re-import every time the function is run, or perhaps just once at the beginning whether or not the function is run? | In Python, what happens when you import inside of a function? | 1 | 0 | 0 | 145,145 |
3,095,071 | 2010-06-22T16:24:00.000 | 55 | 1 | 1 | 0 | python,python-import | 3,095,167 | 6 | false | 0 | 0 | The very first time you import goo from anywhere (inside or outside a function), goo.py (or other importable form) is loaded and sys.modules['goo'] is set to the module object thus built. Any future import within the same run of the program (again, whether inside or outside a function) just look up sys.modules['goo'] ... | 5 | 222 | 0 | What are the pros and cons of importing a Python module and/or function inside of a function, with respect to efficiency of speed and of memory?
Does it re-import every time the function is run, or perhaps just once at the beginning whether or not the function is run? | In Python, what happens when you import inside of a function? | 1 | 0 | 0 | 145,145 |
3,096,953 | 2010-06-22T20:38:00.000 | 0 | 0 | 1 | 0 | python,time,python-datetime | 72,463,310 | 16 | false | 0 | 0 | you could try this:
from datetime import datetime
start = datetime.now()
print(start)
#some code here
end = datetime.now()
print(end)
print(end - start) | 2 | 224 | 0 | I have two times, a start and a stop time, in the format of 10:33:26 (HH:MM:SS). I need the difference between the two times. I've been looking through documentation for Python and searching online and I would imagine it would have something to do with the datetime and/or time modules. I can't get it to work properl... | How to calculate the time interval between two time strings | 0 | 0 | 0 | 542,575 |
3,096,953 | 2010-06-22T20:38:00.000 | 2 | 0 | 1 | 0 | python,time,python-datetime | 3,096,997 | 16 | false | 0 | 0 | Take a look at the datetime module and the timedelta objects. You should end up constructing a datetime object for the start and stop times, and when you subtract them, you get a timedelta. | 2 | 224 | 0 | I have two times, a start and a stop time, in the format of 10:33:26 (HH:MM:SS). I need the difference between the two times. I've been looking through documentation for Python and searching online and I would imagine it would have something to do with the datetime and/or time modules. I can't get it to work properl... | How to calculate the time interval between two time strings | 0.024995 | 0 | 0 | 542,575 |
3,097,236 | 2010-06-22T21:21:00.000 | 0 | 0 | 1 | 0 | python,memory-management | 3,097,266 | 2 | false | 0 | 0 | How big are we talking? Python itself takes up some amount of memory.. up to maybe 30 or 40 MB I believe. If it is bigger than that and not getting collected, you have a memory leak. Only garbage with no references can be collected, somehow your extra stuff is still referenced. Do a memory profile and see what is goi... | 1 | 9 | 0 | My python code process memory increases dynamically as it stores dynamic data in list, dictionary and tuples wherever necessary. Though all those dynamic data is cleared physically in their variables after then, the memory is not shooting down.
Hence i felt like there is a memory leak and i used gc.collect() method to... | growing python process memory over time | 0 | 0 | 0 | 3,815 |
3,098,337 | 2010-06-23T01:31:00.000 | 4 | 0 | 1 | 0 | python,parsing,csv,input,types | 3,098,439 | 5 | false | 0 | 0 | ast.literal_eval() can get the easy ones. | 1 | 2 | 1 | I'm currently parsing CSV tables and need to discover the "data types" of the columns. I don't know the exact format of the values. Obviously, everything that the CSV parser outputs is a string. The data types I am currently interested in are:
integer
floating point
date
boolean
string
My current thoughts are to ... | Method for guessing type of data represented currently represented as strings | 0.158649 | 0 | 0 | 4,235 |
3,098,485 | 2010-06-23T02:12:00.000 | 0 | 0 | 1 | 0 | python,django | 3,098,528 | 3 | false | 0 | 0 | Put it into a dictionary, then use l=list(dictionary.iteritems()) to get the list and l.sort() to sort it | 1 | 0 | 0 | I have an unsorted list of objects that each have a end_date attribute.
The list just looks like [obj1, obj2, obj3, <...>] in no specific order.
I want to end up with a list that looks like this:
[["Saturday, May 5", [obj3, obj5]], ["Monday, May 7", [obj1, obj8, obj9]] ... etc ]
Basically just a list of lists, where... | Most efficient way to sort/categories objects in list based on object attribute | 0 | 0 | 0 | 572 |
3,098,980 | 2010-06-23T04:43:00.000 | 0 | 0 | 1 | 0 | python,frame-rate | 3,099,000 | 3 | false | 0 | 0 | Short answer: No.
Long answer: Not without knowing the internals of the application, and without the application having the appropriate hooks to perform such a measurement. | 1 | 2 | 0 | I was wondering...
It's possible to do it?
A simple console command based program that shows how are your FPS, for your currently running game/program? | It's possible to make a program that shows FPS (frame per second) in Python? | 0 | 0 | 0 | 1,099 |
3,099,244 | 2010-06-23T05:58:00.000 | 0 | 0 | 0 | 0 | python,user-interface,gtk,pygtk,gtktreeview | 60,073,336 | 5 | false | 0 | 1 | Calling both ModifyBase and ModifyText worked for me. Calling just ModifyBase changes the text color to White
Example in GTK C#:
treeViewList.ModifyBase(StateType.Selected, treeViewList.Style.Base(StateType.Normal));
treeViewList.ModifyText(StateType.Selected, treeViewList.Style.Text(StateType.Normal)); | 2 | 9 | 0 | I have a dialog which contains a pygtk.treeview for listing tasks by priority. Each row has the background colour set based on that priority, so for example the highest priority has a light red background.
The row selection color is not so easy to change. I can set it using treeview.modify_base(gtk.STATE_SELECTED, "#C4... | Changing the selected item colour in a GtkTreeview using python | 0 | 0 | 0 | 3,920 |
3,099,244 | 2010-06-23T05:58:00.000 | 0 | 0 | 0 | 0 | python,user-interface,gtk,pygtk,gtktreeview | 3,099,780 | 5 | false | 0 | 1 | Not sure what you mean by flickering. A border would require subclassing TreeView.
I'd make the STATE_SELECTED color identical to STATE_NORMAL to disable the built-in highlighting. Then set a data_func on each column and change some color on the cell renderer depending on whether it's in the selection or not.
You're pr... | 2 | 9 | 0 | I have a dialog which contains a pygtk.treeview for listing tasks by priority. Each row has the background colour set based on that priority, so for example the highest priority has a light red background.
The row selection color is not so easy to change. I can set it using treeview.modify_base(gtk.STATE_SELECTED, "#C4... | Changing the selected item colour in a GtkTreeview using python | 0 | 0 | 0 | 3,920 |
3,101,160 | 2010-06-23T11:30:00.000 | 0 | 0 | 0 | 0 | c++,python,c,ide,code-completion | 3,102,007 | 2 | false | 0 | 1 | I use notepad++ and am vary happy with it. | 1 | 5 | 0 | I've been annoyed lately by the fact that PyDev doesn't information about classes and function when it code completes wxPython code.
Can anybody tell me FOSS IDE's or extensions that offer code information (function params, returns etc.) when it code completes for C/C++ and Python.
I am a fan of CodeLite, Eclipse CDT a... | ide code information | 0 | 0 | 0 | 144 |
3,102,098 | 2010-06-23T13:36:00.000 | 0 | 0 | 0 | 1 | python,ssh,twisted | 3,102,192 | 2 | false | 0 | 0 | You're trying to put a square peg in a round hole. Everything in Twisted is asynchronous, so you have to think about the sequence of events differently. You can't say "here are 10 operations to be run one after the other" that's serial thinking.
In Twisted you issue the first command and register a callback that will b... | 1 | 3 | 0 | Guys this is a question about python twisted ssh lib.
All sample code even production code I saw acting as a ssh client based on twisted.conch.ssh are all interacting with server in such a mode:
prepare some commands to run remotely;
define call backs;
kick off reactor then suspend for new feedback;
After the reactor... | sound way to feed commands to twisted ssh after reactor.run() | 0 | 0 | 0 | 1,007 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.