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
590,007
2009-02-26T10:41:00.000
2
0
1
0
python,ironpython,cpython
590,052
8
false
0
0
Python is Python, the only difference is that IronPython was designed to run on the CLR (.NET Framework), and as such, can inter-operate and consume .NET assemblies written in other .NET languages. So if your platform is Windows and you also use .NET or your company does then should consider IronPython.
4
33
0
How does IronPython stack up to the default Windows implementation of Python from python.org? If I am learning Python, will I be learning a subtley different language with IronPython, and what libraries would I be doing without? Are there, alternatively, any pros to IronPython (not including .NET IL compiled classes) t...
Python or IronPython
0.049958
0
0
14,578
590,007
2009-02-26T10:41:00.000
2
0
1
0
python,ironpython,cpython
590,216
8
false
0
0
One of the pros of IronPython is that, unlike CPython, IronPython doesn't use the Global Interpreter Lock, thus making threading more effective. In the standard Python implementation, threads grab the GIL on each object access. This limits parallel execution, which matters especially if you expect to fully utilize mul...
4
33
0
How does IronPython stack up to the default Windows implementation of Python from python.org? If I am learning Python, will I be learning a subtley different language with IronPython, and what libraries would I be doing without? Are there, alternatively, any pros to IronPython (not including .NET IL compiled classes) t...
Python or IronPython
0.049958
0
0
14,578
590,007
2009-02-26T10:41:00.000
13
0
1
0
python,ironpython,cpython
590,026
8
false
0
0
There are some subtle differences in how you write your code, but the biggest difference is in the libraries you have available. With IronPython, you have all the .Net libraries available, but at the expense of some of the "normal" python libraries that haven't been ported to the .Net VM I think. Basically, you should ...
4
33
0
How does IronPython stack up to the default Windows implementation of Python from python.org? If I am learning Python, will I be learning a subtley different language with IronPython, and what libraries would I be doing without? Are there, alternatively, any pros to IronPython (not including .NET IL compiled classes) t...
Python or IronPython
1
0
0
14,578
590,053
2009-02-26T10:56:00.000
0
1
0
0
python,audio,chat,voice
6,936,316
2
false
0
0
Basically a farsight lib which has xmpp-jingle that can accomodate video and voice chat is commonly used,for python itz farsight.py: try it.....!
1
3
0
I'm trying to find resources on video and voice chat operability in Python... Does anybody know of some good resources or sample projects? Any help would really be appreciated!
Video and Voice chat operability in Python
0
0
0
3,199
590,250
2009-02-26T12:01:00.000
0
0
1
0
python,module
20,102,459
8
false
0
0
I had an issue like this with bsddb. I was forced to install the bsddb3 module but hundreds of scripts imported bsddb. Instead of changing the import in all of them, I extracted the bsddb3 egg, and created a soft link in the site-packages directory so that both "bsddb" and "bsddb3" were one in the same to python.
4
10
0
Is it only possible if I rename the file? Or is there a __module__ variable to the file to define what's its name?
How to change a Python module name?
0
0
0
31,963
590,250
2009-02-26T12:01:00.000
0
0
1
0
python,module
590,279
8
false
0
0
Where would you like to have this __module__ variable, so your original script knows what to import? Modules are recognized by file names and looked in paths defined in sys.path variable. So, you have to rename the file, then remove the oldname.pyc, just to make sure everything works right.
4
10
0
Is it only possible if I rename the file? Or is there a __module__ variable to the file to define what's its name?
How to change a Python module name?
0
0
0
31,963
590,250
2009-02-26T12:01:00.000
0
0
1
0
python,module
590,271
8
false
0
0
Every class has an __module__ property, although I believe changing this will not change the namespace of the Class. If it is possible, it would probably involve using setattr to insert the methods or class into the desired module, although you run the risk of making your code very confusing to your future peers. Your ...
4
10
0
Is it only possible if I rename the file? Or is there a __module__ variable to the file to define what's its name?
How to change a Python module name?
0
0
0
31,963
590,250
2009-02-26T12:01:00.000
10
0
1
0
python,module
590,262
8
true
0
0
Yes, you should rename the file. Best would be after you have done that to remove the oldname.pyc and oldname.pyo compiled files (if present) from your system, otherwise the module will be importable under the old name too.
4
10
0
Is it only possible if I rename the file? Or is there a __module__ variable to the file to define what's its name?
How to change a Python module name?
1.2
0
0
31,963
591,300
2009-02-26T16:24:00.000
0
0
0
0
python,windows,passwords
600,635
3
false
0
0
You might need admin priviliges to do that, so look into elevating the current process or launch a new process with more priviliges. (I.e. something like vista's UAC but on XP.) Can't help with details though. :-/
1
4
0
How can I modify the password expiration to "never" on Windows XP for a local user with Python? I have the PyWIN and WMI modules on board but have no solution. I managed to query the current settings via WMI(based on Win32_UserAccount class), but how can modify it?
How can I modify password expiration in Windows using Python?
0
0
0
2,261
592,332
2009-02-26T20:37:00.000
9
0
0
0
python,orm,sqlalchemy,sqlobject
592,348
3
false
0
0
I think SQLObject is more pythonic/simpler, so if it works for you, then stick with it. SQLAlchemy takes a little more to learn, but can do more advanced things if you need that.
1
14
0
I don't expect to need much more than basic CRUD type functionality. I know that SQLAlchemy is more flexible, but the syntax etc of sqlobject just seem to be a bit easier to get up and going with.
Any reasons not to use SQLObject over SQLAlchemy?
1
1
0
3,351
594,266
2009-02-27T10:42:00.000
3
0
1
0
python,parsing,equation
594,457
7
false
0
0
To emphasize J.F. Sebastian's advice, 'eval' and even the 'compiler' solutions can be open to subtle security holes. How trustworthy is the input? With 'compiler' you can at least filter out things like getattr lookups from the AST, but I've found it's easier to use PLY or pyparsing for this sort of thing than it is to...
1
41
0
How can I (easily) take a string such as "sin(x)*x^2" which might be entered by a user at runtime and produce a Python function that could be evaluated for any value of x?
Equation parsing in Python
0.085505
0
0
60,682
594,273
2009-02-27T10:45:00.000
10
0
1
0
python,random,word-list
594,285
8
false
0
0
You can't. There is no algorithm to generate meaningful words. You can only generate words that sound like English, but they won't have any meaning.
2
14
0
What would be the best way to go about getting a function that returns a random English word (preferably a noun), without keeping a list of all possible words in a file before hand?
How to pick a random english word from a list
1
0
0
36,092
594,273
2009-02-27T10:45:00.000
0
0
1
0
python,random,word-list
594,283
8
false
0
0
Well, you have three options: Hard-code the list of words and initialize an array with it. Fetch the list from an internet location instead of a file. Keep a list of possible words in a file. The only way to avoid the above is if you're not concerned whether the word is real: you can just generate random-length strin...
2
14
0
What would be the best way to go about getting a function that returns a random English word (preferably a noun), without keeping a list of all possible words in a file before hand?
How to pick a random english word from a list
0
0
0
36,092
595,290
2009-02-27T15:46:00.000
3
0
1
0
python,symbian,nokia,s60,pys60
595,300
2
false
0
0
PyS60 as of version 1.9.0 uses Python 2.5.1 core and has no problems with garbage collection.
2
3
0
I have heard it many times that garbage collection in PyS60 is not up to to the mark. This imposes a lot of limits on writing cleaner code. Can I at least rely that the non cyclic references are cleaned up after a function exists.
Does PyS60 has a reliable garbage collection?
0.291313
0
0
308
595,290
2009-02-27T15:46:00.000
0
0
1
0
python,symbian,nokia,s60,pys60
915,114
2
true
0
0
Mostly you can, but occasionally PyS60 needs a little "help". Unbind keys, always cancel timers, might have to manually delete some classes etc. Nothing too bad. Btw current 1.9.x branch uses python core 2.5.4. In my opinion 1.9.5 is the first version, which might be better that 1.4.5. Worth taking a look, especially i...
2
3
0
I have heard it many times that garbage collection in PyS60 is not up to to the mark. This imposes a lot of limits on writing cleaner code. Can I at least rely that the non cyclic references are cleaned up after a function exists.
Does PyS60 has a reliable garbage collection?
1.2
0
0
308
595,296
2009-02-27T15:48:00.000
3
0
0
0
python,symbian,nokia,pys60
595,330
4
false
1
1
Yes, PyS60 is based on CPython, thus uses the C stack.
4
3
0
Symbian has a stack limit of 8kB. Does this also apply to the function calling in PyS60 apps?
Does the stack limit of Symbian also apply to PyS60?
0.148885
0
0
417
595,296
2009-02-27T15:48:00.000
1
0
0
0
python,symbian,nokia,pys60
606,180
4
false
1
1
Increasing the Symbian stack size is done through a parameter in the mmp file. This is valid when you create a native application that the toolchain will turn into an exe file. If you were to upgrade the Python runtime on your phone, with a version you built yourself, you could increase the stack size of the runtime pr...
4
3
0
Symbian has a stack limit of 8kB. Does this also apply to the function calling in PyS60 apps?
Does the stack limit of Symbian also apply to PyS60?
0.049958
0
0
417
595,296
2009-02-27T15:48:00.000
0
0
0
0
python,symbian,nokia,pys60
685,145
4
false
1
1
I would assume that PyS60 should be doing the memory management for you, as your program will probably be constrained by the resources of PyS60.
4
3
0
Symbian has a stack limit of 8kB. Does this also apply to the function calling in PyS60 apps?
Does the stack limit of Symbian also apply to PyS60?
0
0
0
417
595,296
2009-02-27T15:48:00.000
1
0
0
0
python,symbian,nokia,pys60
915,134
4
true
1
1
There is a difference between python runtime and python apps. Also from PyS60 app developer point of view, it's the heapsize that's more interesting... Version 1.9.5 comes by default with heapsize 100k min and 4M max. Of course you can define those by yourself when creating the SIS package to release and distribute you...
4
3
0
Symbian has a stack limit of 8kB. Does this also apply to the function calling in PyS60 apps?
Does the stack limit of Symbian also apply to PyS60?
1.2
0
0
417
597,348
2009-02-28T01:56:00.000
0
0
0
0
c#,.net,python,html-to-pdf
597,840
5
false
1
0
You can also try different approach like using virtual printers.
1
0
0
I have google as much as I possible, checked stackoverflow several times, and yet I can not find a good html to pdf converter that can handle css. Is there a free and open source solution (even for commercial usage)? There are many solutions, with huge variety of price ranges, but I was looking for something open sou...
FOSS HTML to PDF in Python, .Net or command line?
0
0
0
1,517
598,299
2009-02-28T16:59:00.000
3
0
1
1
python,dependencies,distribution,packaging
609,861
8
false
0
0
An important point seems to have been forgotten in the Cons of bundling libraries/frameworks/etc with the application: security updates. Most Web frameworks are full of security holes and require frequent patching. Any library, anyway, may have to be upgraded one day or the other for a security bug. If you do not bundl...
7
14
0
Summary I recently had a conversation with the creator of a framework that one of my applications depends on. During that conversation he mentioned as a sort of aside that it would make my life simpler if I just bundled his framework with my application and delivered to the end user a version that I knew was consisten...
When is it (not) appropriate to bundle dependencies with an application?
0.07486
0
0
1,453
598,299
2009-02-28T16:59:00.000
10
0
1
1
python,dependencies,distribution,packaging
598,397
8
true
0
0
I favor bundling dependencies, if it's not feasible to use a system for automatic dependency resolution (i.e. setuptools), and if you can do it without introducing version conflicts. You still have to consider your application and your audience; serious developers or enthusiasts are more likely to want to work with a ...
7
14
0
Summary I recently had a conversation with the creator of a framework that one of my applications depends on. During that conversation he mentioned as a sort of aside that it would make my life simpler if I just bundled his framework with my application and delivered to the end user a version that I knew was consisten...
When is it (not) appropriate to bundle dependencies with an application?
1.2
0
0
1,453
598,299
2009-02-28T16:59:00.000
1
0
1
1
python,dependencies,distribution,packaging
598,333
8
false
0
0
Just my experience, take it with a grain of salt. My preference for a couple of open-source libraries that I author is for independence from additional libs as much as possible. Reason being, not only am I on the hook for distribution of additional libraries along with mine, I'm also obliged to update my application f...
7
14
0
Summary I recently had a conversation with the creator of a framework that one of my applications depends on. During that conversation he mentioned as a sort of aside that it would make my life simpler if I just bundled his framework with my application and delivered to the end user a version that I knew was consisten...
When is it (not) appropriate to bundle dependencies with an application?
0.024995
0
0
1,453
598,299
2009-02-28T16:59:00.000
3
0
1
1
python,dependencies,distribution,packaging
603,843
8
false
0
0
If you're producing software for an end-user, the goal is to let the customer use your software. Anything that stands in the way is counter-productive. If they have to download dependencies themselves, there's a possibility that they'll decide to avoid your software instead. You can't control whether libraries will be ...
7
14
0
Summary I recently had a conversation with the creator of a framework that one of my applications depends on. During that conversation he mentioned as a sort of aside that it would make my life simpler if I just bundled his framework with my application and delivered to the end user a version that I knew was consisten...
When is it (not) appropriate to bundle dependencies with an application?
0.07486
0
0
1,453
598,299
2009-02-28T16:59:00.000
2
0
1
1
python,dependencies,distribution,packaging
603,778
8
false
0
0
For Linux, don't even think about bundling. You aren't smarter than the package manager or the packagers, and each distribution takes approach their own way - they won't be happy if you attempt to go your way. At best, they won't bother with packaging your app, which isn't great. Keep in mind that in Linux, dependencie...
7
14
0
Summary I recently had a conversation with the creator of a framework that one of my applications depends on. During that conversation he mentioned as a sort of aside that it would make my life simpler if I just bundled his framework with my application and delivered to the end user a version that I knew was consisten...
When is it (not) appropriate to bundle dependencies with an application?
0.049958
0
0
1,453
598,299
2009-02-28T16:59:00.000
1
0
1
1
python,dependencies,distribution,packaging
598,614
8
false
0
0
Beware reproducing the classic Windows DLL hell. By all means minimize the number of dependencies: ideally, just depend on your language and its framework, nothing else, if you can. After all, preserving hard disk space is hardly the objective any more, so users need not care about having multiple copies. Also, unless ...
7
14
0
Summary I recently had a conversation with the creator of a framework that one of my applications depends on. During that conversation he mentioned as a sort of aside that it would make my life simpler if I just bundled his framework with my application and delivered to the end user a version that I knew was consisten...
When is it (not) appropriate to bundle dependencies with an application?
0.024995
0
0
1,453
598,299
2009-02-28T16:59:00.000
1
0
1
1
python,dependencies,distribution,packaging
598,599
8
false
0
0
I always include all dependancies for my web applications. Not only does this make installation simpler, the application remains stable and working the way you expect it to even when other components on the system are upgraded.
7
14
0
Summary I recently had a conversation with the creator of a framework that one of my applications depends on. During that conversation he mentioned as a sort of aside that it would make my life simpler if I just bundled his framework with my application and delivered to the end user a version that I knew was consisten...
When is it (not) appropriate to bundle dependencies with an application?
0.024995
0
0
1,453
598,569
2009-02-28T19:55:00.000
0
0
1
1
python
598,571
3
false
0
0
Unless the said executable takes command line arguments which will specify which function to use, I don't think this is possible. With that being said, if you created the EXE, command line arguments are a good way to implement the functionality you're looking for.
2
4
0
I need to know a way to call a function defined in the exe from a python script. I know how to call entire exe from py file.
Calling function defined in exe
0
0
0
2,356
598,569
2009-02-28T19:55:00.000
1
0
1
1
python
598,585
3
false
0
0
Not sure if it is for windows. But you can treat an exe like a dll (if functions are exported). And they can be used by other programs.
2
4
0
I need to know a way to call a function defined in the exe from a python script. I know how to call entire exe from py file.
Calling function defined in exe
0.066568
0
0
2,356
598,577
2009-02-28T20:00:00.000
5
0
0
0
python,django,administration
599,054
2
false
1
0
Generally, you shouldn't use the admin for access by people you don't really trust. Even though there's plenty of flexibility in terms of locking things down and controlling access (much more so since Django 1.0), the admin is still designed on the assumption that the people using it are trusted members of your staff.
2
4
0
I've been applying Django's automatic administration capabilities to some applications who had previously been very difficult to administer. I'm thinking of a lot of ways to apply it to other applications we use (including using it to replace some internal apps altogether). Before I go overboard though, is there anyt...
What SHOULDN'T Django's admin interface be used for?
0.462117
0
0
352
598,577
2009-02-28T20:00:00.000
7
0
0
0
python,django,administration
598,580
2
true
1
0
User-specific privileges. I myself had been trying to work it into that-- some of the new (and at least at the time, undocumented) features (from newforms-admin) make it actually possible. Depending on how fine you want the control to be, though, you can end up getting very, very deep into the Django/admin internals. J...
2
4
0
I've been applying Django's automatic administration capabilities to some applications who had previously been very difficult to administer. I'm thinking of a lot of ways to apply it to other applications we use (including using it to replace some internal apps altogether). Before I go overboard though, is there anyt...
What SHOULDN'T Django's admin interface be used for?
1.2
0
0
352
598,668
2009-02-28T20:54:00.000
0
0
1
0
python,python-module,python-import
15,196,925
6
false
0
0
If you want to store your RSS file in a different place use sys.append("") and pout the module in that directory and use import or from import *
1
6
0
I'm just beginning Python, and I'd like to use an external RSS class. Where do I put that class and how do I import it? I'd like to eventually be able to share python programs.
External classes in Python
0
0
0
26,764
598,931
2009-03-01T00:03:00.000
5
0
1
0
python,c
598,945
5
false
0
0
Without taking pages and pages to go into the details, think of a C struct as a way to organize data, while a Python (or C++ or Objective-C) "class" is a way to organize not only your data, but the operations for that data. A Python "class," for example, can inherit from other objects, to give you an interator for the ...
3
2
0
I'm new to python. I've studied C and I noticed that that the C structure (struct) seemed to have the same task as "class" in python. So what is, conceptually, the difference?
Difference between class (Python) and struct (C)
0.197375
0
0
8,064
598,931
2009-03-01T00:03:00.000
24
0
1
0
python,c
598,955
5
false
0
0
Structs encapsulate data. Classes encapsulate behavior and data.
3
2
0
I'm new to python. I've studied C and I noticed that that the C structure (struct) seemed to have the same task as "class" in python. So what is, conceptually, the difference?
Difference between class (Python) and struct (C)
1
0
0
8,064
598,931
2009-03-01T00:03:00.000
3
0
1
0
python,c
598,941
5
false
0
0
Classes typically have methods (which are mostly just functions) associated with them, whereas C structs don't. You'll probably want to learn about what object-oriented programming is, if you want to make effective use of classes in Python (or any other object-oriented language, like Java or C++). Of course, it is poss...
3
2
0
I'm new to python. I've studied C and I noticed that that the C structure (struct) seemed to have the same task as "class" in python. So what is, conceptually, the difference?
Difference between class (Python) and struct (C)
0.119427
0
0
8,064
599,205
2009-03-01T03:40:00.000
0
0
0
1
python,google-app-engine,setuptools,pkg-resources
2,164,138
3
true
0
0
Create a setup.py for the package just as you would normally, and then use "setup.py sdist --formats=zip" to build your source zip. The built source zip will include an .egg-info metadata directory, which will then be findable by pkg_resources. Alternately, you can use bdist_egg for all your packages.
2
1
0
I'm trying to get a package installed on Google App Engine. The package relies rather extensively on pkg_resources, but there's no way to run setup.py on App Engine. There's no platform-specific code in the source, however, so it's no problem to just zip up the source and include those in the system path. And I've go...
How can I manually register distributions with pkg_resources?
1.2
0
0
724
599,205
2009-03-01T03:40:00.000
0
0
0
1
python,google-app-engine,setuptools,pkg-resources
744,882
3
false
0
0
On your local development system, run python setup.py bdist_egg, which will create a Zip archive with the necessary metadata included. Add it to your sys.path, and it should work properly.
2
1
0
I'm trying to get a package installed on Google App Engine. The package relies rather extensively on pkg_resources, but there's no way to run setup.py on App Engine. There's no platform-specific code in the source, however, so it's no problem to just zip up the source and include those in the system path. And I've go...
How can I manually register distributions with pkg_resources?
0
0
0
724
600,190
2009-03-01T18:00:00.000
1
0
1
0
python,oop,module
600,325
7
false
0
0
Why not go with an instance of that class? That way you might even be able later on to have 2 different "sessions" running, depending on what instance you use. It might make it more flexible. Maybe add some method get_appstate() to the module so it instanciates the class once. Later on if you might want several instanc...
4
23
0
In my application I have to maintain some global application state and global application wide methods like currently connected users, total number of answers, create an application config file etc. There are two options: Make a separate appstate.py file with global variables with functions over them. It looks fine in...
choosing between Modules and Classes
0.028564
0
0
11,569
600,190
2009-03-01T18:00:00.000
0
0
1
0
python,oop,module
600,206
7
false
0
0
I'd definitely go for the second option : having already used the first one, I'm now forced to refactor, as my application evolved and have to support more modular constructs, so I now need to handle multiple simulataneous 'configurations'. The second approach is, IMO, more flexible and future proof. To avoid the longe...
4
23
0
In my application I have to maintain some global application state and global application wide methods like currently connected users, total number of answers, create an application config file etc. There are two options: Make a separate appstate.py file with global variables with functions over them. It looks fine in...
choosing between Modules and Classes
0
0
0
11,569
600,190
2009-03-01T18:00:00.000
6
0
1
0
python,oop,module
600,219
7
false
0
0
The second approach is only significantly different from the first approach if you have application state stored in an instance of AppState, in which case your complaint doesn't apply. If you're just storing stuff in a class and using static/class methods, your class is no different than a module, and it would be pytho...
4
23
0
In my application I have to maintain some global application state and global application wide methods like currently connected users, total number of answers, create an application config file etc. There are two options: Make a separate appstate.py file with global variables with functions over them. It looks fine in...
choosing between Modules and Classes
1
0
0
11,569
600,190
2009-03-01T18:00:00.000
28
0
1
0
python,oop,module
600,201
7
false
0
0
Sounds like the classic conundrum :-). In Python, there's nothing dirty or shameful about choosing to use a module if that's the best approach. After all, modules, functions, and the like are, in fact, first-class citizens in the language, and offer introspection and properties that many other programming languages off...
4
23
0
In my application I have to maintain some global application state and global application wide methods like currently connected users, total number of answers, create an application config file etc. There are two options: Make a separate appstate.py file with global variables with functions over them. It looks fine in...
choosing between Modules and Classes
1
0
0
11,569
600,225
2009-03-01T18:22:00.000
2
0
0
0
python,google-app-engine,e-commerce,satchmo
833,823
3
false
1
0
Nothing is impossible - this will just require lots of effort - if there will be somebody wishing to do so - why not? But it might be easier (cheaper) to get Django friendly hosting instead of spending hours on hacking the code.
1
4
0
I understand that there are big differences in data-store, but surely since django is bundled and it abstracts data-store away from Satchmo, something can be done? Truth is that I am not a Python guy, been mostly Java/PHP thus far, but I am willing to learn. Plus, if this is not possible today, lets band together and f...
How to make Satchmo work in Google App Engine
0.132549
0
0
1,984
600,401
2009-03-01T20:04:00.000
6
0
1
0
python,ide,debugging
600,436
4
false
0
0
Forgive me for the shameless functional programming plug, but... The ability to step backwards.
2
2
0
Please tell me which features you wish your current Python debugger had. I'm creating a new Python IDE/debugger and am looking forward to challenging requests!
What features would a *perfect* Python debugger have?
1
0
0
529
600,401
2009-03-01T20:04:00.000
2
0
1
0
python,ide,debugging
600,434
4
false
0
0
The #1 debug feature for me (that my current IDE, Wing, does happen to have) is the ability to drop into a python interpreter and run arbitrary python code when at a breakpoint. Reminds me of using Smalltalk back in the day. Ability to execute code in local scope is incredibly useful, especially in contrast to working...
2
2
0
Please tell me which features you wish your current Python debugger had. I'm creating a new Python IDE/debugger and am looking forward to challenging requests!
What features would a *perfect* Python debugger have?
0.099668
0
0
529
601,039
2009-03-02T01:54:00.000
5
1
1
0
python,vim
601,053
12
false
0
0
Command combination seems to work through the | character, so perhaps something like aliasing :w|!your-command-here to a distinct key combination.
1
52
0
I do a lot of Python quick simulation stuff and I'm constantly saving (:w) and then running (:!!). Is there a way to combine these actions? Maybe a "save and run" command.
Save and run at the same time in Vim
0.083141
0
0
19,544
601,236
2009-03-02T04:04:00.000
3
0
1
1
python,macos
618,078
11
false
0
0
How about EPD from Enthought? Yes, it's large but it is a framework build and includes things like wxPython, vtk, numpy, scipy, and ipython built-in.
4
8
0
I bought a low-end MacBook about a month ago and am finally getting around to configuring it for Python. I've done most of my Python work in Windows up until now, and am finding the choices for OS X a little daunting. It looks like there are at least five options to use for Python development: "Stock" Apple Python Mac...
Recommendations for Python development on a Mac?
0.054491
0
0
6,687
601,236
2009-03-02T04:04:00.000
0
0
1
1
python,macos
601,287
11
false
0
0
I recommend python (any python?) plus the ipython shell. My most recent experience with MacPython was MacPython 2.5, and I found IDLE frustrating to use as an editor. It's not very featureful, and its' very slow to scroll large quantities of output.
4
8
0
I bought a low-end MacBook about a month ago and am finally getting around to configuring it for Python. I've done most of my Python work in Windows up until now, and am finding the choices for OS X a little daunting. It looks like there are at least five options to use for Python development: "Stock" Apple Python Mac...
Recommendations for Python development on a Mac?
0
0
0
6,687
601,236
2009-03-02T04:04:00.000
2
0
1
1
python,macos
601,250
11
false
0
0
I recommend using Python Virtual environments, especially if you use a Timecapsule because Timecapsule will back everything up, except modules you added to Python!
4
8
0
I bought a low-end MacBook about a month ago and am finally getting around to configuring it for Python. I've done most of my Python work in Windows up until now, and am finding the choices for OS X a little daunting. It looks like there are at least five options to use for Python development: "Stock" Apple Python Mac...
Recommendations for Python development on a Mac?
0.036348
0
0
6,687
601,236
2009-03-02T04:04:00.000
9
0
1
1
python,macos
601,252
11
false
0
0
One advantage I see in using the "stock" Python that's included with Mac OS X is that it makes deployment to other Macs a piece of cake. I don't know what your deployment scenario is, but for me this is important. My code has to run on any number of Macs at work, and I try to minimize the amount of work it takes to run...
4
8
0
I bought a low-end MacBook about a month ago and am finally getting around to configuring it for Python. I've done most of my Python work in Windows up until now, and am finding the choices for OS X a little daunting. It looks like there are at least five options to use for Python development: "Stock" Apple Python Mac...
Recommendations for Python development on a Mac?
1
0
0
6,687
601,442
2009-03-02T06:34:00.000
1
0
0
0
python,django,mapping,geodjango
614,489
4
false
1
0
How often will the floor plan change? From your description a simple image with a imagemap would suffice.
2
7
0
I want to create a floor plan map of an interior space that has clickable regions. My first thought was to investigate GeoDjango since its the mapping app for Django. But considering the dependencies, the learning curve and overall complexity, I'm concerned that I may be trying to swat a fly with a bazooka. Should I ...
Should I use GeoDjango for mapping a floor plan?
0.049958
0
0
3,422
601,442
2009-03-02T06:34:00.000
5
0
0
0
python,django,mapping,geodjango
613,955
4
true
1
0
I'd say that using GeoDjango for this purpose is definitely overkill. It could be implemented simply with an image map, or Canvas/SVG or Flash for extra pretty-points :)
2
7
0
I want to create a floor plan map of an interior space that has clickable regions. My first thought was to investigate GeoDjango since its the mapping app for Django. But considering the dependencies, the learning curve and overall complexity, I'm concerned that I may be trying to swat a fly with a bazooka. Should I ...
Should I use GeoDjango for mapping a floor plan?
1.2
0
0
3,422
602,030
2009-03-02T11:46:00.000
0
0
1
0
python,django
603,637
4
false
1
0
You'd either have to use a cache, or fetch the most recent change on each request (since you can't persist objects between requests in-memory). From what you describe, it sounds as if it's being hit fairly frequently, so the cache is probably the way to go.
1
0
0
I am working on ajax-game. The abstract: 2+ gamers(browsers) change a variable which is saved to DB through json. All gamers are synchronized by javascript-timer+json - periodically reading that variable from DB. In general, all changes are stored in DB as history, but I want the recent change duplicated in memory. S...
Store last created model's row in memory
0
1
0
127
602,046
2009-03-02T11:55:00.000
13
0
1
0
python,typechecking
602,078
7
true
0
0
The simple answer is No, use Polymorphism, Exceptions etc. In the case of constructor arguments being of the wrong type, an exception will be thrown when executing code that depend s on the parameter being of a particular type. If it is a weird, domain specific thing, raise your own Exception. Surround blocks of code...
1
15
0
Python discourages checking the types. But in many cases this may be useful: Checking constructor arguments. e.g. checking foe Boolean, string, dict etc. If I don't and set the object's members to the arguments it will cause problems later. Checking functions arguments. In properties. If someone sets a wrong value or ...
Should I check the types of constructor arguments (and at other places too)?
1.2
0
0
12,261
602,322
2009-03-02T13:17:00.000
1
0
0
0
jquery,python,html,dhtml
602,381
3
false
1
0
Without thinking of deltas: You can use JSON quite easily to do this sort of thing. You can roll out your own compressed format, too. I think compressing the data using gzip would help a lot. Most browsers nowadays support it, and it will greatly reduce the size of your responses.
1
2
0
I have a game that's based on a 25x20 HTML table (the game board). Every 3 seconds the user can "move," which sends an AJAX request to the server, at which time the server rerenders the entire HTML table and sends it to the user. This was easy to write, but it wastes a lot of bandwidth. Are there any libraries, client ...
Differential AJAX updates for HTML table?
0.066568
0
0
981
602,599
2009-03-02T14:51:00.000
2
0
1
0
python,debugging,pdb
602,733
2
false
0
0
';;' allow to separate commands [crchemist@test tmp]$ python t.py > /home/crchemist/tmp/t.py(7)() -> a() (Pdb) p a ;; l function a at 0xb7e96df4 2 b = 49 + 45 3 v = 'fff' 4 return v 5 6 import pdb; pdb.set_trace() 7 -> a() [EOF] (Pdb) s ;; l --Call-- > /home/crchemist/tmp/t.py...
1
5
0
I would like to have the output of the python pdb 'l' command printed to the screen after every command I enter in an interactive debugging session. Is there a way to setup python pdb to do this?
How to show the output of 'l' in python pdb after every command entered
0.197375
0
0
1,455
603,856
2009-03-02T20:24:00.000
0
0
0
0
python,urllib2
603,916
8
false
0
0
see urllib2.py:do_request (line 1044 (1067)) and urllib2.py:do_open (line 1073) (line 293) self.addheaders = [('User-agent', client_version)] (only 'User-agent' added)
1
15
0
I have a Python web client that uses urllib2. It is easy enough to add HTTP headers to my outgoing requests. I just create a dictionary of the headers I want to add, and pass it to the Request initializer. However, other "standard" HTTP headers get added to the request as well as the custom ones I explicitly add. Whe...
How do you get default headers in a urllib2 Request?
0
0
1
14,482
605,629
2009-03-03T09:02:00.000
2
1
0
0
c++,python,observer-pattern,publish-subscribe
607,627
3
false
0
0
Perhaps you misunderstand what signals and slots are. With signals and slots you don't have to know who sends signals. Your "client" class just declares slots, and an outside manager can connect signals to them. I recommend you to check out Qt. It's an amazing cross-platform library with much more than just GUI support...
1
1
0
i'm looking for a C++ replacement of the Python PubSub Library in which i don't have to connect a signal with a slot or so, but instead can register for a special Kind of messages, without knowing the object which can send it.
Python's PubSub/observer Pattern for C++?
0.132549
0
0
1,723
606,516
2009-03-03T14:12:00.000
0
0
1
0
python,graph
10,728,193
8
false
0
0
I second zweiterlinde's suggestion to use python-graph. I've used it as the basis of a graph-based research project that I'm working on. The library is well written, stable, and has a good interface. The authors are also quick to respond to inquiries and reports.
1
386
0
I'm writing a python application that will make heavy use of a graph data structure. Nothing horribly complex, but I'm thinking some sort of graph/graph-algorithms library would help me out. I've googled around, but I don't find anything that particularly leaps out at me. Anyone have any good recommendations?
Python Graph Library
0
0
0
254,177
608,098
2009-03-03T20:45:00.000
0
0
0
0
python,qt,sqlite,pyqt4,pywin32
608,262
1
false
0
0
When dealing with databases and PyQt UIs, I'll use something similar to model-view-controller model to help organize and simplify the code. View module uses/holds any QObjects that are necessary for the UI contain simple functions/methods for updating your QTGui Object, as well as extracting input from GUI...
1
1
0
I am writing a Python (2.5) GUI Application that does the following: Imports from Access to an Sqlite database Saves ui form settings to an Sqlite database Currently I am using pywin32 to read Access, and pysqlite2/dbapi2 to read/write Sqlite. However, certain Qt objects don't automatically cast to Python or Sqlite ...
What will I lose or gain from switching database APIs? (from pywin32 and pysqlite to QSql)
0
1
0
241
608,316
2009-03-03T21:33:00.000
2
0
1
0
python,file-io,commit,buffering
609,465
4
false
0
0
As has already been stated use the .flush() method to force the write out of the buffer, but avoid using a lot of calls to flush as this can actually slow your writing down (if the application relies on fast writes) as you'll be forcing your filesystem to write changes that are smaller than it's buffer size which can b...
4
8
0
I have a file open for writing, and a process running for days -- something is written into the file in relatively random moments. My understanding is -- until I do file.close() -- there is a chance nothing is really saved to disk. Is that true? What if the system crashes when the main process is not finished yet? Is t...
is there COMMIT analog in python for writing into a file?
0.099668
0
0
3,963
608,316
2009-03-03T21:33:00.000
21
0
1
0
python,file-io,commit,buffering
608,322
4
true
0
0
You should be able to use file.flush() to do this.
4
8
0
I have a file open for writing, and a process running for days -- something is written into the file in relatively random moments. My understanding is -- until I do file.close() -- there is a chance nothing is really saved to disk. Is that true? What if the system crashes when the main process is not finished yet? Is t...
is there COMMIT analog in python for writing into a file?
1.2
0
0
3,963
608,316
2009-03-03T21:33:00.000
2
0
1
0
python,file-io,commit,buffering
608,518
4
false
0
0
To make sure that you're data is written to disk, use file.flush() followed by os.fsync(file.fileno()).
4
8
0
I have a file open for writing, and a process running for days -- something is written into the file in relatively random moments. My understanding is -- until I do file.close() -- there is a chance nothing is really saved to disk. Is that true? What if the system crashes when the main process is not finished yet? Is t...
is there COMMIT analog in python for writing into a file?
0.099668
0
0
3,963
608,316
2009-03-03T21:33:00.000
3
0
1
0
python,file-io,commit,buffering
608,373
4
false
0
0
If you don't want to kill the current process to add f.flush() (it sounds like it's been running for days already?), you should be OK. If you see the file you are writing to getting bigger, you will not lose that data... From Python docs: write(str) Write a string to the file. There is no return value. Due to bu...
4
8
0
I have a file open for writing, and a process running for days -- something is written into the file in relatively random moments. My understanding is -- until I do file.close() -- there is a chance nothing is really saved to disk. Is that true? What if the system crashes when the main process is not finished yet? Is t...
is there COMMIT analog in python for writing into a file?
0.148885
0
0
3,963
608,710
2009-03-03T23:41:00.000
0
0
0
0
python,cocoa,macos,idle-processing
608,833
2
false
0
0
You can use Quartz event taps and an NSTimer. Any time one of your event taps lights up, postpone the timer by setting its fire date. When the timer fires, the user is idle. I'm not sure whether Quartz event taps are exposed to Python, though. The drawing APIs are, but I'm not sure about event taps.
1
3
0
Developing a mac app, how can I tell whether the user is currently at their computer or not? Or how long ago they last pressed a key or moved the mouse?
Monitoring user idle time
0
0
0
895
609,190
2009-03-04T04:10:00.000
0
0
1
0
python,ide,editor,python-idle
612,104
5
false
0
0
You could use custom print function.
1
2
0
Sometimes I'll be working with, say, a list of thousands of items in IDLE, and accidently print it out to the shell. When this happens, it crashes or at least very significaly slows down IDLE. As you can imagine, this is extremely inconvenient. Is there a way to make it, rather than printing the entire thing, just give...
How can I stop IDLE from printing giant lists?
0
0
0
681
609,516
2009-03-04T07:08:00.000
0
0
0
0
python,sqlite,pysqlite
610,761
2
false
0
0
You probably have to cast it to the correct type. Try "SELECT * FROM tasks WHERE (display = CAST ('True' AS bool))".
1
1
0
Using pysqlite how can a user-defined-type be used as a value in a comparison, e. g: “... WHERE columnName > userType”? For example, I've defined a bool type with the requisite registration, converter, etc. Pysqlite/Sqlite responds as expected for INSERT and SELECT operations (bool 'True' stored as an integer 1 and ret...
pysqlite user types in select statement
0
1
0
671
610,128
2009-03-04T11:11:00.000
0
1
0
0
performance,ironpython
613,533
3
true
1
1
Turns out, after aspnet_wp goes to about 500mb, the garbage collector kicks in and cleans out the mess. The memory usage then drops to about 20mb and steadily starts increasing again during load testing. So there's no memory 'leak' as such.
2
2
0
I'm hosting IronPython in a c#-based WebService to be able to provide custom extension scripts. However, I'm finding that memory usage sharply increases when I do simple load testing by executing the webservice repeatedly in a loop. IronPython-1.1 implemented IDisposable on its objects so that you can dispose of them w...
IronPython memory usage
1.2
0
0
1,344
610,128
2009-03-04T11:11:00.000
1
1
0
0
performance,ironpython
611,623
3
false
1
1
You could try creating a new AppDomain every time you run one of your IronPython scripts. Although assebmlies cannot be unloaded from memory you can unload an AppDomain and this will allow you to get the injected assembly out of memory.
2
2
0
I'm hosting IronPython in a c#-based WebService to be able to provide custom extension scripts. However, I'm finding that memory usage sharply increases when I do simple load testing by executing the webservice repeatedly in a loop. IronPython-1.1 implemented IDisposable on its objects so that you can dispose of them w...
IronPython memory usage
0.066568
0
0
1,344
610,892
2009-03-04T14:48:00.000
7
0
0
0
python,graph,procedural-generation
611,124
2
true
0
0
First, you need some sense of Location. Your various objects occupy some amount of coordinate space. You have to decide how regular these various things are. In the trivial case, you can drop them into your coordinate space as simple rectangles (or rectangular solids) to make locations simpler to plan out. If the thi...
1
9
0
I'm developing a procedurally-generated game world in Python. The structure of the world will be similar to the MUD/MUSH paradigm of rooms and exits arranged as a directed graph (rooms are nodes, exits are edges). (Note that this is not necessarily an acyclic graph, though I'm willing to consider acyclic solutions.) T...
What is a good strategy for constructing a directed graph for a game map (in Python)?
1.2
0
0
1,142
611,691
2009-03-04T17:49:00.000
4
0
0
0
python,python-3.x,django,django-models,django-admin
611,725
5
true
1
0
If you are inheriting the model then it is probably not wise to attempt to hide or disable any existing fields. The best thing you could probably do is exactly what you suggested: override save() and handle your logic in there.
1
10
0
I want to inherit a model class from some 3rd party code. I won't be using some of the fields but want my client to be able to edit the model in Admin. Is the best bet to hide them from Admin or can I actually prevent them being created in the first place? Additionally - what can I do if one of the unwanted fields is r...
Django Model Inheritance. Hiding or removing fields
1.2
0
0
6,399
612,372
2009-03-04T20:51:00.000
6
0
0
0
python,django
612,955
14
false
1
0
No, but you can copy admin template and define app name there.
1
151
0
In the same way that you can give fields and models verbose names that appear in the Django admin, can you give an app a custom name?
Can you give a Django app a verbose name for use throughout the admin?
1
0
0
84,109
613,471
2009-03-05T03:18:00.000
3
0
0
0
python,ip-address,tcp
613,477
16
false
0
0
Your simplest way may be to ask some server on the outside of your network. One thing to keep in mind is that different destinations may see a different address for you. The router may be multihomed. And really that's just where problems begin.
3
28
0
I'm behind a router, I need a simple command to discover my public ip (instead of googling what's my ip and clicking one the results) Are there any standard protocols for this? I've heard about STUN but I don't know how can I use it? P.S. I'm planning on writing a short python script to do it
Discovering public IP programmatically
0.037482
0
1
19,213
613,471
2009-03-05T03:18:00.000
1
0
0
0
python,ip-address,tcp
60,525,518
16
false
0
0
Here are a few public services that support IPv4 and IPv6: curl http://icanhazip.com curl http://www.trackip.net/ip curl https://ipapi.co/ip curl http://api6.ipify.org curl http://www.cloudflare.com/cdn-cgi/trace curl http://checkip.dns.he.net The following seem to support only IPv4 at this time: curl http://bot.wha...
3
28
0
I'm behind a router, I need a simple command to discover my public ip (instead of googling what's my ip and clicking one the results) Are there any standard protocols for this? I've heard about STUN but I don't know how can I use it? P.S. I'm planning on writing a short python script to do it
Discovering public IP programmatically
0.012499
0
1
19,213
613,471
2009-03-05T03:18:00.000
3
0
0
0
python,ip-address,tcp
613,518
16
false
0
0
If the network has an UpNp server running on the gateway you are able to talk to the gateway and ask it for your outside IP address.
3
28
0
I'm behind a router, I need a simple command to discover my public ip (instead of googling what's my ip and clicking one the results) Are there any standard protocols for this? I've heard about STUN but I don't know how can I use it? P.S. I'm planning on writing a short python script to do it
Discovering public IP programmatically
0.037482
0
1
19,213
615,100
2009-03-05T14:52:00.000
0
1
1
0
c++,python
615,254
17
false
0
0
Try LISP instead (or afterwards, it's your call). You are at least partially right, though. using Python for a while makes you not want to go back to a statically typed and compiled language. It's just sooo much more comfortable not to have to please the compiler like ALL THE TIME ;). And yet another aspect is the read...
17
8
0
I`m currently studying C++ and want to learn another language. For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful. I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back t...
Should I learn Python after C++?
0
0
0
9,495
615,100
2009-03-05T14:52:00.000
2
1
1
0
c++,python
615,121
17
false
0
0
I don't think that "Python makes you lazy" (nice title, anyway!). On the contrary, in programming as in life, knowing more than one language is important; I think you'll find python amusing and sufficiently different from C++ or C# so that the languages will not get mixed in your head...
17
8
0
I`m currently studying C++ and want to learn another language. For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful. I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back t...
Should I learn Python after C++?
0.023525
0
0
9,495
615,100
2009-03-05T14:52:00.000
1
1
1
0
c++,python
615,129
17
false
0
0
Learning more languages can only make you a better developer, regardless of their approach. Besides, your experience with C++ (or, at least C) will come in handy for writing high-performance parts of your applications using Python's C API, which lets "raw" C and C++ code intermingle nicely with the pure Python stuff. I...
17
8
0
I`m currently studying C++ and want to learn another language. For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful. I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back t...
Should I learn Python after C++?
0.011764
0
0
9,495
615,100
2009-03-05T14:52:00.000
2
1
1
0
c++,python
615,163
17
false
0
0
Python is complementary to C++ and easy to integrate with C++. (As evidence of this claim, the C++ gurus from Boost use Python.) And as you said, Python gives you a way to get a perspective outside the Microsoft orbit. But even there, if you need to integrate Python with MS tools, there's IronPython.
17
8
0
I`m currently studying C++ and want to learn another language. For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful. I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back t...
Should I learn Python after C++?
0.023525
0
0
9,495
615,100
2009-03-05T14:52:00.000
0
1
1
0
c++,python
615,155
17
false
0
0
You could learn a new programming language, like python, and use it to do all the tasks you'd normally perform in your 'core' languages; or you could take a language (like python, or perl) and use it to complement your core language. You could learn VBScript and use it to write scripts that glue your code and others to...
17
8
0
I`m currently studying C++ and want to learn another language. For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful. I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back t...
Should I learn Python after C++?
0
0
0
9,495
615,100
2009-03-05T14:52:00.000
4
1
1
0
c++,python
615,152
17
false
0
0
Many would argue that you would benefit from learning Python before C++. The syntax hurdles are much, much lower; Debugging is much more friendly There are a plethora of libraries---batteries included, you know. It's easy to experiment with web scraping, XML, etc. in Python. Again, the barriers to entry in C++ ar...
17
8
0
I`m currently studying C++ and want to learn another language. For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful. I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back t...
Should I learn Python after C++?
0.047024
0
0
9,495
615,100
2009-03-05T14:52:00.000
1
1
1
0
c++,python
615,150
17
false
0
0
It is up to what exactly is the kind of applications you want to program, for example for Websites that need access to databases I would go for Ruby( and Ruby on Rails framework ) , for financial applications or applications that need a lot of parallel processing I would go for a funcional programming language like Has...
17
8
0
I`m currently studying C++ and want to learn another language. For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful. I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back t...
Should I learn Python after C++?
0.011764
0
0
9,495
615,100
2009-03-05T14:52:00.000
4
1
1
0
c++,python
615,148
17
false
0
0
Well, I've learnt Python after C/C++, Java and C#. Python is a great language, and its simplicity and consistency have improved the way I code. It has also helped me think more clearly about the algorithms underlying my code. I could go on about the benifits it brought me, instead I'll summarize the reason to learn it ...
17
8
0
I`m currently studying C++ and want to learn another language. For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful. I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back t...
Should I learn Python after C++?
0.047024
0
0
9,495
615,100
2009-03-05T14:52:00.000
0
1
1
0
c++,python
615,248
17
false
0
0
I learned, in order: BASIC Pascal Ada (A little bit of Haskell) Java Python C++ C# I don't feel Python inhibited my ability to learn or use C++. I am glad though that I learned pointers in Pascal before encountering reference types in Java, Python and C#, because I feel it gave me a good basis to understand the idea ...
17
8
0
I`m currently studying C++ and want to learn another language. For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful. I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back t...
Should I learn Python after C++?
0
0
0
9,495
615,100
2009-03-05T14:52:00.000
1
1
1
0
c++,python
618,870
17
false
0
0
I learned C/C++, Java, Python & C# in that order. The two I actually invariably end up using are C++ & Python; I find the niche Java & C# occupy between them to be too narrow to feel the need to use them much (at least for the stuff I do). I also think I didn't really "get" C++ functors and boost::bind until I'd been e...
17
8
0
I`m currently studying C++ and want to learn another language. For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful. I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back t...
Should I learn Python after C++?
0.011764
0
0
9,495
615,100
2009-03-05T14:52:00.000
1
1
1
0
c++,python
615,138
17
false
0
0
Flex your brain and improve your skill set. Give a functional language a whirl.
17
8
0
I`m currently studying C++ and want to learn another language. For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful. I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back t...
Should I learn Python after C++?
0.011764
0
0
9,495
615,100
2009-03-05T14:52:00.000
0
1
1
0
c++,python
617,254
17
false
0
0
It is true. After learning python, everything else will seem like too much effort for the same amount of real work being done. You'll get used to the clean, small syntax and the freedom of GC. You will enjoy working in list comps, generators, etc. You'll start to think in python and C++ and Java will be like buildin...
17
8
0
I`m currently studying C++ and want to learn another language. For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful. I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back t...
Should I learn Python after C++?
0
0
0
9,495
615,100
2009-03-05T14:52:00.000
0
1
1
0
c++,python
949,801
17
false
0
0
I think it is always good to know several programming languages. I've learned c++ at school and I've used it a lot in the past years because it is really a standard in the industry. I've learned python by my own and I am using it to make a lot of nice tools that would be too long to write in c++. Python has just a ver...
17
8
0
I`m currently studying C++ and want to learn another language. For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful. I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back t...
Should I learn Python after C++?
0
0
0
9,495
615,100
2009-03-05T14:52:00.000
30
1
1
0
c++,python
615,128
17
true
0
0
There's no right or wrong answer, really. But I think you'll benefit more from learning Python. Given the similarities between C# and C++, you'll learn a different way of thinking from Python. The more ways you learn to think about a problem, the better it makes you as a programmer, regardless of the language.
17
8
0
I`m currently studying C++ and want to learn another language. For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful. I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back t...
Should I learn Python after C++?
1.2
0
0
9,495
615,100
2009-03-05T14:52:00.000
9
1
1
0
c++,python
615,118
17
false
0
0
The benefit of going from a more static language to a dynamic language is to change your programming paradigm -- it's not a matter of becoming "lazy" so much as realizing new ways of accomplishing things, which will make you better in any language.
17
8
0
I`m currently studying C++ and want to learn another language. For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful. I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back t...
Should I learn Python after C++?
1
0
0
9,495
615,100
2009-03-05T14:52:00.000
1
1
1
0
c++,python
1,235,385
17
false
0
0
Many languages are quite similar to others, but to move between imperitave and functional / dynamic and static / Object and Procedural languages you do need to train yourself to think within the constraints of the language you are using. Since most projects are at least a few weeks, this is generally not a problem afte...
17
8
0
I`m currently studying C++ and want to learn another language. For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful. I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back t...
Should I learn Python after C++?
0.011764
0
0
9,495
615,100
2009-03-05T14:52:00.000
0
1
1
0
c++,python
615,218
17
false
0
0
From a utility perspective, it is good to learn one of the more dynamic languages like Python (or Ruby or Perl) too. Not only do they stretch your mind, but they are superior for certain kinds of tasks. If you want to manipulate text, for example, C++ is a lot harder to use than Python. It gives you another arrow in...
17
8
0
I`m currently studying C++ and want to learn another language. For work I use C# + ASP (just started learning it, actually), but I want something "less Microsoft" and powerful. I have heard Python is a popular and powerful language, not so complicated as C++. But many people mentioned it was hard for them to get back t...
Should I learn Python after C++?
0
0
0
9,495
615,632
2009-03-05T16:48:00.000
0
0
1
0
python
615,682
2
false
0
0
works fine for me. Could it be that you're not setting doraise to True somehow?
1
0
0
How do I detect an error when compiling a directory of python files using compile_dir? Currently I get something on stderr, but no way to detect it in my app. py_compile.compile() takes a 'doraise' argument, but nothing here. Or is there a better way to do this from a python script? Edit: I fixed it with os.walk and ca...
How to detect errors from compileall.compile_dir?
0
0
0
970
617,892
2009-03-06T06:55:00.000
2
1
0
0
python,python-2.5,poplib
628,130
4
false
0
0
You can also try imaplib module since GMail also provides access to email via IMAP protocol.
1
1
0
I want to get all the messages from my gmail inbox, but I am facing 2 problems. It does not get all the emails, (as per the count in stat function) The order of emails it get is random. I am unsure if its the problem with poplib or gmail pop server. What am I missing here?
Poplib not working correctly?
0.099668
0
1
1,096
619,384
2009-03-06T16:11:00.000
3
0
0
0
python,django,orm
620,117
3
true
1
0
Since the issue is "manually converting query results into objects," the simplest solution is often to see if your custom SQL can fit into an ORM .extra() call rather than being a pure-SQL query. Often it can, and then you let the ORM do all the work of building up objects as usual.
1
2
0
I often need to execute custom sql queries in django, and manually converting query results into objects every time is kinda painful. I wonder how fellow Slackers deal with this. Maybe someone had written some kind of a library to help dealing with custom SQL in Django?
Tools to ease executing raw SQL with Django ORM
1.2
1
0
3,263
619,437
2009-03-06T16:25:00.000
0
1
1
0
python,interpreter,pypy
619,480
4
false
0
1
cross-platform compatibility Yes
2
28
0
From what I have seen and read on blogs, PyPy is a very ambitious project. What are some advantages it will bring to the table over its siblings (CPython, Jython, and IronPython)? Is it speed, cross-platform compatibility (including mobile platforms), the ability to use c-extensions without the GIL, or is this more of ...
What does PyPy have to offer over CPython, Jython, and IronPython?
0
0
0
3,214
619,437
2009-03-06T16:25:00.000
38
1
1
0
python,interpreter,pypy
619,544
4
true
0
1
PyPy is really two projects: An interpreter compiler toolchain allowing you to write interpreters in RPython (a static subset of Python) and have cross-platform interpreters compiled standalone, for the JVM, for .NET (etc) An implementation of Python in RPython These two projects allow for many things. Maintaining P...
2
28
0
From what I have seen and read on blogs, PyPy is a very ambitious project. What are some advantages it will bring to the table over its siblings (CPython, Jython, and IronPython)? Is it speed, cross-platform compatibility (including mobile platforms), the ability to use c-extensions without the GIL, or is this more of ...
What does PyPy have to offer over CPython, Jython, and IronPython?
1.2
0
0
3,214
620,610
2009-03-06T22:07:00.000
-3
0
0
0
python,sql,sqlalchemy
620,784
2
false
0
0
You can use multiple transactions and manage it within scope.
1
53
0
When I have created a table with an auto-incrementing primary key, is there a way to obtain what the primary key would be (that is, do something like reserve the primary key) without actually committing? I would like to place two operations inside a transaction however one of the operations will depend on what primary ...
SQLAlchemy Obtain Primary Key With Autoincrement Before Commit
-0.291313
1
0
19,996
621,649
2009-03-07T10:36:00.000
2
0
1
0
python,encryption,key
621,653
5
false
0
0
Why not take first 21 chars from md5 or SHA1 hash?
1
7
0
I am using an api which takes a name of 21 char max to represent an internal session which has a lifetime of around "two days". I would like the name not to be meaningfull using some kind of hasing ? md5 generates 40 chars, is there something else i could use ? For now i use 'userid[:10]' + creation time: ddhhmmss + ra...
Python and random keys of 21 char max
0.07983
0
0
7,418
621,802
2009-03-07T12:51:00.000
5
0
0
1
python,django,comet,daemon
622,509
6
true
1
0
I would recommend looking into Twisted, their twisted.web server, and the comet work done on top of it at Divmod. They can handle far more concurrent connections than traditional thread or process based servers, which is exactly what you need for something like this. And, yes, I've architected systems using Twisted for...
1
13
0
I want to push data to the browser over HTTP without killing my django/python application. I decided to use a comet server, to proxy requests between my application and the client (though I still haven't really figured it out properly). I've looked into the following engines: orbited cometd ejabberd jetty Has anyone ha...
Choosing and deploying a comet server
1.2
0
0
7,360
623,054
2009-03-08T04:44:00.000
13
0
1
0
python,multithreading
623,070
7
true
1
0
You will probably find your application is bandwidth limited not CPU or I/O limited. As such, add as many as you like until performance begins to degrade. You may come up against other limits depending on your network setup. Like if you're behind an ADSL router, there will be a limit on the number of concurrent NAT se...
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?
1.2
0
0
2,509