Q_Id
int64
2.93k
49.7M
CreationDate
stringlengths
23
23
Users Score
int64
-10
437
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
DISCREPANCY
int64
0
1
Tags
stringlengths
6
90
ERRORS
int64
0
1
A_Id
int64
2.98k
72.5M
API_CHANGE
int64
0
1
AnswerCount
int64
1
42
REVIEW
int64
0
1
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
15
5.1k
Available Count
int64
1
17
Q_Score
int64
0
3.67k
Data Science and Machine Learning
int64
0
1
DOCUMENTATION
int64
0
1
Question
stringlengths
25
6.53k
Title
stringlengths
11
148
CONCEPTUAL
int64
0
1
Score
float64
-1
1.2
API_USAGE
int64
1
1
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
15
3.72M
9,696,294
2012-03-14T05:13:00.000
0
0
0
0
0
python,django,ftp,web-hosting
0
9,698,149
0
3
0
false
1
0
There are different tools for FTP and SSH file transfer. Which one is best for you depends on your environment (e.g. operating system) and your needs (do you want a graphical or command line interface?). But basically it's always a program you run on your machine that connects to a server to upload files. You don't do ...
1
0
0
0
I'm in the midst of trying to get my first website up and running all of the sudden I get to the point where I need to get my file online and I have zero idea on how to do that. I thought it would be as easy as selecting your files and clicking upload but so far it has not been that easy. Currently I'm using djangoeuro...
Beginner advice on how to use FTP or SSH? (django)
0
0
1
0
0
676
9,698,557
2012-03-14T08:54:00.000
0
0
0
0
1
python,authentication,proxy,pip
0
65,307,484
0
11
0
false
0
0
For me, the issue was being inside a conda environment. Most likely it used the pip command from the conda environment ("where pip" pointed to the conda environment). Setting proxy-settings via --proxy or set http_proxy did not help. Instead, simply opening a new CMD and doing "pip install " there, helped.
1
99
0
0
My computer is running windows behind a proxy on a windows server (using active directory), and I can't figure out how to get through it with pip (in python3). I have tried using --proxy, but it still just timeouts. I have also tried setting a long timeout (60s), but that made no difference. My proxy settings are co...
How to use pip on windows behind an authenticating proxy
1
0
1
0
0
241,528
9,722,778
2012-03-15T15:21:00.000
1
1
0
1
0
python,unix
0
10,034,142
0
1
0
true
0
0
You're asking about something pretty messy here. I suspect that none of this is what you want to do at all, and that you really want to accomplish this some simpler way. However, presuming you really want to mess with process groups... Generally, a new process group is created only by the setpgrp(2) system call. Otherw...
1
1
0
0
I'm writing a unittesting framework for servers that uses popen to basically execute "python myserver.py" with shell=False, run some tests, and then proceed to take the server down by killpg. This myserver.py can and will use multiprocessing to spawn subprocesses of its own. The problem is, from my tests, it seems tha...
Popen-ing a python call that invokes a script using multiprocessing (pgrp issue)?
0
1.2
1
0
0
241
9,724,539
2012-03-15T16:59:00.000
0
0
0
0
1
python,django
0
10,783,975
0
2
0
false
1
0
Think of CBV, more specifically "Generic Class Based Views" as a large tree of Python classes. Starting with the simplest class. Each one subclasses and over rides methods from one another. For example, the ArchiveIndexView is typically the view you will sub-class for the index of your site. It adds an extra context va...
1
0
0
0
I have a news on my site done with "James Bennett - Practical Django Projects, 2nd Edition (2009)". So I am using a date-based views, which will be deprecated in django-1.4. How can I just convert my views and urls to class-based views ? May be you have seen this, please just post a link, I can't find any working examp...
Can you share an example of using class based view with MonthMixin?
0
0
1
0
0
362
9,726,483
2012-03-15T19:09:00.000
3
0
1
0
0
python,wxpython
0
9,726,647
0
2
0
false
0
0
Only the first import executes the file. Subsequent imports copy the reference from sys.modules.
2
2
0
0
Just for my knowledge, how does python, especially wxpython reacts to multiple imports? If I import wx in multiple files, how does it handle that when called the main frame? Does it slows the speed or it firstly checks whether it is already been imported or not?
Multiple imports of python modules
0
0.291313
1
0
0
111
9,726,483
2012-03-15T19:09:00.000
5
0
1
0
0
python,wxpython
0
9,726,645
0
2
0
true
0
0
When Python imports a file, it keps track of it by storing it in sys.modules. So whenever Python is importing a file it checks there first and, if it finds it there, returns that instead; if it is not there, it imports it, adds it to sys.modules, and then returns it.
2
2
0
0
Just for my knowledge, how does python, especially wxpython reacts to multiple imports? If I import wx in multiple files, how does it handle that when called the main frame? Does it slows the speed or it firstly checks whether it is already been imported or not?
Multiple imports of python modules
0
1.2
1
0
0
111
9,736,542
2012-03-16T11:38:00.000
1
0
1
0
0
python
0
9,739,990
0
2
0
true
0
0
Sounds like you have a stand-alone program that reads from stdin, and you want to automate input to it using python. Download and use the pexpect module, that's what it's for.
1
1
0
0
I have a python script say script1.py. It will prompt the user with a serious of questions like Name, 'Y' / 'N' type questions. Now i need to call this python script from another python script,say scripts2.py such that I would define the user inputs in script2.py. So how to pass the input sequentially??? Help would...
Python : Automate the user input data(Multiple sequential inputs)?
0
1.2
1
0
0
751
9,739,963
2012-03-16T15:22:00.000
2
0
1
0
0
python
0
9,740,014
0
4
0
false
0
0
You can seek() to a position and write a single byte. It will overwrite what's there, rather than inserting.
1
6
0
0
This is a theoretical question as I don't have an actual problem, but I got to wondering ... If I had a huge file, say many gigs long and I wanted to change a single byte and I knew the offset of that byte, how could I do this efficiently? Is there a way to do this without rewriting the entire file and only writing th...
Python - Small Change to a Huge File
1
0.099668
1
0
0
1,583
9,752,891
2012-03-17T19:08:00.000
0
0
0
0
0
python,url,dynamic
0
9,753,135
0
1
0
true
1
0
If you parsing some product pages, usually these URLs have some kind of product id. Find the pattern to extract product id from URLs, and use it to filter already visited URLs.
1
0
0
0
I am crawling online stores for price comparison. Mot of the stores are using dynamic URLs heavily. This is causing my crawler to spend lot of time on every online stores. Even though most of them have only 5-6k unique products, they have unique URLs >= 300k. Any idea how to get around this. Thanks in advance!
How to handle dynamic URLs while crawling online stores?
0
1.2
1
0
1
205
9,763,675
2012-03-19T00:41:00.000
5
1
1
0
0
python
0
9,763,705
0
2
0
true
0
0
Opening the file in write/read mode (w+) will truncate the file without rewriting it if it already exists.
1
2
0
0
I want to basically copy whats from the clipboard and paste it in a file in utf-8 encoding, but what ever I try, the file has the '?' symbols in it and is Anscii encoding... But what I found out is, if there is a file that's already in utf-8 encoding, then whatever I paste in it manually (deleting whats there already),...
How to erase all text from a file using python, but not delete/recreate the file?
1
1.2
1
0
0
12,883
9,764,895
2012-03-19T04:03:00.000
2
0
0
1
0
python,google-app-engine,coffeescript,go
0
9,764,949
0
2
0
true
1
0
Coffeescript compiles to Javascript, which can be run in a web browser. In that case, App Engine can serve up the resulting javascript. I don't know of any way to compile coffeescript to python, java or go though, so you can't use it as a server side language.
1
2
0
0
Does anyone know if it is possible to use Coffeescript on Google App Engine? If so how can this be done with the app engine Python or Go platforms?
How to use Coffeescript on Google App Engine
1
1.2
1
0
0
1,031
9,782,972
2012-03-20T07:42:00.000
6
0
0
0
0
python,pdf,pdf-scraping
0
9,803,283
0
4
0
false
0
0
This is a very complex problem and not solvable in general. The reason for this is simply that the format PDF is too flexible. Some PDFs are only bitmaps (you would have to do your own OCR then—obviously not our topic here), some are a bunch of letters literally spilled out over the pages; this means that by parsing t...
1
4
0
0
I am working on a pdf file. There is number of tables in that pdf. According to the table names given in the pdf, I wanted to fetch the data from that table using python. I have worked on html, xlm parsing but never with pdf. Can anyone tell me how to fetch tables from pdf using python?
Working on tables in pdf using python
0
1
1
0
0
12,830
9,788,264
2012-03-20T13:58:00.000
0
0
0
1
0
django,google-app-engine,github,development-environment,python-2.7
0
9,793,302
0
1
1
true
1
0
I'm on a pretty similar setup, though I'm still runing on py2.5, django-nonrel. 1) I usually use 'git status' or 'git gui' to see if I forgot to check in files. 2) I personally don't check in my datastore. Are you familiar with .gitignore? It's a text file in which you list files for git to ignore when you run 'git s...
1
1
0
0
Here is my current setup: GitHub repository, a branch for dev. myappdev.appspot.com (not real url) myapp.appspot.com (not real url) App written on GAE Python 2.7, using django-nonrel Development is performed on a local dev server. When I'm ready to release to dev, I increment the version, commit, and run "manage.py u...
Google App Engine Development and Production Environment Setup
0
1.2
1
0
0
398
9,796,643
2012-03-20T23:38:00.000
11
0
1
0
0
python,garbage-collection,python-3.x,destructor
0
9,796,689
0
3
0
true
0
0
Python doesn't make any guarantees about when __del__ is called, or whether it is called at all. As it is, __del__ methods are unlikely to be called if the object is part of a reference cycle, because even if the cycle as a whole is cleaned up, Python has no way to decide where to break the cycle and in what order the ...
1
4
0
0
How soon after the reference count reaches zero is __del__ method called? Does the language promise that it's done right away, before any other use code can execute? Or can each implementation do what it likes, potentially delaying the call to __del__ arbitrarily long? Please ignore the situation when the program is ab...
how soon is `__del__` called after reference count drops to zero?
0
1.2
1
0
0
743
9,807,215
2012-03-21T15:01:00.000
0
0
1
0
1
java,python,abstract-class,jython
1
9,993,155
0
1
0
false
0
0
Code would really be needed, but my gut feeling is, that your system has access to the compiled .class file from Jython but not the .py source file
1
1
0
0
We need to use in Java written software some Python subclasses of an abstract Python class. Trying to do it with Jython we had some troubles that we haven't experienced importing not-abstract Python classes. More specifically, the error that we get is this the source attachment is not contain the source for the file P...
How to import in Java Python subclasses that use abstract methods of other classes?
0
0
1
0
0
189
9,808,250
2012-03-21T15:56:00.000
1
0
0
1
0
android,python,http,google-app-engine
0
9,808,831
0
1
0
false
1
0
You don't seem to have understood how web applications work. They don't wait for signals - or, rather, that's all they do. Every page served by a Web service is in response to a signal, ie a request. Your web service just needs to respond to normal requests in the normal way.
1
0
0
0
I don't know how to present the title more clearly. I want build a site on Google app engine (GAE), and one app on android. The site on GAE should wait the signal which is from the app on android and handle the signal to do something. I don't know how to search the "keyword" on Google of waiting signal on GAE, or wha...
GAE wait response from other source
0
0.197375
1
0
0
68
9,812,084
2012-03-21T20:10:00.000
0
0
1
0
0
c#,python,vb.net,visual-studio
0
9,812,140
0
5
0
false
0
0
If the arguments are of a different type you could overload the method Alternatively, you can just pass in a value indicating the sequence of arguments and have logic within the method to treat it accordingly.
1
0
0
0
In C#, Python and/or VB.NET, how can I write a method of a class that can accept different sequences of arguments? As an indication, the multiple choices of arguments sequence would be accessible when pressing shift+shift+space in Visual Studio.
How do I define a method which can accept different sequences of arguments?
0
0
1
0
0
290
9,826,322
2012-03-22T16:16:00.000
1
1
0
0
0
python,django,deployment,distutils,project-organization
0
9,826,658
0
1
0
true
1
0
There's different philosophies on how apps should be packaged, but most Python developers adhere to a very minimalistic approach. In other words, you package up the smallest units of logic you can. So, your goal here shouldn't be to cram everything together, but to package each discrete application separately. By appli...
1
0
0
0
We have multiple Python projects that have dependencies on each other. Hierarchically, these are organized like this: P1 P2 ... Pn Each of these is an PyDev project within Eclipse and they co-exist just fine within that environment. We are in the process of structuring out build process to enable us to deploy these a...
Multiple Python projects organization for deployment and/or distribution
0
1.2
1
0
0
180
9,861,344
2012-03-25T15:26:00.000
1
0
0
0
0
python,mongodb,openshift
0
9,862,914
0
2
0
false
0
0
You could write a python script using pymongo (or any other mongodb client library) that does the necessary cleanup and configure cron to run it regularly.
1
1
0
0
I have a python web app that essentially allows 2 computers to talk with one another. If a session ends abruptly the record is still stored in pymongo, I want to be able to run a cron job to clean up old records, but I am not clear on how to do that, can't figure how to use bash to talk to pymongo... What else could I...
Openshift, python, mongodb, and cron guidance needed
0
0.099668
1
0
0
457
9,864,843
2012-03-25T23:01:00.000
2
0
0
0
0
python,qt,model,pyqt,pyqt4
0
9,864,880
0
1
0
true
0
1
Set the QTableModel as the model for each QListView, and use QListView.setModelColumn to choose which column they each display.
1
2
0
0
Salut, community! Briefly. I wrote usual model over QAbstractTableModel and using it in usual way for QTableView. But I think I need to use some columns of this model for the few QListViews in QWizard to fill main table in the right way (for user). For example: use the column2 as the QListView's model on the page1 of t...
QAbstractTableModel as a model for one QTableView and few QListViews
0
1.2
1
0
0
371
9,868,711
2012-03-26T08:16:00.000
2
1
1
0
0
python,eclipse,pydev
0
13,807,754
0
4
0
false
0
0
On a Mac, I can get to the PyDev settings via: Eclipse → Preferences → PyDev (in tree) → Editor (subtree) In my case, I wanted to change hash tag comments from nearly invisible grey to a better color. It worked like a charm.
2
12
0
0
In Eclipse, how can I change default font for Python code in the editor (PyDev plugin)? I navigate to menu Window → Preference → General → Appearance → Colors & Fonts, but I don't find which item would affect the Python code font.
How do I change the default font for Python code in Eclipse?
0
0.099668
1
0
0
16,217
9,868,711
2012-03-26T08:16:00.000
2
1
1
0
0
python,eclipse,pydev
0
9,883,196
0
4
0
false
0
0
Following the guidance of gecco, I found out the item in General → Appearance → Colors & Fonts which affects Python code fonts. It's Text Font in the Basic folder.
2
12
0
0
In Eclipse, how can I change default font for Python code in the editor (PyDev plugin)? I navigate to menu Window → Preference → General → Appearance → Colors & Fonts, but I don't find which item would affect the Python code font.
How do I change the default font for Python code in Eclipse?
0
0.099668
1
0
0
16,217
9,872,029
2012-03-26T12:22:00.000
1
0
0
1
1
python,google-app-engine,types
0
9,885,834
0
1
0
true
1
0
When browser renders html it thinks that <type 'str'> is a (unknown) tag, so it renders it as <type 'str'></type>, hence it becomes part of your page markup... You can see this with Firebug or any similar tool.
1
0
0
0
For debug use I want to show the type of a variable in Google App Engine. In traditional environment, I will use "print type( x )" to do it. But in GAE I just don't know why I can't use self.response.out.write( str( type( x ) ) ) to echo it in the browser. I got confused because I did transform the <type 'type'> to <...
how to show an object's type in google app engine
1
1.2
1
0
0
89
9,873,626
2012-03-26T14:05:00.000
3
0
1
0
0
python,algorithm
0
9,873,885
0
5
0
false
0
0
Use a loop (int i=0; i < m; i++) Then to get the indexes you want, Ceil(i*m/n).
1
12
1
0
I have a vector/array of n elements. I want to choose m elements. The choices must be fair / deterministic -- equally many from each subsection. With m=10, n=20 it is easy: just take every second element. But how to do it in the general case? Do I have to calculate the LCD?
Choose m evenly spaced elements from a sequence of length n
0
0.119427
1
0
0
11,243
9,886,494
2012-03-27T09:13:00.000
0
1
0
0
1
python,django,shipping,satchmo
0
14,647,712
0
1
0
true
0
0
it seems like the tieredweight shipping module is what I need here.
1
0
0
0
I'm taking over a Satchmo site and need it to charge a different shipping rate for international versus local postage. Any idea what I need to do to enable this?
Different national and international shipping rate in Satchmo?
0
1.2
1
0
0
84
9,893,317
2012-03-27T16:04:00.000
0
0
1
0
1
python,pypy
0
68,372,961
0
3
0
false
0
0
install Chocolatey choco install python.pypy -y
2
15
0
0
I was wondering how to use PyPy 1.8 on Windows XP 32-bit. I downloaded the zip file off the website and installed it into a My Documents file. Initially, I thought it was similar to psyco in that I had to "import psyco," but I found that PyPy.exe acted like the Python command line instead. I tried dragging my scripts i...
How to use PyPy on Windows?
0
0
1
0
0
24,210
9,893,317
2012-03-27T16:04:00.000
9
0
1
0
1
python,pypy
0
9,895,099
0
3
0
true
0
0
Maybe I'm not following what you're trying to do, but isn't it just a question of opening a command prompt and running pypy myscriptname ? Assuming you've got all the paths for PyPy and your script straight, anyway (e.g. your script's in PyPy's folder).
2
15
0
0
I was wondering how to use PyPy 1.8 on Windows XP 32-bit. I downloaded the zip file off the website and installed it into a My Documents file. Initially, I thought it was similar to psyco in that I had to "import psyco," but I found that PyPy.exe acted like the Python command line instead. I tried dragging my scripts i...
How to use PyPy on Windows?
0
1.2
1
0
0
24,210
9,899,180
2012-03-27T23:32:00.000
1
0
1
0
0
python,python-3.x,cloud
0
9,899,346
0
3
0
false
1
0
I haven't tried myself. You may want to check out ipython notebook.
1
0
0
0
Is there any way in a browser, to type python code into an input field, it will then be sent to a local server and executed and the result pushed back to the browser. Basically a browser hosted python notebook, where the code gets evaluated on a different machine. Is there any python package to do this. something like...
cloud scripting through browser and evaluate python on server
0
0.066568
1
0
1
92
9,899,313
2012-03-27T23:48:00.000
2
1
1
0
0
python,beautifulsoup,mechanize
0
9,899,341
0
1
1
false
0
0
Use a dict or set. Consider computing a checksum of each item. This brings you toward what's known as Content Addressable Storage, which is where the checksum actually is stored as if it were the item's "name", and a separate index is stored which maps things like filenames or song names to the checksums or data bloc...
1
1
0
0
This isn't as much of a specific problem as something I am looking for more of a "Pythonic" philosophical answer to. Namely, what's the best way to keep track of unique items and ensure duplicates don't arise? For example, I am writing a script to scrape a website for links to songs on SoundCloud so I can automaticall...
What is the most efficient way to keep track of unique downloaded files in a Python program?
0
0.379949
1
0
0
214
9,916,873
2012-03-28T22:58:00.000
0
0
1
0
0
python,exception,gevent
1
17,853,380
0
2
0
false
0
0
You can use spawn_link_exception instead of spawn.
1
2
0
0
i'm working with an application written in python using gevent. i want it to exit immediately as a result of any exception that i haven't explicitly trapped. it looks like i'd have to patch the core gevent code. is there any way can i do this in my app, without patching gevent or greenlet?
how can i make gevent application exit immediately after any exception?
1
0
1
0
0
1,560
9,921,057
2012-03-29T07:41:00.000
0
0
1
0
0
java,python,math
0
9,921,123
0
2
0
false
0
0
You can use the built-in function round: round(3.5) gives 4.0 round(3.4) gives 3.0 round(3.6) gives 4.0
1
1
0
0
Does an analogue to Java's Math.rint exist in Python? If not, how can I achieve the same result?
Rounding numbers: Java's 'Math.rint' in Python
0
0
1
0
0
1,638
9,926,825
2012-03-29T13:54:00.000
0
0
0
0
1
python,amazon-web-services
0
9,928,772
0
4
0
false
1
0
Don't put it in applications you plan to distribute. It'll be visible and they can launch instances that are directly billable to you or worst..they can take down instances if you use it in production. I would look at your programs design and seriously question why I need to include that information in the app. If yo...
1
11
0
0
I'm making an application in Python and using Amazon Web Services in some modules. I'm now hard coding my AWS access id and secret key in *.py file. Or might move them out to an configuration file in future. But there's a problem, how can I protect AWS information form other people? As I know python is a language that ...
How can I protect my AWS access id and secret key in my python application
0
0
1
0
1
6,307
9,927,821
2012-03-29T14:48:00.000
0
1
0
0
1
python,user-interface,wxpython,pyqt,tkinter
0
9,928,114
0
4
0
false
0
0
Basically you just need to figure out what widgets will hold the data you want the best. I suspect you could use a couple combo boxes to hold different sets of extensions. Or you could just use the path name strings to figure that out. Hit a button and run the conversion process, probably in another thread so the GUI r...
3
3
0
0
I have a command-line Python script that works well to convert one sort of file into another given a few parameters and would now like to deploy this to some of my colleagues who may not know what a command line is. I could work for hours trying to determine which Python GUI toolkit is "best", then learning how to do w...
Cookbook GUI interface for a command-line script
0
0
1
0
0
4,233
9,927,821
2012-03-29T14:48:00.000
1
1
0
0
1
python,user-interface,wxpython,pyqt,tkinter
0
9,934,956
0
4
0
false
0
0
There are a few answers advocating wxpython. However, any toolkit will work for this project. Tkinter has the added benefit tha you and your collegues already have it installed and it is very easy to use. That being said, the other toolkits are more-or-less equally easy to use but you might have to jump through a hoop...
3
3
0
0
I have a command-line Python script that works well to convert one sort of file into another given a few parameters and would now like to deploy this to some of my colleagues who may not know what a command line is. I could work for hours trying to determine which Python GUI toolkit is "best", then learning how to do w...
Cookbook GUI interface for a command-line script
0
0.049958
1
0
0
4,233
9,927,821
2012-03-29T14:48:00.000
0
1
0
0
1
python,user-interface,wxpython,pyqt,tkinter
0
9,928,262
0
4
0
false
0
0
This depends mostly on your need. If your need is simple, you can just go with tkinter that is bundled with python itself. If you use this, you will not be relying on third party library to implement your GUI. Since you are wanting to make this available for your collegues, this might be easier to compile with py2exe o...
3
3
0
0
I have a command-line Python script that works well to convert one sort of file into another given a few parameters and would now like to deploy this to some of my colleagues who may not know what a command line is. I could work for hours trying to determine which Python GUI toolkit is "best", then learning how to do w...
Cookbook GUI interface for a command-line script
0
0
1
0
0
4,233
9,979,602
2012-04-02T15:55:00.000
23
0
1
0
0
python
0
9,979,626
0
10
0
true
0
0
Put them in a list, sort them, pick the middle one.
1
8
0
0
Given 3 numbers, I need to find which number lies between the two others. ie,given 3,5,2 I need 3 to be returned. I tried to implement this by going thru all three and using if else conditions to check if each is between the other two.But this seems a naive way to do this.Is there a better way?
how to find the middle number in python
0
1.2
1
0
0
55,236
9,991,838
2012-04-03T10:56:00.000
4
0
1
0
1
python,linux,shell,ipython,line-breaks
0
9,991,864
0
3
0
true
0
0
Nothing is the problem. Python code is executed line-by-line. If your code does not work when executed line-by-line, it should not work when loaded from a file (assuming in both cases a "clean" environment).
2
8
0
0
Hi I'm new to Linux and I really like the idea of writing and testing python code in a shell. But my problem is how can I do line breaks in IPython. Every time I use the (I think) "normal" shortcut shift+enter the code gets executed. Function keys are disabled and keyboard layout works fine on my laptop, what could be ...
Linux - Linebreak in IPython
0
1.2
1
0
0
7,327
9,991,838
2012-04-03T10:56:00.000
7
0
1
0
1
python,linux,shell,ipython,line-breaks
0
9,992,118
0
3
0
false
0
0
If you want to do a line-break, you end the line with the \ escape character, same as you do in a Python file. Shift+Enter doesn't have any special meaning in ipython, and indeed most over places in the shell. It doesn't have special meaning in Python, either. It does have special meaning in some text editors and word ...
2
8
0
0
Hi I'm new to Linux and I really like the idea of writing and testing python code in a shell. But my problem is how can I do line breaks in IPython. Every time I use the (I think) "normal" shortcut shift+enter the code gets executed. Function keys are disabled and keyboard layout works fine on my laptop, what could be ...
Linux - Linebreak in IPython
0
1
1
0
0
7,327
9,995,041
2012-04-03T14:10:00.000
1
0
0
0
0
python,django
0
9,995,337
0
3
0
false
1
0
I certainly use class methods, and I have found that where there are similar operations to be performed on classes, it is possible (and easy) to factor the classmethods into base classes (use the self parameter of your class method to write generic code). Probably the best way to manage broken-up views, etc is to repla...
2
4
0
0
I have a Django project which is getting more and more complex. I started off with the traditional files: models, views, and forms.py. The issue I have right now is that those files are getting bigger and bigger and I'd like to break them into manageable parts. What are the best practices around that? In addition, I am...
How to structure complex Django project?
0
0.066568
1
0
0
1,093
9,995,041
2012-04-03T14:10:00.000
2
0
0
0
0
python,django
0
9,997,876
0
3
0
true
1
0
I find refactoring can really help. Are there a lot of similar views that just have different templates or querysets? Make a more generic view that accepts multiple template names, records, etc. Anything that requires extensive calculations gets moved to a utils.py in the same directory. Class methods are for actions t...
2
4
0
0
I have a Django project which is getting more and more complex. I started off with the traditional files: models, views, and forms.py. The issue I have right now is that those files are getting bigger and bigger and I'd like to break them into manageable parts. What are the best practices around that? In addition, I am...
How to structure complex Django project?
0
1.2
1
0
0
1,093
10,002,771
2012-04-03T23:09:00.000
2
1
0
0
0
python,django,ssh
0
10,003,264
0
1
0
false
1
0
You're close. The problem here is probably that your web server runs as a non-privileged user (NOT root), like www or www-data or nobody (depending on your operating system). While that user can probably run the SSH binary, when doing so as nobody, it probably doesn't have a home directory, can't find your .ssh direc...
1
0
0
0
I acquired a python script that will either telnet to some equipment, or if the equipment is in a lab, ssh to a firewall machine and then it will telnet to the equipment, and run a command, returning the output for more processing. I took this script and tied it into a Django web app so that I could, from a browser, fi...
need to ssh to remote machine from web page with python/django
0
0.379949
1
0
0
2,644
10,003,232
2012-04-04T00:08:00.000
6
0
1
0
0
python,matrix,linear-algebra
0
10,003,296
0
2
0
false
0
0
The rule of Sarrus is only a mnemonic for solving 3x3 determinants, and won't be as helpful moving beyond that size. You should investigate the Leibniz formula for calculating the determinant of an arbitrarily large square matrix. The nice thing about this formula is that the determinant of an n*n matrix is that it can...
1
3
1
0
I'm making a small matrix operations library as a programming challenge to myself(and for the purpose of learning to code with Python), and I've come upon the task of calculating the determinant of 2x2, 3x3 and 4x4 matrices. As far as my understanding of linear algebra goes, I need to implement the Rule of Sarrus in or...
Python determinant calculation(without the use of external libraries)
0
1
1
0
0
3,244
10,006,017
2012-04-04T06:34:00.000
2
0
1
0
0
python,logging
0
10,023,080
0
2
0
false
0
0
I think there is no magic scanning here. Try to test it this way in a separate test directory: test/main.py: import logging logging.info('test') test/any.py: import logging logging.basicConfig(filename='test.log', level=logging.INFO) python main.py Result: NO test.log file. Now let's update the test:...
1
2
0
0
I used to Python logging, it works fine. The logging.basicConfig(...) set in one module (a some.py file), then we can use logging every where. Obviously, logging is global. The question is how logging find it's settings, when we not call the module where basicConfig(...) appeared (in some.py file )? Is logging scan ...
How python logging get it's configuration
0
0.197375
1
0
0
727
10,009,660
2012-04-04T10:53:00.000
9
0
0
1
1
python,installation,py2exe
0
10,009,715
0
2
0
false
0
0
Py2exe has to run on Windows, you can not run it in Linux. (Maybe wine can help, but I'm not sure)
1
9
0
0
I downloaded the actual py2exe package. But I've no idea how to get it in my system. I mean I can follow the tutorial a 100% but I can't find anything how to install py2exe to my kubuntu 11.10. I also can't find a py2exe.py which I could include to my workingfolder. Could some please help me the project has to be fini...
How to install the py2exe modul in Linux
0
1
1
0
0
23,189
10,017,645
2012-04-04T19:06:00.000
1
1
0
0
0
python,database,django,apache,mod-wsgi
0
10,020,054
0
1
0
true
1
0
First up, look at daemon mode of mod_wsgi and don't use embedded mode as then you can control separate to Apache child processes the number of Python WSGI application processes. Secondly, you would be better off putting the memory hungry bits in a separate backend process. You might use XML-RPC or other message queuein...
1
2
0
0
I'm writing a Oracle of Bacon type website that involves a breadth first search on a very large directed graph (>5 million nodes with an average of perhaps 30 outbound edges each). This is also essentially all the site will do, aside from display a few mostly text pages (how it works, contact info, etc.). I currently h...
Maximizing apache server instances with large mod_wsgi application
0
1.2
1
1
0
214
10,018,767
2012-04-04T20:29:00.000
0
0
0
0
0
python,pygtk
0
10,057,082
0
1
0
false
0
1
If you want to display an image and allow the user to select and move parts of it, you best look for a ready-made image editing widget. GTK doesn't come with one. To roll your own you can use an image widget for display, but it doesn't care about the mouse, so you can place it inside an event box and connect to button ...
1
0
0
0
What I'm wanting to do is create a selection tool (like what you see in most paint programs) using PyGtk. I've seen a previous question that asked something similar, but they already seemed to know what they were doing to make the selection itself. That user said he was using an eventbox, but I don't know how I would...
How do I create a canvas selection tool?
0
0
1
0
0
212
10,020,389
2012-04-04T22:52:00.000
-1
0
0
1
1
winapi,windows-7,python-3.x,block,pywin32
0
28,282,261
0
1
0
false
0
0
write a while loop Into the while loop write the command to taskkill dwm.exe It's a poor solution, but the only one I know. Regards!
1
0
0
0
This might be a more difficult question since I don't even know how to do it outside of Python... I want to write a terminal program that completely locks up my PC until a password is entered. In the locked state no one should be able to do anything outside the terminal. In it, the user may rampage and write silly comm...
Completely locking down Windows 7 using Python 3.2?
0
-0.197375
1
0
0
545
10,031,427
2012-04-05T15:22:00.000
5
1
1
0
0
python,python-idle
1
10,031,501
0
1
0
true
0
0
The reason why this is sensible with LISP is that every LISP programs is just a bunch of macros and functions and the s-expressions can be formatted automatically into a nice representation. This isn't the case in Python, where you have more complex syntax (significant whitespace, decorators, lots of control structure...
1
3
0
0
I'm not sure if I worded the subject correctly but essentially I'm curious if someone can develop code in the Python IDLE, or a similar tool, and then through some command spit out the current code in memory. I believe I did this previously when going through a Lisp book and recall it being a very different approach th...
Can a python IDLE be used for iterative/in-memory development?
0
1.2
1
0
0
199
10,033,953
2012-04-05T18:27:00.000
0
0
1
0
0
python,language-agnostic,duck-typing,dynamic-typing
1
10,034,420
0
4
0
false
0
0
If you are worried that the lack of static type checking will let some bugs get through, the answer isn't to bolt on type checking, it is to write tests. In the presence of unit tests, a type checking system becomes largely redundant as a means of catching bugs. While it is true that a type checking system can catch s...
1
4
0
0
I think understand the idea of duck typing, and would like to use it more often in my code. However, I am concerned about one potential problem: name collision. Suppose I want an object to do something. I know the appropriate method, so I simply call it and see what happens. In general, there are three possible outcome...
Duck typing: how to avoid name collisions?
0
0
1
0
0
1,060
10,045,312
2012-04-06T15:03:00.000
1
0
1
0
0
python
0
10,045,462
0
1
0
false
0
1
You could consider the Scintilla text editing component, with bindings for Python (and other languages.) The Scintilla text editing widget is the basis for the SciTE text editor. SciTE supports code folding, so it is certainly doable - it may even be a built in part of Scintilla. From the SciTE website: Scintilla is a...
1
0
0
0
I'm learning Python and want to make a small text editor that would allow the code collapsing like when def a Function, how you can collapse that to a single line. I'm thinking of using Tkinter but would be open to other environments. I mainly want to know what widget I should use, I'd like to think that I'd be able to...
Python: How to program an IDE Code collapsing?
0
0.197375
1
0
0
200
10,047,020
2012-04-06T17:36:00.000
8
0
1
0
0
ipython
0
10,047,045
0
2
0
true
0
0
Doh, one has to click on the very slim divider line. The subframe then closes...
2
5
0
0
In an IPython notebook, when you look at some docs with ? or help(), a split frame is opened at the bottom of the screen where the documentation shows up. While I find this useful as a guide for continuing to play with some Python code, I would like to close this spit frame when I'm done reading the docs, so to get bac...
How to close the doc reading part of the IPython notebook?
0
1.2
1
0
0
613
10,047,020
2012-04-06T17:36:00.000
5
0
1
0
0
ipython
0
21,760,178
0
2
0
false
0
0
You have to press the q key. That works for me.
2
5
0
0
In an IPython notebook, when you look at some docs with ? or help(), a split frame is opened at the bottom of the screen where the documentation shows up. While I find this useful as a guide for continuing to play with some Python code, I would like to close this spit frame when I'm done reading the docs, so to get bac...
How to close the doc reading part of the IPython notebook?
0
0.462117
1
0
0
613
10,054,167
2012-04-07T11:45:00.000
2
0
0
0
0
python,opengl,freeglut
0
10,055,756
0
1
0
true
0
1
You don't. Remember: GLUT is primarily for test applications and demos. If your application is complex and platform-specific enough to need to change its icon, then you probably need to move beyond GLUT.
1
1
0
0
I am trying to learn OpenGL, and I'm using PyOpenGL and GLUT. What really bugs me, is that I can't figure out how to change the title bar icon. Has anyone had any success in changing this?
How do I replace the GLUT title bar icon when using pyopengl?
0
1.2
1
0
0
248
10,054,878
2012-04-07T13:24:00.000
1
0
0
0
0
python,active-directory,ldap
0
10,056,144
0
1
0
true
0
0
The search result contains: A list of search result entries. Each search result entry in the list contains the distinguished name of the entry and a (partial) attribute list or A list of search result references. Each search result reference contains a sequence of URIs After the entries or references comes a single...
1
0
0
0
I was able to get attributes about an user by doing queries on LDAP using Python ldap but I don't know how to obtain his DN. Remark: Doing CN=sAMAccount,base_dn) is not valid because the user can be somewhere in another sub-tree. Which is the proper way of getting the DN for an user for which I do have the sAMAccount?
How do I get the full DN, distinguishedName of an user with python ldap?
0
1.2
1
0
1
1,443
10,066,554
2012-04-08T21:11:00.000
0
0
0
1
1
python,windows,linux,isometric
1
10,067,738
0
3
0
false
0
0
This source code is over 5 years old and the build script for floyd looks to assume hard-coded python2.4. It seems pretty clear that your floyd module did not build. You will most likely have to go back to the build step and ensure that you are properly generating a _floyd.so. If you built it correctly, then this sho...
1
0
0
0
another question for all of you- So i am trying to get a program called Pysomap to work (its basically ISOMAP but for python[http://web.vscht.cz/spiwokv/pysomap/]), i follow the directions best as i can, building it on Ubuntu, Windows, and Fedora (prebuilt libraries), but cant seem to get it to work. On windows (which ...
How to get program to not throw "Error: Can't load Floyd's algorithm library"
0
0
1
0
0
144
10,066,573
2012-04-08T21:14:00.000
5
0
0
0
0
python,sql,django
0
10,066,588
0
1
0
true
1
0
You really don't want to implement each question/answer as a separate DB field. Instead, make a table of questions and a table of answers, and have a field in the answers table (in general, a ForeignKey) to indicate which question a given answer is associated with.
1
0
0
0
I am developing an application designed for a secretary to use. She has a stack of hundreds of ballot forms which have a number of questions on them, and wishes to input this data into a program to show the total votes for each answer. Each question has a number of answers. For example: Q: "Re-elect current president o...
Adding field to SQL table from Django Application
0
1.2
1
1
0
72
10,070,703
2012-04-09T08:26:00.000
2
0
0
0
0
python,python-2.7,web2py,web2py-modules
0
10,090,081
0
2
0
true
1
0
I would consider looking into webservices. If you could expose url from java, that will route to a method/function of java where logic is performed and it returns json object. While in web2py urllib2 you can make a request and decode that json into native python dictionary. The clue is that you would have to expose all...
1
1
0
0
I have to implement one web2py application which has to access java code (which has code to connect to the remote machine) but not sure whether we can do it in web2py or not.My PC has Java 1.6, Python2.7 ,web2py ,eclipse installed. Use case is : I have created one button in web2py application and upon clicking the butt...
can we use java code in web2py application code?
1
1.2
1
0
0
632
10,084,379
2012-04-10T06:56:00.000
2
0
0
1
0
python,build,osx-lion,web2py
1
10,090,778
0
3
0
true
0
0
web2py works fine with Lion's stock Python 2.7. Unless you have a compelling reason to use 2.5, stick with 2.7.
2
1
0
0
Here is what I would like to do. Use web2py with MySQL. To do that, I need to use source web2py rather than web2py.app To use web2py, I need Python 2.5 I am having trouble building and installing Python 2.5 I downloaded Python-2.5.6.tgz from Python release page. Now, I did ./configure and then make Then, I get th...
Python 2.5.6 build error on Mac Lion
0
1.2
1
0
0
483
10,084,379
2012-04-10T06:56:00.000
0
0
0
1
0
python,build,osx-lion,web2py
1
10,114,744
0
3
0
false
0
0
I have web2py on my iMac OSX Lion using the web2py app and MySQL. I haven't run into any reason why you can't use the app with MySQL.
2
1
0
0
Here is what I would like to do. Use web2py with MySQL. To do that, I need to use source web2py rather than web2py.app To use web2py, I need Python 2.5 I am having trouble building and installing Python 2.5 I downloaded Python-2.5.6.tgz from Python release page. Now, I did ./configure and then make Then, I get th...
Python 2.5.6 build error on Mac Lion
0
0
1
0
0
483
10,090,645
2012-04-10T14:27:00.000
1
0
1
0
0
python,sum
0
10,090,752
0
3
0
false
0
0
Open the files and use readline to open the files line by line. Check whether it is string or not. By looking at your file format, I assume everything in between two strings (Name1 and Name2 or else) are numbers so store those on list. Finally use sum(list) to get the output. I am not writing the code since this is "HO...
1
0
0
0
I have to write a script that does this: Inputfile: Name 10 -43 54 Name2 654 43 2 -5467 Name3 65 65 Outputfile: Name 21 Name2 -4768 Name3 130 I came to the conclusion that I am supposed to split the input into arrays at the names and then print the first element and the sum of the rest, but I do not know how to do it a...
Summing numbers with header in Python
0
0.066568
1
0
0
193
10,091,108
2012-04-10T14:55:00.000
0
0
0
0
0
python,mysql,notifications
0
10,091,535
0
1
0
false
0
0
As I understand this is not a client-server application, but rather an application that has a common remote storage. One idea would be to change to web services (this would solve most of your problems on the long run). Another idea (if you don't want to switch to web) is to refresh periodically the data in your interfa...
1
0
0
0
I have a desktop python application whose data backend is a MySQL database, but whose previous database was a network-accessed xml file(s). When it was xml-powered, I had a thread spawned at the launch of the application that would simply check the xml file for changes and whenever the date modified changed (due to any...
Best way to inform user of an SQL Table Update?
0
0
1
1
0
450
10,098,963
2012-04-11T02:09:00.000
2
0
0
0
1
java,javascript,python,html,navigation
0
10,099,151
0
2
0
false
1
0
You can use a tool like Selenium to emulate a user clicking things in a web browser (I believe it actually "drives" a real instance of whatever browser you choose.) Selenium has a domain-specific language for specifying what actions you want to perform, and Python bindings for controlling it programmatically. I haven't...
1
2
0
0
I need to navigate though a website that is written mostly in Javascript. There are no hard links at all, as the page is simply modified through the script. I can do what I need to using Javascript injections one after another, but chrome starts searching for my input instead of injecting it after a certain string leng...
How do I navigate a website through software?
0
0.197375
1
0
1
343
10,099,619
2012-04-11T04:01:00.000
0
0
1
0
0
python,arrays
0
10,101,163
0
4
0
false
0
0
Using the construct [[0,0]]*3 works just fine and returns the following: [[0, 0], [0, 0], [0, 0]]
2
2
1
0
I want to initialize an array that has X two-dimensional elements. For example, if X = 3, I want it to be [[0,0], [0,0], [0,0]]. I know that [0]*3 gives [0, 0, 0], but how do I do this for two-dimensional elements?
How do I initialize a one-dimensional array of two-dimensional elements in Python?
0
0
1
0
0
1,407
10,099,619
2012-04-11T04:01:00.000
0
0
1
0
0
python,arrays
0
10,099,628
0
4
0
false
0
0
I believe that it's [[0,0],]*3
2
2
1
0
I want to initialize an array that has X two-dimensional elements. For example, if X = 3, I want it to be [[0,0], [0,0], [0,0]]. I know that [0]*3 gives [0, 0, 0], but how do I do this for two-dimensional elements?
How do I initialize a one-dimensional array of two-dimensional elements in Python?
0
0
1
0
0
1,407
10,105,610
2012-04-11T12:09:00.000
3
0
0
0
0
python,django,facebook,fandjango
0
10,105,994
0
1
0
true
1
0
There's no need to wrap the context processor. If you've wrapped the view in the first place, then the request will already be annotated with the facebook.user attribute. Since the request is passed to the context processor anyway, you have access to that attribute. You should probably do a quick check - if hasattr(req...
1
0
0
0
I'm using Fandjango for a Django Facebook Canvas app. To use fandjango, you need to wrap all view functions with @facebook_authorization_required, which makes sure you're authorized, then gives you the variable request.facebook.user. What I want is to make a context processor which defines a few more variables based on...
Apply decorator to context processor
0
1.2
1
0
0
280
10,130,367
2012-04-12T19:25:00.000
0
0
0
0
1
python,scrapy,scrapyd
0
10,136,943
0
1
0
false
1
0
I think i had a similar situation. The reason that processes were dying was that spiders were generating an exception making the process to stop. To find out the exception look at the log files somewhere in .scrapy folder. For each started crawler process scrapy creates a log file with job id in its name.
1
2
0
0
I am facing a problem with crawler processes dying unexpectedly. I am using scrapy 0.14, the problem existed in 0.12 as well . The scrapyd log shows entries like: Process died: exitstatus=None The spider logs dont show spider closed information as depicted by my database status also. Has anybody else faced similar s...
Crawler processes dying unexpectedly
0
0
1
0
0
493
10,137,594
2012-04-13T08:30:00.000
0
0
0
0
0
python,networking,ethernet
0
16,929,947
0
6
0
false
0
0
Another roundabout way to get a systems mac id is to use the ping command to ping the system's name then performing an arp -a request against the ip address that was pinged. the downfall to doing it that way thou is you need to write the ping response into the memory of python and performing a readline operation to ret...
1
1
0
0
The goal is to collect the MAC address of the connected local NIC, not a list of all local NICs :) By using socket and connect (to_a_website), I can just use getsockname() to get the IP, that is being used to connect to the Internet. But from the IP how can I then get the MAC address of the local NIC ? Main reason f...
Python - Get MAC address of only the connected local NIC
0
0
1
0
1
8,993
10,151,806
2012-04-14T07:16:00.000
5
0
0
0
0
python,python-c-api
0
10,152,614
0
1
0
true
0
1
Yes, use tp_as_mapping instead. Its mp_subscript takes a PyObject * so you can use anything as index/key. To understand how they relate, you could have a look at the source of PyObject_GetItem() which (as the doc says) is the equivalent of Python o[key] expression. You will see that it first tries tp_as_mapping and if ...
1
3
0
0
Is it possible to define a class with a __getitem__ that takes a tuple argument using the Python C-API? The sq_item member of the tp_as_sequence member of a PyTypeObject must be a ssizeargfunc, so I don't see how to do it. (But I assume that the NumPy ndarray does it.)
__getitem__ method with tuple argument using Python C-API
1
1.2
1
0
0
853
10,152,055
2012-04-14T08:01:00.000
3
0
0
1
1
python,google-app-engine
0
10,152,181
0
1
1
true
1
0
How about writing the XML data to the blobstore and then write a handler that uses send_blob to download to your local file system? You can use the files API to write to the blobstore from you application.
1
0
0
0
I have an application I am developing on top of GAE, using Python APIs. I am using the local development server right now. The application involves parsing large block of XML data received from outside service. So the question is - is there an easy way to get this XML data exported out of the GAE application - e.g., i...
Getting a piece of information from development GAE server to local filesystem
1
1.2
1
0
1
66
10,163,877
2012-04-15T16:35:00.000
1
1
0
1
0
python,bash,ubuntu,file-monitoring
0
10,176,476
0
3
0
true
0
0
One technique I use works with FTP. You issue a command to the FTP server to transfer the file to an auxiliary directory. Once the command completes, you send a second command to the server, this time telling it to rename the file from from the aux directory to the final destination directory.If you're using inotify or...
1
6
0
0
I have a video encoding script that I would like to run as soon as a file is moved into a specific directory. If I use something like inotify, how do I ensure that the file isn't encoded until it is done moving? I've considered doing something like: Copy (rsync) file into a temporary directory. Once finished, move (si...
Move file to another directory once it is done transferring
0
1.2
1
0
0
1,292
10,165,342
2012-04-15T19:34:00.000
0
1
0
0
0
python,buildout
0
10,168,036
0
2
0
false
0
0
Putting it in find-links should work. I've done that in the past. You have to make sure the link is of the correct format as any python egg.
1
0
0
0
zc.recipe.egg allows you to install any egg and its script with buildout. However, zc.recipe.egg relies on find-links and index behavior, inherit from setuptools I guess. It would like to take an egg server / HTML for scanning. What if I just want to point zc.recipe.egg to a egg direct download URL how would I do that?...
Buildout and zc.recipe.egg - specifying egg download URL directly?
0
0
1
0
0
748
10,169,500
2012-04-16T06:19:00.000
1
0
0
0
1
python,url,web,siteminder
0
19,700,519
0
3
0
false
0
0
Agree with Martin - you need to just replicate what the browser does. Siteminder will pass you a token once successfully authenticated. I have to do this as well, will post once I find a good way.
1
3
0
0
I am trying to access and parse a website at work using Python. The sites authorization is done via siteminder, so the usual urllib/urllib2 user password does not work. Does anyone have an idea how to do that? Thanks NoamM
Use Python/urllib to access web sites with "siteminder" authentication?
0
0.066568
1
0
1
2,741
10,196,716
2012-04-17T18:16:00.000
0
0
0
0
0
python,pyqt4
0
10,201,627
0
1
0
false
0
1
After inserting the row, call QTableWidget.scrollToBottom() to show that last row.
1
0
0
0
I am inserting some data in qtablewidget after some time interval. For this i am clearing all content of qtable and then inserting data. But the table showing data from first row, I want that the table always show last row. This will feel like real updation of table. how to do this?
Pyqt table widget updation
0
0
1
0
0
303
10,199,697
2012-04-17T21:49:00.000
1
0
0
0
1
python,web-services,api
0
10,332,534
0
1
0
true
1
0
Well, your question is a little bit generic, but here are a few pointers/tips: Webfaction allows you to install pretty much anything you want (you need to compile it / or ask the admins to install some CentOS package for you). They provide some default Apache server with mod_wsgi, so you can run web2py, Django or any ...
1
1
0
0
I have developed a few python programs that I want to make available online. I am new to web services, and I am not sure what I need to do in order to create a service where somebody makes a request to an URL (for example), and the URL triggers a Python program that displays something in the user's browser, or a set o...
RESTful Web service or API for a Python program in WebFaction
0
1.2
1
0
1
597
10,199,963
2012-04-17T22:12:00.000
7
0
0
1
0
python,google-app-engine,memory-management,python-2.7,task-queue
1
10,200,635
0
1
0
false
1
0
There's not currently any way to advise the App Engine infrastructure about this. You could have your tasks return a non-200 status code if they shouldn't run now, in which case they'll be automatically retried (possibly on another instance), but that could lead to a lot of churn. Backends are probably your best option...
1
1
0
0
I have a Google App Engine app that periodically processes bursts of memory-intensive long-running tasks. I'm using the taskqueue API on the Python2.7 run-time in thread-safe mode, so each of my instances is handling multiple tasks concurrently. As a result, I frequently get these errors: Exceeded soft private memory ...
Restricting the number of task requests per App Engine instance
1
1
1
0
0
228
10,200,594
2012-04-17T23:19:00.000
1
0
1
0
0
python,plugins,pyqt,contextmenu,pyqt4
0
10,543,269
0
2
0
true
0
0
Avaris' comments basically answered this question the best. I can't select it, though, because it's comments, rather than an answer. So I'm summarizing that answer here, so this Q can be answered: "If you are given a context menu (QMenu to be specific) you can access it." - Avaris "You can't do this without modifying...
1
3
0
0
Note: I have very little python and PyQt experience... Given a context menu already created, I'm looking for a functional example of how I would gain access to that context menu, so it can be extended for a plugin which is doing the python equivalent of a javascript greasemonkey script. Then I'm also looking for a fun...
PyQt: Basic example of accessing and adding a submenu to an existing context menu?
0
1.2
1
0
0
3,646
10,208,147
2012-04-18T11:10:00.000
0
0
0
0
0
python,postgresql,openerp
0
10,208,766
0
3
0
false
1
0
OpenERP works with PostgreSQl as the Back-end Structure. Postgresql is managed by pgadmin3 (Postgres GUI),you can write sql queries there and can add/delete records from there. It is not advisable to insert/remove data directly into Database!!!!
2
2
0
0
I am new in OpenERP, I have installed OpenERP v6. I want to know how can I insert data in database? Which files I have to modify to do the job? (files for the SQL code)
OpenERP: insert Data code
0
0
1
1
0
794
10,208,147
2012-04-18T11:10:00.000
0
0
0
0
0
python,postgresql,openerp
0
10,225,346
0
3
0
false
1
0
The addition of columns in the .py files of the corresponding modules you want to chnage will insert coumns to the pgadmin3 also defenition of classes will create tables...when the fields are displayed in xml file and values are entered to the fields through the interface the values get stored to the table values to th...
2
2
0
0
I am new in OpenERP, I have installed OpenERP v6. I want to know how can I insert data in database? Which files I have to modify to do the job? (files for the SQL code)
OpenERP: insert Data code
0
0
1
1
0
794
10,217,948
2012-04-18T21:02:00.000
1
0
0
1
0
python,google-app-engine,analytics,visitors
0
10,221,347
0
3
0
false
1
0
There is no way to tell when someone stops viewing a page unless you use Javascript to inform the server when that happens. Forums etc typically assume that someone has stopped viewing a page after n minutes of inactivity, and base their figures on that. For minimal resource use, I would suggest using memcache exclusiv...
1
2
0
0
I need to get the number of unique visitors(say, for the last 5 minutes) that are currently looking at an article, so I can display that number, and sort the articles by most popular. ex. Similar to how most forums display 'There are n people viewing this thread' How can I achieve this on Google App Engine? I am using ...
How to get number of visitors of a page on GAE?
0
0.066568
1
0
0
1,919
10,218,679
2012-04-18T21:59:00.000
1
1
0
0
0
python,selenium
0
10,218,792
0
6
0
false
1
0
My experience has been that any sufficiently useful test framework will end up needing a customized logging solution. You are going to end up wanting domain specific and context relevant information, and the pre-baked solutions never really fit the bill by virtue of being specifically designed to be generic and broadl...
1
7
0
0
I am doing some R&D on selenium+python. I wrote some test cases in python using selenium webdriver and unittest module. I want to know how can I create report of the test cases. Is there inbuilt solution available in selenium or I need to code to generate file. Or is there any other web testing framework with javascrip...
Selenium+python Reporting
1
0.033321
1
0
1
24,481
10,220,943
2012-04-19T02:41:00.000
0
1
0
0
0
python,windows
0
10,220,978
0
4
1
false
0
0
raw_input('Please fill in questionnaire 1 and press [ENTER] when you are done.') will wait for someone to hit [enter]. Clearing the screen may be OS/environment dependent, I am not sure.
1
0
0
0
'lo, I am currently trying to code a simple routine for an experiment we are planning to run. The experiment starts by entering a subject number and creating a bunch of files. I got that part working. Next, we want the screen to go blank and display a message. Something like 'Please fill in questionnaire 1 and press [E...
Present blank screen, wait for key press -- how?
0
0
1
0
0
5,401
10,221,441
2012-04-19T03:55:00.000
2
0
1
0
0
python,function
0
10,221,621
0
2
0
false
0
0
In general import multiprocessing multiprocessing.__path__ multiprocessing.__file__ __path__ yields location of the library __file__ yields complete path of the file. If above didn't work, you need to look into python development source code. Regarding type source code, Raymond Hettinger's answer is correct.
1
2
0
0
I have used type() function in my program... I just want to know how does Python implement this? Or where could I find the source code file that implement this function?
source code of python inbuilt functions
0
0.197375
1
0
0
2,787
10,241,279
2012-04-20T06:27:00.000
0
0
1
1
0
python,emacs,interpreter
0
15,099,767
0
8
0
false
0
0
In emacs 24.2 there is python-switch-to-python
2
32
0
0
I just downloaded GNU emacs23.4, and I already have python3.2 installed in Windows7. I have been using Python IDLE to edit python files. The problem is that I can edit python files with Emacs but I do not know how to run python interpreter in Emacs. When i click on "switch to interpreter", then it says "Searching for p...
How do I run a python interpreter in Emacs?
1
0
1
0
0
37,056
10,241,279
2012-04-20T06:27:00.000
14
0
1
1
0
python,emacs,interpreter
0
20,375,113
0
8
0
false
0
0
C-c C-z can do this. It is the key-binding for the command python-switch-to-python
2
32
0
0
I just downloaded GNU emacs23.4, and I already have python3.2 installed in Windows7. I have been using Python IDLE to edit python files. The problem is that I can edit python files with Emacs but I do not know how to run python interpreter in Emacs. When i click on "switch to interpreter", then it says "Searching for p...
How do I run a python interpreter in Emacs?
1
1
1
0
0
37,056
10,249,121
2012-04-20T15:31:00.000
0
0
0
0
1
python
0
10,249,180
0
3
0
false
0
0
Get the functional module from pypi. It has a compose function to compose two callables. With that, you can chain functions together. Both that module, and functool provide a partial function, for partial-application. You can use the composed functions in a generator expression just like any other.
1
3
0
0
here is the problem: 1) suppose that I have some measure data (like 1Msample read from my electronics) and I need to process them by a processing chain. 2) this processing chain consists of different operations, which can be swapped/omitted/have different parameters. A typical example would be to take this data, first ...
how to implement 'daisychaining' of pluggable function in python?
0
0
1
0
0
987
10,249,240
2012-04-20T15:38:00.000
1
1
1
0
1
python,character-encoding
0
10,250,521
0
1
0
true
0
0
If it is None, simply output your data as utf-8, and document it. If it happens that there are use cases for other encodings, make that an option through the command line or other means.
1
2
0
0
I am trying to handle the different encodings in a Python script the more user-friendly and auto-magic way possible (there are APIs for utf8). It is a cross-platform console script. For printing to stdout I use sys.stdout.encoding and it seems to do the right thing almost always when printing to the console. However wh...
What should I do when sys.stdout.encoding is None?
0
1.2
1
0
0
643
10,252,304
2012-04-20T19:22:00.000
1
0
1
1
1
python,gcc,cygwin,pypy
0
10,252,762
0
3
0
false
0
0
Windows needs the ".exe" extension to know that it's executable. You'll need to modify the build to look for Windows and use the .exe extension.
1
2
0
0
I'm trying to compile PyPy on cygwin, and the compilation stops when python tries to open the file "externmod", which was just compiled with gcc. The problem with gcc on cygwin is that it automatically appends a '.exe' to whatever you're compiling, so even though gcc is called as gcc -shared -Wl,--enable-auto-image-ba...
Compiling PyPy on cygwin
0
0.066568
1
0
0
1,101
10,255,185
2012-04-21T00:44:00.000
2
0
0
0
0
python,excel,web-scraping
0
10,255,232
0
2
0
false
0
0
if you don't want to introduce a full excel library, you can write an HTML table or CSV and Excel will happily import those. The downside with this is that you're limited to one worksheet and no formulaes.
1
2
0
0
I would like to know how I would have a python web scrape dump all of it's results into excel. It's not that I don't know how to webscrape, it's just I do not know how to scrape into excel.
How to scrape in python into excel
0
0.197375
1
0
1
4,830
10,260,925
2012-04-21T16:36:00.000
2
0
0
1
1
python,celery
0
43,633,216
0
2
0
false
1
0
The way I deployed it is like this: clone your django project on a heroku instance (this will run the frontend) add RabitMQ as an add on and configure it clone your django project into another heroku instance (call it like worker) where you will run the celery tasks
2
58
0
0
I am new to celery.I know how to install and run one server but I need to distribute the task to multiple machines. My project uses celery to assign user requests passing to a web framework to different machines and then returns the result. I read the documentation but there it doesn't mention how to set up multiple ma...
How to set up celery workers on separate machines?
0
0.197375
1
0
0
26,305
10,260,925
2012-04-21T16:36:00.000
60
0
0
1
1
python,celery
0
10,261,277
0
2
0
true
1
0
My understanding is that your app will push requests into a queueing system (e.g. rabbitMQ) and then you can start any number of workers on different machines (with access to the same code as the app which submitted the task). They will pick out tasks from the message queue and then get to work on them. Once they're do...
2
58
0
0
I am new to celery.I know how to install and run one server but I need to distribute the task to multiple machines. My project uses celery to assign user requests passing to a web framework to different machines and then returns the result. I read the documentation but there it doesn't mention how to set up multiple ma...
How to set up celery workers on separate machines?
0
1.2
1
0
0
26,305
10,270,331
2012-04-22T17:35:00.000
-1
0
1
0
0
python,html,regex,markdown,markup
0
10,270,412
0
2
1
false
0
0
Regular expressions, of course! If still haven't done so, learn it. After you are done, you will find it hard to imagine how you got along without it. The samples you show are simple with regular expressions. For example, an asterisk, then a space then a word is expressed as: \*\s\w+ Nothing else but regular expression...
1
1
0
0
This question may have been asked in a different way, if so please point it to me. I just couldn't find it among my search results. I would like to parse text for mark-ups, like those here on SO. eg. * some string for bullet list eg. *some string* for italic text eg. &some string& for a URL eg. &some string&specifi...
What is the most efficient way to trace markups in a string?
0
-0.099668
1
0
0
102
10,284,847
2012-04-23T16:55:00.000
6
0
1
0
1
python,latex,matplotlib
0
44,506,534
0
4
0
false
0
0
Quick solutions plt.annotate("I am \n"+r"$\frac{1}{2}$"+"\n in latex math environment", xy=(0.5, 0.5))
1
24
0
0
I have a very basic question : how to do a line break with matplotlib in python with an "annotate" command. I tried "\" and "\n" but it does not work. And how to do this for a "Latex" annotation and for a normal text annotation ? Thank you very much.
Python : Matplotlib annotate line break (with and without latex)
0
1
1
0
0
40,716
10,295,384
2012-04-24T09:41:00.000
1
0
0
0
0
python,checkbox,tkinter,message
0
10,296,668
0
1
0
true
0
1
No, the standard dialogs don't support that. If you want such a feature you'll have to build your own dialog out of a Toplevel window and other widgets.
1
2
0
0
I'm creating message boxes in Tkinter using tkMessageBox.showwarning. Does Tkinter let you insert a sort of checkbox with the message that says, for example, "do not show again" so when selected the message won't appear the next time?
"do not show message again" checkbox in Tkinter warning message
0
1.2
1
0
0
410
10,298,104
2012-04-24T12:46:00.000
4
0
1
0
0
python,windows-installer,pywinauto
1
10,298,383
0
1
0
false
0
0
You need to launch "msiexec.exe" and pass the MSI as a command line parameter for it to be installed. You cannot launch directly an MSI as you would launch an EXE file. Example: msiexec.exe /i [MSI_path]
1
2
0
0
I am looking at using pywinauto in python to automate the installation of a Windows MSI installer for testing purposes. When I try to launch the MSI through the application.start I get the following error: "Error returned by CreateProcess: [Error 193] " Is it possible to even do this, or do I need to launch the MSI fir...
Using pywinauto to automate an MSI installer
1
0.664037
1
0
0
1,186
10,301,589
2012-04-24T15:58:00.000
4
0
1
0
0
python,list,dictionary,tuples
0
10,301,663
0
6
0
false
0
0
A dictionary value can't contain two tuples just by themselves. Each dictionary key maps to a single value, so the only way you can have two separate tuples associated with that key is for them to be themselves contained within a tuple or list: {'Key1':[(1.000,2.003,3.0029),(2.3232,13.5232,1325.123)]} - note the extra ...
1
4
0
0
I've been trying to figure out how to add multiple tuples that contain multiple values to to a single key in a dictionary. But with no success so far. I can add the values to a tuple or list, but I can't figure out how to add a tuple so that the key will now have 2 tuples containing values, as opposed to one tuple with...
How do you add multiple tuples(lists, whatever) to a single dictionary key without merging them?
0
0.132549
1
0
0
48,959
10,315,232
2012-04-25T12:05:00.000
0
1
0
1
1
python,linux,eclipse,pydev
0
10,343,117
0
1
0
true
1
0
I don't really think there's anything that can be done on the PyDev side... it seems @sys is resolved based on the kind of process you're running (not your system), so, if you use a 64 bit vm (I think) it should work... Other than that, you may have to provide the actual path instead of using @sys...
1
2
0
0
I'm working in a multiuser environment with the following setup: Linux 64bits environment (users can login in to different servers). Eclipse (IBM Eclipse RSA-RTE) 32bits. So Java VM, Eclipse and PyDev is 32bits. Python 3 interpreter is only available for 64bits at this moment. In the preferences for PyDev, I want to ...
Eclipse / PyDev overrides @sys, cannot find Python 64bits interpreter
0
1.2
1
0
0
321
10,315,257
2012-04-25T12:07:00.000
0
0
0
0
0
python,openerp
0
10,324,086
0
2
0
false
1
0
If your purpose is to debug, the simplest solution is to add print statements in your code and then run the server in a console.
1
1
0
0
In openerp, im working on a dummy function that (for example) returns the sum of a certain field on selected records. for instance, u select 3 invoices and it returns the sum of the quantity in the invoice lines. i think the function to perform the sum is correct, and even if it wasnt, i just need help in displaying th...
openerp echo the return result of a function
0
0
1
0
0
517
10,322,938
2012-04-25T20:05:00.000
3
0
1
0
0
python
0
10,322,992
0
4
0
true
0
0
If it's exactly that format, you could just print out line[3:7]
2
0
0
0
I have long a text file where each line looks something like /MM0001 (Table(12,)) or /MM0015 (Table(11,)). I want to keep only the four-digit number next to /MM. If it weren't for the "table(12,)" part I could just strip all the non-numeric characters, but I don't know how to extract the four-digit numbers only. Any ad...
Removing selected characters from text file
0
1.2
1
0
0
460
10,322,938
2012-04-25T20:05:00.000
2
0
1
0
0
python
0
10,322,983
0
4
0
false
0
0
You could parse text line by line and then use 4th to 7th char of every line. ln[3:7]
2
0
0
0
I have long a text file where each line looks something like /MM0001 (Table(12,)) or /MM0015 (Table(11,)). I want to keep only the four-digit number next to /MM. If it weren't for the "table(12,)" part I could just strip all the non-numeric characters, but I don't know how to extract the four-digit numbers only. Any ad...
Removing selected characters from text file
0
0.099668
1
0
0
460
10,325,418
2012-04-25T23:52:00.000
1
0
1
0
0
python,collision-detection,pygame
0
11,217,539
0
1
0
false
0
1
you could make it so that when your character hits a block, they move up at the current speed until they are no longer colliding with the polygon. That way, when you hit the ground from above,you don't go downward through it, but when you hit the bottom, you do. I would recommend a while loop set to the collide functio...
1
0
0
0
I am trying to implement a Mario type plat-former in pyGame. I have Collision detection working with Polygons no problem. I am curious how I can get the player to be able to jump through the floor above him, which is a polygon floating in air. What is the theory on how to handle that?
Jump Through Polygon/Floor Collision Detection
0
0.197375
1
0
0
228