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
623,054
2009-03-08T04:44:00.000
3
0
1
0
python,multithreading
623,064
7
false
1
0
It's usually simpler to make multiple concurrent processes. Simply use subprocess to create as many Popens as you feel it necessary to run concurrently. There's no "optimal" number. Generally, when you run just one crawler, your PC spends a lot of time waiting. How much? Hard to say. When you're running some small ...
3
3
0
I have a simple Python web crawler. It uses SQLite to store its output and also to keep a queue. I want to make the crawler multi-threaded so that it can crawl several pages at a time. I figured i would make a thread and just run several instances of the class at once, so they all run concurrently. But the question is,...
For my app, how many threads would be optimal?
0.085505
0
0
2,509
623,054
2009-03-08T04:44:00.000
1
0
1
0
python,multithreading
623,515
7
false
1
0
One thing you should keep in mind is that some servers may interpret too many concurrent requests from the same IP address as a DoS attack and abort connections or return error pages for requests that would otherwise succeed. So it might be a good idea to limit the number of concurrent requests to the same server to a ...
3
3
0
I have a simple Python web crawler. It uses SQLite to store its output and also to keep a queue. I want to make the crawler multi-threaded so that it can crawl several pages at a time. I figured i would make a thread and just run several instances of the class at once, so they all run concurrently. But the question is,...
For my app, how many threads would be optimal?
0.028564
0
0
2,509
623,504
2009-03-08T12:34:00.000
1
0
0
0
python,google-maps,s60,pys60
858,276
3
false
0
0
No, you can't access it from a Python script or another S60 application because of platform security features of S60 3rd ed. Even if Google Maps application would write information to disk, your app is not able to access application specific files of other apps. Google Maps use cell-based locationing in addition to GP...
1
1
0
I want to fetch my current latitude/longitude from Google Maps Mobile 3.0 with the help of some script, which I guess could be a Python one. Is this possible? And, more importantly: is the Google Maps Mobile API designed for such interaction? Any legal issues? Basically i have a S60 phone that doesnt have GPS,and I hav...
Retrieving the latitude/longitude from Google Map Mobile 3.0's MyLocation feature
0.066568
0
0
948
624,050
2009-03-08T18:26:00.000
1
0
0
0
python,qt,wxpython,pyqt
624,282
4
false
0
1
As far as I understand EVT_IDLE is sent when application message queue is empty. There is no such event in Qt, but if you need to execute something in Qt when there are no pending events, you should use QTimer with 0 timeout.
2
2
0
wx (and wxPython) has two events I miss in PyQt: EVT_IDLE that's being sent to a frame. It can be used to update the various widgets according to the application's state EVT_UPDATE_UI that's being sent to a widget when it has to be repainted and updated, so I can compute its state in the handler Now, PyQt doesn't se...
wx's idle and UI update events in PyQt
0.049958
0
0
2,691
624,050
2009-03-08T18:26:00.000
5
0
0
0
python,qt,wxpython,pyqt
624,734
4
true
0
1
The use of EVT_UPDATE_UI in wxWidgets seems to highlight one of the fundamental differences in the way wxWidgets and Qt expect developers to handle events in their code. With Qt, you connect signals and slots between widgets in the user interface, either handling "business logic" in each slot or delegating it to a dedi...
2
2
0
wx (and wxPython) has two events I miss in PyQt: EVT_IDLE that's being sent to a frame. It can be used to update the various widgets according to the application's state EVT_UPDATE_UI that's being sent to a widget when it has to be repainted and updated, so I can compute its state in the handler Now, PyQt doesn't se...
wx's idle and UI update events in PyQt
1.2
0
0
2,691
624,062
2009-03-08T18:34:00.000
4
0
1
0
asp.net,python
624,119
3
false
1
0
I second the note by Out Into Space on how python is a language versus a web framework; it's an important observation that underlies pretty much everything you will experience in moving from ASP.NET to Python. On a similar note, you will also find that the differences in language style and developer community between C...
2
3
0
I'm thinking about converting an app from Asp.net to python. I would like to know: what are the key comparisons to be aware of when moving a asp.net app to python(insert framework)? Does python have user controls? Master pages?
What should I be aware of when moving from asp.net to python for web development?
0.26052
0
0
390
624,062
2009-03-08T18:34:00.000
0
0
1
0
asp.net,python
637,273
3
false
1
0
Most frameworks for python has a 'templating' engine which provide similar functionality of ASP.NET's Master pages and User Controls. :) Thanks for the replies Out Of Space and Jarret Hardie
2
3
0
I'm thinking about converting an app from Asp.net to python. I would like to know: what are the key comparisons to be aware of when moving a asp.net app to python(insert framework)? Does python have user controls? Master pages?
What should I be aware of when moving from asp.net to python for web development?
0
0
0
390
624,345
2009-03-08T21:37:00.000
1
0
0
0
python,html,css,pygments
624,717
4
false
1
0
Pass full=True to the HtmlFormatter constructor.
1
1
0
If I run a python source file through pygments, it outputs html code whose elements class belong to some CSS file pygments is using. Could the style attributes be included in the outputted html so that I don't have to provide a CSS file?
How can I customize the output from pygments?
0.049958
0
0
3,304
624,535
2009-03-08T23:22:00.000
4
0
0
0
python,django,django-admin,styles,look-and-feel
625,235
2
true
1
0
Are you sure you want to take every bit of admin-site's look & feel?? I think you would need to customize some, as in header footer etc. To do that, just copy base.html from "djangosrc/contrib/admin/templates/admin/" and keep it in "your_template_dir/admin/base.html" or "your_template_dir/admin/mybase.html" Jus...
1
1
0
I like the very simple but still really elegant look and feel of the django admin and I was wondering if there is a way to apply it to my own application. (I think that I've read something like that somewhere, but now I cannot find the page again.) (edited: what I am looking for is a way to do it automatically by exten...
Using Django admin look and feel in my own application
1.2
0
0
1,834
624,844
2009-03-09T02:42:00.000
24
0
0
0
python,signals,django-signals
624,865
4
true
1
0
Actually, "signals" have been around longer than events have. In the earliest usage, a signal was an asynchronous way for processes to get notified that events had occurred. Since Unix is much older than Django (and since a lot of the Django work came from pydispatcher, where the original stuff was done), the name has ...
3
4
0
From what I can tell, in Python and and Django, signals are simply delegated events. Is there anything that functionally differentiates them from the typical notion of events in C#, Java, ActionScript, etc?
Why aren't signals simply called events?
1.2
0
0
676
624,844
2009-03-09T02:42:00.000
1
0
0
0
python,signals,django-signals
624,860
4
false
1
0
You might as well ask "Why aren't events simply called signals?". Differences in terminology happen.
3
4
0
From what I can tell, in Python and and Django, signals are simply delegated events. Is there anything that functionally differentiates them from the typical notion of events in C#, Java, ActionScript, etc?
Why aren't signals simply called events?
0.049958
0
0
676
624,844
2009-03-09T02:42:00.000
4
0
0
0
python,signals,django-signals
624,855
4
false
1
0
Signals typically have an association with an operating system facility and events are typically application-defined. In some technology stacks, the OS-level stuff may be hidden well enough that there isn't a difference in the API, but in others perhaps not.
3
4
0
From what I can tell, in Python and and Django, signals are simply delegated events. Is there anything that functionally differentiates them from the typical notion of events in C#, Java, ActionScript, etc?
Why aren't signals simply called events?
0.197375
0
0
676
625,042
2009-03-09T04:43:00.000
1
0
1
1
python,google-app-engine
625,632
4
false
1
0
The app.yaml syntax already supports multiple languages and multiple API versions, though only one of each (Python, API version 1) is currently supported. Presumably, one of those extension mechanisms will be used to specify that you want Python 3, and it'll be up to you to port your app over to work in Python 3, then ...
2
9
0
What is required to make the transition to Python 3.x for Google App Engine? I know Google App Engine requires the use of at least Python 2.5. Is it possible to use Python 3.0 already on Google App Engine?
What will be the upgrade path to Python 3.x for Google App Engine Applications?
0.049958
0
0
4,490
625,042
2009-03-09T04:43:00.000
1
0
1
1
python,google-app-engine
625,130
4
false
1
0
At least at the being, Guido was working closely with the team at Google who is building AppEngine. When this option does become available, you will have to edit your main XAML file. I agree with Chris B. that Python 3.0 support may not be forthcoming too soon, but I'm not sure I agree that it will come sooner than Per...
2
9
0
What is required to make the transition to Python 3.x for Google App Engine? I know Google App Engine requires the use of at least Python 2.5. Is it possible to use Python 3.0 already on Google App Engine?
What will be the upgrade path to Python 3.x for Google App Engine Applications?
0.049958
0
0
4,490
625,148
2009-03-09T05:49:00.000
4
1
0
0
python,gmail,pop3,poplib
625,175
3
true
0
0
POP3 has no concept of 'folders'. If gmail is showing you both 'sent' as well as 'received' mail, then you really don't have any option but to receive all that email. Perhaps you would be better off using IMAP4 instead of POP3. Python has libraries that will work with gmail's IMAP4 server.
1
2
0
I need to download emails from the gmail inbox only using poplib.Unfortunately I do not see any option to select Inbox alone, and poplib gives me emails from sent items too. How do I select emails only from inbox? I dont want to use any gmail specific libraries.
Select mails from inbox alone via poplib
1.2
0
1
2,392
625,314
2009-03-09T07:49:00.000
8
0
0
1
python,google-app-engine,memcached
626,559
5
true
1
0
People ask for this on the memcached list a lot, sometimes with the same type of "just in case I want to look around to debug something" sentiment. The best way to handle this is to know how you generate your keys, and just go look stuff up when you want to know what's stored for a given value. If you have too many thi...
4
1
0
In the "Memcache Viewer", is there any way to dump a list of existing keys? Just for debugging, of course, not for use in any scripts! I ask because it doesn't seem like the GAE SDK is using a "real" memcache server, so I'm guessing it's emulated in Python (for simplicity, as it's just a development server).. This woul...
Dump memcache keys from GAE SDK Console?
1.2
0
0
2,662
625,314
2009-03-09T07:49:00.000
4
0
0
1
python,google-app-engine,memcached
625,331
5
false
1
0
No. I did not found such functionality in memcached too. Thinking about this issue, I found this limitation understandable - it would require keeping a registry of keys with all related problems like key expiration, invalidation and of course locking. Such system would not be as fast as memcaches are intended to be.
4
1
0
In the "Memcache Viewer", is there any way to dump a list of existing keys? Just for debugging, of course, not for use in any scripts! I ask because it doesn't seem like the GAE SDK is using a "real" memcache server, so I'm guessing it's emulated in Python (for simplicity, as it's just a development server).. This woul...
Dump memcache keys from GAE SDK Console?
0.158649
0
0
2,662
625,314
2009-03-09T07:49:00.000
0
0
0
1
python,google-app-engine,memcached
626,458
5
false
1
0
Memcache is designed to be quick and there's no convincing use case for this functionality which would justify the overhead required for a command that is so at odds with the rest of memcached. The GAE SDK is simulating memcached, so it doesn't offer this functionality either.
4
1
0
In the "Memcache Viewer", is there any way to dump a list of existing keys? Just for debugging, of course, not for use in any scripts! I ask because it doesn't seem like the GAE SDK is using a "real" memcache server, so I'm guessing it's emulated in Python (for simplicity, as it's just a development server).. This woul...
Dump memcache keys from GAE SDK Console?
0
0
0
2,662
625,314
2009-03-09T07:49:00.000
0
0
0
1
python,google-app-engine,memcached
660,458
5
false
1
0
The easiest way that I could think of, would be to maintain a memcache key at a known ID, and then append to it every time you insert a new key. This way you could just query for the single key to get a list of existing keys.
4
1
0
In the "Memcache Viewer", is there any way to dump a list of existing keys? Just for debugging, of course, not for use in any scripts! I ask because it doesn't seem like the GAE SDK is using a "real" memcache server, so I'm guessing it's emulated in Python (for simplicity, as it's just a development server).. This woul...
Dump memcache keys from GAE SDK Console?
0
0
0
2,662
625,614
2009-03-09T09:57:00.000
5
0
0
0
iis,web-config,application-pool,python-idle
627,740
3
true
1
0
Not in IIS 6. In IIS 6, Application Pools are controlled by Worker Processes, which map to a Request Queue handled by HTTP.sys. HTTP.sys handles the communication with the WWW Server to determine when to start and stop Worker Processes. Since IIS 6 was created before .Net, there's no communication hooks between .Net ...
1
15
0
I know one can set the session timeout. But, if the application itself has received no requests for a given period of time, IIS shuts down the application. This behavior is configurable in the IIS management console, and I know how to do this. Still, I wonder if it is possible to configure this in web.config.
Is there a way to configure the Application Pool's "Idle timeout" in web.config?
1.2
0
0
13,542
626,759
2009-03-09T15:41:00.000
1
0
1
0
python,list,tuples
63,424,888
23
false
0
0
Just a quick extension to list vs tuple responses: Due to dynamic nature, list allocates more bit buckets than the actual memory required. This is done to prevent costly reallocation operation in case extra items are appended in the future. On the other hand, being static, lightweight tuple object does not reserve ex...
10
1,120
0
What's the difference between tuples/lists and what are their advantages/disadvantages?
What's the difference between lists and tuples?
0.008695
0
0
443,616
626,759
2009-03-09T15:41:00.000
-1
0
1
0
python,list,tuples
68,077,098
23
false
0
0
Along with a lot of the other comments made here the benefit I see in the use of tuples is the flexibility in their being able to have values of different types UNLIKE a list. Take for example a database table with different values and types designated for each column. A list couldn't replicate this at all (because of ...
10
1,120
0
What's the difference between tuples/lists and what are their advantages/disadvantages?
What's the difference between lists and tuples?
-0.008695
0
0
443,616
626,759
2009-03-09T15:41:00.000
0
0
1
0
python,list,tuples
66,390,274
23
false
0
0
Lists are mutable. whereas tuples are immutable. Accessing an offset element with index makes more sense in tuples than lists, Because the elements and their index cannot be changed.
10
1,120
0
What's the difference between tuples/lists and what are their advantages/disadvantages?
What's the difference between lists and tuples?
0
0
0
443,616
626,759
2009-03-09T15:41:00.000
215
0
1
0
python,list,tuples
627,165
23
false
0
0
If you went for a walk, you could note your coordinates at any instant in an (x,y) tuple. If you wanted to record your journey, you could append your location every few seconds to a list. But you couldn't do it the other way around.
10
1,120
0
What's the difference between tuples/lists and what are their advantages/disadvantages?
What's the difference between lists and tuples?
1
0
0
443,616
626,759
2009-03-09T15:41:00.000
6
0
1
0
python,list,tuples
627,901
23
false
0
0
Lists are intended to be homogeneous sequences, while tuples are heterogeneous data structures.
10
1,120
0
What's the difference between tuples/lists and what are their advantages/disadvantages?
What's the difference between lists and tuples?
1
0
0
443,616
626,759
2009-03-09T15:41:00.000
8
0
1
0
python,list,tuples
16,960,687
23
false
0
0
The values of list can be changed any time but the values of tuples can't be change. The advantages and disadvantages depends upon the use. If you have such a data which you never want to change then you should have to use tuple, otherwise list is the best option.
10
1,120
0
What's the difference between tuples/lists and what are their advantages/disadvantages?
What's the difference between lists and tuples?
1
0
0
443,616
626,759
2009-03-09T15:41:00.000
18
0
1
0
python,list,tuples
16,097,958
23
false
0
0
Lists are for looping, tuples are for structures i.e. "%s %s" %tuple. Lists are usually homogeneous, tuples are usually heterogeneous. Lists are for variable length, tuples are for fixed length.
10
1,120
0
What's the difference between tuples/lists and what are their advantages/disadvantages?
What's the difference between lists and tuples?
1
0
0
443,616
626,759
2009-03-09T15:41:00.000
-1
0
1
0
python,list,tuples
26,128,173
23
false
0
0
List is mutable and tuples is immutable. The main difference between mutable and immutable is memory usage when you are trying to append an item. When you create a variable, some fixed memory is assigned to the variable. If it is a list, more memory is assigned than actually used. E.g. if current memory assignment is ...
10
1,120
0
What's the difference between tuples/lists and what are their advantages/disadvantages?
What's the difference between lists and tuples?
-0.008695
0
0
443,616
626,759
2009-03-09T15:41:00.000
1
0
1
0
python,list,tuples
36,495,737
23
false
0
0
First of all, they both are the non-scalar objects (also known as a compound objects) in Python. Tuples, ordered sequence of elements (which can contain any object with no aliasing issue) Immutable (tuple, int, float, str) Concatenation using + (brand new tuple will be created of course) Indexing Slicing Singleton (...
10
1,120
0
What's the difference between tuples/lists and what are their advantages/disadvantages?
What's the difference between lists and tuples?
0.008695
0
0
443,616
626,759
2009-03-09T15:41:00.000
86
0
1
0
python,list,tuples
626,768
23
false
0
0
The key difference is that tuples are immutable. This means that you cannot change the values in a tuple once you have created it. So if you're going to need to change the values use a List. Benefits to tuples: Slight performance improvement. As a tuple is immutable it can be used as a key in a dictionary. If you can...
10
1,120
0
What's the difference between tuples/lists and what are their advantages/disadvantages?
What's the difference between lists and tuples?
1
0
0
443,616
626,796
2009-03-09T15:48:00.000
3
0
1
0
python,windows,application-data,common-files
627,071
6
false
0
0
You can access all of your OS environment variables using the os.environ dictionary in the os module. Choosing which key to use from that dictionary could be tricky, though. In particular, you should remain aware of internationalized (i.e., non-English) versions of Windows when using these paths. os.environ['ALLUSERS...
1
31
0
I would like my application to store some data for access by all users. Using Python, how can I find where the data should go?
How do I find the Windows common application data folder using Python?
0.099668
0
0
60,928
628,192
2009-03-09T21:58:00.000
0
0
1
0
python,data-structures
20,666,684
7
false
1
0
Do you have the possibility of using Jython? I just mention it because using TreeMap, TreeSet, etc. is trivial. Also if you're coming from a Java background and you want to head in a Pythonic direction Jython is wonderful for making the transition easier. Though I recognise that use of TreeSet in this case would not ...
1
22
1
Does anybody know if Python has an equivalent to Java's SortedSet interface? Heres what I'm looking for: lets say I have an object of type foo, and I know how to compare two objects of type foo to see whether foo1 is "greater than" or "less than" foo2. I want a way of storing many objects of type foo in a list L, so th...
Python equivalent to java.util.SortedSet?
0
0
0
9,278
628,903
2009-03-10T04:05:00.000
2
0
1
0
python,performance,iterator
628,978
9
false
0
0
An iterator is simply an object that provides methods to allow traversing through a collection. You could traverse all of the elements of an array or all the nodes of a tree with the same interface. Trees and arrays are very different data structures and require different methods to traverse .. but with an iterator yo...
4
26
0
What (if any) performance advantages are offered by using iterators. It seems like the 'Right Way' to solve many problems, but does it create faster/more memory-conscious code? I'm thinking specifically in Python, but don't restrict answers to just that.
Performance Advantages to Iterators?
0.044415
0
0
19,830
628,903
2009-03-10T04:05:00.000
3
0
1
0
python,performance,iterator
734,050
9
false
0
0
My inference from many answers above is "Use list to code. If necessary, re-factor using iterators" The difference is not apparent unless you have a large dataset. Another thing to note is that, even when using lists often, the dataset we are operating upon is progressively smaller and smaller.
4
26
0
What (if any) performance advantages are offered by using iterators. It seems like the 'Right Way' to solve many problems, but does it create faster/more memory-conscious code? I'm thinking specifically in Python, but don't restrict answers to just that.
Performance Advantages to Iterators?
0.066568
0
0
19,830
628,903
2009-03-10T04:05:00.000
2
0
1
0
python,performance,iterator
40,428,520
9
false
0
0
There is one answer that I think confuses the concept of generator and iterator a little bit. So I decided to give a try answering this question with a metaphor example. I'm working at a kitchen, my boss give me a task of adding up the weight of 10 (or 100 or a million) breads. I have a scale and a calculator( magic tr...
4
26
0
What (if any) performance advantages are offered by using iterators. It seems like the 'Right Way' to solve many problems, but does it create faster/more memory-conscious code? I'm thinking specifically in Python, but don't restrict answers to just that.
Performance Advantages to Iterators?
0.044415
0
0
19,830
628,903
2009-03-10T04:05:00.000
13
0
1
0
python,performance,iterator
629,169
9
false
0
0
Iterators will be faster and have better memory efficiency. Just think of an example of range(1000) vs xrange(1000). (This has been changed in 3.0, range is now an iterator.) With range you pre-build your list, but xrange is an iterator and yields the next item when needed instead. The performance difference isn't g...
4
26
0
What (if any) performance advantages are offered by using iterators. It seems like the 'Right Way' to solve many problems, but does it create faster/more memory-conscious code? I'm thinking specifically in Python, but don't restrict answers to just that.
Performance Advantages to Iterators?
1
0
0
19,830
629,696
2009-03-10T11:09:00.000
2
0
0
0
python,django,deployment,google-analytics
629,888
10
false
1
0
I mostly agree with Ned, although I have a single setting called IS_LIVE_SITE which toggles analytics code, adverts and a few other things. This way I can keep all the keys in subversion (as it is a pain to look them up) and still toggle them on or off easily.
2
38
0
We're about to deploy a new Django website, and we want to use Google Analytics to keep track of traffic on the site. However, we don't want all of the hits on development instances to contribute to the Google Analytics statistics. There are a few ways we could deal with this: have a configuration option in settings....
Deploying Google Analytics With Django
0.039979
0
0
19,916
629,696
2009-03-10T11:09:00.000
2
0
0
0
python,django,deployment,google-analytics
633,029
10
false
1
0
Instead of including the script tag directly in your html, just change the analytics javascript so it only runs if the href does not contain your prod site's name. This will work without any extra configuration.
2
38
0
We're about to deploy a new Django website, and we want to use Google Analytics to keep track of traffic on the site. However, we don't want all of the hits on development instances to contribute to the Google Analytics statistics. There are a few ways we could deal with this: have a configuration option in settings....
Deploying Google Analytics With Django
0.039979
0
0
19,916
631,813
2009-03-10T19:08:00.000
0
0
1
0
python,svn,distutils
632,040
4
false
0
0
Importing the setup script inside your package is silly (especially since it may no longer be present after your library is installed), but importing your library inside setup.py should be fine. A separate text file would work too, but has the problem that you must install the text file with your package if you want to...
1
4
0
I'm writing a Python package. The package needs to know its version number internally, while also including this version in the setup.py script for distutils. What's the best way of doing this, so that the version number doesn't need to be maintained in two separate places? I don't want to import the setup.py script ...
How do I assign a version number for a Python package using SVN and distutils?
0
0
0
1,001
631,996
2009-03-10T19:52:00.000
5
0
1
0
python,packaging
632,051
3
false
0
0
Isn't it easier, and cleaner, to just set an environment variable on your development machine, and test for os.environ['development_mode'] (or a setting of your choice)?
1
1
0
I tend to develop my apps in 'setup.py develop' -mode. I'd want the configuration to switch automagically on production mode when the program gets 'setup.py install'ed. This can be done by poor hacks, like checking whether installation directory contains 'setup.py', but I wonder whether pkg_resources can do this for me...
figure out whether python module is installed or in develop mode programmatically
0.321513
0
0
218
632,730
2009-03-10T23:47:00.000
1
1
0
1
python,c
632,844
7
false
0
0
If I was faced with a similar situation I'd ask myself a couple of questions: Is there anything more important I could be working on? Does Python bring anything to the table that is currently handled poorly by the current application? Will this allow me to add functionality that was previously too difficult to impleme...
6
2
0
I have a program in C that communicates via UDP with another program (in Java) and then does process manipulation (start/stop) based on the UDP pkt exchange. Now this C program has been legacy and I want to convert it to Python - do you think Python will be a good choice for the tasks mentioned?
What is the feasibility of porting a legacy C program to Python?
0.028564
0
0
381
632,730
2009-03-10T23:47:00.000
0
1
0
1
python,c
634,093
7
false
0
0
If this is an embedded program, then it might be a problem to port it since Python programs typically rely on the Python runtime and library, and those are fairly large. Especially when compared to a C program doing a well-defined task. Of course, it's likely you've already considered that aspect, but I wanted to menti...
6
2
0
I have a program in C that communicates via UDP with another program (in Java) and then does process manipulation (start/stop) based on the UDP pkt exchange. Now this C program has been legacy and I want to convert it to Python - do you think Python will be a good choice for the tasks mentioned?
What is the feasibility of porting a legacy C program to Python?
0
0
0
381
632,730
2009-03-10T23:47:00.000
1
1
0
1
python,c
632,740
7
false
0
0
Assuming that you have control over the environment which this application will run, and that the performance of interpreted language (python) compared to a compiled one (C) can be ignored, I believe Python is a great choice for this.
6
2
0
I have a program in C that communicates via UDP with another program (in Java) and then does process manipulation (start/stop) based on the UDP pkt exchange. Now this C program has been legacy and I want to convert it to Python - do you think Python will be a good choice for the tasks mentioned?
What is the feasibility of porting a legacy C program to Python?
0.028564
0
0
381
632,730
2009-03-10T23:47:00.000
4
1
0
1
python,c
632,788
7
false
0
0
I'd say that if: Your C code contains no platform specific requirements You are sure speed is not going to be an issue going from C to python You have a desire to not compile anymore You would like to try utilise exception handling You want to dabble in OO You might choose to run on many platforms without porting You ...
6
2
0
I have a program in C that communicates via UDP with another program (in Java) and then does process manipulation (start/stop) based on the UDP pkt exchange. Now this C program has been legacy and I want to convert it to Python - do you think Python will be a good choice for the tasks mentioned?
What is the feasibility of porting a legacy C program to Python?
0.113791
0
0
381
632,730
2009-03-10T23:47:00.000
2
1
0
1
python,c
632,925
7
false
0
0
Remember as well, you can leave parts of your program in C, turn them into Python modules and build python code around them - you don't need to re-write everything up-front.
6
2
0
I have a program in C that communicates via UDP with another program (in Java) and then does process manipulation (start/stop) based on the UDP pkt exchange. Now this C program has been legacy and I want to convert it to Python - do you think Python will be a good choice for the tasks mentioned?
What is the feasibility of porting a legacy C program to Python?
0.057081
0
0
381
632,730
2009-03-10T23:47:00.000
1
1
0
1
python,c
632,935
7
false
0
0
Yes, I think Python is a good choice, if all your platforms support it. Since this is a network program, I'm assuming the network is your runtime bottleneck? That's likely to still be the case in Python. If you really do need to speed it up, you can include your long-since-debugged, speedy C as Python modules.
6
2
0
I have a program in C that communicates via UDP with another program (in Java) and then does process manipulation (start/stop) based on the UDP pkt exchange. Now this C program has been legacy and I want to convert it to Python - do you think Python will be a good choice for the tasks mentioned?
What is the feasibility of porting a legacy C program to Python?
0.028564
0
0
381
633,086
2009-03-11T02:11:00.000
0
0
0
0
python,objective-c,cocoa,macos,fullscreen
633,718
4
false
0
1
The two solutions posted so far apply to “real” full-screen, but it’s worth noting that many full-screen apps just put a window over the whole screen (or, as vasi points out, a whole screen). To be accurate, you’ll have to check both.
1
2
0
I am writing an IM client for Mac (in Python, but an Objective C / Cocoa solution here is fine). I want to detect whether or not the user is currently watching a movie or playing a game in the foreground, or doing anything else that takes up the entire screen. If so, I won't play a sound when a new IM comes in, but if ...
Detecting fullscreen on Mac
0
0
0
1,606
633,127
2009-03-11T02:32:00.000
5
0
1
0
python,variables
21,862,978
10
false
0
0
In my Python 2.7 interpreter, the same whos command that exists in MATLAB exists in Python. It shows the same details as the MATLAB analog (variable name, type, and value/data). Note that in the Python interpreter, whos lists all variables in the "interactive namespace".
3
352
0
I'm currently working on a computation in python shell. What I want to have is Matlab style listout where you can see all the variables that have been defined up to a point (so I know which names I've used, their values and such). Is there a way, and how can I do that?
Viewing all defined variables
0.099668
0
0
520,059
633,127
2009-03-11T02:32:00.000
437
0
1
0
python,variables
633,134
10
false
0
0
A few things you could use: dir() will give you the list of in scope variables: globals() will give you a dictionary of global variables locals() will give you a dictionary of local variables
3
352
0
I'm currently working on a computation in python shell. What I want to have is Matlab style listout where you can see all the variables that have been defined up to a point (so I know which names I've used, their values and such). Is there a way, and how can I do that?
Viewing all defined variables
1
0
0
520,059
633,127
2009-03-11T02:32:00.000
16
0
1
0
python,variables
633,136
10
false
0
0
globals(), locals(), vars(), and dir() may all help you in what you want.
3
352
0
I'm currently working on a computation in python shell. What I want to have is Matlab style listout where you can see all the variables that have been defined up to a point (so I know which names I've used, their values and such). Is there a way, and how can I do that?
Viewing all defined variables
1
0
0
520,059
635,200
2009-03-11T16:00:00.000
0
0
1
0
python,visual-studio-2005
635,266
3
false
0
0
I recall, some time ago, giving IronPython a 'whirl' in VS2005. I ran into all kinds of 'esoteric' errors until I figured out that to compile and run I had to add the C++ libraries and tools of VS2005 as well (add/remove). Maybe this is something similar ?
1
0
0
I am looking for the Visual Studio 2005 build of Python 2.4, 2.5 or 2.6, I also need the python2x_d.lib (the debug version of the .lib) since I embed the interpreter into my app and the python libs implicitly link to the python2x_d.lib with pragmas (grrr). Any hints where I can find those builds ? Regards, Paul
Visual Studio 2005 Build of Python with Debug .lib
0
0
0
788
635,419
2009-03-11T16:54:00.000
1
1
1
0
python,documentation,documentation-generation
22,247,361
5
false
0
0
using doxypy filter with doxygen is a good thing also
1
21
0
What is out there on conventions and tools for documenting python source code?
code documentation for python
0.039979
0
0
15,370
636,990
2009-03-12T00:53:00.000
6
0
0
0
python,wxpython,pygame,playing-cards
637,017
6
true
0
1
If all you want is a GUI, wxPython should do the trick. If you're looking to add sound, controller input, and take it beyond a simple card game, then you may want to use pygame.
3
6
0
I have been playing around with writing some simple card games in Python for fun and I would like to add a graphical user interface (GUI) to the games. Which library would you recommend for writing the GUI for a simple card game?
wxPython or pygame for a simple card game?
1.2
0
0
5,022
636,990
2009-03-12T00:53:00.000
3
0
0
0
python,wxpython,pygame,playing-cards
640,064
6
false
0
1
Generally, PyGame is the better option for coding games. But that's for the more common type of games - where things move on the screen and you must have a good "frame-rate" performance. For something like a card game, however, I'd go with wxPython (or rather, PyQt). This is because a card game hasn't much in terms of...
3
6
0
I have been playing around with writing some simple card games in Python for fun and I would like to add a graphical user interface (GUI) to the games. Which library would you recommend for writing the GUI for a simple card game?
wxPython or pygame for a simple card game?
0.099668
0
0
5,022
636,990
2009-03-12T00:53:00.000
1
0
0
0
python,wxpython,pygame,playing-cards
637,004
6
false
0
1
I'd say pygame -- I've heard it's lots of fun, easy and happy. Also, all of my experiences with wxPython have been sad an painful. But I'm not bias or anything.
3
6
0
I have been playing around with writing some simple card games in Python for fun and I would like to add a graphical user interface (GUI) to the games. Which library would you recommend for writing the GUI for a simple card game?
wxPython or pygame for a simple card game?
0.033321
0
0
5,022
637,295
2009-03-12T03:50:00.000
2
0
1
0
python,whitespace
638,131
17
false
0
0
When I look at C and Java code, it's always nicely indented. Always. Nicely. Indented. Clearly, C and Java folks spend a lot of time getting their whitespace right. So do Python programmers.
12
3
0
At the moment I have never had a problem with whitespace in Python (although I've only used it in two projects and I was the only programmer). What are some potential pitfalls with whitespace and indentation in Python for someone learning the language?
Are there any pitfalls with using whitespace in Python?
0.023525
0
0
4,046
637,295
2009-03-12T03:50:00.000
1
0
1
0
python,whitespace
639,671
17
false
0
0
Pitfalls It can be annoying posting code snippets on web sites that ignore your indentation. Its hard to see how multi-line anonymous functions (lambdas) can fit in with the syntax of the language. It makes it hard to embed Python in HTML files to make templates in the way that PHP or C# can be embedded in PHP or ASP....
12
3
0
At the moment I have never had a problem with whitespace in Python (although I've only used it in two projects and I was the only programmer). What are some potential pitfalls with whitespace and indentation in Python for someone learning the language?
Are there any pitfalls with using whitespace in Python?
0.011764
0
0
4,046
637,295
2009-03-12T03:50:00.000
0
0
1
0
python,whitespace
639,262
17
false
0
0
One drawback I experienced as a beginner whith python was forgetting to set softtabs in my editors gave me lots of trouble. But after a year of serious use of the language I'm not able to write poorly indented code anymore in any other language.
12
3
0
At the moment I have never had a problem with whitespace in Python (although I've only used it in two projects and I was the only programmer). What are some potential pitfalls with whitespace and indentation in Python for someone learning the language?
Are there any pitfalls with using whitespace in Python?
0
0
0
4,046
637,295
2009-03-12T03:50:00.000
1
0
1
0
python,whitespace
637,404
17
false
0
0
I used to think that the white space issues was just a question of getting used to it. Someone pointed out some serious flaws with Python indentation and I think they are quite valid and some subconcious understanding of these is what makes experienced programs nervious about the whole thing:- Cut and paste just doesn...
12
3
0
At the moment I have never had a problem with whitespace in Python (although I've only used it in two projects and I was the only programmer). What are some potential pitfalls with whitespace and indentation in Python for someone learning the language?
Are there any pitfalls with using whitespace in Python?
0.011764
0
0
4,046
637,295
2009-03-12T03:50:00.000
1
0
1
0
python,whitespace
638,534
17
false
0
0
If you use Eclipse as your IDE, you should take a look at PyDev; it handles indentation and spacing automatically. You can copy-paste from mixed-spacing sources, and it will convert them for you. Since I started learning the language, I've never once had to think about spacing. And it's really a non-issue; sane progr...
12
3
0
At the moment I have never had a problem with whitespace in Python (although I've only used it in two projects and I was the only programmer). What are some potential pitfalls with whitespace and indentation in Python for someone learning the language?
Are there any pitfalls with using whitespace in Python?
0.011764
0
0
4,046
637,295
2009-03-12T03:50:00.000
0
0
1
0
python,whitespace
637,361
17
false
0
0
The only trouble I've ever had is minor annoyances when I'm using code I wrote before I settled on whether I liked tabs or spaces, or cutting and posting code from a website. I think most decent editors these days have a convert tabs-to-spaces and back option. Textmate certainly does. Beyond that, the indentation has ...
12
3
0
At the moment I have never had a problem with whitespace in Python (although I've only used it in two projects and I was the only programmer). What are some potential pitfalls with whitespace and indentation in Python for someone learning the language?
Are there any pitfalls with using whitespace in Python?
0
0
0
4,046
637,295
2009-03-12T03:50:00.000
0
0
1
0
python,whitespace
639,767
17
false
0
0
No, I would say that is one thing to which I can find no downfalls. Yes, it is no doubt irritating to some, but that is just because they have a different habit about their style of formatting. Learn it early, and it's gonna stick. Just look how many discussions we have over a style matter in languages like C, Cpp, Jav...
12
3
0
At the moment I have never had a problem with whitespace in Python (although I've only used it in two projects and I was the only programmer). What are some potential pitfalls with whitespace and indentation in Python for someone learning the language?
Are there any pitfalls with using whitespace in Python?
0
0
0
4,046
637,295
2009-03-12T03:50:00.000
2
0
1
0
python,whitespace
637,331
17
false
0
0
That actually kept me away from Python for a while. Coming from a strong C background, I felt like I was driving without a seat belt. It was aggravating when I was trying to fill up a snippet library in my editor with boilerplate, frequently used classes. I learn best by example, so I was grabbing as many interesting s...
12
3
0
At the moment I have never had a problem with whitespace in Python (although I've only used it in two projects and I was the only programmer). What are some potential pitfalls with whitespace and indentation in Python for someone learning the language?
Are there any pitfalls with using whitespace in Python?
0.023525
0
0
4,046
637,295
2009-03-12T03:50:00.000
0
0
1
0
python,whitespace
637,310
17
false
0
0
The problem is that in Python, if you use spaces to indent basic blocks in one area of a file, and tabs to indent in another, you get a run-time error. This is quite different from semicolons in C. This isn't really a programming question, though, is it?
12
3
0
At the moment I have never had a problem with whitespace in Python (although I've only used it in two projects and I was the only programmer). What are some potential pitfalls with whitespace and indentation in Python for someone learning the language?
Are there any pitfalls with using whitespace in Python?
0
0
0
4,046
637,295
2009-03-12T03:50:00.000
0
0
1
0
python,whitespace
639,229
17
false
0
0
If your using emacs, set a hard tab length of 8 and a soft tab length of 4. This way you will be alterted to any extraneous tab characters. You should always uses 4 spaces instead of tabs.
12
3
0
At the moment I have never had a problem with whitespace in Python (although I've only used it in two projects and I was the only programmer). What are some potential pitfalls with whitespace and indentation in Python for someone learning the language?
Are there any pitfalls with using whitespace in Python?
0
0
0
4,046
637,295
2009-03-12T03:50:00.000
11
0
1
0
python,whitespace
637,309
17
false
0
0
It can be confusing in some editors where one line is indented with spaces and the next is indented with a tab. This is confusing as the indentation looks the same but causes an error. Also when your copying code, if your editor doesn't have a function to indent entire blocks, it could be annoying fixing all the indent...
12
3
0
At the moment I have never had a problem with whitespace in Python (although I've only used it in two projects and I was the only programmer). What are some potential pitfalls with whitespace and indentation in Python for someone learning the language?
Are there any pitfalls with using whitespace in Python?
1
0
0
4,046
637,295
2009-03-12T03:50:00.000
1
0
1
0
python,whitespace
637,341
17
false
0
0
Whitespace block delimiters force a certain amount of code formatting, which seems to irritate some programmers. Some in our shop seem to be of the attitude that they are too busy, or can't be bothered to pay attention to formatting standards, and a language that forces it rubs them raw. Sometimes the same folks gripe ...
12
3
0
At the moment I have never had a problem with whitespace in Python (although I've only used it in two projects and I was the only programmer). What are some potential pitfalls with whitespace and indentation in Python for someone learning the language?
Are there any pitfalls with using whitespace in Python?
0.011764
0
0
4,046
638,150
2009-03-12T11:06:00.000
16
0
0
0
python,ruby
639,650
4
false
1
0
Ruby gets more attention than Python simply because Ruby has one clear favourite when it comes to web apps while Python has traditionally had a very splintered approach (Zope, Plone, Django, Pylons, Turbogears). The critical mass of having almost all developers using one system as opposed to a variety of individual one...
2
13
0
I am in the field of data crunching and very soon might make a move to the world of web programming. Although I am fascinated both by Python and Ruby as both of them seem to be having every similar styles when it comes to writing business logic or data crunching logic. But when I start googling for web development I st...
Ruby on Rails versus Python
1
0
0
26,861
638,150
2009-03-12T11:06:00.000
3
0
0
0
python,ruby
639,045
4
false
1
0
Ruby and Python have more similarities than differences; the same is true for Rails and Django, which are the leading web frameworks in the respective languages. Both languages and both frameworks are likely to be rewarding to work with - in personal, "fun" terms at least - I don't know what the job markets are like in...
2
13
0
I am in the field of data crunching and very soon might make a move to the world of web programming. Although I am fascinated both by Python and Ruby as both of them seem to be having every similar styles when it comes to writing business logic or data crunching logic. But when I start googling for web development I st...
Ruby on Rails versus Python
0.148885
0
0
26,861
638,272
2009-03-12T11:48:00.000
6
0
0
0
.net,silverlight,multiplayer,python-stackless
1,255,224
3
false
1
0
I spent a year working on a massively multiplayer online game using Silverlight for the frontend and Python for the backend (I actually used IronPython in Silverlight so as to simplify development) Silverlight is very well suited for this, I wouldn't do a serious online game in anything else. It already has 35% of the ...
1
4
0
I'm thinking about developing online multiplayer social game. The shared state of the world would require something fast on the backend, so the potential solutions seem to be: fast game engine on server (eg. c++ ) and some frontend language (php/python/ruby) + flash whole stack in python (using twisted or stackless py...
Architecture for social multiplayer browser game (backend choice + frontend choice [flash/silverlight])
1
0
0
5,154
639,409
2009-03-12T16:22:00.000
1
1
0
0
php,python
639,435
5
false
1
0
PHP is fine for either use in my opinion, the performance overheads are rarely noticed. It's usually other processes which will delay the program. It's easy to cache PHP programs with something like eAccelerator.
3
5
0
I'd like to have your opinion about writing web apps in PHP vs. a long-running process using tools such as Django or Turbogears for Python. As far as I know: - In PHP, pages are fetched from the hard-disk every time (although I assume the OS keeps files in RAM for a while after they've been accessed) - Pages are recomp...
PHP vs. long-running process (Python, Java, etc.)?
0.039979
0
0
1,789
639,409
2009-03-12T16:22:00.000
3
1
0
0
php,python
639,537
5
false
1
0
After you apply memcache, opcode caching, and connection pooling, the only real difference between PHP and other options is that PHP is short-lived, processed based, while other options are, typically, long-lived multithreaded based. The advantage PHP has is that its dirt simple to write scripts. You don't have to wor...
3
5
0
I'd like to have your opinion about writing web apps in PHP vs. a long-running process using tools such as Django or Turbogears for Python. As far as I know: - In PHP, pages are fetched from the hard-disk every time (although I assume the OS keeps files in RAM for a while after they've been accessed) - Pages are recomp...
PHP vs. long-running process (Python, Java, etc.)?
0.119427
0
0
1,789
639,409
2009-03-12T16:22:00.000
0
1
0
0
php,python
640,138
5
false
1
0
As many others have noted, PHP nor Django are going to be your bottlenecks. Hitting the hard disk for the bytecode on PHP is irrelevant for a heavily trafficked site because caching will take over at that point. The same is true for Django. Model/View and user experience design will have order of magnitude benefits t...
3
5
0
I'd like to have your opinion about writing web apps in PHP vs. a long-running process using tools such as Django or Turbogears for Python. As far as I know: - In PHP, pages are fetched from the hard-disk every time (although I assume the OS keeps files in RAM for a while after they've been accessed) - Pages are recomp...
PHP vs. long-running process (Python, Java, etc.)?
0
0
0
1,789
639,949
2009-03-12T18:41:00.000
1
0
0
0
python,oracle,validation
640,115
3
false
0
0
The format of a date string that Oracle recognizes as a date is a configurable property of the database and as such it's considered bad form to rely on implicit conversions of strings to dates. Typically Oracle dates format to 'DD-MON-YYYY' but you can't always rely on it being set that way. Personally I would have the...
2
1
0
Our Python CMS stores some date values in a generic "attribute" table's varchar column. Some of these dates are later moved into a table with an actual date column. If the CMS user entered an invalid date, it doesn't get caught until the migration, when the query fails with an "Invalid string date" error. How can I u...
Validating Oracle dates in Python
0.066568
1
0
902
639,949
2009-03-12T18:41:00.000
-1
0
0
0
python,oracle,validation
640,153
3
false
0
0
Validate as early as possible. Why don't you store dates as dates in your Python CMS? It is difficult to know what date a string like '03-04-2008' is. Is it 3 april 2008 or 4 march 2008? An American will say 4 march 2008 but a Dutch person will say 3 april 2008.
2
1
0
Our Python CMS stores some date values in a generic "attribute" table's varchar column. Some of these dates are later moved into a table with an actual date column. If the CMS user entered an invalid date, it doesn't get caught until the migration, when the query fails with an "Invalid string date" error. How can I u...
Validating Oracle dates in Python
-0.066568
1
0
902
640,191
2009-03-12T19:47:00.000
1
0
1
1
python,linux
640,292
6
false
0
0
For what it's worth, Python 2.6 is available in the Portage tree for Gentoo, but it's hardmasked (that doesn't really count as stable) because apparently there are some programs that don't work with it. My guess is that if you had Gentoo, you could install Python 2.6 and get it to work, but it might not be smart to mak...
2
4
0
I've heard ubuntu 9.4 will but it's still in alpha. Are there any stable distros that come with python 2.6 or at least don't depend on it so much so reinstalling python won't break anything?
Is there any linux distribution that comes with python 2.6 yet?
0.033321
0
0
619
640,191
2009-03-12T19:47:00.000
4
0
1
1
python,linux
640,447
6
false
0
0
openSUSE 11.1 ships Python 2.6 as standard.
2
4
0
I've heard ubuntu 9.4 will but it's still in alpha. Are there any stable distros that come with python 2.6 or at least don't depend on it so much so reinstalling python won't break anything?
Is there any linux distribution that comes with python 2.6 yet?
0.132549
0
0
619
640,877
2009-03-12T23:26:00.000
15
0
0
0
python,django,turbogears,turbogears2
703,311
8
false
1
0
TG2 has several advantages that I think are important: Multi-database support sharding/data partitioning support longstanding support for aggregates, multi-column primary keys a transaction system that handles multi-database transactions for you an admin system that works with all of the above out of the box support ...
4
7
0
Django is my favorite python web framework. I've tried out others like pylons, web2py, nevow and others. But I've never looked into TurboGears with much enthusiasm. Now with TG2 out of beta I may give it a try. I'd like to know what are some of the pros and cons compared to Django.
Can anyone point out the pros and cons of TG2 over Django?
1
0
0
2,475
640,877
2009-03-12T23:26:00.000
5
0
0
0
python,django,turbogears,turbogears2
1,387,123
8
false
1
0
Pros. SQLAlchemy > django ORM Multiple template languages out of the box (genshi,mako,jinja2) more WSGI friendly Object Dispatch > routes > regexp routing. You can get the first 2 with TG2 Almost all components are optional you can keep the core and use any ORM, template, auth library, etc. Sprox > django forms Cons....
4
7
0
Django is my favorite python web framework. I've tried out others like pylons, web2py, nevow and others. But I've never looked into TurboGears with much enthusiasm. Now with TG2 out of beta I may give it a try. I'd like to know what are some of the pros and cons compared to Django.
Can anyone point out the pros and cons of TG2 over Django?
0.124353
0
0
2,475
640,877
2009-03-12T23:26:00.000
0
0
0
0
python,django,turbogears,turbogears2
642,874
8
false
1
0
Last I checked, django has a very poor data implementation. And that's a huge weakness in my book. Django's orm doesn't allow me to use the power of the underlying database. For example I can't use compound primary keys, which are important to good db design. It also doesn't support more than a single database, whi...
4
7
0
Django is my favorite python web framework. I've tried out others like pylons, web2py, nevow and others. But I've never looked into TurboGears with much enthusiasm. Now with TG2 out of beta I may give it a try. I'd like to know what are some of the pros and cons compared to Django.
Can anyone point out the pros and cons of TG2 over Django?
0
0
0
2,475
640,877
2009-03-12T23:26:00.000
0
0
0
0
python,django,turbogears,turbogears2
641,046
8
false
1
0
Because Django uses its own ORM it limits you to learn that ORM for that specific web framework. I think using an web framework with a more popular ORM (like SqlAlchemy which TG uses) increases your employability chances. Just my 2 cents ..
4
7
0
Django is my favorite python web framework. I've tried out others like pylons, web2py, nevow and others. But I've never looked into TurboGears with much enthusiasm. Now with TG2 out of beta I may give it a try. I'd like to know what are some of the pros and cons compared to Django.
Can anyone point out the pros and cons of TG2 over Django?
0
0
0
2,475
640,970
2009-03-13T00:09:00.000
7
0
0
0
python,django,email
641,004
6
false
1
0
Generally: 1) Set up a dedicated email account for the purpose. 2) Have a programm monitor the mailbox (let's say fetchmail, since that's what I do). 3) When an email arrives at the account, fetchmail downloads the email, writes it to disk, and calls script or program you have written with the email file as an argument...
1
12
0
I was wondering if someone could help me out. In some web application, the app will send out emails, say when a new message has been posted. Then instead of signing into the application to post a reply you can just simply reply to the email and it will automatically update the web app with your response. My question ...
Email integration
1
0
0
1,824
641,770
2009-03-13T07:48:00.000
18
0
0
0
python,opengl
641,832
8
true
0
1
If you are worried about 3D performance: Most of the performance-critical parts will be handled by OpenGL (in a C library or even in hardware), so the language you use to drive it should not matter too much. To really find out if performance is a problem, you'd have to try it. But there is no reason why it cannot work ...
2
16
0
I am planning to write an simple 3d(isometric view) game in Java using jMonkeyEngine - nothing to fancy, I just want to learn something about OpenGL and writing efficient algorithms (random map generating ones). When I was planning what to do, I started wondering about switching to Python. I know that Python didn't co...
Can 3D OpenGL game written in Python look good and run fast?
1.2
0
0
17,104
641,770
2009-03-13T07:48:00.000
1
0
0
0
python,opengl
645,987
8
false
0
1
There was a Vampires game out a few years ago where most if not all of the code was in Python. Not sure if the 3D routines were in them, but it worked fine.
2
16
0
I am planning to write an simple 3d(isometric view) game in Java using jMonkeyEngine - nothing to fancy, I just want to learn something about OpenGL and writing efficient algorithms (random map generating ones). When I was planning what to do, I started wondering about switching to Python. I know that Python didn't co...
Can 3D OpenGL game written in Python look good and run fast?
0.024995
0
0
17,104
642,853
2009-03-13T14:01:00.000
-2
0
0
0
python,coding-style,wxpython
642,948
4
false
0
1
Have you tried running your scripts with pythonw.exe instead of python.exe?
2
3
0
I noticed that my programs written with wxPython have Win98 button style. But Boa Constructor (that is written using wxPython too) got pretty buttons. How to make buttons look like current Windows buttons style?
WinXP button-style with wxPython
-0.099668
0
0
1,511
642,853
2009-03-13T14:01:00.000
0
0
0
0
python,coding-style,wxpython
841,710
4
false
0
1
The answers so far handle distributing the package as an executable (eg. py2exe), where the answer has already been given. But since (i think) python 2.6 you have the same problem when just starting the .py file from the commandline (Vista and Windows7). Robin Dunn suggested using update_manifest.py which he distribute...
2
3
0
I noticed that my programs written with wxPython have Win98 button style. But Boa Constructor (that is written using wxPython too) got pretty buttons. How to make buttons look like current Windows buttons style?
WinXP button-style with wxPython
0
0
0
1,511
643,173
2009-03-13T15:14:00.000
0
0
1
0
python,c,regex
643,200
5
false
0
0
Nested parenthesis cannot be described by a regexp and require a full parser (able to understand a grammar, which is something more powerful than a regexp). I do not think there is a solution.
3
2
0
I am converting some matlab code to C, currently I have some lines that have powers using the ^, which is rather easy to do with something along the lines \(?(\w*)\)?\^\(?(\w*)\)? works fine for converting (glambda)^(galpha),using the sub routine in python pattern.sub(pow(\g<1>,\g<2>),'(glambda)^(galpha)') My problem c...
regular expression help with converting exp1^exp2 to pow(exp1, exp2)
0
0
0
288
643,173
2009-03-13T15:14:00.000
1
0
1
0
python,c,regex
643,252
5
false
0
0
I think you can use recursion here. Once you figure out the Left and Right parts, pass each of those to your function again. The base case would be that no ^ operator is found, so you will not need to add the pow() function to your result string. The function will return a string with all the correct pow()'s in place. ...
3
2
0
I am converting some matlab code to C, currently I have some lines that have powers using the ^, which is rather easy to do with something along the lines \(?(\w*)\)?\^\(?(\w*)\)? works fine for converting (glambda)^(galpha),using the sub routine in python pattern.sub(pow(\g<1>,\g<2>),'(glambda)^(galpha)') My problem c...
regular expression help with converting exp1^exp2 to pow(exp1, exp2)
0.039979
0
0
288
643,173
2009-03-13T15:14:00.000
2
0
1
0
python,c,regex
643,204
5
false
0
0
Unfortunately, regular expressions aren't the right tool for handling nested structures. There are some regular expressions engines (such as .NET) which have some support for recursion, but most — including the Python engine — do not, and can only handle as many levels of nesting as you build into the expression (whic...
3
2
0
I am converting some matlab code to C, currently I have some lines that have powers using the ^, which is rather easy to do with something along the lines \(?(\w*)\)?\^\(?(\w*)\)? works fine for converting (glambda)^(galpha),using the sub routine in python pattern.sub(pow(\g<1>,\g<2>),'(glambda)^(galpha)') My problem c...
regular expression help with converting exp1^exp2 to pow(exp1, exp2)
0.07983
0
0
288
643,422
2009-03-13T16:05:00.000
2
1
0
0
python,eclipse,formatting,word-wrap
643,439
2
false
0
0
Highlight the text, then press Ctrl-Shift-F, or open the context menu and select Source / Format.
1
2
0
I would like to auto-fill a paragraph to 80 characters (or some other fixed width) in Eclipse. Is this possible via a keyboard command like in Emacs? Or is there maybe a plugin (I did not find anything on google)? Edit: I am not sure if this is relevant, but I need this for docstrings in Python code (using the PyDev pl...
How can I auto-fill a paragraph in Eclipse?
0.197375
0
0
1,354
643,565
2009-03-13T16:33:00.000
1
0
1
0
javascript,python,gwt
3,030,515
4
false
1
0
yes it works fine on windows (it's a compiler: you just need python, to run the conversion to javascript). but if you're thinking of pyjamas-desktop, 0.6 added support for MSHTML as one of the engines, so that works too.
2
18
0
Has any one used this? I don't have a large background in Javascript and this lib looks like it may speed things along. www.pyjs.org
Anyone use Pyjamas (pyjs) python to javascript compiler (like GWT..)
0.049958
0
0
5,067
643,565
2009-03-13T16:33:00.000
10
0
1
0
javascript,python,gwt
730,960
4
false
1
0
yep. me. i'm the lead developer. drop by on groups.google.com "pyjamas-dev" and say hello.
2
18
0
Has any one used this? I don't have a large background in Javascript and this lib looks like it may speed things along. www.pyjs.org
Anyone use Pyjamas (pyjs) python to javascript compiler (like GWT..)
1
0
0
5,067
644,073
2009-03-13T18:40:00.000
3
0
1
0
python,alarm
699,105
4
false
0
0
The most robust solution is to use a subprocess, then kill that subprocess. Python2.6 adds .kill() to subprocess.Popen(). I don't think your threading approach works as you expect. Deleting your reference to the Thread object won't kill the thread. Instead, you'd need to set an attribute that the thread checks once ...
1
21
0
I have a function that occasionally hangs. Normally I would set an alarm, but I'm in Windows and it's unavailable. Is there a simple way around this, or should I just create a thread that calls time.sleep()?
signal.alarm replacement in Windows [Python]
0.148885
0
0
11,074
644,170
2009-03-13T19:09:00.000
79
0
1
0
python
644,189
5
true
0
0
It automatically sorts a list of tuples by the first elements in the tuples, then by the second elements and so on tuple([1,2,3]) will go before tuple([1,2,4]). If you want to override this behaviour pass a callable as the second argument to the sort method. This callable should return 1, -1, 0.
1
62
0
Empirically, it seems that Python's default list sorter, when passed a list of tuples, will sort by the first element in each tuple. Is that correct? If not, what's the right way to sort a list of tuples by their first elements?
How does Python sort a list of tuples?
1.2
0
0
70,869
644,237
2009-03-13T19:25:00.000
1
0
0
0
python,ruby-on-rails,ruby,django
644,312
7
false
1
0
The problem with a "brochure" approach is that it doesn't address the clients needs. Putting the language/platform of choice into a presentation that addresses the clients goals is much more likely to sell them - both on the tools you want to use, as well as you as a provider. As long as you can show that your approach...
5
14
0
Businessmen typically want a web application developed. They are aware of .net or J2EE by names, without much knowledge about either. Altho' Rails and Django offer for a much better and faster development stack, it is a big task to convince businessmen to use these platforms. The task begins with introducing Django (or...
How do you make a case for Django [or Ruby on Rails] to non-technical clients
0.028564
0
0
2,100
644,237
2009-03-13T19:25:00.000
2
0
0
0
python,ruby-on-rails,ruby,django
644,291
7
false
1
0
The first 2 arguments from the top of my mind: Easier and faster development = cheaper product, less time to market. SO optimization out of the box.
5
14
0
Businessmen typically want a web application developed. They are aware of .net or J2EE by names, without much knowledge about either. Altho' Rails and Django offer for a much better and faster development stack, it is a big task to convince businessmen to use these platforms. The task begins with introducing Django (or...
How do you make a case for Django [or Ruby on Rails] to non-technical clients
0.057081
0
0
2,100
644,237
2009-03-13T19:25:00.000
1
0
0
0
python,ruby-on-rails,ruby,django
644,279
7
false
1
0
The best case to be made for either of these frameworks is their ability to automate repetitive and time-consuming tasks. This allows developers to be faster and more productive which in turn means projects are delivered faster.
5
14
0
Businessmen typically want a web application developed. They are aware of .net or J2EE by names, without much knowledge about either. Altho' Rails and Django offer for a much better and faster development stack, it is a big task to convince businessmen to use these platforms. The task begins with introducing Django (or...
How do you make a case for Django [or Ruby on Rails] to non-technical clients
0.028564
0
0
2,100
644,237
2009-03-13T19:25:00.000
16
0
0
0
python,ruby-on-rails,ruby,django
644,310
7
false
1
0
You need to speak the language of business: money. "If we do it Rails, it will cost you 50% less than the same functionality in Java." Your percentage may vary, and you might need to also include hosting and upkeep costs, to show how it balances out. When you're convincing other programmers, sure, talk about develo...
5
14
0
Businessmen typically want a web application developed. They are aware of .net or J2EE by names, without much knowledge about either. Altho' Rails and Django offer for a much better and faster development stack, it is a big task to convince businessmen to use these platforms. The task begins with introducing Django (or...
How do you make a case for Django [or Ruby on Rails] to non-technical clients
1
0
0
2,100
644,237
2009-03-13T19:25:00.000
21
0
0
0
python,ruby-on-rails,ruby,django
644,316
7
true
1
0
It's easier to ask forgiveness than permission. First, build the initial release in Django. Quickly. Build the model well (really well!). But use as much default admin functionality as you can. Spend time only only reporting and display pages where the HTML might actually matter to the presentation. Show this and th...
5
14
0
Businessmen typically want a web application developed. They are aware of .net or J2EE by names, without much knowledge about either. Altho' Rails and Django offer for a much better and faster development stack, it is a big task to convince businessmen to use these platforms. The task begins with introducing Django (or...
How do you make a case for Django [or Ruby on Rails] to non-technical clients
1.2
0
0
2,100
645,892
2009-03-14T13:11:00.000
2
1
1
0
python
645,935
3
false
0
0
Py2exe can generate COM dlls from python code, by compiling and embedding python code + interpreter. It does not, AFAIK, support regular DLLs yet. For that, see dirkgently's answer about embedding python yourself.
1
7
0
I have a Python module with nothing but regular global functions. I need to call it from another business-domain scripting environment that can only call out to C DLLs. Is there anyway to build my Python modules so that to other code it can be called like a standard C function that's exported from a DLL? This is for a ...
Is there a way to build a C-like DLL from a Python module?
0.132549
0
0
310