Web Development
int64
0
1
Data Science and Machine Learning
int64
0
1
Question
stringlengths
28
6.1k
is_accepted
bool
2 classes
Q_Id
int64
337
51.9M
Score
float64
-1
1.2
Other
int64
0
1
Database and SQL
int64
0
1
Users Score
int64
-8
412
Answer
stringlengths
14
7k
Python Basics and Environment
int64
0
1
ViewCount
int64
13
1.34M
System Administration and DevOps
int64
0
1
Q_Score
int64
0
1.53k
CreationDate
stringlengths
23
23
Tags
stringlengths
6
90
Title
stringlengths
15
149
Networking and APIs
int64
1
1
Available Count
int64
1
12
AnswerCount
int64
1
28
A_Id
int64
635
72.5M
GUI and Desktop Applications
int64
0
1
0
0
I want to send it and forget it. The http rest service call I'm making takes a few seconds to respond. The goal is to avoid waiting those few seconds before more code can execute. I'd rather not use python threads I'll use twisted async calls if I must and ignore the response.
false
3,486,372
0.066568
0
0
1
You are going to have to implement that asynchronously as HTTP protocol states you have a request and a reply. Another option would be to work directly with the socket, bypassing any pre-built module. This would allow you to violate protocol and write your own bit that ignores any responses, in essence dropping the co...
1
2,585
0
6
2010-08-15T05:49:00.000
python,http
How can I make an http request without getting back an http response in Python?
1
2
3
3,486,383
0
0
0
I want to send it and forget it. The http rest service call I'm making takes a few seconds to respond. The goal is to avoid waiting those few seconds before more code can execute. I'd rather not use python threads I'll use twisted async calls if I must and ignore the response.
false
3,486,372
0
0
0
0
HTTP implies a request and a reply for that request. Go with an async approach.
1
2,585
0
6
2010-08-15T05:49:00.000
python,http
How can I make an http request without getting back an http response in Python?
1
2
3
3,486,378
0
0
0
Here is what I would like to do, and I want to know how some people with experience in this field do this: With three POST requests I get from the http server: widgets and layout and then app logic (minimal) data Or maybe it's better to combine the first two or all three. I'm thinking of using pyqt. I think I can loa...
true
3,517,841
1.2
0
0
1
Your desire to send "app logic" from the server to the client without sending "code" is inherently self-contradictory, though you may not realize that yet -- even if the "logic" you're sending is in some simplified ad-hoc "language" (which you don't even think of as a language;-), to all intents and purposes your Pytho...
0
1,647
0
0
2010-08-19T00:33:00.000
python,qt,networking,pyqt,thin
how to implement thin client app with pyqt
1
1
2
3,517,886
1
0
0
I have written a small HTTP server and everything is working fine locally, but I am not able to connect to the server from any other computer, including other computers on the network. I'm not sure if it is a server problem, or if I just need to make some adjustments to Windows. I turned the firewall off, so that can't...
true
3,522,641
1.2
0
0
2
Without any code sample I can only assume that your server is listening on some private interface like localhost/127.0.0.1 and not something that is connected to the rest of your network.
0
213
0
0
2010-08-19T14:13:00.000
python,windows,http
Python Server Help
1
2
2
3,522,672
0
0
0
I have written a small HTTP server and everything is working fine locally, but I am not able to connect to the server from any other computer, including other computers on the network. I'm not sure if it is a server problem, or if I just need to make some adjustments to Windows. I turned the firewall off, so that can't...
false
3,522,641
0
0
0
0
Some things to check: Can you connect to the server via your machine's IP instead of localhost? I.e. if your machine is 1.2.3.4 in the network and the server is listening on port 8080, can you see it by opening a browser to http://1.2.3.4:8080 on the same machine? Can you do (1) from another machine? (just a sanity ch...
0
213
0
0
2010-08-19T14:13:00.000
python,windows,http
Python Server Help
1
2
2
3,522,734
0
0
0
I've develop webmail client for any mail server. I want to implement message conversion for it — for example same emails fwd/reply/reply2all should be shown together like gmail does... My question is: what's the key to find those emails which are either reply/fwd or related to the original mail....
true
3,530,851
1.2
1
0
3
The In-Reply-To header of the child should have the value of the Message-Id header of the parent(s).
0
1,161
0
0
2010-08-20T12:34:00.000
python,imap,pop3,imaplib,poplib
How to maintain mail conversion (reply / forward / reply to all like gmail) of email using Python pop/imap lib?
1
2
2
3,566,252
0
0
0
I've develop webmail client for any mail server. I want to implement message conversion for it — for example same emails fwd/reply/reply2all should be shown together like gmail does... My question is: what's the key to find those emails which are either reply/fwd or related to the original mail....
false
3,530,851
0.197375
1
0
2
Google just seems to chain messages based on the subject line (so does Apple Mail by the way.)
0
1,161
0
0
2010-08-20T12:34:00.000
python,imap,pop3,imaplib,poplib
How to maintain mail conversion (reply / forward / reply to all like gmail) of email using Python pop/imap lib?
1
2
2
3,530,868
0
0
0
Does python have a full fledged email library with things for pop, smtp, pop3 with ssl, mime? I want to create a web mail interface that pulls emails from email servers, and then shows the emails, along with attachments, can display the sender, subject, etc. (handles all the encoding issues etc). It's one thing to be a...
true
3,538,430
1.2
1
0
2
It has all the components you need, in a more modular and flexible arrangement than you appear to envisage -- the standard library's email package deals with the message once you have received it, and separate modules each deal with means of sending and receiving, such as pop, smtp, imap. SSL is an option for each of ...
0
513
0
0
2010-08-21T18:16:00.000
python,email,smtp,mime,pop3
Does python have a robust pop3, smtp, mime library where I could build a webmail interface?
1
1
2
3,538,453
0
0
0
i want to do router configuration using python , but dont want to use any application level protocol to configure it . Is it possible to deal it on a hardware level ? Please do tell if the question is vague or if it needs more explanation , then I would put more details on as to what I have my doubt in
false
3,555,485
0.099668
0
0
1
There is a package named roscraco that configure and extract information from some consumer level routers. It's available on PyPi.
0
616
0
1
2010-08-24T10:30:00.000
python
is it possible to write python scripts which can do router configuration without telnetting into the router?
1
2
2
5,845,120
0
0
0
i want to do router configuration using python , but dont want to use any application level protocol to configure it . Is it possible to deal it on a hardware level ? Please do tell if the question is vague or if it needs more explanation , then I would put more details on as to what I have my doubt in
false
3,555,485
0.099668
0
0
1
The title of your question by itself makes some sense. The body of your question doesn't make sense. is it possible to write python scripts which can do router configuration without telnetting into the router? Yes, depending on the platform. You maybe able to use a variety of other methods to configure the router that...
0
616
0
1
2010-08-24T10:30:00.000
python
is it possible to write python scripts which can do router configuration without telnetting into the router?
1
2
2
3,555,720
0
0
0
I'm using the urllib2.urlopen method to open a URL and fetch the markup of a webpage. Some of these sites redirect me using the 301/302 redirects. I would like to know the final URL that I've been redirected to. How can I get this?
false
3,556,266
0.049958
0
0
1
e.g.: urllib2.urlopen('ORIGINAL LINK').geturl() urllib2.urlopen(urllib2.Request('ORIGINAL LINK')).geturl()
0
34,914
0
22
2010-08-24T12:12:00.000
python,urllib2
How can I get the final redirect URL when using urllib2.urlopen?
1
2
4
31,354,580
0
0
0
I'm using the urllib2.urlopen method to open a URL and fetch the markup of a webpage. Some of these sites redirect me using the 301/302 redirects. I would like to know the final URL that I've been redirected to. How can I get this?
false
3,556,266
0.197375
0
0
4
The return value of urllib2.urlopen has a geturl() method which should return the actual (i.e. last redirect) url.
0
34,914
0
22
2010-08-24T12:12:00.000
python,urllib2
How can I get the final redirect URL when using urllib2.urlopen?
1
2
4
3,556,295
0
0
0
I have tried this probably 6 or 7 different ways, such as using various attribute values, XPath, id pattern matching (it always matches ":\w\w"), etc. as locators, and nothing has worked. If anyone can give me a tested, confirmed-working locator string for this button, I'd be much obliged.
false
3,561,993
0
0
0
0
If you want to emulate a click on the button, just go to #compose.
0
964
0
1
2010-08-25T00:18:00.000
c#,java,python,gmail,selenium-rc
How to access Gmail's "Send" button using Selenium RC for Java or C# or Python
1
1
2
3,562,629
0
1
0
I am trying to encode and store, and decode arguments in Python and getting lost somewhere along the way. Here are my steps: 1) I use google toolkit's gtm_stringByEscapingForURLArgument to convert an NSString properly for passing into HTTP arguments. 2) On my server (python), I store these string arguments as somethin...
false
3,563,126
0.132549
0
0
2
You are out of your luck with stdlib, urllib.quote doesn't work with unicode. If you are using django you can use django.utils.http.urlquote which works properly with unicode
0
83,104
0
48
2010-08-25T05:42:00.000
python,url-encoding
URL encoding/decoding with Python
1
1
3
3,563,366
0
1
0
I'm not sure how to find this information, I have found a few tutorials so far about using Python with selenium but none have so much as touched on this.. I am able to run some basic test scripts through python that automate selenium but it just shows the browser window for a few seconds and then closes it.. I need to ...
true
3,571,233
1.2
0
0
2
There's a Selenium.getHtmlSource() method in Java, most likely it is also available in Python. It returns the source of the current page as string, so you can do whatever you want with it
0
4,318
0
3
2010-08-26T00:22:00.000
python,selenium,browser-automation
Selenium with Python, how do I get the page output after running a script?
1
1
3
3,573,288
0
0
0
A sever I can't influence sends very broken XML. Specifically, a Unicode WHITE STAR would get encoded as UTF-8 (E2 98 86) and then translated using a Latin-1 to HTML entity table. What I get is â 98 86 (9 bytes) in a file that's declared as utf-8 with no DTD. I couldn't configure W3C tidy in a way that doesn't ga...
false
3,577,652
0.197375
0
0
2
BeautifulSoup is your best bet in this case. I suggest profiling before ruling out BeautifulSoup altogether.
0
1,950
0
4
2010-08-26T17:18:00.000
python,xml
How to parse broken XML in Python?
1
1
2
3,577,694
0
0
0
Is it possible to create REST Web Services, that returns JSON or XML, using Python ? Could you give me some recomandations ? Thank you.
false
3,577,994
0
0
0
0
Sure, you can use any web framework you like, just set the content-type header to the mime type you need. For generating json I recommend the simplejson module (ranamed to json and included in the standard library since 2.6), for handling XML the lxml library is very nice.
0
12,155
0
2
2010-08-26T17:57:00.000
python,web-services,rest
Creating REST Web Services with Python
1
1
5
3,578,028
0
0
0
They didn't mention this in python documentation. And recently I'm testing a website simply refreshing the site using urllib2.urlopen() to extract certain content, I notice sometimes when I update the site urllib2.urlopen() seems not get the newly added content. So I wonder it does cache stuff somewhere, right?
false
3,586,295
0
1
0
0
If you make changes and test the behaviour from browser and from urllib, it is easy to make a stupid mistake. In browser you are logged in, but in urllib.urlopen your app can redirect you always to the same login page, so if you just see the page size or the top of your common layout, you could think that your changes ...
0
12,290
0
13
2010-08-27T16:34:00.000
python,urllib2,urlopen
Does urllib2.urlopen() cache stuff?
1
3
5
38,239,971
0
0
0
They didn't mention this in python documentation. And recently I'm testing a website simply refreshing the site using urllib2.urlopen() to extract certain content, I notice sometimes when I update the site urllib2.urlopen() seems not get the newly added content. So I wonder it does cache stuff somewhere, right?
true
3,586,295
1.2
1
0
10
So I wonder it does cache stuff somewhere, right? It doesn't. If you don't see new data, this could have many reasons. Most bigger web services use server-side caching for performance reasons, for example using caching proxies like Varnish and Squid or application-level caching. If the problem is caused by server-si...
0
12,290
0
13
2010-08-27T16:34:00.000
python,urllib2,urlopen
Does urllib2.urlopen() cache stuff?
1
3
5
3,586,796
0
0
0
They didn't mention this in python documentation. And recently I'm testing a website simply refreshing the site using urllib2.urlopen() to extract certain content, I notice sometimes when I update the site urllib2.urlopen() seems not get the newly added content. So I wonder it does cache stuff somewhere, right?
false
3,586,295
-0.07983
1
0
-2
I find it hard to believe that urllib2 does not do caching, because in my case, upon restart of the program the data is refreshed. If the program is not restarted, the data appears to be cached forever. Also retrieving the same data from Firefox never returns stale data.
0
12,290
0
13
2010-08-27T16:34:00.000
python,urllib2,urlopen
Does urllib2.urlopen() cache stuff?
1
3
5
3,936,916
0
0
0
I'm writing a game which requires users to log in to their accounts in order to be able to play. What's the best way of transmitting passwords from client to server and storing them? I'm using Python and Twisted, if that's of any relevance.
true
3,595,835
1.2
1
0
1
The best way is to authenticate via SSL/TLS. The best way of storing passwords is to store them hashed with some complex hash like sha1(sha1(password)+salt) with salt.
0
447
0
0
2010-08-29T17:38:00.000
python,security,passwords,network-programming
Handling Password Authentication over a Network
1
1
2
3,595,865
0
1
0
Is there any approach to generate editor of an XML file basing on an XSD scheme? (It should be a Java or Python web based editor).
false
3,599,569
0.066568
0
0
1
Funny, I'm concerning myself with something similar. I'm building an editor (not really WYSIWYG, but it abstracts the DOM away) for the XMLs Civilization 4 (strategy game) usesu to store about everything. I thought about it for quite a while and built two prototypes (in Python), one of which looks promising so I will e...
0
4,417
0
4
2010-08-30T10:33:00.000
java,python,xml,xsd
Automatic editor of XML (based on XSD scheme)
1
1
3
3,599,767
0
0
0
I'm trying to develop some scripts for iTunes in python and actually i'm having quite a hard time getting the API information. I'm using the win32com.client module but i would really need to get all the specifications, methods and details. There are a few examples but I need some extra data...... thanks!!!
false
3,602,728
-0.049958
0
0
-1
Run dir(my_com_client) to get a list of available methods.
0
9,348
0
5
2010-08-30T17:27:00.000
python,itunes,win32com
iTunes API for python scripting
1
1
4
3,602,834
0
0
0
I'm learning to use the Queue module, and am a bit confused about how a queue consumer thread can be made to know that the queue is complete. Ideally I'd like to use get() from within the consumer thread and have it throw an exception if the queue has been marked "done". Is there a better way to communicate this than...
false
3,605,188
0.07983
0
0
2
Queue is a FIFO (first in first out) register so remember that the consumer can be faster than producer. When consumers thread detect that the queue is empty normally realise one of following actions: Send to API: switch to next thread. Send to API: sleep some ms and than check again the queue. Send to API: wait on ev...
1
10,185
0
14
2010-08-31T00:21:00.000
python,multithreading,queue
Communicating end of Queue
1
3
5
3,607,187
0
0
0
I'm learning to use the Queue module, and am a bit confused about how a queue consumer thread can be made to know that the queue is complete. Ideally I'd like to use get() from within the consumer thread and have it throw an exception if the queue has been marked "done". Is there a better way to communicate this than...
false
3,605,188
0
0
0
0
The best practice way of doing this would be to have the queue itself notify a client that it has reached the 'done' state. The client can then take any action that is appropriate. What you have suggested; checking the queue to see if it is done periodically, would be highly undesirable. Polling is an antipattern in mu...
1
10,185
0
14
2010-08-31T00:21:00.000
python,multithreading,queue
Communicating end of Queue
1
3
5
3,605,282
0
0
0
I'm learning to use the Queue module, and am a bit confused about how a queue consumer thread can be made to know that the queue is complete. Ideally I'd like to use get() from within the consumer thread and have it throw an exception if the queue has been marked "done". Is there a better way to communicate this than...
false
3,605,188
1
0
0
8
A sentinel is a natural way to shut down a queue, but there are a couple things to watch out for. First, remember that you may have more than one consumer, so you need to send a sentinel once for each running consumer, and guarantee that each consumer will only consume one sentinel, to ensure that each consumer receive...
1
10,185
0
14
2010-08-31T00:21:00.000
python,multithreading,queue
Communicating end of Queue
1
3
5
3,605,258
0
0
0
I am using python for web programming and javascript heavily. Currently, i am using NetBeans but i am looking for another IDE. NetBeans is not very good while programming with python and javascript. Any suggestion?
false
3,608,409
0
0
0
0
It's not quite IDE, but on MacOSX i'm using TextMate, it have many extensions which makes it very powerful.
1
6,379
0
6
2010-08-31T11:12:00.000
javascript,python,ide
IDE Suggestion for python and javascript
1
4
7
3,608,498
0
0
0
I am using python for web programming and javascript heavily. Currently, i am using NetBeans but i am looking for another IDE. NetBeans is not very good while programming with python and javascript. Any suggestion?
false
3,608,409
0.028564
0
0
1
PyCharm (and other IDEs on IDEA platform) is brilliant IDE for python, js, xml, css and other languages in webdev stack.
1
6,379
0
6
2010-08-31T11:12:00.000
javascript,python,ide
IDE Suggestion for python and javascript
1
4
7
3,608,554
0
0
0
I am using python for web programming and javascript heavily. Currently, i am using NetBeans but i am looking for another IDE. NetBeans is not very good while programming with python and javascript. Any suggestion?
false
3,608,409
0.028564
0
0
1
I use Eclipse with Pydev (Python) and Aptana (Javascript) plugins
1
6,379
0
6
2010-08-31T11:12:00.000
javascript,python,ide
IDE Suggestion for python and javascript
1
4
7
3,608,748
0
0
0
I am using python for web programming and javascript heavily. Currently, i am using NetBeans but i am looking for another IDE. NetBeans is not very good while programming with python and javascript. Any suggestion?
false
3,608,409
0
0
0
0
For web programming I used Espresso, it only work on Mac but it is quite good,this one is an IDE. I don't think the rest classify as an IDE. For python I use sublimetext2 because it can be customize and has a great GUI feel. I used to use notepad++ don't really suggest it. I think if you are asking for efficiency use v...
1
6,379
0
6
2010-08-31T11:12:00.000
javascript,python,ide
IDE Suggestion for python and javascript
1
4
7
28,404,847
0
0
0
I try to move email from mailbox's gmail to another one, Just curious that UID of each email will change when move to new mailbox ?
true
3,615,561
1.2
1
0
4
Yes of course the UID is changed when you do move operation. the new UID for that mail will be the next UID from the destination folder. (i.e if the last mail UID of the destination folder is : 9332 , then the UID of the move email will be 9333) Note: UID is changed but the Message-Id will not be changed during an...
0
5,836
0
0
2010-09-01T06:37:00.000
python,imap,imaplib
About IMAP UID with imaplib
1
1
2
3,636,059
0
1
0
I am scripting in python for some web automation. I know i can not automate captchas but here is what i want to do: I want to automate everything i can up to the captcha. When i open the page (usuing urllib2) and parse it to find that it contains a captcha, i want to open the captcha using Tkinter. Now i know that i wi...
false
3,623,077
0.379949
0
0
2
Of course the captcha's served by a page which will serve a new one each time (if it was repeated, then once it was solved for one fake userid, a spammer could automatically make a million!). I think you need some "screenshot" functionality to capture the image you want -- there is no cross-platform way to invoke such...
0
1,432
0
0
2010-09-02T00:38:00.000
python,web-applications,firebug,tkinter,urllib2
Is there a way to save a captcha image and view it later in python?
1
1
1
3,623,274
0
1
0
I have a form which when submitted by a user redirects to a thank you page and the file chosen for download begins to download. How can I save this file using python? I can use python's urllib.urlopen to open the url to post to but the html returned is the thank you page, which I suspected it would be. Is there a solut...
true
3,628,454
1.2
0
0
2
If you're getting back a thank you page, the URL to the file is likely to be in there somewhere. Look for <meta http-equiv="refresh"> or JavaScript redirects. Ctrl+F'ing the page for the file name might also help. Some sites may have extra protection in, so if you can't figure it out, post a link to the site, just in c...
0
383
0
1
2010-09-02T15:07:00.000
python,html,download,urllib
Python - How do I save a file delivered from html?
1
1
1
3,628,497
0
0
0
How can I remove / inspect / modify handlers configured for my loggers using the fileConfig() function? For removing there is Logger.removeHandler(hdlr) method, but how do I get the handler in first place if it was configured from file?
true
3,630,774
1.2
0
0
78
logger.handlers contains a list with all handlers of a logger.
0
46,204
0
70
2010-09-02T20:05:00.000
python,logging
logging remove / inspect / modify handlers configured by fileConfig()
1
1
5
3,630,800
0
0
0
I am attempting to use the tweepy api to make a twitter function and I have two issues. I have little experience with the terminal and Python in general. 1) It installed properly with Python 2.6, however I can't use it or install it with Python 3.1. When I attempt to install the module in 3.1 it gives me an error tha...
false
3,631,828
-0.099668
1
0
-1
Update: The comments below have some solid points against this technique. 2) What OS are you running? Generally, there is a symlink somewhere in your system, which points from 'python' to 'pythonx.x', where x.x is the version number preferred by your operating system. On Linux, there is a symlink /usr/bin/python, whic...
1
1,565
0
0
2010-09-02T22:39:00.000
python,tweepy
Python defaults and using tweepy api
1
1
2
3,631,888
0
1
0
I'm using Python to parse an auction site. If I use browser to open this site, it will go to a loading page, then jump to the search result page automatically. If I use urllib2 to open the webpage, the read() method only return the loading page. Is there any python package could wait until all contents are loaded then ...
false
3,637,681
0
0
0
0
How does the search page work? If it loads anything using Ajax, you could do some basic reverse engineering and find the URLs involved using Firebug's Net panel or Wireshark and then use urllib2 to load those. If it's more complicated than that, you could simulate the actions JS performs manually without loading and in...
0
862
0
0
2010-09-03T16:26:00.000
javascript,python
How to parse a web use javascript to load .html by Python?
1
1
2
3,637,740
0
0
0
i'm crawling an SNS with crawler written in python it works for a long time, but few days ago, the webpages got from my severs were ERROR 403 FORBIDDEN. i tried to change the cookie, change the browser, change the account, but all failed. and it seems that are the forbidden severs are in the same network segment. what ...
true
3,648,525
1.2
0
0
1
Looks like you've been blacklisted at the router level in that subnet, perhaps because you (or somebody else in the subnet) was violating terms of use, robots.txt, max crawling frequency as specified in a site-map, or something like that. The solution is not technical, but social: contact the webmaster, be properly apo...
0
2,076
0
0
2010-09-06T01:19:00.000
python,web-crawler,http-status-code-403
how to crawl a 403 forbidden SNS
1
1
1
3,648,748
0
1
0
I have to migrate data to OpenERP through XMLRPC by using TerminatOOOR. I send a name with value "Rotule right Aurélia". In Python the name with be encoded with value : 'Rotule right Aur\xc3\xa9lia ' But in TerminatOOOR (xmlrpc client) the data is encoded with value 'Rotule middle Aur\357\277\275lia' So in the server s...
false
3,651,031
0.099668
0
0
1
This issue comes from Kettle. My program is using Kettle to get an Excel file, get the active sheet and transfer the data in that sheet to TerminateOOOR for further handling. At the phase of reading data from Excel file, Kettle can not recognize the encoding then it gives bad data to TerminateOOOR. My work around sol...
0
1,981
0
1
2010-09-06T11:23:00.000
python,ruby,unicode,xml-rpc
Handling unicode data in XMLRPC
1
1
2
3,698,942
0
0
0
I have substantial PHP experience, although I realize that PHP probably isn't the best language for a large-scale web crawler because a process can't run indefinitely. What languages do people suggest?
false
3,664,016
0.028564
1
0
1
You could consider using a combination of python and PyGtkMozEmbed or PyWebKitGtk plus javascript to create your spider. The spidering could be done in javascript after the page and all other scripts have loaded. You'd have one of the few web spiders that supports javascript, and might pick up some hidden stuff the oth...
0
6,849
0
3
2010-09-08T01:27:00.000
php,c++,python,web-crawler
What languages are good for writing a web crawler?
1
4
7
3,664,065
0
0
0
I have substantial PHP experience, although I realize that PHP probably isn't the best language for a large-scale web crawler because a process can't run indefinitely. What languages do people suggest?
false
3,664,016
-0.085505
1
0
-3
C# and C++ are probably the best two languages for this, it's just a matter of which you know better and which is faster (C# is probably easier). I wouldn't recommend Python, Javascript, or PHP. They will usually be slower in text processing compared to a C-family language. If you're looking to crawl any significant ch...
0
6,849
0
3
2010-09-08T01:27:00.000
php,c++,python,web-crawler
What languages are good for writing a web crawler?
1
4
7
3,664,086
0
0
0
I have substantial PHP experience, although I realize that PHP probably isn't the best language for a large-scale web crawler because a process can't run indefinitely. What languages do people suggest?
false
3,664,016
1
1
0
6
Any language you can easily use with a good network library and support for parsing the formats you want to crawl. Those are really the only qualifications.
0
6,849
0
3
2010-09-08T01:27:00.000
php,c++,python,web-crawler
What languages are good for writing a web crawler?
1
4
7
3,664,054
0
0
0
I have substantial PHP experience, although I realize that PHP probably isn't the best language for a large-scale web crawler because a process can't run indefinitely. What languages do people suggest?
true
3,664,016
1.2
1
0
0
C++ - if you know what you're doing. You will not need a web server and a web application, because a web crawler is just a client, after all.
0
6,849
0
3
2010-09-08T01:27:00.000
php,c++,python,web-crawler
What languages are good for writing a web crawler?
1
4
7
3,664,049
0
0
0
I m trying to use smtp class from Python 2.6.4 to send smtp email from a WinXP VMware machine. After the send method is called, I always got this error: socket.error: [Errno 10061] No connection could be made because the target machine actively refused it. Few stuff I noticed: The same code works in the physical WinXP...
true
3,664,438
1.2
1
0
2
The phrase "...because the target machine actively refused it" usually means there's a firewall that drops any unauthorized connections. Is there a firewall service on the SMTP server that's blocking the WinXP VM's IP address? Or, more likely: Is the SMTP server not configured to accept relays from the WinXP VM's IP ad...
0
828
0
1
2010-09-08T03:23:00.000
python,email,smtp,vmware
Python smtp connection is always failed in a VMware Windows machine
1
1
1
3,668,622
0
0
0
I am developing an email client in Python. Is it possible to check if an email contains an attachement just from the e-mail header without downloading the whole E-Mail?
true
3,676,344
1.2
1
0
5
"attachment" is quite a broad term. Is an image for HTML message an attachment? In general, you can try analyzing content-type header. If it's multipart/mixed, most likely the message contains an attachment.
0
2,147
0
4
2010-09-09T12:05:00.000
python,email,imap,imaplib
Is it possible to check if an email contains an attachement just from the e-mail header?
1
1
2
3,676,393
0
0
0
Can anyone point me towards tutorials for using the Python API in Ntop (other than that Luca Deris paper)? In web interfaces there is about > online documentation > python engine but I think this link has an error. Does anyone have access to that document to re-post online for me?
false
3,686,080
0.53705
0
0
3
If you have ntop installed you can look at the example files in /usr/share/ntop/python (that's where they're at in the Ubuntu package version, at least). If you have epydoc installed you can run make from within the /usr/share/ntop/python/docs directory to generate the documentation. Once you do that the About > Onlin...
0
1,189
0
0
2010-09-10T15:46:00.000
python
Ntop Python API
1
1
1
7,302,974
0
1
0
Is there anyway I can parse a website by just viewing the content as displayed to the user in his browser? That is, instead of downloading "page.htm"l and starting to parse the whole page with all the HTML/javascript tags, I will be able to retrieve the version as displayed to users in their browsers. I would like to "...
false
3,690,560
0
0
0
0
You could get the source and strip the tags out, leaving only non-tag text, which works for almost all pages, except those where JavaScript-generated content is essential.
0
82
0
0
2010-09-11T10:09:00.000
python,html
Counting content only in HTML page
1
2
3
3,690,576
0
1
0
Is there anyway I can parse a website by just viewing the content as displayed to the user in his browser? That is, instead of downloading "page.htm"l and starting to parse the whole page with all the HTML/javascript tags, I will be able to retrieve the version as displayed to users in their browsers. I would like to "...
true
3,690,560
1.2
0
0
0
A browser also downloads the page.html and then renders it. You should work the same way. Use a html parser like lxml.html or BeautifulSoup, using those you can ask for only the text enclosed within tags (and arguments you do like, like title and alt attributes).
0
82
0
0
2010-09-11T10:09:00.000
python,html
Counting content only in HTML page
1
2
3
3,690,865
0
0
0
I'm moving some tests from Selenium to the WebDriver. My problem is that I can't find an equivalent for selenium.wait_for_condition. Do the Python bindings have this at the moment, or is it still planned?
false
3,694,508
0
0
0
0
The Java binding include a Wait class. This class repeatedly checks for a condition (with sleeps between) until a timeout is reached. If you can detect the completion of your Javascript using the normal API, you can take the same approach.
0
3,806
0
8
2010-09-12T10:37:00.000
python,selenium,webdriver
selenium.wait_for_condition equivalent in Python bindings for WebDriver
1
1
3
3,743,112
0
0
0
How can we call the CLI executables commands using Python For example i have 3 linux servers which are at the remote location and i want to execute some commands on those servers like finding the version of the operating system or executing any other commands. So how can we do this in Python. I know this is done throug...
false
3,699,268
0
0
0
0
Depends on how you want to design your software. You could do stand-alone scripts as servers listening for requests on specific ports, or you could use a webserver which runs python scripts so you just have to access a URL. REST is one option to implement the latter. You should then look for frameworks for REST develop...
0
170
1
1
2010-09-13T09:41:00.000
python,django,web-services,api,soap
How can we call the CLI executables commands using Python
1
1
3
3,699,299
0
0
0
I am working on a project that requires me to collect a large list of URLs to websites about certain topics. I would like to write a script that will use google to search specific terms, then save the URLs from the results to a file. How would I go about doing this? I have used a module called xgoogle, but it always re...
false
3,732,595
0
0
0
0
Make sure that you change the User-Agent of urllib2. The default one tends to get blocked by Google. Make sure that you obey the terms of use of the search engine that you're scripting.
0
402
0
0
2010-09-17T04:04:00.000
python,windows,search,hyperlink
Search Crawling "Bot"?
1
1
2
3,732,721
0
0
0
I am going to write a TCP server, the client sends me XML message, I am wondering if below condition will happen and how to avoid that: 1) client sends <cmd ...></cmd> 2) sever is busy doing something 3) clients sends <cmd ...></cmd> 4) server does a recv() and put the string to buffer Will the buffer be filled with <c...
true
3,733,363
1.2
0
0
0
You often write clients in the plural form: are there several clients connecting to your server? In this case, each client should be using its own TCP stream, and the issue you are describing should never occur. If the various commands are send from a single client, then you should write your client code so that it wai...
0
772
1
0
2010-09-17T07:20:00.000
python,networking,tcp
TCP server: how to avoid message overlapping
1
2
3
3,733,452
0
0
0
I am going to write a TCP server, the client sends me XML message, I am wondering if below condition will happen and how to avoid that: 1) client sends <cmd ...></cmd> 2) sever is busy doing something 3) clients sends <cmd ...></cmd> 4) server does a recv() and put the string to buffer Will the buffer be filled with <c...
false
3,733,363
0.26052
0
0
4
This is impossible to guarantee at the TCP level, since it only knows about streams. Depending on the XML parser you're using, you should be able to feed it the stream and have it tell you when it has a complete object, leaving the second <cmd... in its buffer until it is closed also.
0
772
1
0
2010-09-17T07:20:00.000
python,networking,tcp
TCP server: how to avoid message overlapping
1
2
3
3,733,419
0
0
0
Is it possible that CherryPy, in its default configuration, is caching the responses to one or more of my request handlers? And, if so, how do I turn that off?
true
3,736,606
1.2
1
0
4
CherryPy has a caching Tool, but it's never on by default. Most HTTP responses are cacheable by default, though, so look for an intermediate cache between your client and server. Look at the browser first. If you're not sure whether or not your content is being cached, compare the Date response header to the current ti...
0
2,007
0
3
2010-09-17T15:15:00.000
python,http,cherrypy
How to determine if CherryPy is caching responses?
1
1
2
3,737,124
0
0
0
I have a simple workflow [Step 0]->[1]->[2]->...->[Step N]. The master program knows the step (state) it is currently at. I want to stream this in real time to a website (in the local area network) so that when my colleagues open, say, http://thecomputer:8000, they can see a real time rendering of the current state of ...
false
3,739,296
0.039979
0
0
1
You could have the python script write an xml file that you get with an ajax request in your web page, and get the status info from that.
0
880
0
4
2010-09-17T21:47:00.000
javascript,python,streaming,real-time
Streaming the state of a Python script to a website
1
1
5
3,739,311
0
0
0
I want to see if I can access an online API, but for that, I need to have Internet access. How can I see if there's a connection available and active using Python?
false
3,764,291
1
0
0
10
You can just try to download data, and if connection fail you will know that somethings with connection isn't fine. Basically you can't check if computer is connected to internet. There can be many reasons for failure, like wrong DNS configuration, firewalls, NAT. So even if you make some tests, you can't have guarante...
0
229,860
0
162
2010-09-21T20:39:00.000
python,networking
How can I see if there's an available and active network connection in Python?
1
2
21
3,764,315
0
0
0
I want to see if I can access an online API, but for that, I need to have Internet access. How can I see if there's a connection available and active using Python?
false
3,764,291
0.047583
0
0
5
Try the operation you were attempting to do anyway. If it fails python should throw you an exception to let you know. To try some trivial operation first to detect a connection will be introducing a race condition. What if the internet connection is valid when you test but goes down before you need to do actual work?
0
229,860
0
162
2010-09-21T20:39:00.000
python,networking
How can I see if there's an available and active network connection in Python?
1
2
21
3,764,759
0
0
0
I am currently working on exposing data from legacy system over the web. I have a (legacy) server application that sends and receives data over UDP. The software uses UDP to send sequential updates to a given set of variables in (near) real-time (updates every 5-10 ms). thus, I do not need to capture all UDP data -- it...
true
3,768,019
1.2
0
0
4
The software uses UDP to send sequential updates to a given set of variables in (near) real-time (updates every 5-10 ms). thus, I do not need to capture all UDP data -- it is sufficient that the latest update is retrieved What you must do is this. Step 1. Build a Python app that collects the UDP data and caches it int...
0
4,771
1
6
2010-09-22T09:44:00.000
python,wsgi
How to serve data from UDP stream over HTTP in Python?
1
1
3
3,768,227
0
0
0
I am trying to use python's imaplib to create an email and send it to a mailbox with specific name, e.g. INBOX. Anyone has some great suggestion :).
false
3,769,701
-1
1
0
-6
No idea how they do it but doesn't Microsoft Outlook let you move an email from a local folder to a remote IMAP folder?
0
18,674
0
5
2010-09-22T13:28:00.000
python,imaplib
How to create an email and send it to specific mailbox with imaplib
1
1
4
3,787,209
0
0
0
how do i run a python program that is received by a client from server without writing it into a new python file?
false
3,798,067
0
0
0
0
Dcolish's answer is good. I'm not sure the idea of executing code that comes in on a network interface is good in itself, though - you will need to take care to verify that you can trust the sending party, especially if this interface is going to be exposed to the Internet or really any production network.
0
387
0
0
2010-09-26T13:49:00.000
python
network programming in python
1
1
4
3,805,092
0
1
0
I'm using web2py for an intranet site and need to get current login windows user id in my controller. Whether any function is available?
false
3,798,606
0.066568
0
0
1
If you mean you need code at the server to know the windows id of the current browser user, web2py isn't going to be able to tell you that. Windows authentication has nothing to do with web protocols.
0
996
0
3
2010-09-26T16:04:00.000
python,windows,web2py
How to get windows user id in web2py for an intranet application?
1
1
3
3,798,630
0
1
0
I changed my domain from abc.com to xyz.com. After that my facebook authentication is not working. It is throwing a key error KeyError: 'access_token'I am using python as my language.
false
3,806,082
0
1
0
0
You probably need to update the domain in the facebook settings/api key which allow you access.
0
186
0
0
2010-09-27T17:08:00.000
python,facebook
My facebook authentication is not working?
1
1
1
3,806,101
0
0
0
Is there any python function that validates E-mail addresses, aware of IDN domains ? For instance, user@example.com should be as correct as user@zääz.de or user@納豆.ac.jp Thanks.
false
3,806,393
0.066568
1
0
1
It is very difficult to validate an e-mail address because the syntax is so flexible. The best strategy is to send a test e-mail to the entered address.
0
548
0
0
2010-09-27T17:43:00.000
python
Function to validate an E-mail (IDN aware)
1
1
3
3,806,787
0
0
0
I've been searching on this but can't seem to find an exact answer (most get into more complicated things like multithreading, etc), I just want to do something like a Try, Except statement where if the process doesn't finish within X number of seconds it will throw an exception. EDIT: The reason for this is that I am ...
false
3,810,869
0.132549
0
0
2
You can't do it without some sort of multithreading or multiprocessing, even if that's hidden under some layers of abstraction, unless that "process" you're running is specifically designed for asynchronicity and calls-back to a known function once in a while. If you describe what that process actually is, it will be e...
1
6,285
0
4
2010-09-28T08:15:00.000
python,error-handling,timeout
Python, Timeout of Try, Except Statement after X number of seconds?
1
1
3
3,810,878
0
1
0
There is the URL of page on the Internet. I need to get a screenshot of this page (no matter in which browser). I need a script (PHP, Python (even Django framework)) that receives the URL (string) and output screenshot-file at the exit (file gif, png, jpg). UPD: I need dynamically create a page where opposite to URL w...
false
3,811,674
0
0
0
0
If you are family with Python, you can use PyQt4. This library supports to get screenshot from a url.
0
31,489
0
7
2010-09-28T10:08:00.000
php,python,django,url,screenshot
Convert URL to screenshot (script)
1
1
6
21,106,018
0
0
0
How can I know if a node that is being accessed using TCP socket is alive or if the connection was interrupted and other errors? Thanks!
false
3,813,451
0.379949
0
0
2
You can't. Any intermediate nodes can drop your packets or the reply packets from the remote node.
0
240
0
1
2010-09-28T13:51:00.000
python,sockets,system,distributed
Python socket programming
1
1
1
3,813,510
0
0
0
I wish to set the namespace prefix in xml.etree. I found register_namespace(prefix, url) on the Web but this threw "unknown attribute". I have also tried nsmap=NSMAP but this also fails. I'd be grateful for example syntax that shows how to add specified namespace prefixes
true
3,814,365
1.2
0
0
1
register_namespace was only introduced in lxml 2.3 (still beta) I believe you can provide an nsmap parameter (dictionary with prefix-uri mappings) when creating an element, but I don't think you can change it for an existing element. (there is an .nsmap property on the element, but changing that doesn't seem to work. T...
0
1,128
0
3
2010-09-28T15:28:00.000
python,xml.etree
how to set namespace prefixes in xml.etree
1
1
1
3,814,788
0
0
0
i wrote a py script to fetch page from web,it just read write permission enough,so my question is when we need execute permission?
false
3,822,336
1
0
0
6
Read/write is enough if you want to run it by typing python file.py. If you want to run it directly as if it were a compiled program, e.g. ./file.py, then you need execute permission (and the appropriate hash-bang line at the top).
0
6,642
0
4
2010-09-29T14:01:00.000
python,permissions,chmod
when we need chmod +x file.py
1
3
3
3,822,354
0
0
0
i wrote a py script to fetch page from web,it just read write permission enough,so my question is when we need execute permission?
false
3,822,336
0
0
0
0
If you want to be able to run it directly with $ file.py then you'll need the execute bit set. Otherwise you can run it with $ python file.py.
0
6,642
0
4
2010-09-29T14:01:00.000
python,permissions,chmod
when we need chmod +x file.py
1
3
3
3,822,352
0
0
0
i wrote a py script to fetch page from web,it just read write permission enough,so my question is when we need execute permission?
true
3,822,336
1.2
0
0
5
It's required to do so if you need to run the script in this way: ./file.py. Keep in mind though, you need to put the path of python at the very top of the script: #!/usr/bin/python. But wait, you need to make sure you have the proper path, to do that execute: which python.
0
6,642
0
4
2010-09-29T14:01:00.000
python,permissions,chmod
when we need chmod +x file.py
1
3
3
3,822,410
0
0
0
The situation is that I have a small datacenter, with each server running python instances. It's not your usual distributed worker setup, as each server has a specific role with an appropriate long-running process. I'm looking for good ways to implement the the cross-server communication. REST seems like overkill. XML-...
false
3,823,420
0.099668
0
0
1
It wasn't obvious from your question but if getting answers back synchronously doesn't matter to you (i.e., you are just asking for work to be performed) you might want to consider just using a job queue. It's generally the easiest way to communicate between hosts. If you don't mind depending on AWS using SQS is super ...
0
196
0
0
2010-09-29T15:57:00.000
python,network-protocols
What are good specs/libraries for closed network communication in python?
1
1
2
3,824,612
0
0
0
When I call selenium.get_text("foo") on a certain element it returns back a different value depending on what browser I am working in due to the way each browser handles newlines. Example: An elements string is "hello[newline]how are you today?[newline]Very well, thank you." When selenium gets this back from IE it gets...
true
3,824,734
1.2
0
0
0
I ended up just doing a check of what browser I was running and then returning the string with the '\n ' replaced with '\n' if the browser was firefox.
0
1,614
0
1
2010-09-29T18:31:00.000
python,selenium
Selenium and Python: remove \n from returned selenium.get_text()
1
1
1
3,825,411
0
0
0
I have a script that runs continuously when invoked and every 5 minutes checks my gmail inbox. To get it to run every 5 minutes I am using the time.sleep() function. However I would like user to end the script anytime my pressing q, which it seems cant be done when using time.sleep(). Any suggestions on how i can do th...
false
3,836,620
0
0
0
0
If you really wanted to (and wanted to waste a lot of resources), you could cut your loop into 200 ms chunks. So sleep 200 ms, check input, repeat until five minutes elapse, and then check your inbox. I wouldn't recommend it, though. While it's sleeping, though, the process is blocked and won't receive input until the ...
0
5,470
0
4
2010-10-01T04:51:00.000
python,continuous
Continous loop and exiting in python
1
1
3
3,836,650
0
0
0
I just need to write a simple python CGI script to parse the contents of a POST request containing JSON. This is only test code so that I can test a client application until the actual server is ready (written by someone else). I can read the cgi.FieldStorage() and dump the keys() but the request body containing the J...
false
3,836,828
1
1
0
8
notice that if you call cgi.FieldStorage() before in your code, you can't get the body data from stdin, because it just be read once.
0
8,362
0
11
2010-10-01T05:49:00.000
python,parsing,cgi,request
How to parse the "request body" using python CGI?
1
1
2
39,910,366
0
0
0
I have a list of xml examples I would like to turn into schemas (xsd files). Exactly what the trang tool does (http://www.thaiopensource.com/relaxng/trang.html). I don't like calling trang from my script (i.e doing os.system('java -jar trang...')) - is there a python package I can use instead?
false
3,849,632
0
0
0
0
If you are running Jython (http://jython.org/) then you could import trang and run it internally.
0
387
0
3
2010-10-03T11:59:00.000
python,xml,xsd
Python: Is there a way to generate xsd files based on xml examples
1
1
1
5,188,517
0
0
0
I have a server with two separate Ethernet connections. When I bind a socket in python it defaults to one of the two networks. How do I pull a multicast stream from the second network in Python? I have tried calling bind using the server's IP address on the second network, but that hasn't worked.
true
3,859,090
1.2
0
0
0
I figured it out. It turns out that the piece I was missing was adding the interface to the mreq structure that is used in adding membership to a multicast group.
0
9,358
0
6
2010-10-04T21:04:00.000
python,sockets,networking
Choosing multicast network interface in Python
1
1
4
3,873,419
0
0
0
How can I call shutdown() in a SocketServer after receiving a certain message "exit"? As I know, the call to serve_forever() will block the server. Thanks!
false
3,863,281
0.379949
0
0
4
No the serve_forever is checking a flag on a regular basis (by default 0.5 sec). Calling shutdown will raise this flag and cause the serve_forever to end.
0
3,881
0
6
2010-10-05T11:40:00.000
python,sockets,socketserver
Python SocketServer
1
1
2
3,863,539
0
1
0
Im using scrapy to crawl a news website on a daily basis. How do i restrict scrapy from scraping already scraped URLs. Also is there any clear documentation or examples on SgmlLinkExtractor.
false
3,871,613
0.039979
0
0
1
I think jama22's answer is a little incomplete. In the snippet if self.FILTER_VISITED in x.meta:, you can see that you require FILTER_VISITED in your Request instance in order for that request to be ignored. This is to ensure that you can differentiate between links that you want to traverse and move around and item l...
0
9,648
0
15
2010-10-06T10:38:00.000
python,web-crawler,scrapy
Scrapy - how to identify already scraped urls
1
2
5
8,830,983
0
1
0
Im using scrapy to crawl a news website on a daily basis. How do i restrict scrapy from scraping already scraped URLs. Also is there any clear documentation or examples on SgmlLinkExtractor.
false
3,871,613
0.039979
0
0
1
Scrapy can auto-filter urls which are scraped, isn't it? Some different urls point to the same page will not be filtered, such as "www.xxx.com/home/" and "www.xxx.com/home/index.html".
0
9,648
0
15
2010-10-06T10:38:00.000
python,web-crawler,scrapy
Scrapy - how to identify already scraped urls
1
2
5
13,578,588
0
0
0
I am running my code on multiple VPSes (with more than one IP, which are set up as aliases to the network interfaces) and I am trying to figure out a way such that my code acquires the IP addresses from the network interfaces on the fly and bind to it. Any ideas on how to do it in python without adding a 3rd party libr...
false
3,881,951
0
0
0
0
The IP addresses are assigned to your VPSes, no possibility to change them on the fly. You have to open a SSH tunnel to or install a proxy on your VPSes. I think a SSH tunnel would be the best way how to do it, and then use it as SOCKS5 proxy from Python.
0
118
0
1
2010-10-07T13:10:00.000
python
figuring out how to get all of the public ips of a machine
1
1
2
3,882,193
0
1
0
I want to show .ppt (PowerPoint) files uploaded by my user on my website. I could do this by converting them into Flash files, then showing the Flash files on the web page. But I don't want to use Flash to do this. I want to show it, like google docs shows, without using Flash. I've already solved the problem for .pdf ...
true
3,882,249
1.2
0
0
0
Now i found a solution to showing .ppt file on my website without using the flash the solution is: just convert the .ppt file to .pdf files using any language or using software(e.g. open office) and then use Imagemagick to convert that .pdf into image and show to your web page once again thanks to you all for answeri...
0
1,773
0
2
2010-10-07T13:45:00.000
java,c++,python,powerpoint,google-docs
How google docs shows my .PPT files without using a flash viewer?
1
1
3
3,899,697
0
0
0
On my linux machine, 1 of 3 network interfaces may be actually connected to the internet. I need to get the IP address of the currently connected interface, keeping in mind that my other 2 interfaces may be assigned IP addresses, just not be connected. I can just ping a website through each of my interfaces to determin...
false
3,885,160
0
0
0
0
If the default gateway for the system is reliable, then grab that from the output from route -n the line that contains " UG " (note the spaces) will also contain the IP of the gateway and interface name of the active interface.
0
2,443
1
1
2010-10-07T19:24:00.000
python,linux,networking,ip-address
Determine IP address of CONNECTED interface (linux) in python
1
1
2
3,885,255
0
0
0
Using just python, is it possible to possible to use a USB flash drive to serve files locally to a browser, and save information off the online web? Ideally I would only need python. Where would I start?
false
3,885,519
0
0
0
0
This doesn't seem much different then serving files from a local hard drive. You could map the thumbdrive to always be something not currently used on your machine (like U:).
0
195
0
0
2010-10-07T20:13:00.000
python,web-services,usb
Is it possible to use a USB flash drive to serve files locally to a browser?
1
1
2
3,885,544
0
0
0
I have client for web interface to long running process. I'd like to have output from that process to be displayed as it comes. Works great with urllib.urlopen(), but it doesn't have timeout parameter. On the other hand with urllib2.urlopen() the output is buffered. Is there a easy way to disable that buffer?
true
3,888,812
1.2
0
0
0
A quick hack that has occurred to me is to use urllib.urlopen() with threading.Timer() to emulate timeout. But that's only quick and dirty hack.
0
1,600
1
1
2010-10-08T08:20:00.000
python,urllib2,urllib,buffering,urlopen
unbuffered urllib2.urlopen
1
1
2
3,888,827
0
0
0
Is it possible to stream my webcam form my local machine that's connected to the internet to show up on my website without using any media server or something similar?
false
3,890,271
0.099668
0
0
1
You could do it with some kind of java applet or flash/silverlight application, just look at sites like "chat roulette"
0
807
0
0
2010-10-08T12:03:00.000
python,webcam
How to stream my webcam through my site?
1
1
2
3,890,377
0
1
0
OK so im using websockets to let javascript talk to python and that works very well BUT the data i need to send often has several parts like an array, (username,time,text) but how could i send it ? I originally though to encode each one in base64 or urlencode then use a character like | which those encoding methods wil...
false
3,890,390
1
0
0
7
JSON is definitely the way to go. It has a very small overhead and is capable of storing almost any kind of data. I am not a python expert, but i am sure that there is some kind of en/decoder available.
1
1,908
0
1
2010-10-08T12:22:00.000
javascript,python,sockets,encoding
Python to javascript communication
1
1
2
3,890,407
0
0
0
I need to expose an RS232 connection to clients via a network socket. I plan to write in python a TCP socket server which will listen on some port, allow client to connect and handle outgoing and manage and control requests and replies to from the R2232 port. My question is, how do I synchronize the clients, each clie...
false
3,900,403
0.099668
0
0
1
The simplest way is to simply accept a connection, handle the request, and close the connection. This way, your program handles only one request at a time. An alternative is to use locking or semaphores, to prevent multiple clients accessing the RS232 port simultaneously.
0
1,048
0
1
2010-10-10T13:03:00.000
python,sockets,serial-port
Writing a TCP to RS232 driver
1
1
2
3,900,446
0
0
0
maybe this is a noob question, but I'm receiving some data over TCP and when I look at the string I get the following: \x00\r\xeb\x00\x00\x00\x00\x01t\x00 What is that \r character, and what does the t in \x01t mean? I've tried Googling, but I'm not sure what to Google for... thanks.
false
3,906,903
1
0
0
9
\r is a carriage return (0x0d), the t is a t.
1
819
0
0
2010-10-11T14:00:00.000
python,networking,character,bits
Non-binary(hex) characters in string received over TCP with Python
1
1
3
3,906,938
0
0
0
Let's say there is a server on the internet that one can send a piece of code to for evaluation. At some point server takes all code that has been submitted, and starts running and evaluating it. However, at some point it will definitely bump into "os.system('rm -rf *')" sent by some evil programmer. Apart from "rm -rf...
false
3,910,223
0.057081
0
0
2
It's impossible to provide an absolute solution for this because the definition of 'bad' is pretty hard to nail down. Is opening and writing to a file bad or good? What if that file is /dev/ram? You can profile signatures of behavior, or you can try to block anything that might be bad, but you'll never win. Javascript ...
0
5,900
0
8
2010-10-11T21:53:00.000
python,trusted-vs-untrusted
sandbox to execute possibly unfriendly python code
1
4
7
3,910,435
0
0
0
Let's say there is a server on the internet that one can send a piece of code to for evaluation. At some point server takes all code that has been submitted, and starts running and evaluating it. However, at some point it will definitely bump into "os.system('rm -rf *')" sent by some evil programmer. Apart from "rm -rf...
false
3,910,223
0
0
0
0
I think a fix like this is going to be really hard and it reminds me of a lecture I attended about the benefits of programming in a virtual environment. If you're doing it virtually its cool if they bugger it. It wont solve a while True: pass but rm -rf / won't matter.
0
5,900
0
8
2010-10-11T21:53:00.000
python,trusted-vs-untrusted
sandbox to execute possibly unfriendly python code
1
4
7
3,910,850
0
0
0
Let's say there is a server on the internet that one can send a piece of code to for evaluation. At some point server takes all code that has been submitted, and starts running and evaluating it. However, at some point it will definitely bump into "os.system('rm -rf *')" sent by some evil programmer. Apart from "rm -rf...
false
3,910,223
0.057081
0
0
2
I would seriously consider virtualizing the environment to run this stuff, so that exploits in whatever mechanism you implement can be firewalled one more time by the configuration of the virtual machine. Number of users and what kind of code you expect to test/run would have considerable influence on choices btw. If t...
0
5,900
0
8
2010-10-11T21:53:00.000
python,trusted-vs-untrusted
sandbox to execute possibly unfriendly python code
1
4
7
3,910,730
0
0
0
Let's say there is a server on the internet that one can send a piece of code to for evaluation. At some point server takes all code that has been submitted, and starts running and evaluating it. However, at some point it will definitely bump into "os.system('rm -rf *')" sent by some evil programmer. Apart from "rm -rf...
false
3,910,223
0
0
0
0
Unless I'm mistaken (and I very well might be), this is much of the reason behind the way Google changed Python for the App Engine. You run Python code on their server, but they've removed the ability to write to files. All data is saved in the "nosql" database. It's not a direct answer to your question, but an exa...
0
5,900
0
8
2010-10-11T21:53:00.000
python,trusted-vs-untrusted
sandbox to execute possibly unfriendly python code
1
4
7
3,910,895
0
0
0
I'm using urllib.urlopen to read a file from a URL. What is the best way to get the filename? Do servers always return the Content-Disposition header? Thanks.
true
3,912,910
1.2
0
0
1
It's an optional header, so no. See if it exists, and if not then fall back to checking the URL.
0
575
0
1
2010-10-12T08:49:00.000
python,urllib,urlopen
Get filename when using urllib.urlopen
1
1
1
3,912,922
0
0
0
Is there any way in python for S60 (using the python 2.5.4 codebase) to track the amount of data transferred over the mobile device's internet connection?
true
3,928,685
1.2
0
0
2
Symbian C++ API has such a capability, so it is possible to write a python library for that, but if such already exists, that I do not know... BR STeN
0
83
0
0
2010-10-13T22:48:00.000
python,symbian,pys60
Measuring internet data transfers
1
1
1
4,002,429
0
1
0
Disclaimer here: I'm really not a programmer. I'm eager to learn, but my experience is pretty much basic on c64 20 years ago and a couple of days of learning Python. I'm just starting out on a fairly large (for me as a beginner) screen scraping project. So far I have been using python with mechanize+lxml for my browsin...
false
3,929,005
0
0
0
0
For nonprogrammers, I recomment using IRobotSoft. It is visual oriented and with full javascript support. The shortcoming is that it runs only on Windows. The good thing is you can become an expert just by trial and error to learn the software.
0
795
0
2
2010-10-13T23:58:00.000
python,screen-scraping
Options for handling javascript heavy pages while screen scraping
1
1
4
3,992,151
0
1
0
I am trying to make an app for authenticating user with their facebook account in python. App opens the facebook login page in web browser. After user logs in, facebook redirects it to thei dummy success page. At that moment i need to capture that redirect url in my app. I am not able to catch that URL. I am opening f...
false
3,930,129
0
0
0
0
There's a getLoginUrl in the facebook SDK. You might want to look at that. -Roozbeh
0
755
0
2
2010-10-14T04:38:00.000
python,facebook
Catching the Access Token sent by Facebook after successful authentication
1
1
2
4,663,777
0
1
0
Do you think is technically possible to take a screeshot of a website programmatically? I would like to craft a scheduled Python task that crawls a list of websites taking an homepage screenshot of them. Do you think is technically feasible or do you know third party website that offer a service like that (Input: url -...
false
3,940,098
0
0
0
0
It's certainly technically possible. You would probably have to render the HTML directly onto an image file (or more likely, onto an in-memory bitmap that's written to an image file once completed). I don't know any libraries to do this for you (apart from a modified WebKit, perhaps)... but there's certainly websites t...
0
2,523
0
6
2010-10-15T06:53:00.000
python,google-app-engine,screenshot
Is it technically possible to take a screenshot of a website programmatically?
1
1
5
3,940,121
0
0
0
I'm unfamiliar with the new oauth system. I wanted to crawl the status updates of my friends, and their friends' (if permissions allow) with my specified account credentials using the python-twitter api. With the new oauth authentication, does it means that I have to first register an application with twitter before I...
true
3,940,774
1.2
1
0
1
Yes, thats right. You need to register it and connect "grant access" it with your twitter id, if you want, for example, post something on your twitter wall. Also see "connections" in your twitter id.
0
206
0
1
2010-10-15T08:53:00.000
python,oauth,twitter
noob question regarding twitter oauth
1
2
2
3,940,860
0
0
0
I'm unfamiliar with the new oauth system. I wanted to crawl the status updates of my friends, and their friends' (if permissions allow) with my specified account credentials using the python-twitter api. With the new oauth authentication, does it means that I have to first register an application with twitter before I...
false
3,940,774
0
1
0
0
For use api you must register your aplication or use GET methods to post into twi through web interface.
0
206
0
1
2010-10-15T08:53:00.000
python,oauth,twitter
noob question regarding twitter oauth
1
2
2
3,940,840
0
1
0
I can traverse generic tags easily with BS, but I don't know how to find specific tags. For example, how can I find all occurances of <div style="width=300px;">? Is this possible with BS?
false
3,945,750
1
0
0
9
with bs4 things have changed a little. so the code should look like this soup = BeautifulSoup(htmlstring,'lxml') soup.find_all('div', {'style':"width=300px;"})
0
62,029
0
29
2010-10-15T20:11:00.000
python,beautifulsoup
Find a specific tag with BeautifulSoup
1
1
2
45,193,575
0
1
0
I always found links in html source stored in such format, the question is how do I change such links back to what it's normally like? Thanks a lot!
false
3,949,739
0
0
0
0
urllib.unquote() on its own may still cause problems by throwing the exception: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position n: ordinal not in range(128) In that case try: print urllib.unquote("Ober%C3%B6sterreich.txt").decode("utf8")
0
797
0
0
2010-10-16T16:33:00.000
python,html
How to turn an encoded link such as "http%3A%2F%2Fexample.com%2Fwhatever" into "http://example.com/whatever" in python?
1
1
2
5,693,726
0