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
4,052,990
2010-10-29T14:53:00.000
1
1
1
0
c#,python,c++
4,056,557
3
false
0
0
XML is well supported across basically every language. It may become verbose for large maps, however, depending on how you encode the map data in XML. JSON might not be a good choice, simply because I don't think it supports multiline strings, which would be helpful (although not really necessary) YAML is another alte...
2
0
0
I'm trying to figure out how I can best save the map data for a 2d ORPG engine I am developing, the file would contain tile data (Is it blocked, what actual graphics would it use, and various other properties). I am currently using a binary format but I think this might be a bit too limited and hard to debug, what alte...
Saving map data in a 2d ORPG
0.066568
0
0
446
4,052,990
2010-10-29T14:53:00.000
1
1
1
0
c#,python,c++
4,062,198
3
true
0
0
Personally, I would stick with a binary format. Whatever method you choose, it's going to be a pain in the ass to edit by hand anyway, so you may as well stick to binary which gives you a size and speed advantage. You're also going to want a map editor anyway so that you do not have to edit it by hand.
2
0
0
I'm trying to figure out how I can best save the map data for a 2d ORPG engine I am developing, the file would contain tile data (Is it blocked, what actual graphics would it use, and various other properties). I am currently using a binary format but I think this might be a bit too limited and hard to debug, what alte...
Saving map data in a 2d ORPG
1.2
0
0
446
4,053,662
2010-10-29T16:02:00.000
2
1
1
0
python,python-datamodel
4,053,781
4
false
0
0
If not specified in the documentation, it is implementation specific. Implementations other that CPython might re-use the iter method to implement iterkeys and others. I would not consider this to be a bug, but simply a bit of freedom for the implementors. I suspect there is a performance factor in implementing the me...
2
1
0
just encountered a problem at dict "type" subclassing. I did override __iter__ method and expected it will affect other methods like iterkeys, keys etc. because I believed they call __iter__ method to get values but it seems they are implemented independently and I have to override all of them. Is this a bug or intenti...
Python std methods hierarchy calls documented?
0.099668
0
0
142
4,053,662
2010-10-29T16:02:00.000
1
1
1
0
python,python-datamodel
4,053,834
4
false
0
0
You know the saying: "You know what happens when you assume." :-) They don't officially document that stuff because they may decide to change it in the future. Any unofficial documentation you may find would simply document the current behavior of one Python implementation, and relying on it would result in your code...
2
1
0
just encountered a problem at dict "type" subclassing. I did override __iter__ method and expected it will affect other methods like iterkeys, keys etc. because I believed they call __iter__ method to get values but it seems they are implemented independently and I have to override all of them. Is this a bug or intenti...
Python std methods hierarchy calls documented?
0.049958
0
0
142
4,054,205
2010-10-29T17:05:00.000
-1
0
0
0
c#,python,xml,dataset,schema
4,054,231
3
false
0
0
hey dude - take beautifulSoup - it is a super library. HEAD over to the site scraperwiki.com the can help you!
2
1
0
I'm looking to parse a xml file using Python and I was wondering if there was any way of automating the task over manually walking through all xml nodes/attributes using xml.dom.minidom library. Essentially what would be sweet is if I could load a xml schema for the xml file I am reading then have that automatically ge...
Python XML Parse (using schema to generate dataset)
-0.066568
0
1
931
4,054,205
2010-10-29T17:05:00.000
0
0
0
0
c#,python,xml,dataset,schema
4,054,752
3
false
0
0
You might take a look at lxml.objectify, particularly the E-factory. It's not really an equivalent to the ADO tools, but you may find it useful nonetheless.
2
1
0
I'm looking to parse a xml file using Python and I was wondering if there was any way of automating the task over manually walking through all xml nodes/attributes using xml.dom.minidom library. Essentially what would be sweet is if I could load a xml schema for the xml file I am reading then have that automatically ge...
Python XML Parse (using schema to generate dataset)
0
0
1
931
4,054,254
2010-10-29T17:10:00.000
1
0
0
0
python,delay
4,054,980
5
false
0
0
Also you can try to use few proxy servers for prevent ban by IP adress. urllib support proxies by special constructor parameter, httplib can use proxy too
2
67
0
I have written a program which sends more than 15 queries to Google in each iteration, total iterations is about 50. For testing I have to run this program several times. However, by doing that, after several times, Google blocks me. is there any ways so I can fool google maybe by adding delays between each iteration? ...
How to add random delays between the queries sent to Google to avoid getting blocked in python
0.039979
0
1
111,313
4,054,254
2010-10-29T17:10:00.000
4
0
0
0
python,delay
4,054,614
5
false
0
0
Since you're not testing Google's speed, figure out some way to simulate it when doing your testing (as @bstpierre suggested in his comment). This should solve your problem and factor its variable response times out at the same time.
2
67
0
I have written a program which sends more than 15 queries to Google in each iteration, total iterations is about 50. For testing I have to run this program several times. However, by doing that, after several times, Google blocks me. is there any ways so I can fool google maybe by adding delays between each iteration? ...
How to add random delays between the queries sent to Google to avoid getting blocked in python
0.158649
0
1
111,313
4,055,017
2010-10-29T19:01:00.000
5
0
1
0
python,user-interface,tkinter
4,055,447
1
true
0
1
There is no option to associate a variable with a text widget. You can achieve the same thing by using variable traces and widget bindings but it's rarely worth the effort. The typical way to interact with the text widget is to read a file into a variable then use the insert method of the widget to put the text into th...
1
0
0
so I've got this little Text widget with a scroll bar and I've got a question. How do I make text in this Text widget a variable ? If I made this text a variable I would be able to open a text file and edit it's text or save the text I've written, etc or maybe it's a wrong way that I'm approaching this, is there a bett...
Text in Text Widget as a variable
1.2
0
0
1,548
4,055,267
2010-10-29T19:35:00.000
1
0
0
0
python,windows,user-interface,window,tkinter
41,426,823
5
false
0
1
Try this, and it surely works; Create an event function to move window: def movewindow(event): root.geometry('+{0}+{1}'.format(event.x_root, event.y_root)) Bind window: root.bind('', movewindow) Now you can touch the the window and drag
1
17
0
Any suggestions on how one might create event bindings that would allow a user to mouse drag a window without borders, eg. a window created with overridedirect(1)? Use case: We would like to create a floating toolbar/palette window (without borders) that our users can drag around on their desktop. Here's where I'm at i...
Tkinter: Mouse drag a window without borders, eg. overridedirect(1)
0.039979
0
0
20,122
4,058,878
2010-10-30T13:26:00.000
0
0
1
0
python,multithreading,user-interface,tkinter
5,036,358
1
false
0
1
Definitely go the Queue route. Nothing in Tkinter is setup for being threadsafe :(
1
3
0
Are Tkinter StringVar (IntVar, FloatVar, etc) thread safe, eg. can a background thread read or write to these objects? Or must I use a Queue to pass information between my background thread and my main Tkinter GUI thread and have my main Tkinter thread pop the Queue and update the application's StringVar's accordingly?...
Python/Tkinter: Are Tkinter StringVar (IntVar, etc) thread safe?
0
0
0
1,582
4,059,201
2010-10-30T14:49:00.000
6
1
0
0
python,wxpython,ironpython
4,059,227
4
true
0
1
IronPython isn't a variant of Python, it is Python. It's an implementation of the Python language based on the .NET framework. So, yes, it is pure Python. IronPython is caught up to CPython (the implementation you're probably used to) 2.6, so some of the features/changes seen in Python 2.7 or 3.x will not be present in...
3
4
0
I just downloaded the original Python interpreter from Python's site. I just want to learn this language but to start with, I want to write Windows-based standalone applications that are powered by any RDBMS. I want to bundle it like any typical Windows setup. I searched old posts on SO and found guys suggesting wxPyth...
Is IronPython a 100% pure Python variant?
1.2
0
0
1,297
4,059,201
2010-10-30T14:49:00.000
1
1
0
0
python,wxpython,ironpython
4,059,540
4
false
0
1
IronPython is an implementation of Python using C#. It's just like the implementation of Python using Java by Jython. You might want to note that IronPython and Jython will always lag behind a little bit in development. However, you do get the benefit of having some libraries that's not available in the standard Python...
3
4
0
I just downloaded the original Python interpreter from Python's site. I just want to learn this language but to start with, I want to write Windows-based standalone applications that are powered by any RDBMS. I want to bundle it like any typical Windows setup. I searched old posts on SO and found guys suggesting wxPyth...
Is IronPython a 100% pure Python variant?
0.049958
0
0
1,297
4,059,201
2010-10-30T14:49:00.000
1
1
0
0
python,wxpython,ironpython
4,059,291
4
false
0
1
what does "Pure Python" mean? If you're talking about implemented in Python in the same sense that a module may be pure python, then no, and no Python implementation is. If you mean "Compatible with cPython" then yes, code written to cPython will work in IronPython, with a few caveats. The one that's likely to matte...
3
4
0
I just downloaded the original Python interpreter from Python's site. I just want to learn this language but to start with, I want to write Windows-based standalone applications that are powered by any RDBMS. I want to bundle it like any typical Windows setup. I searched old posts on SO and found guys suggesting wxPyth...
Is IronPython a 100% pure Python variant?
0.049958
0
0
1,297
4,059,691
2010-10-30T16:53:00.000
1
0
1
0
python,validation,conditional-statements
4,059,701
3
false
0
0
Use Python's language services to parse and compile the string, then execute the resulting AST.
2
0
0
what I am struggling with is testing predefined conditions which takes user provided parameters like in example below: cond = "if ( 1 is yes and 2 is no ) or ( 1 is yes and 2 is no )" cond2 = "if (3 is no or 1 is no )" vars = [] lst = cond.split() lst += cond2.split() for l in lst: if l.isdigit(): ...
python: how to validate userdefined condition?
0.066568
0
0
618
4,059,691
2010-10-30T16:53:00.000
0
0
1
0
python,validation,conditional-statements
4,060,569
3
false
0
0
so, after some reading based on Ignacio's tip, I think I have it after some string modifications. However, still not quite sure if this is the right approach. So, my condition variable is defined as below cond = """if ( 'no' is 'yes' and 'no' is 'no' ): result.append[1] else: result.append[0] """ Additionall...
2
0
0
what I am struggling with is testing predefined conditions which takes user provided parameters like in example below: cond = "if ( 1 is yes and 2 is no ) or ( 1 is yes and 2 is no )" cond2 = "if (3 is no or 1 is no )" vars = [] lst = cond.split() lst += cond2.split() for l in lst: if l.isdigit(): ...
python: how to validate userdefined condition?
0
0
0
618
4,059,706
2010-10-30T16:58:00.000
9
0
1
0
python,persistent,zeromq
4,374,385
3
true
0
0
As far as I know, Zeromq does not have any persistence. It is out of scope for it and needs to be handled by the end user. Just like serializing the message. In C#, I have used db4o to add persistence. Typically I persist the object in its raw state, then serialize it and send it to ZMQ socket. Btw, this was for PUB/S...
2
15
0
Who has to manages the persistent in the ZeroMQ? When we use the ZeroMQ clients in Python language, what are the plug-ins/modules available to manage the persistent? I would like to know the patterns to use the ZeroMQ.
zeromq persistence patterns
1.2
0
0
10,288
4,059,706
2010-10-30T16:58:00.000
3
0
1
0
python,persistent,zeromq
9,593,144
3
false
0
0
On the application ends you can persist accordingly, for example I've built a persistance layer in node.js which communicated to back-end php calls and via websockets. The persistance aspect held messages for a certain period of time (http://en.wikipedia.org/wiki/Time_to_live) this was to give clients a chance to conn...
2
15
0
Who has to manages the persistent in the ZeroMQ? When we use the ZeroMQ clients in Python language, what are the plug-ins/modules available to manage the persistent? I would like to know the patterns to use the ZeroMQ.
zeromq persistence patterns
0.197375
0
0
10,288
4,059,851
2010-10-30T17:35:00.000
0
1
0
1
python,ruby,perl
4,060,827
3
false
0
0
The tomboy notes are saved as xml files so you could write a xml parser.
1
0
0
I am using sticky notes in ubuntu . And was wondering if it would be possible to read the text written in sticky notes using any scripting language .
is it possible to read the text written in a sticky note using a script in linux?
0
0
0
536
4,061,635
2010-10-31T02:54:00.000
0
0
0
0
python,postgresql,psycopg
4,061,641
2
false
0
0
You will definitely get an error the next time you try and execute a query, so I wouldn't worry if you can't alert the user at the exact instance they lose there network connection.
2
2
0
When connected to a postgresql database using psycopg and I pull the network cable I get no errors. How can I detect this in code to notify the user?
Python and psycopg detect network error
0
1
0
214
4,061,635
2010-10-31T02:54:00.000
0
0
0
0
python,postgresql,psycopg
4,069,833
2
true
0
0
psycopg can't detect what happens with the network. For example, if you unplug your ethernet cable, replug it and execute a query everything will work OK. You should definitely get an exception when psycopg tries to send some SQL to the backend and there is no network connection but depending on the exact netwokr probl...
2
2
0
When connected to a postgresql database using psycopg and I pull the network cable I get no errors. How can I detect this in code to notify the user?
Python and psycopg detect network error
1.2
1
0
214
4,061,828
2010-10-31T04:18:00.000
1
0
0
0
python,mysql,sqlalchemy,performance
4,061,902
3
true
1
0
I would create a read only slave to your mysql database and force its database engines to memory. You'd have to handle failures by re-initializing the read only database, but that can be scripted rather easily. This way you still have your persistence in the regular mysql database and your read speed in the read only ...
2
1
0
I am using Redis database where we store the navigational information. These data must be persistent and should be fetched faster. I don't have more than 200 MB data in this data set. I face problem when writing admin modules for redis db and I really missing the sql schema and power of django style admin modules. Now ...
fit mysql db in memory
1.2
1
0
1,165
4,061,828
2010-10-31T04:18:00.000
0
0
0
0
python,mysql,sqlalchemy,performance
4,061,848
3
false
1
0
I would think you could have a persistent table, copy all of the data into a MEMORY engine table whenever the server starts, and have triggers on the memory db for INSERT UPDATE and DELETE write to the persistent table so it is hidden for the user. Correct me if I'm wrong though, it's just the approach I would first t...
2
1
0
I am using Redis database where we store the navigational information. These data must be persistent and should be fetched faster. I don't have more than 200 MB data in this data set. I face problem when writing admin modules for redis db and I really missing the sql schema and power of django style admin modules. Now ...
fit mysql db in memory
0
1
0
1,165
4,063,482
2010-10-31T14:28:00.000
2
0
0
1
python,remote-debugging
4,300,007
1
true
0
0
Under Windows, I've experienced the same behavior you mention, i.e., remote debugging sometimes works, but often 'gets stuck'. I've found a few things helpful in resolving this situation: Make sure your firewall isn't blocking traffic to/from the ports being used by WingIDE and the process being debugged. (In my cas...
1
1
0
Using WingIDE to debug a web application, I have set a breakpoint in some Python code which runs when a web-form is submitted. Just before the breakpoint I have inserted 'import wingdbstub' to activate remote deubgging. However, execution does not stop at the breakpoint. I know the code is running because if I inser...
Remote debugging with WingIDE
1.2
0
0
879
4,063,534
2010-10-31T14:41:00.000
3
0
1
0
python
4,063,575
1
false
0
0
You can only tell if the job you're submitting is the shortest if you know the runtime of all your jobs in advance. This is not an easy thing to know without first running the jobs. SJF is rarely used for this reason. Scheduling in a FIFO is much easier; you stick the jobs in a list as they come in (with lst.append()) ...
1
0
0
Well , i want to test out which scheduling algorithm is suitable for my application , but unable to figure out on how to go about testing. i have a set of jobs to be executed , for SMP (Symmetric Multi Process ) execution i used Parallel Python , but not able to apply Job Scheduling algorithm . For ex: if i want to i...
How to perform Job scheduling algorithms using python?
0.53705
0
0
4,097
4,065,157
2010-10-31T21:12:00.000
2
0
0
0
python,django
4,065,182
3
false
1
0
I'd make all my times UTC, as that's a good international-level reference point, and you can always shift that to a local time, given that you know the user's TZ. I'd also use the time on the server (datetime.datetime.now()) rather than rely on the client's system clock, as this makes it easy to fake what time somethin...
1
2
0
My app in django requires to tell the user what time an action occurred. Aside from asking the user what timezone he/she is in, is it possible for me to generate the time on the client end? Off the top of my head, are there a particular representation of time that is timezone independent, (unix time?), and then I can ...
Django Time issues
0.132549
0
0
274
4,066,075
2010-11-01T01:16:00.000
2
0
0
0
python,data-structures,graph,sudoku
4,066,155
4
false
0
0
Others have reasonably suggested simply using a 2D array. I note that a 2D array in most language implementations (anything in which that is implemented as "array of array of X" suffers from additional access time overhead (one access to the top level array, a second to the subarray). I suggest you implement the data s...
1
6
1
What would be a smart data structure to use to represent a Sudoku puzzle? I.e. a 9X9 square where each "cell" contains either a number or a blank. Special considerations include: Ability to compare across row, column, and in 3X3 "group Ease of implementation (specifically in Python) Efficiency (not paramount) I suppo...
Proper data structure to represent a Sudoku puzzle?
0.099668
0
0
7,767
4,066,173
2010-11-01T01:46:00.000
0
0
1
0
python,imagemagick
4,066,240
2
false
0
0
It would be a lot more work than piping data to ImageMagick, but there are several Pango based solutions. I used pango and pygtk awhile back, and I am pretty sure you could develop a headless gtk or gdk application to render text to a pixbuf. A simpler solution might be to use the python cairo bondings. Pango works at...
1
4
0
I'm working in Python to create images from text. I've already been back and forth with PIL and frankly, its font and alignment options need a lot of work. I can subprocess Imagemagick and it works great, except that it seems to always need to write a file to disk. I would like to subprocess the image creation and just...
Using Imagemagick without making files?
0
0
0
1,322
4,066,328
2010-11-01T02:31:00.000
2
0
1
0
python,windows-xp
4,066,380
1
false
0
0
which in turn executes the script which ... How does it ‘execute’ the script? You mean an import? A subprocess call? Something else? Because “no viable alternative at input...” is a distinctive ANTLR parser error, and CPython 2.6 doesn't use that. Jython 2.5 does. But Jython shouldn't be trying to run the codecs modul...
1
1
0
I'm using a script which imports some modules, one being codecs. When the script is executed, I'll get a Traceback (most recent call last): on the import codecs line and SyntaxError: ('no viable alternative at input \'""\'', ('C:\\Python26\\lib\\codecs.py', 268, 17, ' return (b"", 0)\n')). This only occurs when...
Python: Syntax Error for imported module - 'codecs.py'
0.379949
0
0
1,142
4,066,571
2010-11-01T04:06:00.000
2
1
1
0
python,buildout,pypi,tipfy
4,066,739
6
false
0
0
To keep your headache in check, I would really recommend just bundling all such custom code with your package. Say you made a fork of some package. As long as its license allows it, I would just bundle the modified version of package with my code, as if it's just another directory. You can place it locally under packag...
1
5
0
I'm doing a few projects in python right now, and I'm trying to figure out how to work with my own versions of existing open source packages. For instance, I'm using tipfy with zc.buildout, and I've added in the 'paypal' package. Unfortunately it doesn't have a feature I need, so I've forked it on github and added the ...
Using custom packages on my python project
0.066568
0
0
1,349
4,067,499
2010-11-01T08:34:00.000
1
1
1
0
python,gmail,imap,imaplib,gmail-imap
4,069,524
2
true
0
0
Simple answer: yes. There is no concept of Deleted Items, Trash, etc. in IMAP. If you want to have a message in one of those folders after deletion, you have to copy it.
1
1
0
When I use google IMAP and try to delete message the message removes from folder but not going to trash folder. Did i must to copy this message before delete it?
Deleting using google IMAP (python, imaplib)
1.2
0
0
896
4,068,052
2010-11-01T10:20:00.000
0
0
0
0
java,python,django,jython
40,502,477
4
false
1
0
It might be what you wanted to avoid. but at the most simple way of things, using sockets / shared file with java will be the best solution. python socket can send information and revise it from java. On the other hand if that feel like a pain. if you use java and python at the same computer you can use a shared file, ...
1
5
0
Apologies if my question is noob. I'm running Django 1.2 with pgsql 8.4 and I'm required to run a Java program after getting the inputs from the user, does some calculations and return the results back to the user. May I know what is the best way to pass data between the Java and Python Django, such that the above scen...
passing data between java and python
0
0
0
5,214
4,068,906
2010-11-01T12:37:00.000
0
0
0
0
python,dll,windows-vista,qt4,pyqt4
4,453,952
1
false
0
1
Yes, Qt plugin infrastructure is a fairly simple and robust one. It attempts to load every file in sqldrivers directory. If it is successful, each dll then runs a function that registers all the features such a plugin supports. Then, you application initalizes. If all the features it needs are available, it works prope...
1
0
0
I'm experimenting with PyQT, and I was trying to figure out how to get it to work with Firebird. I built the Firebird driver, but couldn't get it to work, so I was thinking maybe I wasn't putting it in the right place. So I tried experimenting with the SQLite driver, since PyQT came with it already installed, with work...
Either Python, PyQT, QT, or Windows Vista is finding my dll, no matter what I rename it to. Is this normal?
0
0
0
284
4,072,844
2010-11-01T20:37:00.000
0
0
0
0
python,numpy,scipy
4,072,921
3
false
0
0
If your application is not sensitive to precision or you just want a quick overview, you could just fill the unknown data points with averages from neighbouring known data points (in other words, do naive linear interpolation).
1
7
1
Given some data of shape 20x45, where each row is a separate data set, say 20 different sine curves with 45 data points each, how would I go about getting the same data, but with shape 20x100? In other words, I have some data A of shape 20x45, and some data B of length 20x100, and I would like to have A be of shape 20x...
Add more sample points to data
0
0
0
5,913
4,073,352
2010-11-01T21:47:00.000
1
0
0
0
python,django
4,073,511
4
false
1
0
The devserver included with django is for testing purposes, only on your local machine and should not be used on a web host. From the docs: DO NOT USE THIS SERVER IN A PRODUCTION SETTING. It has not gone through security audits or performance tests. (And that's how it's gonna stay. We're in the business of mak...
1
1
0
I'm learning Django and working on sample sites.. I registered at alwaysdata but am unable to view the site after I go 'manage.py runserver' in the SSH (this is after I've created the project and navigated to the appropriate directory, of course). I appreciate any help. Thanks
Django + alwaysdata.com Noob Question
0.049958
0
0
1,444
4,073,928
2010-11-01T23:21:00.000
0
0
0
0
python,scroll,2d,pygame
14,293,575
5
false
0
1
You can have a 2 variables level_landlevel_d which see where you are in the level, Then check which sprites are in the visible area level_d+height and level_l+width, and draw them on the screen.
3
2
0
I'm currently making a 2D side-scrolling run'n'jump platform game in PyGame. Most of the stuff is working OK and very well in fact - I am exploiting the fast pyGame Sprite objects & groups. What I'm interested to know is how people usually deal with Rects for scrolling games. I obviously have a level that is much bigge...
Pygame: Updating Rects with scrolling levels
0
0
0
1,235
4,073,928
2010-11-01T23:21:00.000
0
0
0
0
python,scroll,2d,pygame
14,189,213
5
false
0
1
One method I found is to keep track of a scrollx and a scrolly. Then, just add scrollx and scroll y to the coordinates when you move the rectangles.
3
2
0
I'm currently making a 2D side-scrolling run'n'jump platform game in PyGame. Most of the stuff is working OK and very well in fact - I am exploiting the fast pyGame Sprite objects & groups. What I'm interested to know is how people usually deal with Rects for scrolling games. I obviously have a level that is much bigge...
Pygame: Updating Rects with scrolling levels
0
0
0
1,235
4,073,928
2010-11-01T23:21:00.000
1
0
0
0
python,scroll,2d,pygame
4,077,600
5
false
0
1
You could extend de Sprite.Group so it recives the camera information. Then do one of these options: A. Override the update method so it updates the on-screen coordinates of every sprite. B. Override the draw method so it updates the on-screen coordinates of every sprite and then calls its parent draw method. I think A...
3
2
0
I'm currently making a 2D side-scrolling run'n'jump platform game in PyGame. Most of the stuff is working OK and very well in fact - I am exploiting the fast pyGame Sprite objects & groups. What I'm interested to know is how people usually deal with Rects for scrolling games. I obviously have a level that is much bigge...
Pygame: Updating Rects with scrolling levels
0.039979
0
0
1,235
4,075,309
2010-11-02T06:11:00.000
0
1
0
0
php,.net,python,ruby
4,076,484
3
true
1
0
I presume you're using a CMS. If not, use one. WordPress is a good start. If you're developing from scratch, the usual method is to have two tables: one for page information (so title, menu position etc.) and then a page_content table, which has columns for page_id, content, and timestamp. As you save a page, instead o...
2
0
0
Our client wants us to implement change history for website articles. What is the best way to do it?
What is the best way to store change history of website articles?
1.2
0
1
289
4,075,309
2010-11-02T06:11:00.000
-1
1
0
0
php,.net,python,ruby
4,075,372
3
false
1
0
There is a wide variety of ways to do this as you alluded by tagging php, .net, python, and ruby. You missed a few off the top of my head perl and jsp. Each of these have their plusses and minuses and is really a question of what best suits your needs. PHP is probably the fastest reward for time spent. Ruby, i'm assu...
2
0
0
Our client wants us to implement change history for website articles. What is the best way to do it?
What is the best way to store change history of website articles?
-0.066568
0
1
289
4,075,627
2010-11-02T07:16:00.000
0
0
0
1
python,python-3.x
5,056,711
1
false
0
0
Is there a problem in making the current directory e:\\lynx from withing python? That seems like a good solution to me.
1
1
0
With args=['e:\\lynx\\lynx.exe','-dump',some_url], subprocess.check_output works fine if the current-directory is e:\lynx. Elsewhere, it fails with a CalledProcessException and retcode of -1. For now, I do not wish to add e:\lynx to PATH. Any thoughts?
Python on Windows - subprocess.check_output with full-path works not?
0
0
0
490
4,076,055
2010-11-02T08:41:00.000
0
0
1
0
python,audio,microphone,pyaudio
4,076,389
2
false
0
0
I have performed basic signal processing (FFT etc) using numpy/scipy directly on the audio buffer without too much trouble. Be careful, you need to tell numpy about the buffer type: float or int, long or short, signed/unsigned ...
1
0
0
I am trying to obtain the pitch, the level, and other stuff from my microphone using Python. I am trying using pyaudio, but I read that I need to use other libraries to generate the maths. I can’t find how mix pyaudio with the math library.
How do I do mathematical analysis on microphone audio information from pyaudio?
0
0
0
961
4,076,114
2010-11-02T08:49:00.000
0
0
1
0
c#,python,remoting
4,077,076
3
false
0
0
I would use XML-RPC for communication. It is very simple to implement (a couple lines of code in Python, not sure about .NET but it shouldn't be difficult there either) and should be enough in your scenario.
2
1
0
I've got a problem. I Have a tool(threads manager) that receives some data and do some computation. I need to write Python client to send data to that tool...I thing I should use .NET Remoting, but how to do that? pls share some links where I can read or post some code...I can't google info about that... P.S Python 2.7...
How implement .NET server and Python client?
0
0
0
987
4,076,114
2010-11-02T08:49:00.000
1
0
1
0
c#,python,remoting
4,076,158
3
true
0
0
.Net Remoting is designed for when you have .net at both ends so will be very hard to use from the Python end. (Event the XML encoding of .net remoting is not easy to use from other platforms) I am assuming that Python has support for soap, if so I would look at using WCF at the .net end running over the “basic profil...
2
1
0
I've got a problem. I Have a tool(threads manager) that receives some data and do some computation. I need to write Python client to send data to that tool...I thing I should use .NET Remoting, but how to do that? pls share some links where I can read or post some code...I can't google info about that... P.S Python 2.7...
How implement .NET server and Python client?
1.2
0
0
987
4,076,695
2010-11-02T10:16:00.000
0
0
1
0
python,syntax-highlighting,sublimetext,keyword,todo
4,076,750
2
true
0
0
This is very specific to the editor. Language/Platform has nothing to do with highlighting.
1
1
0
Can I define #@TODO or something like that as a keyword to be highlighted in Python? Is this specific to the text editor or to the language/platform?
Define todo keyword in Python and Sublime Text
1.2
0
0
1,159
4,076,822
2010-11-02T10:33:00.000
0
0
1
0
python,data-structures,hash,set
4,076,849
2
false
0
0
Hashes can collide. You will have to consider that.
1
0
0
I have ~200K named properties and ~25K files. I extract whether the properties hold or not for each file using Python as a set of properties that hold, one set for each file. To do this extraction I might run hundreds of individual python extraction scripts on a compute farm, in parallel. Each leaving behind some repre...
Hash+mapping or index+mapping to condense use of strings
0
0
0
148
4,077,338
2010-11-02T11:52:00.000
0
1
0
1
python,linux,unit-testing,regression
4,078,021
2
false
0
0
You could use a helper application that is setuid root to run the chroot; that would avoid the need to run the tests as root. Of course, that would probably still open up a local root exploit, so should only be done with appropriate precautions (e.g. in a VM image). At any rate, any solution with chroot is inherently p...
1
3
0
I need to extend a python code which has plenty of hard coded path In order not to mess everything, I want to create unit-tests for the code before my modifications: it will serve as non-regression tests with my new code (that will not have hard-coded paths) But because of hard coded system path, I shall run my test in...
regression test dealing with hard coded path
0
0
0
291
4,078,084
2010-11-02T13:25:00.000
2
0
0
0
python,memory-leaks,garbage-collection,twisted,memory-management
4,078,247
1
false
0
0
If the code is only leaking under load (did you verify this?), I'd have a look at all spots where messages are buffered. Does the memory usage of the process itself increase? Or does the memory use of the system increase? If it's the latter case, your server might simply be too slow to keep up with the incoming message...
1
13
0
I have a Twisted server under load. When the server is under load, memory usage increases, and it is never reclaimed (even when there are no more clients). Next time it goes into high load, memory usage increases again. Here's a snapshot of the situation at that point: RSS memory is 400 MB (should be 200MB with usual ...
Memory leak in Python Twisted: where is it?
0.379949
0
0
2,703
4,078,734
2010-11-02T14:38:00.000
4
0
1
0
python,windows,audio,jython,sikuli
4,079,110
6
false
0
1
If its Jython, then just use any of the Java classes that play sound. There are tons of them. from java import net from java.applet.Applet import newAudioClip from java import io url = io.File("fileName").toURL() audio = newAudioClip(url) audio.play() import sun.audio import java.io inputStream = java.io.FileInputS...
3
7
0
I'm working with Sikuli, which (I think) is build on Jython. I want to make a script that does a small gentle beep to attract the user's attention. (This is on Windows.) How can I do this? I see that the winsound module is not available on Jython. (Note that I want to use the sound card, not the built-in beeper.)
Jython: Making a simple beep on Windows
0.132549
0
0
2,323
4,078,734
2010-11-02T14:38:00.000
0
0
1
0
python,windows,audio,jython,sikuli
4,987,576
6
false
0
1
Since you are using Sikuli you can to the following. Add any mediafile such as any .mp3 on the desktop of a windows machine, asociate the file to a media player. Capture the image and include: click(pattern(desktopnoiseicon.png) alternatley you could execute the same task with openApp(C:\noise.mp3) Sikuli gives the ab...
3
7
0
I'm working with Sikuli, which (I think) is build on Jython. I want to make a script that does a small gentle beep to attract the user's attention. (This is on Windows.) How can I do this? I see that the winsound module is not available on Jython. (Note that I want to use the sound card, not the built-in beeper.)
Jython: Making a simple beep on Windows
0
0
0
2,323
4,078,734
2010-11-02T14:38:00.000
2
0
1
0
python,windows,audio,jython,sikuli
5,165,371
6
false
0
1
You may do the fllowing using command line: Execute "copy con beep.txt" type [ctrl+G] as input and then [ctrl+Z] followed by [Enter] to exit Then run "type beep.txt" and you will hear a beep. You may place "type beep.txt" in a batch file or use Ctrl+G directly in batch (which would produce error in command line with s...
3
7
0
I'm working with Sikuli, which (I think) is build on Jython. I want to make a script that does a small gentle beep to attract the user's attention. (This is on Windows.) How can I do this? I see that the winsound module is not available on Jython. (Note that I want to use the sound card, not the built-in beeper.)
Jython: Making a simple beep on Windows
0.066568
0
0
2,323
4,079,866
2010-11-02T16:33:00.000
5
0
0
0
python,wxpython,gui-builder
4,080,817
5
false
0
1
In addition to those, some people really like the XRCed application that's included with wxPython. Basically you create your GUI in XML. There's also the defunct Boa Constructor that I see people still using on the wxPython user's list.
2
29
0
Is there a good wxpython GUI builder that does not require much coding, like in the case of the form builder in MS visual studio ?
A good wxpython GUI builder?
0.197375
0
0
46,286
4,079,866
2010-11-02T16:33:00.000
0
0
0
0
python,wxpython,gui-builder
55,686,053
5
false
0
1
You can use ezWxPython. it is not gui builder, but it helps you make layout easy same way as pySimpleGUI.
2
29
0
Is there a good wxpython GUI builder that does not require much coding, like in the case of the form builder in MS visual studio ?
A good wxpython GUI builder?
0
0
0
46,286
4,080,413
2010-11-02T17:30:00.000
6
0
0
0
python,python-3.x,widget,tkinter-canvas
4,080,471
1
true
0
1
Your choices depend on what you're really trying to accomplish. Why is using a canvas preferable to using a frame? You can easily add widgets to a canvas just like you do any other container, using pack or grid or place. when you do this, the items will not scroll when you scroll the canvas because they aren't actually...
1
4
0
I want basically to be able to use a Canvas as a meta container for other widgets. I want to divide my GUI into a left, center and middle section. Within each section I would like to be able to place widgets like: Checkbutton, Button, Label, etc. How to place widgets in a Canvas widget?
How to place a widget in a Canvas widget in Tkinter?
1.2
0
0
4,505
4,080,688
2010-11-02T18:04:00.000
1
0
1
0
python,pickle,graceful-degradation
4,160,332
5
false
0
0
This is how I would do this (I did something similar before and it worked): Write a function that determines whether or not an object is pickleable Make a list of all the pickleable variables, based on the above function Make a new dictionary (called D) that stores all the non-pickleable variables For each variable in...
1
12
0
I have an object gui_project which has an attribute .namespace, which is a namespace dict. (i.e. a dict from strings to objects.) (This is used in an IDE-like program to let the user define his own object in a Python shell.) I want to pickle this gui_project, along with the namespace. Problem is, some objects in the na...
Python: Pickling a dict with some unpicklable items
0.039979
0
0
7,031
4,080,749
2010-11-02T18:10:00.000
15
0
0
0
python,optimization,premature-optimization,python-import
4,080,823
5
true
1
0
No, don't do this. In a normal python execution environment on the web (mod_wsgi, gunicorn, etc.) when your process starts those imports will be executed, and then all subsequent requests will not re-execute the script. If you put the imports inside the functions they'll have to be processed every time the function i...
3
5
0
In a framework such as Django, I'd imagine that if a user lands on a page (running a view function called "some_page"), and you have 8 imports at the top of module that are irrelevant to that view, you're wasting cycles on those imports. My questions are: Is it a large enough amount of resources to make an impact on a...
Python - optimize by not importing at module level?
1.2
0
0
1,475
4,080,749
2010-11-02T18:10:00.000
4
0
0
0
python,optimization,premature-optimization,python-import
4,080,821
5
false
1
0
1) The answer is no. Django/Python is not like PHP. Your whole module will not be reinterpreted with each pageview like happens with PHP includes. The module will be in memory and each page view will make a simple function call to your view. 2) Yes, it will be a counter-optimization to make imports at the view level.
3
5
0
In a framework such as Django, I'd imagine that if a user lands on a page (running a view function called "some_page"), and you have 8 imports at the top of module that are irrelevant to that view, you're wasting cycles on those imports. My questions are: Is it a large enough amount of resources to make an impact on a...
Python - optimize by not importing at module level?
0.158649
0
0
1,475
4,080,749
2010-11-02T18:10:00.000
5
0
0
0
python,optimization,premature-optimization,python-import
4,080,836
5
false
1
0
Yes, it is a bad practice to import at the function level. By using smarter imports at the top of the module, you create a one time, small cost. However, if you place an import in a function you will suffer the cost of the import each time that function is run. So, rather than import in the function, just import at the...
3
5
0
In a framework such as Django, I'd imagine that if a user lands on a page (running a view function called "some_page"), and you have 8 imports at the top of module that are irrelevant to that view, you're wasting cycles on those imports. My questions are: Is it a large enough amount of resources to make an impact on a...
Python - optimize by not importing at module level?
0.197375
0
0
1,475
4,081,020
2010-11-02T18:40:00.000
0
0
0
0
python,user-interface,gtk,pygtk
4,085,525
1
true
0
1
Are you sure it's the minimize button? Because GTK doesn't deal with (or even know about the existence of) minimize buttons at all, they are part of the window manager.
1
0
0
Problem: I have a gtk.Dialog. Whenever the 'minimize' button on the dialog is clicked, the window is destroyed. Question: How can I connect to the minimize button of a gtk.Dialog so that I can iconify the window?
Problems Connecting to Minimized Signal
1.2
0
0
129
4,081,217
2010-11-02T19:04:00.000
4
0
1
0
python
4,081,239
9
false
0
0
No you wouldn't alter the "content" of the list, if you could mutate strings that way. But in Python they are not mutable. Any string operation returns a new string. If you had a list of objects you knew were mutable, you could do this as long as you don't change the actual contents of the list. Thus you will need to d...
1
228
0
Now I know that it is not safe to modify the list during an iterative looping. However, suppose I have a list of strings, and I want to strip the strings themselves. Does replacement of mutable values count as modification?
How to modify list entries during for loop?
0.088656
0
0
346,667
4,081,333
2010-11-02T19:22:00.000
1
0
0
0
python,security,mobile
4,084,073
1
true
1
0
As far as I know, there is no way to get Python code running on that kind of mobile platform. Try looking up JavaME and/or Brew. Further, you will need the carrier and device maker to allow your app the get access to the phone's GPS information. This is not a given on the low-end devices. As a first step, most carrie...
1
0
0
I would like to build a mobile phone tracking application for feature phones which have minimum of gprs connectivity. I would like a user to log in to the application and be able to see the location of their phone through google maps. Any resources or information will be highly appreciated. I would preferably use pytho...
feature mobile phone tracking application
1.2
0
0
1,349
4,081,561
2010-11-02T19:52:00.000
96
0
1
0
python
4,081,587
7
true
0
0
When reading, list is a reference to the original list, and list[:] shallow-copies the list. When assigning, list (re)binds the name and list[:] slice-assigns, replacing what was previously in the list. Also, don't use list as a name since it shadows the built-in.
1
69
0
What, if any, is the difference between list and list[:] in python?
What is the difference between list and list[:] in python?
1.2
0
0
31,643
4,081,672
2010-11-02T20:07:00.000
2
0
1
0
python,list,position
4,081,702
7
false
0
0
you can use ['hello', 'world'].index('world')
1
15
0
I will check if a word exists in a list. How can I show the position of this word?
Position in an list?
0.057081
0
0
71,203
4,082,725
2010-11-02T22:37:00.000
1
0
1
0
python,reportlab,pypdf
4,082,827
2
false
0
0
Basically you'll have to remove the corresponding text drawing commands in the PDF's page content stream. It's much easier to generate the pages twice, once with the confidential information, once without them. It might be possible (I don't know ReportLab enough) to specially craft the PDF in a way that the confidentia...
2
1
0
In Python, I have files generated by ReportLab. Now, i need to extract some pages from that PDF and hide confidential information. I can create a PDF file with blacked-out spots and use pyPdf to mergePage, but people can still select and copy-paste the information under the blacked-out spots. Is there a way to make tho...
Hide information in a PDF file in Python
0.099668
0
0
1,789
4,082,725
2010-11-02T22:37:00.000
0
0
1
0
python,reportlab,pypdf
4,083,017
2
false
0
0
(Sorry, I was not able to log on when I posted the question...) Unfortunately, the document cannot be regenerated at will (context sensitive), and those PDF files (about 35) are 3000+ pages. I was thinking about using pdf2ps and pdf2ps back, but there is a lot of quality. pdf2ps -dLanguageLevel=3 input.pdf - | ps2pdf14...
2
1
0
In Python, I have files generated by ReportLab. Now, i need to extract some pages from that PDF and hide confidential information. I can create a PDF file with blacked-out spots and use pyPdf to mergePage, but people can still select and copy-paste the information under the blacked-out spots. Is there a way to make tho...
Hide information in a PDF file in Python
0
0
0
1,789
4,083,440
2010-11-03T01:07:00.000
0
0
0
0
python,web-applications,flask
4,083,522
2
false
1
0
IMHO your time would be better invested learning something like Django, because much of what you could improve in a micro framework is already builtin on a bigger framework.
1
0
0
I'd like to look at some good web-app code written in python, just so I can learn some of the patterns / see how I can improve my code. I've already googled around a bit, used google code search and run a search on github too - but haven't come across a well built, comprehensive app. Perhaps a book could work as well. ...
Great flask / other python micro framework code I could learn from
0
0
0
1,700
4,083,523
2010-11-03T01:25:00.000
1
1
0
1
python,profiling,benchmarking,latency,apachebench
4,083,570
6
true
0
0
I have done this in two ways. With "loadrunner" which is a wonderful but pretty expensive product (from I think HP these days). With combination perl/php and the Curl package. I found the CURL api slightly easier to use from php. Its pretty easy to roll your own GET and PUT requests. I would also recommend manually run...
2
8
0
I've done some experiments using Apache Bench to profile my code response times, and it doesn't quite generate the right kind of data for me. I hope the good people here have ideas. Specifically, I need a tool that Does HTTP requests over the network (it doesn't need to do anything very fancy) Records response times a...
Alternatives to ApacheBench for profiling my code speed
1.2
0
0
6,473
4,083,523
2010-11-03T01:25:00.000
0
1
0
1
python,profiling,benchmarking,latency,apachebench
4,162,131
6
false
0
0
I've used a script to drive 10 boxes on the same switch to generate load by "replaying" requests to 1 server. I had my web app logging response time (server only) to the granularity I needed, but I didn't care about the response time to the client. I'm not sure you care to include the trip to and from the client in y...
2
8
0
I've done some experiments using Apache Bench to profile my code response times, and it doesn't quite generate the right kind of data for me. I hope the good people here have ideas. Specifically, I need a tool that Does HTTP requests over the network (it doesn't need to do anything very fancy) Records response times a...
Alternatives to ApacheBench for profiling my code speed
0
0
0
6,473
4,083,554
2010-11-03T01:32:00.000
1
0
1
0
java,python,ruby,system,enterprise
4,083,588
3
false
1
0
You make a valid point in saying that Java is more suited to enterprise software. That's really where Java shines: it works very well for enterprise programming. However, your gripes about the tools in Python and Ruby are unfounded. PyDev for Eclipse takes full advantage of the same features that you would enjoy if you...
3
1
0
There is some hype with languages like Python (that I like very much) and Ruby but I was writing a medium-size system in Python and feel the lack of some tools that I would have if I was using Java: Eclipse features, JUnit integration and some language-features like catching some errors in compile time. Some people say...
Issues when writing a medium/large system
0.066568
0
0
178
4,083,554
2010-11-03T01:32:00.000
0
0
1
0
java,python,ruby,system,enterprise
4,083,633
3
false
1
0
All much of a muchness really. There are features in Python/Ruby that your aware of that make them a more appealing offering than say Java. Static typing can be your best friend most of the time, and a pain for the other. Lack of tooling is related to adoption. Java/c# has a larger adoption. Corporates/Enterprises and ...
3
1
0
There is some hype with languages like Python (that I like very much) and Ruby but I was writing a medium-size system in Python and feel the lack of some tools that I would have if I was using Java: Eclipse features, JUnit integration and some language-features like catching some errors in compile time. Some people say...
Issues when writing a medium/large system
0
0
0
178
4,083,554
2010-11-03T01:32:00.000
1
0
1
0
java,python,ruby,system,enterprise
4,083,662
3
false
1
0
This kind of question can get very argumentative... For enterprise software most of time the key factor is political, not technical. If you own the business, stick with the technology that best fits your vision. If not, use Java - it is politically safer. On the technical field, it is almost a tie.
3
1
0
There is some hype with languages like Python (that I like very much) and Ruby but I was writing a medium-size system in Python and feel the lack of some tools that I would have if I was using Java: Eclipse features, JUnit integration and some language-features like catching some errors in compile time. Some people say...
Issues when writing a medium/large system
0.066568
0
0
178
4,084,608
2010-11-03T06:12:00.000
6
0
0
0
python,email,rfc822,email-parsing
4,084,648
2
true
0
0
Oh it's email.utils.getaddresses. Just make sure to call it with a list.
1
7
0
I need something like rfc822.AddressList to parse, say, the content of the "TO" header field of an email into individual addresses. Since rfc822 is deprecated in favor of the email package, I looked for something similar there but couldn't find anything. Does anyone know what I'm supposed to use instead? Thanks!
Is there a non-deprecated equivalent of rfc822.AddressList?
1.2
0
1
1,862
4,085,417
2010-11-03T08:58:00.000
2
0
1
0
python,list,stack
4,085,432
2
false
0
0
stack[-1] ist the last element EDIT renamed the previously list called variable (Thanks, Tim McNamara).
1
8
0
In python I need a stack, and I'm using a list for it. In the documenation it says that you can use append() and pop() for stack operations but what about accessing the top of the stack without removing it? How to do that in the most readable way? Because all I came up with is stack[-1:][0] which looks a bit ugly for ...
How to check the last element of a python list?
0.197375
0
0
5,959
4,085,826
2010-11-03T09:55:00.000
3
0
0
0
python,django
4,085,840
1
true
1
0
Yes. You're having other problems.
1
0
0
Just curious to know, Test module won't work properly with django 1.2.3 when update from django 1.1.1 (now on python 2.6.5)
Is Django 1.2.3 competable with Python 2.6.5
1.2
0
0
102
4,086,311
2010-11-03T10:55:00.000
0
0
1
1
python,concurrency,process,queue
4,086,600
3
false
0
0
If I understand correctly what you are doing, I might suggest a slightly different approach. Try establishing a single unit of work as a function and then layer on the parallel processing after that. For example: Wrap the current functionality (calling subprocess and capturing output) into a single function. Have t...
1
2
0
The use case is as follows : I have a script that runs a series of non-python executables to reduce (pulsar) data. I right now use subprocess.Popen(..., shell=True) and then the communicate function of subprocess to capture the standard out and standard error from the non-python executables and the captured output I lo...
python queue concurrency process management
0
0
0
727
4,086,675
2010-11-03T11:44:00.000
3
0
0
1
python,portability,pygame
4,086,715
4
false
0
0
The Python scripts are reasonably portable, as long as the interpreter and relevant libraries are installed. Generated .exe and .app files are not.
3
1
0
I have a lovely Macbook now, and I'm enjoying coding on the move. I'm also enjoying coding in Python. However, I'd like to distribute the end result to friends using Windows, as an executable. I know that Py2Exe does this, but I don't know how portable Python is across operating systems. Can anyone offer any advice? I'...
Portable Python (Mac -> Windows)
0.148885
0
0
1,743
4,086,675
2010-11-03T11:44:00.000
0
0
0
1
python,portability,pygame
4,087,087
4
false
0
0
If you are planning to include Linux in your portability criteria, it's worth remembering that many distributions still package 2.6 (or even 2.5), and will probably be a version behind in the 3.x series as well (I'm assuming your using 2.x given the PyGame requirement though). Versions of PyGame seem to vary quite heav...
3
1
0
I have a lovely Macbook now, and I'm enjoying coding on the move. I'm also enjoying coding in Python. However, I'd like to distribute the end result to friends using Windows, as an executable. I know that Py2Exe does this, but I don't know how portable Python is across operating systems. Can anyone offer any advice? I'...
Portable Python (Mac -> Windows)
0
0
0
1,743
4,086,675
2010-11-03T11:44:00.000
0
0
0
1
python,portability,pygame
4,153,679
4
true
0
0
Personally I experienced huge difficult with all the Exe builder, py2exe , cx_freeze etc. Bugs and errors all the time , keep displaying an issue with atexit module. I find just by including the python distro way more convinient. There is one more advantage beside ease of use. Each time you build an EXE for a python a...
3
1
0
I have a lovely Macbook now, and I'm enjoying coding on the move. I'm also enjoying coding in Python. However, I'd like to distribute the end result to friends using Windows, as an executable. I know that Py2Exe does this, but I don't know how portable Python is across operating systems. Can anyone offer any advice? I'...
Portable Python (Mac -> Windows)
1.2
0
0
1,743
4,087,582
2010-11-03T13:38:00.000
0
1
0
1
python,debugging,pylons,pydev,nose
4,087,763
3
false
0
0
Try import pydevd; pydevd.settrace() where would like a breakpoint.
1
8
0
I'm using PyDev ( with Aptana ) to write and debug a Python Pylons app, and I'd like to step through the tests in the debugger. Is it possible to launch nosetests through PyDev and stop at breakpoints?
Interactive debugging with nosetests in PyDev
0
0
0
4,516
4,088,703
2010-11-03T15:28:00.000
0
0
0
0
python,firefox,selenium,download,firefox-addon
13,342,386
4
false
0
0
In this case, Just create a new folder everytime and download your file there. Make sure the foldername is incremented if it already exits (Ex: folder1, folder2, Folder3.....)
3
3
0
first of all, I'm sorry for my English I am doing some scripting in Python using Selenium RC. The aim is to access to some website, and download some files I would like to know, at the end of the script, what files exactly have been downloaded At that moment, I'm doing something a bit naive, which is checking the new f...
Is it possible to know what file is downloaded by Firefox with Selenium
0
0
1
1,024
4,088,703
2010-11-03T15:28:00.000
0
0
0
0
python,firefox,selenium,download,firefox-addon
4,698,653
4
false
0
0
I haven't tried it myself, but I would consider setting up multiple Firefox profiles each set with a different download directory and then telling my instances to use those profiles (or maybe programmatically setting profile values if you're using Selenium2 - I'm not sure if download directory is possible to change or ...
3
3
0
first of all, I'm sorry for my English I am doing some scripting in Python using Selenium RC. The aim is to access to some website, and download some files I would like to know, at the end of the script, what files exactly have been downloaded At that moment, I'm doing something a bit naive, which is checking the new f...
Is it possible to know what file is downloaded by Firefox with Selenium
0
0
1
1,024
4,088,703
2010-11-03T15:28:00.000
0
0
0
0
python,firefox,selenium,download,firefox-addon
4,118,400
4
false
0
0
If you are working with python-->Selenium RC why don't you just create a lastdownload.txt type of file, and put in the dates, filenames of the files you download. So each time your script runs, it will check the fileserver, and your log file to see which files are new, which files you already have. (if same filename is...
3
3
0
first of all, I'm sorry for my English I am doing some scripting in Python using Selenium RC. The aim is to access to some website, and download some files I would like to know, at the end of the script, what files exactly have been downloaded At that moment, I'm doing something a bit naive, which is checking the new f...
Is it possible to know what file is downloaded by Firefox with Selenium
0
0
1
1,024
4,088,996
2010-11-03T16:01:00.000
1
0
0
0
python,user-interface,tkinter,pywin32,win32ole
4,091,168
1
true
0
1
No, Tkinter has no such thing. However, the screen is only updated via the event loop, so if all of your "large amount of screen activity" is happening in a single method, none of the activity will show up until your method finishes and the event loop is re-entered (or you explicitly call .update_idletasks())
1
1
0
Does Tkinter provide a way to temporarily turn off screen updates (when performing a large amount of screen activity) and then turn on screen updates when the UI updates are complete? Many GUI frameworks have this feature. wxPython provides Freeze and Thaw methods for this functionality. The Windows Win32api supports t...
Python/Tkinter: Turn on/off screen updates like wxPython Freeze/Thaw?
1.2
0
0
968
4,090,753
2010-11-03T19:15:00.000
0
0
0
1
python,macos,installation,osx-snow-leopard
4,161,287
2
true
0
0
The solution was to --force pythonbrew to install in spite of the errors. I tested the socket responses using the built-in Python, Perl and Ruby, and they had the same problem resolving the localhost name. I tested using a current version of Ruby and Python on one of my Linux boxes, and the calls worked, so I was pret...
1
0
0
I'm using pythonbrew to install Python 2.6.6 on Snow Leopard. It failed with a readline error, then a socket error. I installed readline from source, which made the installer happy on the next attempt, but the socket error remains: test_socket test test_socket failed -- Traceback (most recent call last): File "/User...
Workaround for Pythonbrew failing because test_socket can't resolve?
1.2
0
1
2,411
4,092,333
2010-11-03T22:46:00.000
1
0
0
0
python,wxpython
4,101,577
2
true
0
1
You access the rich text control like this: import wx.richtext Or you pass the wx.TextCtrl the wx.TE_RICH or wx.TE_RICH2 flag. I've heard that the richtext widget isn't available on *nix though. Did you try the wxPython Demo? That's usually the best place to look to find out how to use a widget.
2
0
0
im using wxpython 2.8 ansi with python 2.6 ,and richtext class seems to not exist as an error message prompts that wx module does not contain richtext attribute, i've searched the web but couldn't find a clear answer,therefore i come to you:) any thoughts? thanks in advance Nataly
Is wx.richtext supported in wxpython 2.8?
1.2
0
0
427
4,092,333
2010-11-03T22:46:00.000
1
0
0
0
python,wxpython
4,093,711
2
false
0
1
I just downloaded and installed version 2.8.11-ansi. RichTextControl is the first demo listed, and works fine. It sounds like there is something messed up with your installation. Unless you have to support windows 98/ME, I don't know any good reason to prefer the ansi version over unicode. Can you provide the exact tex...
2
0
0
im using wxpython 2.8 ansi with python 2.6 ,and richtext class seems to not exist as an error message prompts that wx module does not contain richtext attribute, i've searched the web but couldn't find a clear answer,therefore i come to you:) any thoughts? thanks in advance Nataly
Is wx.richtext supported in wxpython 2.8?
0.099668
0
0
427
4,093,015
2010-11-04T00:50:00.000
0
0
1
1
python,osx-snow-leopard
4,093,046
2
false
0
0
It's impossible to tell without knowing which version(s) you're comparing. You're best off doing python --version on your default OS X install, and then checking release notes from that version to subsequent versions. My guess (I don't have OS X) is that you're likely running 2.4.x or 2.5.x. There'll be very few regres...
2
0
0
I am a new Mac (Snow Leopard) user and I found that Python is pre-installed in Mac OS X. What is the difference between Mac OS X pre-installed Python and the one from Python.org? If I install the one from Python.org, will it break anything? Will it be redundant? EDIT What would be a good reason to prefer the Python.org...
What is the difference between Mac OS X pre-installed Python and the one from Python.org?
0
0
0
2,569
4,093,015
2010-11-04T00:50:00.000
3
0
1
1
python,osx-snow-leopard
4,094,163
2
false
0
0
The Apple-supplied Python 2.6 in Mac OS X 10.6 (Snow Leopard) is currently 2.6.1 (and, based on previous OS X releases, it is unlikely Apple will update it to a newer version in a 10.6.x maintenance release). The most recent (and likely final) release of Python 2.6 is 2.6.6. So if you install the most recent python.o...
2
0
0
I am a new Mac (Snow Leopard) user and I found that Python is pre-installed in Mac OS X. What is the difference between Mac OS X pre-installed Python and the one from Python.org? If I install the one from Python.org, will it break anything? Will it be redundant? EDIT What would be a good reason to prefer the Python.org...
What is the difference between Mac OS X pre-installed Python and the one from Python.org?
0.291313
0
0
2,569
4,093,387
2010-11-04T02:22:00.000
0
0
0
0
python
4,093,406
2
false
1
0
I'll admit I don't know Python 3, so I may be wrong, but in Python 2, you can just check the __file__ variable in your module to get the name of the file it was loaded from. Just create your file in that same directory (preferably using os.path.dirname and os.path.join to remain platform-independent).
1
0
0
I have a rather simple program that writes HTML code ready for use. It works fine, except that if one were to run the program from the Python command line, as is the default, the HTML file that is created is created where python.exe is, not where the program I wrote is. And that's a problem. Do you know a way of ge...
Python3:Save File to Specified Location
0
0
0
2,983
4,093,447
2010-11-04T02:37:00.000
2
0
0
0
python,module,installation
4,093,865
2
false
0
0
32-bit and 64-bit binaries are different animals, and can be mixed only if you know what you are doing. Did you try installing python 2.6 32-bit on your friend's machine? Why are you using apsw instead of the standard library sqlite3?
1
0
0
First off, I don't know if this goes on stackoverflow or one of the other related sites. So, I have apsw on my system, and am using python 2.6 32 bit. My friend is using Python 64 bit, and when I tried to install apsw on his system, we got a multitude of errors, depending on how we installed it. First off, installing v...
Odd error when helping a friend install apsw
0.197375
0
0
1,014
4,093,541
2010-11-04T03:00:00.000
0
0
0
0
python,django,http-status-code-404,runtime-error
4,096,820
2
false
1
0
try not loading all middleware modules, just comment them all in the settings and see if the problem is somewhere there.
1
0
0
In my Django project I am having RUntimeError when I'm supposed to get a 404. The description says: Exception Value: maximum recursion depth exceeded The error only occurs when I try to access a non-existent page (the correct result would be a 404 page isn't it?). Is this a Django bug or is it my fault? I will provid...
Django is returning RuntimeError instead of 404
0
0
0
425
4,093,819
2010-11-04T04:07:00.000
2
0
0
0
wxpython,wxwidgets,openfiledialog,savefiledialog,filedialog
5,943,314
4
false
0
1
In wxWidgets 2.9 custom controls can be added to file dialogs using wxFileDialog::SetExtraControlCreator(). It's implemented for GTK, MSW and generic dialogs. Alternatively, you may use the wxFileCtrl class. It has native implementation only in wxGTK. I don't know if these features is available from Python wrappers, th...
2
2
0
I'm creating a file dialog that allows the user to save a file after editing it in my app. I want to add a checkbox to the dialog so the user can make some choices about what format the file is saved in. I think I need to make some new class that inherits from FileDialog and inserts a checkbox into the frame created by...
How do I add widgets to a file dialog in wxpython?
0.099668
0
0
2,300
4,093,819
2010-11-04T04:07:00.000
2
0
0
0
wxpython,wxwidgets,openfiledialog,savefiledialog,filedialog
12,428,450
4
false
0
1
I have to disagree with the sentiment that you should use standard dialogs only how they were designed. I take another view and would rather look at using subclassing the way that subclassing was intended. And to me, it is to add additional functionality/specialization to a class. So it is not changing the behavior of...
2
2
0
I'm creating a file dialog that allows the user to save a file after editing it in my app. I want to add a checkbox to the dialog so the user can make some choices about what format the file is saved in. I think I need to make some new class that inherits from FileDialog and inserts a checkbox into the frame created by...
How do I add widgets to a file dialog in wxpython?
0.099668
0
0
2,300
4,093,982
2010-11-04T04:49:00.000
3
0
0
0
python,pyjamas
4,094,232
1
true
1
0
GWT and Pyjamas were created to remove the drugery of coding Javascript and compensating for all of the different browser implementations and object models. Yes, you still need a designer. Yes, you can code in python and not have to learn Javascript (in theory). No, you won't have to recode to work around "features...
1
8
0
I am learning Pyjamas framework of python to generate the frontend which is basically a javascript code generated by Pyjamas. Though, being a new concept and a GWT equivalent in python I am interested in learning it, but I can not really find out what is the actual significance of it? I mean we are coding in python, co...
Pyjamas framework significance
1.2
0
0
1,188
4,093,999
2010-11-04T04:56:00.000
6
0
0
0
python,django,url,host
4,094,037
9
false
1
0
Try os.environ.get('HOSTNAME')
2
66
0
How to use Django to get the name for the host server? I need the name of the hosting server instead of the client name?
How to use Django to get the name for the host server?
1
0
0
62,436
4,093,999
2010-11-04T04:56:00.000
4
0
0
0
python,django,url,host
54,194,805
9
false
1
0
Basically, You can take with request.get_host() in your view/viewset. It returns <ip:port>
2
66
0
How to use Django to get the name for the host server? I need the name of the hosting server instead of the client name?
How to use Django to get the name for the host server?
0.088656
0
0
62,436
4,095,925
2010-11-04T10:55:00.000
1
0
1
0
python,multithreading,queue
4,096,149
1
true
0
0
If a threads waits for a specific task completion, i.e it shouldn't pick any completed task except that one it put, you can use locks to wait for the task: def run(self): # get a task, do somethings, put a new task newTask.waitFor() ... class Task: ... def waitFor(self): self._lock.acquire() def ...
1
0
0
could anyone please provide on how to achieve below scenario ? 2 queues - destination queue, response queue thread picks task up from destination queue finds out needs more details submits new task to destination queue waits for his request to be processed and result appear in response queue or monitors response queue ...
python: how to make threads wait for specific response?
1.2
0
0
1,230
4,096,417
2010-11-04T12:02:00.000
5
0
0
0
python,wxpython,wxwidgets
4,101,554
2
false
0
1
The simple answer is "no". The panel is not a TopLevelWindow. Top level windows are Frames and Windows. Panels typically go in Frames, although you can nest panels in panels or frames. Telling us what to do, as Ryan suggested, would be the best way to get a good answer though.
1
0
0
there are some people? i have some question about wxpython , can i use panel without a frame?
can i use panel without a frame in wxpython?
0.462117
0
0
588
4,096,751
2010-11-04T12:44:00.000
5
1
1
0
python
4,096,865
2
false
0
0
There are three most popular tools: pylint, pyflakes and pycheker. Pyflakes will show you unused imports, variables, variable usage before assignment, syntax errors and things like that. Pychecker, AFAIK is similar to pyflakes. Pylint, on the other hand, is a much more comprehensive tool: apart from the listed above, i...
1
4
0
I wrote a nice little script to do some lightweight work. I set it to run all night, and when I eagerly checked it this morning, I found that I had left a module name prefix out of one of its variables. Is there any way to check for this kind of chicanery statically? The trouble is that this thing sleeps a lot, so runn...
Python syntax and other things checking?
0.462117
0
0
108
4,098,119
2010-11-04T15:15:00.000
6
0
0
1
python,google-app-engine
4,098,417
1
true
1
0
Somewhere in your top level module code is something that uses Python print statements. Print outputs to standard out, which is what is returned as the response body; if it outputs a pair of newlines, the content before that is treated by the browser as the response header. The 'junk' you're seeing is the real response...
1
1
0
I'm developing an app in Python for Google App Engine. When I run the deployed app from appspot, it works fine unless I'm accessing it for the first time in over, say, 5 minutes. The problem is that if I haven't accessed the app for a while, the page renders with the message Status: 200 OK Content-Type: text/html; c...
Google App Engine gives spurious content at beginning of page after quiescent period
1.2
0
0
108