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
5,671,653
2011-04-15T02:02:00.000
5
0
1
0
python,ruby,regex
5,672,045
5
false
0
0
I like the /pattern/ syntax in Ruby, inspired from Perl, for regular expressions. Python's re.compile("pattern") is not really elegant for me. The syntatic sugar in Ruby and the fact that regular expressions are a separate re module in Python, makes me lean towards Ruby when it comes to Regular Expressions. Apart from ...
4
9
0
Are there any real differences between Ruby regex and Python regex? I've been unable to find any differences in the two, but may have missed something.
Ruby Regex vs Python Regex
0.197375
0
0
4,592
5,671,653
2011-04-15T02:02:00.000
3
0
1
0
python,ruby,regex
5,684,927
5
false
0
0
If the question is only about regex's: neither. Use Perl. You should choose between those languages based on the other non-regex issues that you are trying to solve and the community support in that language that is nearby your field of endeavor. If you are truly only picking a language based on regex support -- choos...
4
9
0
Are there any real differences between Ruby regex and Python regex? I've been unable to find any differences in the two, but may have missed something.
Ruby Regex vs Python Regex
0.119427
0
0
4,592
5,671,653
2011-04-15T02:02:00.000
1
0
1
0
python,ruby,regex
26,770,600
5
false
0
0
Ruby's Regexp#match method is equivalent to Python's re.search(), not re.match(). re.search() and Regexp#match look for the first match anywhere in a string. re.match() looks for a match only at the beginning of a string. To perform the equivalent of re.match(), a Ruby regular expression will need to start with a ^, in...
4
9
0
Are there any real differences between Ruby regex and Python regex? I've been unable to find any differences in the two, but may have missed something.
Ruby Regex vs Python Regex
0.039979
0
0
4,592
5,672,100
2011-04-15T03:30:00.000
1
0
0
0
python,livechat
5,672,152
2
false
1
0
You could try doing something like IRC, where the current "room" is sent from the client to the server "before" the text (/PRIVMSG #room-name Hello World), delimited by a space. For example, you could send ROOMNAME Sample text from the browser to the server. Using AJAX would be the most reasonable option. I've never us...
1
2
0
Need some direction on this. I'm writing a chat room browser-application, however there is a subtle difference. These are collaboration chats where one person types and the other person can see live ever keystroke entered by the other person as they type. Also the the chat space is not a single line but a textarea sp...
Multiple chat rooms - Is using ports the only way ? What if there are hundreds of rooms?
0.099668
0
1
1,196
5,672,756
2011-04-15T05:34:00.000
4
0
1
0
python,image-manipulation
5,672,827
2
true
0
0
Use Python Imaging Library for this purpose. There is a img = Image.frombuffer(mode, size, data) method which creates an image from "raw" data (a string). You can then save it as PNG file via img.save('image.png', transparency=transparency)
1
4
0
Forgive me for any naivety, but I am new to working with images. Say I have a list of binary values [1,0,0,0,1,0,1,0,0,0,0,1,1,0....] which represent pixels in a black and white image. How would I go about making a .png file from this list?
Binary List to PNG in Python
1.2
0
0
2,276
5,673,154
2011-04-15T06:31:00.000
2
1
0
1
python,shell,deployment,fabric
8,855,653
3
false
0
0
Also, I think the path you'd choose would depend on what you're trying to do. Some things are easier in python (write it in your fabfile), while others are easier in shell-land (take one of the shell approaches mentioned). Either way, fabric is geared towards centralization and portability, and it doesn't really matter...
3
4
0
Fabric is a tool for "executing local or remote shell commands." Why would you re-implement a remote shell script line by line in a long Fabric script? That is, why not just write a brief Fabric script that runs a long remote shell script instead?
Why re-implement shell commands line by line in a Fabric script?
0.132549
0
0
1,058
5,673,154
2011-04-15T06:31:00.000
4
1
0
1
python,shell,deployment,fabric
5,674,298
3
false
0
0
It wont be a good idea if I have to run the same script on, lets say, 10 servers. This means I've to not only stick the same long script on 10 servers, but also make sure if I change it on 1 server, the change has to be applied to all servers. I know this can be averted by keeping that script on a shared location, but ...
3
4
0
Fabric is a tool for "executing local or remote shell commands." Why would you re-implement a remote shell script line by line in a long Fabric script? That is, why not just write a brief Fabric script that runs a long remote shell script instead?
Why re-implement shell commands line by line in a Fabric script?
0.26052
0
0
1,058
5,673,154
2011-04-15T06:31:00.000
4
1
0
1
python,shell,deployment,fabric
5,676,599
3
true
0
0
lobster1234 raises a good point that you don't want to have to manually stick a long, remote shell script on 10 servers. However, if you still want to avoid rewriting the long, remote shell script as a long Fabric script, you could write a Fabric script that copies that remote shell script to the designated server, exe...
3
4
0
Fabric is a tool for "executing local or remote shell commands." Why would you re-implement a remote shell script line by line in a long Fabric script? That is, why not just write a brief Fabric script that runs a long remote shell script instead?
Why re-implement shell commands line by line in a Fabric script?
1.2
0
0
1,058
5,673,599
2011-04-15T07:22:00.000
2
1
0
1
python,deployment,chef-infra
10,241,015
2
false
0
0
I use chef to bootstrap ec2 instances. I also use boto to do further modifications of ec2 instances such as creating tags etc. I will be now be using libcloud more often since I will I will have a mix between rackspace and ec2. As a side, when bootstrap a ec2 or rackspace instance, I do not use knife, I use libcload ...
2
0
0
Chef is commonly used for provisioning servers, right? So is LibCloud, right? What's an example use case of why someone would use both tools together?
Example of using Chef with LibCloud
0.197375
0
0
739
5,673,599
2011-04-15T07:22:00.000
0
1
0
1
python,deployment,chef-infra
5,919,135
2
false
0
0
Chef works with a variety of cloud computing providers: Amazon AWS EC2 Rackspace Cloud Terremark vCloud Bluebox Group Openstack Slicehost It does this through the Ruby library, fog.
2
0
0
Chef is commonly used for provisioning servers, right? So is LibCloud, right? What's an example use case of why someone would use both tools together?
Example of using Chef with LibCloud
0
0
0
739
5,673,705
2011-04-15T07:36:00.000
0
0
1
0
python
5,673,760
1
false
0
0
Sort by skill, pick from the top for alternating groups. Just like back in high school.
1
0
0
I'm quite new to Python, and I have a problem that I would like to solve (elegantly). I'm going to create teams for soccer matches this coming season. We have 24 players and would like to put them in two groups, 12 in each, based on skills. For each match, we want to select 8 players, 4 from each group. Ideally, everyo...
Creating teams based on two groups
0
0
0
149
5,674,902
2011-04-15T09:36:00.000
0
0
0
0
python,django
11,860,808
2
true
1
0
okay, now I understand how Http404 works. So you have to define this Http500 exception somewhere, and catch it in middleware.
1
0
0
I have a django app running with MySQL and Redis as backend I have a function called redis_helper() to do redis queries. But sometimes Redis crash and needs sometime to bootup, so I need to return a friendly HTTP 500 error message. The problem is, django only defines Http404(Exception) class in django/http/__init__.py...
Best practice to handle global 500 errors in Django?
1.2
0
0
2,163
5,675,531
2011-04-15T10:42:00.000
1
0
0
0
python,html,beautifulsoup
5,675,635
2
false
1
0
Read the BeautifulSoup documentation - and come back if you have real issues.
1
1
0
I am new to python and i don't know many things.I want to parse an html page,modify it and show it in my own page.I try use beautifulsoup in order to parse html but some errors are generated.I searched on the web but i don't know any specific way to do this.Can anyone help me?
Parsing html content with python and modifying it
0.099668
0
1
606
5,677,106
2011-04-15T12:58:00.000
0
0
1
0
python,windows,dll
5,677,903
2
false
0
0
I was slightly worried that you might be talking about the software I write, but you're in a totally different country, so I doubt it. :) I can see at least 3 potential problems with this: This is almost certain to void any warrany / support agreements you have on the software. We are very cautious about any other sof...
2
0
0
I have some Windows proprietary apps that insist on using Python 2.5. I'm already using python 2.7 rarely and on my way to 3.x, so I do not want to keep or force the team to keep yet another python version. So, I cheated and created a python25.dll as a copy of the python27.dll in the same bin folder of that app/ Some...
Duplicating python27.dll as python25.dll
0
0
0
634
5,677,106
2011-04-15T12:58:00.000
0
0
1
0
python,windows,dll
5,677,432
2
false
0
0
Any differences relevant in this context would be the symbols exported by the two DLLs. I am not familiar with the windows toolsuite, but try using a windows equivalent of unix's nm or objdump to see whether there are any symbols exported in the 2.5 version but not 2.7. I wouldn't expect (m)any. Another approach to so...
2
0
0
I have some Windows proprietary apps that insist on using Python 2.5. I'm already using python 2.7 rarely and on my way to 3.x, so I do not want to keep or force the team to keep yet another python version. So, I cheated and created a python25.dll as a copy of the python27.dll in the same bin folder of that app/ Some...
Duplicating python27.dll as python25.dll
0
0
0
634
5,677,391
2011-04-15T13:18:00.000
9
0
0
1
python,subprocess
5,677,732
1
true
0
0
subprocess.Popen is what you are looking for!
1
4
0
Im using subprocess.call to execute a bat file. subprocess.call is waiting for the bat file to complete before it continues. I want it to start the bat then continue on. Looking at the documents for subprocess it didnt look like it had an option to not wait for the command to complete. Is there a way to do this or a...
python how to force subprocess.call to not wait for the called command to complete
1.2
0
0
1,923
5,677,809
2011-04-15T13:54:00.000
1
1
1
0
python,testing
5,677,921
3
false
0
0
Altering sys.path much in production environment may be unwise. Altering it for testing is usually OK. If you don't want to tinker with the variable from sys, use an environment variable named PYTHONPATH, it's a clean and documented way.
2
20
0
I'm in the process of redesigning/refactoring my Python quantum chemistry package (pyquante). One of the things I don't like about the existing release is that I have to install the package to run the test suite. That is, the test suite has statements like from PyQuante import SCF, and, of course, this PyQuante could r...
How can I test my python module without installing it
0.066568
0
0
10,868
5,677,809
2011-04-15T13:54:00.000
6
1
1
0
python,testing
5,678,267
3
false
0
0
I would honestly insist on using virtualenv, its designed for this exact reason in mind. very small overhead, and if you ever mess up just delete directory. I am sure as you grow, things won't be as simple as they are now for your current situation. Take it as an opportunity to learn.
2
20
0
I'm in the process of redesigning/refactoring my Python quantum chemistry package (pyquante). One of the things I don't like about the existing release is that I have to install the package to run the test suite. That is, the test suite has statements like from PyQuante import SCF, and, of course, this PyQuante could r...
How can I test my python module without installing it
1
0
0
10,868
5,679,203
2011-04-15T15:44:00.000
0
1
0
1
python,django,linux,fabric
5,680,308
2
false
0
0
You could also try any of the distributed computing packages. Pyro is one of them that might interest you.
1
1
0
We have around 250 identical linux server which runs a business critical web application for a bank. Basically we do a lot of scripting work but now i want to centralize that only in one location. That means run on one server and and deploy it in many. I know you guys must be thinking that this is an easy task and can ...
Python scripting in linux
0
0
0
304
5,679,359
2011-04-15T15:56:00.000
2
1
1
0
python
5,679,488
4
false
0
0
Install the distrubute package then use the developer mode. Just use python setup.py develop --user and that will place path pointers in your user dir location to your workspace.
2
16
0
I'd like to start developing an existing Python module. It has a source folder and the setup.py script to build and install it. The build script just copies the source files since they're all python scripts. Currently, I have put the source folder under version control and whenever I make a change I re-build and re-ins...
Developing Python Module
0.099668
0
0
4,136
5,679,359
2011-04-15T15:56:00.000
0
1
1
0
python
5,679,437
4
false
0
0
Change the PYTHONPATH to your source directory. A good idea is to work with an IDE like ECLIPSE that overrides the default PYTHONPATH.
2
16
0
I'd like to start developing an existing Python module. It has a source folder and the setup.py script to build and install it. The build script just copies the source files since they're all python scripts. Currently, I have put the source folder under version control and whenever I make a change I re-build and re-ins...
Developing Python Module
0
0
0
4,136
5,680,487
2011-04-15T17:50:00.000
0
0
0
0
python,image,performance,wxpython
5,681,008
2
false
0
1
I would think a ListCtrl in ICON style would be the best way to do this. If you look at the wxPython Demos, the UltimateListCtrl sample in the wx.LC_ICON style is a good example of what you could create.
1
1
0
Which is the most efficient method to display a grid of about 1000 clickable images in wxPython ? Currently i am using a GridSizer filled with StaticBitmap objects. But its quite slow for 500+ images. One more thing is that, i have a listbox of categories on the left. That is to filter the images. Categories will be l...
Efficient method for a grid of clickable images in wxPython?
0
0
0
796
5,681,407
2011-04-15T19:26:00.000
1
0
1
0
python
5,681,599
3
false
0
0
Basic idea Open the file Iterate over the lines For every line read, increment some counter, e.g. line_no += 1; Split the line by whitespace (you will get a list) Check if the list contains the word (use in), then use list.index(word) to get the index, store that index in some variable word_no = list.index(word) print...
1
1
0
i wonder how to know , a position inside the .txt when I read. this is my txt cat dog monkey bird this my printing Word: cat Position: line 1 , word 1 (1,1) any idea?
How to know a position (.txt)
0.066568
0
0
262
5,682,175
2011-04-15T20:43:00.000
3
0
0
1
python,distributed-computing
5,682,297
2
true
0
0
I'm unfamiliar with Disco and Condor, but I can answer regarding Hadoop: Hadoop pros: Robust and proven - probably more than anything else out there. Used by many organizations (including the one I work for) to run clusters of 100s of nodes and more. Large ecosystem = support + many subprojects to make life easier (e...
1
4
1
I am trying to find a tool that will manage a bunch of jobs on 100 machines in a cluster (submit the jobs to the machines; make sure that jobs are run etc). Which tool would be more simple to install / manage: (1) Hadoop? (2) Disco? (3) Condor? Ideally, I am searching for a solution that would be as simple as possible,...
Hadoop Vs. Disco Vs. Condor?
1.2
0
0
1,606
5,684,798
2011-04-16T05:59:00.000
4
0
0
0
python,django,django-debug-toolbar
5,685,316
7
false
1
0
A few tipps without knowing your code: 'debug_toolbar.middleware.DebugToolbarMiddleware' should be your last or second to last middle ware entry (not 100% sure how it works out with the flatpagefallback middleware) 'debug-toolbar' as last in the list of INSTALLED_APPS Double check if the toolbar's assets are loaded Ma...
3
8
0
Hey, I've been using Django 1.2.1 for some time now and came across Django Debug Toolbar just the other day. It looks really useful and I'm really eager to try some stuff out. I installed exactly how the readme said. Step by Step. I put the middleware at the end just in case things get caught up but I'm using quite sta...
Django Debug Toolbar Only Working for Admin Section
0.113791
0
0
4,781
5,684,798
2011-04-16T05:59:00.000
0
0
0
0
python,django,django-debug-toolbar
15,992,979
7
false
1
0
In my case the error was very simple. I removed the footer and it worked like a charm! Hope this solves an issue for somebody else.
3
8
0
Hey, I've been using Django 1.2.1 for some time now and came across Django Debug Toolbar just the other day. It looks really useful and I'm really eager to try some stuff out. I installed exactly how the readme said. Step by Step. I put the middleware at the end just in case things get caught up but I'm using quite sta...
Django Debug Toolbar Only Working for Admin Section
0
0
0
4,781
5,684,798
2011-04-16T05:59:00.000
3
0
0
0
python,django,django-debug-toolbar
5,755,603
7
false
1
0
I had the same problem here, and eventually arrived at this post... Anyway, in my case what I noticed was that I had a javascript error in one of my js included libraries. And that breaked the js interpretation flow. When I fixed the javascript error, the django toolbar worked. That explains why it worked in the admin ...
3
8
0
Hey, I've been using Django 1.2.1 for some time now and came across Django Debug Toolbar just the other day. It looks really useful and I'm really eager to try some stuff out. I installed exactly how the readme said. Step by Step. I put the middleware at the end just in case things get caught up but I'm using quite sta...
Django Debug Toolbar Only Working for Admin Section
0.085505
0
0
4,781
5,685,078
2011-04-16T07:14:00.000
1
0
0
0
python,user-interface,d,cython,cpython
5,687,119
4
false
0
1
Well, its a typical usecase to just write your number crunching code in C/C++ or any language that can be linked into a C module and just add the non performance critical stuff with a scripting language easily. The Python C interface is okay to work with and using SWIG or even writing the binding code manually isn't to...
3
4
0
I really like D(2) language and would like to use it for multi-platform GUI application, but I see that its ecosystem is not quite developed. After moving from Linux to (Free)PC-BSD, I see there is even no 64bit compiler ready in the ports and one is not sure if any of GUI libs (QtD, gtkD, wxD) are ready for serious pr...
multi-platform gui app in C(P)ython or D
0.049958
0
0
1,579
5,685,078
2011-04-16T07:14:00.000
2
0
0
0
python,user-interface,d,cython,cpython
5,687,640
4
false
0
1
Writing the GUI in a dynamic language and writing performance-sensitive code in another language is a great way to write an application. This can be done in Python, it can also be done really easily in Tcl/Tk and several other scripting languages.
3
4
0
I really like D(2) language and would like to use it for multi-platform GUI application, but I see that its ecosystem is not quite developed. After moving from Linux to (Free)PC-BSD, I see there is even no 64bit compiler ready in the ports and one is not sure if any of GUI libs (QtD, gtkD, wxD) are ready for serious pr...
multi-platform gui app in C(P)ython or D
0.099668
0
0
1,579
5,685,078
2011-04-16T07:14:00.000
7
0
0
0
python,user-interface,d,cython,cpython
5,686,614
4
true
0
1
I'm obviously biased as a Cython core developer, but I can certainly recommend it. The combination of CPython and Cython provides an otherwise hard to reach level of developing speed, platform stability, portability, low-level coding and FFI capabilities, and execution performance, including a very easy optimisation pa...
3
4
0
I really like D(2) language and would like to use it for multi-platform GUI application, but I see that its ecosystem is not quite developed. After moving from Linux to (Free)PC-BSD, I see there is even no 64bit compiler ready in the ports and one is not sure if any of GUI libs (QtD, gtkD, wxD) are ready for serious pr...
multi-platform gui app in C(P)ython or D
1.2
0
0
1,579
5,685,176
2011-04-16T07:38:00.000
2
0
1
0
python,qt,pyqt,pyside
5,688,829
1
true
0
1
EFL looks good and promising, especially its widget toolkit which can do very smart things when resizing windows, but there are problems with it: first, it comes in a very-beta quality. Second, the widgets will look quite unfamiliar for the users. Qt is mature and stable, and it adapts to the platform look and feel (bu...
1
2
0
When chatting in IRC yesterday about the possibility to use P(C)ython instead of D for multi-platform GUI application, someone suggested me Enlightenment Foundation Libraries (EFL). We have researched a bit about it and considering we would like to target some mobile-platform in the future as well, EFL looks as nice al...
Qt or EFL for multi-platform Python application
1.2
0
0
1,308
5,686,490
2011-04-16T12:32:00.000
18
0
0
1
python,c,linux,sockets,tcp
8,434,845
7
true
0
0
I've had a recurring problem communicating with equipment that had separate TCP links for send and receive. The basic problem is that the TCP stack doesn't generally tell you a socket is closed when you're just trying to read - you have to try and write to get told the other end of the link was dropped. Partly, that ...
2
27
0
I'm writing a TCP server that can take 15 seconds or more to begin generating the body of a response to certain requests. Some clients like to close the connection at their end if the response takes more than a few seconds to complete. Since generating the response is very CPU-intensive, I'd prefer to halt the task th...
Detect socket hangup without sending or receiving?
1.2
0
1
35,496
5,686,490
2011-04-16T12:32:00.000
-1
0
0
1
python,c,linux,sockets,tcp
8,386,973
7
false
0
0
You can select with a timeout of zero, and read with the MSG_PEEK flag. I think you really should explain what you precisely mean by "not reading", and why the other answer are not satisfying.
2
27
0
I'm writing a TCP server that can take 15 seconds or more to begin generating the body of a response to certain requests. Some clients like to close the connection at their end if the response takes more than a few seconds to complete. Since generating the response is very CPU-intensive, I'd prefer to halt the task th...
Detect socket hangup without sending or receiving?
-0.028564
0
1
35,496
5,686,723
2011-04-16T13:10:00.000
2
0
1
0
python,reflection
5,686,875
4
false
0
0
You could ask the garbage collector for all existing objects and iterate through that collection to find what you are looking for, but thats probably the wrong thing to do, unless you have very special reasons to do it.
1
4
0
suppose we have many objects in memory. Each one has a distinct id. How can I iterate the memory to find a specific object that is compared to some id ? In order to grab it and use it through getattr ?
Python Reflection
0.099668
0
0
5,761
5,688,053
2011-04-16T16:51:00.000
5
0
1
0
python,django,virtualenv
21,246,463
3
false
1
0
Since the question was about easy_install, it's useful to know that (with setuptools v2.1) you can specify version numbers with easy_install like you can with pip. Thus: $ easy_install django==1.3 will install django 1.3. This was important for my problem (which Google directed me here to solve), when I needed to ins...
1
8
0
I just broke my environment because of django 1.3. None of my sites are able to run. So, i decided to use virtualenv to set virtual environment with different python version as well as django. But, seems like if i download the package and install using "sudo python setup.py install" this does not get added to my virtu...
how do you install django older version using easy_install?
0.321513
0
0
12,466
5,688,079
2011-04-16T16:54:00.000
2
0
0
1
python,database,google-app-engine
5,691,077
2
false
1
0
Why not query the data twice? Once for users with a higher score, in descending order. Once for users with a lower score. Fetch five records in each query.
1
0
0
I am using Google App Engine in Python. In My database, I have some Entity which contain score of user. So I wanted to make a page on the ranking of a particular user. To do that, I need to get the 5 user with the higher score than that user and 5 user with lower score than that user, and also the position of that part...
Google App Engine: How to get the offset of an object
0.197375
0
0
157
5,688,573
2011-04-16T18:21:00.000
1
0
0
0
python,http,streaming,mp3,shoutcast
14,489,267
5
false
0
0
Since you already have good python experience (given you've already written an HTTP server) I can only provide a few pointers on how to extend the ground-work you've already done: Prepare your server for dealing with Request Headers like: Accept-Encoding, Range, TE (Transfer Encoding), etc. An MP3-over-HTTP player (i....
1
28
0
I would like to implement a server in Python that streams music in MP3 format over HTTP. I would like it to broadcast the music such that a client can connect to the stream and start listening to whatever is currently playing, much like a radio station. Previously, I've implemented my own HTTP server in Python using S...
Writing a Python Music Streamer
0.039979
0
1
28,874
5,690,599
2011-04-17T00:22:00.000
0
1
0
1
python,serial-port
23,190,516
2
false
0
0
very first you need to get log-in into the device. then you can run the specified command on that device. note:command which you are going to run must be supported by that device. Now after opening a serial port using open() you need to find the login prompt using Read() and then write the username using write(), same ...
1
0
0
I have an embedded linux device and here's what I would like to do using python: Get the device console over serial port. I can do it like this: >>> ser = serial.Serial('/dev/ttyUSB-17', 115200, timeout=1) Now I want to run a tail command on the embedded device command line, like this: # tail -f /var/log/messages and...
how to read command output from serial device using python
0
0
0
4,870
5,690,888
2011-04-17T01:37:00.000
0
0
1
0
python,oop,scope
52,335,732
4
false
0
0
Although answered, let me add some comments to your questions: declaring a variable in a class (outside of a function) : all class functions can access it (basically a public variable): comment:this is like a static variable and can be called using the class name. These variables are available to all functions, any fu...
1
76
0
Declaring a variable in a class (outside of a function): all class functions can access it (basically a public variable) Declaring a variable inside a function inside a class: only that function can access it (it's in that function's scope) Declaring a variable with self.(variable name) inside a function inside a class...
Variable scopes in Python classes
0
0
0
84,233
5,691,309
2011-04-17T03:43:00.000
0
0
1
0
python,multithreading,optimization,operating-system,multiprocessing
5,691,343
2
false
0
0
My guess: people are just referring to calling waitpid() without WNOHANG, which of course obviates the reason you use multiple threads in the first place. (That is, of course, unless you are just using it to reap the zombies).
1
3
0
I've heard there are problems when calling os.waitpid from within a thread. I have not experienced such problems yet (especially using os.WNOHANG option). However I have not paid much attention to the performance implications of such use. Are there any performance penalties or any other issues one should be aware of? D...
In Python, what are the cons of calling os.waitpid in a program with multiple threads?
0
0
0
2,534
5,691,398
2011-04-17T04:06:00.000
1
0
1
0
python,virtualenv,pip
5,691,431
2
false
0
0
Only the first package/module found in sys.path with the given name will be used. If your venv is earlier than the system directory then your venv will be used.
1
1
0
Assume I have a virtualenv installation that does not use --no-site-packages. I run bin/pip install somepackage==1.0.0, but it's already present in my site-packages so it's not installed. Later, the copy installed site-packages is updated to somepackage==2.0.0. What will happen in my virtualenv? Will it use the version...
What happens if a site package is updated beyond the version I specified in a virtualenv with pip?
0.099668
0
0
162
5,691,674
2011-04-17T05:25:00.000
0
0
0
0
python-3.x,tkinter,builder
5,743,059
4
true
0
1
Wow, pity I didn't get any useful responses. Fortunately I have discovered a solution. PyQt4 may not be Tkinter but it works just the same ... and works in python 3.x and comes with a GUI designer that is very neat. Takes a bit of research to know how to use it but well worth it
1
3
0
There are a number of Tkinter builders out there but none (that I've found) that work for Python 3. I don't have the time to learn Tkinter and don't use it much which is why I'm looking for a builder.
Tkinter GUI Builder
1.2
0
0
12,993
5,692,968
2011-04-17T10:22:00.000
1
0
0
0
python,qt,python-3.x,pyqt4
5,693,049
1
true
0
1
Didn't use this for some thime, but I think you had to change paletteForegroundColor and change segmentStyle to QLCDNumber::Filled or QLCDNumber::Flat
1
0
0
Using PyQt4 and Python 3 do you know how I can change the color of a QLcdNumber during the runtime ?
Change the color of the text of QLcdNumber
1.2
0
0
1,466
5,693,151
2011-04-17T11:09:00.000
1
0
0
0
python,charts
6,272,840
4
false
0
0
Pretty easy to do with pygooglechart - You can basically follow the bar chart examples that ship with the software and then use the add_data_line method to make the lines on top of the bar chart
1
0
1
I want to generate compound charts (e.g: Bar+line) from my database using python. How can i do this ? Thanks in Advance
Compoud charts with python
0.049958
1
0
277
5,695,455
2011-04-17T18:21:00.000
0
0
0
0
python,django,django-facebook
21,381,966
2
false
1
0
Yeah, very though question. As first advice i suggest you to be sure that you have SSL enabled on the webserver that serve the canvas service. After that you will able to serve static files as canvas page, but not a django view. It is possible but i'm not able to find a workaround.
1
2
0
I am practicing using django-facebook to integrate my django app with facebook and turn it into a facebook app. The documentation for django-facebook is very bad but I have managed to get my sample app to load the facebook canvas page. But I am unable to display anything on the canvas page. Any advice or suggestions wo...
Using django-facebook to display text on facebook canvas
0
0
0
1,073
5,695,689
2011-04-17T18:57:00.000
43
0
0
0
python,flask,web.py
5,695,723
1
true
1
0
Flask is a new and a very active project with good documentation and guidelines for new development and plugins. Its community is quite large and Armin (the lead) is an A grade programmer. Hence it is definitely the better contender. Web.py is an older and more mature project which is more a library than a framework. ...
1
28
0
For these pythonic web frameworks; They looks similar, except a few minor differences like their url handling schemes. So it is very hard to choose one of them. I want to learn from your experiences that which one more suits for a web application that is small in size, but need long term support (initial application i...
web.py and flask
1.2
0
0
7,454
5,696,995
2011-04-17T22:49:00.000
3
0
0
0
python,google-app-engine,pickle,nltk
5,697,057
1
true
0
0
If your NLTK tagger code and data is of limited size, then carry it along with your GAE code. If you have to act upon it to retrain the set, then storing the content of the file as a BLOB in the datastore would be an option, so that you get, analyze, retrain and put.But that will limit size of dataitem to be less than...
1
0
1
I have a trained and pickled NLTK tagger (Brill's transformational rule-based tagger). I want to use it on GAE. What the best way to do it?
Python: How to load and use trained and pickled NLTK tagger to GAE?
1.2
0
0
312
5,698,957
2011-04-18T05:39:00.000
0
0
0
0
python,django,admin
5,699,159
2
false
1
0
What about using list_filter='my_field' in the admin.py file ?
1
8
0
Can I show a grouped result in Django Admin? By default, they are showing all rows, I want to group these rows based on some fields, and display it. Something like "GROUP BY username" or stuff. I've tried to search but no luck :(
Django Admin : Grouped data in the list
0
0
0
3,477
5,699,092
2011-04-18T06:02:00.000
1
0
0
1
python,google-app-engine
5,699,117
2
true
1
0
I suggest you use Google Analytics on your web app. If you want to do some sort of server-side visitor analaytics (instead of the client-side Javascript that Google Analytics uses), you'd have to store something in a database (BigTable on GAE) and run your own analytics.
1
0
0
Hi My app had visitors and I like to analyze the log file. Can I run a log analyzer program on the log file that google app engine allows us to download? Are third-party programs such as webalizer and visitors compatible? Thank you
Analyze logfile from GAE
1.2
0
0
220
5,699,508
2011-04-18T06:59:00.000
0
0
0
0
python,image
5,699,658
2
false
0
1
If you want something to handle the more complex details you could setup your OpenGL using pygame then use surface = pygame.image.load(fileobj) Where fileobj is any object with a 'file-like' interface. You would need to modify the PNG generator to write to this object rather than a real file.
1
0
0
I have a Python code whose output is a .png file. What should I do to get the output in an OpenGL window? I searched a few places and the closest I got to converting an Image was StringIO() but that didn't seem very helpful.
How to change a .png output from Python to an OpenGL window output?
0
0
0
224
5,700,302
2011-04-18T08:29:00.000
2
1
0
0
python,api,twitter,proxy,streaming
5,755,092
2
false
0
0
Tweepy uses httplib internally which is too low level to have proxy settings. You have to change Stream._run() method to connect to proxy instead of target host and use full (with scheme and host) URL in request.
1
2
0
I am looking for a Twitter Streaming API Python library with proxy support. I love tweepy, but unfortunately I haven't seen a way to use an HTTP proxy. Any ideas?
Twitter Streaming API Python library with proxy support?
0.197375
0
1
1,810
5,700,318
2011-04-18T08:30:00.000
1
1
1
0
visual-studio-2008,.net-3.5,ironpython,fitnesse,cpython
5,700,447
1
true
0
0
You can do it either way. We use IronPython runtime embedded in our code so we use the hosting options to test any python via c# unit test classes. Remember you can use fire up an Iron Python Engine (3.5) or DLR based script host (4.0) and give it a string. In 3.5 there is no DLR to the Iron Python 1.1 is the order of ...
1
0
0
We are mostly a .NET shop and want to cover everything with the Fitness acceptance testing framework. Recently we had to write a couple of scripts for unix and we used python. Now the suggestion has been made that we should write Fitness tests for these python scripts and integrate them into our automated test process....
Using IronPython so I can test normal Python scripts in .net
1.2
0
0
342
5,701,569
2011-04-18T10:30:00.000
3
1
1
0
python
5,702,742
3
false
0
0
When I use the sys.getdefaultencoding() I get the output as "Cp1252" Two comments on that: (1) it's "cp1252", not "Cp1252". Don't type from memory. (2) Whoever caused sys.getdefaultencoding() to produce "cp1252" should be told politely that that's not a very good idea. As for the rest, let me guess. You have a uni...
2
0
0
I am a newbie in python. I have a unicode in Tamil. When I use the sys.getdefaultencoding() I get the output as "Cp1252" My requirement is that when I use text = testString.decode("utf-8") I get the error "UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-8: character maps to undefined"
Conversion of Unicode
0.197375
0
0
879
5,701,569
2011-04-18T10:30:00.000
0
1
1
0
python
9,630,980
3
false
0
0
you need to know which character-encoding is testString using. if not utf8, an error will occur when using decode('utf8').
2
0
0
I am a newbie in python. I have a unicode in Tamil. When I use the sys.getdefaultencoding() I get the output as "Cp1252" My requirement is that when I use text = testString.decode("utf-8") I get the error "UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-8: character maps to undefined"
Conversion of Unicode
0
0
0
879
5,703,308
2011-04-18T13:03:00.000
1
0
0
0
python,mysql,django
5,703,375
4
false
1
0
I am not MySQL expert, but I guess MySQL locks the table for the deleting and this might be MySQL transaction/backend related. When deleting is in progress MySQL blocks the access to the table from other connections. MyISAM and InnoDB backend behavior might differ. I suggest you study MySQL manual related to this: the ...
2
1
0
I'm running django site with MySQL as DB back-end. Finally i've got 3 millions rows in django_session table. Most of them are expired, thus i want to remove them. But if i manually run delete from django_session where expire_date < "2011-04-18" whole site seems to be hanged - it cannot be accessed via browser. Why suc...
MySQL&django hangs on huge session delete
0.049958
1
0
513
5,703,308
2011-04-18T13:03:00.000
5
0
0
0
python,mysql,django
5,703,378
4
true
1
0
If your table is MyISAM, DELETE operations lock the table and it is not accessible by the concurrent queries. If there are many records to delete, the table is locked for too long. Split your DELETE statement into several shorter batches.
2
1
0
I'm running django site with MySQL as DB back-end. Finally i've got 3 millions rows in django_session table. Most of them are expired, thus i want to remove them. But if i manually run delete from django_session where expire_date < "2011-04-18" whole site seems to be hanged - it cannot be accessed via browser. Why suc...
MySQL&django hangs on huge session delete
1.2
1
0
513
5,704,931
2011-04-18T15:06:00.000
1
0
1
0
python,string,parsing,list,intervals
5,705,006
6
false
0
0
Not that I'm aware of, but you can easily make your own: Create a results list. Split strings by , and start iterating over the result. If the current string contains a - append a range to the list. If the current string is a number, append it to the list. Else return an error. Return the list.
1
6
0
I have "2,5,7-9,12" string. I want to get [2, 5, 7, 8, 9, 12] list from it. Is there any built-in function for it in python? Thanks. UPD. I suppose, the straight answer is No. Anyway, thanks for your "snippets". Using one, suggested by Sven Marnach.
parse string of integer sets with intervals to list
0.033321
0
0
3,803
5,705,336
2011-04-18T15:35:00.000
4
0
1
0
python,eclipse,import,path,pydev
5,707,113
1
true
0
0
The problem was that I installed the library from an egg. Egg folders need to be added manually or otherwise PyDev won't see them. Another thing that confused me a little was that I had another version of the same library installed as a regular folder. That folder however didn't have __init__.py in it.
1
8
0
I'm using Eclipse Helios under Ubuntu. Whenever I install a new library under /usr/local/lib/python2.6/dist-packages/ using pip, Eclipse doesn't see it and complains about invalid imports. I double checked the library is in place. Importing it works from the interpreter. Refreshing the PyDev configuration or restarting...
Refresh PyDev import paths in Eclipse
1.2
0
0
1,749
5,705,420
2011-04-18T15:41:00.000
1
0
0
0
python,twisted
5,707,345
1
false
0
0
You have code in the sample you pasted which takes an action when an XML-RPC call completes. printValue prints the result of a call and printError print an error which occurs during a call. If you want to make another call after one finishes, then maybe instead of just printing something in printValue, you could issue...
1
1
0
I have a simple client code using xmlrpclib. try: Server.func1 Server.func2 ..... Server.funcN except: pass , where Server - ServerProxy from xmlrpclib. How to do this on twisted ? I see this example: from twisted.web.xmlrpc import Proxy from twisted.internet import reactor def printV...
using several xmlrpc commands on twisted
0.197375
0
1
305
5,705,659
2011-04-18T16:02:00.000
5
0
0
1
python,subprocess,orphan
5,705,904
2
true
0
0
You can use socketpair() to create a pair of unix domain sockets before creating the subprocess. Have the parent have one end open, and the child the other end open. When the parent exits, it's end of the socket will shut down. Then the child will know it exited because it can select()/poll() for read events from it...
1
6
0
In python, I have a parent process that spawns a handful of child processes. I've run into a situation where, due to an unhandled exception, the parent process was dieing and the child processes where left orphaned. How do I get the child processes to recognize that they've lost their parent? I tried some code that hoo...
How to Detect in Sub Process When Parent Process Has Died?
1.2
0
0
1,656
5,706,597
2011-04-18T17:31:00.000
2
1
0
1
python,linux,change-password
5,706,671
3
false
0
0
You can modify /etc/passwd (/etc/shadow) with Python script which will need root permissions sudo python modify.py /etc/passwd (where modify.py is your script that will change password)
1
1
0
How can i change password of ubuntu root user by python script? Thanks.
Changing password, python, linux
0.132549
0
0
4,855
5,707,549
2011-04-18T19:00:00.000
2
0
1
0
python,list,object,performance
5,707,574
2
false
0
0
Lists-in-lists are typically more efficient (builtin types), but you shouldn't care about efficiency until you have to; it will be more maintainable and easier to work with if you use objects. There's the old adage: "Never optimize until you need to."
2
2
0
I have a list and in each list element, I need some details. What will be more efficient to use the list in the list [['brown', 'wood', 2], ['red', 'box', 3 ],...] Or create a new class for the parameters(details) of color, type, etc.. and creating objects from this class in every element of the list. [object1,objec...
Python, use the lists in the list, or objects in the list?
0.197375
0
0
84
5,707,549
2011-04-18T19:00:00.000
3
0
1
0
python,list,object,performance
5,707,570
2
true
0
0
List of lists will be more efficient(as in less overhead for function calls, object creation, object destruction etc and take up less space in memory), however creating a new class might be better for readability, writability, and maintainability. My opinion is that you shouldn't worry about these micro optimizations ...
2
2
0
I have a list and in each list element, I need some details. What will be more efficient to use the list in the list [['brown', 'wood', 2], ['red', 'box', 3 ],...] Or create a new class for the parameters(details) of color, type, etc.. and creating objects from this class in every element of the list. [object1,objec...
Python, use the lists in the list, or objects in the list?
1.2
0
0
84
5,709,090
2011-04-18T21:23:00.000
3
0
0
0
python,macos
5,709,166
1
true
0
0
PyQt has an integrated web browser in it. So any app you make with PyQt can also include a browser window. PyQt is cross-platfrom so it should work on a mac as well.
1
0
0
Is there a Python library that will easily display a web page in a small window on Mac? I just want to display a web page when the user clicks a button, but without the user having to leave my app.
Python library to display a web page on Mac
1.2
0
0
96
5,709,688
2011-04-18T22:38:00.000
4
1
1
0
python,email,mime
5,710,604
2
true
0
0
One difference I found was that MIMEText has the Content-Type header set to something like 'text/plain'; whereas, Message does not set this header. For me, that's a good enough reason to default to MIMEText, but I'd be interested to know if there are other differences.
1
8
0
I don't know a whole lot about the technical details for constructing and sending email (I figure that's what libraries are for). Seems like both of these classes can be used to construct a basic text email, so which one should I use? What are the differences between these? When is appropriate to use one vs. the other?
When should I use email.message.Message vs. email.mime.text.MIMEText when constructing an email in Python?
1.2
0
0
783
5,710,391
2011-04-19T00:46:00.000
35
0
1
0
python,dictionary,keyword-argument
52,238,771
3
false
0
0
** operator would be helpful here. ** operator will unpack the dict elements and thus **{'type':'Event'} would be treated as type='Event' func(**{'type':'Event'}) is same as func(type='Event') i.e the dict elements would be converted to the keyword arguments. FYI * will unpack the list elements and they would be trea...
1
422
0
I want to build a query for sunburnt(solr interface) using class inheritance and therefore adding key - value pairs together. The sunburnt interface takes keyword arguments. How can I transform a dict ({'type':'Event'}) into keyword arguments (type='Event')?
Converting Python dict to kwargs?
1
0
0
190,452
5,712,062
2011-04-19T05:39:00.000
1
1
0
1
python,bash,fabric
5,712,086
3
false
0
0
This only works for the current shell. Close the shell, start a new one and type date, you will see that the TZ has reset to the default timezone. Even for Fabric if you capture the output, you'd see that the TimeZone does get set correctly but as the script ends, so does the shell and hence the TZ variable is no longe...
1
4
0
I'm trying to change my remote server's timezone via Fabric like so: run("export TZ=\":Pacific/Auckland\"") run("date") This doesn't seem to work. run("date") gives me: Tue Apr 19 00:19:58 CDT 2011 which is not the timezone I just set. If I just log into the server and run the same bash commands, everything's just as...
How do I set remote server TimeZone via Fabric?
0.066568
0
0
733
5,712,857
2011-04-19T07:14:00.000
1
0
0
0
python,django,mongodb,pymongo,mongoengine
6,248,071
4
false
1
0
mongoengine will use the pymongo driver to connect to mongodb. If you are familiar with django.. use mongoengine
2
35
0
For one of my projects I prefered using Django+Mongo. Why should I use MongoEngine, but not just PyMongo? What are advantages? Querying with PyMongo gives results that are allready objects, aren't they? So what is the purpose of MongoEngine?
PyMongo vs MongoEngine for Django
0.049958
0
0
27,617
5,712,857
2011-04-19T07:14:00.000
21
0
0
0
python,django,mongodb,pymongo,mongoengine
5,712,928
4
true
1
0
I assume you have not read the MongoEngine claim. MongoEngine is a Document-Object Mapper (think ORM, but for document databases) for working with MongoDB from Python. This basically say it all. In addition: your claim that Pymongo would deliver objects is wrong....well in Python everything is an object - even ...
2
35
0
For one of my projects I prefered using Django+Mongo. Why should I use MongoEngine, but not just PyMongo? What are advantages? Querying with PyMongo gives results that are allready objects, aren't they? So what is the purpose of MongoEngine?
PyMongo vs MongoEngine for Django
1.2
0
0
27,617
5,713,253
2011-04-19T07:54:00.000
9
0
1
0
python
5,713,264
2
true
0
0
Python's blocks are indentation-based, not delimiter-based, therefore it is possible to unambiguously associate an else clause with its corresponding primary clause.
2
3
0
Just want confirmation that this assertion is correct: python cannot ever experience the dangling else problem UPDATE fixed typo
Dangling else in python
1.2
0
0
2,481
5,713,253
2011-04-19T07:54:00.000
0
0
1
0
python
58,399,359
2
false
0
0
The dangling else is a problem in computer programming in which an optional else clause in an if-else statement results in a nested condition being ambiguous. Formally, the problem is with nested if, if there is only one else statement.
2
3
0
Just want confirmation that this assertion is correct: python cannot ever experience the dangling else problem UPDATE fixed typo
Dangling else in python
0
0
0
2,481
5,714,263
2011-04-19T09:26:00.000
0
0
0
0
java,python,continuous-integration,jython,jenkins
5,714,293
3
false
1
0
Since Jython can produce Java classes I see no reason why this should not work. Note that you will need to learn at least some things about Java (mostly the platform, not necessarily the language) in order to be able to write plugins for Jenkins.
1
8
0
Is it possible to write Jenkins plugins using Python (via Jython), and if so, where would I get started? I don't know Java (and don't have a real interest in learning it at the moment) so being able to use Python would be nice for me.
Can I extend Jenkins with Jython/Python
0
0
0
2,437
5,714,462
2011-04-19T09:43:00.000
0
0
0
0
python,google-app-engine,django-templates
5,714,546
2
false
1
0
There are 2 solutions: You should filter the data before passing it into view You can write additional function in model for retrieving the key if it`s not a field already Can you explain exactly what is **__key__** ?
1
0
0
How can I access key field of model into django template?
Accessing key field into Django Template
0
0
0
125
5,715,251
2011-04-19T10:55:00.000
2
0
1
0
python,return
5,718,688
3
false
0
0
The core problem you are seeing is that a function which "falls off the end" (i.e. reaches the end of the code without returning a value or raising an exception) will implicitly return None to the caller. Hence the suggestion from Daren to include an explicit return at the end to see what is happening and aix noting th...
1
0
0
I'm currently working on XML (SVG) traversing and have the next problem: my function always return None after if currNode.parentNode is rootNode:, though, as you can see in the code below, I've explicitly set return to 'flag', which is non-empty string. The most interesting part here is that print('...') prints three d...
'return' with not-None expression list returns 'None'
0.132549
0
0
862
5,715,320
2011-04-19T11:01:00.000
3
0
0
0
python,django,postgresql,django-south,reinstall
5,716,010
1
true
1
0
South creates a table in your database to track migrations that have been applied. The table is south_migrationhistory. You probably want to either drop the table (and re-sync your db) or delete it's contents. I imagine at the moment south thinks that it's applied migration that it hasn't, which may be confusing thin...
1
2
0
I'm in the classic position of the novice coder, where in hindsight I'd do many things differently if I were starting my project over. I used South relatively early in my project, ran into some problems due to my lack of knowledge, and abandoned it, removing it from installed apps, and syncing the DB. I then learned ...
How do I reintroduce South to my Django project?
1.2
0
0
538
5,717,738
2011-04-19T14:12:00.000
6
0
1
0
python,boolean,isinstance
5,717,795
2
false
0
0
As nightcracker said, command line arguments are strings. You can use sys.argv[2] in ('True', 'False').
2
8
0
in Python, i'd like to check to make sure a command line argument is of type bool before I use it in a conditional statement. this: isinstance(sys.argv[2], bool) is coming back false. What's the right way to do this?
isinstance of bool?
1
0
0
4,502
5,717,738
2011-04-19T14:12:00.000
7
0
1
0
python,boolean,isinstance
5,717,759
2
true
0
0
All command line arguments are strings. Please refine what you want. If you want to check for the argument true, check if sys.argv[2] equals 'true'.
2
8
0
in Python, i'd like to check to make sure a command line argument is of type bool before I use it in a conditional statement. this: isinstance(sys.argv[2], bool) is coming back false. What's the right way to do this?
isinstance of bool?
1.2
0
0
4,502
5,719,506
2011-04-19T16:19:00.000
0
1
0
1
python,c,linux,unix,makefile
5,727,575
2
false
0
0
I would separate the project out into two parts. Your C part can use make as usual. Your python module can use the python setup tools, which are capable of building extensions. (You can also write install targets, so you don't have to copy things manually)
1
4
0
I have a project which is mostly written in C, but it also has a Python API which uses Python extension modules written in C. What is the best way to write installation/deployment scripts for a Linux/UNIX environment? Usually, I use the make utility to compile and install projects written in C. Most of the time, I ju...
Install script for C project with Python API
0
0
0
146
5,721,831
2011-04-19T19:49:00.000
13
0
0
0
python,numpy,numbers
5,729,858
3
true
0
0
Not that I am aware of. You either need to specify the dtype explicitly when you call the constructor for any array, or cast an array to float32 (use the ndarray.astype method) before passing it to your GPU code (I take it this is what the question pertains to?). If it is the GPU case you are really worried about, I fa...
1
28
1
Is there any clean way of setting numpy to use float32 values instead of float64 globally?
Python: Making numpy default to float32
1.2
0
0
13,987
5,721,948
2011-04-19T19:58:00.000
2
1
1
1
python,windows,development-environment
5,722,080
2
false
0
0
To make python executable on your command line, you need to add it to your PATH environment variable, which it sounds like you have done on the command line. It is quite simple to add directories to the PATH in Windows if you know where to look. Essentially, you need to get to the Environment Variables dialog box, whic...
1
1
0
Yes, I've searched. So after spending about 4-5 hours struggling just to get Python files running, I recently stumbled over the solution to get it running through the environment variables like this: cmd -> python -> Python starts, yay yay Since it didn't work to do it through the command line and similar I had to do i...
Setting up a Python development environment on Windows
0.197375
0
0
694
5,722,739
2011-04-19T21:08:00.000
1
0
0
0
java,python,ruby,jruby,jython
5,723,661
2
true
1
0
I know for a fact that you can call all your Java libraries using JRuby. You can use the ruby programming language on your front and back end via Rails (Rails is a framework written in ruby). The difference between MRI (Matz Ruby) and JRuby is that JRuby runs on the JVM, whereas MRI has its own VM which is different fr...
1
0
0
I am evaluating what I will use on the front and back ends of a project. I definitely will need to use some 3rd party Java libraries, but I am curious whether there is a nice way to do the front and back-end layer in something like Ruby or Python? Or is it possible to just call the Java libraries from Ruby/Python and ...
Using JRuby or Python to call some 3rd party Java libraries - architecture question
1.2
0
0
215
5,723,719
2011-04-19T22:55:00.000
-3
0
0
1
python,c,makefile,compilation
5,723,765
2
false
0
0
One way to simplify the build is skip dependencies. Just recompile everything every time. Only if the build has to be done many times, or it takes a "long time", the definition of which depends on the use, and the dependencies change a lot, does it make sense to do a detailed dependency build.
1
2
0
Abstract question: I'm programming a mid-size C++/C program that's highly modularized. It has a common interface, which allows you to drop in a number of different sources with the same function declarations, but different implementations and get executables with different functionalities. I'm working out a make syste...
Is There a Way to Autogenerate Dependencies Tree in Makefile?
-0.291313
0
0
2,038
5,726,440
2011-04-20T06:39:00.000
1
0
0
0
python,mysql,django,mysql-error-1045
8,742,834
1
true
1
0
I found the problem I was having. Django was importing a different settings.py file. I had another django project inside my django product like myproject/myproject/. Instead of importing myproject/settings.py, it was importing myproject/myproject/settings.py I assume that Aptana Studio created that project there. If ...
1
1
0
I have had a virtualenv for Trunk up and running for a while, but now I am trying to branch, and get things setup on another virtualenv for my 'refactor' branch. Everything looks to be setup correctly, but when I try to run any manage.py commands, I get this error: _mysql_exceptions.OperationalError: (1045, "Access den...
Can't access MySQL database in Django VirtualEnv on localhost
1.2
1
0
1,450
5,732,017
2011-04-20T14:29:00.000
1
0
1
0
python,development-environment,virtual-machine,smalltalk,pharo
5,739,164
4
true
0
0
AFAIK, no. There isn't anything like a Smalltalk image for Python.
2
7
0
I like programming in the Python language to solve daily problems in system administration contexts, and I am happy with that. I am learning Pharo Smalltalk and am fascinated by the different approach of this language in object programming. I like very much the idea of the Smalltalk virtual machine and the system image...
Python development environments like Smalltalk
1.2
0
0
978
5,732,017
2011-04-20T14:29:00.000
0
0
1
0
python,development-environment,virtual-machine,smalltalk,pharo
12,063,705
4
false
0
0
Actually there is nothing like smalltalk in any other kind of language. The only thing ever to get close was and still is Delphi and its open source brother Free Pascal + Lazarus but still because it tried to keep ties with C/C++ its very different as a language and environment. I love python as a language and because ...
2
7
0
I like programming in the Python language to solve daily problems in system administration contexts, and I am happy with that. I am learning Pharo Smalltalk and am fascinated by the different approach of this language in object programming. I like very much the idea of the Smalltalk virtual machine and the system image...
Python development environments like Smalltalk
0
0
0
978
5,732,384
2011-04-20T14:56:00.000
0
1
0
1
python,wordpress
5,732,608
2
false
1
0
Urllib is an option, but because your script is running on the local machine anyway, I would probably use os.system. That way you can execute the php script like from a shell. You have to look into the php file on how to pass the parameters.
2
3
0
I have a python program that sets up a wordpress site on my server. It downloads the zip and unzips it into a directory, sets up the database and user, configures the config file. Now I would like to call the the wp_install function in wp-admin/include/upgrade.php and pass it the parameters it needs $weblog_title, $use...
Automate WordPress Install from python
0
0
0
1,206
5,732,384
2011-04-20T14:56:00.000
1
1
0
1
python,wordpress
5,732,698
2
false
1
0
It looks like wp_install() gets called inside of /wp-admin/install.php during step 1, and after form data has been validated. If you submit ?step=1& ... (all of the other required form fields) it should result in calling wp_install. So yes, you should be able to use urllib(2) for this.
2
3
0
I have a python program that sets up a wordpress site on my server. It downloads the zip and unzips it into a directory, sets up the database and user, configures the config file. Now I would like to call the the wp_install function in wp-admin/include/upgrade.php and pass it the parameters it needs $weblog_title, $use...
Automate WordPress Install from python
0.099668
0
0
1,206
5,734,186
2011-04-20T17:22:00.000
0
0
1
0
python,django
5,737,203
3
false
1
0
Or import(module,globals(),locals(),['classname',],-1)
2
0
0
I want to import a class from python module. The module contains multiple classes and which one I need is determined by a string at runtime. Edit: I'm using python 2.6.5, django 1.3.
How do I replicate "from module import class" with __import__() or django.utils.importlib?
0
0
0
250
5,734,186
2011-04-20T17:22:00.000
1
0
1
0
python,django
5,734,239
3
true
1
0
With judicious use of getattr().
2
0
0
I want to import a class from python module. The module contains multiple classes and which one I need is determined by a string at runtime. Edit: I'm using python 2.6.5, django 1.3.
How do I replicate "from module import class" with __import__() or django.utils.importlib?
1.2
0
0
250
5,735,645
2011-04-20T19:31:00.000
1
0
1
0
python,file-io
5,735,661
3
false
0
0
Notepad should be alright, as I do not believe it places a lock on the file. If it however is open in Microsoft Excel, a lock is placed on the file, so you cannot write to it.
1
0
0
I'm using csv.writer to write to file. Is it okay if the file is open in notepad at the same time? What about programs other than notepad?
can python write to file while file is open in notepad?
0.066568
0
0
439
5,735,827
2011-04-20T19:50:00.000
2
0
1
0
debugging,gdb,cuda,pycuda,gdb-python
5,736,173
2
true
0
0
cuda-gdb spills all shared memory and registers to local memory. So when something runs ok built for debugging and fails otherwise, it usually means out of bounds shared memory access. cuda-memcheck might help, depending on what sort of card you are using. Fermi is better than older cards in that respect. EDIT: Casting...
2
0
0
Anyone know likely avenues of investigation for kernel launch failures that disappear when run under cuda-gdb? Memory assignments are within spec, launches fail on the same run of the same kernel every time, and (so far) it hasn't failed within the debugger. Oh Great SO Gurus, What now?
CUDA/PyCUDA: Diagnosing launch failure that disappears under cuda-gdb
1.2
0
0
792
5,735,827
2011-04-20T19:50:00.000
0
0
1
0
debugging,gdb,cuda,pycuda,gdb-python
5,748,527
2
false
0
0
CUDA GDB can make some of the cuda operations synchronous. Are you reading from a memory after has been initialized ? are you using Streams? Are you launching more than one kernel? Where and how does it fail ?
2
0
0
Anyone know likely avenues of investigation for kernel launch failures that disappear when run under cuda-gdb? Memory assignments are within spec, launches fail on the same run of the same kernel every time, and (so far) it hasn't failed within the debugger. Oh Great SO Gurus, What now?
CUDA/PyCUDA: Diagnosing launch failure that disappears under cuda-gdb
0
0
0
792
5,736,264
2011-04-20T20:31:00.000
6
0
1
0
python,singleton,static-methods
5,736,285
1
false
0
0
By definition, a static method does not have a self parameter. That's what makes it static. If it did have a self parameter, it would be a regular method and not a static method.
1
1
0
As in the title I want to know how to have a self instance in a staticmethod in python.
How to have a self instance in a staticmethod in Python
1
0
0
213
5,736,868
2011-04-20T21:29:00.000
3
0
0
0
python,django,web-services,testing,rest
5,750,681
2
false
1
0
As the author of django-rest-framework it'd be great to pick your brains about which bits of functionality could do with fleshing out. :) (obv i've got some thoughts of my own and areas I'm planning to work on, but be really good to get some user perspective) Your absolutely right about the API browser not being limite...
1
3
0
I'm writing a set of REST services for a Django project. I've been using django-rest-framework for a while. Because of its limited functionality I had to switch to django-piston which I quite enjoy. However, django-rest-framework had one really nice feature - it was able to display an admin-like interface for testing t...
Django REST browser interface
0.291313
0
0
2,220
5,737,483
2011-04-20T22:42:00.000
6
0
0
0
python,django,svn
5,737,523
1
true
1
0
You can have a post-commit hook in the svn repo that uses, ideally, a restful interface to your Django app and adds the note. That way your app remains very simple.
1
1
0
I have a small bug tracker written in django. I'd like to integrate it with an svn repository so that when someone commits to svn it will automatically add a note to an issue in the bug tracker. Does anyone have any input on how to best approach this? Should I setup svn hooks? use a cron job and pull from the log?
SVN Integration with django
1.2
0
0
478
5,742,472
2011-04-21T09:59:00.000
2
1
0
0
python,ide
5,742,542
8
false
0
0
Eclipse with Pydev nothing better out there
4
1
0
please advise me some good Python IDE, I was using netbeans but it does not have suitable code completion (when I press "." it gives me methods of all classes of python. It would be nice if netbeans would work as for ex. for PHP.. Thank you.
Python IDE with auto completion
0.049958
0
0
1,928
5,742,472
2011-04-21T09:59:00.000
1
1
0
0
python,ide
5,742,663
8
true
0
0
well, many IDEs now come with pretty good code completion. Eclipse with pydev is nice, or you can get aptana studio 3 to perform similar to it. Theres also jetbrain's PyCharm, if you don't mind paying for a licence (they do give a trial version too if you want to test it before buying). There are a lot of such IDEs, gu...
4
1
0
please advise me some good Python IDE, I was using netbeans but it does not have suitable code completion (when I press "." it gives me methods of all classes of python. It would be nice if netbeans would work as for ex. for PHP.. Thank you.
Python IDE with auto completion
1.2
0
0
1,928
5,742,472
2011-04-21T09:59:00.000
1
1
0
0
python,ide
5,743,360
8
false
0
0
PyCharm for pay or Komodo Edit for free.
4
1
0
please advise me some good Python IDE, I was using netbeans but it does not have suitable code completion (when I press "." it gives me methods of all classes of python. It would be nice if netbeans would work as for ex. for PHP.. Thank you.
Python IDE with auto completion
0.024995
0
0
1,928
5,742,472
2011-04-21T09:59:00.000
1
1
0
0
python,ide
5,742,508
8
false
0
0
Try Geany and Ctrl+Enter. Foo bar <= wrote this because SO said answer was to short ;)
4
1
0
please advise me some good Python IDE, I was using netbeans but it does not have suitable code completion (when I press "." it gives me methods of all classes of python. It would be nice if netbeans would work as for ex. for PHP.. Thank you.
Python IDE with auto completion
0.024995
0
0
1,928
5,743,946
2011-04-21T12:15:00.000
1
0
0
0
python,pygame,pacman
5,763,788
3
false
0
1
You could do this with Tkinter about as easily (or easier) than most other toolkits. Since pac-man graphics set the bar pretty low you could code this all by using the canvas widget. This is arguably the most portable solution since Tkinter is the official, bundled GUI toolkit so you won't require people to download an...
1
1
0
I basically want to make a clone of the classic game Pacman using Python. I would like to keep all the original graphics, sounds, etc. Perhaps being able to have the game in windowed mode would be useful. With Java I would just use Swing and be done with it. But I'd really like to use Python and make it possible for th...
What would be a good python library to use to write a portable version of pacman with nice graphics?
0.066568
0
0
310