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,847,202 | 2010-10-02T19:29:00.000 | 1 | 0 | 0 | 1 | python,django,google-app-engine | 14,967,904 | 4 | false | 1 | 0 | I believe that Django is better because it gives more flexibility with features and also with hosts. Djangobook.com has a very good tutorial. | 2 | 13 | 0 | I've been learning Python and now I'd like to learn a Python-based web framework. I'm considering Google App Engine and Django. Which one should I choose? What are their unique features and learning curves? | Google App Engine or Django? | 0.049958 | 0 | 0 | 5,657 |
3,847,803 | 2010-10-02T22:41:00.000 | 0 | 0 | 0 | 1 | java,python,rest | 3,881,996 | 1 | false | 1 | 0 | Hmm, if you're into Python and open to a Java element, you might want to consider using the Java framework Restlet with Python code running in Jython. I'm a big fan of Restlet; its API embodies RESTful principles, so it encourages one to structure one's code and thinking according to those principles. It's also just a ... | 1 | 1 | 0 | I would like to build something like this
Datastore | mycode.py | RESTful API | mywebapp.py(Django or Tornado)
I checked Piston for Django but it seems that this way I am going to be tied to Django, I would rather have a RESTful API for mycode.py that is consumable by more than one REST client and also can consume it f... | Deciding on RESTful Architecture for my Python code API | 0 | 0 | 0 | 643 |
3,848,091 | 2010-10-03T00:41:00.000 | 6 | 0 | 1 | 0 | python,set,iteration | 3,848,337 | 7 | false | 0 | 0 | The set's iteration order depends not only its contents, but on the order in which the items were inserted into the set, and whether there were deletions along the way. So you can create two different sets, using different insertions and deletions, and end up with the same set at the end, but with different iteration ... | 4 | 33 | 0 | Why does the iteration order of a Python set (with the same contents) vary from run to run, and what are my options for making it consistent from run to run?
I understand that the iteration order for a Python set is arbitrary. If I put 'a', 'b', and 'c' into a set and then iterate them, they may come back out in any o... | Set iteration order varies from run to run | 1 | 0 | 0 | 16,948 |
3,848,091 | 2010-10-03T00:41:00.000 | 13 | 0 | 1 | 0 | python,set,iteration | 3,848,111 | 7 | true | 0 | 0 | What you want isn't possible. Arbitrary means arbitrary.
My solution would be the same as yours, you have to sort the set if you want to be able to compare it to another one. | 4 | 33 | 0 | Why does the iteration order of a Python set (with the same contents) vary from run to run, and what are my options for making it consistent from run to run?
I understand that the iteration order for a Python set is arbitrary. If I put 'a', 'b', and 'c' into a set and then iterate them, they may come back out in any o... | Set iteration order varies from run to run | 1.2 | 0 | 0 | 16,948 |
3,848,091 | 2010-10-03T00:41:00.000 | 1 | 0 | 1 | 0 | python,set,iteration | 40,900,811 | 7 | false | 0 | 0 | You can set the expected result to be also a set. And checks if those two sets are equal using ==. | 4 | 33 | 0 | Why does the iteration order of a Python set (with the same contents) vary from run to run, and what are my options for making it consistent from run to run?
I understand that the iteration order for a Python set is arbitrary. If I put 'a', 'b', and 'c' into a set and then iterate them, they may come back out in any o... | Set iteration order varies from run to run | 0.028564 | 0 | 0 | 16,948 |
3,848,091 | 2010-10-03T00:41:00.000 | -1 | 0 | 1 | 0 | python,set,iteration | 3,848,182 | 7 | false | 0 | 0 | Contrary to sets, lists have always a guaranteed order, so you could toss the set and use the list. | 4 | 33 | 0 | Why does the iteration order of a Python set (with the same contents) vary from run to run, and what are my options for making it consistent from run to run?
I understand that the iteration order for a Python set is arbitrary. If I put 'a', 'b', and 'c' into a set and then iterate them, they may come back out in any o... | Set iteration order varies from run to run | -0.028564 | 0 | 0 | 16,948 |
3,848,490 | 2010-10-03T03:45:00.000 | 0 | 0 | 0 | 0 | python,django | 3,848,525 | 4 | false | 1 | 0 | When you deploy and app as a standalone package, it is just another Python package, which happens to implement Django views, templates, template tags, etc. Therefore, Django's search path is the Python search path itself. This is why people say "Just make sure the package structure is correct and django can run without... | 4 | 1 | 0 | I learned Django following django book and the document. In the django book exmaple, the project is called mysite and there's an app called book inside this project. So in this case, the app is called "book". I've no problem with it.
My confusion arises in front of reusable apps. Reusable apps usually reside outside th... | Confusion about django app's name | 0 | 0 | 0 | 5,314 |
3,848,490 | 2010-10-03T03:45:00.000 | 2 | 0 | 0 | 0 | python,django | 3,848,861 | 4 | true | 1 | 0 | The name of the app is the name of the directory, capitalization and all, unless you go to the extra work to change the name in the appropriate __init__.py file. Django apps are, after all, just Python modules, and all the same rules apply.
If you ever see an app or module name with different capitalization or other mo... | 4 | 1 | 0 | I learned Django following django book and the document. In the django book exmaple, the project is called mysite and there's an app called book inside this project. So in this case, the app is called "book". I've no problem with it.
My confusion arises in front of reusable apps. Reusable apps usually reside outside th... | Confusion about django app's name | 1.2 | 0 | 0 | 5,314 |
3,848,490 | 2010-10-03T03:45:00.000 | 0 | 0 | 0 | 0 | python,django | 3,848,948 | 4 | false | 1 | 0 | An app name is just the name of the Python module. Nothing more.
A python module name is the case name of the root folder of the module, that must contains an init.py file.
If you want to know what this name is, go to your site-packages folder and look for your module. | 4 | 1 | 0 | I learned Django following django book and the document. In the django book exmaple, the project is called mysite and there's an app called book inside this project. So in this case, the app is called "book". I've no problem with it.
My confusion arises in front of reusable apps. Reusable apps usually reside outside th... | Confusion about django app's name | 0 | 0 | 0 | 5,314 |
3,848,490 | 2010-10-03T03:45:00.000 | 1 | 0 | 0 | 0 | python,django | 3,848,893 | 4 | false | 1 | 0 | My confusion arises in front of reusable apps. Reusable apps usually reside outside the project. For example, django-registration only has an independent folder "registration". So what's its app name? "Registration", right?
django-registration is the project name. The application name is registration:
in application ... | 4 | 1 | 0 | I learned Django following django book and the document. In the django book exmaple, the project is called mysite and there's an app called book inside this project. So in this case, the app is called "book". I've no problem with it.
My confusion arises in front of reusable apps. Reusable apps usually reside outside th... | Confusion about django app's name | 0.049958 | 0 | 0 | 5,314 |
3,848,658 | 2010-10-03T04:55:00.000 | 3 | 0 | 1 | 0 | python,database,sqlite,encryption | 3,850,560 | 2 | true | 0 | 0 | This question comes up on the SQLite users mailing list about once a month.
No matter how much encryption etc you do, if the database is on the client machine then the key to decrypt will also be on the machine at some point. An attacker will be able to get that key since it is their machine.
A better way of looking a... | 1 | 4 | 0 | I have been working on developing this analytical tool to help interpret and analyze a database that is bundled within the package. It is very important for us to secure the database in a way that can only be accessed with our software. What is the best way of achieving it in Python?
I am aware that there may not be a... | Encrypting a Sqlite db file that will be bundled in a pyexe file | 1.2 | 1 | 0 | 4,184 |
3,848,671 | 2010-10-03T05:05:00.000 | 5 | 0 | 0 | 1 | python,google-app-engine,runtime,yaml | 3,849,039 | 3 | true | 1 | 0 | No, but some of the data is available from os.environ - for example, os.environ['APPLICATION_ID'], and os.environ['CURRENT_VERSION_ID']. | 1 | 3 | 0 | Is it possible to programmatically retrieve any of the YAML parameters during run-time? Are they stored in the environment somewhere?
Good example would be to automatically find the application version and to add it as a comment in the landing HTML page. | Retrieving YAML parameters during runtime in App Engine (Python) | 1.2 | 0 | 0 | 1,038 |
3,849,632 | 2010-10-03T11:59:00.000 | 0 | 0 | 0 | 0 | python,xml,xsd | 5,188,517 | 1 | false | 0 | 0 | If you are running Jython (http://jython.org/) then you could import trang and run it internally. | 1 | 3 | 0 | I have a list of xml examples I would like to turn into schemas (xsd files). Exactly what the trang tool does (http://www.thaiopensource.com/relaxng/trang.html). I don't like calling trang from my script (i.e doing os.system('java -jar trang...')) - is there a python package I can use instead? | Python: Is there a way to generate xsd files based on xml examples | 0 | 0 | 1 | 387 |
3,849,762 | 2010-10-03T12:40:00.000 | 0 | 0 | 1 | 0 | python,python-3.x | 25,310,992 | 4 | false | 0 | 0 | Notice that easy_install is shipped with Python 3.4 and higher | 1 | 35 | 0 | What is the current status of easy_install, pip and the repository (pypi.python.org) with regards to Python 3.x?
Are there versions of easy_install and/or pip that can install the right versions of packages from there? Else, are they expected soon? | Python 3, easy_install, pip and pypi | 0 | 0 | 0 | 58,539 |
3,850,022 | 2010-10-03T13:55:00.000 | -1 | 0 | 0 | 0 | python,performance,sqlite | 3,850,164 | 10 | false | 0 | 0 | sqlite supports in-memory databases.
In python, you would use a :memory: database name for that.
Perhaps you could open two databases (one from the file, an empty one in-memory), migrate everything from the file database into memory, then use the in-memory database further to do calculations. | 2 | 72 | 0 | I have an existing sqlite3 db file, on which I need to make some extensive calculations. Doing the calculations from the file is painfully slow, and as the file is not large (~10 MB), so there should be no problem to load it into memory.
Is there a Pythonic way to load the existing file into memory in order to speed up... | How to load existing db file to memory in Python sqlite3? | -0.019997 | 1 | 0 | 46,619 |
3,850,022 | 2010-10-03T13:55:00.000 | 0 | 0 | 0 | 0 | python,performance,sqlite | 57,569,063 | 10 | false | 0 | 0 | With the solution of Cenk Alti, I always had a MemoryError with Python 3.7, when the process reached 500MB. Only with the use of the backup functionality of sqlite3 (mentioned by thinwybk), I was able to to load and save bigger SQLite databases. Also you can do the same with just 3 lines of code, both ways. | 2 | 72 | 0 | I have an existing sqlite3 db file, on which I need to make some extensive calculations. Doing the calculations from the file is painfully slow, and as the file is not large (~10 MB), so there should be no problem to load it into memory.
Is there a Pythonic way to load the existing file into memory in order to speed up... | How to load existing db file to memory in Python sqlite3? | 0 | 1 | 0 | 46,619 |
3,850,708 | 2010-10-03T17:07:00.000 | 3 | 0 | 1 | 0 | python,multiprocessing | 3,850,730 | 3 | false | 0 | 0 | If you use the multiprocessing package, every child process has is_alive method you can check. So one option to to hold a list of all running processes and periodically check is_alive and re-spawn dead processes.
If you're on POSIX system, you can also catch SIGCHLD (using signal) and get notified when a child process ... | 1 | 0 | 0 | I have a "master" process that needs to spawn some child processes.
How can I manage these child processes? (for example, restart if the process is dead)
Thanks! | Python multiprocessing | 0.197375 | 0 | 0 | 1,144 |
3,851,884 | 2010-10-03T22:43:00.000 | 2 | 0 | 1 | 0 | python,algorithm | 3,851,940 | 2 | false | 0 | 0 | Make recursive search over directory and for each file store md5 or sha checksum of file in dictionary as key and path/name as value. Make this dictionary for both directories. Then you can remove pairs from each directory and result is missing/different files.
This will make simple O(n) algorhitm, where n is volume o... | 1 | 2 | 0 | I'm going to implement recursive folder comparison on python. What do you think would best algorithm for this?
Get two lists of the files for the folders
Sort both lists
Compare using filecmp module for a file
Repeat for every folder recursively
In result I need to get only the list of the files that are different (c... | Compare folders recursively using python | 0.197375 | 0 | 0 | 1,820 |
3,852,146 | 2010-10-04T00:29:00.000 | 0 | 0 | 0 | 0 | python,wxpython | 3,855,400 | 3 | false | 0 | 1 | DC's only use integers. Try using Cairo or wx.GraphicsContext. | 1 | 1 | 1 | I have input values of x, y, z coordinates in the following format:
[-11.235865 5.866001 -4.604924]
[-11.262565 5.414276 -4.842384]
[-11.291885 5.418229 -4.849229]
[-11.235865 5.866001 -4.604924]
I want to draw polygons and succeeded with making a list of wx.point objects. But I need to plot floating point coordinates ... | How to draw polygons with Point2D in wxPython? | 0 | 0 | 0 | 1,320 |
3,853,038 | 2010-10-04T05:22:00.000 | 0 | 0 | 0 | 1 | python,macos,command-line | 3,853,095 | 2 | false | 0 | 0 | have you tried using the nohup? lets say you have a launch script to start your program:
launch.sh:
nohup your_program &
exit | 1 | 2 | 0 | For great help from stackoverflow, the development for the Mac version of my program is done.
Now I need to deploy my program, and I was wondering if there is any way to "hide" my running Python code (it also runs .so library and it seems it makes a dock item to appear).
The program is supposed to be running in the ba... | Run a python script and a compiled c code without terminal or dock item in Mac OS X | 0 | 0 | 0 | 1,064 |
3,855,015 | 2010-10-04T12:02:00.000 | 12 | 1 | 1 | 0 | python,object,methods,getattr | 3,855,032 | 3 | false | 0 | 0 | There is no difference. A method is also an attribute. (If you want the method to have an implicit "self" argument, though, you'll have to do some more work to "bind" the method). | 1 | 16 | 0 | When an attribute is not found object.__getattr__ is called. Is there an equivalent way to intercept undefined methods? | __getattr__ equivalent for methods | 1 | 0 | 0 | 6,173 |
3,855,537 | 2010-10-04T13:12:00.000 | 4 | 1 | 1 | 0 | python,arrays,performance,sorting | 3,859,736 | 10 | false | 0 | 0 | Radix sort theoretically runs in linear time (sort time grows roughly in direct proportion to array size ), but in practice Quicksort is probably more suited, unless you're sorting absolutely massive arrays.
If you want to make quicksort a bit faster, you can use insertion sort] when the array size becomes small.
It wo... | 1 | 20 | 1 | What is the fastest way to sort an array of whole integers bigger than 0 and less than 100000 in Python? But not using the built in functions like sort.
Im looking at the possibility to combine 2 sport functions depending on input size. | Fastest way to sort in Python | 0.07983 | 0 | 0 | 57,933 |
3,856,314 | 2010-10-04T14:44:00.000 | 4 | 0 | 1 | 0 | python,emacs | 3,856,478 | 6 | false | 0 | 0 | I'm spoiled by Intellisense too. The PyDev extensions for Eclipse offer a pretty good auto-complete substitute. | 1 | 4 | 0 | After using C# for long time I finally decided to switch to Python.
The question I am facing for the moment has to do about auto-complete.
I guess I am spoiled by C# and especially from resharper and I was expecting something similar to exist for Python.
My editor of choice is emacs and after doing some research I foun... | Python Code Completion | 0.132549 | 0 | 0 | 2,302 |
3,856,917 | 2010-10-04T15:57:00.000 | 1 | 0 | 1 | 0 | python,lisp,common-lisp,python-2.x | 3,878,723 | 5 | false | 0 | 0 | Both Lisp's and Python's apply function do the same thing -- given a function f and a list of parameters p, apply f to p. The only difference is that Python's apply also accepts a dictionary for keyword arguments. In Lisp, these would be included in the parameter list as :keyword arguments. | 2 | 2 | 0 | Lisp's APPLY is for calling functions with computed argument stored in lists.(Modified from Rainer's comment)
For example, the following code changes (list 1 2 3) to (+ 1 2 3).
(apply #'+ '(1 2 3))
However, Python's apply does what Lisp's funcall does, except for some minor differences (input is given as tuple/list)... | Lisp's apply and funcall vs Python's apply | 0.039979 | 0 | 0 | 4,779 |
3,856,917 | 2010-10-04T15:57:00.000 | 2 | 0 | 1 | 0 | python,lisp,common-lisp,python-2.x | 3,857,107 | 5 | false | 0 | 0 | I don't see why you claim Lisp's apply() would do anything different than Python's. Both functions take a function and a list and then call the function with the list elements as arguments. ((+ 1 2 3) is an call to + with arguments 1, 2 and 3, isn't it?) To me it looks like both applys do exactly the same thing.
funcal... | 2 | 2 | 0 | Lisp's APPLY is for calling functions with computed argument stored in lists.(Modified from Rainer's comment)
For example, the following code changes (list 1 2 3) to (+ 1 2 3).
(apply #'+ '(1 2 3))
However, Python's apply does what Lisp's funcall does, except for some minor differences (input is given as tuple/list)... | Lisp's apply and funcall vs Python's apply | 0.07983 | 0 | 0 | 4,779 |
3,857,140 | 2010-10-04T16:22:00.000 | 6 | 0 | 0 | 0 | python,google-app-engine,google-cloud-datastore | 3,857,498 | 2 | false | 1 | 0 | The 'low level' API is in google.appengine.api.datastore. There's no public documentation for it, but the module itself has fairly complete docstrings. | 1 | 3 | 0 | What is the alternative for Entity.java in python version?
I do not want any data model. I want my entities without a predefined structure. I just want them to be key and value pairs as the above Entity.java is.
Can I do it in Python version? | How to access lowlevel API for storing data in Google App Engine for python | 1 | 0 | 0 | 304 |
3,857,883 | 2010-10-04T18:03:00.000 | 2 | 0 | 1 | 0 | python,pdf-generation,pypdf | 14,392,145 | 3 | false | 0 | 0 | I had this problem, and was able to figure it out by looking at the original pdf side by side with the PyPDF one in a hex editor.
The problem seems to be that PyPDF actually leaves off a byte - it looks like probably the first byte in each image stream is missing. When I added the bytes to the PyPDF file, the pdf opene... | 2 | 3 | 0 | I have a program in Python (using pyPDF) that merges a bunch of different PDF documents. Sometimes, the resulting pdf is fine, except for some blank pages in the middle. When I view these documents with Acrobat Reader, I get an error message saying "insufficient data for image". When I view the documents with FoxIT ... | what causes "insufficient data for image" in a pdf | 0.132549 | 0 | 0 | 6,035 |
3,857,883 | 2010-10-04T18:03:00.000 | 1 | 0 | 1 | 0 | python,pdf-generation,pypdf | 4,857,711 | 3 | false | 0 | 0 | I suspect that the image XObject stream is Malformed. Without access to a PDF with the problem, all most folks can do is guess.
For example, if the pdf info says the image is 10 pixels wide, 10 pixels high, and 8 bits per pixel, then the stream should uncompress to 100 bytes. If it uncompressed to less than that, I'd... | 2 | 3 | 0 | I have a program in Python (using pyPDF) that merges a bunch of different PDF documents. Sometimes, the resulting pdf is fine, except for some blank pages in the middle. When I view these documents with Acrobat Reader, I get an error message saying "insufficient data for image". When I view the documents with FoxIT ... | what causes "insufficient data for image" in a pdf | 0.066568 | 0 | 0 | 6,035 |
3,858,238 | 2010-10-04T18:56:00.000 | 4 | 0 | 0 | 1 | python,c,linux,io,blocking | 3,859,933 | 6 | true | 0 | 0 | You have a misunderstanding of what non-blocking means. It does not imply asynchronous operation - you can have any combination of asynchronous/synchronous and blocking/non-blocking.
A write() just hands data off to the kernel to take care of. When write() returns successfully, the kernel has now taken care of the da... | 6 | 0 | 0 | If I open a a file as os.open( '/dev/ttyS2', O_RDWR | O_NDELAY ), is there any way that I can check when my 'write()' commands have finished? Or, can I open a file for non-blocking read but blocking write? | checking when all data is sent using non-blocking open | 1.2 | 0 | 0 | 809 |
3,858,238 | 2010-10-04T18:56:00.000 | 3 | 0 | 0 | 1 | python,c,linux,io,blocking | 3,859,349 | 6 | false | 0 | 0 | If you are writing to a tty (as you are in your example), you can use termios.tcdrain to wait until all written bytes have been transmitted.
Your write systems calls will still be non-blocking, so you will need to handle EWOULDBLOCK/EAGAIN errors, and use select(2), poll(2) or epoll(7) to know when you can write to the... | 6 | 0 | 0 | If I open a a file as os.open( '/dev/ttyS2', O_RDWR | O_NDELAY ), is there any way that I can check when my 'write()' commands have finished? Or, can I open a file for non-blocking read but blocking write? | checking when all data is sent using non-blocking open | 0.099668 | 0 | 0 | 809 |
3,858,238 | 2010-10-04T18:56:00.000 | 0 | 0 | 0 | 1 | python,c,linux,io,blocking | 3,858,262 | 6 | false | 0 | 0 | Open two file descriptors to the same location - one for non-blocking reads and the other for blocking writes. | 6 | 0 | 0 | If I open a a file as os.open( '/dev/ttyS2', O_RDWR | O_NDELAY ), is there any way that I can check when my 'write()' commands have finished? Or, can I open a file for non-blocking read but blocking write? | checking when all data is sent using non-blocking open | 0 | 0 | 0 | 809 |
3,858,238 | 2010-10-04T18:56:00.000 | 0 | 0 | 0 | 1 | python,c,linux,io,blocking | 3,858,291 | 6 | false | 0 | 0 | Have you tried os.fsync(fd)? | 6 | 0 | 0 | If I open a a file as os.open( '/dev/ttyS2', O_RDWR | O_NDELAY ), is there any way that I can check when my 'write()' commands have finished? Or, can I open a file for non-blocking read but blocking write? | checking when all data is sent using non-blocking open | 0 | 0 | 0 | 809 |
3,858,238 | 2010-10-04T18:56:00.000 | 1 | 0 | 0 | 1 | python,c,linux,io,blocking | 3,858,316 | 6 | false | 0 | 0 | The O_NDELAY flag always affects both reading and writing. To achieve a blocking write on a non-blocking file you can select (Python module) the file and write when it becomes writable in a loop. | 6 | 0 | 0 | If I open a a file as os.open( '/dev/ttyS2', O_RDWR | O_NDELAY ), is there any way that I can check when my 'write()' commands have finished? Or, can I open a file for non-blocking read but blocking write? | checking when all data is sent using non-blocking open | 0.033321 | 0 | 0 | 809 |
3,858,238 | 2010-10-04T18:56:00.000 | 0 | 0 | 0 | 1 | python,c,linux,io,blocking | 3,858,252 | 6 | false | 0 | 0 | OS API write() returns count of written bytes. Checking this value against size of your input you can see when all input is sent. | 6 | 0 | 0 | If I open a a file as os.open( '/dev/ttyS2', O_RDWR | O_NDELAY ), is there any way that I can check when my 'write()' commands have finished? Or, can I open a file for non-blocking read but blocking write? | checking when all data is sent using non-blocking open | 0 | 0 | 0 | 809 |
3,859,090 | 2010-10-04T21:04:00.000 | 0 | 0 | 0 | 0 | python,sockets,networking | 3,873,419 | 4 | true | 0 | 0 | I figured it out. It turns out that the piece I was missing was adding the interface to the mreq structure that is used in adding membership to a multicast group. | 1 | 6 | 0 | I have a server with two separate Ethernet connections. When I bind a socket in python it defaults to one of the two networks. How do I pull a multicast stream from the second network in Python? I have tried calling bind using the server's IP address on the second network, but that hasn't worked. | Choosing multicast network interface in Python | 1.2 | 0 | 1 | 9,358 |
3,859,526 | 2010-10-04T22:08:00.000 | 1 | 0 | 1 | 0 | ironpython | 3,869,609 | 1 | true | 0 | 0 | The System.Dynamic assembly in .NET 4.0 actually includes no public surface area. It just has a bunch of internal types which are visible to the C# runtime assembly that are used for COM interop. The decision to make this all internal was made late enough in the product cycle that the assembly still remains.
Likely y... | 1 | 2 | 0 | I'm obviously missing something trivial, but I can't seem to import from System.Dynamic; to wit:
import clr
clr.AddReference('System.Dynamic')
which clearly adds the salient reference:
clr.References[2]
(< System.Dynamic, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a>)
but importing fails
i... | Problem importing System.Dynamic in IronPython | 1.2 | 0 | 0 | 452 |
3,859,623 | 2010-10-04T22:26:00.000 | 2 | 0 | 1 | 0 | python,m2crypto,python-2.7,cryptography | 3,929,055 | 2 | true | 0 | 0 | Actually, the M2Crypto package supports Python 2.7 just fine — I have been using it in a cryptography-heavy application with no problem. I suppose the problem here is that Windows does not come with a compiler, so you cannot easily install the .tar.gz off of PyPI? Or are you getting an error when you try to compile it?... | 1 | 3 | 0 | Any recommendations on an AES encryption library that's compatible with Python 2.7 for Windows?
In the past we've used m2crypto with Python 2.6, but there's no version of m2crypto for Python 2.7 and our attempts to build a version from source have failed.
Thank you,
Malcolm | AES encryption library compatible with Python 2.7 for Windows | 1.2 | 0 | 0 | 1,361 |
3,860,386 | 2010-10-05T01:58:00.000 | 2 | 0 | 1 | 0 | python,3d,maya | 4,687,412 | 3 | false | 0 | 0 | I will say that there is no big difference for Python version. Just like others mentioned, ThE_JacO does not involved in popular 3D apps. Maya, Pixar's RenderMan, Houdini, Blender, Realflow, ... all have Python 2.x binding. For Python 2.4, 2.5, and 2.6, there is rare difference in function interfaces. You can just igno... | 2 | 3 | 0 | I have a couple small projects that I want to use to learn python. What version should I be using if I want to move to scripting for Maya, Blender, etc later? Also, what resources are there for scripting for those programs? | python version for maya and other 3d apps | 0.132549 | 0 | 0 | 2,086 |
3,860,386 | 2010-10-05T01:58:00.000 | 5 | 0 | 1 | 0 | python,3d,maya | 3,860,414 | 3 | true | 0 | 0 | If you are using Maya 2011 it comes bundled with and bound to py 2.6.4 already. You don't need a separate install, not even for pyMEL anymore.
If you want to learn Python on its own before applying the knowledge to a 3D app, then pretty much any 2.x Python will do really, the version specific features only come into pl... | 2 | 3 | 0 | I have a couple small projects that I want to use to learn python. What version should I be using if I want to move to scripting for Maya, Blender, etc later? Also, what resources are there for scripting for those programs? | python version for maya and other 3d apps | 1.2 | 0 | 0 | 2,086 |
3,860,890 | 2010-10-05T04:41:00.000 | 0 | 0 | 0 | 0 | python,igraph | 3,976,063 | 2 | false | 0 | 0 | This is not possible in the stable version of igraph (0.5.4 at the moment), but the development version (0.6) supports it. igraph_mincut gives you the minimum cut itself in the cut argument. | 1 | 1 | 0 | mincut_value in igraph for python returns the number of edges of the cut. Can I find the what edges are actually are returned by this function and print them? | finding the edges returned by mincut_value in igraph | 0 | 0 | 0 | 217 |
3,861,027 | 2010-10-05T05:23:00.000 | 3 | 0 | 0 | 0 | python,django,cherrypy | 3,898,465 | 2 | false | 1 | 0 | Django admin is much more, but is bound to Models. Without them, You will not gain much and as there is no such concept in CherryPy, I doubt there is similar application.
However, Django admin is phpmyadmin for masses exploited. Don't be constrained by it and create much more usable admin apps, leveraging CherryPy simp... | 1 | 2 | 0 | Is there a django.contrib.admin like app / module for cherrypy?
I really like the simplicity of cherrypy, but it would be nice, to have the user authentication and password management type things taken care of...
Or is it possible to run a cherrypy application behind the django admin app ? | django.contrib.admin like application for cherrypy | 0.291313 | 0 | 0 | 570 |
3,861,102 | 2010-10-05T05:43:00.000 | 2 | 1 | 0 | 0 | python,ruby,migration,administration | 3,868,363 | 4 | false | 1 | 0 | Have you considered writing your applications as Webmin modules?
You get a lot of stuff for free when you do so (users and groups, tons of security features, a pretty big variety of helper functions related to config files, and tons of existing code for most aspects of a UNIX/Linux system). You also get a lot of stuff ... | 3 | 0 | 0 | We have an in house developed web-based admin console that uses a combination of C CGI and Perl scripts to administer our mail server stack. Of late we have been thinking of cleaning up the code (well, replacing most of it), making the implementation more secure, and improving the overall behavior.
I don't have much pr... | Which language to use for writing an admin console à la webmin? | 0.099668 | 0 | 0 | 155 |
3,861,102 | 2010-10-05T05:43:00.000 | 0 | 1 | 0 | 0 | python,ruby,migration,administration | 3,897,721 | 4 | false | 1 | 0 | django has a nice admin interface | 3 | 0 | 0 | We have an in house developed web-based admin console that uses a combination of C CGI and Perl scripts to administer our mail server stack. Of late we have been thinking of cleaning up the code (well, replacing most of it), making the implementation more secure, and improving the overall behavior.
I don't have much pr... | Which language to use for writing an admin console à la webmin? | 0 | 0 | 0 | 155 |
3,861,102 | 2010-10-05T05:43:00.000 | 0 | 1 | 0 | 0 | python,ruby,migration,administration | 3,861,123 | 4 | true | 1 | 0 | If you already know a bit of ruby, then there's no reason not to use that.
If you're interested specifically in learning another language, then what you're trying to do could be done in pretty much any language/framework, it's just a matter of which one you want to learn. | 3 | 0 | 0 | We have an in house developed web-based admin console that uses a combination of C CGI and Perl scripts to administer our mail server stack. Of late we have been thinking of cleaning up the code (well, replacing most of it), making the implementation more secure, and improving the overall behavior.
I don't have much pr... | Which language to use for writing an admin console à la webmin? | 1.2 | 0 | 0 | 155 |
3,862,332 | 2010-10-05T09:20:00.000 | 0 | 0 | 0 | 1 | php,python | 3,862,362 | 3 | false | 1 | 0 | You could connect its stdin to a FIFO and then have another daemon also connect to the FIFO and send commands. It might be better to have the control daemon start the Java daemon though, so that the Java daemon doesn't shut down if the control daemon does for some reason. | 1 | 0 | 0 | I have a java server application that, when its running, you can interact with it sending commands via stdin. I want to write a web interface that can send these commands to it.
In order to do that I need some way of getting commands from php to the stdin for this backgrounded job. Is there a way to do this from conso... | send commands to a backgrounded jobs stdin | 0 | 0 | 0 | 157 |
3,863,281 | 2010-10-05T11:40:00.000 | 4 | 0 | 0 | 0 | python,sockets,socketserver | 3,863,539 | 2 | false | 0 | 0 | No the serve_forever is checking a flag on a regular basis (by default 0.5 sec). Calling shutdown will raise this flag and cause the serve_forever to end. | 1 | 6 | 0 | How can I call shutdown() in a SocketServer after receiving a certain message "exit"? As I know, the call to serve_forever() will block the server.
Thanks! | Python SocketServer | 0.379949 | 0 | 1 | 3,881 |
3,863,369 | 2010-10-05T11:55:00.000 | 1 | 1 | 0 | 0 | python,eclipse,pydev | 3,863,743 | 3 | false | 0 | 0 | You can try refreshing your PYTHONPATH in Preferences > Pydev > Interpreter - Python and selecting AutoConfig for your interpreter, then manually choosing the libraries for your PYTHONPATH.
This is pretty radical solution though. Making an insignificant change (like adding a space) and saving file should work in most c... | 3 | 15 | 0 | I am using PyDev/Eclipse for several monthes and I get ever and ever the same bugs with imports:
PyDev underline in red an import and say Unresolved import xxx ; Found at yyy. When I click on yyy eclispe find and open the implementation of the module.
(PyDev just inform me that it can't find the module xxx and in the s... | PyDev bugs with imports | 0.066568 | 0 | 0 | 6,201 |
3,863,369 | 2010-10-05T11:55:00.000 | 16 | 1 | 0 | 0 | python,eclipse,pydev | 3,864,323 | 3 | true | 0 | 0 | This can happen if new modules are not cached by PyDev. For example, on my new laptop I first set up PyDev/Eclipse and later installed the Django package. That's why Django imports were marked as unresolved. You can refresh it using Pydev > Interpreter - Python > Libraries > Apply. Select the interpreter you want to "r... | 3 | 15 | 0 | I am using PyDev/Eclipse for several monthes and I get ever and ever the same bugs with imports:
PyDev underline in red an import and say Unresolved import xxx ; Found at yyy. When I click on yyy eclispe find and open the implementation of the module.
(PyDev just inform me that it can't find the module xxx and in the s... | PyDev bugs with imports | 1.2 | 0 | 0 | 6,201 |
3,863,369 | 2010-10-05T11:55:00.000 | 1 | 1 | 0 | 0 | python,eclipse,pydev | 38,688,200 | 3 | false | 0 | 0 | Just in case anyone else runs into this thread but above answers don't solve the issue, make sure that your script does not have the same name as the library that you are trying to import. | 3 | 15 | 0 | I am using PyDev/Eclipse for several monthes and I get ever and ever the same bugs with imports:
PyDev underline in red an import and say Unresolved import xxx ; Found at yyy. When I click on yyy eclispe find and open the implementation of the module.
(PyDev just inform me that it can't find the module xxx and in the s... | PyDev bugs with imports | 0.066568 | 0 | 0 | 6,201 |
3,864,223 | 2010-10-05T13:47:00.000 | 1 | 0 | 0 | 1 | java,python,ruby,deployment | 3,864,388 | 8 | false | 1 | 0 | We use Ant or Maven for different projects we have in house (depending on the need and how old the project is too...). We tend to use Jenkins (formerly known as Hudson) as our build and deployment tool.
And then we encourage developers to write code that does not hard code to DB's, URL's, etc. We try to abstract via th... | 8 | 3 | 0 | What do you use to automatically deploy applications for various kinds of server applications (web, socket, daemon) that uses various technologies (different DBs, languages, etc)?
Here we use Python, Java and Ruby, and may use other languages as well in the future.
Update: I ended up using Puppet to manage all server ... | Agnostic automated deployment | 0.024995 | 0 | 0 | 520 |
3,864,223 | 2010-10-05T13:47:00.000 | 1 | 0 | 0 | 1 | java,python,ruby,deployment | 3,864,349 | 8 | false | 1 | 0 | you can use maven, ant, ivy along with hudson for java projects. | 8 | 3 | 0 | What do you use to automatically deploy applications for various kinds of server applications (web, socket, daemon) that uses various technologies (different DBs, languages, etc)?
Here we use Python, Java and Ruby, and may use other languages as well in the future.
Update: I ended up using Puppet to manage all server ... | Agnostic automated deployment | 0.024995 | 0 | 0 | 520 |
3,864,223 | 2010-10-05T13:47:00.000 | 1 | 0 | 0 | 1 | java,python,ruby,deployment | 3,864,310 | 8 | false | 1 | 0 | I think the best choice you could do is using maven. Even if maven is mostly used for Java projects, you can with the right plugins (or the one you write) deploy anything anywhere. | 8 | 3 | 0 | What do you use to automatically deploy applications for various kinds of server applications (web, socket, daemon) that uses various technologies (different DBs, languages, etc)?
Here we use Python, Java and Ruby, and may use other languages as well in the future.
Update: I ended up using Puppet to manage all server ... | Agnostic automated deployment | 0.024995 | 0 | 0 | 520 |
3,864,223 | 2010-10-05T13:47:00.000 | 1 | 0 | 0 | 1 | java,python,ruby,deployment | 3,864,298 | 8 | false | 1 | 0 | For Python you could use Fabric or Paver
For Ruby, there's capistrano and 'vlad the deployer'
For Java, it's the Ant.
For PHP/Python projects I also use Peritor Webistrano, a neat frontend for capistrano. It involves changing a few of the default recipes to remove the rails-specific stuff, but it's worth it once you ge... | 8 | 3 | 0 | What do you use to automatically deploy applications for various kinds of server applications (web, socket, daemon) that uses various technologies (different DBs, languages, etc)?
Here we use Python, Java and Ruby, and may use other languages as well in the future.
Update: I ended up using Puppet to manage all server ... | Agnostic automated deployment | 0.024995 | 0 | 0 | 520 |
3,864,223 | 2010-10-05T13:47:00.000 | 3 | 0 | 0 | 1 | java,python,ruby,deployment | 3,864,289 | 8 | true | 1 | 0 | I use Puppet for some of the deployements / initial configuration of server. Maven and Ant for Java based projects. | 8 | 3 | 0 | What do you use to automatically deploy applications for various kinds of server applications (web, socket, daemon) that uses various technologies (different DBs, languages, etc)?
Here we use Python, Java and Ruby, and may use other languages as well in the future.
Update: I ended up using Puppet to manage all server ... | Agnostic automated deployment | 1.2 | 0 | 0 | 520 |
3,864,223 | 2010-10-05T13:47:00.000 | 2 | 0 | 0 | 1 | java,python,ruby,deployment | 6,336,041 | 8 | false | 1 | 0 | Go for KWateeSDCM. It comes with a straightforward web GUI and does not require obscure scripting and integrates nicely with your build chain via a REST API. | 8 | 3 | 0 | What do you use to automatically deploy applications for various kinds of server applications (web, socket, daemon) that uses various technologies (different DBs, languages, etc)?
Here we use Python, Java and Ruby, and may use other languages as well in the future.
Update: I ended up using Puppet to manage all server ... | Agnostic automated deployment | 0.049958 | 0 | 0 | 520 |
3,864,223 | 2010-10-05T13:47:00.000 | 1 | 0 | 0 | 1 | java,python,ruby,deployment | 3,864,283 | 8 | false | 1 | 0 | We use Maven and pull out to the ant-plugin when required. In turn the ant-plugin very occasionally calls out to some native scripting language/application/packager/whatever but we're finding that over time we can generally find a Maven or ANT plugin/task to do the trick.
You might want to look up Continuous Deploymen... | 8 | 3 | 0 | What do you use to automatically deploy applications for various kinds of server applications (web, socket, daemon) that uses various technologies (different DBs, languages, etc)?
Here we use Python, Java and Ruby, and may use other languages as well in the future.
Update: I ended up using Puppet to manage all server ... | Agnostic automated deployment | 0.024995 | 0 | 0 | 520 |
3,864,223 | 2010-10-05T13:47:00.000 | 2 | 0 | 0 | 1 | java,python,ruby,deployment | 3,864,269 | 8 | false | 1 | 0 | You could use Ant, Makefile, or a batch script. Or a combination of them. | 8 | 3 | 0 | What do you use to automatically deploy applications for various kinds of server applications (web, socket, daemon) that uses various technologies (different DBs, languages, etc)?
Here we use Python, Java and Ruby, and may use other languages as well in the future.
Update: I ended up using Puppet to manage all server ... | Agnostic automated deployment | 0.049958 | 0 | 0 | 520 |
3,865,283 | 2010-10-05T15:39:00.000 | 2 | 0 | 1 | 0 | python,mongodb,nosql | 3,865,523 | 4 | false | 0 | 0 | I don't know about a noSQL solution, but sqlite+sqlalchemy's ORM works pretty well for me. As long as it gives you the interface and features you need, I don't see a reason to care whether it uses sql internally. | 1 | 4 | 0 | Looking around for a noSQL database implementation that has an ORM syntax (pref. like Django's), lets me store and retrieve nested dictionary attributes but written entirely in Python to ease deployment and avoids Javascript syntax for map/reduce. Even better if it has a context-aware (menus), python-based console, as ... | Pure Python implementation of MongoDB? | 0.099668 | 1 | 0 | 1,830 |
3,865,733 | 2010-10-05T16:32:00.000 | 1 | 0 | 0 | 0 | python,sqlite,sqlalchemy,fts3 | 3,942,449 | 2 | false | 0 | 0 | From elsewhere on the internet it seems it may be possible to surround each search term with double quotes "some-term". Since we do not need the subtraction operation, my solution was to replace hyphens - with underscores _ when populating the search index and when performing searches. | 1 | 2 | 0 | I'm using Python and SQLAlchemy to query a SQLite FTS3 (full-text) store and I would like to prevent my users from using the - as an operator. How should I escape the - so users can search for a term containing the - (enabled by changing the default tokenizer) instead of it signifying "does not contain the term followi... | How do I escape the - character in SQLite FTS3 queries? | 0.099668 | 1 | 0 | 1,200 |
3,866,989 | 2010-10-05T19:28:00.000 | 1 | 0 | 0 | 0 | python,mysql,django | 3,868,544 | 2 | true | 1 | 0 | You can't import sql dumps through django; import it through mysql directly, if you run mysql locally you can find various graphical mysql clients that can help you with doing so; if you need to do it remotely, find out if your server has any web interfaces for that installed! | 1 | 0 | 0 | I'm trying to restore the current working database to the data stored in a .sql file from within Django. Whats the best way to do this? Does django have an good way to do this or do I need to grab the connection string from the settings.py file and send command line mysql commands to do this?
Thanks for your help. | How do I replace the current working MySQL database with a .sql file? | 1.2 | 1 | 0 | 182 |
3,867,262 | 2010-10-05T20:03:00.000 | 8 | 0 | 1 | 0 | python,list | 3,867,296 | 4 | true | 0 | 0 | Use something like if list1[:-1] == list2[:-1]. | 1 | 9 | 0 | I have several long lists in python and have compare them and find the lists that are equal to each other except the last elements in the them.
Which is the fastest way? | Comparing Python lists | 1.2 | 0 | 0 | 18,130 |
3,867,377 | 2010-10-05T20:17:00.000 | 3 | 1 | 1 | 0 | ironpython | 3,869,625 | 1 | true | 0 | 0 | It's interesting, there's actually no support for this at all right now. For the most part this has been used to implement built-in modules that exist in CPython and there's simply been no need for submodules yet. You could have a nested static class in the class used for the module but it wouldn't import as a module... | 1 | 2 | 0 | While I'm familiar with making .net assemblies with the PythonModule assembly attribute, I'm a little curious as to how you could make submodules. Would this be a class within a class? i.e: if I have a class defined as an IronPython module such as:
[assembly: PythonModule(mymodule),typeof(namespace.mymodule)]
How cou... | submodules in ironpython | 1.2 | 0 | 0 | 183 |
3,867,500 | 2010-10-05T20:34:00.000 | 1 | 0 | 0 | 1 | python,user-interface,wxpython,wxwidgets,command-line-interface | 3,867,843 | 2 | false | 0 | 0 | If you can call your data model's methods from your GUI and they don't depend on anything in the GUI, then yes, you should be able to call those same methods from another GUI, be it CLI, pyGTK or whatever. | 1 | 0 | 0 | HI, guys. I am developing a GUI to configure and call several external programs with Python and I use wxPython for the GUI toolkits. Basically, instead of typing commands and parameters in each shell for each application (one application via one shell), the GUI is visualizing these parameters and call them as subproces... | how to make a Command Line Interface from a given data model used for GUI | 0.099668 | 0 | 0 | 440 |
3,867,860 | 2010-10-05T21:24:00.000 | 1 | 1 | 1 | 0 | python,localization,linguistics | 3,868,983 | 6 | false | 0 | 0 | the simplest way to do this is to make a dictionary that matches one language's words to another language's words. However, this is extremely silly and would not take into account grammar at all and it would literally take a very long time to create a translator, especially if you plan to use it for multiple languages.... | 1 | 1 | 0 | What is the best way to approach writing a program in Python to translate English words and/or phrases into other languages? | Python - English translator | 0.033321 | 0 | 0 | 2,381 |
3,867,945 | 2010-10-05T21:36:00.000 | 1 | 0 | 1 | 0 | python,design-patterns,oop | 3,867,968 | 1 | true | 0 | 0 | Have the Player ask the Turn to roll, by calling e.g. turn.roll_dice(). The Turn can then decide whether to roll the dice or e.g. to raise NotYourTurnError.
You can't prevent the Player class directly calling die.roll(), although you can make roll private by renaming it __roll. However, since I assume the player is con... | 1 | 0 | 0 | I'm writing a simulation in Python for a dice game, and am trying to find the best way to handle the following situation in an Object Oriented manner.
I have a Dice class that handles rolling the dice and reporting things about the dice. This class's methods include a roll() method which modifies the dice values, and ... | Is there a design pattern for this: hide certain methods from certain classes | 1.2 | 0 | 0 | 420 |
3,868,722 | 2010-10-06T00:24:00.000 | 0 | 0 | 0 | 0 | python,html,pylons,mako | 3,868,737 | 5 | false | 1 | 0 | If your data are not too dynamic, you could store an optimised cache of the template output and serve this to web clients. | 1 | 7 | 0 | I'm using Mako + Pylons and I've noticed a horrendous amount of whitespace in my HTML output.
How would I go about getting rid of it? Reddit manage to do it. | Strip whitespace from Mako template output (Pylons) | 0 | 0 | 0 | 4,817 |
3,869,280 | 2010-10-06T03:15:00.000 | 0 | 0 | 1 | 0 | python,windows,copy,overwrite | 3,869,375 | 2 | true | 0 | 0 | oops... Turns out that distutils.dir_util.copy_tree(src, dst) works.
It's just that I got my directory path from environment variables and '\n' was stuck at the back of my path.
Adding in a .strip() to my path variable solved the problem. | 1 | 0 | 0 | I'm trying to overwrite a directory with another directory that contains the same files.
I've tried using distutils.dir_util.copy_tree(src, dst) but it tried to make a directory for dst instead.
The objective is to overwrite the directory and its contents silently.
Is there any other way to do so? | Python: Overwriting a directory with another directory containing the same files | 1.2 | 0 | 0 | 925 |
3,869,435 | 2010-10-06T04:07:00.000 | 0 | 1 | 1 | 0 | python,c,decompiling | 3,869,481 | 11 | false | 0 | 1 | Python scripts are analogous to a man looking at a to-do list written in English (or language he understands). The man has to do all the work, every time that list of things has to be done.
If the man, instead of doing the steps on his own each time, creates and programs a robot which can carry out those steps again an... | 7 | 3 | 0 | If I write a python script, anyone can simply point an editor to it and read it. But for programming written in C, one would have to use decompilers and hex tables and such. Why is that? I mean I simply can't open up the Safari web browser and look at its code. | Why do C programs require decompilers but python programs dont? | 0 | 0 | 0 | 801 |
3,869,435 | 2010-10-06T04:07:00.000 | 5 | 1 | 1 | 0 | python,c,decompiling | 3,869,458 | 11 | false | 0 | 1 | This is sorta a big topic. You should look into your local friendly Computer Science curriculum, you'll find a lot of great stuff on this subject there.
The short answer is the Python is an "interpreted" language, which means that it requires a machine language program (the python interpreter) to run the python program... | 7 | 3 | 0 | If I write a python script, anyone can simply point an editor to it and read it. But for programming written in C, one would have to use decompilers and hex tables and such. Why is that? I mean I simply can't open up the Safari web browser and look at its code. | Why do C programs require decompilers but python programs dont? | 0.090659 | 0 | 0 | 801 |
3,869,435 | 2010-10-06T04:07:00.000 | 1 | 1 | 1 | 0 | python,c,decompiling | 3,869,445 | 11 | false | 0 | 1 | because C code is complied to object (machine) code and python code is compiled into an intermediate byte code. I am not sure if you are even referring to the byte code of python - you must be referring to the source file itself which is directly executable (hiding the byte code from you!). C needs to be compiled and l... | 7 | 3 | 0 | If I write a python script, anyone can simply point an editor to it and read it. But for programming written in C, one would have to use decompilers and hex tables and such. Why is that? I mean I simply can't open up the Safari web browser and look at its code. | Why do C programs require decompilers but python programs dont? | 0.01818 | 0 | 0 | 801 |
3,869,435 | 2010-10-06T04:07:00.000 | 0 | 1 | 1 | 0 | python,c,decompiling | 3,869,451 | 11 | false | 0 | 1 | Python scripts are parsed and converted to binary only when they're run - i.e., they're text files and you can read them with an editor.
C code is compiled and linked to an executable binary file before they can be run. Normally, only this executable binary file is distributed - hence you need a decompiler. You can alw... | 7 | 3 | 0 | If I write a python script, anyone can simply point an editor to it and read it. But for programming written in C, one would have to use decompilers and hex tables and such. Why is that? I mean I simply can't open up the Safari web browser and look at its code. | Why do C programs require decompilers but python programs dont? | 0 | 0 | 0 | 801 |
3,869,435 | 2010-10-06T04:07:00.000 | 0 | 1 | 1 | 0 | python,c,decompiling | 3,874,099 | 11 | false | 0 | 1 | G-WAN executes ANSI C scripts on the fly -making it just like Python scripts.
This can be server-side scripts (using G-WAN as a Web server) or any general-purpose C program and you can link any existing library.
Oh, and G-WAN C scripts are much faster than Python, PHP or Java... | 7 | 3 | 0 | If I write a python script, anyone can simply point an editor to it and read it. But for programming written in C, one would have to use decompilers and hex tables and such. Why is that? I mean I simply can't open up the Safari web browser and look at its code. | Why do C programs require decompilers but python programs dont? | 0 | 0 | 0 | 801 |
3,869,435 | 2010-10-06T04:07:00.000 | 10 | 1 | 1 | 0 | python,c,decompiling | 3,869,443 | 11 | false | 0 | 1 | Python is a script language, runs in a virtual machine through an interpeter.
C is a compiled language, the code compiled to binary code which the computer can run without all that extra stuff Python needs. | 7 | 3 | 0 | If I write a python script, anyone can simply point an editor to it and read it. But for programming written in C, one would have to use decompilers and hex tables and such. Why is that? I mean I simply can't open up the Safari web browser and look at its code. | Why do C programs require decompilers but python programs dont? | 1 | 0 | 0 | 801 |
3,869,435 | 2010-10-06T04:07:00.000 | 2 | 1 | 1 | 0 | python,c,decompiling | 3,869,460 | 11 | false | 0 | 1 | Yes, you can - it's called disassembling, and allows you to look at the code of Safari perfectly well. The thing is, C, among other languages, compiles to native code, i.e. code that your CPU can "understand" and execute.
More or less obviously, the level of abstraction present in the instruction set of your CPU is mu... | 7 | 3 | 0 | If I write a python script, anyone can simply point an editor to it and read it. But for programming written in C, one would have to use decompilers and hex tables and such. Why is that? I mean I simply can't open up the Safari web browser and look at its code. | Why do C programs require decompilers but python programs dont? | 0.036348 | 0 | 0 | 801 |
3,869,517 | 2010-10-06T04:34:00.000 | 0 | 1 | 0 | 0 | python,image,python-imaging-library | 3,869,781 | 3 | false | 0 | 0 | In a pinch, convert the Image to a numpy array, modify it as you please, and convert back. | 1 | 4 | 0 | What I'm trying to do:
I want to give the user the ability to upload a picture that is any size. This image is then resized if it is over 1024 wide or over 768 high. It then resizes the image to be within those bounds, but keeping proportions. Then it adds a semi-transparent watermark to the lower right corner, and sav... | Simple Image Manipulation with Python | 0 | 0 | 0 | 5,217 |
3,871,145 | 2010-10-06T09:32:00.000 | 2 | 0 | 0 | 0 | python,validation,pylons | 3,871,201 | 1 | true | 1 | 0 | Having it all in one method, and detecting if the form has been posted via a check on request.method. This works okay, but it seems clumsy to have if request.method == 'post': ... else: ...
I am not sure why you describe this as clumsy. Switching on request method is a valid idiom in the web app world across languages... | 1 | 1 | 0 | What's the best way to handle form POST data in my Pylons app? I've tried:
Having a seperate GET method and a POST method with a rest.restrict('post') decorator. Problem -- if there were validation errors then you can't redisplay the form with the data which the user entered because you have to redirect back to the GE... | Pylons - Handling GET and POST requests | 1.2 | 0 | 0 | 1,052 |
3,871,613 | 2010-10-06T10:38:00.000 | 1 | 0 | 0 | 0 | python,web-crawler,scrapy | 8,830,983 | 5 | false | 1 | 0 | I think jama22's answer is a little incomplete.
In the snippet if self.FILTER_VISITED in x.meta:, you can see that you require FILTER_VISITED in your Request instance in order for that request to be ignored. This is to ensure that you can differentiate between links that you want to traverse and move around and item l... | 2 | 15 | 0 | Im using scrapy to crawl a news website on a daily basis. How do i restrict scrapy from scraping already scraped URLs. Also is there any clear documentation or examples on SgmlLinkExtractor. | Scrapy - how to identify already scraped urls | 0.039979 | 0 | 1 | 9,648 |
3,871,613 | 2010-10-06T10:38:00.000 | 1 | 0 | 0 | 0 | python,web-crawler,scrapy | 13,578,588 | 5 | false | 1 | 0 | Scrapy can auto-filter urls which are scraped, isn't it? Some different urls point to the same page will not be filtered, such as "www.xxx.com/home/" and "www.xxx.com/home/index.html". | 2 | 15 | 0 | Im using scrapy to crawl a news website on a daily basis. How do i restrict scrapy from scraping already scraped URLs. Also is there any clear documentation or examples on SgmlLinkExtractor. | Scrapy - how to identify already scraped urls | 0.039979 | 0 | 1 | 9,648 |
3,872,033 | 2010-10-06T11:41:00.000 | 0 | 0 | 0 | 0 | javascript,python,pyqt,qtwebkit | 3,886,529 | 2 | false | 1 | 1 | Could you post some source code? Once downloaded that data will stay in the /tmp/ folder for some time. You could likely use the data in the temp folder, my guess is you are not enforcing that policy. | 1 | 1 | 0 | I have a QWebView in my app which renders a html page stored in the app as a Qresource. This page, however requires meaty external Javascript libraries such as MathJax, which I would want to include as a resource due to its size.
My problem is that it seems that QtWebkit does not cache these files as a regular browser... | Caching external javascript for a QtWebkit widget in a PyQt app | 0 | 0 | 0 | 1,071 |
3,872,861 | 2010-10-06T13:19:00.000 | 7 | 0 | 1 | 0 | python,lua,bytecode,disassembly | 3,877,403 | 4 | false | 0 | 0 | The luac utility that comes with standard lua can create an assembly listing from Lua source using its -l option. For example, compiling from source on stdin:
C:...> echo a=b | luac -l -
main (3 instructions, 12 bytes at 00334C30)
0+ params, 2 slots, 0 upvalues, 0 locals, 2 constants, 0 functions
1 [1]... | 2 | 7 | 0 | In Python you have the ability to view the compiled bytecode of a user-defined function using dis.
Is there a builtin equivalent to this for Lua?
It would really useful! | Lua equivalent to Python dis()? | 1 | 0 | 0 | 1,475 |
3,872,861 | 2010-10-06T13:19:00.000 | 0 | 0 | 1 | 0 | python,lua,bytecode,disassembly | 3,877,406 | 4 | false | 0 | 0 | You can also use luac -l to compile a lua file and output the disassembly. | 2 | 7 | 0 | In Python you have the ability to view the compiled bytecode of a user-defined function using dis.
Is there a builtin equivalent to this for Lua?
It would really useful! | Lua equivalent to Python dis()? | 0 | 0 | 0 | 1,475 |
3,873,115 | 2010-10-06T13:47:00.000 | 1 | 0 | 1 | 0 | python | 3,873,296 | 1 | true | 0 | 0 | My question is whether that's sane
It's sane. Doing import fish adds just one name to your namespace, that is not "namespace clutter". It's pretty much the big idea behind modules, grouping many things under one name!
When you want to know what a module does, look at the documentation or call help, don't do dir.
All n... | 1 | 2 | 0 | I've noticed sometimes if you call dir() on a package/module, you'll see other modules in the namespace that were imported as part of the implementation and aren't meant for you to use. For instance, if I install the fish package from PyPI and import it, I see fish.sys, which just refers to the built-in sys module.
My ... | Keeping imported modules out of python package namespaces | 1.2 | 0 | 0 | 208 |
3,873,212 | 2010-10-06T13:56:00.000 | 1 | 0 | 1 | 0 | .net,vb.net,ironpython | 3,873,713 | 1 | true | 0 | 0 | The full name for the method is Microsoft.VisualBasic.DateAndTime.Year(DateTime). This is a compat function. Since you need to pass a DateTime argument anyway, you might as well use its Year property.
Albeit that the VB version can be different because it uses the current culture calendar's GetYear() method. In othe... | 1 | 0 | 0 | Since it's possible using the IsNumeric() and others VB.NET functions from IronPython by importing Microsoft.VisualBasic and using it as an object method, is it possible somehow to use the Year() VB.NET function from IronPython? | using the VB.NET Year function from IronPython | 1.2 | 0 | 0 | 163 |
3,873,294 | 2010-10-06T14:04:00.000 | 20 | 0 | 1 | 0 | python,virtualenv | 3,874,179 | 2 | false | 1 | 0 | I think all you have to do is create an empty file called no-global-site-packages.txt and put it into the virtualenv's python2.x folder (eg, lib/python2.6/, the one with all the modules). Then the normal site.py generated by virtualenv detects the difference and handles everything from there. | 1 | 14 | 0 | I can create a new virtualenv that ignores global site-packages with "--no-site-package". Is it possible to change an existing virtualenv (which was created without "--no-site-package") to also ignore the global site-packages? (So that it workes like it was created with "--no-site-package" in the first place.)
thanks i... | Can I change an an existing virtualenv to ignore global site packages? (like --no-site-package on a new one) | 1 | 0 | 0 | 5,667 |
3,874,280 | 2010-10-06T15:41:00.000 | 1 | 0 | 1 | 0 | javascript,jquery,python,html,parsing | 3,874,358 | 4 | false | 1 | 0 | jQuery itself does not contain an HTML/XML parser at all. It uses the browser to do all its parsing. Thus, even if you figure out how to run Javascript from Python, it won't do you any good. | 1 | 3 | 0 | I am attempting to create an html document parser with Python. I am very familiar with jQuery and I would like to use its traversing functionality to parse these html files and return the data gathered with jQuery back to my Python program.
Is there any way to use javascript scripts through Python? Or is this just a pi... | Javascript Execution Through Python | 0.049958 | 0 | 0 | 624 |
3,874,422 | 2010-10-06T15:54:00.000 | 0 | 0 | 0 | 1 | python,django,celery | 58,684,713 | 4 | false | 1 | 0 | After 5+ years of writing Celery tasks I have noticed a pattern I have developed that can help with testing and ease of development - I realised it is much better if my Celery tasks are thin wrappers around the regular Python functions that I typically put in myproject.impl package. Celery tasks may contain some strict... | 1 | 29 | 0 | In development, it's a bit of a hassle to run the celeryd as well as the Django development server. Is it possible to, for example, ask celery to run tasks synchronously during development? Or something similar? | Developing with Django+Celery without running `celeryd`? | 0 | 0 | 0 | 9,748 |
3,874,837 | 2010-10-06T16:37:00.000 | 0 | 0 | 1 | 0 | python,compression,gzip,tar | 3,874,884 | 4 | false | 0 | 0 | As larsmans says, gzip compression is not used for directories, only single files. The usual way of doing things with linux is to put the directory in a tarball first and then compress it. | 1 | 12 | 0 | I'm creating Python software that compresses files/folders... How would I create a section of the code that asks for the user input of the folder location and then compresses it. I currently have the code for a single file but not a folder full of files. Please explain in detail how to do this. | How do I compress a folder with the Python GZip module? | 0 | 0 | 0 | 24,451 |
3,876,114 | 2010-10-06T19:20:00.000 | 2 | 1 | 0 | 0 | python,ssh-keys | 3,876,193 | 3 | false | 0 | 0 | Do you need the answer to be strictly python? You can do this with ssh-keygen -y -f privatekey | 1 | 0 | 0 | ... or if not, can you provide me link or RFC number to full algorithm (from getting ASCII encoded Private key file/string to generation of ASCII encoded public key file/string).
To show you a bigger picture - I started using a pylibssh2 library. This library has a method - userauth_publickey_fromfile (it raises NotImp... | Is there any way to generate public SSH key from private one using Python? | 0.132549 | 0 | 0 | 1,486 |
3,876,348 | 2010-10-06T19:57:00.000 | 1 | 0 | 1 | 0 | python,linux,file,pyinotify | 3,876,723 | 3 | false | 0 | 0 | If you have control of the writing process, you could call the file "foo.part" while it is being written to and rename it to "foo" when it has been closed. | 1 | 7 | 0 | I'm using pyinotify to watch a folder for when files are created in it. And when certain files are created I want to move them. The problem is that as soon as the file is created (obviously), my program tries to move it, even before it's completely written to disk.
Is there a way to make pyinotify wait until a file is ... | Using pyinotify to watch for file creation, but waiting for it to be completely written to disk | 0.066568 | 0 | 0 | 4,949 |
3,877,631 | 2010-10-06T23:28:00.000 | 0 | 1 | 0 | 0 | python,google-app-engine,ip-address | 3,877,766 | 1 | true | 1 | 0 | I believe that I have figured out the reason for seeing so many warnings from google server IP addresses. It seems that immediately after a new user registers, the google crawlers are going to the same (registration) webpage (which I send information to as a GET instead of a POST for reasons which I will not get into).... | 1 | 0 | 0 | In order to make the registration process on my website easy, I allow users to enter their email address which I will send a verification code to or alternatively they can solve a captcha.
The problem is that in order to prevent robots from registering accounts (with fake emails) I limit the number of registrations all... | Google App Engine (Python)- Strange behaviour of REMOTE_ADDR | 1.2 | 0 | 0 | 438 |
3,877,971 | 2010-10-07T00:54:00.000 | 2 | 1 | 0 | 0 | python,pygame,3d-engine,panda3d | 6,589,557 | 3 | false | 0 | 1 | Been using Vizard for various VR and AR development for about 3 yrs now - it's NOT unity - i.e. a web enabled game engine (excellent though it is) - what Vizard provides is a highly optimized OpenGL engine, wrapped in user friendly python scripting environment BUT on top of this you get the ability to seamlessly distri... | 2 | 1 | 0 | Is anybody familiar with Worldviz-Vizard's 3D engine for python? How does it compare to Panda3D? I have a feeling that it might be easier to learn but far more limited. They only support python 2.4 which also makes me not want to try it. | How does Worldviz Vizard compares to Panda3D and Pygame? | 0.132549 | 0 | 0 | 1,459 |
3,877,971 | 2010-10-07T00:54:00.000 | 0 | 1 | 0 | 0 | python,pygame,3d-engine,panda3d | 4,122,231 | 3 | false | 0 | 1 | I only used Vizard, and that for one small project.
It was easy to use, well documented, and had a good set of examples. | 2 | 1 | 0 | Is anybody familiar with Worldviz-Vizard's 3D engine for python? How does it compare to Panda3D? I have a feeling that it might be easier to learn but far more limited. They only support python 2.4 which also makes me not want to try it. | How does Worldviz Vizard compares to Panda3D and Pygame? | 0 | 0 | 0 | 1,459 |
3,878,479 | 2010-10-07T03:33:00.000 | 0 | 1 | 1 | 0 | python | 3,878,507 | 2 | false | 0 | 0 | Compiling the main script would be annoying for scripts in e.g. /usr/bin. The .pyc file is generated in the same directory, thus polluting the public location. | 1 | 33 | 0 | I understand that when you import a module, that file is compiled into a .pyc file to make it faster? Why is the main file also not compiled to a .pyc? Does this slow things down? Would it be better to keep the main file as small as possible then, or does it not matter? | Why are main runnable Python scripts not compiled to pyc files like modules? | 0 | 0 | 0 | 26,157 |
3,878,593 | 2010-10-07T04:10:00.000 | 8 | 0 | 1 | 0 | python | 3,878,615 | 3 | true | 0 | 0 | Depends. There are a few parts of the Python standard libraries that are only available on certain platforms. These parts are noted in the Python documentation.
You also need to be careful of how you handle things like file paths - using os.path.join() and such to make sure paths are formatted in the right way. | 2 | 2 | 0 | If I write a python script using only python standard libraries, using Python 2.6 will it work on all Operating Systems as long as python 2.6 is installed? | Python programs on different Operating Systems | 1.2 | 0 | 0 | 460 |
3,878,593 | 2010-10-07T04:10:00.000 | 0 | 0 | 1 | 0 | python | 3,878,609 | 3 | false | 0 | 0 | yes, unless you are using modules that are os dependent.
Edit : My reply seemed short
and not too the point based on
comments
I am not addressing portable programming in general.
That would mean taking care of binary data packing and manipulation, c extension issues, paths as in windows/unix, "\r\n" in windows t... | 2 | 2 | 0 | If I write a python script using only python standard libraries, using Python 2.6 will it work on all Operating Systems as long as python 2.6 is installed? | Python programs on different Operating Systems | 0 | 0 | 0 | 460 |
3,878,873 | 2010-10-07T05:13:00.000 | 0 | 0 | 0 | 0 | c#,c++,python,image,lua | 3,895,535 | 5 | false | 0 | 1 | Opencv has functions named like "cvHoughLines2" to detect lines. | 4 | 0 | 0 | How do I generate a list of lines to draw if I have pixel data for an image, so I don't have to draw every pixel? Any language will do, although I listed what I have a working knowledge for. C is ok as well. There was a limit to how many tags I could choose. Also, you can just point me toward an algorithm. | transforming an image into an array of lines to draw | 0 | 0 | 0 | 515 |
3,878,873 | 2010-10-07T05:13:00.000 | 1 | 0 | 0 | 0 | c#,c++,python,image,lua | 3,880,279 | 5 | true | 0 | 1 | You are looking for a "raster to vector" algorithm. The term comes from early graphics display systems, that used a CRT (cathode ray tube) for the display itself. There were 2 approaches to displaying graphics: "raster" was the scan of a series of lines left to right, top to bottom, each line made up of on/off pixels... | 4 | 0 | 0 | How do I generate a list of lines to draw if I have pixel data for an image, so I don't have to draw every pixel? Any language will do, although I listed what I have a working knowledge for. C is ok as well. There was a limit to how many tags I could choose. Also, you can just point me toward an algorithm. | transforming an image into an array of lines to draw | 1.2 | 0 | 0 | 515 |
3,878,873 | 2010-10-07T05:13:00.000 | 1 | 0 | 0 | 0 | c#,c++,python,image,lua | 3,879,121 | 5 | false | 0 | 1 | In general, bitmaps are stored in sequential memory, ideal for 'blitting' to the display; your GUI framework of choice will have a function for drawing bitmaps, and this function will be very carefully optimised.
On the other hand, decomposing an image into lines - vectorizing the image - is the domain of specialist pr... | 4 | 0 | 0 | How do I generate a list of lines to draw if I have pixel data for an image, so I don't have to draw every pixel? Any language will do, although I listed what I have a working knowledge for. C is ok as well. There was a limit to how many tags I could choose. Also, you can just point me toward an algorithm. | transforming an image into an array of lines to draw | 0.039979 | 0 | 0 | 515 |
3,878,873 | 2010-10-07T05:13:00.000 | 0 | 0 | 0 | 0 | c#,c++,python,image,lua | 3,879,102 | 5 | false | 0 | 1 | How can you achieve with lines what you have to do with pixels? You need to draw each pixel individually I'd say. | 4 | 0 | 0 | How do I generate a list of lines to draw if I have pixel data for an image, so I don't have to draw every pixel? Any language will do, although I listed what I have a working knowledge for. C is ok as well. There was a limit to how many tags I could choose. Also, you can just point me toward an algorithm. | transforming an image into an array of lines to draw | 0 | 0 | 0 | 515 |
3,879,265 | 2010-10-07T06:38:00.000 | 0 | 1 | 1 | 0 | python,client,imaplib,gmail-imap,email-threading | 34,061,867 | 2 | false | 0 | 0 | As far as i know, Gmail uses an algorithm that is private, and it's not stated in RFCs.
They use a combination of headers (like in-reply-to and references) and considering subject (but in a different way that THREAD=references does). | 1 | 4 | 0 | I want to create a gmail client with the ability to view emails as conversations (threads). In imaplib, there is a method:
IMAP4.thread(threading_algorithm, charset, search_criterion[, ...])
I think it could be the solution. Anybody has experience using it? Please give an example. Thanks. | How to use thread search method in imaplib? | 0 | 0 | 0 | 1,250 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.