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
645,943
2009-03-14T13:53:00.000
1
0
1
0
python,mysql,windows
5,294,670
16
false
0
0
Because I am running python in a (pylons/pyramid) virtualenv, I could not run the binary installers (helpfully) linked to previously. I had problems following the steps with Willie's answer, but I determined that the problem is (probably) that I am running windows 7 x64 install, which puts the registry key for mysql in a slightly different location, specifically in my case (note: I am running version 5.5) in: "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MySQL AB\MySQL Server 5.5". HOWEVER, "HKEY_LOCAL_MACHINE\" cannot be included in the path or it will fail. Also, I had to do a restart between steps 3 and 4. After working through all of this, IMO it would have been smarter to run the entire python dev environment from cygwin.
1
102
0
I am finding it difficult to use MySQL with Python in my windows system. I am currently using Python 2.6. I have tried to compile MySQL-python-1.2.3b1 (which is supposed to work for Python 2.6 ?) source code using the provided setup scripts. The setup script runs and it doesn't report any error but it doesn't generate _mysql module. I have also tried setting up MySQL for Python 2.5 with out success. The problem with using 2.5 is that Python 2.5 is compiled with visual studio 2003 (I installed it using the provided binaries). I have visual studio 2005 on my windows system. Hence setuptools fails to generate _mysql module. Any help ?
Integrating MySQL with Python in Windows
0.012499
1
0
110,355
646,515
2009-03-14T19:07:00.000
0
0
1
0
python,package,search,pypi
13,274,944
4
true
0
0
its unfortunate, but due to the lack of xmlrpc on other indexes i need to keep my solution
2
4
0
Currently I'm using a very ugly approach based on a regex for finding links and taking them apart. I'm unhappy with the code, so I'm asking for nicer solutions, preferably using only the stdlib. Edit The task at hand has 2 parts: Find all distributions that match a certain criteria (like prefix of the name). Find all versions available in each found distribution. The expected result is a mapping of distribution -> versions -> files.
What is an elegant way to find versions of packages on a pypi package index?
1.2
0
0
827
646,515
2009-03-14T19:07:00.000
-1
0
1
0
python,package,search,pypi
646,524
4
false
0
0
In a buildout which access pypi i pin versions like this: Products.PloneFormGen==1.2.5 Here it searches for version 1.2.5 an uses this.. Dont know if it is this what u looking for...
2
4
0
Currently I'm using a very ugly approach based on a regex for finding links and taking them apart. I'm unhappy with the code, so I'm asking for nicer solutions, preferably using only the stdlib. Edit The task at hand has 2 parts: Find all distributions that match a certain criteria (like prefix of the name). Find all versions available in each found distribution. The expected result is a mapping of distribution -> versions -> files.
What is an elegant way to find versions of packages on a pypi package index?
-0.049958
0
0
827
647,257
2009-03-15T03:46:00.000
2
1
0
0
python,django,satchmo
1,198,670
1
true
1
0
Checkout the tiered pricing module
1
1
0
I am new to Satchmo -- picked it up because I needed payment processing for site subscriptions and physical product. My site will have two classes of users: paid subscribers and free users. Both can order a physical product. Paid subscribers get an automatic discount on all orders. I don't see a configuration for this in the admin. (Discount looks like it would apply to all users. If I'm missing something here, let me know.) So what's the best place to automatically override the price depending on the user class? The displayed price should show up, say, 10% less for subscribers everywhere in the site, not just at the checkout. Thanks.
Provide discount to preferred customer with Satchmo?
1.2
0
0
312
649,623
2009-03-16T08:22:00.000
0
0
0
0
python,file,filesystems,checksum
649,665
3
false
0
0
A simple approach would be to monitor/check the last modification date of the working directory (using os.stat() for example). Whenever a file in a directory is modified, the working directory's (the directory the file is in) last modification date changes as well. At least this works on the filesystems I am working on (ufs, ext3). I'm not sure if all filesystems do it this way.
1
3
0
So I'm in the middle of web-based filesystem abstraction layer development. Just like file browser, except it has some extra features like freaky permissions etc. I would like users to be notified somehow about directory changes. So, i.e. when someone uploads a new file via FTP, certain users should get a proper message. It is not required for the message to be extra detailed, I don't really need to show the exact resource changed. The parent directory name should be enough. What approach would you recommend?
Directory checksum with python?
0
0
1
2,053
651,048
2009-03-16T16:00:00.000
1
1
1
0
c++,python,c,multithreading
733,143
4
false
0
0
Check out Cython, it has similar syntax to Python but with a few constructs like "cdef", fast numpy access functions, and a "with nogil" statement (which does what it says).
1
28
0
One of Python's strongest points is the ease of writing C and C++ extensions to speed up processor intensive parts of the code. Can these extensions avoid the Global Interpreter Lock or are they also restricted by the GIL? If not, then this "ease of extension" is even more of a killer feature than I previously realized. I suspect the answer is not a simple yes-or-no but I am not sure, so I am asking the question here on StackOverflow.
Concurrency: Are Python extensions written in C/C++ affected by the Global Interpreter Lock?
0.049958
0
0
7,350
651,717
2009-03-16T19:00:00.000
1
0
1
1
python,macos
651,764
10
false
0
0
I've updated my macbook running leopard to python 2.6 and haven't had any problems with psycopg2. For that matter, I haven't had any compatibility issues anywhere with 2.6, but obviously switching to python3k isn't exactly recommended if you're concerned about backwards compatibility.
6
2
0
After going through hell trying to install the latest version of postgresql and psycopg2 today I'm going for a complete reinstall of Leopard. I've been sticking with macpython 2.5 for the past year but now I'm considering macports even 2.6 For me it's most important for Twisted, PIL and psycopg2 to be working without a problem. Can anyone give some guidelines for what version I should choose, based on experience? Edit: Ok I've decided to go without reinstalling the os. Hacked around to clean up the bad PostgresPlus installation and installed another one. The official python 2.6.1 package works great, no problem installing it alongside 2.5.2. Psycopg2 works. But as expected PIL wont compile. I guess I'll be switching between the 2.5 from macports and the official 2.6 for different tasks, since I know the macports python has it's issues with some packages. Another Edit: I've now compiled PIL. Had to hide the whole macports directory and half the xcode libraries, so it would find the right ones. It wouldn't accept the paths I was feeding it. PIL is notorious for this on leopard.
Which version of python is currently best for os x?
0.019997
0
0
856
651,717
2009-03-16T19:00:00.000
0
0
1
1
python,macos
1,115,314
10
false
0
0
If your using Macports, I recommend downloading the python_select package, which facilitates easy switching between different versions including the built in apple versions. Makes life a lot easier.
6
2
0
After going through hell trying to install the latest version of postgresql and psycopg2 today I'm going for a complete reinstall of Leopard. I've been sticking with macpython 2.5 for the past year but now I'm considering macports even 2.6 For me it's most important for Twisted, PIL and psycopg2 to be working without a problem. Can anyone give some guidelines for what version I should choose, based on experience? Edit: Ok I've decided to go without reinstalling the os. Hacked around to clean up the bad PostgresPlus installation and installed another one. The official python 2.6.1 package works great, no problem installing it alongside 2.5.2. Psycopg2 works. But as expected PIL wont compile. I guess I'll be switching between the 2.5 from macports and the official 2.6 for different tasks, since I know the macports python has it's issues with some packages. Another Edit: I've now compiled PIL. Had to hide the whole macports directory and half the xcode libraries, so it would find the right ones. It wouldn't accept the paths I was feeding it. PIL is notorious for this on leopard.
Which version of python is currently best for os x?
0
0
0
856
651,717
2009-03-16T19:00:00.000
4
0
1
1
python,macos
651,768
10
false
0
0
You can install them side-by-side. If you've encounter problems just set python 2.5 as the standard python and use e.g. python26 for a newer version.
6
2
0
After going through hell trying to install the latest version of postgresql and psycopg2 today I'm going for a complete reinstall of Leopard. I've been sticking with macpython 2.5 for the past year but now I'm considering macports even 2.6 For me it's most important for Twisted, PIL and psycopg2 to be working without a problem. Can anyone give some guidelines for what version I should choose, based on experience? Edit: Ok I've decided to go without reinstalling the os. Hacked around to clean up the bad PostgresPlus installation and installed another one. The official python 2.6.1 package works great, no problem installing it alongside 2.5.2. Psycopg2 works. But as expected PIL wont compile. I guess I'll be switching between the 2.5 from macports and the official 2.6 for different tasks, since I know the macports python has it's issues with some packages. Another Edit: I've now compiled PIL. Had to hide the whole macports directory and half the xcode libraries, so it would find the right ones. It wouldn't accept the paths I was feeding it. PIL is notorious for this on leopard.
Which version of python is currently best for os x?
0.07983
0
0
856
651,717
2009-03-16T19:00:00.000
0
0
1
1
python,macos
652,455
10
false
0
0
I am using Python 2.5.1. It's working great for me for general scripting and some CherryPy web projects.
6
2
0
After going through hell trying to install the latest version of postgresql and psycopg2 today I'm going for a complete reinstall of Leopard. I've been sticking with macpython 2.5 for the past year but now I'm considering macports even 2.6 For me it's most important for Twisted, PIL and psycopg2 to be working without a problem. Can anyone give some guidelines for what version I should choose, based on experience? Edit: Ok I've decided to go without reinstalling the os. Hacked around to clean up the bad PostgresPlus installation and installed another one. The official python 2.6.1 package works great, no problem installing it alongside 2.5.2. Psycopg2 works. But as expected PIL wont compile. I guess I'll be switching between the 2.5 from macports and the official 2.6 for different tasks, since I know the macports python has it's issues with some packages. Another Edit: I've now compiled PIL. Had to hide the whole macports directory and half the xcode libraries, so it would find the right ones. It wouldn't accept the paths I was feeding it. PIL is notorious for this on leopard.
Which version of python is currently best for os x?
0
0
0
856
651,717
2009-03-16T19:00:00.000
1
0
1
1
python,macos
651,988
10
false
0
0
I use both Twisted and Psycopg2 extensively on OSX, and both work fine with Python 2.6. Neither has been ported to Python 3.0, as far as I know. Several of Python 3.0's features have been back-ported to 2.6, so you gain quite a bit by moving from 2.5 to 2.6. But I wouldn't switch to 3.0 until all of your thirdparty libraries support it; and this may not happen for some time.
6
2
0
After going through hell trying to install the latest version of postgresql and psycopg2 today I'm going for a complete reinstall of Leopard. I've been sticking with macpython 2.5 for the past year but now I'm considering macports even 2.6 For me it's most important for Twisted, PIL and psycopg2 to be working without a problem. Can anyone give some guidelines for what version I should choose, based on experience? Edit: Ok I've decided to go without reinstalling the os. Hacked around to clean up the bad PostgresPlus installation and installed another one. The official python 2.6.1 package works great, no problem installing it alongside 2.5.2. Psycopg2 works. But as expected PIL wont compile. I guess I'll be switching between the 2.5 from macports and the official 2.6 for different tasks, since I know the macports python has it's issues with some packages. Another Edit: I've now compiled PIL. Had to hide the whole macports directory and half the xcode libraries, so it would find the right ones. It wouldn't accept the paths I was feeding it. PIL is notorious for this on leopard.
Which version of python is currently best for os x?
0.019997
0
0
856
651,717
2009-03-16T19:00:00.000
1
0
1
1
python,macos
651,835
10
false
0
0
I would stick with the MacPython version 2.5.x (I believe 2.5.4 currently). Here's my rationale: Snow Leopard may still be on the 2.5 series, so you might as well be consistent with the future OS (i.e. no point in going too far ahead). For most production apps, nobody is going to want to use 2.6 for another year. No frameworks/programs are going to leave 2.5 behind for at least 2 years. In other words, my approach is that the only reason to do 2.6 is for fun. If you're looking to have fun, just go for 3.0.
6
2
0
After going through hell trying to install the latest version of postgresql and psycopg2 today I'm going for a complete reinstall of Leopard. I've been sticking with macpython 2.5 for the past year but now I'm considering macports even 2.6 For me it's most important for Twisted, PIL and psycopg2 to be working without a problem. Can anyone give some guidelines for what version I should choose, based on experience? Edit: Ok I've decided to go without reinstalling the os. Hacked around to clean up the bad PostgresPlus installation and installed another one. The official python 2.6.1 package works great, no problem installing it alongside 2.5.2. Psycopg2 works. But as expected PIL wont compile. I guess I'll be switching between the 2.5 from macports and the official 2.6 for different tasks, since I know the macports python has it's issues with some packages. Another Edit: I've now compiled PIL. Had to hide the whole macports directory and half the xcode libraries, so it would find the right ones. It wouldn't accept the paths I was feeding it. PIL is notorious for this on leopard.
Which version of python is currently best for os x?
0.019997
0
0
856
652,283
2009-03-16T21:53:00.000
3
0
0
0
python,artificial-intelligence,neural-network,minimization
13,611,588
8
false
0
0
Back-propagation works by minimizing the error. However, you can really minimize whatever you want. So, you could use back-prop-like update rules to find the Artificial Neural Network inputs that minimize the output. This is a big question, sorry for the short answer. I should also add that my suggested approach sounds pretty inefficient compared to more established methods and would only find a local minima.
4
10
1
I had been interested in neural networks for a bit and thought about using one in python for a light project that compares various minimization techniques in a time domain (which is fastest). Then I realized I didn't even know if a NN is good for minimization. What do you think?
Can a neural network be used to find a functions minimum(a)?
0.07486
0
0
7,231
652,283
2009-03-16T21:53:00.000
0
0
0
0
python,artificial-intelligence,neural-network,minimization
652,348
8
false
0
0
They're pretty bad for the purpose; one of the big problems of neural networks is that they get stuck in local minima. You might want to look into support vector machines instead.
4
10
1
I had been interested in neural networks for a bit and thought about using one in python for a light project that compares various minimization techniques in a time domain (which is fastest). Then I realized I didn't even know if a NN is good for minimization. What do you think?
Can a neural network be used to find a functions minimum(a)?
0
0
0
7,231
652,283
2009-03-16T21:53:00.000
1
0
0
0
python,artificial-intelligence,neural-network,minimization
652,327
8
false
0
0
The training process of a back-propagation neural network works by minimizing the error from the optimal result. But having a trained neural network finding the minimum of an unknown function would be pretty hard. If you restrict the problem to a specific function class, it could work, and be pretty quick too. Neural networks are good at finding patterns, if there are any.
4
10
1
I had been interested in neural networks for a bit and thought about using one in python for a light project that compares various minimization techniques in a time domain (which is fastest). Then I realized I didn't even know if a NN is good for minimization. What do you think?
Can a neural network be used to find a functions minimum(a)?
0.024995
0
0
7,231
652,283
2009-03-16T21:53:00.000
-5
0
0
0
python,artificial-intelligence,neural-network,minimization
652,362
8
true
0
0
Neural networks are classifiers. They separate two classes of data elements. They learn this separation (usually) by preclassified data elements. Thus, I say: No, unless you do a major stretch beyond breakage.
4
10
1
I had been interested in neural networks for a bit and thought about using one in python for a light project that compares various minimization techniques in a time domain (which is fastest). Then I realized I didn't even know if a NN is good for minimization. What do you think?
Can a neural network be used to find a functions minimum(a)?
1.2
0
0
7,231
652,750
2009-03-17T01:33:00.000
6
0
0
0
python,django
652,758
2
true
1
0
Your database is locked because you have a transaction running somewhere. Stop all your Django apps. If necessary, reboot. It's also remotely possible that you crashed a SQLite client in the middle of a transaction and the file lock was left in place.
1
1
0
OMG! What an apparent problem... my django based scripts have locked my sqlite db... Does anyone know how to fix?
How to unlock an sqlite3 db?
1.2
1
0
4,579
653,419
2009-03-17T08:45:00.000
-6
0
1
0
python,multithreading,profiling
653,484
7
false
0
0
I don't know any profiling-application that supports such thing for python - but You could write a Trace-class that writes log-files where you put in the information of when an operation is started and when it ended and how much time it consumed. It's a simple and quick solution for your problem.
2
72
0
I'm developing an inherently multithreaded module in Python, and I'd like to find out where it's spending its time. cProfile only seems to profile the main thread. Is there any way of profiling all threads involved in the calculation?
How can I profile a multithread program in Python?
-1
0
0
28,184
653,419
2009-03-17T08:45:00.000
19
0
1
0
python,multithreading,profiling
653,497
7
false
0
0
Instead of running one cProfile, you could run separate cProfile instance in each thread, then combine the stats. Stats.add() does this automatically.
2
72
0
I'm developing an inherently multithreaded module in Python, and I'd like to find out where it's spending its time. cProfile only seems to profile the main thread. Is there any way of profiling all threads involved in the calculation?
How can I profile a multithread program in Python?
1
0
0
28,184
654,738
2009-03-17T15:26:00.000
0
0
1
0
python,process,ps
10,543,890
4
false
0
0
If you're not interested in a module, you might also have a look at the /proc filesystem, procfs.
1
6
0
Is there any way python is natively, or through some code available online (preferably under the GPL), capable of doing process management. The goal is similar to the functionality of ps, but preferably in arrays, lists, and/or dicts.
Python process management
0
0
0
3,352
655,530
2009-03-17T18:33:00.000
6
0
1
0
python,windows,vim,ipython
6,022,505
4
false
0
0
edit file - C:\Users\[your username]\_ipython\ipythonrc.ini replace line: editor 0 to editor gvim –f (or editor [whatever editor you_want to use and system recognize it]) save file You may have problem that your Win doesn't recognize gvim as a command, you can fix it like this: Control Panel -> System -> Advances system settings (System properties - Advanced tab) -> Enviroment Variables In system variables edit Path and add this: ;C:\Program Files\Vim\vim73\ or path that leads to your gvim.exe
1
8
0
This really looks like something I should be able to find on Google, but for some reason I can't make heads or tails of it. There's the EDITOR environment variable, the ipy_user_conf.py file, the ipythonrc file, some weird thing about running gvim in server mode and a bunch of other stuff I can't wrap my head around (probably because of lack of sleep). Is there a guide somewhere I can follow, or maybe someone can just outline the steps I need to take?
How to configure IPython to use gvim on Windows?
1
0
0
3,757
656,180
2009-03-17T21:51:00.000
6
1
0
0
php,python,email,gmail
656,198
3
true
0
0
any library/source that works with imap or pop will work.
3
1
0
I need advice and how to got about setting up a simple service for my users. I would like to add a new feature where users can send and receive emails from their gmail account. I have seen this done several times and I know its possible. There use to be a project for "Libgmailer" at sourceforge but I think it was abandoned. Is anyone aware of anything similar? I have found that Gmail has a Python API but my site is making use of PHP. I really need ideas on how to best go about this! Thanks all for any input
Implementation: How to retrieve and send emails for different Gmail accounts?
1.2
0
1
498
656,180
2009-03-17T21:51:00.000
0
1
0
0
php,python,email,gmail
656,205
3
false
0
0
Just a thought, Gmail supports POP/IMAP access. Could you do it using those protocols? It would mean asking your users to go into their gmail and enable it though.
3
1
0
I need advice and how to got about setting up a simple service for my users. I would like to add a new feature where users can send and receive emails from their gmail account. I have seen this done several times and I know its possible. There use to be a project for "Libgmailer" at sourceforge but I think it was abandoned. Is anyone aware of anything similar? I have found that Gmail has a Python API but my site is making use of PHP. I really need ideas on how to best go about this! Thanks all for any input
Implementation: How to retrieve and send emails for different Gmail accounts?
0
0
1
498
656,180
2009-03-17T21:51:00.000
0
1
0
0
php,python,email,gmail
656,194
3
false
0
0
Well if Google didn't come up with anything personally I'd see if I could reverse engineer the Python API by implementing it and watching it with a packet sniffer. My guess is it's just accessing some web service which should be pretty easy to mimic regardless of the language you're using.
3
1
0
I need advice and how to got about setting up a simple service for my users. I would like to add a new feature where users can send and receive emails from their gmail account. I have seen this done several times and I know its possible. There use to be a project for "Libgmailer" at sourceforge but I think it was abandoned. Is anyone aware of anything similar? I have found that Gmail has a Python API but my site is making use of PHP. I really need ideas on how to best go about this! Thanks all for any input
Implementation: How to retrieve and send emails for different Gmail accounts?
0
0
1
498
656,779
2009-03-18T02:34:00.000
3
1
0
0
python,pywinauto
6,291,256
4
false
0
0
I am going the same way, bit by bit and I have to say that python + pywinauto is good stuff!
2
10
0
I've been playing with PyWinAuto today and having fun automating all sorts GUI tests. I was wondering if it is still state of the art or if there might be something else (also free) which does windows rich client automation better.
PyWinAuto still useful?
0.148885
0
0
6,625
656,779
2009-03-18T02:34:00.000
8
1
0
0
python,pywinauto
1,653,008
4
false
0
0
I used to do test automation on our projects with AutoIt but switched over to pywinauto 3 months ago and have been very happy with that decision. There are some rough edges, but I've been able to fill them in with my own supplementary test functions. In addition I find that coding tests and support code in Python is much easier and more manageable compared to AutoIt. With Python I have way more powerful options for logging, debugging, documentation, process management and test configuration. For me it was absolutely the right way to go.
2
10
0
I've been playing with PyWinAuto today and having fun automating all sorts GUI tests. I was wondering if it is still state of the art or if there might be something else (also free) which does windows rich client automation better.
PyWinAuto still useful?
1
0
0
6,625
656,987
2009-03-18T04:41:00.000
9
0
0
0
python,asp.net-mvc,ruby,groovy,clojure
670,680
18
false
1
0
Let's start by clarifying your question. Why are you "tired of ASP.NET?" Is it because of the tedious webforms model that tries so hard to protect you from the browser/server conversation that it ends up getting in the way? Or is it because you have been trying to work with one of the tiresome 3rd party enhancement controls that build on the tedium of the webforms model? Or do are you simply tired of working with five different languages at once: ASP.NET, HTML, CSS, Javascript, and C#/VB? If you answered yes to the first two of these questions here's some advice: Get some rest. Try ASP.NET MVC. It gets out of your way and lets you work with the browser and IIS Realize that changing web development models will be difficult no matter which one you choose to move to. The path is smoother the fewer things you change (see number 2). If you answered yes only to the 3rd question (five different languages) then all I can tell you is, welcome to web development. It will be this way for awhile.
15
8
0
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why Clojure/Compojure+Ring/Moustache+Ring Groovy/Grails Python/Django Ruby/Rails Turbogear Cappuccino or Sproutcore Javascript/jQuery
Tired of ASP.NET, which of the following should I learn and why?
1
0
0
1,614
656,987
2009-03-18T04:41:00.000
12
0
0
0
python,asp.net-mvc,ruby,groovy,clojure
657,138
18
false
1
0
OK, first, apparently we all need a pants check. Done? I'm of two minds: if you are looking for a practical language / platform to pick up that you hope to use to help you in your day-to-day then I'd go with Python/Django. Python has developed into a really sweat and powerful language and Django is as nice a web development MVC as any other and pretty easy to pick up and get going with. You can run it locally, its easy to deploy on Apache w/ mod_python. Did I mention that Python is a really nice language? Also good support in the tools world, google app engine etc.... if you are looking to expand your thinking/though processes about the way you program and think about programming then I'm with Joel Spolsky - choose HAppS (Joel would go Haslkell) or Clojure which I've not used but I've done a lot of lisp and it makes you think different and the language constructs like the macro capability will change the way you think of solving problems
15
8
0
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why Clojure/Compojure+Ring/Moustache+Ring Groovy/Grails Python/Django Ruby/Rails Turbogear Cappuccino or Sproutcore Javascript/jQuery
Tired of ASP.NET, which of the following should I learn and why?
1
0
0
1,614
656,987
2009-03-18T04:41:00.000
8
0
0
0
python,asp.net-mvc,ruby,groovy,clojure
657,002
18
false
1
0
I recommend Clojure and Compojure because Clojure is awesome. Clojure is a new and modern LISP implemented on the JVM and can interact seamlessly with any Java library. It already has 3 IDE plugins in development, a book written about it, a very smart and open-minded person running the whole operation and a great newbie friendly community. The language is simple, easy to learn and yet really powerful. A good way to open your mind to new ideas without going as far as pure functional programming. Coding websites with Clojure is a breeze and really fun. It has a lot going for it and a lot of momentum. All the kool kids are doin' it so I recommend giving it a try!
15
8
0
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why Clojure/Compojure+Ring/Moustache+Ring Groovy/Grails Python/Django Ruby/Rails Turbogear Cappuccino or Sproutcore Javascript/jQuery
Tired of ASP.NET, which of the following should I learn and why?
1
0
0
1,614
656,987
2009-03-18T04:41:00.000
30
0
0
0
python,asp.net-mvc,ruby,groovy,clojure
656,999
18
false
1
0
Have you considered turning off the computer and going outside instead? Remember to wear pants!
15
8
0
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why Clojure/Compojure+Ring/Moustache+Ring Groovy/Grails Python/Django Ruby/Rails Turbogear Cappuccino or Sproutcore Javascript/jQuery
Tired of ASP.NET, which of the following should I learn and why?
1
0
0
1,614
656,987
2009-03-18T04:41:00.000
1
0
0
0
python,asp.net-mvc,ruby,groovy,clojure
703,688
18
false
1
0
I'll add in my vote for Groovy, as well as another one for Ruby. Both Grails and Rails are excellent frameworks, although Rails will get you a job a lot sooner than Grails. Both are truly a pleasure to work with, and have actually made me enjoy coding again. Groovy is nice because you can use any Java library. So, lightning-fast database access, XML parsing, PDF generation, and so on. In a nutshell, Groovy is Java, if Java had been written by a bunch of Ruby guys. Grails is also great, although it's a lot buggier than Rails, and if you want to do anything complicated you're going to need to learn a bit about Spring, Hibernate, and Java. Grails does have better internationalization support and more deployment options, as well as a really good integrated scheduler (Quartz) for long-running and scheduled tasks. Rails is Ruby all the way down, so you can very easily read the framework code and figure out how things worked -- I did this in order to figure out how to implement a graph (data structure), and was really pleased with how easy it was to figure out how to change things.
15
8
0
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why Clojure/Compojure+Ring/Moustache+Ring Groovy/Grails Python/Django Ruby/Rails Turbogear Cappuccino or Sproutcore Javascript/jQuery
Tired of ASP.NET, which of the following should I learn and why?
0.011111
0
0
1,614
656,987
2009-03-18T04:41:00.000
10
0
0
0
python,asp.net-mvc,ruby,groovy,clojure
656,998
18
false
1
0
I would probably learn Ruby on Rails. It has a lot of different methodologies compared to ASP.NET, and it might open your eyes to some different and very powerful approaches to web apps.
15
8
0
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why Clojure/Compojure+Ring/Moustache+Ring Groovy/Grails Python/Django Ruby/Rails Turbogear Cappuccino or Sproutcore Javascript/jQuery
Tired of ASP.NET, which of the following should I learn and why?
1
0
0
1,614
656,987
2009-03-18T04:41:00.000
4
0
0
0
python,asp.net-mvc,ruby,groovy,clojure
657,026
18
false
1
0
You should wait until you get an answer from someone who's used more than one of those. That said (I've only used rails, python, and javascript), one way to frame it would be as a balance between sheer intellectual joy and practicality. My thoughts on Rails and Python from that perspective: Rails is going to be different and interesting, and it was hip in 2005-2007. There may be something more hip now. (Hip counts when you want to get future colleagues excited about what you've done, when they haven't done it.) I'd venture that it's at least as eye-opening as something based on LISP or Smalltalk or Haskell, but probably more practical because you may actually end up using it at a job or for contract work. Clojure, Seaside, and HAppS sound really cool, but until one of them really catches on, you're unlikely to ever use any of that stuff again in your career unless you're a computer science PhD working with other PhD's. (Edit in response to comments: please don't read this as a disparagement of those frameworks. As Rayne and MarkusQ have noted, depending on your motivations, they may be just what you're looking for. I'm just trying to communicate one method for weighing the alternatives based on your goals.) Python is a great language to know all around. I haven't used Django, but it has some industry traction (not as much as rails). Python as a language though will serve you well no matter what you do -- it's great for banging out utility scripts and rapidly prototyping ideas. There's a huge community and tons of libraries. You can gauge a technology's potential usefulness for moneymaking by searching for it on craigslist, dice.com, monster.com, etc.
15
8
0
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why Clojure/Compojure+Ring/Moustache+Ring Groovy/Grails Python/Django Ruby/Rails Turbogear Cappuccino or Sproutcore Javascript/jQuery
Tired of ASP.NET, which of the following should I learn and why?
0.044415
0
0
1,614
656,987
2009-03-18T04:41:00.000
6
0
0
0
python,asp.net-mvc,ruby,groovy,clojure
657,029
18
false
1
0
Javascript, because the skills you learn will complement your current Asp.net skills.
15
8
0
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why Clojure/Compojure+Ring/Moustache+Ring Groovy/Grails Python/Django Ruby/Rails Turbogear Cappuccino or Sproutcore Javascript/jQuery
Tired of ASP.NET, which of the following should I learn and why?
1
0
0
1,614
656,987
2009-03-18T04:41:00.000
4
0
0
0
python,asp.net-mvc,ruby,groovy,clojure
658,881
18
false
1
0
Definitely clojure. It is the most different of all languages mentioned in the list, so it would be probably most fun to learn / use.
15
8
0
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why Clojure/Compojure+Ring/Moustache+Ring Groovy/Grails Python/Django Ruby/Rails Turbogear Cappuccino or Sproutcore Javascript/jQuery
Tired of ASP.NET, which of the following should I learn and why?
0.044415
0
0
1,614
656,987
2009-03-18T04:41:00.000
1
0
0
0
python,asp.net-mvc,ruby,groovy,clojure
670,621
18
false
1
0
I have worked with several technologies... not touched ASP. NET. Heard about it from other people who are under its influence. I have started working with Ruby on Rails and it is fun. Since you want to learn and develop web sites, you should go for Ruby on Rails. There are lot of things you can do with RoR on web. I like things that you can do with RMagick. (cropping images, thumbnails,slideshow etc) Talk about multi-lingual sites... and there you have "gettext". I vote for RoR.
15
8
0
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why Clojure/Compojure+Ring/Moustache+Ring Groovy/Grails Python/Django Ruby/Rails Turbogear Cappuccino or Sproutcore Javascript/jQuery
Tired of ASP.NET, which of the following should I learn and why?
0.011111
0
0
1,614
656,987
2009-03-18T04:41:00.000
1
0
0
0
python,asp.net-mvc,ruby,groovy,clojure
1,138,746
18
false
1
0
Learn Ruby on Rails. It'll change the way you see web development. It did for me! A valid alternative is Django and Python. I don't use it, but I consider it to be just as good as Rails.
15
8
0
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why Clojure/Compojure+Ring/Moustache+Ring Groovy/Grails Python/Django Ruby/Rails Turbogear Cappuccino or Sproutcore Javascript/jQuery
Tired of ASP.NET, which of the following should I learn and why?
0.011111
0
0
1,614
656,987
2009-03-18T04:41:00.000
0
0
0
0
python,asp.net-mvc,ruby,groovy,clojure
681,944
18
false
1
0
I've used Ruby on Rails but also have done quite a bit of Groovy and Grails work. If you don't have any previous experience I would go with either of those. They're both fun to learn, pretty easy, and are very powerful. They're both backed up by frameworks: Ruby had Rails/Merb Groovy has Grails They can both use jQuery. I don't know much about Python/Django combination.
15
8
0
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why Clojure/Compojure+Ring/Moustache+Ring Groovy/Grails Python/Django Ruby/Rails Turbogear Cappuccino or Sproutcore Javascript/jQuery
Tired of ASP.NET, which of the following should I learn and why?
0
0
0
1,614
656,987
2009-03-18T04:41:00.000
0
0
0
0
python,asp.net-mvc,ruby,groovy,clojure
691,195
18
false
1
0
I've started to learn Ruby on Rails along with MVC (since conceptually there similar) and found it a great relief from the same routine with .Net.
15
8
0
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why Clojure/Compojure+Ring/Moustache+Ring Groovy/Grails Python/Django Ruby/Rails Turbogear Cappuccino or Sproutcore Javascript/jQuery
Tired of ASP.NET, which of the following should I learn and why?
0
0
0
1,614
656,987
2009-03-18T04:41:00.000
3
0
0
0
python,asp.net-mvc,ruby,groovy,clojure
691,259
18
false
1
0
Nobody seems to be voting for groovy. I'd go for that. I don't know anything about grails, but groovy the language is pretty cool. In the past nine months at my job I've been required to learn python and ruby. In the process I also took some time to understand groovy. groovy is the language that had me hooked before I finished reading the first chapter of Groovy in Action. Ruby is the one I'm actively using now, and while I did nothing but python for six months that's my least favorite of the bunch. Python is not a bad language per se, I just didn't enjoy using it. I find ruby to be a very pleasant language and am glad I had the opportunity to learn it. Fully learning javascript might be the more practical choice, but I'd still vote for Groovy. I'm anxious to find an opportunity to use it at work.
15
8
0
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why Clojure/Compojure+Ring/Moustache+Ring Groovy/Grails Python/Django Ruby/Rails Turbogear Cappuccino or Sproutcore Javascript/jQuery
Tired of ASP.NET, which of the following should I learn and why?
0.033321
0
0
1,614
656,987
2009-03-18T04:41:00.000
1
0
0
0
python,asp.net-mvc,ruby,groovy,clojure
657,797
18
false
1
0
Ruby on Rails, because that's what I use.
15
8
0
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why Clojure/Compojure+Ring/Moustache+Ring Groovy/Grails Python/Django Ruby/Rails Turbogear Cappuccino or Sproutcore Javascript/jQuery
Tired of ASP.NET, which of the following should I learn and why?
0.011111
0
0
1,614
657,868
2009-03-18T11:30:00.000
-2
1
1
0
python,import
657,927
4
false
0
0
import fred print dir(fred)
2
2
0
Is there a way of knowing which modules are available to import from inside a package?
How do I find the modules that are available for import from within a package?
-0.099668
0
0
284
657,868
2009-03-18T11:30:00.000
-1
1
1
0
python,import
658,158
4
false
0
0
You have the source. Look at the files inside the package directory. Those modules are available for you to import.
2
2
0
Is there a way of knowing which modules are available to import from inside a package?
How do I find the modules that are available for import from within a package?
-0.049958
0
0
284
658,879
2009-03-18T15:52:00.000
2
0
1
0
python,visual-studio,import,linker
659,107
2
false
0
1
Try to include C:\WINDOWS\system32\python26.dll in your references. python26.lib contains the symbol names for the main DLL.
2
8
0
I have a C++ application that has embedded Python. I'm building with Visual Studio 2005. When I try to link to python26.lib, I get a number of unresolved symbols, all of which begin with "__imp": error LNK2019: unresolved external symbol __imp__Py_Initialize referenced in function _main python26.lib is an import library (installed by the Python 2.6 installer). What do I have to do to resolve these symbols? They do exist in the import library (dumpbin /all shows them). Thanks.
Linking to Python import library in Visual Studio 2005
0.197375
0
0
6,181
658,879
2009-03-18T15:52:00.000
13
0
1
0
python,visual-studio,import,linker
660,181
2
true
0
1
Looks like I was trying to link a 64-bit Python library to a 32-bit application. I wish the linker would tell me something other than "unresolved symbol." Linking to the 32-bit library fixes the problem.
2
8
0
I have a C++ application that has embedded Python. I'm building with Visual Studio 2005. When I try to link to python26.lib, I get a number of unresolved symbols, all of which begin with "__imp": error LNK2019: unresolved external symbol __imp__Py_Initialize referenced in function _main python26.lib is an import library (installed by the Python 2.6 installer). What do I have to do to resolve these symbols? They do exist in the import library (dumpbin /all shows them). Thanks.
Linking to Python import library in Visual Studio 2005
1.2
0
0
6,181
659,018
2009-03-18T16:28:00.000
0
0
1
0
python,object,automation
659,092
4
false
0
0
As far as I know it is possible to create COM objects (which is what Automation objects are) in Python on Windows. Then assuming you can get out the lists via automation it should be easy to do what you want in python.
1
4
0
I have a set of macros that I have turned into an add-in in excel. The macros allow me to interact with another program that has what are called Microsoft Automation Objects that provide some control over what the other program does. For example, I have a filter tool in the add-in that filters the list provided by the other program to match a list in the Excel workbook. This is slow though. I might have fifty thousand lines in the other program and want to filter out all of the lines that don't match a list of three thousand lines in Excel. This type of matching takes about 30-40 minutes. I have begun wondering if there is way to do this with Python instead since I suspect the matching process could be done in seconds. Edited: Thanks- Based on the suggestion to look at Hammond's book I found out a number of resources. However, though I am still exploring it looks like many of these are old. For example, Hammond's book was published in 2000, which means the writing was finished almost a decade ago. Correction I just found the package called PyWin32 with a 2/2009 build. This should get me started. Thanks
Accessing Microsoft Automation Objects from Python
0
0
0
8,875
659,737
2009-03-18T19:24:00.000
0
0
1
0
python,encryption,rsa
659,745
5
false
0
0
Not entirely sure, but if you add a random component to your RSA message it prevents dictionary attacks
3
4
0
I've been looking at most python crypto libraries, I've decided to use either PyCrypto or M2Crypto. I've discarded ezPyCrypto because it only supports MD5 for signing and Keyczar because it's not mature enough. So I've read that RSA is vulnerable to several attacks if the to-be-encrypted text (or signature hash) is not properly padded. What does it mean? Neither PyCrypto or M2Crypto mention anything about this and google didn't find anything relevant. Do these libraries automatically add the paddign? How can one tell? If the answer to the above is no, what is considered proper padding?
Python: How to add RSA padding?
0
0
0
4,124
659,737
2009-03-18T19:24:00.000
3
0
1
0
python,encryption,rsa
661,276
5
false
0
0
One of the reason for random padding might be that "from the book" RSA with low exponent (let's say 3) can be cracked really simply if the exact same message is sent to several people (three). You'd therefore better make sure that you don't send the exact same message by applying some kind of random (yet inversible) transformation to your message before. Maybe that's what thing padding is about !? EDIT: I looked on wikipedia. what I was talking about is called Hastad's attack.
3
4
0
I've been looking at most python crypto libraries, I've decided to use either PyCrypto or M2Crypto. I've discarded ezPyCrypto because it only supports MD5 for signing and Keyczar because it's not mature enough. So I've read that RSA is vulnerable to several attacks if the to-be-encrypted text (or signature hash) is not properly padded. What does it mean? Neither PyCrypto or M2Crypto mention anything about this and google didn't find anything relevant. Do these libraries automatically add the paddign? How can one tell? If the answer to the above is no, what is considered proper padding?
Python: How to add RSA padding?
0.119427
0
0
4,124
659,737
2009-03-18T19:24:00.000
6
0
1
0
python,encryption,rsa
663,290
5
true
0
0
PyCrypto doesn't add the mentioned padding. M2Crypto instead does. M2Crypto is built on top of openSSL, supports mostlyl everything you need, is still maintained and up to date while PyCrypto issues several deprecation warnings.
3
4
0
I've been looking at most python crypto libraries, I've decided to use either PyCrypto or M2Crypto. I've discarded ezPyCrypto because it only supports MD5 for signing and Keyczar because it's not mature enough. So I've read that RSA is vulnerable to several attacks if the to-be-encrypted text (or signature hash) is not properly padded. What does it mean? Neither PyCrypto or M2Crypto mention anything about this and google didn't find anything relevant. Do these libraries automatically add the paddign? How can one tell? If the answer to the above is no, what is considered proper padding?
Python: How to add RSA padding?
1.2
0
0
4,124
661,017
2009-03-19T04:00:00.000
1
1
0
1
python,linux,python-2.5,errno
6,170,629
6
false
0
0
ctypes actually gives a standard way to access python's c implementation, which is using errno. I haven't tested this on anything other than my (linux) system, but this should be very portable: ctypes.c_int.in_dll(ctypes.pythonapi,"errno") which returns a c_int containing the current value.
1
25
0
I am stuck with a fairly complex Python module that does not return useful error codes (it actually fails disturbingly silently). However, the underlying C library it calls sets errno. Normally errno comes in over OSError attributes, but since I don't have an exception, I can't get at it. Using ctypes, libc.errno doesn't work because errno is a macro in GNU libc. Python 2.6 has some affordances but Debian still uses Python 2.5. Inserting a C module into my pure Python program just to read errno disgusts me. Is there some way to access errno? A Linux-only solution is fine, since the library being wrapped is Linux-only. I also don't have to worry about threads, as I'm only running one thread during the time in which this can fail.
Access to errno from Python?
0.033321
0
0
10,955
661,603
2009-03-19T09:51:00.000
66
1
0
0
python,generator
662,925
24
true
0
0
The simple answer to your question: no, there is no simple way. There are a whole lot of work-arounds. There really shouldn't be a simple way, because of what generators are: a way to output a sequence of values without holding the sequence in memory. So there's no backward traversal. You could write a has_next function or maybe even slap it on to a generator as a method with a fancy decorator if you wanted to.
3
206
0
Is there a simple way of testing if the generator has no items, like peek, hasNext, isEmpty, something along those lines?
How do I know if a generator is empty from the start?
1.2
0
0
101,926
661,603
2009-03-19T09:51:00.000
0
1
0
0
python,generator
64,162,865
24
false
0
0
There's a very simple solution: if next(generator,-1) == -1 then the generator is empty!
3
206
0
Is there a simple way of testing if the generator has no items, like peek, hasNext, isEmpty, something along those lines?
How do I know if a generator is empty from the start?
0
0
0
101,926
661,603
2009-03-19T09:51:00.000
0
1
0
0
python,generator
70,471,281
24
false
0
0
bool(generator) will return the correct result
3
206
0
Is there a simple way of testing if the generator has no items, like peek, hasNext, isEmpty, something along those lines?
How do I know if a generator is empty from the start?
0
0
0
101,926
661,826
2009-03-19T11:20:00.000
2
0
0
1
python,file-io
669,335
3
false
0
0
You can use memory-mapped files, standard Python module called mmap.
1
2
0
I want to have an application writing out information at the same time that a monitor is reading it. The application is "embedded" (and on Win32 XP) and so has restricted memory and I/O functionality. The simplest way I can think to do this is by writing the data to a buffer file from the application, and then read the same file using the monitor application. The writer application is C++, and the reader is currently Python on Win32 XP. Are there libraries to do this? Has anyone seen examples of this? I don't want to have to use a database as I don't want to link to a database library in the applcation. I.e. don't have space and may not be supported on the embedded platform. Another way to do this is over a network connection, but I figure files are the simplest solution.
Can I use a single file as a buffer? I.e. write to and read from at same time
0.132549
0
0
313
662,624
2009-03-19T15:23:00.000
1
0
0
0
python,xml,minidom
29,696,911
9
false
1
0
1.Custom your own 'Element.writexml' method. from 'minidom.py' copy Element's writexml code to your own file. rename it to writexml_nosort, delete 'a_names.sort()' (python 2.7) or change 'a_names = sorted(attrs.keys())' to 'a_names = attrs.keys()'(python 3.4) change the Element's method to your own: minidom.Element.writexml = writexml_nosort; 2.custom your favorite order: right_order = ['a', 'b', 'c', 'a1', 'b1'] 3.adjust your element 's _attrs node._attrs = OrderedDict( [(k,node._attrs[k]) for k in right_order ] )
1
13
0
Is there a way I can preserve the original order of attributes when processing XML with minidom? Say I have: <color red="255" green="255" blue="233" /> when I modify this with minidom the attributes are rearranged alphabetically blue, green, and red. I'd like to preserve the original order. I am processing the file by looping through the elements returned by elements = doc.getElementsByTagName('color') and then I do assignments like this e.attributes["red"].value = "233".
Preserve order of attributes when modifying with minidom
0.022219
0
1
8,252
662,762
2009-03-19T15:52:00.000
0
0
0
1
python,cgi,fastcgi,wsgi
663,372
6
false
1
0
Writing python web apps is a topic on itself, but I would say that by default, it will be portable on multiple servers / platforms. When developping python web applications, you will often use frameworks that provide their own web server. For performance reasons, you might want to place it behind apache, but it is not even necessary, however, you might get a performance boost by placing it behind an apache server. Some of the most popular frameworks for web python are : Plone, Zope, CherryPy and TurboGears, only to name a few. Under apache, you could also use python server pages through mod_python, and since apache runs on windows too, this would aslo be portable.
5
3
0
Can I write web application that I can host on Windows(IIS web server) and Linux (Apache or lighttpd) without any changes? CGI? Maybe something new? WSGI | FastCGI ?
Can I write Python web application for Windows and Linux platforms at the same time?
0
0
0
1,553
662,762
2009-03-19T15:52:00.000
0
0
0
1
python,cgi,fastcgi,wsgi
663,304
6
false
1
0
consider also the possibility of using web2Py, or XML-RPC implementation, or Twisted...
5
3
0
Can I write web application that I can host on Windows(IIS web server) and Linux (Apache or lighttpd) without any changes? CGI? Maybe something new? WSGI | FastCGI ?
Can I write Python web application for Windows and Linux platforms at the same time?
0
0
0
1,553
662,762
2009-03-19T15:52:00.000
2
0
0
1
python,cgi,fastcgi,wsgi
662,791
6
false
1
0
Yes, if you use CGI, FastCGI or depending on your framework, even a self-contained web server (so IIS and Apache would be a reverse-proxy) then that would all work. The difference will be the configuration of the OS-specific servers, and also your Python environment on each OS. So you may find yourself doing a small bit of work at the beginning to make sure your paths are right, etc.
5
3
0
Can I write web application that I can host on Windows(IIS web server) and Linux (Apache or lighttpd) without any changes? CGI? Maybe something new? WSGI | FastCGI ?
Can I write Python web application for Windows and Linux platforms at the same time?
0.066568
0
0
1,553
662,762
2009-03-19T15:52:00.000
2
0
0
1
python,cgi,fastcgi,wsgi
662,784
6
false
1
0
web.py includes a server... It will do the trick for small jobs. By the way, Apache works on windows.
5
3
0
Can I write web application that I can host on Windows(IIS web server) and Linux (Apache or lighttpd) without any changes? CGI? Maybe something new? WSGI | FastCGI ?
Can I write Python web application for Windows and Linux platforms at the same time?
0.066568
0
0
1,553
662,762
2009-03-19T15:52:00.000
7
0
0
1
python,cgi,fastcgi,wsgi
662,789
6
false
1
0
Yes you can. But you can also use apache on windows. If you go the IIS way there's only CGI and it's pretty hard to set up. You can also use python based server like CherryPy which is pretty good and will work on all platforms with python. Some frameworks like django support both CGI and WSGI, so you don't have to worry about the details of WSGI or CGI much. If you ask me, WSGI is the future for python web apps.
5
3
0
Can I write web application that I can host on Windows(IIS web server) and Linux (Apache or lighttpd) without any changes? CGI? Maybe something new? WSGI | FastCGI ?
Can I write Python web application for Windows and Linux platforms at the same time?
1
0
0
1,553
663,171
2009-03-19T17:29:00.000
7
0
1
0
python,string,substring
61,509,129
16
false
0
0
Well, I got a situation where I needed to translate a PHP script to Python, and it had many usages of substr(string, beginning, LENGTH). If I chose Python's string[beginning:end] I'd have to calculate a lot of end indexes, so the easier way was to use string[beginning:][:length], it saved me a lot of trouble.
2
2,504
0
I want to get a new string from the third character to the end of the string, e.g. myString[2:end]. If omitting the second part means 'till the end', and if you omit the first part, does it start from the start?
How do I get a substring of a string in Python?
1
0
0
3,461,049
663,171
2009-03-19T17:29:00.000
73
0
1
0
python,string,substring
9,528,361
16
false
0
0
A common way to achieve this is by string slicing. MyString[a:b] gives you a substring from index a to (b - 1).
2
2,504
0
I want to get a new string from the third character to the end of the string, e.g. myString[2:end]. If omitting the second part means 'till the end', and if you omit the first part, does it start from the start?
How do I get a substring of a string in Python?
1
0
0
3,461,049
666,148
2009-03-20T13:30:00.000
9
0
1
1
python,cocoa,xcode,pyobjc
667,584
2
true
0
0
PyObjC does not yet work with Python 3.0. According to Ronald Oussoren, a (the?) PyObjC developer, Python 3.0 support is possible, but not yet implemented: Support for Python 3.x is on my todo list but is non-trivial to achieve. PyObjC contains a large amount of pretty low-level C code, getting the details w.r.t. to the changes in 3.0 right is not easy. I have looked into a Python 3.x port and this should be fairly easy, but it's still a couple of days work. I'm not planning to work on that before the next release of PyObjC, that's way too long overdue as it is. I'm sure patches would be welcomed.
1
10
0
By default, a Cocoa-Python application uses the default Python runtime which is version 2.5. How can I configure my Xcode project so that it would use the newer Python 3.0 runtime? I tried replacing the Python.framework included in the project with the newer version but it did not work. And another thing, are PyObjc modules compatible with the new version of Python?
PyObjC + Python 3.0 Questions
1.2
0
0
1,254
667,508
2009-03-20T19:02:00.000
3
1
0
0
python,algorithm,message-queue
667,528
10
false
0
0
One solution is to attach a timestamp to each queue item and to discard the item after 8 seconds have passed. You can perform this check each time the queue is added to. This only works if you limit the queue size to 5 and discard any additions whilst the queue is full.
1
173
0
I could use some pseudo-code, or better, Python. I am trying to implement a rate-limiting queue for a Python IRC bot, and it partially works, but if someone triggers less messages than the limit (e.g., rate limit is 5 messages per 8 seconds, and the person triggers only 4), and the next trigger is over the 8 seconds (e.g., 16 seconds later), the bot sends the message, but the queue becomes full and the bot waits 8 seconds, even though it's not needed since the 8 second period has lapsed.
What's a good rate limiting algorithm?
0.059928
0
1
108,156
667,510
2009-03-20T19:02:00.000
0
0
0
0
python,xmpp,ejabberd
1,703,042
1
false
1
0
Go through once for each transport and register yourself. Capture the XMPP packets. Dump the transport registration data from your current system into a csv file, xml file, or something else you can know the structure. Write a script using jabberpy, xmpppy, pyxmpp, or whatever, and emulate each of your users registering with the transports. One issue is you may have to be connected to the Internet for the transports to come online. Then you're going live with someone else's account. If you can't get their current password data for your jabber server, set it all to a default and then migrate it back after your transport registration.
1
1
0
I'm trying to write some scripts to migrate my users to ejabberd, but the only way that's been suggested for me to register a user with a transport is to have them use their client and discover the service. Certainly there is a way, right?
Is there a way to manually register a user with a py-transport server-side?
0
0
0
262
667,540
2009-03-20T19:11:00.000
29
0
1
1
python,command-line
667,556
10
false
0
0
You're too late. By the time that the typed command gets to Python your shell has already worked its magic. For example, quotes get consumed (as you've noticed), variables get interpolated, etc.
4
36
0
I want to get the full command line as it was typed. This: " ".join(sys.argv[:]) doesn't work here (deletes double quotes). Also I prefer not to rejoin something that was parsed and split. Any ideas?
Full command line as it was typed
1
0
0
9,141
667,540
2009-03-20T19:11:00.000
5
0
1
1
python,command-line
667,889
10
false
0
0
As mentioned, this probably cannot be done, at least not reliably. In a few cases, you might be able to find a history file for the shell (e.g. - "bash", but not "tcsh") and get the user's typing from that. I don't know how much, if any, control you have over the user's environment.
4
36
0
I want to get the full command line as it was typed. This: " ".join(sys.argv[:]) doesn't work here (deletes double quotes). Also I prefer not to rejoin something that was parsed and split. Any ideas?
Full command line as it was typed
0.099668
0
0
9,141
667,540
2009-03-20T19:11:00.000
2
0
1
1
python,command-line
668,518
10
false
0
0
On Linux there is /proc/<pid>/cmdline that is in the format of argv[] (i.e. there is 0x00 between all the lines and you can't really know how many strings there are since you don't get the argc; though you will know it when the file runs out of data ;). You can be sure that that commandline is already munged too since all escaping/variable filling is done and parameters are nicely packaged (no extra spaces between parameters, etc.).
4
36
0
I want to get the full command line as it was typed. This: " ".join(sys.argv[:]) doesn't work here (deletes double quotes). Also I prefer not to rejoin something that was parsed and split. Any ideas?
Full command line as it was typed
0.039979
0
0
9,141
667,540
2009-03-20T19:11:00.000
13
0
1
1
python,command-line
667,554
10
false
0
0
In a Unix environment, this is not generally possible...the best you can hope for is the command line as passed to your process. Because the shell (essentially any shell) may munge the typed command line in several ways before handing it to the OS for execution.
4
36
0
I want to get the full command line as it was typed. This: " ".join(sys.argv[:]) doesn't work here (deletes double quotes). Also I prefer not to rejoin something that was parsed and split. Any ideas?
Full command line as it was typed
1
0
0
9,141
667,640
2009-03-20T19:31:00.000
47
0
0
0
python,sockets
15,175,067
6
false
0
0
Short answer: use a non-blocking recv(), or a blocking recv() / select() with a very short timeout. Long answer: The way to handle socket connections is to read or write as you need to, and be prepared to handle connection errors. TCP distinguishes between 3 forms of "dropping" a connection: timeout, reset, close. Of these, the timeout can not really be detected, TCP might only tell you the time has not expired yet. But even if it told you that, the time might still expire right after. Also remember that using shutdown() either you or your peer (the other end of the connection) may close only the incoming byte stream, and keep the outgoing byte stream running, or close the outgoing stream and keep the incoming one running. So strictly speaking, you want to check if the read stream is closed, or if the write stream is closed, or if both are closed. Even if the connection was "dropped", you should still be able to read any data that is still in the network buffer. Only after the buffer is empty will you receive a disconnect from recv(). Checking if the connection was dropped is like asking "what will I receive after reading all data that is currently buffered ?" To find that out, you just have to read all data that is currently bufferred. I can see how "reading all buffered data", to get to the end of it, might be a problem for some people, that still think of recv() as a blocking function. With a blocking recv(), "checking" for a read when the buffer is already empty will block, which defeats the purpose of "checking". In my opinion any function that is documented to potentially block the entire process indefinitely is a design flaw, but I guess it is still there for historical reasons, from when using a socket just like a regular file descriptor was a cool idea. What you can do is: set the socket to non-blocking mode, but than you get a system-depended error to indicate the receive buffer is empty, or the send buffer is full stick to blocking mode but set a very short socket timeout. This will allow you to "ping" or "check" the socket with recv(), pretty much what you want to do use select() call or asyncore module with a very short timeout. Error reporting is still system-specific. For the write part of the problem, keeping the read buffers empty pretty much covers it. You will discover a connection "dropped" after a non-blocking read attempt, and you may choose to stop sending anything after a read returns a closed channel. I guess the only way to be sure your sent data has reached the other end (and is not still in the send buffer) is either: receive a proper response on the same socket for the exact message that you sent. Basically you are using the higher level protocol to provide confirmation. perform a successful shutdow() and close() on the socket The python socket howto says send() will return 0 bytes written if channel is closed. You may use a non-blocking or a timeout socket.send() and if it returns 0 you can no longer send data on that socket. But if it returns non-zero, you have already sent something, good luck with that :) Also here I have not considered OOB (out-of-band) socket data here as a means to approach your problem, but I think OOB was not what you meant.
2
69
0
I want my python application to be able to tell when the socket on the other side has been dropped. Is there a method for this?
How to tell if a connection is dead in python
1
0
1
175,519
667,640
2009-03-20T19:31:00.000
41
0
0
0
python,sockets
667,710
6
true
0
0
It depends on what you mean by "dropped". For TCP sockets, if the other end closes the connection either through close() or the process terminating, you'll find out by reading an end of file, or getting a read error, usually the errno being set to whatever 'connection reset by peer' is by your operating system. For python, you'll read a zero length string, or a socket.error will be thrown when you try to read or write from the socket.
2
69
0
I want my python application to be able to tell when the socket on the other side has been dropped. Is there a method for this?
How to tell if a connection is dead in python
1.2
0
1
175,519
668,257
2009-03-20T22:40:00.000
2
0
1
0
python,asynchronous
668,772
10
false
1
0
I'd just build a service in twisted that did that concurrent fetch and analysis and access that from web.py as a simple http request.
3
9
0
I have a web.py server that responds to various user requests. One of these requests involves downloading and analyzing a series of web pages. Is there a simple way to setup an async / callback based url download mechanism in web.py? Low resource usage is particularly important as each user initiated request could result in download of multiple pages. The flow would look like: User request -> web.py -> Download 10 pages in parallel or asynchronously -> Analyze contents, return results I recognize that Twisted would be a nice way to do this, but I'm already in web.py so I'm particularly interested in something that can fit within web.py .
Python: simple async download of url content?
0.039979
0
1
10,221
668,257
2009-03-20T22:40:00.000
0
0
1
0
python,asynchronous
668,723
10
false
1
0
Actually you can integrate twisted with web.py. I'm not really sure how as I've only done it with django (used twisted with it).
3
9
0
I have a web.py server that responds to various user requests. One of these requests involves downloading and analyzing a series of web pages. Is there a simple way to setup an async / callback based url download mechanism in web.py? Low resource usage is particularly important as each user initiated request could result in download of multiple pages. The flow would look like: User request -> web.py -> Download 10 pages in parallel or asynchronously -> Analyze contents, return results I recognize that Twisted would be a nice way to do this, but I'm already in web.py so I'm particularly interested in something that can fit within web.py .
Python: simple async download of url content?
0
0
1
10,221
668,257
2009-03-20T22:40:00.000
0
0
1
0
python,asynchronous
668,486
10
false
1
0
I'm not sure I'm understanding your question, so I'll give multiple partial answers to start with. If your concern is that web.py is having to download data from somewhere and analyze the results before responding, and you fear the request may time out before the results are ready, you could use ajax to split the work up. Return immediately with a container page (to hold the results) and a bit of javascript to poll the sever for the results until the client has them all. Thus the client never waits for the server, though the user still has to wait for the results. If your concern is tying up the server waiting for the client to get the results, I doubt if that will actually be a problem. Your networking layers should not require you to wait-on-write If you are worrying about the server waiting while the client downloads static content from elsewhere, either ajax or clever use of redirects should solve your problem
3
9
0
I have a web.py server that responds to various user requests. One of these requests involves downloading and analyzing a series of web pages. Is there a simple way to setup an async / callback based url download mechanism in web.py? Low resource usage is particularly important as each user initiated request could result in download of multiple pages. The flow would look like: User request -> web.py -> Download 10 pages in parallel or asynchronously -> Analyze contents, return results I recognize that Twisted would be a nice way to do this, but I'm already in web.py so I'm particularly interested in something that can fit within web.py .
Python: simple async download of url content?
0
0
1
10,221
669,770
2009-03-21T18:51:00.000
5
0
0
0
python,winapi,encoding,pywin32
669,791
4
false
0
0
I realize this isn't answering your question directly, but I strongly recommend you go through the trouble of using the Unicode-clean GetUserNameW as you mentioned. The non-wide commands work differently on different Windows editions (e.g. ME, although I admit that example is old!), so IMHO it's worth just getting it right. Having done a lot of multi-lingual Windows development, although the wide API can add a layer of translation or wrapping (as you suggest!), it's worth it.
2
2
0
How do I get the encoding that is used for the string returned by GetUserName from the win32 API? I'm using pywin32 and it returns an 8-bit string. On my German XP, this string is obviously encoded using Latin-1, but this might not be the case for other Windows installations. I could use GetUserNameW, but I would have to wrap that myself using ctypes, which I'd like to avoid for now if there is a simpler solution.
Encoding of string returned by GetUserName()
0.244919
0
0
1,422
669,770
2009-03-21T18:51:00.000
0
0
0
0
python,winapi,encoding,pywin32
669,789
4
false
0
0
From the API docs, GetUserNameA will return the name in ANSI and GetUserNameW returns the name in Unicode. You will have to use GetUserNameW.
2
2
0
How do I get the encoding that is used for the string returned by GetUserName from the win32 API? I'm using pywin32 and it returns an 8-bit string. On my German XP, this string is obviously encoded using Latin-1, but this might not be the case for other Windows installations. I could use GetUserNameW, but I would have to wrap that myself using ctypes, which I'd like to avoid for now if there is a simpler solution.
Encoding of string returned by GetUserName()
0
0
0
1,422
669,903
2009-03-21T20:08:00.000
2
0
0
0
python,django,pagination
670,763
5
true
1
0
Date based generic views don't have pagination. It seems you can't add pagination via wrapping them as well since they return rendered result. I would simply write my own view in this case. You can check out generic views' code as well, but most of it will probably be unneeded in your case. Since your question is a valid one, and looking at the code; I wonder why they didn't decouple queryset generation as separate functions. You could just use them and render as you wish then.
1
6
0
I have a pretty simple question. I want to make some date-based generic views on a Django site, but I also want to paginate them. According to the documentation the object_list view has page and paginate_by arguments, but the archive_month view does not. What's the "right" way to do it?
Pagination of Date-Based Generic Views in Django
1.2
0
0
3,818
670,398
2009-03-22T01:37:00.000
0
0
0
0
python,oauth
3,117,885
7
false
1
0
You could create 2 applications? 1 for deployment and the other for testing. Alternatively, you can also include an oauth_callback parameter when you requesting for a request token. Some providers will redirect to the url specified by oauth_callback (eg. Twitter, Google) but some will ignore this callback url and redirect to the one specified during configuration (eg. Yahoo)
3
37
0
I'm building a Python application that needs to communicate with an OAuth service provider. The SP requires me to specify a callback URL. Specifying localhost obviously won't work. I'm unable to set up a public facing server. Any ideas besides paying for server/hosting? Is this even possible?
How do I develop against OAuth locally?
0
0
1
19,222
670,398
2009-03-22T01:37:00.000
5
0
0
0
python,oauth
7,971,246
7
false
1
0
This was with the Facebook OAuth - I actually was able to specify 'http://127.0.0.1:8080' as the Site URL and the callback URL. It took several minutes for the changes to the Facebook app to propagate, but then it worked.
3
37
0
I'm building a Python application that needs to communicate with an OAuth service provider. The SP requires me to specify a callback URL. Specifying localhost obviously won't work. I'm unable to set up a public facing server. Any ideas besides paying for server/hosting? Is this even possible?
How do I develop against OAuth locally?
0.141893
0
1
19,222
670,398
2009-03-22T01:37:00.000
10
0
0
0
python,oauth
12,107,449
7
false
1
0
In case you are using *nix style system, create a alias like 127.0.0.1 mywebsite.dev in /etc/hosts (you need have the line which is similar to above mentioned in the file, Use http://website.dev/callbackurl/for/app in call back URL and during local testing.
3
37
0
I'm building a Python application that needs to communicate with an OAuth service provider. The SP requires me to specify a callback URL. Specifying localhost obviously won't work. I'm unable to set up a public facing server. Any ideas besides paying for server/hosting? Is this even possible?
How do I develop against OAuth locally?
1
0
1
19,222
671,403
2009-03-22T18:27:00.000
2
0
1
0
python,memory,dictionary,performance
671,476
7
false
0
0
Honestly, you won't be able to tell the difference either way, in terms of either performance or memory usage. Unless you're dealing with tens of millions of items or more, the performance or memory impact is just noise. From the way you worded your second sentence, it sounds like the one big dictionary is your first inclination, and matches more closely with the problem you're trying to solve. If that's true, go with that. What you'll find about Python is that the solutions that everyone considers 'right' nearly always turn out to be those that are as clear and simple as possible.
5
38
0
I'm writing an application in Python (2.6) that requires me to use a dictionary as a data store. I am curious as to whether or not it is more memory efficient to have one large dictionary, or to break that down into many (much) smaller dictionaries, then have an "index" dictionary that contains a reference to all the smaller dictionaries. I know there is a lot of overhead in general with lists and dictionaries. I read somewhere that python internally allocates enough space that the dictionary/list # of items to the power of 2. I'm new enough to python that I'm not sure if there are other unexpected internal complexities/suprises like that, that is not apparent to the average user that I should take into consideration. One of the difficulties is knowing how the power of 2 system counts "items"? Is each key:pair counted as 1 item? That's seems important to know because if you have a 100 item monolithic dictionary then space 100^2 items would be allocated. If you have 100 single item dictionaries (1 key:pair) then each dictionary would only be allocation 1^2 (aka no extra allocation)? Any clearly laid out information would be very helpful!
Memory efficiency: One large dictionary or a dictionary of smaller dictionaries?
0.057081
0
0
31,141
671,403
2009-03-22T18:27:00.000
16
0
1
0
python,memory,dictionary,performance
671,463
7
false
0
0
If you're using Python, you really shouldn't be worrying about this sort of thing in the first place. Just build your data structure the way it best suits your needs, not the computer's. This smacks of premature optimization, not performance improvement. Profile your code if something is actually bottlenecking, but until then, just let Python do what it does and focus on the actual programming task, and not the underlying mechanics.
5
38
0
I'm writing an application in Python (2.6) that requires me to use a dictionary as a data store. I am curious as to whether or not it is more memory efficient to have one large dictionary, or to break that down into many (much) smaller dictionaries, then have an "index" dictionary that contains a reference to all the smaller dictionaries. I know there is a lot of overhead in general with lists and dictionaries. I read somewhere that python internally allocates enough space that the dictionary/list # of items to the power of 2. I'm new enough to python that I'm not sure if there are other unexpected internal complexities/suprises like that, that is not apparent to the average user that I should take into consideration. One of the difficulties is knowing how the power of 2 system counts "items"? Is each key:pair counted as 1 item? That's seems important to know because if you have a 100 item monolithic dictionary then space 100^2 items would be allocated. If you have 100 single item dictionaries (1 key:pair) then each dictionary would only be allocation 1^2 (aka no extra allocation)? Any clearly laid out information would be very helpful!
Memory efficiency: One large dictionary or a dictionary of smaller dictionaries?
1
0
0
31,141
671,403
2009-03-22T18:27:00.000
8
0
1
0
python,memory,dictionary,performance
671,474
7
false
0
0
"Simple" is generally better than "clever", especially if you have no tested reason to go beyond "simple". And anyway "Memory efficient" is an ambiguous term, and there are tradeoffs, when you consider persisting, serializing, cacheing, swapping, and a whole bunch of other stuff that someone else has already thought through so that in most cases you don't need to. Think "Simplest way to handle it properly" optimize much later.
5
38
0
I'm writing an application in Python (2.6) that requires me to use a dictionary as a data store. I am curious as to whether or not it is more memory efficient to have one large dictionary, or to break that down into many (much) smaller dictionaries, then have an "index" dictionary that contains a reference to all the smaller dictionaries. I know there is a lot of overhead in general with lists and dictionaries. I read somewhere that python internally allocates enough space that the dictionary/list # of items to the power of 2. I'm new enough to python that I'm not sure if there are other unexpected internal complexities/suprises like that, that is not apparent to the average user that I should take into consideration. One of the difficulties is knowing how the power of 2 system counts "items"? Is each key:pair counted as 1 item? That's seems important to know because if you have a 100 item monolithic dictionary then space 100^2 items would be allocated. If you have 100 single item dictionaries (1 key:pair) then each dictionary would only be allocation 1^2 (aka no extra allocation)? Any clearly laid out information would be very helpful!
Memory efficiency: One large dictionary or a dictionary of smaller dictionaries?
1
0
0
31,141
671,403
2009-03-22T18:27:00.000
7
0
1
0
python,memory,dictionary,performance
671,502
7
false
0
0
Premature optimization bla bla, don't do it bla bla. I think you're mistaken about the power of two extra allocation does. I think its just a multiplier of two. x*2, not x^2. I've seen this question a few times on various python mailing lists. With regards to memory, here's a paraphrased version of one such discussion (the post in question wanted to store hundreds of millions integers): A set() is more space efficient than a dict(), if you just want to test for membership gmpy has a bitvector type class for storing dense sets of integers Dicts are kept between 50% and 30% empty, and an entry is about ~12 bytes (though the true amount will vary by platform a bit). So, the fewer objects you have, the less memory you're going to be using, and the fewer lookups you're going to do (since you'll have to lookup in the index, then a second lookup in the actual value). Like others, said, profile to see your bottlenecks. Keeping an membership set() and value dict() might be faster, but you'll be using more memory. I'd also suggest reposting this to a python specific list, such as comp.lang.python, which is full of much more knowledgeable people than myself who would give you all sorts of useful information.
5
38
0
I'm writing an application in Python (2.6) that requires me to use a dictionary as a data store. I am curious as to whether or not it is more memory efficient to have one large dictionary, or to break that down into many (much) smaller dictionaries, then have an "index" dictionary that contains a reference to all the smaller dictionaries. I know there is a lot of overhead in general with lists and dictionaries. I read somewhere that python internally allocates enough space that the dictionary/list # of items to the power of 2. I'm new enough to python that I'm not sure if there are other unexpected internal complexities/suprises like that, that is not apparent to the average user that I should take into consideration. One of the difficulties is knowing how the power of 2 system counts "items"? Is each key:pair counted as 1 item? That's seems important to know because if you have a 100 item monolithic dictionary then space 100^2 items would be allocated. If you have 100 single item dictionaries (1 key:pair) then each dictionary would only be allocation 1^2 (aka no extra allocation)? Any clearly laid out information would be very helpful!
Memory efficiency: One large dictionary or a dictionary of smaller dictionaries?
1
0
0
31,141
671,403
2009-03-22T18:27:00.000
1
0
1
0
python,memory,dictionary,performance
671,454
7
false
0
0
Often times, dictionaries of dictionaries are useful for other than performance reasons. ie, they allow you to store context information about the data without having extra fields on the objects themselves, and make querying subsets of the data faster. In terms of memory usage, it would stand to reason that one large dictionary will use less ram than multiple smaller ones. Remember, if you're nesting dictionaries, each additional layer of nesting will roughly double the number of dictionaries you need to allocate. In terms of query speed, multiple dicts will take longer due to the increased number of lookups required. So I think the only way to answer this question is for you to profile your own code. However, my suggestion is to use the method that makes your code the cleanest and easiest to maintain. Of all the features of Python, dictionaries are probably the most heavily tweaked for optimal performance.
5
38
0
I'm writing an application in Python (2.6) that requires me to use a dictionary as a data store. I am curious as to whether or not it is more memory efficient to have one large dictionary, or to break that down into many (much) smaller dictionaries, then have an "index" dictionary that contains a reference to all the smaller dictionaries. I know there is a lot of overhead in general with lists and dictionaries. I read somewhere that python internally allocates enough space that the dictionary/list # of items to the power of 2. I'm new enough to python that I'm not sure if there are other unexpected internal complexities/suprises like that, that is not apparent to the average user that I should take into consideration. One of the difficulties is knowing how the power of 2 system counts "items"? Is each key:pair counted as 1 item? That's seems important to know because if you have a 100 item monolithic dictionary then space 100^2 items would be allocated. If you have 100 single item dictionaries (1 key:pair) then each dictionary would only be allocation 1^2 (aka no extra allocation)? Any clearly laid out information would be very helpful!
Memory efficiency: One large dictionary or a dictionary of smaller dictionaries?
0.028564
0
0
31,141
671,741
2009-03-22T22:49:00.000
1
0
0
0
python,user-interface,sqlite,gtk,glade
691,567
8
false
0
1
There is a good book on wxPython, "wxPython in Action", which can't be said for some of the other solutions. No knock on the others. I've had success developing with wxPython in the past and it comes with a great set of demo applications with source code from which you can borrow liberally. The best UI designer I found for wxPython applications is a commercial one, Anthemion DialogBlocks. It's by one of the wxPython programmers and is worth the money. Other solutions for UI design include wxGlade (I found it usable but not featureful) and Boa Constructor (haven't used it). Wing IDE might also have one. Stani's Python Editor bundles wxGlade, I believe. There are a lot of other projects that don't really work or are fairly old. As far as SQL automation goes, as another answerer says, I'd look at SQL alchemy, but the learning curve for a small application might be too much and you'd be better off just going straight to odbc. The best odbc api is the one used by Django, pyodbc. It's been a while since I developed with these tools, so there may be something newer for each, but at the time these were definitely the best of breed in my opinion.
3
7
0
I am writing editing front ends in Python since several years now, and I am fed up with micromanaging every UI detail of a window or dialog every single time. Is there a technology that allows me to, say, specify the relations between a GTK+ Glade-designed interface and the tables and records of an SQLite database to do all the middle man work? It should spare me the work of manually writing event handlers, input evaluators and view updates. The technologies in question are just examples, but I want to stick with Python as far as possible.
Is there a Python library that allows to build user interfaces without writing much code?
0.024995
0
0
1,574
671,741
2009-03-22T22:49:00.000
0
0
0
0
python,user-interface,sqlite,gtk,glade
678,000
8
false
0
1
I had lots of success with wxPython, but that was some years ago now and there may be better new solutions...
3
7
0
I am writing editing front ends in Python since several years now, and I am fed up with micromanaging every UI detail of a window or dialog every single time. Is there a technology that allows me to, say, specify the relations between a GTK+ Glade-designed interface and the tables and records of an SQLite database to do all the middle man work? It should spare me the work of manually writing event handlers, input evaluators and view updates. The technologies in question are just examples, but I want to stick with Python as far as possible.
Is there a Python library that allows to build user interfaces without writing much code?
0
0
0
1,574
671,741
2009-03-22T22:49:00.000
4
0
0
0
python,user-interface,sqlite,gtk,glade
671,752
8
false
0
1
PyQt and its models can automate some of these tasks for you (to some amount off course, e.g. filling widgets with data from a database and handling most of the widgets behaviour, buffering etc.). If you want a more object-oriented approach to handling SQL you could look into an ORM-oriented solution (for example SQLAlchemy).
3
7
0
I am writing editing front ends in Python since several years now, and I am fed up with micromanaging every UI detail of a window or dialog every single time. Is there a technology that allows me to, say, specify the relations between a GTK+ Glade-designed interface and the tables and records of an SQLite database to do all the middle man work? It should spare me the work of manually writing event handlers, input evaluators and view updates. The technologies in question are just examples, but I want to stick with Python as far as possible.
Is there a Python library that allows to build user interfaces without writing much code?
0.099668
0
0
1,574
672,781
2009-03-23T09:59:00.000
3
1
1
0
java,python,design-patterns,programming-languages,dynamic-typing
672,806
2
false
0
0
I've been using Python as distributed computing framework in one of the worlds largest banks. It was chosen because: It had to be extremely fast for developing and deploying new functionalities; It had to be easily integrable with C and C++; Some parts of the code were to be written by people whose area of expertise was mathematical modeling, not software development.
2
7
0
I'm a somewhat advanced C++/Java Developer who recently became interested in Python and I enjoy its dynamic typing and efficient coding style very much. I currently use it on my small programming needs like solving programming riddles and scripting, but I'm curious if anyone out there has successfully used Python in an enterprise-quality project? (Preferably using modern programming concepts such as OOP and some type of Design Pattern) If so, would you please explain why you chose Python (specifically) and give us some of the lessons you learned from this project? (Feel free to compare the use of Python in the project vs Java or etc)
Python Programming - Rules/Advice for developing enterprise-level software in Python?
0.291313
0
0
1,839
672,781
2009-03-23T09:59:00.000
17
1
1
0
java,python,design-patterns,programming-languages,dynamic-typing
672,975
2
true
0
0
I'm using Python for developing a complex insurance underwriting application. Our application software essentially repackages our actuarial model in a form that companies can subscribe to it. This business is based on our actuaries and their deep thinking. We're not packaging a clever algorithm that's relatively fixed. We're renting our actuarial brains to customers via a web service. The actuaries must be free to make changes as they gain deeper insight into the various factors that lead to claims. Static languages (Java, C++, C#) lead to early lock-in to a data model. Python allows us to have a very flexible data model. They're free to add, change or delete factors or information sources without a lot of development cost and complexity. Duck typing allows us to introduce new pieces without a lot rework. Our software is a service (not a package) so we have an endless integration problem. Static languages need complex mapping components. Often some kind of configurable, XML-driven mapping from customer messages to our ever-changing internal structures. Python allows us to have the mappings as a simple Python class definition that we simply tweak, test and put into production. There are no limitations on this module -- it's first-class Python code. We have to do extensive, long-running proof-of-concept. These involve numerous "what-if" scenarios with different data feeds and customized features. Static languages require a lot of careful planning and thinking to create yet another demo, yet another mapping from yet another customer-supplied file to the current version of our actuarial models. Python requires much less planning. Duck typing (and Django) let us knock out a demo without very much pain. The data mappings are simple python class definitions; our actuarial models are in a fairly constant state of flux. Our business model is subject to a certain amount of negotiation. We have rather complex contracts with information providers; these don't change as often as the actuarial model, but changes here require customization. Static languages bind in assumptions about the contracts, and require fairly complex designs (or workarounds) to handle the brain-farts of the business folks negotiating the deals. In Python, we use an extensive test suite and do a lot of refactoring as the various contract terms and conditions trickle down to us. Every week we get a question like "Can we handle a provision like X?" Our standard answer is "Absolutely." Followed by an hour of refactoring to be sure we could handle it if the deal was struck in that form. We're mostly a RESTful web service. Django does a lot of this out of the box. We had to write some extensions because our security model is a bit more strict than the one provided by Django. Static languages don't have to ship source. Don't like the security model? Pay the vendor $$$. Dynamic languages must ship as source. In our case, we spend time reading the source of Django carefully to make sure that our security model fits cleanly with the rest of Django. We don't need HIPAA compliance, but we're building it in anyway. We use web services from information providers. urllib2 does this for us nicely. We can prototype an interface rapidly. With a static language, you have API's, you write, you run, and you hope it worked. The development cycle is Edit, Compile, Build, Run, Crash, Look at Logs; and this is just to spike the interface and be sure we have the protocol, credentials and configuration right. We exercise the interface in interactive Python. Since we're executing it interactively, we can examine the responses immediately. The development cycle is reduced to Run, Edit. We can spike a web services API in an afternoon.
2
7
0
I'm a somewhat advanced C++/Java Developer who recently became interested in Python and I enjoy its dynamic typing and efficient coding style very much. I currently use it on my small programming needs like solving programming riddles and scripting, but I'm curious if anyone out there has successfully used Python in an enterprise-quality project? (Preferably using modern programming concepts such as OOP and some type of Design Pattern) If so, would you please explain why you chose Python (specifically) and give us some of the lessons you learned from this project? (Feel free to compare the use of Python in the project vs Java or etc)
Python Programming - Rules/Advice for developing enterprise-level software in Python?
1.2
0
0
1,839
673,434
2009-03-23T13:51:00.000
3
0
0
0
python,user-interface,opengl,gtk,cairo
673,447
2
false
0
1
Qt has this covered... check PyQt
1
3
0
My next work is going to be heavily focused on working with data that is best understood when organized on a two-dimensional zoomable plane or canvas, instead of using lists and property forms. The library can be based on OpenGL, GTK+ or Cairo. It should allow me to: build widgets out of vector shapes and text (perhaps even SVG based?) arrange these widgets on a 2D plane catch widget-related events zoom deeply into a widget to reveal additional data arrange widgets in a tree animate widgets fluidly It wouldn't hurt if it would also allow for some databinding or model/view concept.
Is there a Python library for easily writing zoomable UI's?
0.291313
0
0
802
673,725
2009-03-23T15:00:00.000
1
1
1
0
jquery,python,css,xhtml,python-imaging-library
673,958
4
false
1
0
I assume you got Python on the server side. The best way imo is to somehow 'get' all the editing parameters from the client, then re-render it using PIL. Update: How I will do it On the server side, you need an url to handle posts. On the client side, (after each edit, )send a post to that url, with the editing parameters. I think there is not an easy solution to this. Maybe if you don't use PIL to render the final image, but only remember the parameters, each view from clients can render itself?
2
1
0
I want to enable a user on a website to upload an image, and write some text over it. Also, they should be able to crop/scale/move the image and text. For that stuff, I can do it in jQuery. After they've made the image the way they want it, is there a way i can take a screenshot of that image (using PiL) and save it on the server? What is the best/proper way to do this?
Using PiL to take a screenshot of HTML/CSS
0.049958
0
0
1,584
673,725
2009-03-23T15:00:00.000
0
1
1
0
jquery,python,css,xhtml,python-imaging-library
674,283
4
false
1
0
Well, even if others are trying to discourage you from doing this, it would probably not be that hard. On the client-side, you, you define a div that is floated/resizable over the image, with transparency, that can be scaled for the crop. Move, I assume it applies only to the text, so you dynamically create draggable spans on the client side, still easy. Scale, I have no Idea of a simple UI to do it. When you want to update your Image, you serialize your data (position of your cropping div and position of your text spans / scaling, relative to the position to the image.) Then, using json or anything similar you'd like, you transfer the data to the server. Then, on the server, using python/PIL, you reproduce the transformations that you have serialized.
2
1
0
I want to enable a user on a website to upload an image, and write some text over it. Also, they should be able to crop/scale/move the image and text. For that stuff, I can do it in jQuery. After they've made the image the way they want it, is there a way i can take a screenshot of that image (using PiL) and save it on the server? What is the best/proper way to do this?
Using PiL to take a screenshot of HTML/CSS
0
0
0
1,584
673,970
2009-03-23T16:00:00.000
1
0
0
0
python,django,django-admin,django-templates,django-forms
680,830
1
false
1
0
Try Django 1.1 beta. It's got the option to make items in the changelist editable (as well as incorporating the django-batchadmin project)
1
1
0
Basically I want to have an editable form for related entries instead of a static listing.
How can I make the Django contrib Admin change list for a particular model class editable with drop downs for related items displayed in the listing?
0.197375
0
0
197
674,030
2009-03-23T16:16:00.000
0
0
0
0
python,django,django-syncdb
21,254,637
3
false
1
0
Strange here too, but simply restarting the PostgreSQL service (or server) solved it. I'd tried manually pasting the table creation code in psql too, but that wasn't solving it either (well, no way it could if it was a lock thing) - so I just used the restart: systemctl restart postgresql.service that's on my Suse box. Am not sure whether reloading the service/server might lift existing table locks too?
3
3
0
I've added new models and pushed to our staging server, run syncdb to create their tables, and it locks up. It gets as far as 'Create table photos_photousertag' and postgres output shows the notice for creation of 'photos_photousertag_id_seq', but otherwise i get nothing on either said. I can't ctrl+c the syncdb process and I have no indication of what route to take from here. Has anyone else ran into this?
Django syncdb locking up on table creation
0
1
0
985
674,030
2009-03-23T16:16:00.000
1
0
0
0
python,django,django-syncdb
10,438,955
3
false
1
0
I just experienced this as well, and it turned out to just be a plain old lock on that particular table, unrelated to Django. Once that cleared the sync went through just fine. Try querying the table that the sync is getting stuck on and make sure that's working correctly first.
3
3
0
I've added new models and pushed to our staging server, run syncdb to create their tables, and it locks up. It gets as far as 'Create table photos_photousertag' and postgres output shows the notice for creation of 'photos_photousertag_id_seq', but otherwise i get nothing on either said. I can't ctrl+c the syncdb process and I have no indication of what route to take from here. Has anyone else ran into this?
Django syncdb locking up on table creation
0.066568
1
0
985
674,030
2009-03-23T16:16:00.000
1
0
0
0
python,django,django-syncdb
674,105
3
false
1
0
We use postgres, and while we've not run into this particular issue, there are some steps you may find helpful in debugging: a. What version of postgres and psycopg2 are you using? For that matter, what version of django? b. Try running the syncdb command with the "--verbosity=2" option to show all output. c. Find the SQL that django is generating by running the "manage.py sql " command. Run the CREATE TABLE statements for your new models in the postgres shell and see what develops. d. Turn the error logging, statement logging, and server status logging on postgres way up to see if you can catch any particular messages. In the past, we've usually found that either option b or option c points out the problem.
3
3
0
I've added new models and pushed to our staging server, run syncdb to create their tables, and it locks up. It gets as far as 'Create table photos_photousertag' and postgres output shows the notice for creation of 'photos_photousertag_id_seq', but otherwise i get nothing on either said. I can't ctrl+c the syncdb process and I have no indication of what route to take from here. Has anyone else ran into this?
Django syncdb locking up on table creation
0.066568
1
0
985
674,229
2009-03-23T16:58:00.000
17
0
1
0
python,indexing,list
674,250
10
true
0
0
Because -1 is itself a valid index. It could use a different value, such as None, but that wouldn't be useful, which -1 can be in other situations (thus str.find()), and would amount simply to error-checking, which is exactly what exceptions are for.
5
26
0
Why does list.index throw an exception, instead of using an arbitrary value (for example, -1)? What's the idea behind this? To me it looks cleaner to deal with special values, rather than exceptions. EDIT: I didn't realize -1 is a potentially valid value. Nevertheless, why not something else? How about a value of None?
Python list.index throws exception when index not found
1.2
0
0
22,838
674,229
2009-03-23T16:58:00.000
0
0
1
0
python,indexing,list
674,277
10
false
0
0
It's a semantic argument. If you want to know the index of an element, you are claiming that it already exists in the list. If you want to know whether or not it exists, you should use in.
5
26
0
Why does list.index throw an exception, instead of using an arbitrary value (for example, -1)? What's the idea behind this? To me it looks cleaner to deal with special values, rather than exceptions. EDIT: I didn't realize -1 is a potentially valid value. Nevertheless, why not something else? How about a value of None?
Python list.index throws exception when index not found
0
0
0
22,838
674,229
2009-03-23T16:58:00.000
0
0
1
0
python,indexing,list
674,262
10
false
0
0
One simple idea: -1 is perfectly usable as an index (as are other negative values).
5
26
0
Why does list.index throw an exception, instead of using an arbitrary value (for example, -1)? What's the idea behind this? To me it looks cleaner to deal with special values, rather than exceptions. EDIT: I didn't realize -1 is a potentially valid value. Nevertheless, why not something else? How about a value of None?
Python list.index throws exception when index not found
0
0
0
22,838