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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,358,759 | 2010-07-29T01:04:00.000 | 1 | 0 | 1 | 0 | python,installation,error-handling,pyqt,packages | 3,358,864 | 1 | true | 0 | 1 | The distutils model handles installing a python app correctly, or there is a third party setuptools package that is even easier for end users. | 1 | 0 | 0 | What's a good way to handle fatal errors - missing packages, .ui files not compiled, Qt DLLs or shared objects not found, etc. - in a PyQt app (or other Python app)?
Displaying a cross-platform message box without Qt DLLs or shared objects seems like a lot of work. Dumping a message to the console seems not very helpf... | Handling missing packages or DLLs in a PyQt app | 1.2 | 0 | 0 | 67 |
3,359,214 | 2010-07-29T03:04:00.000 | 0 | 0 | 0 | 0 | python,mysql,django | 3,359,618 | 4 | false | 1 | 0 | An index wouldn't help as them main problem I believe is not so much getting the sorted list as having a DB write with every page view of an article. Another index actually makes that problem worse, albeit only a little.
So I'd go with the cache. I think django's cache shim is a problem here because it requires timeout... | 3 | 2 | 0 | I'm creating a Django-powered site for my newspaper-ish site. The least obvious and common-sense task that I have come across in getting the site together is how best to generate a "top articles" list for the sidebar of the page.
The first thing that came to mind was some sort of database column that is updated (based... | Dynamically Created Top Articles List in Django? | 0 | 0 | 0 | 117 |
3,359,214 | 2010-07-29T03:04:00.000 | 0 | 0 | 0 | 0 | python,mysql,django | 3,359,569 | 4 | false | 1 | 0 | If you do something like sort by top views, it would be fast if you index the view column in the DB. Another option is to only collect the top x articles every hour or so, and toss that value into Django's cache framework.
The nice thing about caching the list is that the algorithm you use to determine top articles ... | 3 | 2 | 0 | I'm creating a Django-powered site for my newspaper-ish site. The least obvious and common-sense task that I have come across in getting the site together is how best to generate a "top articles" list for the sidebar of the page.
The first thing that came to mind was some sort of database column that is updated (based... | Dynamically Created Top Articles List in Django? | 0 | 0 | 0 | 117 |
3,359,214 | 2010-07-29T03:04:00.000 | 1 | 0 | 0 | 0 | python,mysql,django | 3,361,120 | 4 | false | 1 | 0 | Premature optimization, first try the db way and then see if it really is too database sensitive. Any decent database has so good caches it probably won't matter very much. And even if it is a problem, take a look at the other db/cache suggestions here.
It is most likely by the way is that you will have many more inte... | 3 | 2 | 0 | I'm creating a Django-powered site for my newspaper-ish site. The least obvious and common-sense task that I have come across in getting the site together is how best to generate a "top articles" list for the sidebar of the page.
The first thing that came to mind was some sort of database column that is updated (based... | Dynamically Created Top Articles List in Django? | 0.049958 | 0 | 0 | 117 |
3,362,859 | 2010-07-29T13:18:00.000 | 6 | 0 | 0 | 0 | javascript,python,screen-scraping | 3,364,608 | 6 | false | 1 | 0 | I would actually suggest using Selenium. Its mainly designed for testing Web-Applications from a "user perspective however it is basically a "FireFox" driver. I've actually used it for this purpose ... although I was scraping an dynamic AJAX webpage. As long as the Javascript form has a recognizable "Anchor Text" th... | 1 | 17 | 0 | I'm trying to scrape and submit information to websites that heavily rely on Javascript to do most of its actions. The website won't even work when i disable Javascript in my browser.
I've searched for some solutions on Google and SO and there was someone who suggested i should reverse engineer the Javascript, but i ha... | Scraping websites with Javascript enabled? | 1 | 0 | 1 | 23,351 |
3,363,167 | 2010-07-29T13:47:00.000 | 3 | 1 | 0 | 0 | python,error-handling,bottle | 3,393,377 | 2 | false | 1 | 0 | in the error500 function written after the @error decorator to serve my customized error page, wrote error.exception and error.traceback, these two give the exception and complete traceback of the error message. | 1 | 2 | 0 | I am using the Bottle framework. I have set the @error decorator so I am able to display my customized error page, and i can also send email if any 500 error occurs, but I need the complete traceback to be sent in the email. Does anyone know how to have the framework include that in the e-mail? | E-mail traceback on errors in Bottle framework | 0.291313 | 0 | 0 | 894 |
3,363,831 | 2010-07-29T14:55:00.000 | 1 | 0 | 0 | 1 | python,process | 3,363,869 | 4 | false | 0 | 0 | The daemon could have an open (network) socket, where it accepts commands.
It could monitor changes in a file.
Any other kind of signalling is possible, but these would probably be the most common. | 1 | 5 | 0 | I have a python program that is running as a daemon on Linux.
How to send this daemon a signal from another python program? | communication between python programs | 0.049958 | 0 | 0 | 4,184 |
3,366,499 | 2010-07-29T20:05:00.000 | 2 | 0 | 1 | 0 | python,notepad++,indentation | 30,389,815 | 6 | false | 0 | 0 | Tiny update - to get spaces as tabs, you now go to Settings>>Preferences>>Tab Settings and check the "Replace by space" box | 4 | 50 | 0 | I'm coding in Python and I really like Notepad++. However, off late when I use tab to indent, it seems fine in Notepad++, but when I run the program I get an indentation error, and when I check my code in Emacs or something, I find that Notepad++ actually adds more tab spaces than it shows on screen. What is happening? | Notepad++ indentation messes up | 0.066568 | 0 | 0 | 64,168 |
3,366,499 | 2010-07-29T20:05:00.000 | 106 | 0 | 1 | 0 | python,notepad++,indentation | 3,366,550 | 6 | true | 0 | 0 | There is no universal tab size, so I always make sure to replace tabs by spaces (so you know what you see is what you get everywhere else as well)
Go to Settings -> "Preferences..." -> Language Menu/Tab Settings and check 'Replace by space' | 4 | 50 | 0 | I'm coding in Python and I really like Notepad++. However, off late when I use tab to indent, it seems fine in Notepad++, but when I run the program I get an indentation error, and when I check my code in Emacs or something, I find that Notepad++ actually adds more tab spaces than it shows on screen. What is happening? | Notepad++ indentation messes up | 1.2 | 0 | 0 | 64,168 |
3,366,499 | 2010-07-29T20:05:00.000 | 42 | 0 | 1 | 0 | python,notepad++,indentation | 3,366,526 | 6 | false | 0 | 0 | I would suggest going to View > Show Symbol > Show Whitespace and Tab to get an better idea of how your indentations look. | 4 | 50 | 0 | I'm coding in Python and I really like Notepad++. However, off late when I use tab to indent, it seems fine in Notepad++, but when I run the program I get an indentation error, and when I check my code in Emacs or something, I find that Notepad++ actually adds more tab spaces than it shows on screen. What is happening? | Notepad++ indentation messes up | 1 | 0 | 0 | 64,168 |
3,366,499 | 2010-07-29T20:05:00.000 | 2 | 0 | 1 | 0 | python,notepad++,indentation | 32,338,760 | 6 | false | 0 | 0 | I am new to python and started using Notepad++. But I faced the same issue as you... Indentation problems. On my senior's advice, I switched to PyCharm community edition. I pasted the code from Notepad++ to PyCharm and it highlighted the block with indentation problems... The issue was that, some of the lines used spac... | 4 | 50 | 0 | I'm coding in Python and I really like Notepad++. However, off late when I use tab to indent, it seems fine in Notepad++, but when I run the program I get an indentation error, and when I check my code in Emacs or something, I find that Notepad++ actually adds more tab spaces than it shows on screen. What is happening? | Notepad++ indentation messes up | 0.066568 | 0 | 0 | 64,168 |
3,367,808 | 2010-07-29T23:41:00.000 | 5 | 0 | 1 | 0 | python,mobile | 3,367,841 | 2 | false | 0 | 0 | No. Python is an excellent language, but there is nothing about it makes it especially preferred for mobile development. | 2 | 1 | 0 | a lot of my friends are using Python to build their mobile applications and games.
is python the preferred language for mobile applications for developers? if so, why? | is python the preferred language for mobile applications? | 0.462117 | 0 | 0 | 3,114 |
3,367,808 | 2010-07-29T23:41:00.000 | 3 | 0 | 1 | 0 | python,mobile | 3,367,854 | 2 | true | 0 | 0 | No, there is no preferred language for mobile development. Each mobile platform has its own supported language or set of supported languages. Android is programmed primarily with Java (although development in C++ and Python are also supported), while the iPhone is programmed with Objective-C. A common theme in mobile i... | 2 | 1 | 0 | a lot of my friends are using Python to build their mobile applications and games.
is python the preferred language for mobile applications for developers? if so, why? | is python the preferred language for mobile applications? | 1.2 | 0 | 0 | 3,114 |
3,367,986 | 2010-07-30T00:37:00.000 | 0 | 0 | 0 | 0 | python,wxpython,hide | 22,358,518 | 3 | false | 0 | 1 | statictext.Show to show
and
statictext.Hide to hide | 3 | 4 | 0 | I was wondering how to hide/delete a StaticText in wxPython? | Hide/Delete a StaticText in wxPython | 0 | 0 | 0 | 3,670 |
3,367,986 | 2010-07-30T00:37:00.000 | 5 | 0 | 0 | 0 | python,wxpython,hide | 3,368,074 | 3 | true | 0 | 1 | Have you tried control.Hide() or control.Show(False)? | 3 | 4 | 0 | I was wondering how to hide/delete a StaticText in wxPython? | Hide/Delete a StaticText in wxPython | 1.2 | 0 | 0 | 3,670 |
3,367,986 | 2010-07-30T00:37:00.000 | 5 | 0 | 0 | 0 | python,wxpython,hide | 3,371,640 | 3 | false | 0 | 1 | The widget's Hide/Show methods should work. If the widget is in a sizer, then you can use the sizer's Detach method to "hide" it but not destroy it. Otherwise, the sizer has a Remove method that will remove the widget and destroy it. And there's the widget's own Destroy method. | 3 | 4 | 0 | I was wondering how to hide/delete a StaticText in wxPython? | Hide/Delete a StaticText in wxPython | 0.321513 | 0 | 0 | 3,670 |
3,368,459 | 2010-07-30T03:02:00.000 | 0 | 0 | 1 | 1 | python | 3,368,490 | 3 | false | 0 | 0 | If it's not in site-packages then you can add a file with the extension .pth to your site-packages directory.
The file should have one path per line, that you want included in sys.path | 1 | 1 | 0 | I have been programming in Python for a while now, and have created some utilities that I use a lot. Whenever I start a new project, I start writing, and as I need these utilities I copy them from where ever I think the latest version of the particular utility is. I have enough projects now that I am losing track of ... | How do I setup python to always include my directory of utility files | 0 | 0 | 0 | 147 |
3,368,740 | 2010-07-30T04:43:00.000 | 6 | 0 | 0 | 0 | python,image-processing,python-imaging-library | 3,368,847 | 2 | true | 0 | 0 | You would be much better off using the EXTENT rather than the AFFINE method. You only need to calculate two things: what part of the input you want to see, and how large it should be. For example, if you want to see the whole image scaled down to half size (i.e. zooming out by 2), you'd pass the data (0, 0, im.size[0],... | 1 | 7 | 1 | I'm writing a simple application in Python which displays images.I need to implement Zoom In and Zoom Out by scaling the image.
I think the Image.transform method will be able to do this, but I'm not sure how to use it, since it's asking for an affine matrix or something like that :P
Here's the quote from the docs:
im... | Zooming With Python Image Library | 1.2 | 0 | 0 | 7,941 |
3,369,073 | 2010-07-30T06:16:00.000 | 0 | 0 | 0 | 0 | python,browser,webbrowser-control | 3,370,550 | 6 | false | 0 | 0 | Depends what do you actually want to achieve. If you need to do some automatic stuff w/out user interference, you can just use underlying engine of the browser, like Gecko or WebKit, w/out loading browser itself. There are ready Python bindings to these engines available.
Browsers themself do not provide this kind of A... | 2 | 27 | 0 | Is it possible to control a web browser like Firefox using Python?
I would want to do things like
launch the browser
force clicks on URLs
take screenshots
etc. | Controlling Browser using Python? | 0 | 0 | 1 | 50,784 |
3,369,073 | 2010-07-30T06:16:00.000 | 1 | 0 | 0 | 0 | python,browser,webbrowser-control | 3,370,579 | 6 | false | 0 | 0 | Ag great way to control a browser in Python is to use PyQt4.QtWebKit. | 2 | 27 | 0 | Is it possible to control a web browser like Firefox using Python?
I would want to do things like
launch the browser
force clicks on URLs
take screenshots
etc. | Controlling Browser using Python? | 0.033321 | 0 | 1 | 50,784 |
3,369,080 | 2010-07-30T06:17:00.000 | 1 | 1 | 0 | 1 | python,centos | 3,369,157 | 3 | false | 0 | 0 | you can use cgi, but that will not have great performance as it starts a new process for each request.
More efficient alternatives are to use fastcgi or wsgi
A third option is to run a mini Python webserver and proxy the requests from apache using rewrite rules | 1 | 0 | 0 | I'm a LAMP developer trying out Python for the first time.. I'm okay with picking up the syntax, but I can't figure out how to run it on the server! I've tried the following
uploading filename.py to a regular web/public directory. chmod 777, 711, 733, 773... (variations of execute)
putting the filename.py in cgi-bin, ... | Running a .py file on LAMP (CentOS) server - from a PHP developer's perspective | 0.066568 | 0 | 0 | 5,711 |
3,369,640 | 2010-07-30T08:02:00.000 | 0 | 0 | 1 | 0 | python,oop | 3,369,782 | 4 | false | 0 | 0 | Its usually used when class is used as function with some instance context, like some DecoratorClass which would be used as @DecoratorClass('some param'), so 'some param' would be stored in the instance's namespace and then instance being called as actual decorator.
It is not very useful when your class provides some d... | 4 | 32 | 0 | What are peoples' opinions on using the __call__. I've only very rarely seen it used, but I think it's a very handy tool to use when you know that a class is going to be used for some default behaviour. | When is using __call__ a good idea? | 0 | 0 | 0 | 4,325 |
3,369,640 | 2010-07-30T08:02:00.000 | 33 | 0 | 1 | 0 | python,oop | 3,369,912 | 4 | true | 0 | 0 | I think your intuition is about right.
Historically, callable objects (or what I've sometimes heard called "functors") have been used in the OO world to simulate closures. In C++ they're frequently indispensable.
However, __call__ has quite a bit of competition in the Python world:
A regular named method, whose behavi... | 4 | 32 | 0 | What are peoples' opinions on using the __call__. I've only very rarely seen it used, but I think it's a very handy tool to use when you know that a class is going to be used for some default behaviour. | When is using __call__ a good idea? | 1.2 | 0 | 0 | 4,325 |
3,369,640 | 2010-07-30T08:02:00.000 | 0 | 0 | 1 | 0 | python,oop | 3,369,712 | 4 | false | 0 | 0 | More generally, Python has a lot of double-underscore methods. They're there for a reason: they are the Python way of overloading operators. For instance, if you want a new class in which addition, I don't know, prints "foo", you define the __add__ and __radd__ methods. There's nothing inherently good or bad about this... | 4 | 32 | 0 | What are peoples' opinions on using the __call__. I've only very rarely seen it used, but I think it's a very handy tool to use when you know that a class is going to be used for some default behaviour. | When is using __call__ a good idea? | 0 | 0 | 0 | 4,325 |
3,369,640 | 2010-07-30T08:02:00.000 | 3 | 0 | 1 | 0 | python,oop | 3,369,658 | 4 | false | 0 | 0 | Use it if you need your objects to be callable, that's what it's there for
I'm not sure what you mean by default behaviour
One place I have found it particularly useful is when using a wrapper or somesuch where the object is called deep inside some framework/library. | 4 | 32 | 0 | What are peoples' opinions on using the __call__. I've only very rarely seen it used, but I think it's a very handy tool to use when you know that a class is going to be used for some default behaviour. | When is using __call__ a good idea? | 0.148885 | 0 | 0 | 4,325 |
3,371,008 | 2010-07-30T11:28:00.000 | 1 | 0 | 1 | 0 | python,window | 3,371,085 | 1 | true | 0 | 0 | Ohh, I found the solution by repairing the Python 2.6 installation. | 1 | 0 | 0 | What information about Python 2.6 stored in the Windows registry, under HKEY_LOCAL_MACHINE/SOFTWARE? Where is it stored?
Somehow I lost it in my regedit and can't install a module. I googled it, but I can't find any answer, and I don't have an extra computer to try and many modules that I need for my school project is... | How to store Python 2.6 value in regedit | 1.2 | 0 | 0 | 182 |
3,371,136 | 2010-07-30T11:50:00.000 | 15 | 0 | 1 | 0 | python,virtualenv | 58,513,801 | 6 | false | 0 | 0 | Go to your venv folder and open pyvenv.cfg. (E.g. if your virtual environment is called myenv then the file will be located at myenv\pyvenv.cfg)
You'll see a boolean setting called include-system-site-packages
Set that setting to true to use global packages
If you want to disable using global packages, just set that se... | 2 | 129 | 0 | I have created a virtualenv using the --no-site-packages option and installed lots of libraries. Now I would like to revert the --no-site-packages option and use also the global packages.
Can I do that without recreating the virtualenv?
More precisely:
I wonder what exactly happens when creating a virtualenv using the ... | Revert the `--no-site-packages` option with virtualenv | 1 | 0 | 0 | 22,256 |
3,371,136 | 2010-07-30T11:50:00.000 | 2 | 0 | 1 | 0 | python,virtualenv | 3,371,637 | 6 | false | 0 | 0 | Try adding a symlink between /virtualenv_root/lib/ and /path/to/desired/site-packages/ | 2 | 129 | 0 | I have created a virtualenv using the --no-site-packages option and installed lots of libraries. Now I would like to revert the --no-site-packages option and use also the global packages.
Can I do that without recreating the virtualenv?
More precisely:
I wonder what exactly happens when creating a virtualenv using the ... | Revert the `--no-site-packages` option with virtualenv | 0.066568 | 0 | 0 | 22,256 |
3,371,255 | 2010-07-30T12:10:00.000 | 3 | 1 | 1 | 0 | python,unit-testing,testing | 3,371,690 | 7 | false | 0 | 0 | nosetests is a brilliant solution for unit testing in Python. It supports both unittest based testcases and doctests, and gets you started with it with just a simple configuration file. | 1 | 545 | 0 | I completed my first proper project in Python and now my task is to write tests for it.
Since this is the first time I did a project, this is the first time I would be writing tests for it.
The question is, how do I start? I have absolutely no idea. Can anyone point me to some documentation/ tutorial/ link/ book that I... | Writing unit tests in Python: How do I start? | 0.085505 | 0 | 0 | 258,822 |
3,371,549 | 2010-07-30T12:51:00.000 | 0 | 0 | 0 | 0 | python,facebook,webkit,pyqt | 5,099,848 | 1 | true | 1 | 1 | I don't believe you can open an "authentication page" in a separate window under Facebook's terms (I used to work for Zynga, and we couldn't then, so I don't know how you'd achieve this now legally).
Second, you're looking into the QWebkit backwards I believe. From a UI perspective this is supposed to provide access t... | 1 | 4 | 0 | Are there any examples how to authenticate your desktop Facebook application using PyQT and embedded webkit?
This is to provide better user experience than opening Facebook authentication page in a separate browser window. | pyqt, webkit and facebook authentication? | 1.2 | 0 | 0 | 640 |
3,371,795 | 2010-07-30T13:19:00.000 | 1 | 0 | 0 | 0 | python,sql-server,pyodbc,freetds | 3,372,035 | 2 | false | 0 | 0 | You could always just convert it to Decimal when it comes back... | 1 | 0 | 0 | I am connecting to an MS SQL Server db from Python in Linux. I am connecting via pyodbc using the FreeTDS driver. When I return a money field from MSSQL it comes through as a float, rather than a Python Decimal.
The problem is with FreeTDS. If I run the exact same Python code from Windows (where I do not need to use... | FreeTDS translating MS SQL money type to python float, not Decimal | 0.099668 | 1 | 0 | 1,284 |
3,372,444 | 2010-07-30T14:30:00.000 | 0 | 0 | 0 | 0 | python,numpy,memory-management,profile | 3,374,079 | 5 | false | 0 | 0 | Can you just save/pickle some of the arrays to disk in tmp files when not using them? That's what I've had to do in the past with large arrays. Of course this will slow the program down, but at least it'll finish. Unless you need them all at once? | 1 | 27 | 1 | I have a program that contains a large number of objects, many of them Numpy arrays. My program is swapping miserably, and I'm trying to reduce the memory usage, because it actually can't finis on my system with the current memory requirements.
I am looking for a nice profiler that would allow me to check the amount of... | Profile Memory Allocation in Python (with support for Numpy arrays) | 0 | 0 | 0 | 4,821 |
3,372,774 | 2010-07-30T15:07:00.000 | 2 | 0 | 1 | 0 | python,multithreading | 3,372,837 | 2 | true | 1 | 0 | Usual approach for handling HTTP requests synchronously is to spawn (or re-use one in the pool) new thread for each request as soon as it comes.
However, python threads are not very good for HTTP, due to GIL and some i/o and other calls blocking whole app, including other threads.
You should look into multiprocessing ... | 1 | 5 | 0 | I have never written any code that uses threads.
I have a web application that accepts a POST request, and creates an image based on the data in the body of the request.
Would I want to spin off a thread for the image creation, as to prevent the server from hanging until the image is created? Is this an appropriate us... | When to thread? | 1.2 | 0 | 0 | 189 |
3,374,542 | 2010-07-30T18:59:00.000 | 1 | 0 | 1 | 1 | python | 3,374,587 | 5 | false | 0 | 0 | Do you mean that you enter script directly into the interactive python shall, or are you executing your .py file from the terminal by running something like python myscript.py? | 1 | 10 | 0 | Every time I make a change to a python script I have to reload python and re-import the module. Please advise how I can modify my scripts and run then without having to relaunch python in the terminal.
Thanks. | Need to restart python in Terminal every time a change is made to script | 0.039979 | 0 | 0 | 16,071 |
3,374,943 | 2010-07-30T20:02:00.000 | 2 | 0 | 1 | 0 | python,twisted,multiprocessing | 3,379,621 | 2 | false | 0 | 0 | There are two dimensions to this question: concurrency and distribution.
Concurrency: either Twisted or multiprocessing will do the job of concurrently handling fetching/parsing jobs. I'm not sure though where your premise of the "Twisted overhead" comes from. On the contrary, the multiprocessing path would incur much... | 1 | 1 | 0 | Got a situation where I'm going to be parsing websites. each site has to have it's own "parser" and possibly it's own way of dealing with cookies/etc..
I'm trying to get in my head which would be a better choice.
Choice I:
I can create a multiprocessing function, where the (masterspawn) app gets an input url, and in t... | question comparing multiprocessing vs twisted | 0.197375 | 0 | 1 | 815 |
3,375,913 | 2010-07-30T22:48:00.000 | 1 | 0 | 1 | 0 | python | 28,681,111 | 4 | true | 0 | 0 | There are times you want to ask whether an object is an Exception (for example, when you get the result of a task back from a celery type process). You can do that using:
isinstance(x, Exception) | 1 | 1 | 0 | is there a function that will return true if some_function returns an error? | python: is there an isError function? | 1.2 | 0 | 0 | 22,717 |
3,376,252 | 2010-07-31T00:24:00.000 | 2 | 1 | 1 | 0 | php,python,c,types | 3,376,298 | 7 | false | 0 | 0 | Many a book has been written about this sort of thing. There's an inherent tradeoff; with a weakly-typed language a lot of annoyances simply cease to be. For instance, in Python you never have to worry about dividing a float by an int; adding an int to a list; typing functions' arguments (did you know, OCaml has specia... | 3 | 17 | 0 | I'm a big fan of PHP and it's obviously a very weakly-typed language. I realize some of the benefits include the general independence of changing variable types on the fly and such.
What I'm wondering about are the drawbacks. What can you get out of a strongly-typed language like C that you otherwise can't get from a w... | What are the benefits (and drawbacks) of a weakly typed language? | 0.057081 | 0 | 0 | 11,418 |
3,376,252 | 2010-07-31T00:24:00.000 | 0 | 1 | 1 | 0 | php,python,c,types | 18,869,364 | 7 | false | 0 | 0 | You have to understand that PHP was created for the context of web applications. Everything in the context of the web is a string. Therefore it is very rare where strong typing would be beneficial. | 3 | 17 | 0 | I'm a big fan of PHP and it's obviously a very weakly-typed language. I realize some of the benefits include the general independence of changing variable types on the fly and such.
What I'm wondering about are the drawbacks. What can you get out of a strongly-typed language like C that you otherwise can't get from a w... | What are the benefits (and drawbacks) of a weakly typed language? | 0 | 0 | 0 | 11,418 |
3,376,252 | 2010-07-31T00:24:00.000 | 5 | 1 | 1 | 0 | php,python,c,types | 28,466,502 | 7 | false | 0 | 0 | I have been using both strong typed (like Java) and weak typed (like JavaScript) languages for some time now. What I have found is that the convenience of the weak typed languages are great for small applications. Unfortunately, as the application grows in size, it becomes impossible to manage. There becomes too muc... | 3 | 17 | 0 | I'm a big fan of PHP and it's obviously a very weakly-typed language. I realize some of the benefits include the general independence of changing variable types on the fly and such.
What I'm wondering about are the drawbacks. What can you get out of a strongly-typed language like C that you otherwise can't get from a w... | What are the benefits (and drawbacks) of a weakly typed language? | 0.141893 | 0 | 0 | 11,418 |
3,376,479 | 2010-07-31T02:08:00.000 | 0 | 0 | 0 | 0 | python,django,inheritance,inline,admin | 3,376,487 | 2 | false | 1 | 0 | All fields in the superclass also exist on the subclass, so having an explicit relation is unnecessary.
Model inheritance in Django is terrible. Don't use it. Python doesn't need it anyway. | 2 | 2 | 0 | Howdy. I'm working on migrating an internal system to Django and have run into a few wrinkles.
Intro
Our current system (a billing system) tracks double-entry bookkeeping while allowing users to enter data as invoices, expenses, etc.
Base Objects
So I have two base objects/models:
JournalEntry
JournalEntryItems
defin... | Django object extension / one to one relationship issues | 0 | 0 | 0 | 709 |
3,376,479 | 2010-07-31T02:08:00.000 | 1 | 0 | 0 | 0 | python,django,inheritance,inline,admin | 3,396,991 | 2 | true | 1 | 0 | First, inheriting from a model creates an automatic OneToOneField in the inherited model towards the parents so you don't need to add them. Remove them if you really want to use this form of model inheritance.
If you only want to share the member of the model, you can use Meta inheritance which will create the inherit... | 2 | 2 | 0 | Howdy. I'm working on migrating an internal system to Django and have run into a few wrinkles.
Intro
Our current system (a billing system) tracks double-entry bookkeeping while allowing users to enter data as invoices, expenses, etc.
Base Objects
So I have two base objects/models:
JournalEntry
JournalEntryItems
defin... | Django object extension / one to one relationship issues | 1.2 | 0 | 0 | 709 |
3,376,673 | 2010-07-31T03:34:00.000 | 1 | 0 | 0 | 0 | python,mysql,django | 3,377,350 | 2 | false | 1 | 0 | syncdb will not create a database for you -- it only creates tables that don't already exist in your schema. You need to:
Create a user to 'own' the database (root is a bad choice).
Create the database with that user.
Update the Django database settings with the correct database name, user, and password. | 1 | 0 | 0 | I set up Mysql5, mysql5-server and py26-mysql using Macports. I then started the mysql server and was able to start the prompt with mysql5
In my settings.py i changed database_engine to "mysql" and put "dev.db" in database_name.
I left the username and password blank as the database doesnt exist yet.
When I ran python ... | Django MySql setup | 0.099668 | 1 | 0 | 5,039 |
3,377,038 | 2010-07-31T06:05:00.000 | 1 | 0 | 1 | 0 | python,screen-capture | 10,981,323 | 2 | false | 0 | 0 | I think the best way to do this would be create a higher level interface to ffmpeg. Unless you want to write the code to deal with X11 and record the screen, then it would be the best option.
If you test it on various platforms, then give useful error messages on things like incompatible sound systems, where to get cer... | 1 | 1 | 0 | I'm learning Python now and I want to develop a screen capture tool in Python.How I can do this work? | How I can develop a screen-capture tool in Python | 0.099668 | 0 | 0 | 1,288 |
3,377,439 | 2010-07-31T08:52:00.000 | 2 | 0 | 0 | 0 | python,qt,qt4,pyqt | 12,565,371 | 2 | false | 0 | 1 | setDefaultTextColor(col) "Sets the color for unformatted text to col." The documentation is not clear about what "unformatted text" means. I think it means: "all portions of the contents of the item that have not been styled."
The contents is a QTextDocument.
You style a part of a document using a QTextCursor. You ca... | 1 | 10 | 0 | i have a scene with a multiple (QGraphicsTextItem)s, and i need to have control over their colors , so how to change a color of a QGraphicsTextItem ? is it possible anyway? i've been trying for 3 days until now . please help
thanks in advance | how to change the color of a QGraphicsTextItem | 0.197375 | 0 | 0 | 8,684 |
3,377,951 | 2010-07-31T11:50:00.000 | 2 | 0 | 0 | 1 | php,python,linux,server-push,publish-subscribe | 3,378,244 | 3 | false | 1 | 0 | If you know in advance you'll have a lot of subscribers (people/applications) that want notifications on a certain subject while on other hand you'll have few different subjects consider a pull technology anyway.
RSS, Atom are quite successful even though they use pull. The reason: no need to have an administration on ... | 1 | 3 | 0 | I would like to implement a mechanism which will provide a RESTful API that allows a client to register interest in a subject with a sever, and receive asynchronous notifications from the server after the interest is registered. In enterprise (messaging) architecture, this is known as publish/subscribe 'pattern'.
With ... | A scalable solution for server side push? | 0.132549 | 0 | 0 | 651 |
3,379,032 | 2010-07-31T17:03:00.000 | 0 | 0 | 0 | 1 | python,deployment | 3,379,058 | 2 | false | 0 | 0 | How do people usually deploy such apps?
2 choices.
With instructions.
All bundled up.
You write simple instructions like this. Folks can follow these pretty reliably, unless they don't have enough privileges. Sometimes they need to sudo in linux environments.
Download easy_install (or pip)
easy_install this, easy... | 1 | 2 | 0 | I've written an app in python that depends on wxPython and some other python libraries. I know about pyexe for making python scripts executable on Windows, but what would be the easiest way to share this with my Mac using friends who wouldn't know how to install the required dependencies? One option would be to bundle ... | Deploying python app to Mac and Windows users | 0 | 0 | 0 | 523 |
3,379,142 | 2010-07-31T17:37:00.000 | 3 | 0 | 1 | 0 | python,mysql | 3,380,170 | 2 | true | 0 | 0 | You can use the file command :
file `which python`
file `which mysql`
The file command is available on all UNIX-based systems. | 1 | 1 | 0 | How do I check if my python and mysql are 32 bit installations or 64 bit? | Python and MySQL compile version | 1.2 | 0 | 0 | 97 |
3,379,174 | 2010-07-31T17:43:00.000 | 3 | 1 | 1 | 0 | python,ruby,dynamic-languages | 3,379,213 | 7 | false | 0 | 0 | Learn [one of] these:
Ruby
Python
Clojure (a modern Lisp)
JavaScript (yes, this is a great dynamic language!)
Don't transition via a semi-dynamic, semi-Java language. Just jump in and try a dynamic language. In order to really understand what else is going on, you have to get out of the Java world by jumping in, not ... | 4 | 0 | 0 | After working for on JAVA for a long time now i feel like also learn some other language just for a change. This time i want to spend some time learning and reading one of the dynamic languages.
Which is the most appropriate one that covers most of the features offered by dynamic languages and the syntax which probab... | Which is the most preferred language to start with dynamic languages | 0.085505 | 0 | 0 | 367 |
3,379,174 | 2010-07-31T17:43:00.000 | 0 | 1 | 1 | 0 | python,ruby,dynamic-languages | 3,379,189 | 7 | false | 0 | 0 | Try Jython, if you like Java, this way you can both ;-) | 4 | 0 | 0 | After working for on JAVA for a long time now i feel like also learn some other language just for a change. This time i want to spend some time learning and reading one of the dynamic languages.
Which is the most appropriate one that covers most of the features offered by dynamic languages and the syntax which probab... | Which is the most preferred language to start with dynamic languages | 0 | 0 | 0 | 367 |
3,379,174 | 2010-07-31T17:43:00.000 | 2 | 1 | 1 | 0 | python,ruby,dynamic-languages | 3,379,188 | 7 | false | 0 | 0 | Ahah, nice troll :) (with ruby and python tags).
In my humble opinion, after trying many languages, my favorite is Ruby with Ruby on Rails. | 4 | 0 | 0 | After working for on JAVA for a long time now i feel like also learn some other language just for a change. This time i want to spend some time learning and reading one of the dynamic languages.
Which is the most appropriate one that covers most of the features offered by dynamic languages and the syntax which probab... | Which is the most preferred language to start with dynamic languages | 0.057081 | 0 | 0 | 367 |
3,379,174 | 2010-07-31T17:43:00.000 | 7 | 1 | 1 | 0 | python,ruby,dynamic-languages | 3,379,183 | 7 | false | 0 | 0 | Python is always fun.Go for it. | 4 | 0 | 0 | After working for on JAVA for a long time now i feel like also learn some other language just for a change. This time i want to spend some time learning and reading one of the dynamic languages.
Which is the most appropriate one that covers most of the features offered by dynamic languages and the syntax which probab... | Which is the most preferred language to start with dynamic languages | 1 | 0 | 0 | 367 |
3,379,440 | 2010-07-31T19:01:00.000 | 3 | 0 | 0 | 0 | java,python,jakarta-ee | 3,379,488 | 4 | false | 1 | 0 | Any language/framework is a good choice, if it is used properly by competent developers. Sometimes the best choice is the one with which your team is most familiar.
Given your client space though, if you want to move to a "higher productivity" framework, I suggest Grails. Its implemented in Groovy, which Java develop... | 1 | 8 | 0 | Can Python be a good alternative to a web app that would otherwise be developed with Java EE? If so, which Python web app framework(s) may be a good choice? Please see details about the app below. I've asked a few people individually about this, who have worked for a good amount of time on either or both of Java EE and... | Can Python be good alternative for web app that would otherwise be done in Java EE? | 0.148885 | 0 | 0 | 1,841 |
3,379,971 | 2010-07-31T22:09:00.000 | 4 | 0 | 1 | 0 | python,math | 3,379,975 | 2 | false | 0 | 0 | You can do it with integer arithmetic:
items_per_page = 10
number_of_pages = (x + items_per_page - 1) // items_per_page | 1 | 5 | 0 | If I have 177 items, and each page has 10 items that means I'll have 18 pages.
I'm new to python and having used any of the math related functions.
How can I calculate 177/10 and then get round up so I get 18 and not 17.7 | Calculation to get page count based on # of items | 0.379949 | 0 | 0 | 1,287 |
3,380,986 | 2010-08-01T06:20:00.000 | 0 | 0 | 0 | 0 | python,user-interface,windows-xp,wxpython | 3,380,995 | 1 | false | 0 | 1 | If you have python win32 installed, then look under the directory <PYTHON>/lib/site-packages/win32comext/shell/demos/servers. This contains a file context_menu.py which has sample code for creating a shell extension.
Update: I think you want the folder_view.py sample. | 1 | 0 | 0 | I have a WxPython app that, among other things, has a integrated file-browser.
I want to be able to create a system-default file context menu (e.g. what you get if you right-click on a file in windows explorer) when a user right clicks on one of the items within my application.
Note: I already know how to create my own... | Create Explorer.exe's File - Context Menu in WxPython application | 0 | 0 | 0 | 741 |
3,382,390 | 2010-08-01T14:36:00.000 | 2 | 0 | 0 | 0 | php,python,html,django | 3,382,449 | 2 | true | 1 | 0 | I see no problem with such setup, using lightweight frontend is recommended for django (or any other wsgi app) anyway. Although you should serve static html with nginx itself, not django. | 1 | 1 | 0 | I have a project coming up for client who is basically happy with how he manages his website. It's lots of HTML files (around 300 of them) that he insists on keeping flat HTML files so can easily edit and manage them using Dreamweaver. His site has a lot of traffic and so I'm looking into options of keeping things simp... | Combining static HTML, a Django backend and a PHP forum on one server? | 1.2 | 0 | 0 | 1,097 |
3,382,739 | 2010-08-01T16:20:00.000 | 2 | 0 | 0 | 0 | python,sqlalchemy | 3,382,810 | 1 | true | 0 | 0 | Typical approach is to define all mappings in separate model module, with one file per class/table.
Then you just import needed classes whenever need them. | 1 | 1 | 0 | I had my sqlalchemy related code in my main() method in my script.
But then when I created a function, I wasn't able to reference my 'products' mapper because it was in the main() method.
Should I be putting the sqlalchemy related code (session, mapper, and classes) in global scope so all functions in my single file sc... | Where to put my sqlalchemy code in my script? | 1.2 | 1 | 0 | 87 |
3,384,361 | 2010-08-02T00:56:00.000 | 1 | 0 | 1 | 0 | python,python-3.x,python-2.x | 3,401,516 | 4 | false | 0 | 0 | Things like changing default floor
division could be a real pain to
change for big projects.
If you had started making the change 8 years ago when Python 2.2 was introduced with // and from __future__ import division, it wouldn't be a pain now. Personally, I'm glad to finally get rid of old-style division!
My sec... | 1 | 8 | 0 | I learned Python as my first serious (non BASIC) language about 10 years ago. Since then, I have learned lots of others, but I tend to 'think' in Python. When I look at the list of changes I do not see one I need this feature. I usually say to myself, hmm that would been a good way of doing it, but why change it now?
T... | Why is Python 3 (or later) better than Python 2? | 0.049958 | 0 | 0 | 1,312 |
3,384,374 | 2010-08-02T01:00:00.000 | 28 | 0 | 1 | 0 | python,class,inheritance | 3,386,914 | 3 | true | 0 | 0 | Mostly it isn't going to matter whether or not you inherit from object, but if you don't there are bugs waiting to catch you out when you've forgotten that you decided not to bother.
Some subtle things just won't work properly if you don't ultimately inherit from object:
Using properties in classic classes only partly... | 1 | 34 | 0 | So I'm just learning python (I know plenty of other languages) and I'm confused about something. I think this is due to lack of documentation (at least that I could find). On a few websites, I've read that you should derive your classes from object:
class Base(object):
pass
But I don't see what that does or why... | Deriving class from `object` in python | 1.2 | 0 | 0 | 11,827 |
3,384,989 | 2010-08-02T04:28:00.000 | 6 | 0 | 1 | 0 | .net,ironpython,optional-parameters,named-parameters | 3,401,635 | 2 | true | 0 | 1 | Named and optional parameters are fully supported. .NET has had these for a long time for VB.NET support and so IronPython has supported that same way to do them since the beginning. The new C# syntax maps to the same underlying metadata as the old VB support.
For calling you use f(x = 42) which is Python's named par... | 1 | 3 | 0 | I hope to load .net dll in ironpython.
But one of static functions in .net dll, has some Named and Optional Arguments.
like, Draw(weight:w,height:h, Area=1)
Only can I use full arguments? | Can I use Named and Optional Arguments in ironpython | 1.2 | 0 | 0 | 1,159 |
3,385,013 | 2010-08-02T04:35:00.000 | 0 | 0 | 1 | 0 | python,linux,pyqt4,kubuntu | 3,460,599 | 2 | false | 0 | 1 | I guess you need python-qt4 qt4-designer qt4-dev-tools. | 1 | 2 | 0 | Im planing to do some GUI development using pyqt4 pykde and python3.1 on Kubuntu 10.4. In the research I did I found out that most of the things are available as packages in repositories and some of the packages are preinstalled. Only thing is I'm not able to figure out what to install and what not to. Can someone plea... | pyqt installation question | 0 | 0 | 0 | 333 |
3,385,400 | 2010-08-02T06:08:00.000 | 0 | 0 | 0 | 0 | python,django,csv | 3,389,840 | 5 | false | 1 | 0 | Depending upon the data format (you said CSV) and the database, you'll probably be better off loading the data directly into the database (either directly into the Django-managed tables, or into temp tables). As an example, Oracle and SQL Server provide custom tools for loading large amounts of data. In the case of M... | 3 | 4 | 0 | What would be the best way to import multi-million record csv files into django.
Currently using python csv module, it takes 2-4 days for it process 1 million record file. It does some checking if the record already exists, and few others.
Can this process be achieved to execute in few hours.
Can memcache be used some... | Django with huge mysql database | 0 | 0 | 0 | 2,045 |
3,385,400 | 2010-08-02T06:08:00.000 | 3 | 0 | 0 | 0 | python,django,csv | 3,385,550 | 5 | false | 1 | 0 | I'm not sure about your case, but we had similar scenario with Django where ~30 million records took more than one day to import.
Since our customer was totally unsatisfied (with the danger of losing the project), after several failed optimization attempts with Python, we took a radical strategy change and did the impo... | 3 | 4 | 0 | What would be the best way to import multi-million record csv files into django.
Currently using python csv module, it takes 2-4 days for it process 1 million record file. It does some checking if the record already exists, and few others.
Can this process be achieved to execute in few hours.
Can memcache be used some... | Django with huge mysql database | 0.119427 | 0 | 0 | 2,045 |
3,385,400 | 2010-08-02T06:08:00.000 | 0 | 0 | 0 | 0 | python,django,csv | 4,772,823 | 5 | false | 1 | 0 | Like Craig said, you'd better fill the db directly first.
It implies creating django models that just fits the CSV cells (you can then create better models and scripts to move the data)
Then, db feedding : a tool of choice for doing this is Navicat, you can grab a functional 30 days demo on their site. It allows you t... | 3 | 4 | 0 | What would be the best way to import multi-million record csv files into django.
Currently using python csv module, it takes 2-4 days for it process 1 million record file. It does some checking if the record already exists, and few others.
Can this process be achieved to execute in few hours.
Can memcache be used some... | Django with huge mysql database | 0 | 0 | 0 | 2,045 |
3,385,990 | 2010-08-02T07:59:00.000 | 2 | 1 | 0 | 0 | python,twitter | 3,388,478 | 1 | true | 0 | 0 | Twitter's API is over HTTP, which is a stateless protocol. you don't really need to close the connection, since connections made and closed for each request | 1 | 1 | 0 | i developed an aplication built on twitter api , but i get erorrs like a mesage that i've parsed and deleted to be parsed again at the next execution , could that be because i left the twitter connection opened or is just a fault of the twitter API. I also tried to delete all direct messages because it seemed to... | twitter connection needs to be closed? | 1.2 | 0 | 1 | 105 |
3,386,098 | 2010-08-02T08:20:00.000 | 0 | 0 | 0 | 0 | python,user-interface,tkinter,ttk | 3,389,225 | 2 | false | 0 | 1 | I've never used these widgets so I have no idea how possible this is, but what I would try is something akin to the grid_remove() method. If you can move the tabs to an invisible widget, or just make them invisible without losing content, that's what I'd look for/try. | 2 | 1 | 0 | I'm working on a project using Tkinter and Python. In order to have native theming and to take advantage of the new widgets I'm using ttk in Python 2.6. My problem is how to allow the user to scroll through the tabs in the notebook widget (a la firefox). Plus, I need a part in the right edge of the tabs for a close but... | Using the ttk (tk 8.5) Notebook widget effectively (scrolling of tabs) | 0 | 0 | 0 | 1,350 |
3,386,098 | 2010-08-02T08:20:00.000 | 2 | 0 | 0 | 0 | python,user-interface,tkinter,ttk | 3,650,157 | 2 | true | 0 | 1 | The notebook widget doesn't do scrolling of tabs (or multiple layers of them either) because the developer doesn't believe that they make for a good GUI. I can see his point; such GUIs tend to suck. The best workaround I've seen is to have a panel on the side that allows the selection of which pane to display. You can ... | 2 | 1 | 0 | I'm working on a project using Tkinter and Python. In order to have native theming and to take advantage of the new widgets I'm using ttk in Python 2.6. My problem is how to allow the user to scroll through the tabs in the notebook widget (a la firefox). Plus, I need a part in the right edge of the tabs for a close but... | Using the ttk (tk 8.5) Notebook widget effectively (scrolling of tabs) | 1.2 | 0 | 0 | 1,350 |
3,386,377 | 2010-08-02T09:07:00.000 | 3 | 0 | 0 | 0 | java,python,netbeans,pyqt | 3,386,409 | 9 | false | 0 | 1 | First, results speak for themselves: if you can piece together another version of one of your applications in pyqt, and tell him how long it took, it might be motivation enough.
Or, next time you're starting a project, you could prototype four or five different versions of the interface in pyqt in the morning, ask his ... | 9 | 5 | 0 | I'm working for small company, which operates in the automation industry.
The boss hired me because he wants to sell/give some desktop applications to his
current costumers.
He imposes me to use the Netbeans Platform (a generic desktop application framework).
A software engineer friend of his advised him to choose this... | How to convince boss to substitute Java/Netbeans Platform for Python/PyQt? | 0.066568 | 0 | 0 | 874 |
3,386,377 | 2010-08-02T09:07:00.000 | 0 | 0 | 0 | 0 | java,python,netbeans,pyqt | 3,386,403 | 9 | false | 0 | 1 | Just use Netbeans as an IDE and he'll never notice :P
Speaking more seriously: a side by side comparison of strong and weak points behind each of technologies will certianly be more convincing. Just don't cheat too much in favor of Python ;) | 9 | 5 | 0 | I'm working for small company, which operates in the automation industry.
The boss hired me because he wants to sell/give some desktop applications to his
current costumers.
He imposes me to use the Netbeans Platform (a generic desktop application framework).
A software engineer friend of his advised him to choose this... | How to convince boss to substitute Java/Netbeans Platform for Python/PyQt? | 0 | 0 | 0 | 874 |
3,386,377 | 2010-08-02T09:07:00.000 | 12 | 0 | 0 | 0 | java,python,netbeans,pyqt | 3,386,436 | 9 | true | 0 | 1 | If your selling skills are not working in discussion format I highly suggest that you document it. Some managers/bosses really respond well to this.
Make a matrix of all the metrics that you yourself use to grade the two frameworks (I leave the level of objectivity to you there: for example if objective it should analy... | 9 | 5 | 0 | I'm working for small company, which operates in the automation industry.
The boss hired me because he wants to sell/give some desktop applications to his
current costumers.
He imposes me to use the Netbeans Platform (a generic desktop application framework).
A software engineer friend of his advised him to choose this... | How to convince boss to substitute Java/Netbeans Platform for Python/PyQt? | 1.2 | 0 | 0 | 874 |
3,386,377 | 2010-08-02T09:07:00.000 | 1 | 0 | 0 | 0 | java,python,netbeans,pyqt | 3,386,699 | 9 | false | 0 | 1 | Perhaphs showing him
a)Time spent in developing in Python and Java
b)lines of code in Python and Java
with these two metrics maybe you can make your case stronger | 9 | 5 | 0 | I'm working for small company, which operates in the automation industry.
The boss hired me because he wants to sell/give some desktop applications to his
current costumers.
He imposes me to use the Netbeans Platform (a generic desktop application framework).
A software engineer friend of his advised him to choose this... | How to convince boss to substitute Java/Netbeans Platform for Python/PyQt? | 0.022219 | 0 | 0 | 874 |
3,386,377 | 2010-08-02T09:07:00.000 | 5 | 0 | 0 | 0 | java,python,netbeans,pyqt | 3,386,477 | 9 | false | 0 | 1 | The basic problem here is that your non-technical boss is getting conflicting advice from you and from the friend who advised him in the first place. If you want him to take your advice seriously you need to prove that your advice is likely to be trustworthy. And that will only come with taking the lead and being suc... | 9 | 5 | 0 | I'm working for small company, which operates in the automation industry.
The boss hired me because he wants to sell/give some desktop applications to his
current costumers.
He imposes me to use the Netbeans Platform (a generic desktop application framework).
A software engineer friend of his advised him to choose this... | How to convince boss to substitute Java/Netbeans Platform for Python/PyQt? | 0.110656 | 0 | 0 | 874 |
3,386,377 | 2010-08-02T09:07:00.000 | 1 | 0 | 0 | 0 | java,python,netbeans,pyqt | 3,387,150 | 9 | false | 0 | 1 | I would guess a lot, in terms of risk management, would depend on the separation/isolation of the various softwares you develop, and their life cycle.
If you don't need to further a central set of libraries, or have (or can develop) Python bindings for those, and the projects are relatively self contained, say a turn a... | 9 | 5 | 0 | I'm working for small company, which operates in the automation industry.
The boss hired me because he wants to sell/give some desktop applications to his
current costumers.
He imposes me to use the Netbeans Platform (a generic desktop application framework).
A software engineer friend of his advised him to choose this... | How to convince boss to substitute Java/Netbeans Platform for Python/PyQt? | 0.022219 | 0 | 0 | 874 |
3,386,377 | 2010-08-02T09:07:00.000 | 1 | 0 | 0 | 0 | java,python,netbeans,pyqt | 3,386,396 | 9 | false | 0 | 1 | Have you emphasised the point of the lower development time. Any person that doesn't want a shorter turn around time is an idiot. This is the only main issue i can think for the change. Or what you could do is develop it on the side and when you have errors say this is what i have been doing in my spare time(have a wor... | 9 | 5 | 0 | I'm working for small company, which operates in the automation industry.
The boss hired me because he wants to sell/give some desktop applications to his
current costumers.
He imposes me to use the Netbeans Platform (a generic desktop application framework).
A software engineer friend of his advised him to choose this... | How to convince boss to substitute Java/Netbeans Platform for Python/PyQt? | 0.022219 | 0 | 0 | 874 |
3,386,377 | 2010-08-02T09:07:00.000 | 8 | 0 | 0 | 0 | java,python,netbeans,pyqt | 3,386,487 | 9 | false | 0 | 1 | The problem is that development time is usually nothing compared to maintenance. Who cares if it takes two days instead of four if the app has a 1-5 year lifetime?
You'll have to convince him that if you get hit by a truck or leave the company (perhaps to work for somebody who uses Python exclusively) that he won't be... | 9 | 5 | 0 | I'm working for small company, which operates in the automation industry.
The boss hired me because he wants to sell/give some desktop applications to his
current costumers.
He imposes me to use the Netbeans Platform (a generic desktop application framework).
A software engineer friend of his advised him to choose this... | How to convince boss to substitute Java/Netbeans Platform for Python/PyQt? | 1 | 0 | 0 | 874 |
3,386,377 | 2010-08-02T09:07:00.000 | 2 | 0 | 0 | 0 | java,python,netbeans,pyqt | 3,387,872 | 9 | false | 0 | 1 | Some people will tell you to try to convince your boss verbally. Others will tell you to document the time savings you think you can make. My opinion is that you just go ahead and do it. Do it in your own time if you strongly believe its in your best interests.
I'm yet to meet a software manager who turned down a worki... | 9 | 5 | 0 | I'm working for small company, which operates in the automation industry.
The boss hired me because he wants to sell/give some desktop applications to his
current costumers.
He imposes me to use the Netbeans Platform (a generic desktop application framework).
A software engineer friend of his advised him to choose this... | How to convince boss to substitute Java/Netbeans Platform for Python/PyQt? | 0.044415 | 0 | 0 | 874 |
3,387,605 | 2010-08-02T12:15:00.000 | 3 | 0 | 0 | 1 | python,google-app-engine,command-prompt | 3,388,313 | 1 | false | 1 | 0 | You can run appcfg.py with --no_cookies to tell it not to store authentication cookies, or -e EMAIL to specify an email address that differs from the one in the current cookie. | 1 | 1 | 0 | I am uploading google app engine application with the help of appcfg.py command from command prompt in windows.
But after one login I want to upload another application from the same command prompt but i cannot because this second application has no rights with the current login so i want to logout from this session o... | logout from command prompt to uploading application on google app | 0.53705 | 0 | 0 | 556 |
3,387,663 | 2010-08-02T12:20:00.000 | 4 | 1 | 0 | 0 | c++,python,swig | 3,393,617 | 3 | true | 0 | 1 | It looks like you aren't linking to the Python runtime library. Something like adding -lpython24 to your gcc line. (I don't have a Linux system handy at the moment). | 1 | 2 | 0 | HI all
I am trying to use SWIG to export C++ code to Python.
The C sample I read on the web site does work but I have problem with C++ code.
Here are the lines I call
swig -c++ -python SWIG_TEST.i
g++ -c -fPIC SWIG_TEST.cpp SWIG_TEST_wrap.cxx -I/usr/include/python2.4/
gcc --shared SWIG_TEST.o SWIG_TEST_wrap.o -o _SWIG... | using SWIG with C++ | 1.2 | 0 | 0 | 886 |
3,388,829 | 2010-08-02T14:43:00.000 | 2 | 0 | 0 | 0 | php,python,backend | 3,388,948 | 2 | false | 1 | 0 | A "Python backend" is simply server-side software written in Python, no different in general terms than server-side software written in PHP. It does all the same things, just with a different programming language. | 2 | 1 | 0 | I am primarily a PHP developer, and I have been browsing the source code of a few open-source applications recently(Mozilla Bespin in particular), to find that some of them use a Python "back-end." I was just wondering what the purpose of this back-end is. I am assuming it is the same thing as the model in an MVC fra... | What purpose does a python backend serve? | 0.197375 | 0 | 0 | 4,068 |
3,388,829 | 2010-08-02T14:43:00.000 | 1 | 0 | 0 | 0 | php,python,backend | 3,388,977 | 2 | false | 1 | 0 | It looks like Bespin uses Python in the same way it would use PHP, if the autors chose PHP and not Python.
If you are a PHP developer, you already are a "back-end" programmer and you already know what it does, the only difference is the programming language that was used to do that.
Some web sites, mostly the huge ones... | 2 | 1 | 0 | I am primarily a PHP developer, and I have been browsing the source code of a few open-source applications recently(Mozilla Bespin in particular), to find that some of them use a Python "back-end." I was just wondering what the purpose of this back-end is. I am assuming it is the same thing as the model in an MVC fra... | What purpose does a python backend serve? | 0.099668 | 0 | 0 | 4,068 |
3,388,911 | 2010-08-02T14:53:00.000 | 0 | 1 | 0 | 0 | python,linux,ipv6 | 3,388,966 | 3 | false | 0 | 0 | You could just simply run 'ifconfig' with a subprocess.* call and parse the output. | 1 | 6 | 0 | Do you know how I could get one of the IPv6 adress of one of my interface in python2.6. I tried something with the socket module which lead me nowhere.
Thanks. | How to get the IPv6 address of an interface under linux | 0 | 0 | 1 | 3,133 |
3,389,313 | 2010-08-02T15:40:00.000 | 1 | 0 | 1 | 0 | python,import | 3,389,337 | 1 | true | 0 | 0 | Use imp.find_module() and imp.load_module()
find_module lets you specify your own path to search | 1 | 1 | 0 | I have an executable file, named, for example, resource.py. It is disposed in the folder named resource. Renaming file or folder is objectionable - it is old product and users accustomed to use such naming. At old version it was under another project, so imports to it sound like import main_product.resource.<..>.
Now I... | Importing from module with the same name as executable file in Python | 1.2 | 0 | 0 | 560 |
3,390,558 | 2010-08-02T18:15:00.000 | 0 | 0 | 1 | 1 | python | 13,340,272 | 5 | false | 0 | 0 | I had the same error due to the fact that Python2.7 was not on the path used by sudo.
I just added:
alias sudo='sudo env PATH=$PATH'
before running the installer. | 1 | 7 | 0 | A newbie question but.....
I've installed python2.7 on a host where the system version is 2.3 (2.7 at ~/python2.7/bin/python). I'd like to add a few packages such as MySQLdb but need setuptools.
The directions say that you can use --prefix as an argument. However, if I do the following:
sh setuptools-0.6c11-py2.7.egg ... | Installing setuptools in a private version of python | 0 | 0 | 0 | 12,097 |
3,390,778 | 2010-08-02T18:44:00.000 | 0 | 0 | 1 | 0 | python,vba,compiler-construction | 10,985,685 | 4 | false | 0 | 0 | [PyScripter](http://code.google.com/p/pyscripter/"This is the download page.") is good and is actively developed. | 2 | 1 | 0 | does anyone know if there a vba style compiler/gui for python. i am using the regular IDLE and it is difficult to navigate from function to function. with the VBA editor you are able to skip from function to function with a listbox. does anyone know if such a thing exists for python? | vba-style compiler/gui for python | 0 | 0 | 0 | 252 |
3,390,778 | 2010-08-02T18:44:00.000 | 1 | 0 | 1 | 0 | python,vba,compiler-construction | 3,390,840 | 4 | true | 0 | 0 | Learn a decent text editor, and learn it well.
In vim for instance, I would search for def func and get there WAY faster than you ever could using your mouse in a drop-down list. | 2 | 1 | 0 | does anyone know if there a vba style compiler/gui for python. i am using the regular IDLE and it is difficult to navigate from function to function. with the VBA editor you are able to skip from function to function with a listbox. does anyone know if such a thing exists for python? | vba-style compiler/gui for python | 1.2 | 0 | 0 | 252 |
3,391,013 | 2010-08-02T19:16:00.000 | 4 | 0 | 1 | 0 | python,introspection | 3,391,039 | 2 | true | 0 | 0 | help(thing) pretty prints all the docstrings that are in the module, method, whatever ... | 1 | 7 | 0 | Is there is a tool similar to dir() for modules that will tell me what parameters a given function takes? For instance, I would like to do something like dir(os.rename) and have it tell me what parameters are documented so that I can avoid checking the documentation online, and instead use only the Python scripting in... | Python introspection: description of the parameters a function takes | 1.2 | 0 | 0 | 4,945 |
3,391,222 | 2010-08-02T19:49:00.000 | 1 | 1 | 0 | 0 | python,flash,video-capture,html5-video | 3,393,137 | 1 | true | 1 | 0 | There are many video solutions. Here are two:
Take a look at Flash Media Server (FMS). You will need to some server-side code to place the video into a folder as it streams up.
Also, if you're looking into free open-source take a look at Red5. | 1 | 1 | 0 | I wanted to make a website that would let users record a small video message through their broswer and save it to my website.
As I have never used flash, i wanted to know what softwares would be required and what programming languages would I need? I mean, what should I go about learning to implement such a site. I wou... | Flash video record on website tutorial | 1.2 | 0 | 0 | 549 |
3,391,368 | 2010-08-02T20:11:00.000 | 0 | 0 | 0 | 0 | python | 3,391,404 | 1 | true | 1 | 0 | Fixed it. Sorry Santa for not including the console print out. Windows was dumb and added an extra .py to the file when I created it. So everything was actually "pythonfile.py.py". Awesome. | 1 | 0 | 0 | I added a folder to my PYTHONPATH where I can put all of my Django Apps. I print sys.path, and everything looks good, the folder I want is there. However, when I go to import a module, it tells me that there's no module by that name. All the site-packages modules work fine. In all of my Django apps, there's an "_____in... | Python Path import problems | 1.2 | 0 | 0 | 252 |
3,391,558 | 2010-08-02T20:40:00.000 | 3 | 0 | 0 | 0 | python,image | 3,391,578 | 3 | false | 0 | 0 | Look at PyMagick, the python interface for the ImageMagick libraries. It's fairly simple to resize an image, retaining proportion, while limiting the longest side.
edit: when I say fairly simple, I mean you can describe your resize in terms of the longest acceptable values for each side, and ImageMagick will preserve ... | 1 | 1 | 0 | I want to create a thumbnail, and the width has to be either fixed or no bigger than 200 pixels wide (the length can be anything).
The images are either .jpg or .png or .gif
I am using python.
The reason it has to be fixed is so that it fits inside a html table cell. | Need to create thumbnail, how to ensure proportions and set fixed width? | 0.197375 | 0 | 0 | 405 |
3,391,692 | 2010-08-02T20:58:00.000 | 1 | 1 | 1 | 0 | python,objective-c,unicode,pyobjc | 3,391,733 | 1 | true | 0 | 0 | I misread the documentation. I need to do this:
NSWorkspace.sharedWorkspace().setIcon_forFile_options_(NSImage.alloc().initWithContentsOfFile_(icon),target,0)
Unfortunately the error is what confused me. | 1 | 0 | 0 | I have this line:
NSWorkspace.sharedWorkspace().setIcon_forFile_options_(unicode(icon),unicode(target),0)
Why does it give that error and how do I fix it?
Thank you. | PyObjC giving strange error - [OC_PythonUnicode representations]: unrecognized selector sent to instance 0x258ae2a0 | 1.2 | 0 | 0 | 318 |
3,391,920 | 2010-08-02T21:28:00.000 | 2 | 0 | 1 | 1 | python | 3,391,956 | 2 | false | 0 | 0 | Yes you can. Is this a hard thing to test yourself? | 1 | 2 | 0 | if I run a .py script, can I open a new terminal, modify the file and run it also?
i.e. does the file that I run get loaded in memory, such that I can modify the file and run it at the same time in a different terminal? | if I run a .py script, can I open a new terminal, modify the file and run it also? | 0.197375 | 0 | 0 | 146 |
3,392,203 | 2010-08-02T22:10:00.000 | 2 | 0 | 1 | 1 | linux,kernel,init,python | 3,392,306 | 2 | false | 0 | 0 | I don't think init needs to be a C binary; it can be a script with a #! at the beginning; if that is the case, then you can have it be a python program with little effort.
Having said that, it is pretty trivial to write an inittab where init just runs a single program once (Although it's usually more useful to do other... | 1 | 3 | 0 | Would it be possible and not incredibly difficult to build a linux kernel, with a python interpreter built in or accessible from the kernel, that could run a python file as it's init process? | Linux kernel that runs python file for init | 0.197375 | 0 | 0 | 1,752 |
3,392,333 | 2010-08-02T22:34:00.000 | 4 | 0 | 0 | 1 | python,fabric | 5,531,404 | 4 | true | 0 | 0 | If you don't want to have to iterate through all open connections, fabric.network.disconnect_all() is what you're looking for. The docstring reads
"""
Disconnect from all currently connected servers.
Used at the end of fab's main loop, and also intended for use by library users.
""" | 1 | 6 | 0 | The website says:
Closing connections: Fabric’s
connection cache never closes
connections itself – it leaves this up
to whatever is using it. The fab tool
does this bookkeeping for you: it
iterates over all open connections and
closes them just before it exits
(regardless of whether the tasks
failed or... | Disconnecting from host with Python Fabric when using the API | 1.2 | 0 | 0 | 4,881 |
3,393,314 | 2010-08-03T02:57:00.000 | 2 | 0 | 0 | 0 | python,windows,passwords,download | 3,393,326 | 2 | false | 0 | 0 | This is best implemented at the web server level.
If you are using Apache, this can be done by placing the files you desire to protect in a directory with an htaccess file which requires user authentication.
Then, implement HTTP Basic Auth in your Python script to download the files. Make sure to use an SSL connection... | 1 | 0 | 0 | I am working on a project that requires password protected downloading, but I'm not exactly sure how to implement that. If the target file has a specific extension (.exe, .mp3, .mp4, etc), I want to prompt the user for a username and password. Any ideas on this?
I am using Python 26 on Windows XP. | Prevent A User From Downloading Files from Python? | 0.197375 | 0 | 0 | 450 |
3,394,757 | 2010-08-03T08:16:00.000 | 1 | 0 | 1 | 0 | python,if-statement | 3,394,782 | 11 | false | 0 | 0 | Try a simple game, like if you press 'L', turn left, if you press 'R', turn right, if there's a monster, you die etc. | 4 | 11 | 0 | What would be a good set of programming exercises that would help Python newbies to learn the use of the "if ... else" construct? I could cook up the following, do you know of any more?
Find the largest/smallest of three numbers.
Given a date (year, month, day), find the next date.
Most of the intended audience have ... | What are good programming questions to exercise the use of "if ... else" in Python? | 0.01818 | 0 | 0 | 14,476 |
3,394,757 | 2010-08-03T08:16:00.000 | 9 | 0 | 1 | 0 | python,if-statement | 3,394,792 | 11 | false | 0 | 0 | "Figure out whether a given year is a leap year" springs to mind almost immediately. Just give 'em the rules and turn 'em loose.
Other possibilities (albeit with stuff other than if statements):
Hunt the Wumpus (you may have to google for this one, I'm showing my age).
The perennial "detect a win in a Tic Tac Toe (Nou... | 4 | 11 | 0 | What would be a good set of programming exercises that would help Python newbies to learn the use of the "if ... else" construct? I could cook up the following, do you know of any more?
Find the largest/smallest of three numbers.
Given a date (year, month, day), find the next date.
Most of the intended audience have ... | What are good programming questions to exercise the use of "if ... else" in Python? | 1 | 0 | 0 | 14,476 |
3,394,757 | 2010-08-03T08:16:00.000 | 0 | 0 | 1 | 0 | python,if-statement | 3,397,650 | 11 | false | 0 | 0 | I like the "Three men and a monkey on an island" problem:
Three men are stranded on a desert
island with a monkey. They collect
all of the coconuts and put them into
a big pile. Then throughout the night
each man gets up secretly and takes
1/3rd of the remaining pile and hides it. When
he splits the pil... | 4 | 11 | 0 | What would be a good set of programming exercises that would help Python newbies to learn the use of the "if ... else" construct? I could cook up the following, do you know of any more?
Find the largest/smallest of three numbers.
Given a date (year, month, day), find the next date.
Most of the intended audience have ... | What are good programming questions to exercise the use of "if ... else" in Python? | 0 | 0 | 0 | 14,476 |
3,394,757 | 2010-08-03T08:16:00.000 | 0 | 0 | 1 | 0 | python,if-statement | 32,794,893 | 11 | false | 0 | 0 | At my lecture I asked them to implement is_between_5_8(x) (I admit, there's no ulterior motive with using 5 and 8), and afterward I gave them the exercises to implement abs(x) and closest_to_zero(x, y).
If you've taught them recursion I can give you a few more suggestions :) | 4 | 11 | 0 | What would be a good set of programming exercises that would help Python newbies to learn the use of the "if ... else" construct? I could cook up the following, do you know of any more?
Find the largest/smallest of three numbers.
Given a date (year, month, day), find the next date.
Most of the intended audience have ... | What are good programming questions to exercise the use of "if ... else" in Python? | 0 | 0 | 0 | 14,476 |
3,395,409 | 2010-08-03T09:58:00.000 | 1 | 1 | 0 | 0 | c#,python,apache,mod-wsgi | 3,395,446 | 2 | true | 0 | 0 | Trivially.
Apache serves static content.
Certain URI's will be routed to mod_wsgi to Python.
Python will then execute (via subprocess) a C# program, providing command-line arguments, and reading the standard output response from the C# program.
Python does whatever else is required to serve the web pages.
This presum... | 1 | 0 | 0 | I have a c# application that defines a membership provider used in a Asp.Net MVC application.
And i have an apache httpd server that does authentication with mod_wsgi.
The objective is to share the membership provider between the two, so that the authentication information be the same.
How can i achieve this behaviour ... | using c# inside an apache python script | 1.2 | 0 | 0 | 145 |
3,396,503 | 2010-08-03T12:38:00.000 | 1 | 0 | 0 | 1 | python,linux,fuse | 7,897,314 | 2 | false | 0 | 0 | Did you set st_size properly in getattr? ls will first try with a buffer size of the returned st_size and double it until the the readlink buffer fits. | 1 | 3 | 0 | I am implementing a filesystem using Python Fuse. A directory contains only symlinks and as such I return S_IFLNK | 0777 on the getattr method.
Now, when I do an ls on the directory, I notice that Linux calls readlink method 6 times in a row for each entry in the directory.
Is it a bug on my side or a normal behavior? | Python Fuse calling 'readlink' 6 times in a row | 0.099668 | 0 | 0 | 510 |
3,397,599 | 2010-08-03T14:38:00.000 | 17 | 0 | 0 | 0 | python,django,amazon-s3,thumbnails | 5,262,932 | 2 | false | 1 | 0 | easy_thumbnails will do S3-based image thumbnailing for you - you just need to set settings.THUMBNAIL_DEFAULT_STORAGE, so that easy_thumbnails knows which storage to use (in your case, you probably want to set it to the same storage you're using for your ImageFields). | 1 | 5 | 0 | I'm making a website where files are uploaded through the admin and this will then store them on Amazon S3. I'm using django-storages and boto for this, and it seems to be working just fine.
Thing is, I'm used to use my easy_thumbnails (the new sorl.thumbnail) on the template side to create thumbnails on the fly. I pre... | In Django, how to get django-storages, boto and easy_thumbnail to work nicely? | 1 | 0 | 0 | 1,958 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.