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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
12,272,856 | 2012-09-04T23:59:00.000 | 9 | 0 | 1 | 0 | python,ruby | 12,272,872 | 7 | true | 0 | 0 | When you do something like "hi".print(), you are implying that the string object "hi" has a method print. This is not the case. Instead, print is a function that takes a string (or other types) as input. | 3 | 7 | 0 | My understanding of the print() in both Python and Ruby (and other languages) is that it is a method on a string (or other types). Because it is so commonly used the syntax:
print "hi"
works.
So why doesn't "hi".print() in Python or "hi".print in Ruby work? | Why can't I "string".print()? | 1.2 | 0 | 0 | 671 |
12,273,201 | 2012-09-05T00:55:00.000 | 2 | 0 | 1 | 0 | python,regex | 12,273,291 | 2 | false | 0 | 0 | re.findall(pattern, string) will return a list with all matches for pattern in string. len(...) will return the number of items in a list. | 1 | 0 | 0 | I have a string and I need match that string with an sequence and determine the number of times the matched sequence is found in that sequence
But it has following conditions
Sequence can contain only ACGT valid chars so seq could be ACGTGTCTG
the string could be ACGnkG
where n could be replaced by A or G
k could b... | string matching with substitution using PYTHON | 0.197375 | 0 | 0 | 118 |
12,274,060 | 2012-09-05T03:20:00.000 | 26 | 0 | 1 | 0 | python | 12,274,070 | 5 | true | 0 | 0 | Python uses a linear list layout in memory so that indexing is fast (O(1)). | 2 | 15 | 0 | Just learning Python. Reading through the official tutorials. I ran across this:
While appends and pops from the end of list are fast, doing inserts or pops from the beginning of a list is slow (because all of the other elements have to be shifted by one).
I would have guessed that a mature language like Python wou... | Does Python use linked lists for lists? Why is inserting slow? | 1.2 | 0 | 0 | 6,808 |
12,274,060 | 2012-09-05T03:20:00.000 | 5 | 0 | 1 | 0 | python | 12,274,109 | 5 | false | 0 | 0 | list is implemented as an arraylist. If you want to insert frequently, you can use a deque (but note that traversal to the middle is expensive).
Alternatively, you can use a heap. It's all there if you take the time to look at the docs. | 2 | 15 | 0 | Just learning Python. Reading through the official tutorials. I ran across this:
While appends and pops from the end of list are fast, doing inserts or pops from the beginning of a list is slow (because all of the other elements have to be shifted by one).
I would have guessed that a mature language like Python wou... | Does Python use linked lists for lists? Why is inserting slow? | 0.197375 | 0 | 0 | 6,808 |
12,274,600 | 2012-09-05T04:44:00.000 | 2 | 0 | 0 | 0 | python,django,web | 12,274,626 | 4 | false | 1 | 0 | Easiest way to do that is to find a host online (such as pythonanywhere.com) to host your app on there, following their instructions, and your app will be online. They handle most of the issues with piggybacking a django project on a server. | 1 | 3 | 0 | I developed a simple Django/Python poll application(Following step by step tutorial from the Django Official Documentation). I used the in build server to test the application. Now, I want to host my application in the web. I heard WSGI is the best way to expose Python/Django application to the web? What would be the b... | How to expose Django/Python application to the web? | 0.099668 | 0 | 0 | 1,111 |
12,277,864 | 2012-09-05T09:02:00.000 | 1 | 0 | 1 | 0 | python,csv | 12,277,912 | 3 | false | 0 | 0 | The Python csv module is only for reading and writing whole CSV files but not for manipulating them. If you need to filter data from file then you have to read it, create a new csv file and write the filtered rows back to new file. | 1 | 8 | 1 | how can I clear a complete csv file with python. Most forum entries that cover the issue of deleting row/columns basically say, write the stuff you want to keep into a new file. I need to completely clear a file - how can I do that? | python clear csv file | 0.066568 | 0 | 0 | 41,353 |
12,285,858 | 2012-09-05T16:27:00.000 | 1 | 1 | 0 | 0 | python,search,artificial-intelligence,computer-science,heuristics | 12,287,399 | 5 | false | 0 | 0 | A simple approach is to build the minimum spanning tree for your graph and do a (depth-first) walk over it, skipping nodes already visited.
This is proven to be no more than twice as long as the optimal TSP path. You can definitely do better with heuristics, but it's a starter (and easy to implement too). | 1 | 4 | 0 | My problem is the following:
I have an undirected graph. Each edge has a cost (or weight). One of the nodes is labelled S. I want to start from S and visit every node at least once. Visiting a node multiple times is allowed. Travelling along an edge multiple times is allowed, although that would make the solution more ... | What's a fast algorithm that can find a short path to traverse each node of a weighted undirected graph at least once? | 0.039979 | 0 | 0 | 4,388 |
12,286,987 | 2012-09-05T17:45:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine,app-engine-ndb | 21,434,751 | 1 | false | 1 | 0 | This seems to happen if you have async operations in progress before you enter the ndb.toplevel function.
My guess is that this warns you that theses async operations will not be waited for at the end of the request. This could be an issue if you expected them to be included in your "toplevel" function and they are tas... | 1 | 4 | 0 | I'm using Google App Engine NDB with a lot of async operations and yields. The console shows me this message:
tasklets.py:119] all_pending: clear set([Future 106470190 created by
dispatch(webapp2.py:570) for tasklet post(sync.py:387); pending])
Is this a warning of some sort? Should it be ignored? It doesn't cause ... | What does this console message mean in Google App Engine | 0.197375 | 0 | 0 | 177 |
12,289,700 | 2012-09-05T21:00:00.000 | 0 | 0 | 0 | 0 | python,selenium | 60,626,053 | 5 | false | 1 | 0 | I think username might be a variable in the python library you are using. Try calling it something else like Username1 and see if it works?? | 2 | 7 | 0 | I'm trying to use Selenium for some app testing, and I need it to plug a variable in when filling a form instead of a hardcoded string. IE:
this works
name_element.send_keys("John Doe")
but this doesnt
name_element.send_keys(username)
Does anyone know how I can accomplish this? Pretty big Python noob, but used Google ... | Passing variables through Selenium send.keys instead of strings | 0 | 0 | 1 | 9,992 |
12,289,700 | 2012-09-05T21:00:00.000 | 1 | 0 | 0 | 0 | python,selenium | 47,662,083 | 5 | false | 1 | 0 | Try this.
username = r'John Doe'
name_element.send_keys(username)
I was able to pass the string without casting it just fine in my test. | 2 | 7 | 0 | I'm trying to use Selenium for some app testing, and I need it to plug a variable in when filling a form instead of a hardcoded string. IE:
this works
name_element.send_keys("John Doe")
but this doesnt
name_element.send_keys(username)
Does anyone know how I can accomplish this? Pretty big Python noob, but used Google ... | Passing variables through Selenium send.keys instead of strings | 0.039979 | 0 | 1 | 9,992 |
12,290,336 | 2012-09-05T21:53:00.000 | 2 | 1 | 0 | 0 | python,unit-testing,selenium-webdriver | 12,290,574 | 5 | false | 1 | 0 | Override fail() to generate the screenshot and then call TestCase.fail(self)? | 1 | 12 | 0 | I have some class-based unit tests running in python's unittest2 framework. We're using Selenium WebDriver, which has a convenient save_screenshot() method. I'd like to grab a screenshot in tearDown() for every test failure, to reduce the time spent debugging why a test failed.
However, I can't find any way to run code... | How to execute code only on test failures with python unittest2? | 0.07983 | 0 | 0 | 1,958 |
12,290,694 | 2012-09-05T22:29:00.000 | 0 | 0 | 0 | 0 | python,scrapy,portable-python | 20,853,931 | 1 | false | 1 | 0 | you can easily download scrapy executable, extract it with python, copy scrapy folder and content to c:\Portable Python 2.7.5.1\App\Lib\site-packages\ and you'll have scrapy in your portable python.
I just had my similar problem with SciKit this way. | 1 | 1 | 0 | I need to create a portable python install on a usb but also install the scrapy framework on it, so I can work on and run my spiders on any computer.
Has anyone else done this? Is it even possible?
If so how do you add scrapy onto the portable python usb and then run the spiders?
Thanks | How do you add the scrapy framework to portable python? | 0 | 0 | 0 | 658 |
12,292,277 | 2012-09-06T02:42:00.000 | 4 | 0 | 0 | 0 | python,session,sqlalchemy,session-state,pyramid | 12,320,928 | 2 | true | 1 | 0 | Unless you're being really careful, serializing the entire object into redis is going to cause problems. You're effectively treating it like a cache, so you have to be careful that those values are expired if the user changes something about themselves. You also have to make sure that all of the values are serializable... | 1 | 1 | 0 | I have a few a few model classes such as a user class which is passed a dictionary, and wraps it providing various methods, some of which communicate with the database when a value needs to be changed. The dictionary itself is made from an sqlalchemy RowProxy, so all its keys are actually attribute names taken directly... | How do I go about storing session objects? | 1.2 | 1 | 0 | 241 |
12,292,723 | 2012-09-06T03:53:00.000 | 2 | 0 | 0 | 0 | python,django,testing,twisted,twisted.web | 12,486,382 | 1 | false | 0 | 0 | When it comes to testing, you sould always use code, so that if you change something in the future or if you have to fix a bug, testing your changes will be a matter of seconds:
python mytestsuite.py | 1 | 0 | 0 | Are there any Tools / Chrome plugins like "Advanced REST Plugin" for Chrome that I can use to Test Twisted RPC JSON calls?
Or do I have to write some Python code to do this? | Tools to Test RPC twisted calls? | 0.379949 | 0 | 1 | 76 |
12,293,603 | 2012-09-06T05:39:00.000 | -2 | 0 | 1 | 0 | python,lxml,scrapy | 12,313,354 | 1 | false | 0 | 0 | maybe you need to install libxml2-dev and libxslt-dev
in ubuntu do
sudo apt-get install libxml2-dev libxslt-dev | 1 | 1 | 0 | I have tried several ways to install lxml (actually I need to install Scrapy, which depend on lxml installed), easy_install, pip, build from source, but they didn't work out.
Now I use: STATIC_DEPS=true easy_install lxml. But got the following error:
/usr/bin/ld:
/tmp/easy_install-mptFTT/lxml-3.0alpha2/build/tmp/lib... | easy_install lxml error on Redhat | -0.379949 | 0 | 0 | 954 |
12,293,643 | 2012-09-06T05:43:00.000 | 1 | 0 | 1 | 0 | python,twisted | 12,297,692 | 1 | false | 0 | 0 | The session is basically a dictionary. Adapters are the values you can put into it, and interfaces are the keys you use with them.
Subclassing comes with a bunch of problems, none of them specific to the web or session state handling. It mixes lots of implementation concerns together that don't need to be mixed. A d... | 1 | 1 | 0 | It feels to me that using components/adapters is just adding extra bloat to handling sessions without much obvious benefit. It feels simpler to just subclass or wrap the session and use this subclass to generate sessions.
Maybe I am not seeing some obvious benefits of using components and adapters, so if anyone could e... | What's the benefit of using Adaptors over subclassing/wrapping Session in twisted.web? | 0.197375 | 0 | 0 | 89 |
12,295,834 | 2012-09-06T08:20:00.000 | 4 | 0 | 0 | 0 | php,javascript,python,xml,perl | 12,295,930 | 1 | true | 1 | 0 | You could try to reverse engineer the javascript code. Maybe it's making an ajax request to a service, that delivers the data as json. Use your browsers developer tools/network tab to see what's going on. | 1 | 1 | 0 | I need to export a website(.html page) to a XML file. The website contains a table with some data which i require for using in my web project. The table in the website is formed using some javascript, so i cannot get the data by getting the page source. Please tell me how I can export the table in the website to a XML ... | Export a website to an XML Page | 1.2 | 0 | 1 | 2,036 |
12,296,563 | 2012-09-06T09:03:00.000 | 1 | 0 | 0 | 0 | python,excel,win32com | 13,086,152 | 4 | false | 0 | 0 | Documentation for win32com is next to non-existent as far I know. However, I use the following method to understand the commands.
MS-Excel
In Excel, record a macro of whatever action you intend to, say plotting a chart. Then go to the Macro menu and use View Macro to get the underlying commands. More often than not, t... | 1 | 0 | 0 | Hi I intend to draw a chart with data in an xlsx file.
In order to keep the style, I HAVE TO draw it within excel.
I found a package named win32com, which can give a support to manipulate excel file with python on win32 platform, but I don't know where is the doc.....
Another similar question is how to change the style... | How to draw a chart with excel using python? | 0.049958 | 1 | 0 | 2,868 |
12,297,847 | 2012-09-06T10:17:00.000 | 3 | 0 | 0 | 0 | python,sqlalchemy,cassandra | 12,302,894 | 3 | false | 0 | 0 | playOrm supports JOIN on noSQL so that you CAN put relational data into noSQL but it is currently in java. We have been thinking of exposing a S-SQL language from a server for programs like yours. Would that be of interest to you?
The S-SQL would look like this(if you don't use partitions, you don't even need anythi... | 1 | 6 | 0 | I use Python with SQLAlchemy for some relational tables. For the storage of some larger data-structures I use Cassandra. I'd prefer to use just one technology (cassandra) instead of two (cassandra and PostgreSQL). Is it possible to store the relational data in cassandra as well? | Can I use SQLAlchemy with Cassandra CQL? | 0.197375 | 1 | 0 | 8,349 |
12,298,811 | 2012-09-06T11:12:00.000 | 2 | 1 | 0 | 0 | python,openerp | 12,298,831 | 2 | true | 0 | 0 | To debug your Openerp+python code in eclipse, start eclipse in debug perspective and follow the given steps:
1: Stop your openERP running server by pressing "ctr+c".
2: In eclipse go to Menu "Run/Debug Configurations". In configuration window under "Python Run", create new debug configuration(Double click on 'Python Ru... | 1 | 2 | 0 | how can I debug python code in to the eclipse.if it will be done then we face less effort and fast do our work.can any one tell me??? | how can i debug openerp code in to the eclipse | 1.2 | 0 | 0 | 3,051 |
12,299,602 | 2012-09-06T11:58:00.000 | 2 | 0 | 0 | 0 | python,html | 12,299,906 | 2 | false | 1 | 0 | I won't go so far as to say it's impossible, but this is an extremely tall order. The reason is that an HTML parser will usually not attempt to preserve HTML-irrelevant characters like line endings, but anything other than an HTML parser will not be very good at telling what is or isn't a tag according to the strict d... | 1 | 0 | 0 | How can I convert all HTML tags and attributes in a string to lowercase in python? Nothing else should be changed, e.g. attribute values should not be changed, no indentation, line wrapping etc.
Sorry if it's too obvious :) | How to convert all HTML tags and attributes in a string to lowercase in python? | 0.197375 | 0 | 0 | 807 |
12,302,155 | 2012-09-06T14:16:00.000 | 0 | 1 | 0 | 0 | python,buffer,pyserial | 45,513,398 | 4 | false | 1 | 0 | pySerial uses the native OS drivers for serial receiving. In the case of Windows, the size of the input driver is based on the device driver.
You may be able to increase the size in your Device Manager settings if it is possible, but ultimately you just need to read the data in fast enough. | 2 | 10 | 0 | I want to communicate with the phone via serial port. After writing some command to phone, I used ser.read(ser.inWaiting()) to get its return value, but I always got total 1020 bytes of characters, and actually, the desired returns is supposed to be over 50KB.
I have tried to set ser.read(50000), but the interpreter wi... | How to expand input buffer size of pyserial | 0 | 0 | 0 | 21,578 |
12,302,155 | 2012-09-06T14:16:00.000 | 1 | 1 | 0 | 0 | python,buffer,pyserial | 12,920,183 | 4 | false | 1 | 0 | I'm guessing that you are reading 1020 bytes because that is all there is in the buffer, which is what ser.inWaiting() is returning. Depending on the baud rate 50 KB may take a while to transfer, or the phone is expecting something different from you. Handshaking?
Inspect the value of ser.inWaiting, and then the conten... | 2 | 10 | 0 | I want to communicate with the phone via serial port. After writing some command to phone, I used ser.read(ser.inWaiting()) to get its return value, but I always got total 1020 bytes of characters, and actually, the desired returns is supposed to be over 50KB.
I have tried to set ser.read(50000), but the interpreter wi... | How to expand input buffer size of pyserial | 0.049958 | 0 | 0 | 21,578 |
12,302,385 | 2012-09-06T14:30:00.000 | 1 | 0 | 0 | 0 | python,django,oauth | 12,322,503 | 1 | true | 1 | 0 | I ended up creating a table with a single row, updated to contain the latest valid token.
Main reason: I know that wherever I deploy this application, and no matter how many processes across how many machines are serving, the database will work as storage. It's not that much extra code either, and goes well with Django... | 1 | 1 | 0 | I'm running a Django app that needs to interact with an external API to make requests in behalf of its users.
Before making any calls, I have to obtain an access token through an OAuth-like interface. This token is mine, my users won't have one each. I have tested the entry points and methods with curl, and everything ... | Django: OAuth token storage and renewal | 1.2 | 0 | 0 | 343 |
12,304,035 | 2012-09-06T16:02:00.000 | 4 | 0 | 1 | 0 | python,dictionary | 12,304,058 | 1 | true | 0 | 0 | Nope, python dicts will not see any difference in what characters you use in the key string.
They are optimized to deal with strings only versus arbitrary key objects, but if you use only string values for keys you won't see any difference between using keys without and with non-alphanumeric characters.
The string-only... | 1 | 0 | 0 | All my keys are strings, but I'm considering to use non-alphanumeric characters such as +, :, _, etc as part of the key.
Is there any performance (or any other) impact of using them? | Is there any performance impact of using non-alphanumeric characters in string keys for dictionary | 1.2 | 0 | 0 | 96 |
12,305,045 | 2012-09-06T17:07:00.000 | 1 | 0 | 0 | 1 | python,io,subprocess | 12,306,605 | 1 | true | 0 | 0 | Check this out: http://pypi.python.org/pypi/async_subprocess/0.2.1
"Provides an asynchronous version of Popen.communicate" | 1 | 0 | 0 | I use Windows XP and Python 2.5. I am trying to make a way for my python programs to secretly communicate with each other, I think the STARTUPOPTIONS class could hide the window, but I can't find out how I could communicate with them. On my python subprocess I tried using raw_input and on the parent I tried writing to ... | Is there a way to use the python subprocess module's Popen.communicate() without waiting for the process to exit? | 1.2 | 0 | 0 | 112 |
12,305,146 | 2012-09-06T17:14:00.000 | 0 | 1 | 0 | 0 | python,python-2.7,mod-wsgi,web.py,flup | 12,314,167 | 2 | false | 0 | 0 | I use nginx and uwsgi to deploy my own web.py apps, seems faster and consumes less ram than apache+mod_wsgi, the setup is not as easy though. I have to run supervisord to ensure that all uwsgi processes are on.
Don't use flup, I think its considered to be a bit outdated way of deploying python web apps. | 1 | 1 | 0 | I am unsure which of the two I should go for. Flup or modwsgi.
Flup seems to have very little documentation and even less people adding to the code. modwsgi on the other hand seems to be widely supported.
I just want to start running my webpy environmental so that I can utilize Python scripts online. But this thing s... | Python 2.7 with Webpy - flup or modwsgi? | 0 | 0 | 0 | 813 |
12,307,173 | 2012-09-06T19:38:00.000 | 10 | 0 | 0 | 1 | python,rabbitmq,celery,distributed-computing,django-celery | 12,355,563 | 1 | true | 0 | 0 | There is no one-size-fits-all answer to this
Dividing a big task A into many small parts (A¹, A², A³, …) will increase potential concurrency.
So if you have 1 worker instance with 10 worker threads/processes,
A can now run in parallel using the 10 threads instead of sequentially
on one thread.
The number of parts is ... | 1 | 6 | 0 | In my solution I use distributed tasks to monitor hardware instances for a period of time (say, 10 minutes). I have to do some stuff when:
I start this monitoring session
I finish this monitoring session
(Potentially) during the monitoring session
Is it safe to have a single task run for the whole session (10 minutes... | Celery: long dedicated monolithic task vs short multiple tasks | 1.2 | 0 | 0 | 1,293 |
12,314,245 | 2012-09-07T08:13:00.000 | 1 | 1 | 0 | 0 | python,nginx,uwsgi | 12,314,652 | 3 | false | 0 | 0 | First, consider those questions:
On which port is uWSGI running?
Is uWSGI running on your or on a remote machine?
If it's running on a remote machine, is the port accessible from your computer? (iptables rules might forbid external access)
If you made sure you have access, you can just call http://hostname:port/path/... | 1 | 3 | 0 | Here's a data flow:
http <--> nginx <--> uWSGI <--> python webapp
I guess there's http2uwsgi transfer in nginx, and uwsgi2http in uWSGI.
What if I want to directly call uWSGI to test an API in a webapp?
actually i'm using pyramid. just config [uwsgi] in .ini and run uWSGI. but i want to test if uWSGI hold webapp functi... | Can I use the uwsgi protocol to call http? | 0.066568 | 0 | 0 | 5,693 |
12,315,398 | 2012-09-07T09:30:00.000 | 18 | 1 | 1 | 0 | python,base64 | 12,317,005 | 11 | true | 0 | 0 | This isn't possible. The best you could do would be to verify that a string might be valid Base 64, although many strings consisting of only ASCII text can be decoded as if they were Base 64. | 1 | 47 | 0 | Is there a good way to check if a string is encoded in base64 using Python? | Check if a string is encoded in base64 using Python | 1.2 | 0 | 0 | 50,919 |
12,317,388 | 2012-09-07T11:38:00.000 | 4 | 0 | 0 | 0 | python,networkx | 12,317,478 | 1 | true | 0 | 0 | Found it, there is a property node_shape that allows changing shape. | 1 | 4 | 0 | I need nodes in different shapes in NetworkX, some rectangle and triangle nodes. Does anybody know if it is possible?
regards | changing node shape in NetworkX | 1.2 | 0 | 1 | 1,795 |
12,318,264 | 2012-09-07T12:37:00.000 | 5 | 0 | 1 | 1 | python,windows,installation-path | 12,318,294 | 1 | true | 0 | 0 | the default installation folder is c:/python27 | 1 | 2 | 0 | When using windows MSI installation from python.org/download (current version is 2.7.3), python by default installs in some folder but it is nowhere documented what is this default. Can someone check that on windows?
Also does this MSI installation recognizes is it 32 or 64bit windows and installs appropriate version o... | What is the default installation directory with an MSI install of Python 2.7? | 1.2 | 0 | 0 | 3,491 |
12,318,437 | 2012-09-07T12:46:00.000 | 9 | 0 | 1 | 0 | python,python-3.x,python-2.x | 12,318,539 | 6 | false | 0 | 0 | If you're looking to learn new things, and aren't looking to make a "must work today" type project, try Python3. It will be easier to move forward into the future with Python3, as it will become the standard over time.
If you're making something quick and dirty, you'll typically get better library support with Python 2... | 2 | 9 | 0 | I am coming from Ruby, and am having trouble deciding between installing and using Python 2.x or Python 3.x I am guessing that this choice this depends on what platforms and frameworks I want to use, but how can I find a list of programs that are or are not Python 3 compatible? This might help me get past this dilemma. | Confused about the choice between Python 2 vs Python 3 | 1 | 0 | 0 | 7,661 |
12,318,437 | 2012-09-07T12:46:00.000 | 1 | 0 | 1 | 0 | python,python-3.x,python-2.x | 12,318,536 | 6 | false | 0 | 0 | Nowadays, quite a number of libraries support Python 3. There is not a single list of these, so you'll have to check the frameworks you'd like to use for Python 3 compatibility. Some support Python 3 only in some beta stage, but that doesn't mean those are bad.
I would start off nowadays with Python 3, and see where yo... | 2 | 9 | 0 | I am coming from Ruby, and am having trouble deciding between installing and using Python 2.x or Python 3.x I am guessing that this choice this depends on what platforms and frameworks I want to use, but how can I find a list of programs that are or are not Python 3 compatible? This might help me get past this dilemma. | Confused about the choice between Python 2 vs Python 3 | 0.033321 | 0 | 0 | 7,661 |
12,319,957 | 2012-09-07T14:19:00.000 | 0 | 0 | 0 | 0 | python,openerp | 13,524,808 | 1 | false | 1 | 0 | All it means is the directive shown has a syntax error. If you look at it it is fairly clear. One set of parentheses is not closed. The other common cause is missing the closing > tag | 1 | 2 | 0 | I got the following Error after I hit the print button, the report was full functional in openerp6.1 with aeroo:
Aeroo Reports: Error while generating the report.
unexpected EOF while parsing in expression "__filter(get_label("report.account.account.balance","chart_account_id")" of "replace" directive (, line 1) (, lin... | have bug with aeroo reports in openerp version 6.1 | 0 | 0 | 0 | 629 |
12,320,273 | 2012-09-07T14:39:00.000 | 1 | 0 | 0 | 0 | python,selenium,tinymce | 22,871,270 | 3 | false | 0 | 0 | Use command: runScript
Target: tinyMCE.get('text_area_id').setContent('Your text here')
or you can use tinyMCE.activeEditor.setContent('Your text here') which will select either the first or the last mceEditor, I forget.. | 1 | 1 | 0 | In selenium i am trying to enter text into the tinymce text area, but i am having trouble selecting the text area to input the text. Is there a way to select the text area behind tinymce or anyway to select tinymce so i can enter text. thanks | Having trouble inputting into tinymce via selenium | 0.066568 | 0 | 1 | 525 |
12,321,301 | 2012-09-07T15:39:00.000 | 1 | 1 | 0 | 0 | python,websocket,broadcasting,autobahn | 14,835,403 | 2 | false | 0 | 0 | Well it is purely your logic in the code. When you receive the message you are simply broadcasting it, what you have to do is to pass this onto a custom function, and there, do a check:
Create a temporary array that contains list of active authenticated users. when user logs on, it should send this special string, ma... | 1 | 1 | 0 | I have read this example from AutobahnPython: https://github.com/tavendo/AutobahnPython/tree/master/examples/websocket/broadcast
It looks pretty easy to understand and practice. But I want to add a little more. Members who submit the correct secret string can send the messages, anyone else can only view the information... | Python - Broadcasting with WebSocket using AutobahnPython | 0.099668 | 0 | 1 | 1,310 |
12,323,833 | 2012-09-07T18:53:00.000 | 6 | 0 | 1 | 0 | python,pyramid | 12,324,667 | 2 | true | 0 | 0 | After the request object has gotten to the view it's recommended that you do not pass "as-is" to any non-web-specific code. Any code dealing with databases, etc shouldn't be coupled to pyramid's concept of a request. This pattern is easier to follow in Pyramid as it avoids a global request object.
The request object en... | 1 | 2 | 0 | My assumption is that the correct request object is not the guaranteed result, but I would like to know exactly why it's ill advised, and the recommended way is to pass the request object down the pipeline from a view function. | Why is it ill advised to use pyramid.threadlocal.get_current_request? | 1.2 | 0 | 0 | 980 |
12,332,975 | 2012-09-08T17:33:00.000 | 5 | 0 | 1 | 0 | python,pip,python-module,pypi | 12,333,019 | 11 | false | 0 | 0 | You define the dependent module inside the setup.py of your own package with the "install_requires" option.
If your package needs to have some console script generated then you can use the "console_scripts" entry point in order to generate a wrapper script that will be placed
within the 'bin' folder (e.g. of your virt... | 1 | 430 | 0 | I need to install a package from PyPi straight within my script.
Maybe there's some module or distutils (distribute, pip etc.) feature which allows me to just execute something like pypi.install('requests') and requests will be installed into my virtualenv. | Installing python module within code | 0.090659 | 0 | 0 | 412,031 |
12,333,831 | 2012-09-08T19:34:00.000 | 1 | 0 | 0 | 0 | python,sockets,port | 12,333,846 | 2 | false | 0 | 0 | Bind to 0.0.0.0 or the outside IP address instead, obviously. | 1 | 0 | 0 | I currently have the problem that I have a server script running on one computer as localhost:12123. I can connect to it using the same computer but using another computer in the same network does not connect to it (says it does not exist). Firewall is disabled.
Does it have to do with permissions?
The socket is create... | How to make HTTP server with port not 80 available for network? | 0.099668 | 0 | 1 | 1,991 |
12,335,114 | 2012-09-08T22:53:00.000 | 2 | 1 | 0 | 1 | python,rsync,fabric | 12,335,299 | 2 | true | 0 | 0 | If rsync using ssh as a remote shell transport is an option and you can setup public key authentication for the users, that would provide you a secure way of doing the rsync without requiring passwords to be entered. | 1 | 1 | 0 | I'd like to pass somehow user password for rsync_project() function (that is wrapper for regular rsync command) from Fabric library.
I've found the option --password-file=FILE of rsync command that requires password stored in FILE. This could somehow work but I am looking for better solution as I have (temporarily) pas... | Putting password for fabric rsync_project() function | 1.2 | 0 | 0 | 1,763 |
12,335,127 | 2012-09-08T22:56:00.000 | 1 | 0 | 0 | 0 | jquery,python,google-app-engine,autocomplete,submit | 12,335,176 | 1 | false | 1 | 0 | You could add a keystroke event listener and simply listen to the backspace keypress event.
When that happens, save and ajax the form field value to your server for storage.
EDIT: On basis of Scott Selby's anser:
To cover all bases:
Event listener for keypress backspace
Event listener for selection start and end. Save ... | 1 | 0 | 0 | I'm using Jquery autocomplete on an input field. So, as users type out a word, they can see a drop-down list showing fewer and fewer choices to select from.
The thing is, sometimes the user's input will not be among the choices in that list. I believe that when users see that list go empty, they will give up on their ... | Find out what users DIDN'T submit in input field. | 0.197375 | 0 | 0 | 84 |
12,335,424 | 2012-09-08T23:53:00.000 | 19 | 1 | 0 | 1 | python,eclipse,pydev | 12,774,197 | 2 | false | 0 | 0 | press CTRL+ALT+ENTER to send the selected lines to the interactive console | 1 | 19 | 0 | Is there a command in Eclipse Pydev which allows me to only run a few selected (highlighted) lines of code within a larger script?
If not, is it possible to run multiple lines of code in the PyDev console at once? | Eclipse Pydev: Run selected lines of code | 1 | 0 | 0 | 11,174 |
12,335,801 | 2012-09-09T01:20:00.000 | 0 | 0 | 1 | 0 | python,video,encoding | 12,336,353 | 1 | true | 0 | 0 | Not 100% clear on what you mean by 'make a video'. You can run use mencoder if say you do not like using ffmpeg for some reason.
Whatever that may be, you need a video source and video encoder to generate a video. Of course you could write your own video encoder in python if you wanted but that would leave you doing ... | 1 | 1 | 0 | I have python 2.5 on a Windows XP computer. I want to create a video (preferably a AVI) from a list of images. I would also like to be able to add sound to the video. I have tried modules like pymedia (keeps crashing), pyFFMPEG (gived DLL NOT FOUND ImportError), pyglet (only displays videos), and OpenCV (would not inst... | Is there a way to make a video with python? | 1.2 | 0 | 0 | 218 |
12,336,611 | 2012-09-09T04:57:00.000 | 2 | 0 | 0 | 0 | python,sockets | 12,336,669 | 2 | false | 0 | 0 | The socket is closed when the process exits. The port it was using may hang around for a couple of minutes, that's normal, then it will disappear. If you need to re-use the port immediately, set SO_REUSEADDR before binding or connecting. | 1 | 0 | 0 | I created a program which listens to particular socket in python, however I ctrl+c'd script which resulted in .close() nor called, however how can I free the socket now. | closing a previously opened socket | 0.197375 | 0 | 1 | 142 |
12,337,318 | 2012-09-09T07:36:00.000 | -2 | 0 | 0 | 0 | python,django,web-applications,django-admin | 12,337,353 | 2 | false | 1 | 0 | How secure is a Google Login ;) ? You can't tell as you can't look behind the scenes (Update: Of Google Login of course.). I would guess that Django's admin code is pretty safe, as it's used in lots of production systems. Still, beside the code, it also matters how you set it up. In the end, it depends on the level of ... | 2 | 0 | 0 | I have couple of apps on internet and want to serve static files for those apps using another Django App. I simply can't afford to use Amazon Web Services for my pet-projects.
So, I want to setup an Admin interface where I can manage static files easily. The following are the actions I am thinking to include in admin.
... | How secure is Django Admin interface | -0.197375 | 0 | 0 | 2,419 |
12,337,318 | 2012-09-09T07:36:00.000 | 0 | 0 | 0 | 0 | python,django,web-applications,django-admin | 12,337,841 | 2 | false | 1 | 0 | Besides serving static files through django is considered a bad idea, the django admin itself is pretty safe. You can take additional measure by securing it via .htaccess and force https access on it. You could also restrict access to a certain IP. If the admin is exposed to the whole internet you should at least be ca... | 2 | 0 | 0 | I have couple of apps on internet and want to serve static files for those apps using another Django App. I simply can't afford to use Amazon Web Services for my pet-projects.
So, I want to setup an Admin interface where I can manage static files easily. The following are the actions I am thinking to include in admin.
... | How secure is Django Admin interface | 0 | 0 | 0 | 2,419 |
12,340,250 | 2012-09-09T15:12:00.000 | 0 | 0 | 1 | 0 | comments,ipython | 68,532,960 | 4 | false | 0 | 0 | For me Ctrl + ^/~. The other solutions didn't work for me.
I'm using windows 10 and Jupyter Notebook. | 1 | 3 | 0 | Is there a way to comment multiple lines of code in an ipython cell in one go? | Commenting multiple lines in an ipython cell | 0 | 0 | 0 | 7,337 |
12,340,456 | 2012-09-09T15:39:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine,dkim | 12,340,517 | 1 | false | 1 | 0 | How long ago did you create your DNS TXT record? Since DKIM is a DNS controlled service, and DNS often takes up to days to propagate across the Internet, you may need to wait for that to happen before Google will recognize it as valid. | 1 | 0 | 0 | Am confused why emails sent by my appengine app are not being signed with DKIM.
Enabled DKIM signing on Google Apps dashboard. Confirmed that my domain is "Authenticating email"
Have setup DNS TXT record using the values indicated in the apps domain. Have confirmed, using 3rd party validation tool, that the DNS is c... | Google Appengine not signing emails with DKIM code | 0.197375 | 0 | 0 | 441 |
12,340,468 | 2012-09-09T15:41:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine | 37,780,181 | 3 | false | 1 | 0 | For those using windows change the open line to:
raw = open('path_to_datastore_export_file', 'rb')
The file must be opened in binary mode! | 1 | 3 | 0 | I'm experimenting with the Google cloud storage backup feature for an application.
After downloading the backup files using gsutil, how can they be loaded into a local development server?
Is there a parser available for these formats (eg, protocol buffers)? | How can one load an AppEngine cloud storage backup to a local development server? | 0 | 0 | 0 | 1,341 |
12,341,496 | 2012-09-09T17:58:00.000 | 8 | 0 | 0 | 0 | python,template-engine,jinja2 | 43,586,175 | 4 | false | 1 | 0 | For anyone coming here looking to use the safe filter programmatically: wrap it in a markupsafe.Markup class, on which Jinja2 depends on. | 1 | 30 | 0 | I have a little problem understanding what an expression like {{ something.render() | safe }} does .
From what I have seen, without the safe keyword it outputs the entire html document, not just the true content.
What I would like to know, is what it actually does, how it functions . | Jinja 2 safe keyword | 1 | 0 | 0 | 32,304 |
12,341,610 | 2012-09-09T18:12:00.000 | 0 | 1 | 0 | 0 | python,python-2.7,mod-wsgi | 12,444,455 | 2 | false | 1 | 0 | You have Apache 2.2 core package installed, but possibly have the devel package for Apache 1.3 instead of that for 2.2 installed. This isn't certain though, as for some Apache distributions, such as when compiled from source code, 'apxs' is still called 'apxs'. It is only certain Linux distros that have changed the nam... | 2 | 0 | 0 | When installing mod_wsgi I get stuck after doing ./config
Apparently I am missing the apxs2
Here is the result:
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
checking Apache version... 2.2.22
checking for python... /usr/bin/python
configure: creating ./config.status
config.status: creating Makefile
What... | Error when installing mod_wsgi | 0 | 0 | 0 | 314 |
12,341,610 | 2012-09-09T18:12:00.000 | 2 | 1 | 0 | 0 | python,python-2.7,mod-wsgi | 12,341,622 | 2 | false | 1 | 0 | checking for apxs... /usr/sbin/apxs
...
config.status: creating Makefile
It succeeded. Go on to the next step. | 2 | 0 | 0 | When installing mod_wsgi I get stuck after doing ./config
Apparently I am missing the apxs2
Here is the result:
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
checking Apache version... 2.2.22
checking for python... /usr/bin/python
configure: creating ./config.status
config.status: creating Makefile
What... | Error when installing mod_wsgi | 0.197375 | 0 | 0 | 314 |
12,342,207 | 2012-09-09T19:24:00.000 | 3 | 0 | 1 | 0 | python,text | 12,342,216 | 5 | false | 0 | 0 | Use a dictionary - basically letters[char]++ | 2 | 6 | 0 | In python, how can I iterate through a text file and count the number of occurrences of each letter? I realise I could just use a 'for x in file' statement to go through it and then set up 26 or so if elif statements, but surely there is a better way to do it?
Thanks. | Count frequency of letters in a text file | 0.119427 | 0 | 0 | 29,198 |
12,342,207 | 2012-09-09T19:24:00.000 | 0 | 0 | 1 | 0 | python,text | 12,342,298 | 5 | false | 0 | 0 | Counter is a good way to do this, but Counter is only available in 3.1 and up, plus 2.7.
If you're on 3.0 or 2.[56], you probably should use collections.defaultdict(int) instead. | 2 | 6 | 0 | In python, how can I iterate through a text file and count the number of occurrences of each letter? I realise I could just use a 'for x in file' statement to go through it and then set up 26 or so if elif statements, but surely there is a better way to do it?
Thanks. | Count frequency of letters in a text file | 0 | 0 | 0 | 29,198 |
12,342,807 | 2012-09-09T20:44:00.000 | 1 | 0 | 0 | 0 | python,pyqt4,pjsip | 12,426,092 | 1 | true | 1 | 0 | himself answer :-)
in my case it was so
# call window
################
self.MuteMic = False
self.MuteSpeaker = False
################
#btn signals
self.connect(self.MuteUnmuteMicButton, QtCore.SIGNAL("clicked()"), self.MuteUnmuteMic)
self.connect(self... | 1 | 0 | 0 | Hello friends and colleagues
I am trying to make a function mute / un mute microphone and also speakers for my program softphone on pyt4 and using library PJSIP
I found this in the code pjsip
pjsip:
def conf_set_tx_level(self, slot, level):
"""Adjust the signal level to be transmitted from the bridge t... | pyqt4, function Mute / Un mute microphone and also speakers [PJSIP] | 1.2 | 0 | 0 | 1,239 |
12,342,820 | 2012-09-09T20:45:00.000 | 2 | 0 | 0 | 0 | python,django,session,cookies | 12,343,112 | 1 | true | 1 | 0 | You're confusing things a bit.
The only thing stored inside "Django's session cookie" is an ID. That ID refers to the data which is stored inside the session backend: this is usually a database table, but could be a file or cache location depending on your Django configuration.
Now the only time that data is updated is... | 1 | 1 | 0 | I am going to be storing a significant amount of information inside Django's session cookie. I want this data to persist for the entire time the user is on the website. When he leaves, the data should be deleted, but the session MUST persist. I do not want to user to need to log in every time he returns to the website... | Delete pieces of Session on browser close | 1.2 | 0 | 0 | 1,943 |
12,344,187 | 2012-09-10T00:44:00.000 | 0 | 0 | 1 | 0 | python,windows-7 | 12,344,713 | 5 | false | 0 | 0 | I suggest that you run your code in some sort of editor (pretty much any will do: Eclipse, Geany, Spyder, IDLE, etc.). The reason for this is that when the program is executed, you are most likely getting a fatal error in your code somewhere. Python IDEs have a tendency to keep the windows used to execute the code open... | 1 | 0 | 0 | I have that issue with python interpreter - it's closing immediately after script execution. I'm trying to learn pygtk; I wrote "hello world" after tutorial and all I can see is a quick flash of two windows, one interpreter's and one gtk's. I tried to run the script from command.com instead of by double-click - didn't ... | How to stop python interpreter from closing on Windows 7? | 0 | 0 | 0 | 1,943 |
12,344,193 | 2012-09-10T00:44:00.000 | 0 | 0 | 0 | 0 | python,performance,google-app-engine,google-cloud-datastore,scalability | 12,345,364 | 2 | false | 1 | 0 | Here are some suggestions:
Save the user preferences/settings on the Server too, so that you can have their preferences synced to multiple clients/devices in the future.
Having the data stored locally on the client is also recommended, so that the calls are not made to the server everytime to get some preferences. In... | 2 | 1 | 0 | I want to minimize traffic/storage costs on GAE.
Users fill out a form, checking boxes to select options which are lines of text, eg "I wake up two or more times during the night." or "I sleep less than 7 hours per night." or "I usually have trouble falling asleep."
I want to store the user's selections using the datas... | Most efficient/cheap way to send/store data on GAE | 0 | 0 | 0 | 118 |
12,344,193 | 2012-09-10T00:44:00.000 | 1 | 0 | 0 | 0 | python,performance,google-app-engine,google-cloud-datastore,scalability | 12,352,966 | 2 | false | 1 | 0 | Sounds like you already figured out how best to store the data.
In terms of translating it to HTML on the server or client side, it'll depend on the complexity of your page. Analyzing it will probably be more time than it's worth, and it might change if your page changes. It's most likely a wash unless it's an extrem... | 2 | 1 | 0 | I want to minimize traffic/storage costs on GAE.
Users fill out a form, checking boxes to select options which are lines of text, eg "I wake up two or more times during the night." or "I sleep less than 7 hours per night." or "I usually have trouble falling asleep."
I want to store the user's selections using the datas... | Most efficient/cheap way to send/store data on GAE | 0.099668 | 0 | 0 | 118 |
12,344,481 | 2012-09-10T01:42:00.000 | 0 | 0 | 1 | 0 | python | 12,344,677 | 2 | false | 0 | 0 | Python is a "dynamically-typed" programming language, that meaning that the odds are against the IDE in providing code-intelligence.
That said, Wing-IDE is the very best for Python, and there are a few things you can do: first be sure to have open the "Source Assistant" panel, i.e., press F2 and locate it to your righ... | 1 | 0 | 0 | in visual studio all you had to do was type the first parenthesis and it showed you the parameters required.
It's not doing that in python / wingware, what is the best / easiest way to do this? | how do i know what parameters a python function takes with wingware IDE | 0 | 0 | 0 | 468 |
12,346,337 | 2012-09-10T06:26:00.000 | 0 | 1 | 0 | 0 | python-module,monkeyrunner | 12,348,061 | 1 | false | 0 | 0 | Try to name your script something.py. This way you have a python script where you can import the modules. When you run the script with monkeyrunner, some python modules are not recognized. Monkeyrunner does not equal python 100%. It does not have all the power and functionality. | 1 | 1 | 0 | I have installed psutil module.
It works well if run by the python interpreter but when I try to import the module in a monkeyrunner script,it gives
No such module.
Is there any way through which i use psutil module in monkeyrunner?
Note-i am using the monkeyrunner with the android ics-x86 version | Monkeyrunner doesnt find my module | 0 | 0 | 0 | 258 |
12,346,831 | 2012-09-10T07:10:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine,download,email-attachments | 12,349,722 | 1 | false | 1 | 0 | You cannot write a File to your web application directory in App Engine.
Possible choices for you are:
Save the content in the Datastore.
Use the Blobstore
Use the Google Storage facility.
Alternately, you might want to post the content away to an external server that can store the data, either your own or some 3rd p... | 1 | 0 | 0 | I am able to receive an email to app engine. I see the data in an attachment is payload base64 encoded data. Can I download the attachment as it is to file system without processing it or without storing it to blobstore? | google app engine email attachment: download it to file system | 0.197375 | 0 | 0 | 218 |
12,348,291 | 2012-09-10T08:56:00.000 | 1 | 0 | 1 | 1 | python,windows-7,command-line,tags,command-line-arguments | 12,348,372 | 2 | true | 0 | 0 | You cannot using standard Windows cmd shell. You can use something like bash from Cygwin, maybe PowerShell.
If you want to open *.py from application like vim but in Python, then you can use glob module. | 1 | 0 | 0 | I'm not able to do this
ptags.py *.py
or
python *.py
i'm getting an error saying "Cannot open file named *.py"
but i'm able to open all the python files in vim using this command
vim *.py
python 2.7 in windows 7 command prompt | how do i pass multiple files as arguments in command line for python using regular expressions? | 1.2 | 0 | 0 | 1,629 |
12,348,500 | 2012-09-10T09:09:00.000 | 1 | 1 | 0 | 0 | python,wsgi,gevent | 15,670,806 | 1 | false | 1 | 0 | If your library uses threading.local to provide thread-isolated "global" request variable then all you need is to call gevent.monkey.patch_thread BEFORE you use threading.local. That should turn all threading.local objects into "greenlet.local" ones. | 1 | 1 | 0 | I'd like to test my WSGI library with gevent's WSGI Servers to ensure that request parameters aren't leaked/overwritten with those from another request/greenlet - in my library request is "global", though it should be thread-safe... which is what I'd like to test using gevent.
What approaches can I use? Are there any o... | How can I unittest wsgi code which uses gevent? | 0.197375 | 0 | 0 | 563 |
12,349,086 | 2012-09-10T09:44:00.000 | 0 | 0 | 0 | 1 | java,android,python,google-app-engine | 12,349,313 | 1 | true | 1 | 0 | The communication with your server can be totally independent of the languages used on the server and client end.
Typically web applications use principles such as REST to communicate. This is why your browser runs using HTML and JavaScript and your server can be using anything, including python.
It really depends on w... | 1 | 0 | 0 | I'm a newbie Android Developer, and my app requires that it interacts with a server.
I came across Google AppEngine, and find it to be a good choice for this app.
If I code my Android app in Java, and do the server coding for Google AppEngine in Python, will my Android App be able to communicate with the server?
I mean... | Python AppEngine coding for Android app? | 1.2 | 0 | 0 | 130 |
12,349,118 | 2012-09-10T09:45:00.000 | 14 | 0 | 1 | 0 | python,regex | 12,349,512 | 4 | true | 0 | 0 | You can use r"[^\W\d]", ie. invert the union of non-alphanumerics and numbers. | 1 | 8 | 0 | Special sequences (character classes) in Python RegEx are escapes like \w or \d that matches a set of characters.
In my case, I need to be able to match all alpha-numerical characters except numbers.
That is, \w minus \d.
I need to use the special sequence \w because I'm dealing with non-ASCII characters and need to ma... | Can I mix character classes in Python RegEx? | 1.2 | 0 | 0 | 4,458 |
12,349,295 | 2012-09-10T09:57:00.000 | 0 | 0 | 0 | 0 | python,web-scraping | 12,349,430 | 2 | false | 1 | 0 | I assume you use some library like urllib to do the scraping. You already know the website's content changes dynamically. I also assume that the dynamic content uses server-side interaction. This means, using javascript (ajax) the browser requests new data from the server, based on the value from the selection).
If s... | 2 | 3 | 0 | I want to scrape a webpage that changes its content via a <select> tag. When I select a different option, the content of the page dynamically changes. I want to know if there is a way that I can change the option from a python script so I can get the content from all different pages of all different options in <select>... | How to scrape a webpage that changes content from tag | 0 | 0 | 1 | 2,430 |
12,349,295 | 2012-09-10T09:57:00.000 | 0 | 0 | 0 | 0 | python,web-scraping | 12,349,434 | 2 | false | 1 | 0 | As @Tichodroma said, when the select is changed, either:
Some content previously hidden on the page is made visible, or:
An ajax call is made to retrieve some additional content and add it to the DOM
In both cases, JavaScript is involved. Have a look at it, and depending on what is happening (case #1 or #2), you shou... | 2 | 3 | 0 | I want to scrape a webpage that changes its content via a <select> tag. When I select a different option, the content of the page dynamically changes. I want to know if there is a way that I can change the option from a python script so I can get the content from all different pages of all different options in <select>... | How to scrape a webpage that changes content from tag | 0 | 0 | 1 | 2,430 |
12,349,970 | 2012-09-10T10:39:00.000 | 0 | 1 | 1 | 0 | python,algorithm,caching | 12,350,058 | 2 | false | 0 | 0 | You can have a metadata file that will hold a list of all cached entities together with their creation times | 2 | 4 | 0 | My python script does some heavy computation. To boost performance, it caches the computed data on the disk so that next time I'll run it, it doesn't waste time in computing the same thing. However, before extracting data from the cache, it needs to do some checking to make sure that the cache is not stale. This is the... | Algorithm to check if cache is stale | 0 | 0 | 0 | 591 |
12,349,970 | 2012-09-10T10:39:00.000 | 2 | 1 | 1 | 0 | python,algorithm,caching | 12,356,214 | 2 | true | 0 | 0 | Just check the last-modified time of your cache file instead.
Even better, that's what you really want to check in any case, because when you update your cache to store the new computed value, you want to know when that was done last, not when that was done the first time. :-) | 2 | 4 | 0 | My python script does some heavy computation. To boost performance, it caches the computed data on the disk so that next time I'll run it, it doesn't waste time in computing the same thing. However, before extracting data from the cache, it needs to do some checking to make sure that the cache is not stale. This is the... | Algorithm to check if cache is stale | 1.2 | 0 | 0 | 591 |
12,350,693 | 2012-09-10T11:25:00.000 | 0 | 0 | 0 | 0 | python,matplotlib | 12,363,743 | 1 | false | 0 | 0 | I post here a schematic approach how to solve your problem with out any real python code, it might help though.
When actually plotting you need to store all in some kind of two lists, which will enable you to access them later.
For each element, bar and marker you can get the color.
For each marker you can find if i... | 1 | 1 | 1 | I am using matplotlib to draw a bar chart with many different colors. I also draw a number of markers on the plot with scatter.
Since I am already using many different colors for the bars, I do not want to use a separate contrasting color for the marks, as that would add a big limit to the color space I can choose m... | Inverted color marks in matplotlib | 0 | 0 | 0 | 385 |
12,351,786 | 2012-09-10T12:30:00.000 | -2 | 0 | 0 | 0 | python,tkinter | 12,351,926 | 5 | false | 0 | 1 | The function which normally prints to stdout should instead put the text into text widget. | 1 | 18 | 0 | I have a Python program which performs a set of operations and prints the response on STDOUT. Now I am writing a GUI which will call that already existing code and I want to print the same contents in the GUI instead of STDOUT. I will be using the Text widget for this purpose. I do not want to modify my existing code w... | How to redirect print statements to Tkinter text widget | -0.07983 | 0 | 0 | 23,774 |
12,354,189 | 2012-09-10T14:50:00.000 | 1 | 0 | 0 | 0 | python,django,shopify,webhooks | 12,423,594 | 2 | true | 1 | 0 | Thanks for the answers guys, but I found out that the issue was something else.
I forgot to make a CSRF exemption for the POST request URL that Shopify calls and also forgot to add a trailing slash '/' at the end of the URL I told the webhook to call.
I guess I would have caught these errors if I used something like po... | 2 | 2 | 0 | Backdrop: Am building a shopify app using a test store provided by shopify. #Python #Django-
Problem: I have setup shopify webhooks for my test store using the python API for the topics "products/update" and "products/delete". But my endpoints are not called by shopify when I manually update or delete a product on my t... | Shopify webhook not working when product updated/deleted | 1.2 | 0 | 1 | 2,272 |
12,354,189 | 2012-09-10T14:50:00.000 | 1 | 0 | 0 | 0 | python,django,shopify,webhooks | 12,389,770 | 2 | false | 1 | 0 | I don't have the creds to comment apparently, so I'll put this in an "answer" - to use the term very loosely - instead. I ran into something similar with the Python API, but soon realized that I was doing it wrong. In my case, it was toggling the fulfillment status, which then fires off an email notifying customers of ... | 2 | 2 | 0 | Backdrop: Am building a shopify app using a test store provided by shopify. #Python #Django-
Problem: I have setup shopify webhooks for my test store using the python API for the topics "products/update" and "products/delete". But my endpoints are not called by shopify when I manually update or delete a product on my t... | Shopify webhook not working when product updated/deleted | 0.099668 | 0 | 1 | 2,272 |
12,354,515 | 2012-09-10T15:09:00.000 | 5 | 0 | 1 | 0 | python,list,set | 46,170,559 | 7 | false | 0 | 0 | Set represents a collection of distinct elements. In python, sets are mainly used for two reasons (Book: Data Science from Scratch, Joel Gruce):
For faster operation: in is a very fast operation on sets. If we have a large collection of elements and if we wish to perform membership test, in that case it is appropriat... | 2 | 54 | 0 | Is the only difference between sets and lists in Python the fact that you can use the union, intersect, difference, symmetric difference functions to compare two sets? Why can't these functions simply be applied to lists? In what situations are sets more useful than lists? | What is the difference between sets and lists in Python? | 0.141893 | 0 | 0 | 92,780 |
12,354,515 | 2012-09-10T15:09:00.000 | 5 | 0 | 1 | 0 | python,list,set | 39,240,481 | 7 | false | 0 | 0 | Some more differences are:
List can be 2-D whereas a set can't.
As list are ordered (IE. have serial number) list are comparatively slow to execute whereas sets are fast.
List in python is like Array of java or c.
Printing a set almost always provide different sequence of output.
Set uses hash function to find an elem... | 2 | 54 | 0 | Is the only difference between sets and lists in Python the fact that you can use the union, intersect, difference, symmetric difference functions to compare two sets? Why can't these functions simply be applied to lists? In what situations are sets more useful than lists? | What is the difference between sets and lists in Python? | 0.141893 | 0 | 0 | 92,780 |
12,355,416 | 2012-09-10T16:05:00.000 | 0 | 0 | 0 | 0 | python,numpy,scipy,data-mining | 12,369,285 | 2 | false | 0 | 0 | An SQL database should work fine in your case. In fact, you can store all the training examples in just one database, each row representing a particular training set and each column representing a feature. You can add features by adding collumns as and when required. In a relational database, you might come across acce... | 2 | 1 | 0 | I'm looking to expand my recommender system to include other features (dimensions). So far, I'm tracking how a user rates some document, and using that to do the recommendations. I'm interested in adding more features, such as user location, age, gender, and so on.
So far, a few mysql tables have been enough to handle ... | Multi feature recommender system representation | 0 | 1 | 0 | 289 |
12,355,416 | 2012-09-10T16:05:00.000 | 0 | 0 | 0 | 0 | python,numpy,scipy,data-mining | 24,491,488 | 2 | false | 0 | 0 | I recommend using tensors, which is multidimensional arrays. You can use any data table or simply text files to store a tensor. Each line or row is a record / transaction with different features all listed. | 2 | 1 | 0 | I'm looking to expand my recommender system to include other features (dimensions). So far, I'm tracking how a user rates some document, and using that to do the recommendations. I'm interested in adding more features, such as user location, age, gender, and so on.
So far, a few mysql tables have been enough to handle ... | Multi feature recommender system representation | 0 | 1 | 0 | 289 |
12,356,348 | 2012-09-10T17:07:00.000 | 1 | 0 | 0 | 1 | python,vim,autocomplete,refactoring,rename | 12,357,914 | 3 | false | 0 | 0 | The . register contains the last inserted text. See :help quote_..
The help doesn't specifically mention any caveats of when this register is populated, however it does mention that it doesn't work when editing the command line. This shouldn't be an issue for you. | 1 | 3 | 0 | As a secondary task to a Python auto-completion (https://github.com/davidhalter/jedi), I'm writing a VIM plugin with the ability to do renaming (refactoring).
The most comfortable way to do renaming is to use cw and autocommand InsertLeave :call do_renaming_func(). To do this I need to access the redo-register (see hel... | VIM: How to access the redo-register | 0.066568 | 0 | 0 | 194 |
12,356,728 | 2012-09-10T17:34:00.000 | 1 | 0 | 1 | 0 | python,ruby,outline | 12,360,884 | 1 | true | 1 | 0 | As far as I know there is no such library. You could create it yourself though.
A pragmatic way would be to follow the indentation levels in Python. For other languages, you could either follow the indentation level, or use regular expression matching and a stack to keep track your outline. | 1 | 2 | 0 | Is there a python or ruby library to create a code outline for the given code? The library should support multiple languages.
I am looking for something like outline view in Eclipse. I don't need the UI, and i can write my own. But I am looking for a library which parses the given language and creates an outline datast... | Library to create code outline | 1.2 | 0 | 0 | 361 |
12,360,279 | 2012-09-10T22:23:00.000 | 2 | 0 | 0 | 1 | python,linux,sqlite,ubuntu | 12,360,397 | 1 | true | 0 | 0 | Are you putting the DB file name in the command ?
$ sqlite3 test.db | 1 | 1 | 0 | Trying to set up some basic data I/O scripts in python that read and write from a local sqlite db. I'd like to use the command line to verify that my scripts work as expected, but they don't pick up on any of the databases or tables I'm creating.
My first script writes some data from a dict into the table, and the seco... | sqlite3 command line tools don't work in Ubuntu | 1.2 | 1 | 0 | 1,252 |
12,364,981 | 2012-09-11T07:41:00.000 | 1 | 0 | 0 | 0 | python,tkinter | 60,425,005 | 8 | false | 0 | 1 | You say that you have a list of widgets to change dynamically. Do you want to reuse and reconfigure existing widgets, or create all new widgets and delete the old ones? It affects the answer.
If you want to reuse the existing widgets, just reconfigure them. Or, if you just want to hide some of them temporarily, use the... | 1 | 61 | 0 | I have a list of tkinter widgets that I want to change dynamically.
How to delete the widgets from the window? | How to delete Tkinter widgets from a window? | 0.024995 | 0 | 0 | 201,947 |
12,367,009 | 2012-09-11T09:48:00.000 | 0 | 1 | 0 | 0 | python,nose,nosetests | 12,367,042 | 2 | false | 0 | 0 | I am only answering my question. It is really very strange. I found that the test files previously were in executable mode. And as soon as i changed there modes, it started working like a charm. :-) chmod -x *_test.py worked for me. Can anybody explain this behaviour of nosetests ??? | 2 | 0 | 0 | I am having a hierarchy of directories and inside every directory there is one 'test/' directory which has all the test files. nosetests is not able to collect these test files somehow.
I have followed naming convention used for filenames and class names as well. All the classes defined in those files are subclass of ... | 'nosetests' was unable to collect test files from directory | 0 | 0 | 0 | 379 |
12,367,009 | 2012-09-11T09:48:00.000 | 1 | 1 | 0 | 0 | python,nose,nosetests | 12,418,833 | 2 | true | 0 | 0 | If you carefully see the python nose usage, you will get it
--exe Look for tests in python modules that are executable.
Normal behavior is to exclude executable modules,
Thanks. | 2 | 0 | 0 | I am having a hierarchy of directories and inside every directory there is one 'test/' directory which has all the test files. nosetests is not able to collect these test files somehow.
I have followed naming convention used for filenames and class names as well. All the classes defined in those files are subclass of ... | 'nosetests' was unable to collect test files from directory | 1.2 | 0 | 0 | 379 |
12,367,082 | 2012-09-11T09:52:00.000 | 1 | 0 | 0 | 0 | python,django,project | 12,367,541 | 2 | false | 1 | 0 | It doesn't matter if database is involved or not, but for overall web development, it's an easy to use framework. | 1 | 0 | 0 | I am going to develop a auto text summarization tool as my FYP. I am going to use Python and it's going to be a web application. Since, there would be no database involved in my tool is it a good idea to use Django? Can anyone recommend any other framework? Thanks. | Auto Text Summarization: Web application using Django/python? | 0.099668 | 0 | 0 | 421 |
12,367,891 | 2012-09-11T10:40:00.000 | 0 | 1 | 1 | 0 | python,mime-types,content-type | 55,849,444 | 2 | false | 0 | 0 | Yes, you should evaluate the hex signature. | 1 | 2 | 0 | Is it possible to determine the type of a file-like object in Python?
For instance, if I were to read the contents of a file into a StringIO container and store it in a database, could I later work-out the original file-/content-/mime-type from the data? Eg. are there any common headers I could search for?
If not, are... | Determine file-/content-/mime-type from file-like? | 0 | 0 | 0 | 584 |
12,367,904 | 2012-09-11T10:41:00.000 | 2 | 0 | 0 | 1 | google-app-engine,python-2.7,google-cloud-datastore | 12,378,411 | 2 | true | 1 | 0 | Pretty sure you are running into the HRD feature where queries are "eventually consistent". NDB's caching has nothing to do with this behavior. | 1 | 2 | 0 | So I have been reading a lot of documentation on HRD and NDB lately, yet I still have some doubts regarding how NDB caches things.
Example case:
Imagine a case where a users writes data and the app needs to fetch it immediately after the write. E.g. A user creates a "Group" (similar to a Facebook/Linkedin group) and is... | Write/Read with High Replication Datastore + NDB | 1.2 | 0 | 0 | 863 |
12,368,120 | 2012-09-11T10:54:00.000 | 2 | 0 | 0 | 0 | python,zeromq | 12,396,881 | 1 | true | 0 | 0 | You could simply implement an counter with a second socket.
Each time you have an active client or you close your socket, send a message on your "socket counter".
ZeroMQ is made to combine sockets. | 1 | 3 | 0 | Is there any way to count the number of currently connected clients in a zeromq socket? If that's not possible, is there any way to determine whether the socket has no client connected to it?
Thanks. | Counting The Number of Connection in a ZeroMQ Socket | 1.2 | 0 | 1 | 1,053 |
12,372,258 | 2012-09-11T14:39:00.000 | 0 | 0 | 0 | 0 | javascript,python,tags | 12,372,353 | 2 | false | 1 | 0 | Agree with @unwind , it depends on the content length of the text and your algorithm to grab the tags(scalability) | 2 | 0 | 0 | I'm thinking if a user submits a message and they click a 'suggest tags' button, their message would be analyzed and a form field populated wIthaca random words from their post.
Is it possible to do this on a scalable level? Would JavaScript be able to handle it or better to Ajax back to python?
I'm thinking certain co... | Is it possible to automatically pull random "tags" from a long string of text? | 0 | 0 | 1 | 60 |
12,372,258 | 2012-09-11T14:39:00.000 | 0 | 0 | 0 | 0 | javascript,python,tags | 12,372,295 | 2 | false | 1 | 0 | Of course it's possible, you pretty much described the algorithm to test, and it doesn't seem to contain any obviously non-computable steps:
Split the message into words
Filter out the common words
Sort the words by length
Pick the top ten and present them as tags
Not sure what you mean by "scalable level", this soun... | 2 | 0 | 0 | I'm thinking if a user submits a message and they click a 'suggest tags' button, their message would be analyzed and a form field populated wIthaca random words from their post.
Is it possible to do this on a scalable level? Would JavaScript be able to handle it or better to Ajax back to python?
I'm thinking certain co... | Is it possible to automatically pull random "tags" from a long string of text? | 0 | 0 | 1 | 60 |
12,375,113 | 2012-09-11T17:43:00.000 | 2 | 1 | 0 | 0 | python,gmail,gmail-imap,imaplib | 12,375,120 | 2 | false | 0 | 0 | IMAP server is still imap.gmail.com -- try with that? | 1 | 1 | 0 | I am trying to download emails using imaplib with Python. I have tested the script using my own email account, but I am having trouble doing it for my corporate gmail (I don't know how the corporate gmail works, but I go to gmail.companyname.com to sign in). When I try running the script with imaplib.IMAP4_SSL("imap.gm... | IMAP in Corporate Gmail | 0.197375 | 0 | 1 | 321 |
12,375,173 | 2012-09-11T17:48:00.000 | 0 | 0 | 1 | 0 | python,windows | 42,477,949 | 19 | false | 0 | 0 | I think I am too late to answer this question but anyways here goes nothing.
I have run in to the same problem before and I think there are two alternative solutions you can choose from.
using sleep(_sometime)
from time import *
sleep(10)
using a prompt message (note that I am using python 2.7)
exit_now = raw_inpu... | 8 | 42 | 0 | I have just started college and we are going to be using python. We really have done nothing so I have downloaded the program and done some print commands, and that's it.
When I run my .py file (a print command) it immediately closes after appearing. I understand why it does this - it's given the output, so it's done w... | How to stop Python closing immediately when executed in Microsoft Windows | 0 | 0 | 0 | 225,642 |
12,375,173 | 2012-09-11T17:48:00.000 | 0 | 0 | 1 | 0 | python,windows | 50,656,710 | 19 | false | 0 | 0 | Late in here, but in case someone comes here from google---
Go to the location of your .py file. Press SHIFT then right click anywhere and choose open command prompt from here. Once it's up, Just add
"python NameOfTheProg.py" to the cmd line | 8 | 42 | 0 | I have just started college and we are going to be using python. We really have done nothing so I have downloaded the program and done some print commands, and that's it.
When I run my .py file (a print command) it immediately closes after appearing. I understand why it does this - it's given the output, so it's done w... | How to stop Python closing immediately when executed in Microsoft Windows | 0 | 0 | 0 | 225,642 |
12,375,173 | 2012-09-11T17:48:00.000 | 0 | 0 | 1 | 0 | python,windows | 71,677,769 | 19 | false | 0 | 0 | just put this line of code
input("")
It worked for me and it's show blank
Thanks! | 8 | 42 | 0 | I have just started college and we are going to be using python. We really have done nothing so I have downloaded the program and done some print commands, and that's it.
When I run my .py file (a print command) it immediately closes after appearing. I understand why it does this - it's given the output, so it's done w... | How to stop Python closing immediately when executed in Microsoft Windows | 0 | 0 | 0 | 225,642 |
12,375,173 | 2012-09-11T17:48:00.000 | 0 | 0 | 1 | 0 | python,windows | 41,017,183 | 19 | false | 0 | 0 | Well I got similar issue,
It is solved by adding Environment Variable.
Add System Variables in Window
Name : PYTHONPATH
Value : C:\Python27;
Your Python path. | 8 | 42 | 0 | I have just started college and we are going to be using python. We really have done nothing so I have downloaded the program and done some print commands, and that's it.
When I run my .py file (a print command) it immediately closes after appearing. I understand why it does this - it's given the output, so it's done w... | How to stop Python closing immediately when executed in Microsoft Windows | 0 | 0 | 0 | 225,642 |
12,375,173 | 2012-09-11T17:48:00.000 | 0 | 0 | 1 | 0 | python,windows | 64,017,306 | 19 | false | 0 | 0 | Just add an line of code in idle "input()" | 8 | 42 | 0 | I have just started college and we are going to be using python. We really have done nothing so I have downloaded the program and done some print commands, and that's it.
When I run my .py file (a print command) it immediately closes after appearing. I understand why it does this - it's given the output, so it's done w... | How to stop Python closing immediately when executed in Microsoft Windows | 0 | 0 | 0 | 225,642 |
12,375,173 | 2012-09-11T17:48:00.000 | -2 | 0 | 1 | 0 | python,windows | 62,414,792 | 19 | false | 0 | 0 | Very simple:
Open command prompt as an administrator.
Type python.exe (provided you have given path of it in environmental variables)
Then, In the same command prompt window the python interpreter will start with >>>
This worked for me. | 8 | 42 | 0 | I have just started college and we are going to be using python. We really have done nothing so I have downloaded the program and done some print commands, and that's it.
When I run my .py file (a print command) it immediately closes after appearing. I understand why it does this - it's given the output, so it's done w... | How to stop Python closing immediately when executed in Microsoft Windows | -0.02105 | 0 | 0 | 225,642 |
12,375,173 | 2012-09-11T17:48:00.000 | 1 | 0 | 1 | 0 | python,windows | 51,530,192 | 19 | false | 0 | 0 | The reason why it is closing is because the program is not running anymore, simply add any sort of loop or input to fix this (or you could just run it through idle.) | 8 | 42 | 0 | I have just started college and we are going to be using python. We really have done nothing so I have downloaded the program and done some print commands, and that's it.
When I run my .py file (a print command) it immediately closes after appearing. I understand why it does this - it's given the output, so it's done w... | How to stop Python closing immediately when executed in Microsoft Windows | 0.010526 | 0 | 0 | 225,642 |
12,375,173 | 2012-09-11T17:48:00.000 | 3 | 0 | 1 | 0 | python,windows | 65,952,963 | 19 | false | 0 | 0 | I know a simple answer!
Open your cmd, the type in: cd C:\directory your file is in and then type python your progam.py | 8 | 42 | 0 | I have just started college and we are going to be using python. We really have done nothing so I have downloaded the program and done some print commands, and that's it.
When I run my .py file (a print command) it immediately closes after appearing. I understand why it does this - it's given the output, so it's done w... | How to stop Python closing immediately when executed in Microsoft Windows | 0.031568 | 0 | 0 | 225,642 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.