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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,394,054 | 2010-03-06T20:48:00.000 | 0 | 0 | 0 | 1 | python,windows,django,iis,executable | 2,395,623 | 1 | false | 1 | 0 | Might be a permissions issue. when you run from the shell, you're using the user that run the python manage.py shell command. When serving requests from the IIS you're using its user (IUSR or something like that). Try giving execution permission on the executable file to the Everyone group just to see if it helps. | 1 | 1 | 0 | I have a Python / Django application which is supposed to call an external windows binary and get its output at some point. And it does so when tested via 'python manage.py shell'.
But when it is run from within the web browser, which is served by IIS, the external application is not executed.
Is IIS blocking somethin... | Calling an executable from within Python / Django web application running on IIS | 0 | 0 | 0 | 1,622 |
2,394,235 | 2010-03-06T21:55:00.000 | 0 | 1 | 1 | 0 | python,date,bank | 70,469,423 | 6 | false | 0 | 0 | I should caution contributors from thinking this is all solvable by an algorithm. Three examples:
most Islamic holidays are lunar. The moon is predictable, some countries do this, but others explicitly require that the new moon be actually sighted in the country. Some even post people to the tops of tall mountains, ... | 1 | 30 | 0 | What's the simplest way to determine if a date is a U.S. bank holiday in Python? There seem to be various calendars and webservices listing holidays for various countries, but I haven't found anything specific to banks in the U.S. | Detecting a US Holiday | 0 | 0 | 0 | 35,484 |
2,394,870 | 2010-03-07T01:54:00.000 | 0 | 0 | 0 | 0 | python,mysql,database,search,indexing | 2,395,473 | 4 | false | 0 | 0 | If you are trying to search for the names through any development Language, you can use the Regular expression package in Java.
Some thing like java.util.regex.*; | 1 | 3 | 0 | They will also search part of their name. Not only words with spaces.
If they type "Matt", I expect to retrieve "Matthew" too. | Suppose I have 400 rows of people's names in a database. What's the best way to do a search for their names? | 0 | 1 | 0 | 291 |
2,394,903 | 2010-03-07T02:09:00.000 | 0 | 0 | 0 | 1 | python,macos | 2,394,908 | 4 | false | 1 | 0 | The only thing that I can think of is that maybe it's not on your path. Seems unlikely, but I would check that anyways. | 2 | 3 | 0 | I'm very new to Python development, and am having a problem with one of my apps in OSX.
Technologies being used in this project
python 2.6
django
google app engine
rpx (openid)
When loading up the site on my windows app, there are no issues, but when trying to same app on OSX 10.6, I get the following issue:
ImportE... | Python _ctypes import error on OSX 10.6 | 0 | 0 | 0 | 2,937 |
2,394,903 | 2010-03-07T02:09:00.000 | 3 | 0 | 0 | 1 | python,macos | 4,802,082 | 4 | false | 1 | 0 | I don't have enough rep to comment so I will make this a post.
The accepted answer is correct in that all you need to do is set the Python Path in the GAE preferences to /usr/bin/python2.5.
There is no need to download python 2.5 via macports or from the official python website.
python 2.5 is still installed in OSX 10.... | 2 | 3 | 0 | I'm very new to Python development, and am having a problem with one of my apps in OSX.
Technologies being used in this project
python 2.6
django
google app engine
rpx (openid)
When loading up the site on my windows app, there are no issues, but when trying to same app on OSX 10.6, I get the following issue:
ImportE... | Python _ctypes import error on OSX 10.6 | 0.148885 | 0 | 0 | 2,937 |
2,395,157 | 2010-03-07T04:16:00.000 | 1 | 1 | 1 | 0 | php,python,ruby | 2,433,699 | 2 | true | 0 | 0 | If you're just getting started in python, chances are the standard python distribution will work just fine. Once you get into the guts of your project, changing to IronPython (etc) is not a big deal.
I think the most important part is the "getting started" piece. Start writing python and you'll never look back. | 2 | 1 | 0 | I have no knowledge of Python. I started with .NET and than learned PHP. Someone later asked me to learn Ruby as well. I started learning it. Since last few months I am seeing many libraries and drivers written in Python. I want to know what are the advantages of Python over PHP/Ruby? What type of language it is and is... | Python Libraries and drivers | 1.2 | 0 | 0 | 98 |
2,395,157 | 2010-03-07T04:16:00.000 | 1 | 1 | 1 | 0 | php,python,ruby | 2,395,204 | 2 | false | 0 | 0 | Nobody can tell you the exact answer because everybody has their own "holy grail". You will just have to find out for yourself which one suits you best for the task you want to perform. Case closed. | 2 | 1 | 0 | I have no knowledge of Python. I started with .NET and than learned PHP. Someone later asked me to learn Ruby as well. I started learning it. Since last few months I am seeing many libraries and drivers written in Python. I want to know what are the advantages of Python over PHP/Ruby? What type of language it is and is... | Python Libraries and drivers | 0.099668 | 0 | 0 | 98 |
2,396,294 | 2010-03-07T12:57:00.000 | 1 | 0 | 0 | 0 | python,django,frameworks,migrate | 2,396,341 | 2 | false | 1 | 0 | Your database queries(and object models), url config, and templates to say the least will all be specific to django. That said - if you understand what you're doing, recreating them in another package shouldn't take too long if you really need to at some later time.
edit: this is all assuming you dont integrate third p... | 1 | 0 | 0 | I'm having trouble deciding which python framework to use for my website. So I've decided to bite the bullet and use Django. My question is how easy (or difficult) will it be to migrate to a different framework in future if I have issues with Django ? | migrating from one framework to another in python | 0.099668 | 0 | 0 | 149 |
2,396,938 | 2010-03-07T16:18:00.000 | 9 | 0 | 0 | 0 | python,css,django,mobile,templates | 2,396,949 | 6 | true | 1 | 0 | Have two sets of templates, one for mobile, one for desktop. Store the filenames in a pair of dictionaries, and use the User-agent header to detect which set should be used. Also allow manual selection of which site to use via a session entry. | 2 | 5 | 0 | I'd like everything to function correctly, except when it's mobile, the entire site will used a set of specific templates.
Also, I'd like to autodetect if it's mobile. If so, then use that set of templates throughout the entire site. | In Django, what is the best way to manage both a mobile and desktop site? | 1.2 | 0 | 0 | 1,531 |
2,396,938 | 2010-03-07T16:18:00.000 | 1 | 0 | 0 | 0 | python,css,django,mobile,templates | 2,397,185 | 6 | false | 1 | 0 | If you place a class on your body (Django uses something similar to specify what column style to use), you could use the same templates but simply use different stylesheets. I'm not sure what main differences you are using separate templates for, but this might allow you to cut down on re-coding the templates multiple... | 2 | 5 | 0 | I'd like everything to function correctly, except when it's mobile, the entire site will used a set of specific templates.
Also, I'd like to autodetect if it's mobile. If so, then use that set of templates throughout the entire site. | In Django, what is the best way to manage both a mobile and desktop site? | 0.033321 | 0 | 0 | 1,531 |
2,397,295 | 2010-03-07T18:07:00.000 | 1 | 0 | 0 | 0 | python,firefox,webkit,web-scraping | 2,397,311 | 10 | false | 1 | 0 | Well, WebKit is open source so you could use its own parser (in the WebCore component), if any language is acceptable | 1 | 9 | 0 | I'm currently trying to scrape a website that has fairly poorly-formatted HTML (often missing closing tags, no use of classes or ids so it's incredibly difficult to go straight to the element you want, etc.). I've been using BeautifulSoup with some success so far but every once and a while (though quite rarely), I run... | Web scraping with Python | 0.019997 | 0 | 1 | 4,506 |
2,397,576 | 2010-03-07T19:22:00.000 | 4 | 0 | 1 | 0 | python,concurrency | 2,397,580 | 2 | true | 0 | 0 | Have you considered using the multiprocessing module to coordinate between the running programs in a thread-like manner? See in particular the queue interface; you can place each completed work item on a queue when completed, and have a single process reading off the queue and writing to your output file.
Alternately, ... | 2 | 4 | 0 | I've got multiple python processes (typically 1 per core) transforming large volumes of data that they are each reading from dedicated sources, and writing to a single output file that each opened in append mode.
Is this a safe way for these programs to work?
Because of the tight performance requirements and large data... | How to have multiple python programs append rows to the same file? | 1.2 | 0 | 0 | 2,659 |
2,397,576 | 2010-03-07T19:22:00.000 | 4 | 0 | 1 | 0 | python,concurrency | 2,397,607 | 2 | false | 0 | 0 | Your procedure is "safe" in that no crashes will result, but data coming (with very unlucky timing) from different processes could get mixed up -- e.g., process 1 is appending a long string of as, process 2 a long string of b, you could end up in the file with lots of as then the bs then more as (or other combinations ... | 2 | 4 | 0 | I've got multiple python processes (typically 1 per core) transforming large volumes of data that they are each reading from dedicated sources, and writing to a single output file that each opened in append mode.
Is this a safe way for these programs to work?
Because of the tight performance requirements and large data... | How to have multiple python programs append rows to the same file? | 0.379949 | 0 | 0 | 2,659 |
2,398,800 | 2010-03-08T01:27:00.000 | 3 | 0 | 0 | 0 | python,user-interface,qt,pyqt,qt-designer | 54,119,368 | 12 | false | 0 | 1 | in pyqt5 to convert from a ui file to .py file
pyuic5.exe youruifile.ui -o outputpyfile.py -x | 2 | 83 | 0 | So if I go into QtDesigner and build a UI, it'll be saved as a .ui file. How can I make this as a python file or use this in python? | Linking a qtDesigner .ui file to python/pyqt? | 0.049958 | 0 | 0 | 135,115 |
2,398,800 | 2010-03-08T01:27:00.000 | 0 | 0 | 0 | 0 | python,user-interface,qt,pyqt,qt-designer | 52,304,139 | 12 | false | 0 | 1 | Using Anaconda3 (September 2018) and QT designer 5.9.5.
In QT designer, save your file as ui.
Open Anaconda prompt. Search for your file: cd C:.... (copy/paste the access path of your file).
Then write: pyuic5 -x helloworld.ui -o helloworld.py (helloworld = name of your file). Enter.
Launch Spyder. Open your file .py. | 2 | 83 | 0 | So if I go into QtDesigner and build a UI, it'll be saved as a .ui file. How can I make this as a python file or use this in python? | Linking a qtDesigner .ui file to python/pyqt? | 0 | 0 | 0 | 135,115 |
2,399,643 | 2010-03-08T06:25:00.000 | 4 | 0 | 0 | 0 | python,berkeley-db,bsddb,okvs | 2,399,691 | 2 | true | 0 | 0 | You have to pick one "column" as the key (must be unique; I imagine that would be "username" in your case) -- the only way searches will ever possibly happen. The other columns can be made to be the single string value of that key by any way you like, from pickling to simple joining with a character that's guaranteed ... | 1 | 1 | 0 | Say I have a simple table that contains username, firstname, lastname.
How do I express this in berkeley Db?
I'm currently using bsddb as the interface.
Cheers. | Expressing multiple columns in berkeley db in python? | 1.2 | 1 | 0 | 1,199 |
2,399,812 | 2010-03-08T07:12:00.000 | 0 | 0 | 0 | 0 | python,wxpython,mode,kiosk | 2,399,853 | 2 | false | 0 | 1 | wxPython alone cannot be done with that.
You need to do Low Level Keyboard Hook with C/C++ or with equivalent ctypes, for
Windows keys, alt-tab, alt-f4,
but Ctrl-Alt-Del, I don't think so for Windows XP and above. | 1 | 0 | 0 | Is there a way to create a 'kiosk mode' in wxpython under Windows (98 - 7) where the application disables you from breaking out of the app using Windows keys, alt-tab, alt-f4, and ctrl+alt+delete? | Kiosk mode in wxpython? | 0 | 0 | 0 | 753 |
2,400,088 | 2010-03-08T08:37:00.000 | 0 | 1 | 1 | 0 | python,vim | 2,401,864 | 2 | true | 0 | 0 | If you want json/simplejson to produce unicode output instead of str output with Unicode escapes then you need to pass ensure_ascii=False to dump()/dumps(), then either encode before saving or use a file-like from codecs. | 1 | 1 | 0 | I would like to do the following:
1) Serialize my class
2) Also manually edit the serialization dump file to remove certain objects of my class which I find unnecessary.
I am currently using python with simplejson. As you know, simplejson converts all characters to unicde. As a result, when I dump a particular object w... | Python: getting \\u00bd correctly in editor | 1.2 | 0 | 0 | 600 |
2,400,276 | 2010-03-08T09:22:00.000 | 1 | 0 | 1 | 0 | python,linux,inotify | 2,400,337 | 2 | false | 0 | 0 | It's always a good idea to release resources (e.g. free memory, close file descriptors, waitpid(2) on child processes, etc) whenever you're done using them. Being lazy and letting the operating system take care of it for you when you exit is a sure way to cause bugs in the future. | 2 | 3 | 0 | With python inotifyx, do I have to remove watch and close opened system file descriptor if I need them until program exit? E.g. is there some possible problems if I create one (file descriptor + watch) with each run and don't close it? | Is closing file descriptor and removing inotify watch really necessary? | 0.099668 | 0 | 0 | 1,568 |
2,400,276 | 2010-03-08T09:22:00.000 | 0 | 0 | 1 | 0 | python,linux,inotify | 2,400,290 | 2 | true | 0 | 0 | The kernel stores watches as full paths, so closing the watch is preferable, it also takes unnecessary work off of VFS. As for the file descriptor, that would depend on how many others you had opened.
Kind of like a phone call, its nice to tell the other party that you have stopped listening, hanging up the phone is op... | 2 | 3 | 0 | With python inotifyx, do I have to remove watch and close opened system file descriptor if I need them until program exit? E.g. is there some possible problems if I create one (file descriptor + watch) with each run and don't close it? | Is closing file descriptor and removing inotify watch really necessary? | 1.2 | 0 | 0 | 1,568 |
2,400,605 | 2010-03-08T10:26:00.000 | 6 | 1 | 0 | 0 | php,python,ruby,delphi | 2,401,097 | 10 | false | 0 | 0 | Why should an answer be different if the question was asked by a Delphi programmer, than a programmer from any other platform? Any decent language should be fun to learn, regardless of the tool you are using right now.
That said, I myself walked a way from Borland Pascal and Delphi (quite some time ago), over PHP and A... | 3 | 5 | 0 | I'm Delphi developer, and I would like to build few web applications, I know about Intraweb, but I think it's not a real tool for web development, maybe for just intranet applications
so I'm considering PHP, Python or ruby, I prefer python because it's better syntax than other( I feel it closer to Delphi), also I want ... | Best web application language for Delphi Developers | 1 | 0 | 0 | 2,367 |
2,400,605 | 2010-03-08T10:26:00.000 | 1 | 1 | 0 | 0 | php,python,ruby,delphi | 2,401,646 | 10 | false | 0 | 0 | PHP is a pretty simple answer.
One reason is there is both Delphi4PHP (the rather cryptic IDE licensed by Embarcadero which in my estimation is really only for Web Apps (not for doing whole site)s) and PHP4Delphi (the pretty awesome Delphi Component that lets you compile your Delphi code to PHP Extensions). | 3 | 5 | 0 | I'm Delphi developer, and I would like to build few web applications, I know about Intraweb, but I think it's not a real tool for web development, maybe for just intranet applications
so I'm considering PHP, Python or ruby, I prefer python because it's better syntax than other( I feel it closer to Delphi), also I want ... | Best web application language for Delphi Developers | 0.019997 | 0 | 0 | 2,367 |
2,400,605 | 2010-03-08T10:26:00.000 | 0 | 1 | 0 | 0 | php,python,ruby,delphi | 2,401,428 | 10 | false | 0 | 0 | I have done a fairly large (4-5 FTE) project based on webhub (www.href.com). I can certainly advise this if it is a webapp for internal use. | 3 | 5 | 0 | I'm Delphi developer, and I would like to build few web applications, I know about Intraweb, but I think it's not a real tool for web development, maybe for just intranet applications
so I'm considering PHP, Python or ruby, I prefer python because it's better syntax than other( I feel it closer to Delphi), also I want ... | Best web application language for Delphi Developers | 0 | 0 | 0 | 2,367 |
2,400,619 | 2010-03-08T10:30:00.000 | 1 | 0 | 1 | 0 | python,python-idle | 2,400,666 | 2 | false | 0 | 0 | I assume you are asking about how to enable debugging in Idle?
In the Python Shell window, choose Debugger from the Debug menu, then open foo.py and use the Run Model command. A Debug Control window opens, allowing you to step through the execution of foo.py; when execution is over, the prompt is still available for yo... | 1 | 3 | 0 | I love the IDLE. However, sometimes I have 100-200 line scripts and I want to sort of interactively debug/play with say, functions defined in foo.py instead of just calling python foo.py. Is there a way I can trigger IDLE in the context of my foo.py? | How can I interact with rather long python scripts? | 0.099668 | 0 | 0 | 291 |
2,400,643 | 2010-03-08T10:34:00.000 | 2 | 1 | 1 | 0 | python,json,large-files | 2,400,780 | 11 | true | 0 | 0 | Update
See the other answers for advice.
Original answer from 2010, now outdated
Short answer: no.
Properly dividing a json file would take intimate knowledge of the json object graph to get right.
However, if you have this knowledge, then you could implement a file-like object that wraps the json file and spits out pr... | 4 | 86 | 0 | I have some json files with 500MB.
If I use the "trivial" json.load() to load its content all at once, it will consume a lot of memory.
Is there a way to read partially the file? If it was a text, line delimited file, I would be able to iterate over the lines. I am looking for analogy to it. | Is there a memory efficient and fast way to load big JSON files? | 1.2 | 0 | 0 | 70,067 |
2,400,643 | 2010-03-08T10:34:00.000 | 3 | 1 | 1 | 0 | python,json,large-files | 2,402,371 | 11 | false | 0 | 0 | On your mention of running out of memory I must question if you're actually managing memory. Are you using the "del" keyword to remove your old object before trying to read a new one? Python should never silently retain something in memory if you remove it. | 4 | 86 | 0 | I have some json files with 500MB.
If I use the "trivial" json.load() to load its content all at once, it will consume a lot of memory.
Is there a way to read partially the file? If it was a text, line delimited file, I would be able to iterate over the lines. I am looking for analogy to it. | Is there a memory efficient and fast way to load big JSON files? | 0.054491 | 0 | 0 | 70,067 |
2,400,643 | 2010-03-08T10:34:00.000 | 1 | 1 | 1 | 0 | python,json,large-files | 2,402,407 | 11 | false | 0 | 0 | in addition to @codeape
I would try writing a custom json parser to help you figure out the structure of the JSON blob you are dealing with. Print out the key names only, etc. Make a hierarchical tree and decide (yourself) how you can chunk it. This way you can do what @codeape suggests - break the file up into smaller... | 4 | 86 | 0 | I have some json files with 500MB.
If I use the "trivial" json.load() to load its content all at once, it will consume a lot of memory.
Is there a way to read partially the file? If it was a text, line delimited file, I would be able to iterate over the lines. I am looking for analogy to it. | Is there a memory efficient and fast way to load big JSON files? | 0.01818 | 0 | 0 | 70,067 |
2,400,643 | 2010-03-08T10:34:00.000 | 3 | 1 | 1 | 0 | python,json,large-files | 2,406,386 | 11 | false | 0 | 0 | "the garbage collector should free the memory"
Correct.
Since it doesn't, something else is wrong. Generally, the problem with infinite memory growth is global variables.
Remove all global variables.
Make all module-level code into smaller functions. | 4 | 86 | 0 | I have some json files with 500MB.
If I use the "trivial" json.load() to load its content all at once, it will consume a lot of memory.
Is there a way to read partially the file? If it was a text, line delimited file, I would be able to iterate over the lines. I am looking for analogy to it. | Is there a memory efficient and fast way to load big JSON files? | 0.054491 | 0 | 0 | 70,067 |
2,400,827 | 2010-03-08T11:12:00.000 | 3 | 0 | 1 | 0 | python,filesystems | 2,400,870 | 3 | false | 0 | 0 | Or you could append the current system time to make unique filenames... | 1 | 6 | 0 | I want my program to be able to write files in a sequential format, ie: file1.txt, file2.txt, file3.txt. It is only meant to write a single file upon execution of the code. It can't overwrite any existing files, and it MUST be created. I'm stumped. | Python: How do I create sequential file names? | 0.197375 | 0 | 0 | 10,921 |
2,401,508 | 2010-03-08T13:18:00.000 | 1 | 0 | 0 | 0 | python,mysql,database,regex,search | 2,401,635 | 2 | true | 0 | 0 | This is very hard for us to determine without knowing:
the amount of text to search
the load and configuration on the database server
the load and configuration on on the webserver
etc etc ...
With that said i would conceptually definitely go for the first scenario. It should be lightening-fast when searching only 50... | 1 | 0 | 0 | Suppose I have 500 rows of data, each with a paragraph of text (like this paragraph). That's it.I want to do a search that matches part of words. (%LIKE%, not FULL_TEXT)
What would be faster?
SELECT * FROM ...WHERE LIKE "%query%"; This would put load on the database server.
Select all. Then, go through each one and do... | What would be the most efficient way to do this search (mysql or text)? | 1.2 | 1 | 0 | 105 |
2,401,599 | 2010-03-08T13:34:00.000 | 0 | 0 | 1 | 0 | python,c,cross-platform,packaging,cross-compiling | 2,467,317 | 6 | false | 0 | 1 | For casual gaming I would recommend Flash | 1 | 6 | 0 | Some friends and I wanted to develop a game. Any language will do. I've been programming in C for years, but never wrote a game before. One of us knows SDL a little bit. It would also be a nice excuse to learn Python+pygame.
We wish our game to be 'standalone'. By standalone, I mean most users (at least Linux, Mac and ... | Game cross-compiling and packaging | 0 | 0 | 0 | 1,603 |
2,401,602 | 2010-03-08T13:34:00.000 | 0 | 1 | 0 | 0 | python,apache,unix | 2,401,607 | 3 | false | 0 | 0 | This should be on ServerFault. By the way, mod_python is deprecated, use WSGI instead. | 1 | 2 | 0 | I have mod_python installed on my server, but if I want to acceses a python script - let's say httü://site.com/something.py the script doesn't run, the download box "pops up"
Any solutions? | How to run python scripts on your server? | 0 | 0 | 0 | 280 |
2,401,789 | 2010-03-08T14:03:00.000 | 0 | 1 | 0 | 0 | python,unit-testing,aop | 2,402,152 | 3 | false | 1 | 0 | Well... let's see. In my opinion you are testing three different things here (sorry for the "Java AOP jargon"):
the features implemented by the interceptors (i.e. the methods that implement the functions activated at the cutpoints)
the coverage of the filters (i.e. whether the intended cutpoints are activated correctl... | 2 | 4 | 0 | I'd like to know what would you propose as the best way to unit test aspect-oriented application features (well, perhaps that's not the best name, but it's the best I was able to come up with :-) ) such as logging or security?
These things are sort of omni-present in the application, so how to test them properly?
E.g. ... | Unit testing aspect-oriented features | 0 | 0 | 0 | 258 |
2,401,789 | 2010-03-08T14:03:00.000 | 1 | 1 | 0 | 0 | python,unit-testing,aop | 2,796,926 | 3 | false | 1 | 0 | IMHO, the way of testing users permissions to the pages depends on the design of your app and design of the framework you're using.
Generally, it's probably enough to cover your permission checker decorator with unit tests to make sure it always works as expected and then write a test that cycles through your 'views' (... | 2 | 4 | 0 | I'd like to know what would you propose as the best way to unit test aspect-oriented application features (well, perhaps that's not the best name, but it's the best I was able to come up with :-) ) such as logging or security?
These things are sort of omni-present in the application, so how to test them properly?
E.g. ... | Unit testing aspect-oriented features | 0.066568 | 0 | 0 | 258 |
2,402,128 | 2010-03-08T14:52:00.000 | 3 | 0 | 0 | 0 | python,user-interface,google-app-engine | 2,404,551 | 3 | false | 1 | 1 | There is no difference in the amount of built in widgets available to the python and java sides of app engine. Neither side has any! App Engine is primarily a back end technology. It allows you to use pretty much whatever web framework you want for your presentation layer, subject to constraints that Alex mentions.
G... | 1 | 5 | 0 | Are there any UI widgets available to the python side of Google App Engine? I'd like something like the collapsed/expanded views of Google Groups threads. Are these type things limited to the GWT side? | Google App Engine UI Widgets | 0.197375 | 0 | 0 | 2,260 |
2,403,041 | 2010-03-08T16:59:00.000 | 4 | 0 | 0 | 0 | python,powerpoint,jpeg | 2,403,104 | 3 | false | 1 | 0 | Off the top of my head, the way I'd do it:
Use OpenOffice.org to convert the .ppt file into a PDF. (OO.o has a very rich Java API. Rich and bloody difficult to use, mind, but once you figure out how to get it to do the task you need, you're all set. Dunno if you can do anything useful with it via Python; not my lan... | 1 | 4 | 0 | I'm creating a "slideshow room" web page. The user will upload a PowerPoint file that my server will use to generate a set of .jpg image files representing the slides to present in a custom "gallery viewer".
I'm an experienced Python developer but I cannot find anything useful.
How can I do that? | How do I create a set of image files from a PowerPoint file file? | 0.26052 | 0 | 0 | 2,977 |
2,406,082 | 2010-03-09T01:38:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine,screen-scraping | 2,660,349 | 4 | false | 1 | 0 | I have used BeautifulSoup with great success parsing HTML. Problem is that's all BeautifulSoup does, is parse the HTML. I ended up writing all the http interactions using urlfetch.
To web-scrape my target I need a full fledged code driven browser that can execute javascript on my target site's pages. I think I'm h... | 2 | 3 | 0 | I am looking to setup a automated screen scraper that will run on Google app engine using python. I want it to scrape the site and put the specified results into a Entity in app engine. I am looking for some directions on what to use. I have seen beautifulsoup but wonder if people could recommend anything else that cou... | Setting up a python screen scraper that could work on Google App engine | 0 | 0 | 0 | 2,539 |
2,406,082 | 2010-03-09T01:38:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine,screen-scraping | 2,406,093 | 4 | false | 1 | 0 | The other choice is lxml, but it uses C code and so does not work on GAE. | 2 | 3 | 0 | I am looking to setup a automated screen scraper that will run on Google app engine using python. I want it to scrape the site and put the specified results into a Entity in app engine. I am looking for some directions on what to use. I have seen beautifulsoup but wonder if people could recommend anything else that cou... | Setting up a python screen scraper that could work on Google App engine | 0 | 0 | 0 | 2,539 |
2,407,212 | 2010-03-09T07:10:00.000 | 3 | 0 | 0 | 0 | python,sikuli | 3,884,131 | 4 | false | 0 | 1 | If you are using Sikuli IDE click image miniature, for which you want to change sensitivity. You will be presented screenshot of your desktop with and occurrences of pattern(your image). Below there is a slider witch changes sensitivity. While changing it you will notice that highlighted occurrences of the pattern incr... | 2 | 5 | 0 | I've been using sikuli for awhile, however I have an issue with it... It's not sensitive enough. I'm trying to match something on the screen that is -EXACT-, and there are a few other items on the screen that look similar enough that sikuli is mistaking them for what I'm actually looking for, so I need to make it look ... | Change Sikuli's sensitivity? | 0.148885 | 0 | 0 | 6,449 |
2,407,212 | 2010-03-09T07:10:00.000 | 7 | 0 | 0 | 0 | python,sikuli | 3,885,229 | 4 | true | 0 | 1 | You can do the following in the Sikuli IDE:
Click on the image
In Pattern Settings > Matching Preview, drag the Similarity bar to 1.0 (all the way to the right)
Click OK | 2 | 5 | 0 | I've been using sikuli for awhile, however I have an issue with it... It's not sensitive enough. I'm trying to match something on the screen that is -EXACT-, and there are a few other items on the screen that look similar enough that sikuli is mistaking them for what I'm actually looking for, so I need to make it look ... | Change Sikuli's sensitivity? | 1.2 | 0 | 0 | 6,449 |
2,407,589 | 2010-03-09T08:38:00.000 | 33 | 0 | 0 | 0 | python,api,blocking | 2,407,601 | 2 | false | 0 | 0 | "Blocking" means that the caller waits until the callee finishes its processing. For instance, a "blocking read" from a socket waits until there is data to return; a "non-blocking" read does not, it just returns an indication (usually a count) of whether there was something read.
You hear the term mostly around APIs th... | 2 | 28 | 0 | Could someone provide a layman definition and use case? | What does the term "blocking" mean in programming? | 1 | 0 | 0 | 14,970 |
2,407,589 | 2010-03-09T08:38:00.000 | 5 | 0 | 0 | 0 | python,api,blocking | 2,407,604 | 2 | false | 0 | 0 | In simple words: If you call a function that stops the program from continuing to run until the user has performed some action (or some other action that your program is not controlling), this call is called a blocking call. | 2 | 28 | 0 | Could someone provide a layman definition and use case? | What does the term "blocking" mean in programming? | 0.462117 | 0 | 0 | 14,970 |
2,408,560 | 2010-03-09T11:17:00.000 | 2 | 0 | 0 | 0 | python,windows,input | 53,794,715 | 14 | false | 0 | 0 | I'd do what Mickey Chan said, but I'd use unicurses instead of normal curses.
Unicurses is universal (works on all or at least almost all operating systems) | 1 | 73 | 0 | I am trying to make a simple IRC client in Python (as kind of a project while I learn the language).
I have a loop that I use to receive and parse what the IRC server sends me, but if I use raw_input to input stuff, it stops the loop dead in its tracks until I input something (obviously).
How can I input something with... | Non-blocking console input? | 0.028564 | 0 | 1 | 93,857 |
2,408,882 | 2010-03-09T12:18:00.000 | 3 | 0 | 1 | 0 | python,events,multithreading | 2,408,923 | 2 | true | 0 | 0 | Yes, you're missing next sentence in documentation which writes:
Changed in version 2.7: Previously,
the method always returned None. | 1 | 1 | 0 | import threading
event = threading.Event()
event.set()
print event.wait(1)
None
event.clear()
print event.wait(1)
None
So it basically returns None both when condition was True and False. How can I distinguish the case of timeouting from the one with no waiting at al... | How can I tell if waiting on Event has timed out? | 1.2 | 0 | 0 | 2,128 |
2,409,168 | 2010-03-09T13:04:00.000 | 2 | 0 | 1 | 1 | python | 2,409,213 | 2 | false | 0 | 0 | You could write a installer (using NSIS or something) that does two things :
install LateX (or make sure there is an installation of latex available), potentially by calling another installer
then install your python script (which can assume latex is now available) | 1 | 1 | 0 | I wanted to know how can I make standalone application in python.
Basically what I am doing right now is I have a template.tex file and my script generate the pdf by giving some input values.
So I have to make exe file for windows and same for linux.
I can use cx_freeze for creating exe file.
But my problem is most of ... | standalone application in python | 0.197375 | 0 | 0 | 467 |
2,409,200 | 2010-03-09T13:12:00.000 | 1 | 0 | 0 | 1 | python,terminal-services,citrix | 2,410,065 | 2 | true | 0 | 0 | The various instances of your application need some way to communicate with one another. When an instance starts up, it asks the question, 'how many are already running?'. If there are more than the allowed n, it chooses not to start up.
One implementation approach might be to make n files to lock for the n instances o... | 2 | 3 | 0 | I'm looking for simple ways to monitor and limit the number of instances of our application under Terminal Server (2003 and 2008).
The purpose of this restriction is to make sure we don't overload our servers. This is an internal administrative requirement - I am not looking for a licensing solution.
The application in... | Technique to limit number of instances of our application under Terminal Server | 1.2 | 0 | 0 | 702 |
2,409,200 | 2010-03-09T13:12:00.000 | 1 | 0 | 0 | 1 | python,terminal-services,citrix | 2,431,193 | 2 | false | 0 | 0 | Based on feedback on the Python Win32 API mailing list I'm also considering one of the following techniques:
Using Windows Semaphores
Using a pool of Mutexes (offer better recoverability than semaphores)
Using a range of ports | 2 | 3 | 0 | I'm looking for simple ways to monitor and limit the number of instances of our application under Terminal Server (2003 and 2008).
The purpose of this restriction is to make sure we don't overload our servers. This is an internal administrative requirement - I am not looking for a licensing solution.
The application in... | Technique to limit number of instances of our application under Terminal Server | 0.099668 | 0 | 0 | 702 |
2,409,812 | 2010-03-09T14:42:00.000 | 0 | 1 | 0 | 0 | php,python,pylons | 6,481,796 | 4 | false | 0 | 0 | Many many times have we had this discussion at my job. We use PHP and everyone here would love to switch to python. Even for our new web projects PHP delivers, and since we use it every day that is what we use. Many things in PHP irk me, and I love python, that said Im a big fan of "use the best tool for the job".
Good... | 4 | 4 | 0 | My friend and I are planning on building a sort of a forum type of webapp.
We've used the major PHP frameworks but we're really thinking about using Python specifically the Pylons framework for our app. Although we're competent PHP programmers, we're somewhat noobs at Python (We could create practical scripts and such)... | Should we use Pylons or PHP for our webapp? | 0 | 0 | 0 | 675 |
2,409,812 | 2010-03-09T14:42:00.000 | 5 | 1 | 0 | 0 | php,python,pylons | 2,409,917 | 4 | false | 0 | 0 | Don't be scared off by imports in python. They're much more common when coding in python than PHP in general, and this is good because your namespace never gets polluted with stuff you aren't expecting, unless you do from foo import * (so don't do that). I think you'll find that the structure pylons gives you will be... | 4 | 4 | 0 | My friend and I are planning on building a sort of a forum type of webapp.
We've used the major PHP frameworks but we're really thinking about using Python specifically the Pylons framework for our app. Although we're competent PHP programmers, we're somewhat noobs at Python (We could create practical scripts and such)... | Should we use Pylons or PHP for our webapp? | 0.244919 | 0 | 0 | 675 |
2,409,812 | 2010-03-09T14:42:00.000 | 9 | 1 | 0 | 0 | php,python,pylons | 2,409,852 | 4 | false | 0 | 0 | Decide what you want to put your focus on, being productive or learning a new language:
If you want to learn Pylons and Python, use Pylon and Python.
If you want to deliver a stable forum software, use PHP, because that's what you're competent at.
Note: I should add that this is not meant to imply that you cannot... | 4 | 4 | 0 | My friend and I are planning on building a sort of a forum type of webapp.
We've used the major PHP frameworks but we're really thinking about using Python specifically the Pylons framework for our app. Although we're competent PHP programmers, we're somewhat noobs at Python (We could create practical scripts and such)... | Should we use Pylons or PHP for our webapp? | 1 | 0 | 0 | 675 |
2,409,812 | 2010-03-09T14:42:00.000 | 4 | 1 | 0 | 0 | php,python,pylons | 2,409,860 | 4 | false | 0 | 0 | I don't know about Pylons but I've been in a similar situation and built a site using Django. I learned enough about Python in an environment that I was familiar with (web apps) that I now go to Python as my first choice. | 4 | 4 | 0 | My friend and I are planning on building a sort of a forum type of webapp.
We've used the major PHP frameworks but we're really thinking about using Python specifically the Pylons framework for our app. Although we're competent PHP programmers, we're somewhat noobs at Python (We could create practical scripts and such)... | Should we use Pylons or PHP for our webapp? | 0.197375 | 0 | 0 | 675 |
2,411,306 | 2010-03-09T18:01:00.000 | 0 | 0 | 1 | 0 | python,multithreading | 2,411,865 | 2 | true | 0 | 0 | If I had this problem (and "polling", i.e. trying each queue alternately with short timeouts, was unacceptable -- it usually is, being very wasteful of CPU time etc), I would tackle it by designing a "multiqueue" object -- one with multiple condition variables, one per "subqueue" and an overall one. A put to any subqu... | 2 | 0 | 0 | Say there are two empty Queues. Is there a way to get an item from the queue that gets it first?
So I have a queue of high anonymous proxies, queues of anonymous and transparent ones. Some threads may need only high anon. proxies, while others may accept both high anon. and just anon. proxies. That's why I can't put th... | How to get an item from a set of Queues? | 1.2 | 0 | 1 | 119 |
2,411,306 | 2010-03-09T18:01:00.000 | 0 | 0 | 1 | 0 | python,multithreading | 2,411,355 | 2 | false | 0 | 0 | You could check both queues in turn, each time using a short timeout. That way you would most likely read from the first queue that receives data. However, this solution is prone to race conditions if you will be getting many items on a regular basis.
If that is the case, do you have a good reason for not just writing ... | 2 | 0 | 0 | Say there are two empty Queues. Is there a way to get an item from the queue that gets it first?
So I have a queue of high anonymous proxies, queues of anonymous and transparent ones. Some threads may need only high anon. proxies, while others may accept both high anon. and just anon. proxies. That's why I can't put th... | How to get an item from a set of Queues? | 0 | 0 | 1 | 119 |
2,411,886 | 2010-03-09T19:21:00.000 | 0 | 0 | 0 | 0 | python,user-interface,python-3.x | 29,502,724 | 4 | false | 0 | 1 | I use exclusively Tkinter, and though it's somewhat limited in terms of images, it's remarkably easy to work with and follows the standard easy-to-read Python syntax very nicely. I'm not familiar with other GUI options, but Tkinter is great from my experience. | 1 | 4 | 0 | I was wondering what options are available for Python 3.x? I know Tkinter is available as well as qt, but what about the other libraries? Any word on when some of them may be ported over to 3.x? | GUI options with python 3.x | 0 | 0 | 0 | 968 |
2,414,616 | 2010-03-10T04:56:00.000 | 1 | 0 | 1 | 1 | c#,c++,python | 2,414,677 | 5 | false | 0 | 0 | The first solution would be to fix your EXE, so it does not crash. If you can not fix it now, you probably need to add exception handling, so you can catch the exception, and not close the EXE.
Second solution is to write simple guard programm that will start your simple .exe and will monitor specific process handle. I... | 1 | 0 | 0 | I have a simple .exe that needs to be running continuously.
Unfortunately, sometimes it crashes unexpectedly, and there's nothing that can be done for this.
I'm thinking of like a C# program that scans the running application tree on a timer and if the process stops running it re-launches it... ? Not sure how to do th... | How to make script/program to make it so an application is always running? | 0.039979 | 0 | 0 | 221 |
2,414,667 | 2010-03-10T05:08:00.000 | 29 | 0 | 1 | 0 | python,string | 13,345,099 | 8 | false | 0 | 0 | I have used the code of Oliver Crow (link given by Andrew Hare) and adapted it a bit to tailor Python 2.7.3. (by using timeit package). I ran on my personal computer, Lenovo T61, 6GB RAM, Debian GNU/Linux 6.0.6 (squeeze).
Here is the result for 10,000 iterations:
method1: 0.0538418292999 secs
process size 4800 kb
me... | 3 | 161 | 0 | Is there some string class in Python like StringBuilder in C#? | Python string class like StringBuilder in C#? | 1 | 0 | 0 | 173,157 |
2,414,667 | 2010-03-10T05:08:00.000 | 0 | 0 | 1 | 0 | python,string | 48,364,553 | 8 | false | 0 | 0 | There is no explicit analogue - i think you are expected to use string concatenations(likely optimized as said before) or third-party class(i doubt that they are a lot more efficient - lists in python are dynamic-typed so no fast-working char[] for buffer as i assume).
Stringbuilder-like classes are not premature opti... | 3 | 161 | 0 | Is there some string class in Python like StringBuilder in C#? | Python string class like StringBuilder in C#? | 0 | 0 | 0 | 173,157 |
2,414,667 | 2010-03-10T05:08:00.000 | 22 | 0 | 1 | 0 | python,string | 2,414,916 | 8 | false | 0 | 0 | Python has several things that fulfill similar purposes:
One common way to build large strings from pieces is to grow a list of strings and join it when you are done. This is a frequently-used Python idiom.
To build strings incorporating data with formatting, you would do the formatting separately.
For insertion ... | 3 | 161 | 0 | Is there some string class in Python like StringBuilder in C#? | Python string class like StringBuilder in C#? | 1 | 0 | 0 | 173,157 |
2,414,915 | 2010-03-10T06:21:00.000 | 9 | 0 | 1 | 0 | python,multithreading,r,concurrency,hadoop | 2,415,028 | 2 | true | 0 | 0 | While languages and associated technologies/frameworks are important for scaling, they tend to pale in comparison to the importance of the algorithms, data structure, and architectures. Forget threads: the number of cores you can exploit that way is just too limited -- you want separate processes exchanging messages, ... | 2 | 5 | 0 | I'd like to begin thinking about how I can scale up my algorithms that I write for data analysis so that they can be applied to arbitrarily large sets of data. I wonder what are the relevant concepts (threads, concurrency, immutable data structures, recursion) and tools (Hadoop/MapReduce, Terracota, and Eucalyptus) to ... | Concepts and tools required to scale up algorithms | 1.2 | 0 | 0 | 453 |
2,414,915 | 2010-03-10T06:21:00.000 | 3 | 0 | 1 | 0 | python,multithreading,r,concurrency,hadoop | 2,414,986 | 2 | false | 0 | 0 | The main thing for scaling up to large data is to avoid situations where you're reading huge datasets into memory at once. In pythonic terms this generally means using iterators to consume the dataset in manageable pieces. | 2 | 5 | 0 | I'd like to begin thinking about how I can scale up my algorithms that I write for data analysis so that they can be applied to arbitrarily large sets of data. I wonder what are the relevant concepts (threads, concurrency, immutable data structures, recursion) and tools (Hadoop/MapReduce, Terracota, and Eucalyptus) to ... | Concepts and tools required to scale up algorithms | 0.291313 | 0 | 0 | 453 |
2,414,917 | 2010-03-10T06:21:00.000 | 1 | 1 | 0 | 1 | python,linux,shell | 2,414,931 | 4 | false | 0 | 0 | Folder size is still the total size of the folder contents.
You may try to call du -s foldername from python | 2 | 2 | 0 | What will be the fastest way to check whether a folder size is beyond a specific size say 10 MB, 1 Gb , 10 GB etc, without actually calculating the folder size. Something like quota. A Pythonic solution will be great, but standard UNIX utilities also welcome | What is the fastest way to check whether a folder size is greater than a specific size? | 0.049958 | 0 | 0 | 1,806 |
2,414,917 | 2010-03-10T06:21:00.000 | 2 | 1 | 0 | 1 | python,linux,shell | 2,414,949 | 4 | false | 0 | 0 | I'd have to say it's impossible. I don't believe any filesystems cache folder sizes. Whatever you do is going to have to walk the tree in some fashion or another. Using du is probably the fastest method since it's all going to be happening in C.
If you know the maximum filesize expected or supported you could perhaps o... | 2 | 2 | 0 | What will be the fastest way to check whether a folder size is beyond a specific size say 10 MB, 1 Gb , 10 GB etc, without actually calculating the folder size. Something like quota. A Pythonic solution will be great, but standard UNIX utilities also welcome | What is the fastest way to check whether a folder size is greater than a specific size? | 0.099668 | 0 | 0 | 1,806 |
2,415,014 | 2010-03-10T06:45:00.000 | 2 | 0 | 0 | 0 | python,autocomplete,pythonpath | 2,415,055 | 1 | true | 1 | 0 | Have you tried adding Additional import directories in Edit/Preferences/ under Languages/Python in Komodo?
Edit: I think you can also add a .pth file in [komodo-install-dir]/lib/mozilla/python/ or C:\[PythonVersion]\Lib\site-packages\ containing all other path you might want to be available. Not sure wich way is more a... | 1 | 1 | 0 | I have 2 hard-drives, C:\ and D:\
Django imports correctly (which is in my C drive), but my application is on my D drive. I can't move it to the C drive because of some back-up software I'm running/
I'm trying to get auto-complete to work in Komodo Edit 5 which works fine for Django, but not for my application. There a... | Add directory to PYTHONPATH ( multiple drives ), for auto-complete | 1.2 | 0 | 0 | 1,976 |
2,416,677 | 2010-03-10T12:08:00.000 | 0 | 0 | 0 | 0 | python,django,django-templates | 2,416,776 | 3 | false | 1 | 0 | Django doesn't strip out javascript, because it is client side agnostic.
How are you inserting javascript into your website? If you are trying to put it into database (like ) it will escaped. | 2 | 0 | 0 | Very newbie question, but please be gentle with me. Our site uses Django CMS and we're trying to insert some javascript into particular stories, but it appears Django is stripping out any javascript or iframes we put in there as soon as we save the story. How do we allow javascript to be used in stories? Is it being de... | stop django from taking out javascript/frames? | 0 | 0 | 0 | 200 |
2,416,677 | 2010-03-10T12:08:00.000 | 2 | 0 | 0 | 0 | python,django,django-templates | 2,416,764 | 3 | false | 1 | 0 | Django is probably automatically escaping the content the javascript / html as the template renders the content. It does this for security purposes.
The solution depends on which version of django you're running, whether you'll be rendering any content from untrusted sources, how the templates are put together and perh... | 2 | 0 | 0 | Very newbie question, but please be gentle with me. Our site uses Django CMS and we're trying to insert some javascript into particular stories, but it appears Django is stripping out any javascript or iframes we put in there as soon as we save the story. How do we allow javascript to be used in stories? Is it being de... | stop django from taking out javascript/frames? | 0.132549 | 0 | 0 | 200 |
2,416,819 | 2010-03-10T12:31:00.000 | 2 | 0 | 0 | 0 | python,mysql,database,multithreading,insert | 2,417,080 | 1 | true | 1 | 0 | This is not caused by multithreading, but because there are more than one object in database, that satisfies your query. You must select exactly one object from the database using get, otherwise it will raise an exception. | 1 | 1 | 0 | Django's get_or_create function always cause "get() returned more than one Model name" error in a multi-threaded program.
I even tried to put get_or_create statement inside a lock.acquire() and lock.release() block but still didn't work.
The program only works when I set thread_count=1
The database is on InnoDB engine.... | Django and "get() returned more than one Model name" error in multi-threaded program | 1.2 | 0 | 0 | 4,232 |
2,417,705 | 2010-03-10T14:39:00.000 | 1 | 0 | 0 | 0 | python,gtk,pygtk,mplayer | 2,944,206 | 2 | false | 0 | 1 | You need to tell mplayer to zoom video according to window size. This can be done either in command line (-zoom) or in the configuration file (zoom = 1). | 1 | 0 | 0 | I've wrote a piece of code in python and pygtk for an embeded mplayer in a gui.
I assume I use GtkSocket and the slave mode of mplayer with the -wid option.
But I've got an issue, when the size of my GTK window is smaller than my stream, the stream appears to be cropped. And when the size of my window is bigger than my... | Dynamic resize with MPlayer and PyGTK | 0.099668 | 0 | 0 | 1,512 |
2,419,662 | 2010-03-10T18:54:00.000 | 1 | 0 | 1 | 0 | ironpython,visual-studio-2010 | 2,804,148 | 4 | false | 0 | 0 | Asking MS at PyCon 2009, they were investigating IPy for VS 'next plus 1' - which hasn't been released yet.
For VS2010, you can use IronPython Tools for Visual Studio 2010 - www.ironpython.net. | 4 | 11 | 0 | IronPython has been out for a while now, so when I installed Visual Studio 2010 RC1 "Ultimate" this morning I was surprised to find that it couldn't be selected from the installer. Instead, one still has to go out to Codeplex. Does anybody know why it hasn't been included? | Why can't IronPython be installed with Visual Studio 2010? | 0.049958 | 0 | 0 | 2,563 |
2,419,662 | 2010-03-10T18:54:00.000 | 3 | 0 | 1 | 0 | ironpython,visual-studio-2010 | 2,423,719 | 4 | true | 0 | 0 | This is what I have picked up from the IP mailing list...
Ironpython is on a different release cycle to Visual Studio and developed by a separate team. The MS G.O. team development process is far more responsive and agile than a 2 year release cycle. Given the changing nature of CPython (+other implementations) with fr... | 4 | 11 | 0 | IronPython has been out for a while now, so when I installed Visual Studio 2010 RC1 "Ultimate" this morning I was surprised to find that it couldn't be selected from the installer. Instead, one still has to go out to Codeplex. Does anybody know why it hasn't been included? | Why can't IronPython be installed with Visual Studio 2010? | 1.2 | 0 | 0 | 2,563 |
2,419,662 | 2010-03-10T18:54:00.000 | 3 | 0 | 1 | 0 | ironpython,visual-studio-2010 | 2,419,685 | 4 | false | 0 | 0 | They accept user submitted code, because of this there are patent issues and infringing code possibilities, John Lam talked about this in a podcast with dotnetrocks. What would happen if this code violated something? Microsoft would have to take Visual Studio off the shelves until they fixed it | 4 | 11 | 0 | IronPython has been out for a while now, so when I installed Visual Studio 2010 RC1 "Ultimate" this morning I was surprised to find that it couldn't be selected from the installer. Instead, one still has to go out to Codeplex. Does anybody know why it hasn't been included? | Why can't IronPython be installed with Visual Studio 2010? | 0.148885 | 0 | 0 | 2,563 |
2,419,662 | 2010-03-10T18:54:00.000 | -1 | 0 | 1 | 0 | ironpython,visual-studio-2010 | 2,419,681 | 4 | false | 0 | 0 | May be because it is not an "official" language? | 4 | 11 | 0 | IronPython has been out for a while now, so when I installed Visual Studio 2010 RC1 "Ultimate" this morning I was surprised to find that it couldn't be selected from the installer. Instead, one still has to go out to Codeplex. Does anybody know why it hasn't been included? | Why can't IronPython be installed with Visual Studio 2010? | -0.049958 | 0 | 0 | 2,563 |
2,419,770 | 2010-03-10T19:11:00.000 | 76 | 0 | 1 | 0 | python,generator | 2,421,288 | 6 | false | 0 | 0 | In Python <= 2.5, use gen.next(). This will work for all Python 2.x versions, but not Python 3.x
In Python >= 2.6, use next(gen). This is a built in function, and is clearer. It will also work in Python 3.
Both of these end up calling a specially named function, next(), which can be overridden by subclassing. In Python... | 4 | 143 | 0 | Very basic question - how to get one value from a generator in Python?
So far I found I can get one by writing gen.next(). I just want to make sure this is the right way? | How to get one value at a time from a generator function in Python? | 1 | 0 | 0 | 99,132 |
2,419,770 | 2010-03-10T19:11:00.000 | 5 | 0 | 1 | 0 | python,generator | 60,391,726 | 6 | false | 0 | 0 | To get the value associated with a generator object in python 3 and above use next(<your generator object>).
subsequent calls to next() produces successive object values in the queue. | 4 | 143 | 0 | Very basic question - how to get one value from a generator in Python?
So far I found I can get one by writing gen.next(). I just want to make sure this is the right way? | How to get one value at a time from a generator function in Python? | 0.16514 | 0 | 0 | 99,132 |
2,419,770 | 2010-03-10T19:11:00.000 | 189 | 0 | 1 | 0 | python,generator | 2,419,782 | 6 | true | 0 | 0 | Yes, or next(gen) in 2.6+. | 4 | 143 | 0 | Very basic question - how to get one value from a generator in Python?
So far I found I can get one by writing gen.next(). I just want to make sure this is the right way? | How to get one value at a time from a generator function in Python? | 1.2 | 0 | 0 | 99,132 |
2,419,770 | 2010-03-10T19:11:00.000 | 1 | 0 | 1 | 0 | python,generator | 37,890,506 | 6 | false | 0 | 0 | In python 3 you don't have gen.next(), but you still can use next(gen).
A bit bizarre if you ask me but that's how it is. | 4 | 143 | 0 | Very basic question - how to get one value from a generator in Python?
So far I found I can get one by writing gen.next(). I just want to make sure this is the right way? | How to get one value at a time from a generator function in Python? | 0.033321 | 0 | 0 | 99,132 |
2,420,219 | 2010-03-10T20:11:00.000 | 5 | 0 | 1 | 0 | python,memory,data-structures,matrix,swap | 2,420,257 | 4 | false | 0 | 0 | You need a database, if the data will exceed memory. The indexing of dictionaries isn't designed for good performance when a dictionary is bigger than memory. | 2 | 4 | 0 | I have a python program that is going to eat a lot of memory, primarily in a dict. This dict will be responsible for assigning a unique integer value to a very large set of keys. As I am working with large matrices, I need a key-to-index correspondence that can also be recovered from (i.e., once matrix computations a... | How does OS handle a python dict that's larger than memory? | 0.244919 | 0 | 0 | 1,227 |
2,420,219 | 2010-03-10T20:11:00.000 | 1 | 0 | 1 | 0 | python,memory,data-structures,matrix,swap | 2,420,260 | 4 | true | 0 | 0 | It will just end up in swap trashing, because a hash table has very much randomized memory access patterns.
If you know that the map exceeds the size of the physical memory, you could consider using a data structure on the disk in the first place. This especially if you don't need the data structure during the computat... | 2 | 4 | 0 | I have a python program that is going to eat a lot of memory, primarily in a dict. This dict will be responsible for assigning a unique integer value to a very large set of keys. As I am working with large matrices, I need a key-to-index correspondence that can also be recovered from (i.e., once matrix computations a... | How does OS handle a python dict that's larger than memory? | 1.2 | 0 | 0 | 1,227 |
2,420,671 | 2010-03-10T21:19:00.000 | 8 | 0 | 1 | 0 | python,serial-port,escaping | 3,219,355 | 2 | true | 0 | 0 | There is no such thing as an "escape sequence" for the ESC key on a VT-100 (or other terminals that used escape sequences).
The escape character, ASCII 27, was used to indicate that the following sequences of characters had special meaning. This usually put the terminal into a simple state machine. In general the rul... | 2 | 5 | 0 | I'm writing a script to navigate a text-based menu system, using python's telnetlib to access a serial connection.
I can happily press the F-keys, using the escape codes. e.g. F9 = "\033OX", where "\033" is the escape sequence.
How do I encode the "esc" keyboard key? I would have expected just "\033", but that doesn'... | What's the VT100 escape code for the "esc" keyboard key itself | 1.2 | 0 | 0 | 4,218 |
2,420,671 | 2010-03-10T21:19:00.000 | 6 | 0 | 1 | 0 | python,serial-port,escaping | 2,420,715 | 2 | false | 0 | 0 | Put a small delay, say 1.5s, after sending the escape so that the other side realizes that it's an isolated escape and not part of a longer sequence. | 2 | 5 | 0 | I'm writing a script to navigate a text-based menu system, using python's telnetlib to access a serial connection.
I can happily press the F-keys, using the escape codes. e.g. F9 = "\033OX", where "\033" is the escape sequence.
How do I encode the "esc" keyboard key? I would have expected just "\033", but that doesn'... | What's the VT100 escape code for the "esc" keyboard key itself | 1 | 0 | 0 | 4,218 |
2,421,007 | 2010-03-10T22:10:00.000 | 4 | 1 | 0 | 0 | python,rest,web-services,apache2 | 2,421,023 | 6 | false | 0 | 0 | If you just want to run web apps then use mod_wsgi. If you need to write a handler for the rest of httpd's request/response phases then use mod_python. | 5 | 5 | 0 | I am planning to write web service in python. But, I found wsgi also does the similar thing. Which one can be preferred?
Thank you
Bala
Update
I am still confused. Please help.
Better in my sense means:
1. Bug will be fixed periodically.
2. Chosen by most developers.
3. Additional features like authentication tokens ... | Apache2: mod_wsgi or mod_python, which one is better? | 0.132549 | 0 | 0 | 5,895 |
2,421,007 | 2010-03-10T22:10:00.000 | 0 | 1 | 0 | 0 | python,rest,web-services,apache2 | 2,422,260 | 6 | false | 0 | 0 | Bug will be fixed periodically.
Unless you're paying money, you cannot have any idea about this.
Chosen by most developers.
mod_wsgi
Additional features like authentication tokens like AWS, can be supported out of the box.
True for every framework.
No strong dependency on version.( I see that wsgi requires python 2.... | 5 | 5 | 0 | I am planning to write web service in python. But, I found wsgi also does the similar thing. Which one can be preferred?
Thank you
Bala
Update
I am still confused. Please help.
Better in my sense means:
1. Bug will be fixed periodically.
2. Chosen by most developers.
3. Additional features like authentication tokens ... | Apache2: mod_wsgi or mod_python, which one is better? | 0 | 0 | 0 | 5,895 |
2,421,007 | 2010-03-10T22:10:00.000 | 1 | 1 | 0 | 0 | python,rest,web-services,apache2 | 2,422,564 | 6 | false | 0 | 0 | mod_wsgi is much more actively maintained than mod_python at this point. It also has a good bit of momentum, as it was somewhat recently adopted as the preferred deployment method on apache2 by Django. The author is also actively engaged with the Python community in regards to the future evolution of WSGI. | 5 | 5 | 0 | I am planning to write web service in python. But, I found wsgi also does the similar thing. Which one can be preferred?
Thank you
Bala
Update
I am still confused. Please help.
Better in my sense means:
1. Bug will be fixed periodically.
2. Chosen by most developers.
3. Additional features like authentication tokens ... | Apache2: mod_wsgi or mod_python, which one is better? | 0.033321 | 0 | 0 | 5,895 |
2,421,007 | 2010-03-10T22:10:00.000 | 5 | 1 | 0 | 0 | python,rest,web-services,apache2 | 2,421,104 | 6 | false | 0 | 0 | Don't confuse what WSGI and mod_wsgi are. WSGI is an interface specification for hosting Python web applications on a server. The mod_wsgi module is an implementation of the WSGI specification using Apache as the underlying web server. Thus, Python and WSGI are not choices exactly, WSGI is just one way of being able to... | 5 | 5 | 0 | I am planning to write web service in python. But, I found wsgi also does the similar thing. Which one can be preferred?
Thank you
Bala
Update
I am still confused. Please help.
Better in my sense means:
1. Bug will be fixed periodically.
2. Chosen by most developers.
3. Additional features like authentication tokens ... | Apache2: mod_wsgi or mod_python, which one is better? | 0.16514 | 0 | 0 | 5,895 |
2,421,007 | 2010-03-10T22:10:00.000 | 3 | 1 | 0 | 0 | python,rest,web-services,apache2 | 2,421,190 | 6 | false | 0 | 0 | mod_wsgi is specifically tuned to run Python web apps that use WSGI in Apache. mod_python is for any kind of Python web app, including WSGI apps. mod_wsgi also has a lower memory footprint than mod_python. | 5 | 5 | 0 | I am planning to write web service in python. But, I found wsgi also does the similar thing. Which one can be preferred?
Thank you
Bala
Update
I am still confused. Please help.
Better in my sense means:
1. Bug will be fixed periodically.
2. Chosen by most developers.
3. Additional features like authentication tokens ... | Apache2: mod_wsgi or mod_python, which one is better? | 0.099668 | 0 | 0 | 5,895 |
2,421,586 | 2010-03-10T23:54:00.000 | 179 | 1 | 0 | 1 | python,bash,language-comparisons | 2,421,592 | 2 | true | 0 | 0 | You can use : for this. | 2 | 125 | 0 | Is there a Bash equivalent to the Python's pass statement? | What is the Bash equivalent of Python's pass statement | 1.2 | 0 | 0 | 36,506 |
2,421,586 | 2010-03-10T23:54:00.000 | 45 | 1 | 0 | 1 | python,bash,language-comparisons | 2,421,637 | 2 | false | 0 | 0 | true is a command that successfully does nothing.
(false would, in a way, be the opposite: it doesn't do anything, but claims that a failure occurred.) | 2 | 125 | 0 | Is there a Bash equivalent to the Python's pass statement? | What is the Bash equivalent of Python's pass statement | 1 | 0 | 0 | 36,506 |
2,425,656 | 2010-03-11T14:24:00.000 | -2 | 0 | 1 | 0 | python,overriding,final | 2,428,648 | 4 | false | 0 | 0 | Yes there is, don't do it.
I should add to this after the down-vote. Such protection mechanisms are seen by some to go against the ethos of Python, that "we are all consenting adults here".Who do you want to protect such functions from? And if a comment will not suffice why would something 'stronger'?
I would document ... | 2 | 41 | 0 | Is there a way to make a class function unoverriddable? something like java's final keyword. i.e, any overriding class cannot override that method. | How to prevent a function from being overridden in python | -0.099668 | 0 | 0 | 18,512 |
2,425,656 | 2010-03-11T14:24:00.000 | 1 | 0 | 1 | 0 | python,overriding,final | 51,879,567 | 4 | false | 0 | 0 | Using a double underscore before a method in a class is not just a naming convention. By doing so the method name is mangled with classname(_classname__methodname()).
By inheriting a class with a method having double underscores in front of it;for the child class it becomes difficult to override the above specified met... | 2 | 41 | 0 | Is there a way to make a class function unoverriddable? something like java's final keyword. i.e, any overriding class cannot override that method. | How to prevent a function from being overridden in python | 0.049958 | 0 | 0 | 18,512 |
2,428,077 | 2010-03-11T19:38:00.000 | 0 | 0 | 0 | 0 | php,python,ruby-on-rails,programming-languages,saas | 2,430,572 | 3 | false | 1 | 0 | If you wan't to run a version of the server on desktops, your best options would be Python, Rails, or Java servlets, all of which can be easily packaged into small self contained servers with no dependencies.
My recommendation for the desktop would be HTML 5 local storage. The standard hasn't been finalized, but there... | 3 | 1 | 0 | I have an idea for a product that I want to be web-based. But because I live in a part of the world where the internet is not always available, there needs to be a client desktop component that is available for when the internet is down. Also, I have been a SQL programmer, a desktop application programmer using dBase, ... | Old desktop programmer wants to create S+S project | 0 | 1 | 0 | 174 |
2,428,077 | 2010-03-11T19:38:00.000 | 0 | 0 | 0 | 0 | php,python,ruby-on-rails,programming-languages,saas | 2,429,484 | 3 | false | 1 | 0 | The languages you list are all serverside components. The big question is whether you can sensibly build a thick client - effectively you could develop a multi-tier application where the webserver sits on the client and uses a webservice as a datafeed if/when its available but the solution is not very portable.
You cou... | 3 | 1 | 0 | I have an idea for a product that I want to be web-based. But because I live in a part of the world where the internet is not always available, there needs to be a client desktop component that is available for when the internet is down. Also, I have been a SQL programmer, a desktop application programmer using dBase, ... | Old desktop programmer wants to create S+S project | 0 | 1 | 0 | 174 |
2,428,077 | 2010-03-11T19:38:00.000 | 0 | 0 | 0 | 0 | php,python,ruby-on-rails,programming-languages,saas | 2,428,452 | 3 | false | 1 | 0 | If you want a 'desktop component' that is available for you to do development on whenever your internet is out, you could really choose any of those technologies. You can always have a local server (like apache) running on your machine, as well as a local sql database, though if your database contains a large amount of... | 3 | 1 | 0 | I have an idea for a product that I want to be web-based. But because I live in a part of the world where the internet is not always available, there needs to be a client desktop component that is available for when the internet is down. Also, I have been a SQL programmer, a desktop application programmer using dBase, ... | Old desktop programmer wants to create S+S project | 0 | 1 | 0 | 174 |
2,428,301 | 2010-03-11T20:11:00.000 | 7 | 0 | 1 | 0 | python | 2,428,363 | 6 | false | 0 | 0 | Circular references are a normal thing to do, so I don't see a reason to be worried about them. Many tree algorithms require that each node have links to its children and its parent. They're also required to implement something like a doubly linked list. | 2 | 43 | 0 | Suppose I have code that maintains a parent/children structure. In such a structure I get circular references, where a child points to a parent and a parent points to a child. Should I worry about them? I'm using Python 2.5.
I am concerned that they will not be garbage collected and the application will eventually cons... | Should I worry about circular references in Python? | 1 | 0 | 0 | 26,532 |
2,428,301 | 2010-03-11T20:11:00.000 | 12 | 0 | 1 | 0 | python | 2,428,360 | 6 | false | 0 | 0 | Python will detect the cycle and release the memory when there are no outside references. | 2 | 43 | 0 | Suppose I have code that maintains a parent/children structure. In such a structure I get circular references, where a child points to a parent and a parent points to a child. Should I worry about them? I'm using Python 2.5.
I am concerned that they will not be garbage collected and the application will eventually cons... | Should I worry about circular references in Python? | 1 | 0 | 0 | 26,532 |
2,428,391 | 2010-03-11T20:20:00.000 | 0 | 0 | 1 | 0 | python | 2,428,430 | 4 | false | 0 | 0 | If you're creating a class that should act sort of like an array or dictionary, these are very useful so that your syntax looks familiar. For example, if you wanted to create an ordered dictionary, you could use all of the functions you mentioned so that you could interchange that with a regular dictionary. | 2 | 1 | 0 | I know that classes can implement various special methods, such as __iter__, __setitem__, __len__, __setattr__, and many others. But when should I use them? Can anyone describe typical scenarios when I would want to implement them and they would simplify programming in Python?
Thanks, Boda Cydo. | When to use Python special methods? | 0 | 0 | 0 | 292 |
2,428,391 | 2010-03-11T20:20:00.000 | 0 | 0 | 1 | 0 | python | 12,573,111 | 4 | false | 0 | 0 | getattr and setattr are useful when you want to implement an interface by delegating to an instance member instead of straight inheritance. You map them to the getattr and setattr of the member. | 2 | 1 | 0 | I know that classes can implement various special methods, such as __iter__, __setitem__, __len__, __setattr__, and many others. But when should I use them? Can anyone describe typical scenarios when I would want to implement them and they would simplify programming in Python?
Thanks, Boda Cydo. | When to use Python special methods? | 0 | 0 | 0 | 292 |
2,429,039 | 2010-03-11T22:07:00.000 | 1 | 0 | 1 | 0 | python | 2,429,057 | 5 | false | 0 | 0 | There have been several proposals for a compose operation, but none have been formalized. In the meantime it is possible to use a list comprehension or a generator expression to apply complex transformations to a sequence. | 1 | 2 | 0 | Haskell provides the feature something like f = f1 . f2
How can I mimic that with Python?
For example, if I have to do the 'map' operation two times, is there any way to do something like map . map in Python?
x = ['1','2','3']
x = map(int,x)
x = map(lambda i:i+1, x) | Mimic Haskell with Python | 0.039979 | 0 | 0 | 203 |
2,429,073 | 2010-03-11T22:11:00.000 | 0 | 0 | 1 | 0 | python | 2,429,139 | 5 | false | 0 | 0 | for i, v in enumerate(buff):
if i != v - 1:
print "MISSING OR DUPLICATE" | 1 | 1 | 0 | testGroupList is a list of integer.
I need to check the numbers in testGroupList is sequential and not duplicate numbers. Ignore the negative integer.
For example, [1,2,-1,2,3,4] is an error as 2 is duplicated, but [-1,3,2,4,1,5] is OK.
I implemented it as follows, and it's pretty ugly. Is there any clever way to do ... | Check if the integer in a list is not duplicated, and sequential | 0 | 0 | 0 | 1,080 |
2,430,423 | 2010-03-12T04:02:00.000 | 4 | 0 | 0 | 0 | python,xml | 2,430,575 | 4 | false | 0 | 0 | I find xml.etree essentially sufficient for everything, except for BeautifulSoup if I ever need to parse broken XML (not a common problem, differently from broken HTML, which BeautifulSoup also helps with and is everywhere): it has reasonable support for reading entire XML docs in memory, navigating them, creating them... | 3 | 8 | 0 | A search for "python" and "xml" returns a variety of libraries for combining the two.
This list probably faulty:
xml.dom
xml.etree
xml.sax
xml.parsers.expat
PyXML
beautifulsoup?
HTMLParser
htmllib
sgmllib
Be nice if someone can offer a quick summary of when to use which, and why. | Which XML library for what purposes? | 0.197375 | 0 | 1 | 803 |
2,430,423 | 2010-03-12T04:02:00.000 | 6 | 0 | 0 | 0 | python,xml | 2,430,541 | 4 | true | 0 | 0 | The DOM/SAX divide is a basic one. It applies not just to python since DOM and SAX are cross-language.
DOM: read the whole document into memory and manipulate it.
Good for:
complex relationships across tags in the markup
small intricate XML documents
Cautions:
Easy to use excessive memory
SAX: parse the document w... | 3 | 8 | 0 | A search for "python" and "xml" returns a variety of libraries for combining the two.
This list probably faulty:
xml.dom
xml.etree
xml.sax
xml.parsers.expat
PyXML
beautifulsoup?
HTMLParser
htmllib
sgmllib
Be nice if someone can offer a quick summary of when to use which, and why. | Which XML library for what purposes? | 1.2 | 0 | 1 | 803 |
2,430,423 | 2010-03-12T04:02:00.000 | 1 | 0 | 0 | 0 | python,xml | 2,430,695 | 4 | false | 0 | 0 | For many problems you can get by with the xml. It has the major advantage of being part of the standard library. This means that it is pre-installed on almost every system and that the interface will be static. It is not the best, or the fastest, but it is there.
For everything else there is lxml. Specically, lxml ... | 3 | 8 | 0 | A search for "python" and "xml" returns a variety of libraries for combining the two.
This list probably faulty:
xml.dom
xml.etree
xml.sax
xml.parsers.expat
PyXML
beautifulsoup?
HTMLParser
htmllib
sgmllib
Be nice if someone can offer a quick summary of when to use which, and why. | Which XML library for what purposes? | 0.049958 | 0 | 1 | 803 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.