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
8,087,753
2011-11-10T23:15:00.000
1
0
1
0
python
8,087,935
3
false
0
0
This size of the float is baked in at compilation time. You can pass in a compile option to treat a C double as a float in a fresh python executable file.
1
1
0
Is there anyway I can ask python to explicitly treat all floats as 32bits even on a 64bit machine? I don't want to change the codes...
Is there anyway I can ask python to explicitly treat all floats as 32bits even on a 64bit machine?
0.066568
0
0
206
8,088,742
2011-11-11T01:44:00.000
1
1
0
0
python,security,ssh,telnet
8,088,775
3
false
0
0
While Telnet is insecure, it's essentially just a serial console over a network, which makes it easy to code for. SSH is much, much more complex. There's encryption, authentication, negotiation, etc to do. And it's very easy to get wrong in spectacular fashion. There's nothing wrong with Telnet per se, but if you can c...
1
0
0
I write a python telnet client to communicate with a server through telnet. However, many people tell me that it's no secure. How can I convert it to ssh? Should I need to totally rewrite my program?
python: convert telnet application to ssh
0.066568
0
1
1,247
8,090,084
2011-11-11T05:34:00.000
3
0
1
1
python,shell
8,090,108
5
false
0
0
All calls to subprocess.Popen return immediately to the caller. It's the calls to wait and communicate which block. So all you need to do is spin up a number of processes using subprocess.Popen (set stdin to /dev/null for safety), and then one by one call communicate until they're all complete. Naturally I'm assuming y...
1
3
0
Most of the examples I've seen with os.fork and the subprocess/multiprocessing modules show how to fork a new instance of the calling python script or a chunk of python code. What would be the best way to spawn a set of arbitrary shell command concurrently? I suppose, I could just use subprocess.call or one of the Pop...
Best way to fork multiple shell commands/processes in Python?
0.119427
0
0
4,562
8,091,248
2011-11-11T08:08:00.000
0
0
0
0
python,algorithm,matrix
8,091,830
7
false
0
0
I don't think you can avoid iteration, but you can at least do an XOR of all elements and if the result of that is 0 => they are all equal, then you don't need to do any comparisons.
3
6
1
is there a good algorithm for checking whether there are 5 same elements in a row or a column or diagonally given a square matrix, say 6x6? there is ofcourse the naive algorithm of iterating through every spot and then for each point in the matrix, iterate through that row, col and then the diagonal. I am wondering if ...
better algorithm for checking 5 in a row/col in a matrix
0
0
0
3,808
8,091,248
2011-11-11T08:08:00.000
0
0
0
0
python,algorithm,matrix
8,098,697
7
false
0
0
You can try improve your method with some heuristics: use the knowledge of the matrix size to exclude element sequences that do not fit and suspend unnecessary calculation. In case the given vector size is 6, you want to find 5 equal elements, and the first 3 elements are different, further calculation do not have any ...
3
6
1
is there a good algorithm for checking whether there are 5 same elements in a row or a column or diagonally given a square matrix, say 6x6? there is ofcourse the naive algorithm of iterating through every spot and then for each point in the matrix, iterate through that row, col and then the diagonal. I am wondering if ...
better algorithm for checking 5 in a row/col in a matrix
0
0
0
3,808
8,091,248
2011-11-11T08:08:00.000
0
0
0
0
python,algorithm,matrix
8,091,403
7
false
0
0
Your best approach may depend on whether you control the placement of elements. For example, if you were building a game and just placed the most recent element on the grid, you could capture into four strings the vertical, horizontal, and diagonal strips that intersected that point, and use the same algorithm on each ...
3
6
1
is there a good algorithm for checking whether there are 5 same elements in a row or a column or diagonally given a square matrix, say 6x6? there is ofcourse the naive algorithm of iterating through every spot and then for each point in the matrix, iterate through that row, col and then the diagonal. I am wondering if ...
better algorithm for checking 5 in a row/col in a matrix
0
0
0
3,808
8,092,254
2011-11-11T09:52:00.000
0
0
0
0
python,django,django-models,django-admin
8,092,344
2
true
1
0
Turns out, one can put the methods in the UserAdmin itself instead than in the User model. This way I can access all the information I need about the user.
1
0
0
I have a Django application where users have additional data. That data is collected in a Profile model with a OneToOneField pointing to User. This is fine and works perfectly for most purposes, but I have trouble customizing the admin for User. In particular: I would like to be able to show a Profile field inside lis...
Customizing the Django User admin
1.2
0
0
521
8,093,297
2011-11-11T11:26:00.000
0
1
0
0
jquery,events,python-idle
8,093,470
4
false
1
0
Ideally the answer would be $(function(){ }) or window.onload = function(){} that fires after all the DOM contents are loaded. But I guess, the ads on your page starts loading asynchronously after the DOM load. So, assuming you know the number of 'ads' on your page (you said you are loading them piece by piece), my ad...
1
3
0
I have a page with a lot of ads being loaded in piece by piece. I need to position an element relative to overall page height, which is changing during load, because of ads being added. Question: Is there a jquery event or similar to detect, when all elements are loaded? I'm currently "waiting" with setTimeout, but thi...
jquery - can I detect once all content is loaded?
0
0
1
6,659
8,095,062
2011-11-11T14:04:00.000
1
0
0
0
python,qt,pyqt
8,095,328
2
false
0
1
Add some widgets to the central widget first. Then select the central widget and use the "Layout in a Grid", "Layout Vertically", etc buttons on the toolbar to add a main layout. The layouts in the "Widget Box" side-bar are used for adding child layouts to a main layout.
2
1
0
I started new clear Main Window project, There are 4 Objects: MainWindow, centralWidget, menubar, and statusbar. I need to set default layout inside the window, so probably for centralWidget. But I didnt found way how to do it. I can get LayoutWidget with some particular size into centralWidget. But I want to set layou...
pyqt designer and layout for central widget
0.099668
0
0
2,793
8,095,062
2011-11-11T14:04:00.000
3
0
0
0
python,qt,pyqt
8,095,337
2
true
0
1
Right click anywhere within your centralWidget go to the Lay Out sub menu and select the Layout you want. This will be applied automatically to all contents of your centralWidget. In order to see how it works place inside it 2 or 3 push buttons and try changing the layouts.
2
1
0
I started new clear Main Window project, There are 4 Objects: MainWindow, centralWidget, menubar, and statusbar. I need to set default layout inside the window, so probably for centralWidget. But I didnt found way how to do it. I can get LayoutWidget with some particular size into centralWidget. But I want to set layou...
pyqt designer and layout for central widget
1.2
0
0
2,793
8,096,668
2011-11-11T16:02:00.000
2
0
0
0
python,performance,hdf5,h5py
8,288,377
1
true
0
0
High-level interfaces are generally going with a performance loss of some sort. After that, whether it is noticeable (worth being investigated) will depend on what you are doing exactly with your code. Just start with the high-level interface. If the code is overall too slow, start profiling and move the bottlenecks do...
1
7
1
I've been working with HDF5 files with C and Matlab, both using the same way for reading from and writing to datasets: open file with h5f open dataset with h5d select space with h5s and so on... But now I'm working with Python, and with its h5py library I see that it has two ways to manage HDF5: high-level and low-le...
HDF5 for Python: high level vs low level interfaces. h5py
1.2
0
0
932
8,097,644
2011-11-11T17:23:00.000
0
0
0
0
python,django
8,097,716
3
false
1
0
Honestly, this isn't a Django-specific issue. The problem is whether you are doing a normal form submission or using AJAX. The basic idea is to POST to your form submission endpoint using AJAX and the form data, and in the Django view, merely update your models and return either an empty 200 response or some data (in X...
1
1
0
I'm submitting a form and instead of redirecting to a success url I would like to just show "Form has been submitted" in text on the page when the form has been submitted. Does anyone know how I can do so?
How do I confirm a form has been submitted with django?
0
0
0
3,238
8,098,068
2011-11-11T18:02:00.000
2
0
0
0
python,networking
8,098,102
4
false
1
0
I would suggest taking a look at setting up a simple site in google app engine. It's free and you can use python to do the site. Than it would just be a matter of creating a simple restful service that you could send a POST to with your pickled data and store it in a database. Than just create a simple web front end on...
4
1
0
I have a program that I wrote in python that collects data. I want to be able to store the data on the internet somewhere and allow for another user to access it from another computer somewhere else, anywhere in the world that has an internet connection. My original idea was to use an e-mail client, such as g-mail, to ...
Sending data through the web to a remote program using python
0.099668
0
1
403
8,098,068
2011-11-11T18:02:00.000
0
0
0
0
python,networking
8,098,342
4
false
1
0
Adding this as an answer so that OP will be more likely to see it... Make sure you consider security! If you just blindly accept pickled data, it can open you up to arbitrary code execution.
4
1
0
I have a program that I wrote in python that collects data. I want to be able to store the data on the internet somewhere and allow for another user to access it from another computer somewhere else, anywhere in the world that has an internet connection. My original idea was to use an e-mail client, such as g-mail, to ...
Sending data through the web to a remote program using python
0
0
1
403
8,098,068
2011-11-11T18:02:00.000
0
0
0
0
python,networking
8,099,975
4
false
1
0
I suggest you to use a good middle-ware like: Zero-C ICE, Pyro4, Twisted. Pyro4 using pickle to serialize data.
4
1
0
I have a program that I wrote in python that collects data. I want to be able to store the data on the internet somewhere and allow for another user to access it from another computer somewhere else, anywhere in the world that has an internet connection. My original idea was to use an e-mail client, such as g-mail, to ...
Sending data through the web to a remote program using python
0
0
1
403
8,098,068
2011-11-11T18:02:00.000
1
0
0
0
python,networking
8,098,220
4
false
1
0
Another option in addition to what Casey already provided: Set up a remote MySQL database somewhere that has user access levels allowing remote connections. Your Python program could then simply access the database and INSERT the data you're trying to store centrally (e.g. through MySQLDb package or pyodbc package). ...
4
1
0
I have a program that I wrote in python that collects data. I want to be able to store the data on the internet somewhere and allow for another user to access it from another computer somewhere else, anywhere in the world that has an internet connection. My original idea was to use an e-mail client, such as g-mail, to ...
Sending data through the web to a remote program using python
0.049958
0
1
403
8,099,380
2011-11-11T20:11:00.000
20
0
1
0
python,eclipse,syntax-error,pydev
8,101,987
3
true
0
0
Remove and re-add the python interpreter in the PyDev configuration. Make sure that the project is using the newly added interpreter.
1
15
0
Why is Pydev giving me syntax errors for built-in python functions like str()? Undefined variable: str Undefined variable: False Undefined variable: float
Why is Pydev giving a syntax error for built-in keywords?
1.2
0
0
13,935
8,099,699
2011-11-11T20:41:00.000
4
0
0
0
python,django,rest
8,130,058
1
true
1
0
django-celery is a popular choice for async tasks, i usually use greenlets as im used to them. Then to notify the user you can use the notification framework to tell the client that something is done.
1
4
0
I need to create a django web portal in which users can select and run ad-hoc reports by providing values, via forms, to parameters defined in each specific report. The view that processes the user’s report execution requests needs to make RESTFul service calls to a remote Jasper Reports Server where the actual output...
Django - Consuming a RESTful service asynchronously
1.2
0
0
890
8,101,353
2011-11-12T00:00:00.000
3
0
1
0
python,math,chemistry,significant-digits
8,101,851
5
true
0
0
No. Significant digits are just not that big a deal and get little support in computer languages. People doing real computations need error bars, which have far more precision — real measurements say very exact things like “this is 0.11 ± 0.03mm“ instead of saying either of the less exact statements “this is 0.1 mm” or...
2
6
0
Is there a way in Python to count the significant figures in a double/float/etc? I'm not seeing an easy way to do this, but I'd expect it to be in the library. Thanks in advance.
Counting significant figures in Python?
1.2
0
0
9,872
8,101,353
2011-11-12T00:00:00.000
1
0
1
0
python,math,chemistry,significant-digits
8,104,261
5
false
0
0
Computers simply don't work that way, at least, not unless they are programmed to do so. The assumption is the number you give them is exact. If you create the number 2/3 as 0.6666666666666667, then all operations treat it as exactly that. That error in the least significant digit may end up propagating to larger error...
2
6
0
Is there a way in Python to count the significant figures in a double/float/etc? I'm not seeing an easy way to do this, but I'd expect it to be in the library. Thanks in advance.
Counting significant figures in Python?
0.039979
0
0
9,872
8,102,987
2011-11-12T06:34:00.000
3
0
1
0
python
8,103,001
4
false
0
0
Python 3 is significantly different than Python 2.x, and breaks numerous libraries and likely a lot of other dependent code. Python 2.x will likely be around for quite a while, as libraries are ported and 3.0 is field-tested.
3
14
0
I used Python a few years ago when 2 was the only version. Now there is 2 and 3. Was there a a reason 2 hasn't continued to upgrade and now there is a split into two different pythons? Like no one uses Python 2.5. They all use 2.7 or whatever it is. Why not just use 3? Obviously there's a reason, but I was unable to fi...
If Python 3 is the newest python, why is python 2 still around?
0.148885
0
0
3,730
8,102,987
2011-11-12T06:34:00.000
1
0
1
0
python
8,103,175
4
false
0
0
The latest Ubuntu doesn't ship with Python 3. 12.04 will but that's not out yet. OpenBSD doesn't have a package for Python 3, either. Some people may just not have Python 3 on their platform and don't care to compile.
3
14
0
I used Python a few years ago when 2 was the only version. Now there is 2 and 3. Was there a a reason 2 hasn't continued to upgrade and now there is a split into two different pythons? Like no one uses Python 2.5. They all use 2.7 or whatever it is. Why not just use 3? Obviously there's a reason, but I was unable to fi...
If Python 3 is the newest python, why is python 2 still around?
0.049958
0
0
3,730
8,102,987
2011-11-12T06:34:00.000
1
0
1
0
python
8,103,009
4
false
0
0
it costs a lot to upgrade from python 2.x to python 3, that's why my project still uses python 2.7
3
14
0
I used Python a few years ago when 2 was the only version. Now there is 2 and 3. Was there a a reason 2 hasn't continued to upgrade and now there is a split into two different pythons? Like no one uses Python 2.5. They all use 2.7 or whatever it is. Why not just use 3? Obviously there's a reason, but I was unable to fi...
If Python 3 is the newest python, why is python 2 still around?
0.049958
0
0
3,730
8,104,811
2011-11-12T13:45:00.000
2
0
0
1
python,permissions,executable,chmod
8,104,835
3
true
0
0
The permissions you can set on a file with chmod affect who can read from/write to/execute that file, not what privileges the process created by running that file has. On Unix you could get some form of protection by playing with the file owner and the sticky bit, and having appropriate permissions on your filesystem, ...
2
0
0
I have to change file permissions on an executable file, using os.chmod. I have this executable and I want to change its permissions so that it can write nowhere, only reading and executing. How can I do that? Thanks, rubik
chmod - file permission on executable
1.2
0
0
1,884
8,104,811
2011-11-12T13:45:00.000
1
0
0
1
python,permissions,executable,chmod
8,104,833
3
false
0
0
I have this executable and I want to change its permissions so that it can write nowhere, only reading and executing That's not how chmod works - it sets permissions on the file itself, it can't restrict what an executable can write to.
2
0
0
I have to change file permissions on an executable file, using os.chmod. I have this executable and I want to change its permissions so that it can write nowhere, only reading and executing. How can I do that? Thanks, rubik
chmod - file permission on executable
0.066568
0
0
1,884
8,107,261
2011-11-12T20:16:00.000
53
0
0
1
ipython
8,175,931
2
true
0
0
I think this is exactly what %cpaste is for (I am always forgetting about all the things IPython does). %cpaste enters a state allowing you to paste already formatted or indented code, and it will strip leading indentation and prompts, so you can copy/paste indented code from files, or even from an interactive Python ...
1
33
0
In ipython >=0.11, the %paste command is required to paste indented commands. However, if I run an ipython shell in a remote terminal, the buffer %paste refers to is on the remote machine rather than the local machine. Is there any way around this?
ipython: %paste over ssh connection
1.2
0
0
5,474
8,107,745
2011-11-12T21:39:00.000
0
0
1
0
python,xorg,clutter
8,111,322
2
false
0
0
yes, you need to retrieve the Stage XID and set the hints manually. alternatively, you could use Clutter-Gtk, and the Gdk API, instead of using Xlib directly.
1
0
0
Is there any way to make a standalone ClutterStage use TYPE_HINT_DOCK (and be borderless), with python? Perhaps by manipulating the window with Xlib?
How can I set window type hints on a ClutterStage?
0
0
0
281
8,107,748
2011-11-12T21:39:00.000
0
0
0
0
python,email,heroku,port
8,110,748
3
false
1
0
Custom mail server? Nope. Heroku's mail services? Yes, check out the "Add-On" link for cloudmailin, mailgun and sendgrid. Basic service is free (they still want your credit-card and hope you exceed free quota).
2
7
0
Web services on Heroku normally use the PORT environment variable, but I want to run a custom mail server on Heroku. So I need to expose 2 ports, preferably 110 and 25, but I can live with alternatives. Is it possible?
Can a Heroku app use different/multiple ports?
0
0
0
8,631
8,107,748
2011-11-12T21:39:00.000
3
0
0
0
python,email,heroku,port
8,107,804
3
false
1
0
No, just running some quick tests against the heroku proxy (proxy.heroku.com) I can only make connections to ports 80 and 443. Being as heroku don't provide any POP/SMTP it doesn't make sense for them to have those ports open I'm afraid.
2
7
0
Web services on Heroku normally use the PORT environment variable, but I want to run a custom mail server on Heroku. So I need to expose 2 ports, preferably 110 and 25, but I can live with alternatives. Is it possible?
Can a Heroku app use different/multiple ports?
0.197375
0
0
8,631
8,108,477
2011-11-12T23:54:00.000
0
0
0
0
python,session,cookies,scrapy
8,113,814
1
false
1
0
I think the site tracks your session. If it's a PHP site, pass PHPSESSID cookie to the request which downloads the PDF file.
1
0
0
I'm scraping pdf files from a site using Scrapy, a Python web-scraping framework. The site requires to follow the same session in order to allow you to download the pdf. It works great with Scrapy's because it's all automated but when I run the script after a couple of seconds it starts to give me fake pdf files like ...
Downloading PDF files with Scrapy
0
0
1
1,740
8,109,713
2011-11-13T05:01:00.000
0
0
1
0
python,search,text,find,lines
8,109,757
4
false
0
0
A non-Python Unix solution is fairly immediate: "search a text file for a keyword" is a grep "count how many lines" is a wc Do you have difficulty implementing the essence of either of these in Python?
1
3
0
I'm pretty sure I'm over thinking this and there's a simple outcome for it, but I just can't seem to put it all together. I'm looking for a kind of a search method. I'd like a Python script search a text file for a keyword and count how many lines it appears on. Though if the keyword comes up on a single line multiple ...
Python - Search for Word In Line, Count it, Add It
0
0
0
7,197
8,110,920
2011-11-13T10:22:00.000
1
0
1
0
python,multithreading,celery
8,111,398
2
false
0
0
Well the documentation of sys._current_frames explains something slightly Firstly This function should be used for internal and specialized purposes only. So its not really something you should be poking. And the key answer comes from threading.enumerate documentation The list includes daemonic threads, dummy thre...
1
4
0
I have a program which forks a number of subprocesses (it's using Celery Workers for that matter). I'm trying to dump the stack traces of all the running threads in each process. I'm using sys._current_frames() to get the stack traces and threading.enumerate() to get the thread names. For some reason, I noticed that, ...
Python threading: "sys._current_frames()" vs "threading.enumerate()"
0.099668
0
0
965
8,110,952
2011-11-13T10:31:00.000
0
1
1
0
python,django,debugging,static-analysis
8,152,166
3
false
1
0
Thank you for your answers, I'll check these tools. I wanted to share with you other ideas (none python/django specific): Assert conditions in code - but remove from production code. Run periodic checks on the data (eg. sending email to dev when found unexpected state) - in case a bug slips by it may be detected faste...
1
2
0
What tools or techniques can help avoid bugs, especially silly mistakes such as typos, coding in Python and Django? I know unit-testing every line of code is the "proper" way, but are there any shortcuts? I know of pylint, but unfortunately it doesn't check Django ORM named parameters, where a typo can go unnoticed. Is...
tools or techniques to help avoid mistakes in python/django
0
0
0
189
8,111,484
2011-11-13T12:23:00.000
1
0
1
0
python
8,111,504
4
false
0
0
x = a or b does the same thing.
1
12
0
I am Python newbie, so maybe don't knew if this is obvious or not. In Javascript a||b returns a if a is evaluated to true, else returns b. Is that possible in Python other than lengthy if else statement.
Python operator that mimic javascript || operator
0.049958
0
0
2,809
8,111,664
2011-11-13T12:56:00.000
2
1
0
0
python,windows-7,import,boost-python
8,115,457
3
true
0
0
The problem was with the KB2264107 Windows update (http://support.microsoft.com/kb/2264107), "messing" with DLL search routine (security fix). Setting the registry value [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager] : CWDIllegalInDllSearch to 0, allowed to properly load DLL files and properly im...
2
5
0
I've spent last 2 days trying to launch examples from Boost.Python with the "ImportError: DLL load failed: The specified module could not be found" error, while trying to load compiled (using bjam) pyd modules. I was using Windows 7 x64, Python 2.7 x64 with Boost 1.47. I've followed up different answers on StackOverflo...
Boost.Python examples, Windows 7 x64, "ImportError: DLL load failed: The specified module could not be found."
1.2
0
0
5,048
8,111,664
2011-11-13T12:56:00.000
6
1
0
0
python,windows-7,import,boost-python
35,737,001
3
false
0
0
Two solution, no need to use regedit add BOOST_PYTHON_STATIC_LIB marco when build your dll. It will let boost.python static link to your dll file rather than dynamic load in runtime. add boost.python dll to PATH or copy it to same dir where your dll locate
2
5
0
I've spent last 2 days trying to launch examples from Boost.Python with the "ImportError: DLL load failed: The specified module could not be found" error, while trying to load compiled (using bjam) pyd modules. I was using Windows 7 x64, Python 2.7 x64 with Boost 1.47. I've followed up different answers on StackOverflo...
Boost.Python examples, Windows 7 x64, "ImportError: DLL load failed: The specified module could not be found."
1
0
0
5,048
8,112,922
2011-11-13T16:26:00.000
3
0
0
0
python,html,beautifulsoup,innerhtml
63,989,449
7
false
1
0
str(element) helps you to get outerHTML, then remove outer tag from the outer html string.
2
64
0
Let's say I have a page with a div. I can easily get that div with soup.find(). Now that I have the result, I'd like to print the WHOLE innerhtml of that div: I mean, I'd need a string with ALL the html tags and text all toegether, exactly like the string I'd get in javascript with obj.innerHTML. Is this possible?
BeautifulSoup innerhtml?
0.085505
0
0
53,337
8,112,922
2011-11-13T16:26:00.000
1
0
0
0
python,html,beautifulsoup,innerhtml
35,100,639
7
false
1
0
How about just unicode(x)? Seems to work for me. Edit: This will give you the outer HTML and not the inner.
2
64
0
Let's say I have a page with a div. I can easily get that div with soup.find(). Now that I have the result, I'd like to print the WHOLE innerhtml of that div: I mean, I'd need a string with ALL the html tags and text all toegether, exactly like the string I'd get in javascript with obj.innerHTML. Is this possible?
BeautifulSoup innerhtml?
0.028564
0
0
53,337
8,113,895
2011-11-13T19:04:00.000
1
0
0
1
python,termination,linefeed
8,115,701
1
true
0
0
You mostly don't need to worry about it. If you come to a point when something doesn't work, come back and ask about that. Note however that what determines the line-ending convention is not which programming language you use, but the platform it runs on (*nix/Windows/Mac, all are different).
1
0
0
I'm note sure about conventions for different types of line termination in different programming languages. I know that there are 2 types, 1: line feed, 2: carriage-return, line feed. My question is: how does readline in different programming languages, like python: a = fd.readline();, c/c++: file.getline (buffer,100);...
different types of line terminations(unix, windows, etc)
1.2
0
0
136
8,114,067
2011-11-13T19:31:00.000
0
0
1
1
c#,python,scripting,msbuild,mono
8,114,513
1
false
0
0
Far easier would be to write a small shell script for Linux or OSX that ran xbuild but was called msbuild. The arguments are the same I think.
1
0
0
I have a simple .Net console app which has only framework dependencies. It can compile fine with either MSBuild on windows or Mono/XBuild on linux. It is part of a larger project, which has a python build script. Is there any simple way to determine the most suitable build engine (msbuild/xbuild) and use that? In other...
Cross platform build script that can call MSBuild or Xbuild depending on environment?
0
0
0
391
8,114,839
2011-11-13T21:23:00.000
1
0
1
0
python,exe,scrapy
8,114,876
1
false
0
0
Yes, use py2exe Ask questions about any specific problems you have.
1
0
0
I have a Scrapy script, and it's working fine. To distribute it to my friends, I need it to be executable because they don't know much about Scrapy. Would someone tell me how to turn a Scrapy script into an exe file? Is py2exe applicable in this regard?
How to make an exe file out of Python Scrapy script?
0.197375
0
0
1,257
8,116,901
2011-11-14T03:12:00.000
0
0
1
0
python,security,embed
8,116,988
1
true
0
1
So, as I understand it the actual program will not exist in the executable, either in python source form, nor in 'marshalled' form (basically .pyc image) or compiled form, though I guess it will exist in some encrypted or obfuscated form which is converted into python source at run time. This definitely makes it harder...
1
1
0
I am developing a software based on embedded Python and C++. I want to secure some of my python code and prevent people from copying it. For now I am using PyRun_SimpleString to execute the python code and the string is generated using my C++ code. If I use this method, will it secure the Python code from being copie...
Can python source code executed using PyRun_SimpleString be extracted?
1.2
0
0
409
8,117,515
2011-11-14T04:58:00.000
2
0
1
0
python,cloud,mapreduce
8,205,419
2
false
0
0
Actually these concepts are somewhat different and common names are misleading. In functional programming (where Python borrowed these functions): map applies some function to all elements of a list and returns a new list reduce applies some function to aggregate all values in some list to get a single value. In dist...
1
6
0
I'm new to Python, Do someone know what's relationships between Python (and functional languages') functions map() / reduce() and MapReduce concept related to distributed computations?
Relationship between python map reduce and cloud-computing map/reduce?
0.197375
0
0
584
8,117,522
2011-11-14T04:59:00.000
4
0
1
0
python,shell,ipython
8,120,031
1
true
0
0
In short: no. bpython's rewind works, behind the scenes, by rerunning everything you've entered minus the last bit. It's a neat feature, but it's not all that important when you can just delete or replace any variable at any time. If you do want to rerun all but the last line, you can use %reset, then %rerun 1-17 (if y...
1
3
0
A feature in bpython called rewind. Is there some similar key bindings?
Can I redo/undo in ipython shell?
1.2
0
0
3,658
8,119,360
2011-11-14T09:14:00.000
0
0
0
0
python,django,localization
8,130,667
2
false
1
0
You can use the builtin template parser to parse your templates, and recurse into all tags that are not instances of BlockTransTag
1
4
0
Is there way to find untranslated strings in the HTML templates of my Django application i.e. blocks of text that are not wrapped in trans and blocktrans tags. Since we have many templates, it would be a very time-consuming process to go through them manually and check but if there isn't an option, I guess it has to be...
Find untranslated strings in HTML templates
0
0
0
865
8,119,799
2011-11-14T09:52:00.000
0
0
0
0
c++,python
8,120,273
3
false
0
1
This approach requires a bit a bit of work, and might not be feasible if you have a lot of functions, that you want to wrap/the functions use a lot of c++ intrinsic types as arguments/return values. If that is not the case, you can define some c-wrapper functions, with the "extern c" keyword in front of them, with pur...
1
3
0
I have a library and some head files, no c++ source code, I want to use it with python. I tried py++, but gccxml report error. I tried swig, but some many "undefined symbol" errors. Are there some smart tools can do such things automatically?
How to wrap a c++ library for python?
0
0
0
2,475
8,119,900
2011-11-14T10:01:00.000
1
1
0
0
python,coding-style
8,121,141
2
true
0
0
UML generation is provided by pyreverse - it's part of pylint package It generates UML in dot format - or png, etc. It creates UML diagram, so you can easily see basic structure of your code I'm not sure if it satisfy all your needs, but it might be helpful
1
5
1
I would have a quite simple question, but can't find any suitable automated solution for now. I have developed an algorithm that performs a lot of stuff (image processing in fact) in Python. What I want to do now is to optimize it. And for that, I would love to create a graph of my algorithm. Kind of an UML chart or ...
Get the complete structure of a program?
1.2
0
0
435
8,122,078
2011-11-14T13:09:00.000
4
0
0
0
python,reflection,sqlalchemy,pyramid
8,125,931
4
false
1
0
This doesn't seem to have much to do with "database reflection", but rather dynamic table creation. This is a pretty dangerous operation and generally frowned upon. You should try to think about how to model the possible structure your users would want to add to the Base and design your schema around that. Sometimes th...
1
3
0
I am currently working on a pyramid system that uses sqlalchemy. This system will include a model (let's call it Base) that is stored in a database table. This model should be extensible by the user on runtime. Basically, the user should be able to subclass the Base and create a new model (let's call this one 'Child')....
Model Creation by SQLAlchemy database reflection
0.197375
1
0
1,319
8,125,968
2011-11-14T18:01:00.000
1
0
0
0
wxpython,wxwidgets
10,554,783
1
false
0
1
On Linux I got what seemed like an identical error. I removed the error in this manner: I used the find command to get a list of wx-config programs From the list, I chose a wx-config that seemed right & used its full path for WX_CONFIG
1
1
0
I checked out wxPython and wxWidgets into two directories C:\dev\wx\wxPtyhon and C:\dev\wx\wxWidgets: mkdir /D c:\dev\wx\ cd c:\dev\wx git clone https://github.com/wxWidgets/wxPython.git git clone https://github.com/wxWidgets/wxWidgets.git I successfully build wxWidgets by running: cd wxwidgets\build\msw mingw32-...
How to build wxPython trunk with mingw on Windows?
0.197375
0
0
727
8,127,213
2011-11-14T19:51:00.000
0
0
0
0
java,c++,python,streaming
8,129,233
1
false
1
0
What kind of live video source that you mean? If you don't intend to do this code-wise, you can use the free VLC Player to act as a streaming service in between any kind of media stream source (file, network, capture device, disc) and your web video client. But, if you intend to do this code-wise, you can you VLCJ libr...
1
1
0
I want to read in a live video stream, like RTSP, run some basic processing on it, and display it on a website. What are some good ways to do this? I have used OpenCV for Python before but found it to be a hassle. I am also familiar with Java and C++ if there are better libraries available. I haven't done a lot of ...
Best ways to stream live video to a webpage using Python/C++/Java
0
0
0
677
8,128,736
2011-11-14T21:56:00.000
3
0
0
1
python,wsgi,tornado
8,129,321
1
true
1
0
Tornado shouldn't use WSGI, because WSGI is not async friendly. It has WSGI support, but it won't support async. Tornado has its own HTTP server (written in C and Python), and can be used standalone or placed behind another async HTTP server (usually Nginx).
1
1
0
am sorry for that question, am beginning in Tornado, and because i come from two other frameworks: Flask and Django, Flask uses Werkzeug which is a WSGI webserver, Django uses WSGI too, but, when making an application programmed with Tornado, how it will deal with HTTP? there is a protocol to deal with python files whe...
does Tornado uses WSGI to deal with python files?
1.2
0
0
444
8,129,088
2011-11-14T22:26:00.000
4
1
0
0
php,python,apache,mod-python,mod-php
8,129,667
2
false
0
0
This is relatively simple; When the webserver starts, it will register modules within its core. Language interpreter modules, like mod_php, will register a hook within the page request handler. This means when a user requests a page, the webserver will pass the request to the module, which checks if the requested file ...
1
1
0
Some of the Apache modules are related to programming languages, like mod_php and mod_python. The description is basically "enables usage of php within apache" or "enables usage of python within apache". I'm trying to understand an overview of how these types of "language" modules work.
How do mod_php, mod_python, mod_Language work
0.379949
0
0
645
8,131,279
2011-11-15T03:52:00.000
0
0
1
0
python,windows,module,web2py
8,131,500
3
false
0
0
What about add your local module path into sys.path variable? sys.path.apend('/path/to/your/module/directory') By the way, which module is not found by web2py
2
8
0
I am running web2py on a Windows machine. I'm working on an application, but it keeps erroring because it says the module I'm trying to use isn't installed. It is however installed in my local python install. How can I install modules so that web2py can recognize them?
Install Python Module in local install of web2py
0
0
0
5,995
8,131,279
2011-11-15T03:52:00.000
5
0
1
0
python,windows,module,web2py
8,136,638
3
false
0
0
If you are using the Windows binary version (i.e., web2py.exe), note that it includes its own Python interpreter, which means it will not use your installed version of Python and will therefore not see any of your installed modules. You can put Python modules in the /web2py/site-packages folder (which is created the fi...
2
8
0
I am running web2py on a Windows machine. I'm working on an application, but it keeps erroring because it says the module I'm trying to use isn't installed. It is however installed in my local python install. How can I install modules so that web2py can recognize them?
Install Python Module in local install of web2py
0.321513
0
0
5,995
8,136,921
2011-11-15T13:17:00.000
0
0
1
0
python
52,946,193
3
false
0
0
try radon, It calculate Cyclomatic Complexity, Maintainability Index and Raw metrics like LOC, SLOC and...
1
12
0
I want a tool which can compute source code metrics such as lines of code, number of packages, classes, functions, cyclomatic complexity number, depth of inheritance tree etc. for my Python Code. I have tried pylint, but it didn't offer much metrics. pynocle seemed interesting but I dont know how to use it. Can anyone ...
Software metric tool for Python
0
0
0
1,752
8,139,822
2011-11-15T16:39:00.000
21
0
1
0
python,neural-network,pybrain
8,143,012
2
true
0
0
Here is how I did it: ds = SupervisedDataSet(6,3) tf = open('mycsvfile.csv','r') for line in tf.readlines(): data = [float(x) for x in line.strip().split(',') if x != ''] indata = tuple(data[:6]) outdata = tuple(data[6:]) ds.addSample(indata,outdata) n = buildNetwork(ds.indim,8,8,ds.outdim,recurren...
1
8
0
I am trying to use PyBrain for some simple NN training. What I don't know how to do is to load the training data from a file. It is not explained in their website anywhere. I don't care about the format because I can build it now, but I need to do it in a file instead of adding row by row manually, because I will have ...
How to load training data in PyBrain?
1.2
0
0
9,903
8,139,892
2011-11-15T16:44:00.000
3
0
0
0
python,django,django-admin
8,140,229
3
true
1
0
Simply create a modelform with normal validation via the clean methods, then assign that form to be used in the admin by doing form = MyFormClass inside the ModelAdmin class.
1
4
0
I'd like to perform a check when saving a model via the django Admin panel. I thought about using ModelAdmin.save_model(), however, from the documentation it says: ModelAdmin.save_model() and ModelAdmin.delete_model() must save/delete the object, they are not for veto purposes, rather they allow you to perform extra o...
Performing a check when saving a model in Django's admin
1.2
0
0
2,403
8,140,469
2011-11-15T17:24:00.000
1
0
1
0
python
8,140,535
1
true
0
0
A method object is a wrapper for a function object that allows the function to be attached (bound) to an instance. The method object knows what instance it is bound to, and, when it is called, it calls the wrapped function, passing the instance as the first argument. In other words, the method object is responsible for...
1
0
0
Could somebody please elaborate this paragraph to me: If you still don’t understand how methods work, a look at the implementation can perhaps clarify matters. When an instance attribute is referenced that isn’t a data attribute, its class is searched. If the name denotes a valid class attribute that is a funct...
Elaborate Explanation for MethodObject and FunctionObject in Python Documentation
1.2
0
0
54
8,140,750
2011-11-15T17:45:00.000
2
0
0
1
python
8,142,466
2
true
0
0
(Reposting as an answer as requested): os.system() will work when run in a terminal - that's where stdout is going, and any processes you start will inherit that stdout unless you redirect it. If you need to redirect into IDLE, use @root45's answer above (upvoted). That will work for most programs, but at least on Unix...
1
3
0
I want to make a simple batch script using python using os.system. I am able to run the commands just fine, but the output for those commands dont print to the python shell. Is there some way to redirect the output to the python shell?
Python: How do I redirect output of os.system to python shell?
1.2
0
0
6,088
8,141,746
2011-11-15T19:09:00.000
0
0
0
0
android,python,android-emulator,sl4a
8,142,934
1
true
0
1
You can create your own sdcard image, put files on it and after that mount in emulator. To create image you can use mksdcard <size> <file>: mksdcard 1024M sdcard1.iso. After that you need to mount sdcard: mount -o loop sdcard1.iso /mnt/cdrom/. Next step: copy files, umount /mnt/cdrom/ and point to image in virtual mach...
1
0
0
I am trying to import a python library into SL4A. From my understanding, the easiest way to do this is to import the zipped files (egg files) of the python library into the SD Card and then import it into SL4A. Since I do not have an android device yet, I am working with the emulator. Whenever I try to push the zipped ...
ADB push command android emulator
1.2
0
0
1,245
8,143,228
2011-11-15T21:14:00.000
0
0
0
0
python,django
8,143,409
2
false
1
0
you could always keep the files, and have a cron job that deletes files whose session has expired
1
0
0
I have a form where I upload a file, and I generate a report out of it. The thing is, I would also like to make the report available for download, as an archive. I would like to somehow include the CSS and the JS ( that I inherit from my layout ) inside the report, but I don't really know how to go about this. So far, ...
How to use a report from a view inside another view in Django?
0
0
0
54
8,143,439
2011-11-15T21:34:00.000
0
0
0
0
python,matplotlib
8,147,354
3
false
0
0
For resolution, you can use the dpi (dots per inch) argument when creating a figure, or in the savefig() function. For high quality prints of graphics dpi=600 or more is recommended.
1
4
1
I'm fed up with manually creating graphs in excel and consequently, I'm trying to automate the process using Python to massage the .csv data into a workable form and matplotlib to plot the result. Using matplotlib and generating them is no problem but I can't work out is how to set the aspect ration / resolution of the...
How do get matplotlib pyplot to generate a chart for viewing / output to .png at a specific resolution?
0
0
0
1,578
8,144,910
2011-11-15T22:17:00.000
4
0
0
0
simulation,python,modeling
16,157,331
5
false
0
0
As @Matt said, I know this is old. But this came up as my first google hit, so I wanted to edit it. You can use scipy.signal.lti to model linear, time invariant systems. That gives you lti.bode. For an impulse response in the form of H(s) = (As^2 + Bs + C)/(Ds^2 + Es + F), you would enter h = scipy.signal.lti([A,B,C],[...
1
6
1
I would like to simulate/model a closed-loop, linear, time-invariant system (specifically a locked PLL approximation) with python. Each sub-block within the model has a known transfer function which is given in terms of complex frequency H(s) = K / ( s * tau + 1 ). Using the model, I would like to see how the system ...
Modeling a linear system with Python
0.158649
0
0
14,035
8,145,041
2011-11-16T00:18:00.000
2
0
1
0
python,multithreading
8,148,720
1
true
0
0
Continually creating and terminating threads is expensive, error-prone and best avoided if at all possible on both performance and reliablilty grounds. Micro-managing threads from the 'main program' is just, well, just a really bad idea when you can just, well, not do it. Modern languages/environments/libraries are pr...
1
3
0
I'm creating a socket server that will run forever and push files out to a remote service. The files will be big and many, so creating a threaded script that can help move things along. I have a few questions about how to approach this. In this setup I will be using the Queue provided by python because it implements th...
architecture questions about a multithreaded approach in python
1.2
0
0
243
8,148,821
2011-11-16T08:43:00.000
5
0
0
0
python,openerp
8,149,572
1
true
1
0
serch for main_sidebar in web/addons/openerp/controllers/templates/form.mako you can hide the toolbar using this css file: web/addons/openerp/static/css/screen.cs
1
2
0
How can we remove the panel that appears on right hand side of openERP's main page ,which shows ACTIONS ,LINKS,OTHER OPTIONS.From which file in openERP web server can we remove that. Thanks, Sameer
Removing the panel that appears on the right hand side of OpenERP main page
1.2
0
0
337
8,149,701
2011-11-16T09:57:00.000
2
0
0
1
python,linux,redirect,webserver,transmission
8,166,815
2
false
0
0
I found my answer: a reverse proxy. It will take care of the routing to the correct port based on the URL. I now just have to select the right one there are so many (NginX, pound, lighttd etc...) Thanks anyway.
1
1
0
Here is my setup: I have a Python webserver (written myself) that listens on port 80 and also have the Transmission-daemon (bittorrent client) that provides a webUI on port 9101. (running on Linux) I can access both webservers locally without problems, but now would like to access them externally also. My issue is that...
Redirecting traffic to other webserver
0.197375
0
1
388
8,151,033
2011-11-16T11:37:00.000
0
0
0
0
python,openerp
12,295,904
2
false
1
0
It's in the openerp-web module. The location depends on your particular configuration. The relevant code can be found in the file addons/web/static/src/xml/base.xml. Search for header_title and edit the contents of the h1 tag of that class.
1
0
0
How can we remove the database name and username that appears on top left hand side corner in openERP window after openERP logo.In which file do we need to make changes to remove that. Thanks, Sameer
Removing Database name and username from top Left hand side corner.
0
1
0
133
8,151,044
2011-11-16T11:38:00.000
2
0
0
0
python,django,google-app-engine
8,151,077
3
true
1
0
Where did you see anything recommending the use of google.appengine.ext.key_range.simplejson? That is only available because the key_range package happens to import simplejson. Don't use it like that.
2
2
0
I'm trying to figure out which simplejson module to use. Having looked back through my project I can see in some places I am using a mixture of both: django.utils.simplejson google.appengine.ext.key_range.simplejson Which should I be using and why?
Which simplejson module to use for Google AppEngine?
1.2
0
0
146
8,151,044
2011-11-16T11:38:00.000
0
0
0
0
python,django,google-app-engine
8,151,134
3
false
1
0
Functionality is probably the same for both, but I would use django.utils.simplejson, here is why: google.appengine.ext.key_range.simplejson is not mentioned by any GAE documents so it may get removed at some point. django.utils.simplejson has more probability to being updated along with django and it seems there is l...
2
2
0
I'm trying to figure out which simplejson module to use. Having looked back through my project I can see in some places I am using a mixture of both: django.utils.simplejson google.appengine.ext.key_range.simplejson Which should I be using and why?
Which simplejson module to use for Google AppEngine?
0
0
0
146
8,151,243
2011-11-16T11:54:00.000
0
0
0
0
python,excel,xls,xlsx,xlrd
21,996,139
2
false
0
0
xlrd-0.9.2.tar.gz (md5) can extract data from Excel spreadsheets (.xls and .xlsx, versions 2.0 on-wards) on any platform.
1
0
0
I want to convert xlsx file to xls format using python. The reason is that im using xlrd library to parse xls files, but xlrd is not able to parse xlsx files. Switching to a different library is not feasible for me at this stage, as the entire project is using xlrd, so a lot of changes will be required. So, is there an...
xlrd library not working with xlsx files.any way to covert xlsx to xls using python?
0
1
0
1,806
8,151,300
2011-11-16T11:59:00.000
1
0
0
1
python,linux
42,831,010
8
false
0
0
Depending on your case, you might use .lower() on both file pattern and results from folder listing and only then compare the pattern with the filename
1
48
0
I'm writing a script which will have to work on directories which are modified by hand by Windows and Linux users alike. The Windows users tend to not care at all about case in assigning filenames. Is there a way to handle this on the Linux side in Python, i.e. can I get a case-insensitive, glob-like behaviour?
Ignore case in glob() on Linux
0.024995
0
0
34,246
8,151,815
2011-11-16T12:36:00.000
1
0
0
0
python,apache,cx-oracle
8,158,089
1
false
1
0
Need a solution as well. I have the same setup on WinXP (Apache 2.2.21/ mod_wsgi 3.3/ python 2.7.2/ cx_Oracle 5.x.x). I found that cx_Oracle 5.1 also fails with the same error. Only 5.0.4 works. Here is the list of changes that were made from 5.0.4 to 5.1: Remove support for UNICODE mode and permit Unicode to be...
1
1
0
if I use cx_Oracle 5.0.4, I can connect from python console, and works under apache+django+mod_wsgi but when I update cx_Oracle 5.1.1, I can connect from python console, BUT same code doesn't work under apache+django+mod_wsgi File "C:\Python27\lib\site-packages\django\db\backends\oracle\base.py", line 24, in rais...
cx_Oracle 5.1.1 under apache+mod_wsgi
0.197375
1
0
1,227
8,152,504
2011-11-16T13:34:00.000
0
0
0
0
python,opencv
9,634,189
2
false
0
0
I don't really understand your concern. With the camera, you would get an image object. With this image object, you can calculate as much different histograms as you want. Each histogram would be a different output object :). Basicaly, you could track hundreds of colors at the same time!
1
0
1
I'm looking for a way to track two different colors at the same time using a single camera with OpenCV 2.3 (python bindings). I've read through a number of papers regarding OpenCV but can't find any mention as to whether or not it's capable of analyzing multiple histograms at once. Is this is even technically possibl...
Tracking two different colors using OpenCV 2.3 and Python
0
0
0
4,911
8,153,264
2011-11-16T14:29:00.000
2
1
0
0
java,android,python,performance,inheritance
8,153,347
1
true
1
0
It's the correct, and probably only, Java way. In Java all calls are virtual anyway unless you use final all over the place, but that means you couldn't even use interfaces. So most calls will probably be virtual dispatch whatever you do. Inheritance does not incur any other significant penalty. Besides, Android device...
1
1
0
I am building an extension of ORMLite to target Android. What I want to do I want to reproduce one of the behavior that Doctrine and Symfony are achieving in PHP with models. In a word: From a yml file generate a bunch of BaseModel class with accessors and things that won't change. Let the real model inherits from t...
Cost of Inheritance Java (Android)
1.2
0
0
992
8,153,525
2011-11-16T14:46:00.000
0
0
0
1
python,graph-algorithm
8,154,303
2
false
0
0
If you have created a topology of the screens, the A* algorithm should work fine.
1
0
0
I am using a terminal client to interact with a mainframe computer. The entire interface is based on the concept of screens. An example workflow might look like: Login Screen: enter login credentials, press enter Menu Screen: enter the number of the menu item you want (lets say "6" for memos), press enter Memo Scree...
Looking for algorithm to help determine shortest path from one terminal screen to another
0
0
0
137
8,156,455
2011-11-16T18:04:00.000
4
0
0
0
python-sphinx,restructuredtext
8,156,620
1
true
0
0
Figured it out myself. We should use the code-block directive with 'xml' as the value
1
5
0
What is the suggested way of adding xml in Sphinx/reST so that it gets properly displayed in the generated doc.
How to syntax highlight XML in reStructuredTest/Sphinx
1.2
0
0
2,564
8,156,736
2011-11-16T18:28:00.000
0
0
0
0
python,beautifulsoup
8,156,982
2
false
1
0
You should consider using hashes for comparing the previously collected list. Instead of storing a list of links as strings, store a list of MD5 or SHA1 hashes for those links. Comparing a hash to a list of hashes is much faster than comparing a string to a list of strings. Or if you maintain and persist an actual ...
1
0
0
So I am writing link fetchers to find new links on particular sites for a given group of 'starting links'. Currently I am using Python/Beautiful Soup to accomplish this with decent success. I have an input file [for each site] that I build the 'starting links' list from. I use urllib2 to load the webpages and then beau...
Python Link Fetcher Performance Issue
0
0
1
130
8,157,348
2011-11-16T19:16:00.000
8
0
0
1
c++,python,linux,networking,gcc
8,157,428
4
true
0
0
If you already have a TCP or UDP server, the easiest way will probably be to switch to UNIX domain sockets. They come in "stream" and "datagram" modes, just like TCP/UDP sockets, and they're always local, as they use the filesystem namespace (instead of port numbers like TCP/UDP).
2
2
0
I have a GNU C++ program and a python script that need to pass strings to each other quite frequently (~70-80 messages a minute). They will run local to each other in CentOS (hosted in the same environment). It feels that although TCP/IP can and will get the job done, what other options do I have? Keep in mind that I c...
Alternative to TCP/IP for local program-to-program data streaming?
1.2
0
0
856
8,157,348
2011-11-16T19:16:00.000
0
0
0
1
c++,python,linux,networking,gcc
8,157,381
4
false
0
0
Maybe you can use named pipes?
2
2
0
I have a GNU C++ program and a python script that need to pass strings to each other quite frequently (~70-80 messages a minute). They will run local to each other in CentOS (hosted in the same environment). It feels that although TCP/IP can and will get the job done, what other options do I have? Keep in mind that I c...
Alternative to TCP/IP for local program-to-program data streaming?
0
0
0
856
8,160,632
2011-11-17T00:23:00.000
0
0
1
0
python,multithreading
8,273,436
2
false
0
0
Let the display window/screen be powered by a temp local db. Code 1: Updates the screen from db. You can use infinite loop with or without a pause (screen refresh rate) Code 2: Updates the db no sooner the user enters something Code 3: Continuously check for updates from Chat Server and updates the db no sooner a new...
1
5
0
I'm trying to write a simple Python script to interface with a chat server. It would poll the server for updates, and allow the user to enter text to send to the server as chat. I can kind of get something hacked together with multithreading, but it looks terrible. Is there a nice, simple way to display updating inform...
Asynchronous interactive Python script
0
0
0
942
8,161,108
2011-11-17T01:42:00.000
1
0
0
0
python-3.x,keyboard-events
8,161,308
1
false
0
1
There is no generic "keyboard event", they all depend on what your environment is. In a terminal there are no keyboard events at all, you simply get sent text on stdin. In Windows you need to use the Win32, on Unix you need to use the X11 API and on Mac you have to use whatever OS X uses is it Cocoa?). wxPython and tk...
1
0
0
I'm a beginning programmer and i need a way to get python to recognize a keyboard event. So far i can only find these methods in vPython or tkinter, and i want to simply use the normal python shell. if anyone can help me with a module name/where i could download a module for free that would be very helpful. or simply t...
Recognition of keyboard event in python
0.197375
0
0
318
8,162,020
2011-11-17T04:12:00.000
3
1
1
0
python,python-sphinx,restructuredtext
18,234,027
3
false
0
0
Sphinx's doctest is for testing the documentation itself. In other words, it allows for the automatic verification of the documentation's sample code. While it might also verify whether the Python code works as expected, Sphinx is unnecessary for that purpose alone (you could more easily use the standard library's doct...
2
1
0
What is is the significance of doctest in Sphinx? Can someone help me understand its use with a simple example.
What is the real world use or significance of sphinx doctest?
0.197375
0
0
308
8,162,020
2011-11-17T04:12:00.000
1
1
1
0
python,python-sphinx,restructuredtext
18,168,477
3
true
0
0
I haven't used it myself but it is my understanding that it extends the functionality of doctest. For example it adds testsetup and testcleanup directives which you can put your set-up and tear-down logic in. Making it possible for Sphinx to exclude that in the documentation.
2
1
0
What is is the significance of doctest in Sphinx? Can someone help me understand its use with a simple example.
What is the real world use or significance of sphinx doctest?
1.2
0
0
308
8,163,195
2011-11-17T06:50:00.000
1
0
0
0
python,popup,tkinter,tk,ttk
8,183,103
3
false
0
1
Take a look at the Balloon widget in the Tix package. I think it is just what you are looking for.
1
3
0
I need to add a popup dialog box on my GUI. So, when ever I hover my mouse over a label, it should be able to show a popup( Like the type we get while hovering over a file in windows). It should also disappear as soon i move away the mouse. To start with, I am not even sure which module or class to use. I tried menu, ...
Popup Dialog in Tkinter/Python
0.066568
0
0
863
8,163,418
2011-11-17T07:19:00.000
3
0
0
1
python,apache,wsgi
8,163,446
2
false
1
0
WSGI is not a network protocol, so you will have to run a web server in front of your application even if it only acts as a WSGI container. Proxy connections from your main web server to the WSGI container with mod_proxy.
2
2
0
I am developing web service. My system is like this: Client request --> Web Server(Apache) --> Application Server(Python) I used WSGI for communicating between Apache and Python. My question how can I separated the web server and app server. At the moment, I have to run them on the same server.
Separated web server and application server?
0.291313
0
0
265
8,163,418
2011-11-17T07:19:00.000
1
0
0
1
python,apache,wsgi
8,163,634
2
false
1
0
+1 for Ignacio's answer. Also note that separating a WSGI app from a server will lose one of the main benefits of WSGI (the server calls the wsgi app directly). Additionally, WSGI apps have a response callback that was intended to communicate directly with the server. Instead of decoupling the server from the app, ...
2
2
0
I am developing web service. My system is like this: Client request --> Web Server(Apache) --> Application Server(Python) I used WSGI for communicating between Apache and Python. My question how can I separated the web server and app server. At the moment, I have to run them on the same server.
Separated web server and application server?
0.099668
0
0
265
8,163,669
2011-11-17T07:47:00.000
0
0
0
1
python,google-app-engine,appserver
8,163,809
1
false
1
0
There isn't an official way to discover if your application has been modified altought each time you upload your application it gets a unique version number {app version.(some unique number)} but since there isn't a document API on how to get it I wound't take a risk and use it. What you need todo is to have a script t...
1
2
0
I've built an appeninge project so, how can I run some piece of code on the appserver only once, i.e when ever I upload the whole project on to the server. How should I achieve this task???
Run the some code whenever I upload the project on to the app engine server
0
0
0
64
8,163,837
2011-11-17T08:04:00.000
0
0
1
0
python,winapi,structure,ctypes
8,164,031
2
false
0
0
Yes. A practice of filling structures with zeros is a part of wide-spreaded data preparing practice.
1
0
0
I want to use the WinAPI (CreateProcessA) in python with the help of ctypes. In order to call the function correctly, I should make some structure (e.g. STARTUPINFO, PROCESSINFORMATION) beforehand. I know that when you want to use a structure in a WinAPI, you should use ZeroMemory to fill the structure with zeros. Sho...
Should structures in python be filled with zeros before being used in WinAPI calls?
0
0
0
261
8,168,482
2011-11-17T14:10:00.000
0
0
0
0
python,xml,binary
8,168,534
2
false
0
0
Python is probably not the best tool, I would recommend VBA as it is going to be best suited to reading that file. Then, create your xml file as output.
2
0
0
I have a binary file which was created by a VBA file (I don't work with VBA or binary at all) but I need to get Python to read this binary file (which includes a list of inputs for a calculation) and then write these values into an xml file. If I know the order of the inputs into the file that is created, is it possibl...
Python file to read in binary and write in xml
0
0
1
1,333
8,168,482
2011-11-17T14:10:00.000
0
0
0
0
python,xml,binary
8,168,665
2
true
0
0
If you have the VBA code that made the file you should be able to copy the data structure in python and then deserialize it.
2
0
0
I have a binary file which was created by a VBA file (I don't work with VBA or binary at all) but I need to get Python to read this binary file (which includes a list of inputs for a calculation) and then write these values into an xml file. If I know the order of the inputs into the file that is created, is it possibl...
Python file to read in binary and write in xml
1.2
0
1
1,333
8,169,561
2011-11-17T15:18:00.000
0
1
0
1
python,debugging,google-app-engine,optimization,pydev
8,169,698
1
false
1
0
How often do you need to reload the application?, the dev server will update all your code and configuration changes without need to reload.
1
0
0
How it possible to speed up debugging in PyDev in Eclipse for Google App Engine programs? How to speed up code execution? How to speed up application reloading? Please share your experience or suggestions.
How to speed up debugging of python programs in PyDev in Eclipse (esspecially Google App Engine)
0
0
0
291
8,175,353
2011-11-17T22:32:00.000
3
0
0
0
python,django,mongodb,sentry
8,323,585
2
true
1
0
Sentry is built on a relational DB, and thus will require such for the foreseeable future. It's possible to implement most things in many NoSQL solutions, but the various types of indexes, and some of the (newer) advanced SQL would be a lot more work. As an example, Sentry 2.0 includes a "Trending" option, which is cal...
1
3
0
Is Sentry (python/django) compatible with Mongodb? If not, is there an easy solution to make it compatible? Thanks guys.
Is Sentry compatible with Mongodb?
1.2
0
0
1,292
8,175,406
2011-11-17T22:39:00.000
0
0
0
0
python,html,cgi
8,175,486
1
true
1
0
I wouldn't write off the javascript polling idea. Consider generating the file and pushing to a CDN. Make sure to let the CDN know you need a specific TTL that meets with the schedule you're generating with as their default TTL will probably be longer than 2 min. The CDN should be awesome at serving static content an...
1
0
0
I plan to run a webserver with some content generated through a Python script. I have a script that generates the data I would want to present at the moment that polls every 2 minutes with a fairly large request. How can I put this data onto a webpage without making voluminous numbers of requests? I can think of a few ...
Dynamic Content with a Polling Interval
1.2
0
1
199
8,175,928
2011-11-17T23:37:00.000
1
0
0
0
python,cookies,cookiejar,cookielib
12,788,241
4
false
0
0
cookielib.CookieJar? you can convert jar to a list and process that, e.g. {i.name: i for i in list(j)} and btw, j._cookies is actually a dict-dict already, though not completely trivially indexed. cookie jar file? I thought those were plain text files...
2
30
0
I know that I can iterate through the cookies in a cookiejar, and this would allow me to find a cookie with a particular name - but does the CookieJar object itself have any methods I can call to get a certain cookie by name? It just saves me having to write a helper method that already exists.
Get cookie from CookieJar by name
0.049958
0
0
31,059
8,175,928
2011-11-17T23:37:00.000
7
0
0
0
python,cookies,cookiejar,cookielib
36,387,083
4
false
0
0
It's undocumented internals, but you can access cookies directly like this: cookiejar._cookies[domain][path][name]
2
30
0
I know that I can iterate through the cookies in a cookiejar, and this would allow me to find a cookie with a particular name - but does the CookieJar object itself have any methods I can call to get a certain cookie by name? It just saves me having to write a helper method that already exists.
Get cookie from CookieJar by name
1
0
0
31,059
8,176,002
2011-11-17T23:45:00.000
30
0
1
0
python,boto
12,064,611
3
false
0
0
Your question about Boto is a good one, not not easy to answer. The Boto exception hierarchy is poorly designed, and ultimately the only way to determine what the exception you want to trap is requires looking at the boto source code. For example if you look at (on Ubuntu) /usr/share/pyshared/boto/exception.py you will...
1
8
0
How can I wrap a boto.storage_uri() call in python so I can handle possible exceptions?
How can I handle a boto exception in python?
1
0
1
14,487
8,176,421
2011-11-18T00:45:00.000
5
0
1
1
python,process,subprocess
8,176,549
2
false
0
0
Not without getting into subversive process hiding tasks. If as a user that wants to look at the running processes, let me see the running processes. Don't hide it from me. Techniques to hide running processes may also be picked up by some anti virus as potential threats. Don't do it. Actually, why do you want to? I ...
2
1
0
I would like to know if it's possible to run Python application subprocess in such way that there wouldn't be duplicate process in task manager?
How to run invisible subprocess in Python?
0.462117
0
0
1,893
8,176,421
2011-11-18T00:45:00.000
0
0
1
1
python,process,subprocess
8,176,846
2
false
0
0
Are you sure this "subprocess" needs to actually be a process? Maybe you could do the work inside of a thread instead of forking a new process. I'm not sure if that would accomplish your goals though, since you're not specific about what you need multiple processes for.
2
1
0
I would like to know if it's possible to run Python application subprocess in such way that there wouldn't be duplicate process in task manager?
How to run invisible subprocess in Python?
0
0
0
1,893
8,176,599
2011-11-18T01:10:00.000
2
0
0
0
python,tkinter,pacman
8,189,097
2
true
0
1
You are correct that you would use the create_arc method. Set the start to 45 and the extent to 270 and it will look like pacman is facing to the right with his mouth open. Since you are just learning I'll not post the exact code so you'll have a chance to figure it out on your own.
1
2
0
So I'm coding Pacman in Python just for fun and I want to create pacman's open face (when he is eating food) using Tkinter graphics. How exactly do I draw an open face? I was thinking about using canvas.create_arc to create the open mouth but it doesn't work properly :( Any help? Thanks!
Drawing Pacman's Face in Tkinter
1.2
0
0
2,778
8,177,403
2011-11-18T03:29:00.000
0
0
0
0
python,xmpp,google-talk
8,179,210
2
false
0
0
Check the resource associated with each change. If the resources are all different for the same user, it is because the user is logged on from several different clients, perhaps from multiple different machines. You will get presence updates from all of the user's clients if you're subscribed to them.
2
2
0
I am using sleekxmpp to connect to Google Talk. I am trying to track when contacts change their status using the changed_status event. The issue I am having is that as I log a status change, the function associated with the changed_status event seems to be called multiple times. Why might this be? I am thinking it has ...
sleekxmpp changed_status event, firing multiple times
0
0
1
471