Q_Id
int64
337
49.3M
CreationDate
stringlengths
23
23
Users Score
int64
-42
1.15k
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
Tags
stringlengths
6
105
A_Id
int64
518
72.5M
AnswerCount
int64
1
64
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
6
11.6k
Available Count
int64
1
31
Q_Score
int64
0
6.79k
Data Science and Machine Learning
int64
0
1
Question
stringlengths
15
29k
Title
stringlengths
11
150
Score
float64
-1
1.2
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
8
6.81M
12,871,388
2012-10-13T08:30:00.000
0
1
1
0
java,python,testing,frameworks,automation
12,871,446
2
false
0
0
Normally Test Cases are used as classes rather than functions because each test case has own setup data and initialization mechanism. Implementing test cases as a single function will not only make difficult to set up test data before running any test case, but yes you can have different test method in a test case clas...
2
0
0
I am having a design problem in test automation:- Requirements - Need to test different servers (using unix console and not GUI) through automation framework. Tests which I'm going to run - Unit, System, Integration Question: While designing a test case, I am thinking that a Test Case should be a part of a test suite (...
How to write automated tests - Test case as a function or test case as a class
0
0
0
1,670
12,871,388
2012-10-13T08:30:00.000
0
1
1
0
java,python,testing,frameworks,automation
12,871,619
2
false
0
0
The following is my opinion: Pros of writing tests as functions: If you need any pre-requisites for that test case, just call another function which provides the pre-requisites. Do the same thing for teardown steps Looks simple for a new person in the team. Easy to undertstand what is happening by looking into tests a...
2
0
0
I am having a design problem in test automation:- Requirements - Need to test different servers (using unix console and not GUI) through automation framework. Tests which I'm going to run - Unit, System, Integration Question: While designing a test case, I am thinking that a Test Case should be a part of a test suite (...
How to write automated tests - Test case as a function or test case as a class
0
0
0
1,670
12,873,542
2012-10-13T13:26:00.000
3
0
1
1
python,python-idle
12,873,584
3
false
0
0
Indeed, the command to run a Python file should be run in the command prompt. Python should be in your path variable for it to work flexible. When the python folder is added to path you can call python everywhere in the command prompt, otherwise just in your python install folder. The following is from the python websi...
2
4
0
I have installed the Enthought Python distribution on my computer, but I don't have any idea how to use it. I have PyLab and IDLE but I want to run .py files by typing the following command: python fileName.py I don't know where to write this command: IDLE, PyLab or Python.exe or Windows command prompt. When I do thi...
How to run a Python project?
0.197375
0
0
41,336
12,873,542
2012-10-13T13:26:00.000
3
0
1
1
python,python-idle
12,873,556
3
true
0
0
Open a command prompt: Press ⊞ Win and R at the same time, then type in cmd and press ↵ Enter Navigate to the folder where you have the ".py" file (use cd .. to go one folder back or cd folderName to enter folderName) Then type in python filename.py
2
4
0
I have installed the Enthought Python distribution on my computer, but I don't have any idea how to use it. I have PyLab and IDLE but I want to run .py files by typing the following command: python fileName.py I don't know where to write this command: IDLE, PyLab or Python.exe or Windows command prompt. When I do thi...
How to run a Python project?
1.2
0
0
41,336
12,874,266
2012-10-13T14:55:00.000
0
0
0
0
python,kml,google-earth,collada
12,878,019
1
false
0
0
You can do this, you would probably do it by creating a KML NetworkLink file that loads a KMZ that contains a KML file that points to a .dae file that is collada. That can all be autogenerated from Python. There are libraries to generate it or you can roll your own. Just search generate collada python and you'll find s...
1
0
0
Hello from what i understand that using Python i can dynamically send kml data to Google earth client. i was wondering is this possible for collada files? i need it in combination to load models in Google earth. so far i can do it manually.
Dynamically generate collada files
0
0
1
356
12,874,406
2012-10-13T15:13:00.000
4
0
1
0
python,eof
12,874,442
4
false
0
0
Do you need to process the first number before the second is entered? If not, then int(s) for s in sys.stdin.read().split() would probably do, either as a list comprehension (in []) or generator expression (in (), for example as a function argument).
1
0
0
Is there a way to scan an unknown number of elements in Python (I mean scan numbers until the user writes at the standard input eof(end of file))?
How to scan an unknown number of numbers in Python?
0.197375
0
0
1,134
12,875,660
2012-10-13T18:18:00.000
0
0
1
1
python,c,cython,fuse
12,875,850
1
false
0
1
You should use it as a Python Fuse System, then you can write your cython stuff in it's own module and just import that module in your python code. Usually file system related operations are IO bound and not CPU bound so I'm not sure how much of a speedup you would get with cython, but I guess try out and compare the r...
1
0
0
I know FUSE has bindings for C, C++, Python etc. Which effectively means that I can develop FUSE filesystems using those languages. I wish to use Cython, as it offers much faster speeds as compared to pure Python. That is stressed in a filesystem. Is it possible to produce a FUSE filesystem by coding in Cython? As far ...
can I use FUSE with Cython bindings
0
0
0
173
12,876,159
2012-10-13T19:19:00.000
3
1
0
0
python,mod-python
12,876,548
1
true
1
0
I am not familiar with the mod_python (project was abandoned long ago) but nowadays Python applications are using wsgi (mod_wsgi or uwsgi). If you are using apache, mod_wsgi is easy to configure, for nginx use the uwsgi.
1
0
0
I've been testing out Mod_python and it seems that there are two ways of producing python code using:- Publisher Handler PSP Handler I've gotten both to work at the same time however, should I use one over the other? PSP resembles PHP a lot but Publisher seems to resemble python more. Is there an advantage over using...
Mod_Python: Publisher Handler vs PSP Handler
1.2
0
0
274
12,877,643
2012-10-13T22:36:00.000
1
0
0
0
python,sockets,client-server
12,877,653
2
false
0
0
There is generally speaking no problem with having even tens of thousands of sockets at once on even a very modest home server. Just make sure you do not create a new thread or process for each connection.
1
5
0
I'm writing a client-server app with Python. The idea is to have a main server and thousands of clients that will connect with it. The server will send randomly small files to the clients to be processed and clients must do the work and update its status to the server every minute. My problem with this is that for the ...
Handle multiple socket connections
0.099668
0
1
3,588
12,877,870
2012-10-13T23:18:00.000
1
0
0
1
python,linux,web
12,877,893
3
false
1
0
Note this is not a standard way. Imagine the websites out there had the ability to open Notepad or Minesweeper at their will when you visit or click something. The way it is done is, you need to have a service which is running on the client machine which can expose certain apis and trust the request from the web apps c...
1
1
0
I'm going to be using python to build a web-based asset management system to manage the production of short cg film. The app will be intranet-based running on a centos machine on the local network. I'm hoping you'll be able to browse through all the assets and shots and then open any of them in the appropriate program ...
How can a python web app open a program on the client machine?
0.066568
0
0
351
12,878,175
2012-10-14T00:09:00.000
0
1
0
0
python,ruby,unix,scripting,python-3.x
12,878,180
4
false
0
0
I don't think you need it in ruby ... an if doesn't require an else.
2
4
0
Python3 has a pass command that does nothing. This command is used in if-constructs because python requires the programmer to have at least one command for else. Does Ruby have an equivalent to python3's pass command?
Python3 Pass Command Equivalent in Ruby
0
0
0
1,225
12,878,175
2012-10-14T00:09:00.000
6
1
0
0
python,ruby,unix,scripting,python-3.x
12,878,394
4
false
0
0
Your statement is essentially wrong, since else statement is not obligatory in Python. One of the frequent uses of the pass statement is in try/ except construct, when exception may be ignored. pass is also useful when you define API - and wish to postpone actual implementation of classes/functions. EDIT: One more freq...
2
4
0
Python3 has a pass command that does nothing. This command is used in if-constructs because python requires the programmer to have at least one command for else. Does Ruby have an equivalent to python3's pass command?
Python3 Pass Command Equivalent in Ruby
1
0
0
1,225
12,878,631
2012-10-14T01:48:00.000
1
0
1
0
python
12,878,642
1
true
0
0
Sure. Values that are supposed to be treated as constants. There's no need to have each instance initialized with the values since they'll never change.
1
0
0
I read that it isn't advisable to create static methods/variables in web applications because all the threads will have to use the same method/variable. Is there any use case for them at all in this domain?
In a web application under potentially high load, what are the use cases for class variables and methods in python?
1.2
0
0
71
12,878,695
2012-10-14T02:02:00.000
2
0
0
0
python,wxpython
12,884,118
2
false
0
1
Really you have methods to place menu to position that you want: Append(menu, title) Add menu to the end of MenuBar (i.e. place it as most right element). title is a title of a new menu. If succed returns True, otherwise - False. Insert(pos, menu, title) Insert menu in pos position (after that GetMenu(pos)==menu wi...
1
0
0
Is it possible to control the position of elements in a wx.MenuBar()? I can't find it in the docs, but it seems like it should be an option. By default, menu elements, like file, view, edit, etc.. are at the left most position, and then each additional element extends to the right. I have a very simple gui, and thus on...
Is there a position the menu elements of a wx MenuBar?
0.197375
0
0
231
12,878,819
2012-10-14T02:30:00.000
2
1
0
0
python,pyramid
12,879,591
1
true
1
0
You should be able to check the request.content_length. WSGI does not support streaming the request body so content length must be specified. If you ever access request.body, request.params or request.POST it will read the content and save it to disk. The best way to handle this, however, is as close to the client as p...
1
1
0
Is there a way to check the size of the incoming POST in Pyramid, without saving the file to disk and using the os module?
Check size of HTTP POST without saving to disk
1.2
0
0
134
12,879,754
2012-10-14T06:11:00.000
1
0
0
0
python,youtube,gdata
12,892,498
1
false
1
0
YouTube will not provide this to you. They intentionally rate limit their feeds to prevent abuse.
1
0
0
I want to catch the 1 thousand most viewed youtube videos through gdata youtube api. However, only the first 84 are being returned. If I use the following query, only 34 records are returned (plus the first 50). Anyone knows what is wrong? "http://gdata.youtube.com/feeds/api/standardfeeds/most_popular?start-index=1" re...
Youtube GData 2 thousand most viewed
0.197375
0
1
164
12,880,380
2012-10-14T08:05:00.000
0
0
1
0
python,opengl,multiprocessing,pygame,pyinstaller
12,885,990
1
false
0
1
The [x] button fires for me, when event.type == pygame.QUIT on windows.
1
2
0
I wrote my program to spawn a process of the main application. When I run the pyinstaller packaged exe it says no Module name pygame.base. But if I keep the app in the main thread it doesn't do that. I need the process to detect closure, because GLUT doesn't have an event for the upper right hand exit button and I can...
No Module name pygame.base
0
0
0
751
12,881,834
2012-10-14T11:35:00.000
2
0
0
1
python,google-app-engine,google-apps-script
12,881,937
2
true
1
0
No you can't. AS and GAE are totally different things and won't work together. What you can really do is (abstract): write an AS that does what you need redirect from GAE to the AS url to make sure that the user logs-in/grants permissions. perform what you needed to do with AS send back the user to GAE with a bunch of...
1
1
0
I'm trying to work out if it is possible to use Google Apps Scripts inside Google App Engine? And if there is a tutorial in doing this out there ? Through reading Google's App Script site I get the feeling that you can only use app scripts inside Google Apps like Drive, Docs etc? What I would like to do is to be able...
Accessing Google Groups Services on Google Apps Script in Google App Engine?
1.2
0
0
221
12,882,679
2012-10-14T13:28:00.000
0
0
1
0
python
12,882,688
3
false
0
0
Without seeing your code, the error message seems to imply that at some point your function some_func(x) returns None. As the message states, you subtraction operation between None and the float is not possible in Python. Trace your function and make sure that it always returns a numeric value and that problem should n...
1
0
0
So I'm getting this error on a line where I have a recursive call. The line where the error occurred looks something like: return some_func(x) - .2 TypeError: unsupported operand type(s) for -: 'NoneType' and 'float' I tried return some_func(x) - .2 and x not None and float(x) is True, and other tricks but unsuccessful...
Return type error in python
0
0
0
272
12,889,477
2012-10-15T04:53:00.000
0
0
0
0
python,google-app-engine,google-cloud-datastore,security,voting
12,889,623
3
false
1
0
Have you tried set() variable type which avoid duplicate?
2
0
0
There are a few questions similar to this already but I am hoping for a somewhat different answer. I have a website on Google App Engine in Python and I let registered users vote on posts, either up or down, and I only want each user to be able to vote once. The primary method that I have thought of and read about is t...
More Efficient Way to Prevent Duplicate Voting
0
0
0
193
12,889,477
2012-10-15T04:53:00.000
0
0
0
0
python,google-app-engine,google-cloud-datastore,security,voting
12,895,187
3
false
1
0
If you only have hundreds of votes for hundreds of posts this is not a big data hog or read/write hog. I am assuming you are storing the list of users as a list in the post enity on the data store. Depending on if you are storing a long that points to the user or a string for their email you are probably at most usin...
2
0
0
There are a few questions similar to this already but I am hoping for a somewhat different answer. I have a website on Google App Engine in Python and I let registered users vote on posts, either up or down, and I only want each user to be able to vote once. The primary method that I have thought of and read about is t...
More Efficient Way to Prevent Duplicate Voting
0
0
0
193
12,890,137
2012-10-15T06:06:00.000
1
1
0
0
java,python,rmi,rpc,web2py
12,890,526
4
false
1
0
I'd be astonished if you could do it at all. Java RMI requires Java peers.
1
0
0
I have a remote method created via Python web2py. How do I test and invoke the method from Java? I was able to test if the method implements @service.xmlrpc but how do i test if the method implements @service.run?
Using Java RMI to invoke Python method
0.049958
0
1
2,053
12,890,897
2012-10-15T07:18:00.000
3
0
0
0
python,ruby,web-crawler
12,891,191
4
false
1
0
Between lxml and beautiful soup, lxml is more equivalent to nokogiri because it is based on libxml2 and it has xpath/css support. The equivalent of net/http is urllib2
1
2
0
I've started to learn python the past couple of days. I want to know the equivalent way of writing crawlers in python. so In ruby I use: nokogiri for crawling html and getting content through css tags Net::HTTP and Net::HTTP::Get.new(uri.request_uri).body for getting JSON data from a url what are equivalents of these...
Going from Ruby to Python : Crawlers
0.148885
0
1
5,706
12,892,263
2012-10-15T08:59:00.000
1
0
0
0
python,flash,wxpython
12,896,608
1
true
0
1
You can try the WebView widget that was mentioned or download the separate webkit port and try that (search the wxPython mailing list for a link to that). Otherwise, the only truly supported wxPython widget that does this is "ActiveX_FlashWindow" and I'm pretty sure that's Windows-only.
1
0
0
I'm considering creating a wxPython application that I'll deploy for Windows and OSX. I want to include Flash objects like YouTube embeds and Twitch.tv embeds in the application. Is that possible? Are there any resources out there that addresses the issue?
Can I create a cross-platform wxPython application that uses Flash embeds?
1.2
0
0
146
12,893,264
2012-10-15T09:57:00.000
1
0
0
0
python,firefox,authentication,selenium,form-submit
12,893,410
1
false
0
0
Using driver.get("https://username:password@somewebsite.com/") should directly log you in, without the popup being displayed, What about this did not work for you? EDIT I am not sure this will work but after driver.get("https://username:password@somewebsite.com/") Try accepting alert. For the alert - @driver.switch_t...
1
2
0
I want to access with Selenium (through) Python, a URL that demands authentication. When visit the URL, manually a new authentication window pops up, on which I need to fill in a username and password. Only after clicking on “OK” this window disappears and I return to the original site. As I want to visit this URL on a...
How to Submit Https authentication with Selenium in python
0.197375
0
1
3,449
12,895,653
2012-10-15T12:25:00.000
1
0
0
1
python,celery
12,898,127
1
true
0
0
A worker can't trigger signals after it has been killed. The best way would be to write a plugin for Nagios, Munin or similar to notify when the number of workers decrease. See the Monitoring and Management guide in the Celery documentation.
1
1
0
Where's the best place to get notified when celery workers die? I'm aware of the worker_shutdown signal but does it get called also in sudden death of workers? I have these pdf rendering workers and they suddenly died or at least became unresponsive to remote control commands so I'm looking for ways so I can get notifi...
Get notified when celery workers die
1.2
0
0
699
12,897,908
2012-10-15T14:35:00.000
2
1
0
0
eclipse,pydev,python-unittest
12,945,643
1
true
1
0
Output can be easily redirected to a file in Run Configurations > Common tab > Standard Input and Output section. Hiding just in plain sight...
1
2
0
Is there a built-in way in Eclipse to redirect PyUnit's output to a file (~ save the report)?
Redirecting PyUnit output to file in Eclipse
1.2
0
0
823
12,899,513
2012-10-15T16:02:00.000
5
0
0
0
python,opencv,windows-xp,py2exe
12,930,212
1
true
0
0
The problem comes from 4 dlls which are copyied by py2exe: msvfw32.dll msacm32.dll, avicap32.dll and avifil32.dll As I am building on Vista, I think that it forces the use of Vista dlls on Windows XP causing some mismatch when trying to load it. I removed these 4 dlls and everything seems to work ok (in this case it us...
1
1
1
I have a Python app built with Python, OpenCv and py2exe. When I distribute this app and try to run it on a windows XP machine, I have an error on startup due to error loading cv2.pyd (opencv python wrapper) I looked at cv2.pyd with dependency walker and noticed that some dlls are missing : ieshims.dll and wer.dll. Un...
Python: OpenCV can not be loaded on windows xp
1.2
0
0
941
12,900,023
2012-10-15T16:34:00.000
8
1
0
1
python,django,celery,django-celery,celery-task
12,900,160
3
false
1
0
I think you'll need to open two shells: one for executing tasks from the Python/Django shell, and one for running celery worker (python manage.py celery worker). And as the previous answer said, you can run tasks using apply() or apply_async() I've edited the answer so you're not using a deprecated command.
1
89
0
I'm using celery and django-celery. I have defined a periodic task that I'd like to test. Is it possible to run the periodic task from the shell manually so that I view the console output?
How can I run a celery periodic task from the shell manually?
1
0
0
60,194
12,901,776
2012-10-15T18:29:00.000
2
0
1
0
python,setuptools,distutils
12,902,659
3
false
0
0
Try the --install-dir option. You may also want to use --build-dir to change building dir.
2
24
0
Python has ability to "pseudoinstall" a package by running it's setup.py script with develop instead of install. This modifies python environment so package can be imported from it's current location (it's not copied into site-package directory). This allows to develop packages that are used by other packages: source c...
Python "setup.py develop": is it possible to create ".egg-info" folder not in source code folder?
0.132549
0
0
13,420
12,901,776
2012-10-15T18:29:00.000
4
0
1
0
python,setuptools,distutils
13,554,020
3
false
0
0
The good manner is to keep all source files inside special directory which name is your project name (programmers using other languages keep their code inside src directory). So if your setup.py file is inside myproject directory then you should keep the files at myproject/myproject. This method keeps your sources sepa...
2
24
0
Python has ability to "pseudoinstall" a package by running it's setup.py script with develop instead of install. This modifies python environment so package can be imported from it's current location (it's not copied into site-package directory). This allows to develop packages that are used by other packages: source c...
Python "setup.py develop": is it possible to create ".egg-info" folder not in source code folder?
0.26052
0
0
13,420
12,903,081
2012-10-15T19:59:00.000
1
0
1
0
python,python-3.x,python-2.7
12,903,111
3
false
0
0
Most people are still using 2.x, even Django (one of the most popular web frameworks for Python) doesn't fully support Python 3 yet. I would start with version 2.x. You'll have a lot less headaches when working with other libraries.
1
1
0
I'm not quite sure what the real differences are so I'm not able to decide which version is better for a beginner. I have a background about C, C++ and Java basically, i would like to start Python because i need it, this will look like a noob question but i really don't know which version i'm supposed to pick; for what...
Starting with Python 2.x or 3.x?
0.066568
0
0
871
12,904,326
2012-10-15T21:29:00.000
3
0
0
0
python,amazon-s3,boto
12,907,767
2
false
1
0
There are two ways to implement the search... Case 1. As suggested by john - you can specify the prefix of the s3 key file in your list method. that will return you result of S3 key files which starts with the given prefix. Case 2. If you want to search the S3 key which are end with specific suffix or we can say extens...
1
2
0
I have 10000 files in a s3 bucket.When I list all the files it takes 10 minutes. I want to implement a search module using BOTO (Python interface to AWS) which searches files based on user input. Is there a way I can search specific files with less time?
Search files(key) in s3 bucket takes longer time
0.291313
1
1
5,534
12,904,413
2012-10-15T21:36:00.000
1
0
0
0
python,google-app-engine,geolocation,geocoding,gae-search
13,315,721
1
false
1
0
I don't know of any examples that show geo specifically, but the process is very much the same. You can index documents containing GeoFields, each of which has a latitude and a longitude. Then, when you construct your query, you can: limit the results by distance from a fixed point by using a query like distance(my_ge...
1
2
0
I have been going through trying to find the best option on Google App Engine to search a Model by GPS coordinates. There seem to be a few decent options out there such as GeoModel (which is out of date) but the new Search API seems to be the most current and gives a good bit of functionality. This of course comes at...
Google App Engine Search API Performing Location Based Searches
0.197375
0
0
498
12,904,560
2012-10-15T21:49:00.000
-2
0
0
0
python,django,security,encryption,credentials
12,904,783
3
false
1
0
Maybe you can rely on a multi-user scheme, by creating : A user running Django (e.g. django) who does not have the permission to access the credentials A user having those permissions (e.g. sync). Both of them can be in the django group, to allow them to access the app. After that, make a script (a Django command, su...
1
12
0
I'm working on a python/django app which, among other things, syncs data to a variety of other services, including samba shares, ssh(scp) servers, Google apps, and others. As such, it needs to store the credentials to access these services. Storing them as unencrypted fields would be, I presume, a Bad Idea, as an SQL i...
Safely storing encrypted credentials in django
-0.132549
0
0
6,457
12,905,707
2012-10-16T00:02:00.000
-3
0
1
0
python,types,numbers,compare
12,905,719
6
false
0
0
47.36/1.6*2 return integer. So 47.36/1.6*2 would be 18, which is not equal to 18.5. Edit Sorry about that, actually it is being stored as 18.499999. You should do this import numpy as np print np.around((47.36/1.6**2), decimals=1) == 18.5 This would return True.
2
1
0
I found this interesting question when I was doing homework we know, 47.36/1.6**2 == 18.5 but when I try to run the following code, it gives me a False(should be true) print 47.36/1.6**2 == 18.5 Do anyone know what's going on?
Simple Basic Python compare
-0.099668
0
0
120
12,905,707
2012-10-16T00:02:00.000
1
0
1
0
python,types,numbers,compare
12,905,783
6
false
0
0
I would avoid checking for exact equality when comparing two floats. Instead take the difference and see if it is smaller than a value you consider close to zero. (47.36/1.6**2 - 18.5) < 0.00000000001 will be True
2
1
0
I found this interesting question when I was doing homework we know, 47.36/1.6**2 == 18.5 but when I try to run the following code, it gives me a False(should be true) print 47.36/1.6**2 == 18.5 Do anyone know what's going on?
Simple Basic Python compare
0.033321
0
0
120
12,906,249
2012-10-16T01:15:00.000
6
0
1
0
python,clr,visual-studio-2012,ironpython
13,183,325
3
false
0
1
I got the same error and resolved it with these steps: I changed the project properties General>Interpreter to IronPython 2.7 Debug>Launch mode to IronPython(.NET) launcher At first I didn't see IronPython as an interpreter option to select from. I added the path to IronPython installation to my Path System variable, r...
1
5
0
i'm using IronPython and i want to create some windows form, i want to create a windows form with some button, and i want to do this in visual studio with iron python, i'm using visual studio 2012 integrated edition, each time i create an "ironpython windows form" project, when i want to run it, it says: The project ...
Cpython interpretter / IronPython interpretter No module named clr
1
0
0
4,656
12,908,271
2012-10-16T05:44:00.000
0
0
0
0
python,skype4py
15,720,075
1
false
0
0
Looking at the docs, each chat message has a body (the text of the message) and a IsEditable property. So long as IsEditable=True you should be able to do m.Body = "some new text"
1
0
0
As the title says, I'm curious if the functionality of editing a sent chat message can be replicated programatically using the Skype4Py api. I'm not sure when Skype added this feature, and the API, as far as I know, hasn't been maintained in some years, so I was just curious. I don't see anything that looks like it wo...
Is it possible to edit a previously sent chat message using the Skype4Py api?
0
0
1
667
12,909,334
2012-10-16T07:14:00.000
-1
1
0
1
python
66,757,126
2
false
0
0
I used the same script, but my host failed to respond. My host is in different network. WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
1
2
0
I am writing a python script to copy python(say ABC.py) files from one directory to another directory with the same folder name(say ABC) as script name excluding .py. In the local system it works fine and copying the files from one directory to others by creating the same name folder. But actually I want copy these fi...
How to Transfer Files from Client to Server Computer by using python script?
-0.099668
0
1
9,452
12,911,327
2012-10-16T09:16:00.000
1
0
0
1
python,python-3.x
12,911,826
3
false
0
0
The docs mention a default method, which you can override to handle any unknown command. Code it to prefix scan a list of commands and invoke them as you suggest for do_alias.
1
10
0
How can I create an alias for a command in a line-oriented command interpreter implemented using the cmd module? To create a command, I must implement the do_cmd method. But I have commands with long names (like constraint) and I want to provide aliases (in fact, shortcuts) for these commands (like co). How can I do th...
Aliases for commands with Python cmd module
0.066568
0
0
3,225
12,913,250
2012-10-16T11:01:00.000
3
1
0
0
c++,python,parsing
12,913,328
1
false
0
0
Using regular parser-generators to generate parsers from the grammar is usually complicated with Python (for example due to its significant whitespace and difficult line-continuation rules). I am not sure about your experience with Python, but my recommendation would be to parse the Python file from Python, and do as m...
1
0
0
I can find a load of information on the reverse, not so much this way around :) So, the summary is that I want to write some Python code-completion stuff in C++, but I can't figure out the best way of tokenizing the Python code. Are there any libraries out there that will do this? I'm leaning towards calling Python's ...
Parsing Python code from C++
0.53705
0
0
210
12,919,644
2012-10-16T16:50:00.000
1
1
0
1
c++,python,embedded
12,919,968
2
false
0
0
doubt you can do this you are using a uart interface...just get an arduino or someat and send serial commands to the arduino (serial pins) which then puts the correct pwm signal out its pins ... probably 5 lines of arduino code and another 5 of python code ... all that said you may be able to find some very difficult a...
1
4
0
How to to send out a pwm signal from the serial port with linux? (With python or c++) I want to connect a motor directly to change the speed rotation.
PWM signal out of serial port with linux
0.099668
0
0
1,468
12,921,120
2012-10-16T18:28:00.000
1
0
0
1
python,google-app-engine
12,921,291
2
true
1
0
If can disable an entire application (from Application Settings page) for sometime and then reenable it (or you can delete it from that point onwards). There is no way you can "shutdown" a particular instance. You can have different version of your application, but at any moment in time, you can only have only one inst...
2
0
0
In user interface of Google App Engine, in "Instances" I can shutdown selected instances by press button "Shutdown". Can I do shutdown by program from source code?
GAE: Instance shutdown from source code
1.2
0
0
144
12,921,120
2012-10-16T18:28:00.000
0
0
0
1
python,google-app-engine
12,944,920
2
false
1
0
Actually you can force an instance to shutdown within your code, but it's not pretty. Just allocate more memory than you instance has, it will be then shutdown for you. I have used this technique in some python2.5 M/S apps where a DeadlineExceeded during startup could cause problems with incomplete imports. If the nex...
2
0
0
In user interface of Google App Engine, in "Instances" I can shutdown selected instances by press button "Shutdown". Can I do shutdown by program from source code?
GAE: Instance shutdown from source code
0
0
0
144
12,923,402
2012-10-16T21:04:00.000
1
0
0
0
python,django,timezone
12,923,424
2
true
1
0
generally, the server is setup to run as UTC, which has no daylight saving time, etc, and each user's settings contains their preferred timezone. Then you do the time difference calculation. You DB might have that feature.
1
0
0
I am building a application where the clients are supposed to pass a datetime field to query the database. But the client will be in different timezones, so how to solve that problem. Should I make it a point that the client's timezone is used as deafult for each user or the server for every user. And if so than how c...
Timezone for server
1.2
0
0
115
12,925,147
2012-10-16T23:50:00.000
3
0
0
0
python,tar,compression
12,925,291
1
true
0
0
No, the argument to getmember is the key inside the tar file, not a local file system path. Use the slashes.
1
3
0
I have a tar.gz file, and I want to extract a certain directory but not the whole thing, so I use TarFile.getmember('foo/bar'). what I want to know is if I really should be using TarFile.getmember(os.path.join('foo','bar')). edit: I'm also wondering if I would use os.path.join for any other function within the tarfile ...
(python) do I use os.path.join on tar.gz files
1.2
0
0
355
12,926,898
2012-10-17T03:58:00.000
62
0
0
0
python,numpy
12,926,989
2
true
0
0
You can do this with the return_index parameter: >>> import numpy as np >>> a = [4,2,1,3,1,2,3,4] >>> np.unique(a) array([1, 2, 3, 4]) >>> indexes = np.unique(a, return_index=True)[1] >>> [a[index] for index in sorted(indexes)] [4, 2, 1, 3]
1
36
1
How can I use numpy unique without sorting the result but just in the order they appear in the sequence? Something like this? a = [4,2,1,3,1,2,3,4] np.unique(a) = [4,2,1,3] rather than np.unique(a) = [1,2,3,4] Use naive solution should be fine to write a simple function. But as I need to do this multiple times, are the...
numpy unique without sort
1.2
0
0
32,836
12,929,592
2012-10-17T07:51:00.000
3
0
1
0
python
12,929,674
3
false
0
0
You can modify your PATH environment variable to get python3 picked up first, or create an alias that'll give you a command for running python3. To modify your PATH edit your shell configuration file (e.g., ~/.bashrc if you are using BASH) PATH=/usr/local/python3.2.3/bin:$PATH To create an alias to python3 do (in the s...
3
1
0
I just start learning Python in my company, I usually type python ext.py to run a script. The default Python version is 2.4. But now I need to run a new script in Python 3. The company's IT support installed Python 3 in /usr/local/python3.2.3/bin/python3, but when I type python -V to check version, it still shows Pyth...
How to run a script with a different version of Python
0.197375
0
0
164
12,929,592
2012-10-17T07:51:00.000
1
0
1
0
python
12,929,608
3
true
0
0
/usr/local/python3.2.3/bin/python3 -V /usr/local/python3.2.3/bin/python3 ext.py
3
1
0
I just start learning Python in my company, I usually type python ext.py to run a script. The default Python version is 2.4. But now I need to run a new script in Python 3. The company's IT support installed Python 3 in /usr/local/python3.2.3/bin/python3, but when I type python -V to check version, it still shows Pyth...
How to run a script with a different version of Python
1.2
0
0
164
12,929,592
2012-10-17T07:51:00.000
0
0
1
0
python
12,930,020
3
false
0
0
As py2 and 3 have so many differences, usually Python 3 will be started with python3 instead of a mere python.
3
1
0
I just start learning Python in my company, I usually type python ext.py to run a script. The default Python version is 2.4. But now I need to run a new script in Python 3. The company's IT support installed Python 3 in /usr/local/python3.2.3/bin/python3, but when I type python -V to check version, it still shows Pyth...
How to run a script with a different version of Python
0
0
0
164
12,931,338
2012-10-17T09:35:00.000
1
0
0
0
django,testing,python-sphinx
14,034,222
1
true
1
0
Turned out that I had some python paths wrong. Everything works as expected - as noted by bmu in his comment. (I'm writing this answer so I can close the question in a normal way)
1
1
0
I have a Django project with a couple of apps - all of them with 100% coverage unit tests. And now I started documenting the whole thing in a new directory using ReST and Sphinx. I create the html files using the normal approach: make html. Since there are a couple of code snippets in these ReST files, I want to make s...
Sphinx code validation for Django projects
1.2
0
0
148
12,932,610
2012-10-17T10:46:00.000
5
0
1
1
python
12,932,872
1
true
0
0
Python is implemented in C, and records what version of the C compiler was used to compile it (to aid tracking down compiler-specific bugs). The implementation itself does not vary based on the compiler. It can vary based on the platform it is compiled for, and the available external libraries, but there is nothing alt...
1
1
0
If I start python under MacOS X 10.8 in the console it starts with "Python 2.7.2 (default, Jun 20 2012, 16:23:33) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin". In what way does the implementation of python depend on GCC?
CPython and GCC
1.2
0
0
295
12,932,663
2012-10-17T10:49:00.000
0
1
0
0
javascript,python,c,serialization,natural-sort
12,933,456
3
false
0
0
The obvious answer is to remove the restriction that you can't use the native database type. I can't see any point in it. It's still 8 bytes and it does the ordering for you without any further investigation, work, experiment, testing etc being necessary.
1
3
0
The project I'm working on requires me to store javascript numbers(which are doubles) as BLOB primary keys in a database table(can't use the database native float data type). So basically I need to serialize numbers to a byte array in such a way that: 1 - The length of the byte array is 8(which is what is normally need...
How to efficiently serialize 64-bit floats so that the byte arrays preserve natural numeric order?
0
0
0
797
12,934,495
2012-10-17T12:38:00.000
1
0
0
0
python,wireshark,libpcap
12,941,372
1
false
0
0
What needs to be updated is libpcap, not the wrapper. Libpcap 1.1.0 and later can transparently read pcap-ng files, as long as the pcap-ng files don't have more than one link-layer header type (for example, a pcap-ng file with two LINKTYPE_ETHERNET interfaces would be readable, but a pcap-ng file with a LINKTYPE_ETHER...
1
2
0
Have any of the existing libpcap wrappers for python been updated to read the pcap-ng format generated by Wireshark 1.8.x? I tried several of them with no success. Maybe I'm missing something, like config options or new APIs. If this hasn't been done yet or is incomplete, I'm willing to help with the work. Thanks, all.
Python libpcap wrapper that understands pcap-ng format?
0.197375
0
0
1,267
12,936,533
2012-10-17T14:23:00.000
2
0
0
0
python,selenium,webdriver,urllib2,tcp-ip
12,940,958
3
false
0
0
In as much as a small amount of plastic explosive solves the problem of forgetting your house keys, I implemented a solution. I created a class that tracks a list of resources and the time they were added to it, blocks when a limit is reached, and removes entries when their timestamp passes beyond a timeout value. I ...
1
2
0
I'm working on a suite of tests using selenium webdriver (written in Python). The page being tested contains a form that changes its displayed fields based upon what value is selected in one of its select boxes. This select box has about 250 options. I have a test (running via nose, though that's probably irrelevant...
tcp/ip port exhaustion with selenium webdriver
0.132549
0
1
2,907
12,937,916
2012-10-17T15:33:00.000
0
0
1
1
python,windows,py2app
72,331,122
2
false
0
0
No, There's no way on earth you can run py2app on windows,py2app cannot create a Mac app bundle in windows because it's impossible to do so... Either hackintosh your pc or emulate a mac using QEMU,VMware or VirtualBox!
1
10
0
I recently discovered that an outdated version of Python was causing my Wx app to run into errors. I can't install Python 2.7.3 on my Mac, and when I tried it in a virtual machine, py2app was still "compiling" the app after running overnight (my Windows/Linux box has an ≈1GHz processor). Is there a version of py2app th...
Can I run py2app on Windows?
0
0
0
5,722
12,938,568
2012-10-17T16:07:00.000
1
0
0
0
python,pdf,pagination,matplotlib
12,938,704
3
false
0
0
I suspect that there is a more elegant way to do this, but one option is to use tempfiles or StringIO to avoid making traditional files on the system and then you can piece those together.
1
12
1
I have a lengthy plot, composed o several horizontal subplots organized into a column. When I call fig.savefig('what.pdf'), the resulting output file shows all the plots crammed onto a single page. Question: is there a way to tell savefig to save on any number (possibly automatically determined) of pdf pages? I'd rathe...
Matplotlib savefig into different pages of a PDF
0.066568
0
0
16,939
12,939,379
2012-10-17T16:53:00.000
1
0
0
0
python,mouse,pygame
12,940,103
2
false
0
1
The MOUSEBUTTONDOWN event has two attributes: pos button If you use event.pos instead of mouse.get_pos() you should be able to pick up the coordinates where the click occurred even if you have more than one mouse.
1
0
0
I'm trying to make a simple piano keyboard for my programming class. I've made it in pygame because it's nice and simple to use. I've managed to get it working by making a mouse rect and individual rects for each note on the piano and having the note play by linking it to a mousebuttondown event. So it's working pretty...
Multiple mouse position
0.099668
0
0
880
12,940,223
2012-10-17T17:45:00.000
2
1
0
0
python,bash,shell
12,940,327
1
false
0
0
If the server supports if-modified-since, you could send the request with If-Modified-Since: (T-30 minutes) and ignore the 304 responses.
1
0
0
I am trying to download only files modified in the last 30 minutes from a URL. Can you please guide me how to proceed with this. Please let me know if I should use shell scripting or python scripting for this.
Download files modified in last 30 minutes from a URL
0.379949
0
1
170
12,942,806
2012-10-17T20:26:00.000
8
0
1
0
python,linux,file,unix,words
12,942,907
3
false
0
0
You'll have to do 2 passes through the file: In pass 1: Build a dictionary using the words as keys and their occurrences as values (i.e. each time you read a word, add 1 to its value in the dictionary) Then pre-process the list to remove all keys with a value greater than 1. This is now your "blacklist" In pass 2: ...
1
1
0
Given a very large text file, I want to remove all the words which occur only once in the file. Is there any easy and efficient way of doing it? Best regards,
Remove rare words from a very large file
1
0
0
1,939
12,943,846
2012-10-17T21:40:00.000
4
0
0
0
python,django,git
12,944,156
1
true
1
0
The way I work: Each website has it's own git repo and each app has it's own repo. Each website also has it's own virtualenv and requirements.txt. Even though 2 websites may share the most recent version of MyApp right now, they may not in the future (maybe you haven't gotten one of the websites up to date on some API ...
1
0
0
I'm currently developing several websites on Django, which requiere several Django Apps. Lets say I have two Django projects: web1 and web2 (the websites, each has a git repo). Both web1 and web2 have a different list of installed apps, but happen to both use one (or more) application(s) developed by me, say "MyApp" (a...
Git, Django and pluggable applications
1.2
0
0
154
12,945,278
2012-10-18T00:04:00.000
2
1
0
0
java,python,optimization,webserver,multiplayer
12,946,896
3
false
0
0
Anything else? Maybe a cup of coffee to go with your question :-) Answering your question from the ground up would require several books worth of text with topics ranging from basic TCP/IP networking to scalable architectures, but I'll try to give you some direction nevertheless. Questions: Listen on ports or use sock...
2
2
0
Basically I want a Java, Python, or C++ script running on a server, listening for player instances to: join, call, bet, fold, draw cards, etc and also have a timeout for when players leave or get disconnected. Basically I want each of these actions to be a small request, so that players could either be processes on sa...
Multiplayer card game on server using RPC
0.132549
0
1
2,321
12,945,278
2012-10-18T00:04:00.000
1
1
0
0
java,python,optimization,webserver,multiplayer
12,963,229
3
false
0
0
Honestly, I'd start with classic LAMP. Take a stock Apache server, and a mysql database, and put your Python scripts in the cgi-bin directory. The fact that they're sending and receiving JSON instead of HTTP doesn't make much difference. This is obviously not going to be the most flexible or scalable solution, of cours...
2
2
0
Basically I want a Java, Python, or C++ script running on a server, listening for player instances to: join, call, bet, fold, draw cards, etc and also have a timeout for when players leave or get disconnected. Basically I want each of these actions to be a small request, so that players could either be processes on sa...
Multiplayer card game on server using RPC
0.066568
0
1
2,321
12,946,708
2012-10-18T03:38:00.000
2
0
0
1
python,django,linux,apache2
12,947,246
1
true
1
0
If you use the subprocess module to execute the script, the close_fds argument to the Popen constructor will probably do what you want: If close_fds is true, all file descriptors except 0, 1 and 2 will be closed before the child process is executed. Assuming they weren't simply closed, the first three file descriptor...
1
5
0
I am trying to fork() and exec() a new python script process from within a Django app that is running in apache2/WSGI Python. The new python process is daemonized so that it doesn't hold any association to apache2, but I know the HTTP ports are still open. The new process kills apache2, but as a result the new python...
Close TCP port 80 and 443 after forking in Django
1.2
0
0
256
12,949,634
2012-10-18T07:48:00.000
0
0
1
0
python,regex,routing,tornado
12,950,281
2
true
1
0
What about this: r'/admin/?' or r'/admin/{0,1}? Pay attention that I'm only talking about regex, don't know if this would work in Django.
1
1
0
i currently have this in my routing: (r"/admin", AdminController.Index ), (r"/admin/", AdminController.Index ), how do i merge them with just one line and have admin and admin/ go to AdminController.Index? i know this could be achieved via regex, but it doesnt seem to work
Regex routing in Python using Tornado framework
1.2
0
0
1,761
12,953,040
2012-10-18T10:57:00.000
2
0
1
1
python,ipython
15,759,634
1
true
0
0
Just now I have a try with ipython on my mac, auto-complete works well when dealing with space-contained directory. The ipython version I used is 0.13.1. Perhaps simple upgrade your ipython can solve.
1
4
0
I am running iPython v0.13 on windows 7 64-bit. (qtconsole --pylab=inline) When I type %cd 'C:/Users/My Name/Downloads' it takes me to the desired location. When I tab auto-complete between directories the auto-complete fails if directories have a space in their names (as in the example). Is there a reason for this and...
iPython filepath autocompletion
1.2
0
0
910
12,953,542
2012-10-18T11:26:00.000
5
0
0
0
python,simplehttpserver,webdev.webserver
25,786,569
3
false
1
0
The right way to do this, to ensure that the query parameters remain as they should, is to make sure you do a request to the filename directly instead of letting SimpleHTTPServer redirect to your index.html For example http://localhost:8000/?param1=1 does a redirect (301) and changes the url to http://localhost:8000/?p...
1
13
0
I like to use Python's SimpleHTTPServer for local development of all kinds of web applications which require loading resources via Ajax calls etc. When I use query strings in my URLs, the server always redirects to the same URL with a slash appended. For example /folder/?id=1 redirects to /folder/?id=1/ using a HTTP 30...
Why does SimpleHTTPServer redirect to ?querystring/ when I request ?querystring?
0.321513
0
1
6,427
12,956,582
2012-10-18T14:06:00.000
0
0
0
1
python,google-app-engine,google-cloud-datastore
12,958,199
2
false
1
0
You can use UrlFetch in App2 to request all the data you need from App1 and proces it to create your merged result. It is quite easy to serve and serialize the entities (with a cursor) using JSON for the data exchange in App1.
1
1
0
I have 2 different apps that are basically identical but I had to setup a 2nd app because of GAE billing issues. I want to merge the datastore data from the 1st app with the 2nd apps data store. By merge, I simply want to append the 2 data stores. To help w/visualise App1: SomeModel AnotherModel App2: SomeModel Ano...
Merge (append) GAE datastores from different apps
0
0
0
52
12,960,212
2012-10-18T17:19:00.000
2
0
0
0
python,django,apache,wsgi,django-wsgi
12,960,567
2
false
1
0
I'd go for the Apache configuration + run a proxy in front + restrict in WSGI : I dislike Apache for communicating with web clients when dynamic content generation is involved. Because of it's execution model, a slow or disconnected client can tie up the Apache process. If you have a proxy in front ( i prefer nginx,...
1
3
0
What is the simplest way to make Django /admin/ urls accessible to localhost only? Options I have thought of: Seperate the admin site out of the project (somehow) and run as a different virtual host (in Apache2) Use a proxy in front of the hosting (Apache2) web server Restrict the URL in Apache within WSGI somehow. I...
How do I make Django admin URLs accessible to localhost only?
0.197375
0
0
2,696
12,960,276
2012-10-18T17:23:00.000
0
1
0
1
python,redirect,subprocess
12,960,474
3
false
0
0
You can use existing file descriptors as the stdout/stderr arguments to subprocess.Popen. This should be exquivalent to running from with redirection from bash. That redirection is implemented with fdup(2) after fork and the output should never touch your program. You can probably also pass fopen('/dev/null') as a file...
2
0
0
To begin with, I am only allowed to use python 2.4.4 I need to write a process controller in python which launches and various subprocesses monitors how they affect the environment. Each of these subprocesses are themselves python scripts. When executed from the unix shell, the command lines look something like this:...
Preserving bash redirection in a python subprocess
0
0
0
1,449
12,960,276
2012-10-18T17:23:00.000
0
1
0
1
python,redirect,subprocess
12,961,812
3
false
0
0
The subprocess module is good. You can also do this on *ix with os.fork() and a periodic os.wait() with a WNOHANG.
2
0
0
To begin with, I am only allowed to use python 2.4.4 I need to write a process controller in python which launches and various subprocesses monitors how they affect the environment. Each of these subprocesses are themselves python scripts. When executed from the unix shell, the command lines look something like this:...
Preserving bash redirection in a python subprocess
0
0
0
1,449
12,960,535
2012-10-18T17:42:00.000
1
0
1
0
python,audio,join,split
17,218,449
2
false
0
0
If you prefer to make a solution yourself, you can also glue MP3 files together. They're composed by just a sequence of frames, so if you copy byte-by-byte each file to an unique file, it should work well. For the audio extraction, if you can rely on an external programme, you can use FFmpeg, and the -t and -tt options...
2
0
0
If I have several audio files in a directory, how would I go about writing a script that would take the audio from the time 10 seconds to 20 seconds from each file and concatenate these 10 second chunks together into a single audio file? Any specific packages, extensions, etc. which would be helpful? (I would prefer an...
Python - How to split and join audio?
0.099668
0
0
731
12,960,535
2012-10-18T17:42:00.000
1
0
1
0
python,audio,join,split
12,960,848
2
true
0
0
I've used mp3wrap from a bash script to catenate mp3's. The mp3wrap package includes an mp3splt executable. It's not Python, but you could subprocess them from Python. They appear to be written in C, based on a quick ldd.
2
0
0
If I have several audio files in a directory, how would I go about writing a script that would take the audio from the time 10 seconds to 20 seconds from each file and concatenate these 10 second chunks together into a single audio file? Any specific packages, extensions, etc. which would be helpful? (I would prefer an...
Python - How to split and join audio?
1.2
0
0
731
12,960,907
2012-10-18T18:04:00.000
-1
0
1
0
python,dictionary
12,960,956
4
false
0
0
Yes, it's possible. Iterate through every key in the dictionary and set the related value to 1.
1
12
0
Is it possible to replace all values in a dictionary, regardless of value, with the integer 1? Thank you!
Python: Replace All Values in a Dictionary
-0.049958
0
0
34,084
12,964,666
2012-10-18T22:21:00.000
0
0
0
1
python,google-nativeclient
13,452,816
2
true
0
0
I got a solution- not a direct one, though. managed to use a program to redirect the HTTPS traffic through the HTTP proxy. I used the program called "proxifier". Works great.
1
1
0
For the last few days I have been trying ti install the Native Client SDK for chrome in Windows and/or Ubuntu. I'm behind a corporate network, and the only internet access is through an HTTP proxy with authentication involved. When I run "naclsdk update" in Ubuntu, it shows "urlopen error Tunnel connection failed: 407...
Installing Chrome Native Client SDK
1.2
0
1
1,326
12,964,736
2012-10-18T22:28:00.000
1
0
1
0
python
12,988,142
2
true
0
0
I'm posting this answer on behalf of an "Anonymous user" (presumably the OP who had not logged in properly?!) who had written this as an edit to the question (edit got rejected because it should have been posted as an answer -- which is what I'm doing now). EDIT 3 (and answer): Done. It turned out that win32com.clien...
2
0
0
I understand the question might well be too vague, but just in case anyone seen this or can have any clues. I have an application which works just fine under python 2.5.1. But when running it on Python 2.5.4, it starts giving "NoneType is not callable". I have checked changelogs between the versions, but there are quit...
Python 2.5.4 throws 'NoneType is not callable' whereas 2.5.1 works fine
1.2
0
0
162
12,964,736
2012-10-18T22:28:00.000
1
0
1
0
python
12,964,845
2
false
0
0
The place to start digging is your app. The error message is telling you some variable is None when you think it should point to an object. So, find that variable (the error message should tell you exactly where it is), then figure out why that varianle contains None. There's a good chance your code is either silently...
2
0
0
I understand the question might well be too vague, but just in case anyone seen this or can have any clues. I have an application which works just fine under python 2.5.1. But when running it on Python 2.5.4, it starts giving "NoneType is not callable". I have checked changelogs between the versions, but there are quit...
Python 2.5.4 throws 'NoneType is not callable' whereas 2.5.1 works fine
0.099668
0
0
162
12,966,573
2012-10-19T02:34:00.000
2
0
0
0
python,ruby,session-state,web.py
12,966,697
1
false
1
0
Usually a session cookie is used to keep track of the session between client (in your case your Python web.py part) and server (in this case the Ruby server). Make sure you save the the session cookie when in your Python part when making the first request to the Ruby service. When making a second request simple send th...
1
1
0
I have an app running on python web.py. For a couple of data items, I contact a ruby service. I was wondering if I could, in some way, keep track of the session in ruby as well. Every time the python calls the ruby service, it treats it as a different session. Any help? Thanks! PS - This might not be trivial and I migh...
Session variables on Ruby when called through a Python web service
0.379949
0
0
95
12,968,446
2012-10-19T06:20:00.000
1
0
0
0
python,image,filter,numpy,scipy
13,009,064
2
false
0
0
Even if python did provide functionality to apply an operation to an NxM array without looping over it, the operation would still not be executed simultaneously in the background since the amount of instructions a CPU can handle per cycle is limited and thus no time could be saved. For your use case this might even be ...
1
0
1
I want to apply a 3x3 or larger image filter (gaussian or median) on a 2-d array. Though there are several ways for doing that such as scipy.ndimage.gaussian_filter or applying a loop, I want to know if there is a way to apply a 3x3 or larger filter on each pixel of a mxn array simultaneously, because it would save a l...
Python: Perform an operation on each pixel of a 2-d array simultaneously
0.099668
0
0
854
12,969,188
2012-10-19T07:15:00.000
3
0
1
0
python,hex
12,969,264
4
false
0
0
Why do you think that hex(0) should return 0x00? 0x0 is semantically correct and is the shortest representation of the hexadecimal 0. Consider this: when you write decimal zero, it is 0 not 00. Or e.g. 0x9 == 00009 == 9. And the latter is the natural non-redundant decimal representation of the number 9.
1
1
0
I'm using hex(int('00000000', 2)) to convert a binary string into hex. It works fine for all (output) values from 10 to FF, but its not padding 00 to 09 properly, and I'm seeing 0x0 to 0x9 instead of the 0x00 to 0x09 that I am expecting. What am I doing wrong?
Invalid hex values
0.148885
0
0
2,059
12,970,909
2012-10-19T09:08:00.000
1
0
1
0
python,python-2.7
12,972,735
4
false
0
0
All this libraries are automatically installed with python may there should be a problem at installation time you can try this sudo apt-get update i am not sure for this. If this does not solve your issue the better way is completely uninstall python and reinstall it.
3
0
0
I have a system that has installed Python 2.7, but not the standard libraries like minidom, etc. I guess it is a broken install. How can I fix that and install separately the standard libraries for that Python?
How can I install the standard libraries for a Python that doesn't have them?
0.049958
0
0
1,632
12,970,909
2012-10-19T09:08:00.000
1
0
1
0
python,python-2.7
12,971,177
4
false
0
0
(As it is standard library, it should have been shipped with python, thus no need to explicitly download) Try importing like this: from xml.dom import minidom or import xml.dom.minidom
3
0
0
I have a system that has installed Python 2.7, but not the standard libraries like minidom, etc. I guess it is a broken install. How can I fix that and install separately the standard libraries for that Python?
How can I install the standard libraries for a Python that doesn't have them?
0.049958
0
0
1,632
12,970,909
2012-10-19T09:08:00.000
2
0
1
0
python,python-2.7
12,971,103
4
true
0
0
I think you should totally uninstall the python, and reinstall a full-package version. Standard lib comes with install package, it's hard to separate it.
3
0
0
I have a system that has installed Python 2.7, but not the standard libraries like minidom, etc. I guess it is a broken install. How can I fix that and install separately the standard libraries for that Python?
How can I install the standard libraries for a Python that doesn't have them?
1.2
0
0
1,632
12,972,530
2012-10-19T10:38:00.000
1
0
0
1
python,windows,shell,unix
12,973,389
2
false
0
0
Have you considered using Cygwin together with rsync? You could write a small bash script that uses rsync to fetch the files you need, and run this as a daily cron job.
2
2
0
I would like to write a script to automate a task which I do manually everyday. This task requires me to download some files from a UNIX server (Solaris) to my desktop (Windows XP) using WinSCP. Is there any way to copy/move the files from a path in the UNIX server to a path in my Windows XP PC using Python or shell sc...
Copy file from UNIX to Windows using script
0.099668
0
0
1,745
12,972,530
2012-10-19T10:38:00.000
2
0
0
1
python,windows,shell,unix
12,972,627
2
false
0
0
If you are planning to use python, then you can use paramiko library. It has sftp support. Once you have the file on windows, use shutils library to move it to your path on windows
2
2
0
I would like to write a script to automate a task which I do manually everyday. This task requires me to download some files from a UNIX server (Solaris) to my desktop (Windows XP) using WinSCP. Is there any way to copy/move the files from a path in the UNIX server to a path in my Windows XP PC using Python or shell sc...
Copy file from UNIX to Windows using script
0.197375
0
0
1,745
12,976,652
2012-10-19T14:43:00.000
0
0
0
1
python,google-app-engine
12,980,347
3
false
1
0
I misunderstood part of your problem, I thought you were issuing a query that was giving you 250 entities. I see what the problem is now, you're issuing an IN query with a list of 250 phone numbers, behind the scenes, the datastore is actually doing 250 individual queries, which is why you're getting 250 read ops. I ca...
1
3
0
A user accesses his contacts on his mobile device. I want to send back to the server all the phone numbers (say 250), and then query for any User entities that have matching phone numbers. A user has a phone field which is indexed. So I do User.query(User.phone.IN(phone_list)), but I just looked at AppStats, and is th...
Efficient way to do large IN query in Google App Engine?
0
1
0
176
12,977,110
2012-10-19T15:05:00.000
3
0
0
1
python,google-app-engine
13,069,255
1
true
1
0
The entity ID forms part of the primary key for the entity, so there's no way to change it. Changing it is identical to creating a new entity with the new key and deleting the old one - which is one thing you can do, if you want. A better solution would be to create a PhoneNumber kind that provides a reference to the a...
1
2
0
I'm using Google App Engine NDB. Sometimes I will want to get all users with a phone number in a specified list. Using queries is extremely expensive for this, so I thought I'll just make the id value of the User entity the phone number of the user so I can fetch directly by ids. The problem is that the phone number fi...
Modify a Google App Engine entity id?
1.2
0
0
1,404
12,977,441
2012-10-19T15:22:00.000
5
0
1
0
python,python-3.x
12,977,721
3
false
0
0
You can use the -i interpreter option. python -c "import os" -i will import the os module and go to the interpreter read/eval loop. You can also put some statements (imports, definitions, etc) on a file and load it with python -i <file.py>
1
1
0
I want to bring up a python window (could be idle or cmd based) with some packages already imported by double clicking a python script. Is this possible? If so, how do I do it?
How can I bring up a python shell with packages already imported with a python script?
0.321513
0
0
115
12,981,607
2012-10-19T19:58:00.000
2
0
0
0
python,3d,rendering,panda3d
15,449,900
2
false
0
0
You can use a buffer with setOneShot enabled to make it render only a single frame. You can start Panda3D without a window by setting the "window-type" PRC variable to "none", and then opening an offscreen buffer yourself. (Note: offscreen buffers without a host window may not be supported universally.) If you set "w...
1
1
1
I would like to use Panda3D for my personal project, but after reading the documentation and some example sourcecodes, I still have a few questions: How can I render just one frame and save it in a file? In fact I would need to render 2 different images: a single object, and a scene of multiple objects including the...
Panda3D and Python, render only one frame and other questions
0.197375
0
0
2,225
12,990,315
2012-10-20T16:17:00.000
0
0
1
0
python,graph,plot,interpolation
12,990,987
2
false
0
0
If you use matplotlib, you can just call plot(X1, Y1, 'bo', X2, Y2, 'r+'). Change the formatting as you'd like, but it can cope with different lengths just fine. You can provide more than two without any issue.
1
3
1
I have four one dimensional lists: X1, Y1, X2, Y2. X1 and Y1 each have 203 data points. X2 and Y2 each have 1532 data points. X1 and X2 are at different intervals, but both measure time. I want to graph Y1 vs Y2. I can plot just fine once I get the interpolated data, but can't think of how to interpolate data. I'...
Data interpolation in python
0
0
0
2,501
12,991,111
2012-10-20T17:52:00.000
0
1
0
0
java,python,visual-studio-2010,arcgis,arcobjects
32,124,775
3
false
1
0
Creating a Python AddIn is probably the quickest and easiest approach if you just want to do some geoprocessing and deploy the tool to lots of users. But as soon as you need a user interface (that does more than simply select GIS data sources) you should create a .Net AddIn (using either C# or VB.net). I've created man...
1
0
0
I've been tasked with a thesis project where i have to extend the features of ArcGis. I've been asked to create a model written in Python that can run out of ArcGIS 10. This model will have a simple user interface where the user can drag/drop a variety of shapefiles and enter the values for particular variables in orde...
Extending ArcGIS
0
0
0
727
12,991,858
2012-10-20T19:24:00.000
0
0
1
0
python,oop
12,991,951
2
false
0
0
In short, you can't. There is no such thing as a reference to an object attribute, only references to objects. You'd indeed have to store an object an an identifier which denotes a storage location in that object (doesn't have to be a string which is an attribute name, could be a key for a dictionary which is a member,...
1
0
0
I am working on a project that attempts to represent an electronic circuit. This problem doesn't deal with circuit theory, just with connections between objects. The problem is I need to make a connection between two objects in two different ways. I have a Component and a Node. A component has two terminals (positive...
Python - Making a reference to an objects attribute
0
0
0
143
12,995,006
2012-10-21T04:34:00.000
1
1
1
0
python,simics
13,001,532
1
false
0
0
In Simics 4.x, eval_cli_line has been replaced with run_command(). Read the migration guide.
1
0
0
eval_cli_line("cache_%s" % cpu.name + ".ptime") in my python script is constantly giving the following error NameError: global name 'eval_cli_line' is not defined Any suggestions ?
Python eval_cli_line()
0.197375
0
0
241
12,995,925
2012-10-21T07:40:00.000
1
0
1
0
python,ctypes
12,996,825
2
true
0
1
The easiest way is to attach the CFUNCTYPE objects to a module or class. I've found it useful to have a Python wrapper module - in essence a separate file that keeps everything at the ctypes level in one namespace. You could add and remove your callbacks from there as necessary.
1
1
0
I am creating CFUNCTYPE objects in my script and passing them as callbacks to c. If I make them local they are destroyed immediately and I am getting access violaton errors Tried to gc.disable(), it doesnt help. Today Im making global lists and putting/removing FUNCTYPE objects when needed. Is there better solution?
How to prevent FUNCTYPE from being collected
1.2
0
0
265
12,997,225
2012-10-21T11:03:00.000
0
0
1
0
python,macos
12,997,556
1
false
0
0
I'm guessing the performance drop is because it is swapping stuff in and out of memory. I don't think the issue is how long the program is running - Python uses a garbage collector, so it doesn't have memory leaks. Well, that's not entirely true. The garbage collector will make sure that it deletes anything that isn't ...
1
0
0
I wrote a program to crunch some data about 2.2 million records. For each record, it will pass through a series of 20 computations that takes about total 0.01 second. To make it run faster, I use Python multiprocess, break my data generally into 6 blocks and run them in parallel with a master process distributing paylo...
Strange Python performance degradation after running a long time and consuming large memory footprint
0
0
0
763
12,999,262
2012-10-21T15:33:00.000
5
0
0
0
python,amazon-web-services,boto,amazon-dynamodb
13,003,481
1
true
1
0
The item_count value is only updated every six hours or so. So, I think boto is returning you the value as it is returned by the service but that value is probably not up to date.
1
3
0
I'm using the python framework Boto to interact with AWS DynamoDB. But when I use "item_count" it returns the wrong value. What's the best way to retrieve the number of items in a table? I know it would be possible using the Scan operation, but this is very expensive on resources and can take a long time if the table i...
Boto's DynamoDB API returns wrong value when using item_count
1.2
0
1
592
12,999,970
2012-10-21T16:51:00.000
0
1
0
0
python,keyboard,signals
36,716,865
1
false
0
0
Have a parent process that monitors keyboard input, and forward a signal to the child if it occurs.
1
4
0
My Python 2.7 script (on Raspberry Pi Debian) runs a couple of stepper motors synchronously via the GPIO port. I currently have a signal handler in place for Ctrl-C to clean up tidily before exit. I'd now like to extend that method such that keyboard inputs could also generate SIGUSR1 or similar as an asynchonous con...
Getting keyboard inputs to cause SIGUSR1/2 akin to ctrl-C / SIGINT to trigger signal_handler
0
0
0
415
13,000,007
2012-10-21T16:56:00.000
1
0
0
0
postgresql,content-management-system,python-2.7
13,003,890
2
false
1
0
Have you tried Drupal. Drupal supports PostgreSQL and is written in PHP and is open source.
1
5
0
Php or python Use and connect to our existing postgres databases open source / or very low license fees Common features of cms, with admin tools to help manage / moderate community have a large member base on very basic site where members provide us contact info and info about their professional characteristics. About...
What is a good cms that is postgres compatible, open source and either php or python based?
0.099668
1
0
5,703
13,001,913
2012-10-21T20:32:00.000
1
0
1
0
python,hash,dictionary,equality
13,001,958
3
false
0
0
__hash__ defines the bucket the object is put into, __eq__ gets called only when objects are in the same bucket.
2
6
0
I have a class (let's call it myClass) that implements both __hash__ and __eq__. I also have a dict that maps myClass objects to some value, computing which takes some time. Over the course of my program, many (in the order of millions) myClass objects are instantiated. This is why I use the dict to keep track of those...
What happens when you call `if key in dict`
0.066568
0
0
607