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
9,337,866
2012-02-18T02:02:00.000
2
0
1
0
python,module,project,solution
9,337,879
2
false
0
0
There really isn't a single file in any package that consistently lists every module the entire package imports. Some people make entries to the __init__.py and some don't. Usually most python supported IDE's will make available to you whatever is on your pythonpath. Eclipse pydev, for instance, will add the specific p...
1
1
0
Is there a standard file in python which lists all the modules comprising the project, and other metadata? Is this simply the 'package'? Or, do different IDEs use their own specific files?
Python equivalent of a Visual-Studio project (or solution)
0.197375
0
0
755
9,337,917
2012-02-18T02:12:00.000
0
0
1
0
python,compilation,python-idle
23,854,924
2
false
0
0
You have to manually force save on A (CTRL+S) And then run B (this will prompt you to save B too) IF A has changed since last time it should recompile.
1
3
0
I can't seem to force IDLE to recompile code. Here's my simple design: class A and B, B imports A When I change A, then run B, IDLE doesn't seem to recompile A and run the old version of A. How can I fix this? :\
IDLE - recompile changed code
0
0
0
768
9,338,289
2012-02-18T03:35:00.000
0
0
1
0
python
9,338,332
2
false
0
0
Do pseudo code for defining all the possible outcomes, and conditional statements for saying what happens "if" one has one and the other has their choice. who wins? make function modules for each specific process that happens, which is basically just what i already said. at least that's how i would do it in C, I am ...
1
0
0
I am quite literally two weeks familiar with any programming whatsoever. I am currently enrolled in a class on Python. I have a programming assignment that requires me to write a program that simulates the game 'rock, paper, scissors'. It is supposed to be designed as a two player game that: 1: gets the first player's...
problems with rock paper scissors in python
0
0
0
442
9,338,948
2012-02-18T05:46:00.000
0
1
0
0
python,ruby,cookies,mechanize
11,950,195
1
false
0
0
I am working on the same issue (I want to get all cookies loaded on a page). I think it's impossible with mechanize. One reason is that it doesn't support javascript, so anything a little bit complex (such as a img loaded on a js event, which set a new cookie) will not work. I am considering other options as webkit :ht...
1
0
0
When I log into a page in my browser, I get 3 cookies: tips, ipb_member_id and ip_pass_hash. I need those last two to access some pages I can only see when logged in. When I log in via the browser it works fine, but under mechanize I only get the tips cookie. Are there any flags I have to set up for this to work, or is...
Ruby/Mechanize: Not getting all the cookies after logging into a page
0
0
0
362
9,339,169
2012-02-18T06:22:00.000
1
1
0
0
python,gps
9,343,253
2
false
0
0
Expanding on my comment, a Kalman filter is the usual choice for estimating position and velocity from noisy sensor readings. Here's what Wikipedia has to say on the topic (emphasis mine:) The Kalman filter is an algorithm, commonly used since the 1960s for improving vehicle navigation (among other applications, alt...
1
3
0
I'd like to know if there is any implemented python library for GPS trajectory pre-processing such as compression, smoothing, filtering, etc.
Python library for GPS trajectory pre-processing?
0.099668
0
0
2,133
9,339,220
2012-02-18T06:33:00.000
1
0
1
0
python
9,339,264
1
false
0
0
a) You need either a compiler, e.g. that bundled w/ MinGW, or b) a pre-compiled executable for your OS and (ideally) Python version. The latter might be tough to find, so if you go the former route it'll be roughly like this: Download and install MinGW Add c:\MinGW\bin to PATH environment variable (right-click My Com...
1
0
0
iam trying to install ReviewBoard on my windows system.i got this error error: Setup script exited with error: Unable to find vcvarsall.bat.please help
Unable to find vcvarsall.bat.error while installing ReviewBoard
0.197375
0
0
876
9,340,677
2012-02-18T11:15:00.000
1
0
0
0
python,neural-network,backpropagation,forecasting,pybrain
9,349,317
1
false
0
0
Try applying log() to the price-attribute - then scale all inputs and outputs to [-1..1] - of course, when you want to get the price from the network-output you'll have to reverse log() with exp()
1
1
1
I am currently trying to create a Neural Network with pybrain for stock price forecasting. Up to now I have only used Networks with a binary output. For those Networks sigmoid inner layers were sufficient but I don't think this would be the right approach for Forecasting a price. The problem is, that when I create such...
Pybrain: Completely linear network
0.197375
0
0
1,055
9,344,144
2012-02-18T18:54:00.000
6
0
1
1
python
9,344,292
3
true
0
0
As stated on python's manual: -i switch When a script is passed as first argument or the -c option is used, enter interactive mode after executing the script.
1
3
0
Is there a command line switch to carry out the script specified without terminating the process at the end? Windows' cmd.exe for example has the /K switch.
Run python script without terminating at the end
1.2
0
0
1,094
9,344,163
2012-02-18T18:57:00.000
4
0
1
0
python,pep8
9,344,207
2
false
0
0
Throw an exception, this is what they are there for. They allow the things using your code to manage the error, passing back strings provides too much opportunity for mishandling. Consider the case you return a string or an iterable normally, checking for an error message could cause problems, and may not catch them al...
1
12
0
I was wondering how you guys handle functions fails. Do you raise an exception, or do you return an error message? e.G. I have a function that is supposed to connect to an external com-object. If the com-object has not been initiated through another program, the connection cannot be established. What would be the prefe...
Function failed: Raise Exception, or return FALSE? What's the better approach?
0.379949
0
0
10,315
9,345,201
2012-02-18T23:35:00.000
5
1
1
0
python,c
9,345,227
2
false
0
0
Being a Python extension doesn't affect the execution speed of a piece of code, except insofar as the Python invoking it is slower than the equivalent C would be, and the compiler is less able to aggressively unroll and inline code which crosses the C/Python boundary. That is to say, if you just have Python code call a...
2
14
0
Python extension modules written in C are faster than the equivalent programs written in pure Python. How do these extension modules compare (speed wise) to programs written in pure C? Are programs written in pure C even faster than the equivalent Python extension module?
Speed of Python Extensions in C vs. C
0.462117
0
0
2,535
9,345,201
2012-02-18T23:35:00.000
15
1
1
0
python,c
9,345,231
2
true
0
0
How do these extension modules compare (speed wise) to programs written in pure C? They are slightly slower due to the translation between Python data structures -> C types. Disregarding this translation the actual C code runs at exactly the same speed as a regular C function would. Are programs written in pure C eve...
2
14
0
Python extension modules written in C are faster than the equivalent programs written in pure Python. How do these extension modules compare (speed wise) to programs written in pure C? Are programs written in pure C even faster than the equivalent Python extension module?
Speed of Python Extensions in C vs. C
1.2
0
0
2,535
9,345,307
2012-02-18T23:53:00.000
2
0
0
0
python,tkinter,pygame
9,345,389
5
true
0
1
This is a fairly trivial thing to do in Tkinter. A battleship game shows an array of coordinates which you can display as a grid of checkbuttons.
1
0
0
I am making a battleship game for a project. While I have completed the logic and the game works with text input. I was hoping make a (very basic) GUI while still use the methods created for the text. The two options I've been looking at are PyGame and Tkinter. PyGame does not seem to have a text output/label function....
Opinion on GUI for a Battleship game in Python
1.2
0
0
2,309
9,345,458
2012-02-18T17:43:00.000
2
0
1
0
python,lua
9,345,459
2
false
0
0
Will it stop working - that depends on how the program is being run. If the system has both versions installed and you ask to run against Python 2, then it'll continue to work. If you don't explicitly ask to run against a certain version, and it's not there, then it'll probably fail. Lua offers you no solutions here - ...
2
2
0
I'm working on my first Python-based program. I would like it to be as maintenance free in the future as possible and I was wondering if this could be a problem as Python is updated. I'm using 2.7.2 currently, but when 3 becomes standard what could happen to my program? Will it likely stop working on a system installed...
When Python is Updated Will I Have to Update My Program?
0.197375
0
0
86
9,345,458
2012-02-18T17:43:00.000
2
0
1
0
python,lua
9,345,487
2
false
0
0
It will take a very, very long time until Python2 will die. Python2 code will most likely require modifications to run with Python3 (there's the 2to3 tool to help with migrating though), but with all the libs out there which are for python2 it will take years until py2 dies - so you don't really have to care about it r...
2
2
0
I'm working on my first Python-based program. I would like it to be as maintenance free in the future as possible and I was wondering if this could be a problem as Python is updated. I'm using 2.7.2 currently, but when 3 becomes standard what could happen to my program? Will it likely stop working on a system installed...
When Python is Updated Will I Have to Update My Program?
0.197375
0
0
86
9,347,392
2012-02-19T07:01:00.000
0
0
1
0
python,unit-testing,testing,regression-testing
9,361,569
1
true
0
0
Here's the approach I'll probably use. Have Mercurial manage the code, the input files, and the regression test outputs. Start from a certain parent revision. Make and document (preferably as few as possible) modifications. Run regression tests. Review the differences with the parent revision regression test output. I...
1
1
0
I maintain a Python program that provides advice on certain topics. It does this by applying a complicated algorithm to the input data. The program code is regularly changed, both to resolve newly found bugs, and to modify the underlying algorithm. I want to use regression tests. Trouble is, there's no way to tell what...
Regression testing when "test oracle" is an informal output comparison
1.2
0
0
154
9,347,419
2012-02-19T07:07:00.000
1
0
1
0
python,strip
9,347,524
7
false
0
0
Often, depending on the way you read the lines, in order to get rid of \n from myline, you can take myline[:-1] since \n is the last character of myline. For the '\t' you can use replace() or strip()
2
112
0
This is my problem. I'm trying to read a text file and then convert the lines into floats. The text file has \n and \t in it though I don't know how to get rid of it. I tried using line.strip() but it didn't take it off and I got an error when I wanted to convert the stuff to floats. I then tried line.strip("\n") but t...
Python strip with \n
0.028564
0
0
575,477
9,347,419
2012-02-19T07:07:00.000
1
0
1
0
python,strip
9,347,611
7
false
0
0
If you're trying to convert lines of floats separated by tab characters, then just float(line) will try to convert the whole line into one float, which will fail if there's more than one. Using strip to get rid of leading and trailing whitespace isn't going to help that fundamental problem. Maybe you need to split each...
2
112
0
This is my problem. I'm trying to read a text file and then convert the lines into floats. The text file has \n and \t in it though I don't know how to get rid of it. I tried using line.strip() but it didn't take it off and I got an error when I wanted to convert the stuff to floats. I then tried line.strip("\n") but t...
Python strip with \n
0.028564
0
0
575,477
9,350,183
2012-02-19T14:46:00.000
0
0
0
0
java,c++,python,eclipse,wxpython
9,363,014
1
true
0
1
Regarding missing parameters on the constructor for wx.Button, unfortunately that's currently expected. Please create a bug report for PyDev specifying that.
1
1
0
How can I activate autocompletion feature for wx classes in pyDev? I cannot find anything to prompt me to change that will activate this feature from PyDev>Preference>Autocompletion. How can I get autocompletion from packages like wx and other third-party packages? Update: I added wx path in configuration to pyDev and ...
Autocompletion in Pydev- Eclipse for wxpython
1.2
0
0
324
9,350,430
2012-02-19T15:21:00.000
7
0
1
0
python,unicode
9,350,510
2
false
0
0
There is no difference after those strings have been parsed by the interpreter. One version simply puts the special characters, but it requires the source file to have a special encoding, such as UTF-8. The second version replaces those characters with their byte representation, so it's safe to have such strings in an ...
2
2
0
I've read a dozen pages but im still not getting it. Where is the difference between these versions: u'Georges Méliès' and u'Georges M\xe9li\xe8s' and how do convert one to the other and vice-versa?
u'Georges Méliès' vs u'Georges M\xe9li\xe8s'
1
0
0
139
9,350,430
2012-02-19T15:21:00.000
2
0
1
0
python,unicode
9,350,587
2
true
0
0
It's the same, and I would add: u'Georges Méliès'.encode('latin1') gives 'Georges M\xe9li\xe8s'
2
2
0
I've read a dozen pages but im still not getting it. Where is the difference between these versions: u'Georges Méliès' and u'Georges M\xe9li\xe8s' and how do convert one to the other and vice-versa?
u'Georges Méliès' vs u'Georges M\xe9li\xe8s'
1.2
0
0
139
9,350,571
2012-02-19T15:40:00.000
0
0
1
1
python,macos,package,packagemaker,mpkg
9,356,034
1
false
0
0
You don't need any scripts - you can do that with Package Manager alone - the Package Manager GUI allows you to tag packages as installable (enabled) and selected based on conditions such as OS version (in Choices under Requirements)
1
0
0
I am trying to create a .pkg installer for a python application (specifically Spyderlib). This is not an app but a python package and a command line executable that have to be copied to specific locations. However, the location depends on the version of OSX. I'm only targeting 10.6 and 10.7 but they come with different...
How to create a Mac .pkg from python which supports multiple versions of OSX
0
0
0
514
9,354,087
2012-02-19T22:52:00.000
3
0
1
0
python,functional-programming,memoization,object-persistence
9,354,305
2
false
0
0
One option would be to use marshal.dumps(function.func_code) It'll produce a string representation for the code of the function. That should handle changing implementations and anonymous functions.
1
5
0
I have written a little class to persistently memoize some expensive functions that do various statistical analyses of random networks. These are all pure functions; all the data is immutable. However, some of the functions take functions as arguments. Making keys based on these arguments is a small problem, since in ...
Python: strategies for persistently memoizing functions with function arguments?
0.291313
0
0
361
9,354,695
2012-02-20T00:15:00.000
0
0
0
0
android,python,client-server
9,354,732
2
false
0
1
As you have asserted: client is java only. On server: GUI for Windows : WPF ORM - Database without installation : SQLCE 4.0 - Maybe use codefirst GUI builder (RAD Tool) : Visual Studio lets you do that for WPF apps Ability to create easily REST Services : Use WCF hope that helps
1
0
0
I will start a project ( not commercial, just for learning ) but I would like to choose to work with the right tools as I would if I were doing it for a company. First of all small description of what I will need. It would be a server-client(s) application. For the server: - GUI for Windows - ORM - Database without in...
Right tools for GUI windows program
0
1
0
657
9,355,460
2012-02-20T02:25:00.000
1
0
0
0
python,nlp,nltk,text-processing
9,355,945
2
false
0
0
Well, WSD is an open problem (since it's language... and AI...), so currently each of those claims are in some sense valid. If you are engaged in a domain-specific project, I think you'd be best served by a statistical method (Support Vector Machines) if you can find a proper corpus. Personally, if you're using pytho...
1
0
1
What are the best algorithms for Word-Sense-Disambiguation I read a lot of posts, and each one proves in a research document that a specific algorithm is the best, this is very confusing. I just come up with 2 realizations 1-Lesk Algorithm is deprecated, 2-Adapted Lesk is good but not the best Please if anybody based o...
What are the best algorithms for Word-Sense-Disambiguation
0.099668
0
0
1,301
9,355,472
2012-02-20T02:26:00.000
2
0
1
0
python,parallel-processing,multiprocessing
9,355,626
2
false
0
0
It's definitely based on what the application does. If it's CPU-heavy, the number of cores is a sane starting point. If it's IO-heavy, mulitple processes won't help performance anyway. If it's mostly CPU with occasional IO (e.g. PNG optimisation), you can run a few processes more than the number of cores. The only way...
1
19
0
I'm just getting my feet wet with multiprocessing(and its totally awesome!), but I was wondering if there was any guidelines to selecting number of processes? Is it just based on number of cores on the server? Is it somehow based on the application your running(number of loops, how much cpu it uses,etc)? etc...how do ...
Are there any guidelines to follow when choosing number of processes with multiprocessing?
0.197375
0
0
5,306
9,355,779
2012-02-20T03:19:00.000
2
0
0
0
android,python,sl4a
9,356,229
1
true
1
1
You are talking about Client-Server to set the location of your client. You have to create one server which will be provide you a webservice to submit your data. You can you any web service like xmlrpc, soap ... to fulfill your needs. Python provide the module to develop this services. You have to use SL4A to develop ...
1
2
0
I am trying to write server code for my python computer and make the android phone a client. The client needs to be able to send its location as well as be able to get data from the server and should run in the background and start itself every 5 minutes or so and send location data to the server. The python side shoul...
Python Computer -to- Android Phone
1.2
0
0
604
9,355,952
2012-02-20T03:48:00.000
2
0
1
0
python,django,datetime,pattern-matching
9,356,001
2
true
1
0
It sounds like something that is fundamentally "business logic." For example, if the dates happen to all be Easter on consecutive years, do you expect that to be picked up? What about if they are all the last day of Hanukkah? This isn't likely to be something that's handled by a language or library directly--you'll ...
1
1
0
I've got a Django app that needs to take a list of multiple datetimes and print out a simple string that explains what the pattern is. Example: With 3 datetime instances for Monday, Wednesday, and Friday at 3pm, the simple output would be something like Monday, Wednesday, Friday at 3:00pm With 3 datetime instances of...
How to format multiple python datetime instances to a simple format?
1.2
0
0
169
9,356,053
2012-02-20T04:07:00.000
10
0
0
0
python,django
9,356,177
2
true
1
0
Run the server with --traceback option and set DEBUG=False in settings.py. You will get the traceback on console.
1
3
0
I got 500 errors in Django console but it doesn't print any information to the Console about the error. How can i print the detail to Console ?
How can i print unhandled exception to the Console instead of the Browser in Django?
1.2
0
0
408
9,356,926
2012-02-20T06:14:00.000
1
0
0
1
python,django,centos
9,357,006
3
false
1
0
Copy script to server test script manually on server set cron, "crontab -e" to a value that will test it soon once you've debugged issues set cron to the appropriate time.
1
1
0
I'm new to Python (relatively new to programing in general) and I have created a small python script that scrape some data off of a site once a week and stores it to a local database (I'm trying to do some statistical analysis on downloaded music). I've tested it on my Mac and would like to put it up onto my server (VP...
Deploying a Python Script on a Server (CentOS): Where to start?
0.066568
1
0
865
9,361,783
2012-02-20T13:17:00.000
1
0
1
0
python,strftime,strptime
9,361,942
1
true
0
0
The general principle is that you put required arguments before optional arguments (and indeed you can't put optional arguments before required arguments only if you were to use keyword arguments, which time.strftime and time.strptime don't support.) Since time.strftime(format) formats the current time, the optional ti...
1
1
0
In time.strftime(format[, t]) the first parameter is format and in time.strptime(string[, format]) it is second parameter. Why is that so? Sometimes i got confused and unintentionally used format as first parameter in time.strptime which raised an error.
Different order of parameters in strptime and strftime
1.2
0
0
500
9,361,891
2012-02-20T13:25:00.000
1
0
0
1
python,c,debugging,libusb
9,362,176
2
false
0
0
Enable core dumps (ulimit -Sc unlimited) and crash the program to produce a core file. Examine the core file with gdb to learn more about the conditions leading up to the crash. Inspect the functions and local variables on the call stack for clues. Or run the program under gdb to begin with and inspect the live proce...
1
0
0
complete Python noob here (and rusty in C). I am using a Mac with Lion OS. Trying to use NFCpy, which uses USBpy, which uses libUSB. libUSB is crashing due to a null pointer but I have no idea how to debug that since there are so many parts involved. Right now I am using xcode to view the code highlighted but I run eve...
Debug crashing C Library used in Python project
0.099668
0
0
617
9,363,363
2012-02-20T15:11:00.000
1
0
0
0
python,sql-server,html,websocket
10,478,720
3
false
0
0
Tornado is definitely a good choice for what you are doing. It supports web sockets with the latest version and it works fine with PyPy if you are concerned about performance. I already have a prototype MMO working with this set up and it works great. Also you can add new connection types later. So you could start with...
1
2
0
I want to write a server for a browser-based MMO game, which uses WebSocket for communication, SQL Server for database, and the language of choice for server is Python. What I would like to know is which libraries can provide Websocket and MMO support, and should I use Stackless or PyPy?
Writing browser-based MMO server in Python
0.066568
0
1
2,452
9,365,982
2012-02-20T17:56:00.000
20
0
0
0
python,machine-learning,scikit-learn,missing-data,scikits
17,582,671
7
false
0
0
I wish I could provide a simple example, but I have found that RandomForestRegressor does not handle NaN's gracefully. Performance gets steadily worse when adding features with increasing percentages of NaN's. Features that have "too many" NaN's are completely ignored, even when the nan's indicate very useful informati...
3
34
1
Is it possible to have missing values in scikit-learn ? How should they be represented? I couldn't find any documentation about that.
Missing values in scikits machine learning
1
0
0
39,190
9,365,982
2012-02-20T17:56:00.000
1
0
0
0
python,machine-learning,scikit-learn,missing-data,scikits
48,199,308
7
false
0
0
When you run into missing values on input features, the first order of business is not how to impute the missing. The most important question is WHY SHOULD you. Unless you have clear and definitive mind what the 'true' reality behind the data is, you may want to curtail urge to impute. This is not about technique or pa...
3
34
1
Is it possible to have missing values in scikit-learn ? How should they be represented? I couldn't find any documentation about that.
Missing values in scikits machine learning
0.028564
0
0
39,190
9,365,982
2012-02-20T17:56:00.000
11
0
0
0
python,machine-learning,scikit-learn,missing-data,scikits
18,020,591
7
false
0
0
I have come across very similar issue, when running the RandomForestRegressor on data. The presence of NA values were throwing out "nan" for predictions. From scrolling around several discussions, the Documentation by Breiman recommends two solutions for continuous and categorical data respectively. Calculate the Medi...
3
34
1
Is it possible to have missing values in scikit-learn ? How should they be represented? I couldn't find any documentation about that.
Missing values in scikits machine learning
1
0
0
39,190
9,366,212
2012-02-20T18:13:00.000
72
0
1
0
python,function,variables,python-3.x,global-variables
9,366,806
4
true
0
0
In the first case the global keyword is pointless, so that is not correct. Defining a variable on the module level makes it a global variable, you don't need the global keyword. The second example is correct usage. However, the most common usage for global variables are without using the global keyword anywhere. The g...
2
56
0
Which is the correct use of global variables in Python 3?: 1) Stating global VAR_NAME once in the core script (not within a function) and then simply referring to the variable as VAR_NAME everywhere else 2) Stating global VAR_NAME once within every function that uses the global variable and then simply referring to the...
Correct Use Of Global Variables In Python 3
1.2
0
0
82,175
9,366,212
2012-02-20T18:13:00.000
1
0
1
0
python,function,variables,python-3.x,global-variables
55,935,098
4
false
0
0
The main difference between the first two cases and the next two cases in the above answer would have to be the fact that the list is mutable. For cases like a = 1 a pointer points to the location where 1 is and when you say a = 2 the pointer shifts. For the case of mutable objects a memory location is allotted and w...
2
56
0
Which is the correct use of global variables in Python 3?: 1) Stating global VAR_NAME once in the core script (not within a function) and then simply referring to the variable as VAR_NAME everywhere else 2) Stating global VAR_NAME once within every function that uses the global variable and then simply referring to the...
Correct Use Of Global Variables In Python 3
0.049958
0
0
82,175
9,366,899
2012-02-20T19:06:00.000
0
1
0
0
php,python,sockets
9,367,348
1
false
0
0
Erm, sorry, you can't do WebSockets (at least not properly to my knowledge) without opening ports. You might be able to fake it with PHP, but the timeout would defeat it. I would recommend Comet AJAX/long-polling instead.
1
0
0
I want to ask you guys, how to make my php (or python) socket server to start when a client make request to a specific file and to stop, when client stops. Also, is there a way to make a php or python socket server not to open any ports (maybe to use port 80, which I think is possible, thanks to the request above). I'm...
html5 websockets OR flash sockets activated on load?
0
0
1
87
9,367,049
2012-02-20T19:16:00.000
1
1
0
1
python,google-app-engine,email,gmail,spam-prevention
9,374,887
1
false
1
0
My guess would be that the content of the mail looks "spammy" for Google, but you can do some things that might help you. I would suggest you, since this is a confirmation mail, add another admin for your app an email like: do-not-reply@domain.com and use that one for the confirmation emails. Add more text to the body...
1
3
0
We send email using appengine's python send_mail api. Is there any way to tell why an email that is sent to only one recipient would be marked as SPAM. This seems to only happen when appengine's python send_mail api sends to Gmail. In our case we are sending email as one of the administrators of our appengine applica...
AppEngine python send email api is marked as SPAM by Gmail email reader
0.197375
0
0
691
9,367,630
2012-02-20T20:01:00.000
0
1
0
0
python,numpy,scipy
9,367,777
1
false
0
0
There is no general solution for this problem. If you know the properties of the function it should be possible to deduce some bounds for the variables and then test all combinations. But that is not very efficient. You could approximate a solution with scipy.optimize.leastsq and then round the results to integers. The...
1
0
1
Does anybody know a python function (proven to work and having its description in internet) which able to make minimum search for a provided user function when argument is an array of integers? Something like scipy.optimize.fmin_l_bfgs_b scipy.optimize.leastsq but for integers
Optimizer/minimizer for integer argument
0
0
0
569
9,368,865
2012-02-20T21:43:00.000
14
1
1
0
encoding,utf-8,python-3.x,stringio
9,368,909
2
true
0
0
The class io.StringIO works with str objects in Python 3. That is, you can only read and write strings from a StringIO instance. There is no encoding -- you have to choose one if you want to encode the strings you got from StringIO in a bytes object, but strings themselves don't have an encoding. (Of course strings n...
1
13
0
I can't seem to find what's the default encoding for io.StringIO in Python3. Is it the locale as with stdio? How can I change it? With stdio, seems that just reopening with correct encoding works, but there's no such thing as reopening a StringIO.
io.StringIO encoding in python3
1.2
0
0
19,442
9,369,899
2012-02-20T23:17:00.000
2
0
1
0
python,windows
9,370,116
3
false
0
0
If I don't be wrong, I remember that for some processors family (AMD?) a division by zero cause a loop onto processor and that cause a system crash (onto win 95 and win 98). Maybe your professor was referring to that?
1
5
0
I was told by a professor that dividing by zero or taking a negative square root in Python crashes if you do it in Windows 98. This seems ridiculous since Python is an interpreted language, but I don't have a way to verify this, and Windows is notorious... Can anyone confirm or deny the claim? If so, does it have to do...
Does Dividing by Zero in Python Crash Windows 98, et al?
0.132549
0
0
417
9,370,343
2012-02-21T00:08:00.000
4
1
0
0
python,html,utf-8,iso-8859-1
9,370,450
2
false
1
0
It is better to use UTF-8. Note that "iso-8859-1" is a common mislabeling of "windows-1252", also known as "cp1252". Try being more explicit and see if this resolves your issues.
2
3
0
I am working on some programs in spanish, so I need to use accent marks. This is why I use # -*- coding: iso-8859-1 -*- and <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> on all my programs (python). I tested in chrome,firefox and safari and they all work puttin the accent marks. The only on...
ISO-8859-1 Not working on IE
0.379949
0
1
1,203
9,370,343
2012-02-21T00:08:00.000
2
1
0
0
python,html,utf-8,iso-8859-1
9,370,369
2
true
1
0
Yes, it is better to use UTF-8 instead. Your question really cannot be answered unless you also provide the bytes that you are sending.
2
3
0
I am working on some programs in spanish, so I need to use accent marks. This is why I use # -*- coding: iso-8859-1 -*- and <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> on all my programs (python). I tested in chrome,firefox and safari and they all work puttin the accent marks. The only on...
ISO-8859-1 Not working on IE
1.2
0
1
1,203
9,370,794
2012-02-21T01:11:00.000
0
0
0
0
python,wxpython,wxwidgets
13,944,075
2
false
0
1
Little late: but you can center a busyInfo window by specifying a parent. It will center on the parent, otherwise it will center on the screen.
2
1
0
Looking at the API there doesn't seem to be a way to center a wx.BusyInfo message to the center of the screen like with other pop up modals by using Center(). Is there a way to center wx.BusyInfo()?
How to center a wx.BusyInfo() - wxpython?
0
0
0
485
9,370,794
2012-02-21T01:11:00.000
1
0
0
0
python,wxpython,wxwidgets
9,374,668
2
true
0
1
not with wx.BusyInfo, as far as I know (although it should be already centered by default... have you tried not giving a parent window to the wx.BusyInfo?). Alternatively, you may want to try wx.lib.agw.PyBusyInfo instead: if it doesn't do exactly what you need, you can always hack it to suit your needs (it's pure Pyt...
2
1
0
Looking at the API there doesn't seem to be a way to center a wx.BusyInfo message to the center of the screen like with other pop up modals by using Center(). Is there a way to center wx.BusyInfo()?
How to center a wx.BusyInfo() - wxpython?
1.2
0
0
485
9,371,542
2012-02-21T03:02:00.000
1
1
0
0
python,emacs,highlight
9,371,607
3
false
0
0
I'm not sure if this is right, but try the following. 1) M-x 2) type in "python-mode". Tab completion works here so type in "pyth" and hit tab and you can see what your options are. mj
2
3
0
I am using emacs 23 -nw and xterm installed on Debian Squeeze. I need highlighting with python but I don't have it. How can I enable it? Edit: Thanks for all answers, the problem is that I have googled a lot, really. I have the code on a file with extension .py The script starts with #!/usr/bin/python, as one of the ...
Python highlighting in emacs
0.066568
0
0
4,284
9,371,542
2012-02-21T03:02:00.000
0
1
0
0
python,emacs,highlight
9,371,634
3
false
0
0
Emacs 23 should know about Python out of the box. Does the name of your Python file end with .py, or does the file have #!/usr/bin/env python as the first line? If you're creating a new file, make sure the filename ends with .py. You can also use M-x python-mode as mentioned in another answer. If none of that works, ch...
2
3
0
I am using emacs 23 -nw and xterm installed on Debian Squeeze. I need highlighting with python but I don't have it. How can I enable it? Edit: Thanks for all answers, the problem is that I have googled a lot, really. I have the code on a file with extension .py The script starts with #!/usr/bin/python, as one of the ...
Python highlighting in emacs
0
0
0
4,284
9,371,916
2012-02-21T03:49:00.000
0
0
0
0
python,winapi,pywin32
9,372,040
3
false
0
1
Tkinter has very little control over the behavior of the rest of the windows on the OS. There's no built-in cross-platform function for this.
2
4
0
A good example is MS OneNote. It has the option to be fixed to one side of the screen and pushes all other windows to the side. When maximizing or resizing other windows, they can only expand up to the edge of OneNote. Does Python have this capability using Tkinter or another module? Thank you for any assistance.
How can I set up a dedicated screen area for an application in Python?
0
0
0
528
9,371,916
2012-02-21T03:49:00.000
2
0
0
0
python,winapi,pywin32
9,375,993
3
true
0
1
The win32 feature you're looking for is called Application Desktop Toolbars - it allows your application to cooperate with the shell and reserve space along the side, similar to the taskbar. If you want to implement this yourself, you'll likely need to use Win32 somehow. It looks like there's a python wrapper for this,...
2
4
0
A good example is MS OneNote. It has the option to be fixed to one side of the screen and pushes all other windows to the side. When maximizing or resizing other windows, they can only expand up to the edge of OneNote. Does Python have this capability using Tkinter or another module? Thank you for any assistance.
How can I set up a dedicated screen area for an application in Python?
1.2
0
0
528
9,372,107
2012-02-21T04:17:00.000
0
0
0
0
python,user-interface,wxpython
9,397,106
1
true
0
1
The wxPython demo shows how to put checkboxes in it. The event you want is probably wx.grid.EVT_GRID_CELL_LEFT_CLICK, so when you click on the cell, you could check which cell you clicked on and react appropriately. Even if you can't use a custom cell renderer, you could create a little frame with the widget you need o...
1
0
0
I have created a grid wit n*n column with wxpython using wx.grid.Grid class. I want to use some of the cells of the grid as a drop-down list and some as buttons. How can widgets be implemented as a part of grid class in wxpython?
using cells in grid as buttons and drop-down list
1.2
0
0
710
9,372,188
2012-02-21T04:29:00.000
0
0
0
0
ruby,markdown,documentation-generation,python-sphinx,restructuredtext
37,973,198
3
false
1
0
Another couple of options would be to use Middleman which is a static site generator that accepts either Kramdown or Markdown as input. There are also frameworks that are designed specifically for technical documentation that use Middleman (both of which are on GitHub) including lord/slate and pnerger/dpslate (the la...
1
6
0
Ruby has a few good document generators like Yard, rDoc, even Glyph. The thing is that Sphinx does websites, PDF's, epub, LaTex...etc. It does all these things in restructuredtext. Is there an alternative to this in the Ruby world? Maybe a combination of programs? If I could use Markdown as well that would be eve...
Ruby equivalent of Sphinx documentation generator?
0
0
0
3,534
9,374,781
2012-02-21T09:10:00.000
0
0
1
1
python,terminal,cross-platform
9,374,829
3
false
0
0
Getting terminal size in a cross-platform and reliable way is far from trivial (see termcap, curses and such).
1
1
0
Some basic requirements and desires: Windows/Mac/Linux Run as "full screen" within the terminal window, resizes as needed. Network multi player (loose requirement, although definitely would like to) Basic sounds Would like to write in Python since I'm learning that. Distributable as a single package, as in no run time...
So I would like to start making my own terminal based game, is this feasible?
0
0
0
5,953
9,374,885
2012-02-21T09:17:00.000
8
0
0
0
python,numpy,scipy
9,375,030
1
true
0
0
random.choice is as far as I can tell part of python itself, not of numpy. Did you import random? Update: numpy 1.7 added a new function, numpy.random.choice. Obviously, you need numpy 1.7 for it. Update2: it seems that in unreleased numpy 2.0, this was temporarily called numpy.random.sample. It has been renamed back. ...
1
8
1
I've been working with numpy and needed the random.choice() function. Sadly, in version 2.0 it's not in the random or the random.mtrand.RandomState modules. Has it been excluded for a particular reason? There's nothing in the discussion or documentation about it! For info, I'm running Numpy 2.0 on python 2.7 on mac os....
Why has the numpy random.choice() function been discontinued?
1.2
0
0
6,270
9,375,637
2012-02-21T10:10:00.000
11
0
0
0
python,excel,xlwt
9,376,306
1
true
0
0
I got it working like this: currency_style = xlwt.XFStyle() currency_style.num_format_str = "[$$-409]#,##0.00;-[$$-409]#,##0.00" sheet.write(row+2, col, val, style=currency_style)
1
5
0
I have a column heading Fee. Using xlwt in python, I successfully generated the required excel.This column is always blank at the creation of Excel file. Is it possible to have the Fee column preformatted to 'Currency' and 'two decimal places', so that when I write manually in the Fee column of the Excel file after dow...
Preformat to currency and two decimal places in python using xlwt for excel
1.2
1
0
2,721
9,378,664
2012-02-21T13:46:00.000
1
0
0
0
python,browser,flask
9,378,819
2
false
1
0
You can force the contents to be a downloadable attachment using http headers. In PHP that would be: $fileName = 'dummy.jpg'; header("Content-Disposition: attachment; filename=$fileName"); Then, the script dumps the raw contents of the file.
1
4
0
I have a static folder that is managed by apache where images are stored. I wonder if it's possible by configuring apache to send all files from that folder as downloadable files, not opening them as images inside browser? I suppose I can do it by creating a special view in Flask, but I think it would be nicer if I cou...
Send image as an attachment in browser
0.099668
1
0
219
9,379,307
2012-02-21T14:31:00.000
7
0
0
0
python,django
9,379,383
1
true
1
0
Use virtualenv. Create a virtualenv, activate it, install what you need, then do pip freeze > requirements.txt to create a file listing all your requirements. Then on your new machine (also inside a virtualenv) you can do pip install -r requirements.txt to reinstall all those libraries.
1
1
0
I've been developing a Django app and in the process I installed a couple of component using pip (e.g. pip install django-ajax-selects). I just realized that those components aren't installed in my app directory but somewhere which is machine specific. First, how do I keep track of all the components I installed. Seco...
How to keep track of all the components used by my Django app
1.2
0
0
100
9,380,304
2012-02-21T15:34:00.000
3
0
1
0
python,performance,pipe,stdin
9,380,354
1
true
0
0
The pipe is managed by the operating system: One process writes to the pipe, the OS buffers what was written and passes it on to the reading process. If the buffer of the pipe is full, subsequent write operations of the writing process will simply block until there is enough space in the buffer again. So in short, th...
1
0
0
I have a following question: Consider flowing data through pipe to python script and processing it there line by line. The rate of lines of text going to the pipe is very fast (sys.stdin.readline ), and what if lines of text are coming too fast for script to handle, what happens then? Will stdin read lines in order or ...
python pipe (stdin) too fast
1.2
0
0
553
9,381,247
2012-02-21T16:29:00.000
0
1
0
0
python,git,github
9,381,435
1
false
0
0
Setup the project the way github describes. Create your ssh keys. Tar or Zip everything up. Distribute and Untar/Unzip. Done.
1
0
0
How would I go about setting up one github user and ssh key and then replicating that to several other laptops so they can all use the same account? It would be optimal if I could copy a configuration file so I wouldn't have to apply it one laptop at a time - I could apply it through server administration. This isn't a...
Multiple laptops with same github account and SSH key
0
0
0
189
9,381,772
2012-02-21T17:02:00.000
0
0
0
0
javascript,python,html,django
9,381,932
2
false
1
0
Well, presumably you are dealing with form posts whenever you want to access the option you refer to. You could either have your whole page be contained by a form, or use javascript to set a hidden field within your main form which is submitted. You can then access it as a raw property of the POST object, or bind a Fo...
1
2
0
I am using Django-Python for my project..I have created a "Master HTML page" and all other pages extends this master page.. There is a Drop down (Select Menu) in Master page..and i want to access the value of selected option across all Django Function and views.. How can i achieve that..??
How to make a variable accessible across all pages in HTML / Template (Django)..?
0
0
0
487
9,383,450
2012-02-21T18:58:00.000
2
0
0
0
python,django,deployment,heroku,environment
41,711,924
7
false
1
0
The most reliable way would be to set an environment variable as above. If that's not possible, there are a few signs you can look for in the filesystem, but they may not be / are not foolproof Heroku instances all have the path /app - the files and scripts that are running will be under this too, so you can check for...
1
42
0
I have a Django webapp, and I'd like to check if it's running on the Heroku stack (for conditional enabling of debugging, etc.) Is there any simple way to do this? An environment variable, perhaps? I know I can probably also do it the other way around - that is, have it detect if it's running on a developer machine, bu...
How can I detect Heroku's environment?
0.057081
0
0
13,817
9,383,740
2012-02-21T19:19:00.000
175
0
1
0
python,eval
9,384,005
10
false
0
0
eval() interprets a string as code. The reason why so many people have warned you about using this is because a user can use this as an option to run code on the computer. If you have eval(input()) and os imported, a person could type into input() os.system('rm -R *') which would delete all your files in your home dire...
4
331
0
In the book that I am reading on Python, it keeps using the code eval(input('blah')) I read the documentation, and I understand it, but I still do not see how it changes the input() function. What does it do? Can someone explain?
What does Python's eval() do?
1
0
0
488,578
9,383,740
2012-02-21T19:19:00.000
6
0
1
0
python,eval
31,014,206
10
false
0
0
eval(), as the name suggests, evaluates the passed argument. raw_input() is now input() in python 3.x versions. So the most commonly found example for the use of eval() is its use to provide the functionality that input() provided in 2.x version of python. raw_input returned the user-entered data as a string, while in...
4
331
0
In the book that I am reading on Python, it keeps using the code eval(input('blah')) I read the documentation, and I understand it, but I still do not see how it changes the input() function. What does it do? Can someone explain?
What does Python's eval() do?
1
0
0
488,578
9,383,740
2012-02-21T19:19:00.000
28
0
1
0
python,eval
9,383,771
10
false
0
0
In Python 2.x input(...) is equivalent to eval(raw_input(...)), in Python 3.x raw_input was renamed input, which I suspect lead to your confusion (you were probably looking at the documentation for input in Python 2.x). Additionally, eval(input(...)) would work fine in Python 3.x, but would raise a TypeError in Python ...
4
331
0
In the book that I am reading on Python, it keeps using the code eval(input('blah')) I read the documentation, and I understand it, but I still do not see how it changes the input() function. What does it do? Can someone explain?
What does Python's eval() do?
1
0
0
488,578
9,383,740
2012-02-21T19:19:00.000
6
0
1
0
python,eval
9,383,854
10
false
0
0
Maybe a misleading example of reading a line and interpreting it. Try eval(input()) and type "1+1" - this should print 2. Eval evaluates expressions.
4
331
0
In the book that I am reading on Python, it keeps using the code eval(input('blah')) I read the documentation, and I understand it, but I still do not see how it changes the input() function. What does it do? Can someone explain?
What does Python's eval() do?
1
0
0
488,578
9,384,021
2012-02-21T19:40:00.000
1
0
1
1
python,macos,crash,python-idle
21,723,895
5
false
0
0
I had the same issue. I run OSX 10.8.5, Python 3.3.3 and IDLE 3.3.3 and reinstalling Python haven't been a solution. I solved any problem removing the ~/.idlerc directory. My problem showed for the first time when I tried to change some Preferences (IDLE->Preferences->General->Startup Preferences->At Startup Open Edit ...
2
3
0
I recently attempted to install python 3.2 along with IDLE 3 on my macbook pro. I successfully installed python 3.2 (as in, I can run it from the terminal), but when I attempted to install IDLE 3.2 I must have done something wrong because now both IDLE 2.7 and IDLE 3.2 crash immediately upon opening with the message "P...
IDLE crash when opening on Mac OS X
0.039979
0
0
7,506
9,384,021
2012-02-21T19:40:00.000
0
0
1
1
python,macos,crash,python-idle
26,536,767
5
false
0
0
I had the same problem where IDLE would crash after I opened it on my MAC I ended up updating my computer to OS Yosemite. and the most updated version of python but it still would shut the reason it started was because I tried to change the preferences for certain keys. Resetting the preferences fixed it! I typed m...
2
3
0
I recently attempted to install python 3.2 along with IDLE 3 on my macbook pro. I successfully installed python 3.2 (as in, I can run it from the terminal), but when I attempted to install IDLE 3.2 I must have done something wrong because now both IDLE 2.7 and IDLE 3.2 crash immediately upon opening with the message "P...
IDLE crash when opening on Mac OS X
0
0
0
7,506
9,385,251
2012-02-21T21:12:00.000
0
0
0
0
python,c,database,daemon,opencl
9,497,466
1
false
0
1
Yes, C extensions can have internal structures allocated, but be sure to destroy your data properly when needed. You can also write your code as a C/C++ DLL and use the ctypes python extension to access C functions directly and pass them C variables (ints, char *, etc.).
1
0
0
I am working on a proof of concept for an in-memory database. I do know about stuff like redis and love things like intersecting sets but that is not enough. I want to find out how to implement a service which is like the parstream database or the drawntoscale solutions. And therefore I like to have a daemon which kee...
python c extension / opencl daemon
0
0
0
167
9,388,461
2012-02-22T02:52:00.000
3
0
1
0
python,xml,pickle
9,388,522
1
false
0
0
lxml is the fastest XML parser for Python. I would keep it in XML format unless size is an issue. Combine your XML files together if speed is an issue. Depending on your data, putting your information into an SQLite database might be a good choice as well.
1
1
0
I have hundreds of small (on the order of kilobytes) XML files whose information I need to use at run-time. All of the data in these XML files is useful to me, not just some. At runtime, as I hit the need for information from one of these I could construct an ElementTree, parse the XML file, and iterate over it recurs...
Python - Need to parse all the elements of a number of XML files. Fastest parser?
0.53705
0
1
227
9,389,138
2012-02-22T04:34:00.000
2
1
0
1
python,mod-wsgi,bottle
9,389,919
1
true
0
0
In mod_wsgi you can register atexit callbacks and they will be called on normal process shutdown. You don't have too long to do stuff though. If embedded mode, or daemon mode and shutdown caused by Apache restart, you have only 3 seconds as Apache will kill off processes forcibly after that. If daemon mode and trigger ...
1
1
0
Hi is there a way out to gracefully shutdown the bottle server. In a way it should be able to do few steps before it eventually stops. This is critical for some clean up of threads and db state etc avoiding the corrupt state during the restart. I am using mod wsgi apache module for running the bottle server.
Gracefull shutdown of bottle python server
1.2
0
0
758
9,389,381
2012-02-22T05:08:00.000
0
0
0
0
python,cx-oracle
21,155,146
2
false
0
0
With-out establishing a connection,. No you can never asking anything. It's like going to Google Page.(Internet Architecture - wether you call it sessionless or session based) As for Authentical, if no permission are set - Oracle uses a username 'nobody' as a user and thus gives every user a session. I am a user of Ora...
1
7
0
In order to demonstrate the security feature of Oracle one has to call OCIServerVersion() or OCIServerRelease() when the user session has not yet been established. While having the database parameter sec_return_server_release_banner = false. I am using Python cx_Oracle module for this, but I am not sure how to get the ...
python cx_oracle and server information
0
1
0
1,064
9,390,586
2012-02-22T07:15:00.000
0
0
0
0
python,plone,archetypes
9,405,455
1
false
1
0
Alternative 1: Use PloneFormGen, make a form with a button and an action adapter. The button is called "Apply". The action adapter has a python script that checks if user has already applied, if so redirects to edit view of existing item, if not calls invokeFactory on the Applications folder. You may want to hide the "...
1
0
0
Is it possible to access or navigate saved content items under the same folder during every content submission so that every content submitted must be verified to avoid submission of content that already exists? I have application content type where members can submit their applications but shouldn't accept application...
Plone: Query Archetype content items/objects inside a particular folder during content submission
0
0
0
153
9,391,963
2012-02-22T09:15:00.000
0
0
0
0
python,django
9,406,387
1
false
1
0
Looks like Django does not look inside zipped eggs. But you can make your own ZipFileFinder based on Django's FileFinder, I think it will not be very much to code.
1
0
0
I have several third party django apps downloaded from pip as python eggs. Some of them have zip-safe flag set so they are compressed. I've noticed that django collectstatic command can't find static files from compressed eggs. Is there any posibility to make django taking staticfiles out of zipped eggs?
Does django AppDirectoriesFinder looks in compressed files?
0
0
0
213
9,393,118
2012-02-22T10:32:00.000
0
0
1
0
python
9,393,202
3
false
0
0
Use that connection in the separate thread and join it using the desired timeout value.
1
1
0
when I use HTTPConnection under python 2.4,if the serve do not answer,the connection is keeped forever.How can i break it?
How to set the timeout on HTTPConnection under python 2.4
0
0
1
731
9,394,676
2012-02-22T12:25:00.000
0
0
1
0
python,import
9,394,920
6
false
0
0
There is no easy way to do a from foo import func_*, alas. You should import them all by name explicitly to make the code more cleaner and readable.
1
1
0
I have a bunch of functions defined in file foo.py, each of them has the name like func_xxx. I want import only those functions, not the other things in foo.py. How can I achieve that without list them all?
Python: how to import a bunch of similar names?
0
0
0
155
9,395,758
2012-02-22T13:29:00.000
0
0
1
0
python,arrays,memory,numpy,floating-point
62,791,902
3
false
0
0
I gauss, easily, we can compute by print(a.size // 1024 // 1024, a.dtype) it is similar to how much MB is uesd, however with the param dtype, float=8B, int8=1B ...
1
23
1
Does anybody know how much memory is used by a numpy ndarray? (with let's say 10,000,000 float elements).
How much memory is used by a numpy ndarray?
0
0
0
14,086
9,396,312
2012-02-22T14:02:00.000
1
0
1
0
python,python-imaging-library
9,396,440
3
false
0
0
The general algorithmn would be to find the color of the top left pixel, and then do a spiral scan inwards until you find a pixel not of that color. That will define one edge of your bounding box. Keep scanning until you hit one more of each edge.
1
6
0
Any ideas how to use Python with the PIL module to shrink select all? I know this can be achieved with Gimp. I'm trying to package my app as small as possible, a GIMP install is not an option for the EU. Say you have 2 images, one is 400x500, other is 200x100. They both are white with a 100x100 textblock somewhere ...
Use Python / PIL or similar to shrink whitespace
0.066568
0
0
4,161
9,397,234
2012-02-22T15:00:00.000
0
0
0
0
python,django,networking,intranet
9,399,359
2
true
0
0
You can get the client (computer connecting to your web server) IP address from the HttpRequest object. If your Django view is def MyView(request): you can get the IP from request.META.get('REMOTE_ADDR'). Is that what you're looking for?
1
2
0
How can we identify distinct computers/devices on an intranet? This is possible using cookies but that is not foolproof. I am expecting something on the lines of finding local ip address. It would be great if you mention some tools(libraries) required to integrate it with an intranet application. The application is de...
How to identify computers on intranet?
1.2
0
1
1,372
9,400,487
2012-02-22T18:09:00.000
0
0
0
0
python,selenium,selenium-chromedriver
31,517,267
2
false
0
0
Or you can try to move the mouse pointer to 0,0 coordinates. Because click event is not as reliable as the one in firefox.
2
2
0
I have a set of python Selenium tests that run on chromedriver, and I've found that certain tests will fail occasionally because chromedriver crashes. If chromedriver crashes during one of my tests it's almost always at the same spot in that test, but I've looked at the tests and there doesn't seem to be anything that...
Selenium chromedriver crashes on some test runs
0
0
1
2,525
9,400,487
2012-02-22T18:09:00.000
1
0
0
0
python,selenium,selenium-chromedriver
11,804,002
2
false
0
0
What often happens in chromedriver is that when an element is not in the visible region (for example if there vertical scroll bars and the web element is not in the region) the driver will throw Element not clickable error, which is essentially saying that the element you are trying to click is not currently visible to...
2
2
0
I have a set of python Selenium tests that run on chromedriver, and I've found that certain tests will fail occasionally because chromedriver crashes. If chromedriver crashes during one of my tests it's almost always at the same spot in that test, but I've looked at the tests and there doesn't seem to be anything that...
Selenium chromedriver crashes on some test runs
0.099668
0
1
2,525
9,403,699
2012-02-22T21:54:00.000
1
0
1
0
python,google-maps,travel-time
9,501,416
6
false
0
0
You can draw a circle around your current position and check for a road at an angle every X degrees. Another idea is to use a contour plot and isolines.
1
45
0
My question is very simple and can be understood in one line: Is there a way, tool, etc. using Google Maps to get an overlay of all surface which is below a certain time of travel? I hope the question is clear, but I coulnd't find anything related on the web. If you have any information, I'll take it! Here is what I me...
Map of all points below a certain time of travel?
0.033321
0
0
43,203
9,407,472
2012-02-23T05:03:00.000
0
1
0
1
python,macos,apache
9,407,550
2
false
0
0
Edit the shebang line in the CGI scripts to point to the other executable.
1
0
0
I have Apache running on OSX Lion and MacPorts Python and some packages installed with MacPorts. There are some Python cgi scripts that I'd like to run. It looks like Apache uses the Python that is installed with Lion. How can I configure Apache so that the cgi scripts are run with the MacPorts Python and sites-packag...
OSX and setting PATH for Apache
0
0
0
366
9,408,025
2012-02-23T06:07:00.000
0
0
1
1
python,python-stackless
9,408,074
2
false
0
0
It's likely not in your PYTHONPATH in that environment. Check to ensure the module is in your PYTHONPATH and that it is being set in the environment in which python launches. This is typically accomplished by adding the appropriate entry to your .bashrc or environment.plist.
1
1
0
I used pycharm and eclipse+pydev, and I also installed stackless python(2.7.1) for mac os x. when I try to import stackless, there always are tips which is "can't find such package/reference", but when I switch to IDLE/Client, "import stackless" is correct. I really don't know the reason, please help me. thanks a lot
Can not import stackless after stackless python installation
0
0
0
1,014
9,413,559
2012-02-23T12:58:00.000
1
0
1
0
python,python-2.7
9,413,623
2
false
1
0
Because there is an order in which Python searches for models. Amongst the paths Python looks for is your current directory (but not the directory above it). When you are inside your blimp folder there is no blimp.models, only a models. The solution is to always run your code from one directory up (e.g. python -m blimp...
1
0
0
I have a folder blimp with an __init__.py, models.py and views.py When I import from outside the folder I use from blimp.models import .. but inside folder it gives an import error unless I use from models import .. I was wondering why this is? Thanks
python 2.7 import a class from the same directory
0.099668
0
0
2,369
9,414,906
2012-02-23T14:25:00.000
0
0
0
1
python,process,window,pywin32
9,429,657
1
false
0
1
The usual way is to call EnumWindows with a callback and then get information about each hwnd - for example name, title or window class. Check that against what you are looking for and save the matched hwnd. After EnumWindows returns, check that you found a valid hwnd and use that for your program. It's not pleasant - ...
1
0
0
I'm kinda new to programming, and I wanna write a simple program that needs to OCR a particular window. Currently, I'm using (w.GetForegroundWindow()), but that gets me the current window which would always be the Python shell, since that is the one that is active when I run it, even if it is for a split second only. ...
What are the parameters for .GetWindow function in python?
0
0
0
815
9,419,327
2012-02-23T18:53:00.000
1
0
1
0
python,numpy,centos
9,419,462
4
true
0
0
Python searches the path in order, so simply put the directory where you installed your NumPy first in the path. You can check numpy.version.version to make sure you're getting the version you want.
1
1
1
I'm using a server where I don't have administrative rights and I need to use the latest version of numpy. The system administrator insists that he cannot update the global numpy to the latest version, so I have to install it locally. I can do that without trouble, but how do I make sure that "import numpy" results in...
have local numpy override global
1.2
0
0
1,857
9,421,345
2012-02-23T21:09:00.000
1
0
0
0
python,django
9,421,485
3
false
1
0
Create a profile model and link the user to this profile model. (via a foreign key) The profile model will then have different attributes for different behaviours. These different behaviours would then be exposed in the web application either by branching the template (as you say using if in the template) or returning ...
1
1
0
I have two types of users. After a user logs in, I take the user to their user profile at /profile Based on the type of user, their profile may contain different navigation items and forms. Is there an easier way to construct the navigation based on the user type instead of putting {% if %} tags everywhere in the templ...
Show different profile based on user type
0.066568
0
0
225
9,421,373
2012-02-23T21:11:00.000
1
1
1
0
python,deployment
9,421,431
5
false
0
0
Build a web application in python. Then the world can use it via a browser with zero install.
3
14
0
Is it possible to deploy python applications such that you don't release the source code and you don't have to be sure the customer has python installed? I'm thinking maybe there is some installation process that can run a python app from just the .pyc files and a shared library containing the interpreter or something ...
deploying python applications
0.039979
0
0
9,784
9,421,373
2012-02-23T21:11:00.000
19
1
1
0
python,deployment
9,421,511
5
true
0
0
You protect your source code legally, not technologically. Distributing py files really isn't a big deal. The only technological solution here is not to ship your program (which is really becoming more popular these days, as software is provided over the internet rather than fully installed locally more often.) If you ...
3
14
0
Is it possible to deploy python applications such that you don't release the source code and you don't have to be sure the customer has python installed? I'm thinking maybe there is some installation process that can run a python app from just the .pyc files and a shared library containing the interpreter or something ...
deploying python applications
1.2
0
0
9,784
9,421,373
2012-02-23T21:11:00.000
8
1
1
0
python,deployment
9,421,442
5
false
0
0
Yes, it is possible to make installation packages. Look for py2exe, cx_freeze and others. No, it is not possible to keep the source code completely safe. There are always ways to decompile. Original source code can trivially be obtained from .pyc files if someone wants to do it. Code obfuscation would make it more diff...
3
14
0
Is it possible to deploy python applications such that you don't release the source code and you don't have to be sure the customer has python installed? I'm thinking maybe there is some installation process that can run a python app from just the .pyc files and a shared library containing the interpreter or something ...
deploying python applications
1
0
0
9,784
9,423,127
2012-02-23T23:29:00.000
0
0
0
0
python,wxpython,wxwidgets
9,432,185
1
true
0
1
If you're talking about some kind of list box with strings in it, then you might want to look at the EditableListBox, which is in wx.gizmos.EditableListBox. See the wxPython demo for more info. Otherwise you'll have to roll your own, which really shouldn't be that hard.
1
0
0
I'm working on a program that outputs a text procedure file, based on user input. ie, the user will have a few options they can select from, and I'd like for them to be able to add them, reorder them, etc. into a custom order, and have it output that list into a text file. I'd like to write this in python, and I am fam...
Widget to add, remove, and sort entries in a wxpython program
1.2
0
0
189
9,423,620
2012-02-24T00:27:00.000
11
0
0
0
python,django,deployment,amazon-web-services
9,424,119
3
true
1
0
It depends on your configuration. We are using the following stack for our environment on Rackspace, but you can setup the same thing on AWS with EC2 instances. Ubuntu 11.04 Varnish (in memory cache) to avoid disk seeks NginX to server static content Apache to server dynamic content (MOD-WSGI) Python 2.7.2 with Django...
1
5
0
How should the project be deployed and run. There are loads of tools in this space. Which should be used and why? Supervisor Gunocorn Ngnix Fabric Boto Pip Virtualenv Load balancers
What is the best way to run a django project on aws?
1.2
0
0
2,360
9,424,873
2012-02-24T03:15:00.000
2
0
1
0
python,visual-studio-2010,ptvs
47,581,483
3
false
0
0
for future visitors from google. This doesn't involve Python settings, but to prevent the console window from closing automatically while using "Start without debugging" (Ctrl + F5). Try looking for this setting. Project -> "project name" Properties -> Configuration Properties -> Linker -> System Then look for the Sub...
3
8
0
I have installed Python Tools for Visual Studio and I cannot see the output in the console window like I see output when I run a C# console application within visual studio upon hitting the following Shortcut keys. F5 -- Starts debugging the program and closes the console window in c# and in Python Ctrl+F5 -- Start w...
Console windows closes right after I hit ctrl+F5 in visual studio tools for python
0.132549
0
0
5,880
9,424,873
2012-02-24T03:15:00.000
-1
0
1
0
python,visual-studio-2010,ptvs
50,195,348
3
false
0
0
UPDATE: Visual Studio 2017 - the items listed have moved :-( and I don't know where they moved to
3
8
0
I have installed Python Tools for Visual Studio and I cannot see the output in the console window like I see output when I run a C# console application within visual studio upon hitting the following Shortcut keys. F5 -- Starts debugging the program and closes the console window in c# and in Python Ctrl+F5 -- Start w...
Console windows closes right after I hit ctrl+F5 in visual studio tools for python
-0.066568
0
0
5,880
9,424,873
2012-02-24T03:15:00.000
8
0
1
0
python,visual-studio-2010,ptvs
9,834,430
3
true
0
0
There's an option in Tools->Options->Python Tools->Advanced under the Debugging section for "Wait for input when process exits abnormally" and "Wait for input when the process exits normally". I thought they were supposed to be on by default but enabling them should cause it to wait.
3
8
0
I have installed Python Tools for Visual Studio and I cannot see the output in the console window like I see output when I run a C# console application within visual studio upon hitting the following Shortcut keys. F5 -- Starts debugging the program and closes the console window in c# and in Python Ctrl+F5 -- Start w...
Console windows closes right after I hit ctrl+F5 in visual studio tools for python
1.2
0
0
5,880
9,426,045
2012-02-24T05:49:00.000
321
0
1
0
python,exit-code
9,426,054
5
true
0
0
0 and 1 are the exit codes. exit(0) means a clean exit without any errors / problems exit(1) means there was some issue / error / problem and that is why the program is exiting. This is not Python specific and is pretty common. A non-zero exit code is treated as an abnormal exit, and at times, the error code indicates ...
4
211
0
What's the difference between exit(0) and exit(1) in Python? I tried looking around but didn't find a specific question on these lines. If it's already been answered, a link would be sufficient.
Difference between exit(0) and exit(1) in Python
1.2
0
0
357,021
9,426,045
2012-02-24T05:49:00.000
16
0
1
0
python,exit-code
9,426,078
5
false
0
0
The standard convention for all C programs, including Python, is for exit(0) to indicate success, and exit(1) or any other non-zero value (in the range 1..255) to indicate failure. Any value outside the range 0..255 is treated modulo 256 (the exit status is stored in an 8-bit value). Sometimes, that will be treated a...
4
211
0
What's the difference between exit(0) and exit(1) in Python? I tried looking around but didn't find a specific question on these lines. If it's already been answered, a link would be sufficient.
Difference between exit(0) and exit(1) in Python
1
0
0
357,021
9,426,045
2012-02-24T05:49:00.000
7
0
1
0
python,exit-code
9,426,115
5
false
0
0
The number you pass to the exit() function is simply your program's return code, which is given to the operating system. From your program's point of view, there is no difference: execution will end in both cases, and the value supplied to the function will be given to the OS. But some tools and scripts take into accou...
4
211
0
What's the difference between exit(0) and exit(1) in Python? I tried looking around but didn't find a specific question on these lines. If it's already been answered, a link would be sufficient.
Difference between exit(0) and exit(1) in Python
1
0
0
357,021
9,426,045
2012-02-24T05:49:00.000
8
0
1
0
python,exit-code
33,705,695
5
false
0
0
exit(0): This causes the program to exit with a successful termination. exit(1): This causes the program to exit with a system-specific meaning. On many systems, exit(1) signals some sort of failure, however there is no guarantee. As I recall, the C standard only recognizes three standard exit values: EXIT_SUCCESS -- ...
4
211
0
What's the difference between exit(0) and exit(1) in Python? I tried looking around but didn't find a specific question on these lines. If it's already been answered, a link would be sufficient.
Difference between exit(0) and exit(1) in Python
1
0
0
357,021
9,429,436
2012-02-24T10:48:00.000
5
0
0
1
python,google-app-engine,backup,restore
13,692,611
4
false
1
0
Bet you've found a solution by now Yasser, but for anyone else ending up here from Google, here's an updated answer: The backup option in the appstore admin has been upgraded to support both datastore and cloud storage. It also uses mapreduce to do the backup, which makes the query much lighter on the system.
1
11
0
After working on several GAE apps, some of which are being used for production, I have come to the conclusion that on this platform, backing up your production data is slow enough and expensive enough for us to transition to some other cloud based technology stack. In one of our production apps, we have around a mill...
Google App Engine - prohibitively slow and expensive backup and restore?
0.244919
0
0
1,978