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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
433,945 | 2009-01-11T23:03:00.000 | 0 | 0 | 1 | 0 | java,python,jfilechooser | 433,977 | 6 | false | 0 | 1 | Maybe you would like to take a look at Jython. | 2 | 4 | 0 | I was wondering if there is something similar to Java's JFileChooser for Python?
JFileChooser is a graphical front end to choose a file.
Preferably something that is already with Python. Maybe with Tkinter. | JFileChooser for Python? | 0 | 0 | 0 | 2,182 |
434,407 | 2009-01-12T04:05:00.000 | 0 | 0 | 1 | 0 | python,virtualenv,buildout | 436,427 | 5 | false | 1 | 0 | The other option (one I've used) is to easy_install Django after you've created the virtual environment. This is easily scripted. The penalty you pay is waiting for Django installation in each of your virtual environments.
I'm with Toby, though: Unless there's a compelling reason why you have to have a separate copy of... | 2 | 2 | 0 | So, I want to start using virtualenv this year. I like the no-site-packages option, that is nice. However I was wondering how to install certain packages into each virtualenv. For example, lets say I want to install django into each virtualenv... is this possible, and if so, how? Does buildout address this?
Well i... | Installing certain packages using virtualenv | 0 | 0 | 0 | 3,218 |
434,407 | 2009-01-12T04:05:00.000 | 2 | 0 | 1 | 0 | python,virtualenv,buildout | 434,445 | 5 | false | 1 | 0 | If you want django to be installed on EACH virtualenv, you might as well install it in the site-packages directory? Just a thought. | 2 | 2 | 0 | So, I want to start using virtualenv this year. I like the no-site-packages option, that is nice. However I was wondering how to install certain packages into each virtualenv. For example, lets say I want to install django into each virtualenv... is this possible, and if so, how? Does buildout address this?
Well i... | Installing certain packages using virtualenv | 0.07983 | 0 | 0 | 3,218 |
434,580 | 2009-01-12T06:07:00.000 | 0 | 0 | 0 | 0 | python,web-hosting,wsgi | 434,598 | 9 | false | 1 | 0 | I've been pretty happy with Dreamhost, and of course Google AppEngine. | 3 | 14 | 0 | I want to be able to run WSGI apps but my current hosting restricts it. Does anybody know a company that can accommodate my requirements? | For Python support, what company would be best to get hosting from? | 0 | 0 | 0 | 9,246 |
434,580 | 2009-01-12T06:07:00.000 | 0 | 0 | 0 | 0 | python,web-hosting,wsgi | 435,197 | 9 | false | 1 | 0 | Google App engine and OpenHosting.com
Have virtual server by OpenHosting, they are ultra fast with support and have very high uptime. | 3 | 14 | 0 | I want to be able to run WSGI apps but my current hosting restricts it. Does anybody know a company that can accommodate my requirements? | For Python support, what company would be best to get hosting from? | 0 | 0 | 0 | 9,246 |
434,580 | 2009-01-12T06:07:00.000 | 0 | 0 | 0 | 0 | python,web-hosting,wsgi | 22,368,517 | 9 | false | 1 | 0 | I use AWS micro server, 1 year free and after that you can get a 3 year reserved which works out to about $75/yr :) The micro server has only 20MB/sec throughput, ~600MB of ram, and a slower CPU. I run a few Mezzanine sites on mine and it seems fine. | 3 | 14 | 0 | I want to be able to run WSGI apps but my current hosting restricts it. Does anybody know a company that can accommodate my requirements? | For Python support, what company would be best to get hosting from? | 0 | 0 | 0 | 9,246 |
434,597 | 2009-01-12T06:23:00.000 | 2 | 0 | 1 | 1 | python,windows,macos | 818,083 | 15 | false | 0 | 0 | If you want to specify the app to open the file with on Mac OS X, use this:
os.system("open -a [app name] [file name]") | 2 | 157 | 0 | I need to be able to open a document using its default application in Windows and Mac OS. Basically, I want to do the same thing that happens when you double-click on the document icon in Explorer or Finder. What is the best way to do this in Python? | Open document with default OS application in Python, both in Windows and Mac OS | 0.02666 | 0 | 0 | 118,227 |
434,597 | 2009-01-12T06:23:00.000 | 5 | 0 | 1 | 1 | python,windows,macos | 24,895,085 | 15 | false | 0 | 0 | os.startfile(path, 'open') under Windows is good because when spaces exist in the directory, os.system('start', path_name) can't open the app correctly and when the i18n exist in the directory, os.system needs to change the unicode to the codec of the console in Windows. | 2 | 157 | 0 | I need to be able to open a document using its default application in Windows and Mac OS. Basically, I want to do the same thing that happens when you double-click on the document icon in Explorer or Finder. What is the best way to do this in Python? | Open document with default OS application in Python, both in Windows and Mac OS | 0.066568 | 0 | 0 | 118,227 |
436,497 | 2009-01-12T18:38:00.000 | 23 | 0 | 1 | 0 | python,module,package,python-import | 436,511 | 5 | false | 0 | 0 | This doesn't exactly answer your question, but I'm going to suggest that you move the function outside of the __init__.py file, and into another module inside that package. You can then easily import that function into your other module. If you want, you can have an import statement in the __init__.py file that will im... | 3 | 62 | 0 | In a module residing inside a package, i have the need to use a function defined within the __init__.py of that package. how can i import the package within the module that resides within the package, so i can use that function?
Importing __init__ inside the module will not import the package, but instead a module name... | Python: import the containing package | 1 | 0 | 0 | 36,370 |
436,497 | 2009-01-12T18:38:00.000 | 5 | 0 | 1 | 0 | python,module,package,python-import | 436,607 | 5 | false | 0 | 0 | If the package is named testmod and your init file is therefore testmod/__init__.py and your module within the package is submod.py then from within submod.py file, you should just be able to say import testmod and use whatever you want that's defined in testmod. | 3 | 62 | 0 | In a module residing inside a package, i have the need to use a function defined within the __init__.py of that package. how can i import the package within the module that resides within the package, so i can use that function?
Importing __init__ inside the module will not import the package, but instead a module name... | Python: import the containing package | 0.197375 | 0 | 0 | 36,370 |
436,497 | 2009-01-12T18:38:00.000 | 1 | 0 | 1 | 0 | python,module,package,python-import | 708,076 | 5 | false | 0 | 0 | In Django, the file manage.py has from django.core.management import execute_manager, but execute_manager is not a module. It is a function within the __init__.py module of the management directory. | 3 | 62 | 0 | In a module residing inside a package, i have the need to use a function defined within the __init__.py of that package. how can i import the package within the module that resides within the package, so i can use that function?
Importing __init__ inside the module will not import the package, but instead a module name... | Python: import the containing package | 0.039979 | 0 | 0 | 36,370 |
436,944 | 2009-01-12T20:40:00.000 | 0 | 0 | 1 | 0 | python,django,django-forms | 437,360 | 2 | false | 1 | 0 | The Django source says
Given a
dictionary of data and this widget's
name, returns the value of this
widget. Returns None if it's not
provided.
Reading the code, I see that Django's separate Date and Time widgets are both subclasses of Input, subclasses of Widget, which appears to work with simple Strings. | 1 | 5 | 0 | I'm trying to build my own custom django form widgets (putting them in widgets.py of my project directory). What should the value "value_from_datadict()" return? Is it returning a string or the actual expected value of the field?
I'm building my own version of a split date/time widget using JQuery objects, what shoul... | What should "value_from_datadict" method of a custom form widget return? | 0 | 0 | 0 | 4,106 |
437,025 | 2009-01-12T21:11:00.000 | -1 | 0 | 1 | 1 | python,readline,read-eval-print-loop | 439,403 | 6 | false | 0 | 0 | I think you have 2 basic options:
Synchronize your output (i.e. block until it comes back)
Separate your input and your (asyncronous) output, perhaps in two separate columns. | 1 | 13 | 0 | I have a Python-based app that can accept a few commands in a simple read-eval-print-loop. I'm using raw_input('> ') to get the input. On Unix-based systems, I also import readline to make things behave a little better. All this is working fine.
The problem is that there are asynchronous events coming in, and I'd like ... | How to implement a python REPL that nicely handles asynchronous output? | -0.033321 | 0 | 0 | 7,222 |
438,149 | 2009-01-13T06:42:00.000 | 0 | 1 | 1 | 0 | python,class,scripting | 1,992,389 | 4 | false | 0 | 0 | not necessary since python is not a purely object oriented language but certain things are better written in classes (encapsulation).it becomes easier to build a large project using classes | 3 | 0 | 0 | I am creating an interface for Python scripting.
Later I will be dong Python scripting also for automated testing.
Is it necessary the at i must use class in my code.Now I have created the code
with dictionaries,lists,functions,global and local variables.
Is class necessary?
Help me in this. | Help needed--Is class necessary in Python scripting? | 0 | 0 | 0 | 2,284 |
438,149 | 2009-01-13T06:42:00.000 | 1 | 1 | 1 | 0 | python,class,scripting | 438,239 | 4 | false | 0 | 0 | It's not needed to make it work, but I would argue that it will become messy to maintain if you do not encapsulate certain things in classes. Classes are something that schould help the programmer to organizes his/her code, not just nice to have fluff. | 3 | 0 | 0 | I am creating an interface for Python scripting.
Later I will be dong Python scripting also for automated testing.
Is it necessary the at i must use class in my code.Now I have created the code
with dictionaries,lists,functions,global and local variables.
Is class necessary?
Help me in this. | Help needed--Is class necessary in Python scripting? | 0.049958 | 0 | 0 | 2,284 |
438,149 | 2009-01-13T06:42:00.000 | 10 | 1 | 1 | 0 | python,class,scripting | 438,171 | 4 | false | 0 | 0 | No, of course class is not a must. As Python is a scripting language, you can simply code your scripts without defining your own classes.
Classes are useful if you implement a more complex program which needs a structured approach and OOP benfits (encapsulation, polimorphism) help you in doing it. | 3 | 0 | 0 | I am creating an interface for Python scripting.
Later I will be dong Python scripting also for automated testing.
Is it necessary the at i must use class in my code.Now I have created the code
with dictionaries,lists,functions,global and local variables.
Is class necessary?
Help me in this. | Help needed--Is class necessary in Python scripting? | 1 | 0 | 0 | 2,284 |
438,559 | 2009-01-13T10:36:00.000 | 4 | 0 | 0 | 0 | python,mysql,database,django,django-models | 438,700 | 2 | false | 1 | 0 | No.
Adding indexes willy-nilly to all "slow" queries will also slow down inserts, updates and deletes.
Indexes are a balancing act between fast queries and fast changes. There is no general or "right" answer. There's certainly nothing that can automate this.
You have to measure the improvement across your whole appli... | 1 | 5 | 0 | The beauty of ORM lulled me into a soporific sleep. I've got an existing Django app with a lack of database indexes. Is there a way to automatically generate a list of columns that need indexing?
I was thinking maybe some middleware that logs which columns are involved in WHERE clauses? but is there anything built into... | Is there a way to automatically generate a list of columns that need indexing? | 0.379949 | 1 | 0 | 620 |
438,844 | 2009-01-13T12:53:00.000 | 159 | 0 | 1 | 0 | python,goto | 438,848 | 22 | false | 0 | 0 | No, Python does not support labels and goto. It's a (highly) structured programming language. | 1 | 250 | 0 | Is there a goto or any equivalent in Python to be able to jump to a specific line of code? | Is there a label/goto in Python? | 1 | 0 | 0 | 616,022 |
438,894 | 2009-01-13T13:13:00.000 | 6 | 0 | 1 | 0 | python,exception-handling | 438,901 | 6 | false | 0 | 0 | As far as I know, if an exception is not caught by your script, it will be interrupted. | 2 | 75 | 0 | I need to stop my program when an exception is raised in Python.
How do I implement this? | How do I stop a program when an exception is raised in Python? | 1 | 0 | 0 | 188,945 |
438,894 | 2009-01-13T13:13:00.000 | 17 | 0 | 1 | 0 | python,exception-handling | 440,523 | 6 | false | 0 | 0 | If you don't handle an exception, it will propagate up the call stack up to the interpreter, which will then display a traceback and exit. IOW : you don't have to do anything to make your script exit when an exception happens. | 2 | 75 | 0 | I need to stop my program when an exception is raised in Python.
How do I implement this? | How do I stop a program when an exception is raised in Python? | 1 | 0 | 0 | 188,945 |
439,641 | 2009-01-13T16:21:00.000 | 7 | 1 | 1 | 0 | python,ruby,python-imaging-library,rmagick | 440,298 | 3 | false | 0 | 0 | PIL is a good library, use it. ImageMagic (what RMagick wraps) is a very heavy library that should be avoided if possible. Its good for doing local processing of images, say, a batch photo editor, but way too processor inefficient for common image manipulation tasks for web.
EDIT: In response to the question, PIL sup... | 1 | 4 | 0 | For my next project I plan to create images with text and graphics. I'm comfortable with ruby, but interested in learning python. I figured this may be a good time because PIL looks like a great library to use. However, I don't know how it compares to what ruby has to offer (e.g. RMagick and ruby-gd). From what I c... | PIL vs RMagick/ruby-gd | 1 | 0 | 0 | 2,243 |
439,759 | 2009-01-13T16:47:00.000 | 0 | 0 | 0 | 0 | php,python,postgresql | 494,119 | 7 | false | 0 | 0 | Just to throw it out there... there are PHP frameworks utilizing MVC.
Codeigniter does simple and yet powerful things. You can definitely separate the template layer from the logic layer. | 6 | 2 | 0 | I'm looking for some quick thoughts about a business application I am looking to build. I'd like to separate the three layers of presentation, domain logic, and data using PHP, Python, and PostgreSQL, respectively. I would like to hear, possibly from other folks who have gone down this path before, if there are proble... | Is a PHP, Python, PostgreSQL design suitable for a business application? | 0 | 1 | 0 | 2,512 |
439,759 | 2009-01-13T16:47:00.000 | 0 | 0 | 0 | 0 | php,python,postgresql | 439,793 | 7 | false | 0 | 0 | I personally agree with the second and the third points in your post. Speaking about PHP, in my opinion you can use Python also for presentation, there are many solutions (Zope, Plone ...) based on Python. | 6 | 2 | 0 | I'm looking for some quick thoughts about a business application I am looking to build. I'd like to separate the three layers of presentation, domain logic, and data using PHP, Python, and PostgreSQL, respectively. I would like to hear, possibly from other folks who have gone down this path before, if there are proble... | Is a PHP, Python, PostgreSQL design suitable for a business application? | 0 | 1 | 0 | 2,512 |
439,759 | 2009-01-13T16:47:00.000 | 0 | 0 | 0 | 0 | php,python,postgresql | 439,818 | 7 | false | 0 | 0 | Just skip PHP and use Python (with Django, as already noticed while I typed). Django already separates the layers as you mentioned.
I have never used PgSQL myself, but I think it's mostly a matter of taste whether you prefer it over MySQL. It used to support more enterprise features than MySQL but I'm not sure if that'... | 6 | 2 | 0 | I'm looking for some quick thoughts about a business application I am looking to build. I'd like to separate the three layers of presentation, domain logic, and data using PHP, Python, and PostgreSQL, respectively. I would like to hear, possibly from other folks who have gone down this path before, if there are proble... | Is a PHP, Python, PostgreSQL design suitable for a business application? | 0 | 1 | 0 | 2,512 |
439,759 | 2009-01-13T16:47:00.000 | 1 | 0 | 0 | 0 | php,python,postgresql | 440,496 | 7 | false | 0 | 0 | I can only repeat what other peoples here already said : if you choose Python for the domain layer, you won't gain anything (quite on the contrary) using PHP for the presentation layer. Others already advised Django, and that might be a pretty good choice, but there's no shortage of good Python web frameworks. | 6 | 2 | 0 | I'm looking for some quick thoughts about a business application I am looking to build. I'd like to separate the three layers of presentation, domain logic, and data using PHP, Python, and PostgreSQL, respectively. I would like to hear, possibly from other folks who have gone down this path before, if there are proble... | Is a PHP, Python, PostgreSQL design suitable for a business application? | 0.028564 | 1 | 0 | 2,512 |
439,759 | 2009-01-13T16:47:00.000 | 1 | 0 | 0 | 0 | php,python,postgresql | 440,118 | 7 | false | 0 | 0 | I'm going to assume that by "business application" you mean a web application hosted in an intranet environment as opposed to some sort of SaaS application on the internet.
While you're in the process of architecting your application you need to consider the existing infrastructure and infrastructure support people of ... | 6 | 2 | 0 | I'm looking for some quick thoughts about a business application I am looking to build. I'd like to separate the three layers of presentation, domain logic, and data using PHP, Python, and PostgreSQL, respectively. I would like to hear, possibly from other folks who have gone down this path before, if there are proble... | Is a PHP, Python, PostgreSQL design suitable for a business application? | 0.028564 | 1 | 0 | 2,512 |
439,759 | 2009-01-13T16:47:00.000 | 0 | 0 | 0 | 0 | php,python,postgresql | 440,098 | 7 | false | 0 | 0 | Just to address the MySQL vs PgSQL issues - it shouldn't matter. They're both more than capable of the task, and any reasonable framework should isolate you from the differences relatively well. I think it's down to what you use already, what people have most experience in, and if there's a feature in one or the other ... | 6 | 2 | 0 | I'm looking for some quick thoughts about a business application I am looking to build. I'd like to separate the three layers of presentation, domain logic, and data using PHP, Python, and PostgreSQL, respectively. I would like to hear, possibly from other folks who have gone down this path before, if there are proble... | Is a PHP, Python, PostgreSQL design suitable for a business application? | 0 | 1 | 0 | 2,512 |
440,036 | 2009-01-13T17:52:00.000 | 1 | 0 | 1 | 0 | java,python,ruby,multithreading,concurrency | 442,312 | 5 | false | 1 | 0 | This is not flame bait, but IMHO Java has one of the simpler and more restricted models for threading and concurrency available.
That's not necessarily a bad thing, but at the level of granularity it offers it means that the perspective it gives you of what concurrency is and how to deal with it is inherently limited i... | 3 | 7 | 0 | I am primarily a Java developer, and I've been reading a lot of in-depth work on threads and concurrency. Many very smart people (Doug Lea, Brian Goetz, etc) have authored books on these topics and made contributions to new concurrency libraries for Java.
As I start to learn more about Python, Ruby, and other language... | Re-creating threading and concurrency knowledge in increasingly popular languages | 0.039979 | 0 | 0 | 573 |
440,036 | 2009-01-13T17:52:00.000 | 3 | 0 | 1 | 0 | java,python,ruby,multithreading,concurrency | 463,249 | 5 | false | 1 | 0 | I think the answer is both yes and no. Java arguably has the most well-defined memory model and execution semantics of the most commonly used imperative languages (Java, C++, Python, Ruby, etc). In some sense, other languages either lack this completely or are playing catch-up (if that's even possible given the immat... | 3 | 7 | 0 | I am primarily a Java developer, and I've been reading a lot of in-depth work on threads and concurrency. Many very smart people (Doug Lea, Brian Goetz, etc) have authored books on these topics and made contributions to new concurrency libraries for Java.
As I start to learn more about Python, Ruby, and other language... | Re-creating threading and concurrency knowledge in increasingly popular languages | 0.119427 | 0 | 0 | 573 |
440,036 | 2009-01-13T17:52:00.000 | 11 | 0 | 1 | 0 | java,python,ruby,multithreading,concurrency | 440,086 | 5 | false | 1 | 0 | The basic principles of concurrent programming existed before java and were summarized in those java books you're talking about. The java.util.concurrent library was similarly derived from previous code and research papers on concurrent programming.
However, some implementation issues are specific to Java. It has a spe... | 3 | 7 | 0 | I am primarily a Java developer, and I've been reading a lot of in-depth work on threads and concurrency. Many very smart people (Doug Lea, Brian Goetz, etc) have authored books on these topics and made contributions to new concurrency libraries for Java.
As I start to learn more about Python, Ruby, and other language... | Re-creating threading and concurrency knowledge in increasingly popular languages | 1 | 0 | 0 | 573 |
440,320 | 2009-01-13T19:06:00.000 | 23 | 1 | 1 | 0 | python,unicode,utf-8 | 440,461 | 2 | false | 0 | 0 | I'd prefer 'something'.decode(...) since the unicode type is no longer there in Python 3.0, while text = b'binarydata'.decode(encoding) is still valid. | 1 | 27 | 0 | Is there any reason to prefer unicode(somestring, 'utf8') as opposed to somestring.decode('utf8')?
My only thought is that .decode() is a bound method so python may be able to resolve it more efficiently, but correct me if I'm wrong. | unicode() vs. str.decode() for a utf8 encoded byte string (python 2.x) | 1 | 0 | 0 | 30,226 |
441,256 | 2009-01-13T23:11:00.000 | 0 | 0 | 1 | 0 | python,wxpython,compilation,py2exe | 929,765 | 4 | false | 0 | 0 | I have run into similar problem few minutes ago. I couldn't run py2exe installation file, it kept saying that application configuration was incorrect. Downgrading to python 2.5 didn't work for me because I used 'with' statements through out the code and didn't want to change it.
I reinstalled python 2.6 and I checked ... | 2 | 5 | 0 | I've compiled my Python program using Py2Exe, and on the client's computer we've satisfied all the dependencies using dependency walker, but we still get "The application configuration is incorrect. Reinstalling the application may correct the problem." I'm also using wxPython.
The client does not have administrator ... | Py2Exe - "The application configuration is incorrect." | 0 | 0 | 0 | 2,997 |
441,256 | 2009-01-13T23:11:00.000 | 1 | 0 | 1 | 0 | python,wxpython,compilation,py2exe | 441,590 | 4 | true | 0 | 0 | I've ran into this myself and my random Googling has pointed me to several people saying to downgrade python 2.6 to 2.5, which worked for me. | 2 | 5 | 0 | I've compiled my Python program using Py2Exe, and on the client's computer we've satisfied all the dependencies using dependency walker, but we still get "The application configuration is incorrect. Reinstalling the application may correct the problem." I'm also using wxPython.
The client does not have administrator ... | Py2Exe - "The application configuration is incorrect." | 1.2 | 0 | 0 | 2,997 |
441,824 | 2009-01-14T03:39:00.000 | 0 | 0 | 1 | 0 | java,python,jvm | 49,241,488 | 14 | false | 0 | 0 | No, they don't both interpret byte code.
Python only interprets bytecode if you are running with pypy. Otherwise it is compiled into C and interpreted at that level.
Java compiles to bytecode. | 12 | 235 | 0 | It seems rare to read of a Python "virtual machine" while in Java "virtual machine" is used all the time.
Both interpret byte codes; why call one a virtual machine and the other an interpreter? | Java "Virtual Machine" vs. Python "Interpreter" parlance? | 0 | 0 | 0 | 72,004 |
441,824 | 2009-01-14T03:39:00.000 | 0 | 0 | 1 | 0 | java,python,jvm | 39,804,828 | 14 | false | 0 | 0 | First of all you should understand that programming or computer science in general is not mathematics and we don't have rigorous definitions for most of the terms we use often.
now to your question :
what is an Interpreter (in computer science)
It translates source code by smallest executable unit and then executes th... | 12 | 235 | 0 | It seems rare to read of a Python "virtual machine" while in Java "virtual machine" is used all the time.
Both interpret byte codes; why call one a virtual machine and the other an interpreter? | Java "Virtual Machine" vs. Python "Interpreter" parlance? | 0 | 0 | 0 | 72,004 |
441,824 | 2009-01-14T03:39:00.000 | 14 | 0 | 1 | 0 | java,python,jvm | 53,356,426 | 14 | false | 0 | 0 | To provide a deep answer to the question "Why Java Virtual Machine, but Python interpreter?" let's try to go back to the field of compilation theory as to the starting point of the discussion.
The typical process of program compilation includes next steps:
Lexical analysis. Splits program text into meaningful "words" ... | 12 | 235 | 0 | It seems rare to read of a Python "virtual machine" while in Java "virtual machine" is used all the time.
Both interpret byte codes; why call one a virtual machine and the other an interpreter? | Java "Virtual Machine" vs. Python "Interpreter" parlance? | 1 | 0 | 0 | 72,004 |
441,824 | 2009-01-14T03:39:00.000 | 144 | 0 | 1 | 0 | java,python,jvm | 441,973 | 14 | true | 0 | 0 | A virtual machine is a virtual computing environment with a specific set of atomic well defined instructions that are supported independent of any specific language and it is generally thought of as a sandbox unto itself. The VM is analogous to an instruction set of a specific CPU and tends to work at a more fundamenta... | 12 | 235 | 0 | It seems rare to read of a Python "virtual machine" while in Java "virtual machine" is used all the time.
Both interpret byte codes; why call one a virtual machine and the other an interpreter? | Java "Virtual Machine" vs. Python "Interpreter" parlance? | 1.2 | 0 | 0 | 72,004 |
441,824 | 2009-01-14T03:39:00.000 | 12 | 0 | 1 | 0 | java,python,jvm | 441,901 | 14 | false | 0 | 0 | The term interpreter is a legacy term dating back to earlier shell scripting languages. As "scripting languages" have evolved into full featured languages and their corresponding platforms have become more sophisticated and sandboxed, the distinction between a virtual machine and an interpreter (in the Python sense), ... | 12 | 235 | 0 | It seems rare to read of a Python "virtual machine" while in Java "virtual machine" is used all the time.
Both interpret byte codes; why call one a virtual machine and the other an interpreter? | Java "Virtual Machine" vs. Python "Interpreter" parlance? | 1 | 0 | 0 | 72,004 |
441,824 | 2009-01-14T03:39:00.000 | 68 | 0 | 1 | 0 | java,python,jvm | 441,854 | 14 | false | 0 | 0 | Probably one reason for the different terminology is that one normally thinks of feeding the python interpreter raw human-readable source code and not worrying about bytecode and all that.
In Java, you have to explicitly compile to bytecode and then run just the bytecode, not source code on the VM.
Even though Pyth... | 12 | 235 | 0 | It seems rare to read of a Python "virtual machine" while in Java "virtual machine" is used all the time.
Both interpret byte codes; why call one a virtual machine and the other an interpreter? | Java "Virtual Machine" vs. Python "Interpreter" parlance? | 1 | 0 | 0 | 72,004 |
441,824 | 2009-01-14T03:39:00.000 | 11 | 0 | 1 | 0 | java,python,jvm | 441,830 | 14 | false | 0 | 0 | There's no real difference between them, people just follow the conventions the creators have chosen. | 12 | 235 | 0 | It seems rare to read of a Python "virtual machine" while in Java "virtual machine" is used all the time.
Both interpret byte codes; why call one a virtual machine and the other an interpreter? | Java "Virtual Machine" vs. Python "Interpreter" parlance? | 1 | 0 | 0 | 72,004 |
441,824 | 2009-01-14T03:39:00.000 | 3 | 0 | 1 | 0 | java,python,jvm | 57,942,833 | 14 | false | 0 | 0 | Python can interpret code without compiling it to bytecode. Java can't.
Python is an interpreted language, as opposed to a compiled one, though the distinction can be blurry because of the presence of the bytecode compiler. This means that source files can be run directly without explicitly creating an executable whic... | 12 | 235 | 0 | It seems rare to read of a Python "virtual machine" while in Java "virtual machine" is used all the time.
Both interpret byte codes; why call one a virtual machine and the other an interpreter? | Java "Virtual Machine" vs. Python "Interpreter" parlance? | 0.042831 | 0 | 0 | 72,004 |
441,824 | 2009-01-14T03:39:00.000 | 3 | 0 | 1 | 0 | java,python,jvm | 441,926 | 14 | false | 0 | 0 | Don't forget that Python has JIT compilers available for x86, further confusing the issue. (See psyco).
A more strict interpretation of an 'interpreted language' only becomes useful when discussing performance issues of the VM, for example, compared with Python, Ruby was (is?) considered to be slower because it is an i... | 12 | 235 | 0 | It seems rare to read of a Python "virtual machine" while in Java "virtual machine" is used all the time.
Both interpret byte codes; why call one a virtual machine and the other an interpreter? | Java "Virtual Machine" vs. Python "Interpreter" parlance? | 0.042831 | 0 | 0 | 72,004 |
441,824 | 2009-01-14T03:39:00.000 | 0 | 0 | 1 | 0 | java,python,jvm | 66,917,426 | 14 | false | 0 | 0 | There actually might be a reason why the HotSpot runtime is called a Virtual Machine while CPython is merely referred to as an interpreter
Firstly, CPython is just your average run of the mill, stack based, bytecode interpreter. You input Python opcode into it, and the software stack machine inside CPython evaluates yo... | 12 | 235 | 0 | It seems rare to read of a Python "virtual machine" while in Java "virtual machine" is used all the time.
Both interpret byte codes; why call one a virtual machine and the other an interpreter? | Java "Virtual Machine" vs. Python "Interpreter" parlance? | 0 | 0 | 0 | 72,004 |
441,824 | 2009-01-14T03:39:00.000 | 0 | 0 | 1 | 0 | java,python,jvm | 59,725,809 | 14 | false | 0 | 0 | for posts that mention that python does not need to generate byte code, I'm not sure that's true. it seems that all callables in Python must have a .__code__.co_code attribute which contains the byte code. I don't see a meaningful reason to call python "not compiled" just because the compiled artifacts may not be saved... | 12 | 235 | 0 | It seems rare to read of a Python "virtual machine" while in Java "virtual machine" is used all the time.
Both interpret byte codes; why call one a virtual machine and the other an interpreter? | Java "Virtual Machine" vs. Python "Interpreter" parlance? | 0 | 0 | 0 | 72,004 |
441,824 | 2009-01-14T03:39:00.000 | 1 | 0 | 1 | 0 | java,python,jvm | 58,199,884 | 14 | false | 0 | 0 | I think the lines between both are blurred, people mostly argue around meaning of word "interpreter" and how close the language stands to each side of "interpreter...compiler" spectrum. None makes 100% however. I think it is easy to write Java or Python implementation which be of any value of the spectrum.
Currently bo... | 12 | 235 | 0 | It seems rare to read of a Python "virtual machine" while in Java "virtual machine" is used all the time.
Both interpret byte codes; why call one a virtual machine and the other an interpreter? | Java "Virtual Machine" vs. Python "Interpreter" parlance? | 0.014285 | 0 | 0 | 72,004 |
441,849 | 2009-01-14T03:51:00.000 | 1 | 0 | 0 | 1 | python,networking,twisted | 442,079 | 5 | false | 0 | 0 | Just adding an answer to re-iterate other posters - it'll be worth it to use Twisted. There's no reason to write yet another TCP server that'll end up working not as well as one using twisted would. The only reason would be if writing your own is much faster, developer-wise, but if you just bite the bullet and learn tw... | 2 | 12 | 0 | I was just wondering what network libraries there are out there for Python for building a TCP/IP server. I know that Twisted might jump to mind but the documentation seems scarce, sloppy, and scattered to me.
Also, would using Twisted even have a benefit over rolling my own server with select.select()? | Good Python networking libraries for building a TCP server? | 0.039979 | 0 | 1 | 12,949 |
441,849 | 2009-01-14T03:51:00.000 | 6 | 0 | 0 | 1 | python,networking,twisted | 441,863 | 5 | false | 0 | 0 | The standard library includes SocketServer and related modules which might be sufficient for your needs. This is a good middle ground between a complex framework like Twisted, and rolling your own select() loop. | 2 | 12 | 0 | I was just wondering what network libraries there are out there for Python for building a TCP/IP server. I know that Twisted might jump to mind but the documentation seems scarce, sloppy, and scattered to me.
Also, would using Twisted even have a benefit over rolling my own server with select.select()? | Good Python networking libraries for building a TCP server? | 1 | 0 | 1 | 12,949 |
442,188 | 2009-01-14T07:34:00.000 | 0 | 0 | 1 | 0 | python | 442,662 | 4 | false | 0 | 0 | Note that Python doesn't have readByte, readInt and readString because it doesn't work directly with all those fancy data types. Files provides strings which you can convert.
Python <= 2.6 has String and that's what you get from your input streams -- strings. The simple socket.read() provides this input. You can use... | 1 | 6 | 0 | The functions ReadInt(), ReadByte(), and ReadString() (to name a few) exist in other languages for reading input from streams. I am trying to read from a socket, and I want to use functions like these. Are they tucked away in Python somewhere under a different way or has someone made a library for it?
Also, there are W... | ReadInt(), ReadByte(), ReadString(), etc. in Python? | 0 | 0 | 0 | 14,799 |
442,355 | 2009-01-14T09:11:00.000 | 0 | 0 | 0 | 0 | python,django,configuration,django-models,django-admin | 448,110 | 3 | false | 1 | 0 | I think you'll have trouble if you make other apps depend (at interpretation/app-loading time) on values set in your config app. Can you use some kind of placeholder value in Python code at interpretation time, and then pull in the real config data on the post_syncdb signal? | 1 | 4 | 0 | I need to program kind of configuration registry for Django-based application.
Requirements:
Most likely param_name : param_value structure
Editable via admin interface
Has to work with syncdb. How to deal with a situation in which other apps depend on configuration model and the model itself has not been initialized... | What is the best approach to implement configuration app with Django? | 0 | 0 | 0 | 1,916 |
442,596 | 2009-01-14T11:04:00.000 | 1 | 0 | 0 | 0 | python,django | 443,155 | 2 | false | 1 | 0 | I would also suggest considering getting a mapping of all data once instead of requesting subfield values one by one. Unless the subfield choices change frequently (states/cities change?) or huge in numbers (>1000) this should offer best performance and it is less complex.
You don't even need to create a seperate view,... | 1 | 3 | 0 | Can anyone point to an example written in Python (django preferred) with ajax for cascading forms? Cascading Forms is basically forms whose field values change if and when another field value changes. Example Choose Country, and then States will change... | cascading forms in Django/else using any Pythonic framework | 0.099668 | 0 | 0 | 612 |
443,082 | 2009-01-14T14:17:00.000 | 0 | 0 | 1 | 0 | python,multithreading | 661,707 | 2 | false | 0 | 0 | Thank you for this answer! Actually I am running one profiler in each context, so the question make sense. From the tests I made the profiler would measure "linef1 linef2 linef3" in the above example. | 1 | 1 | 0 | This is a question about Python native c file _lsprof.
How does _lsprof.profile() profiler counts total time spent on a function f in a multi-threaded program if the execution of f is interrupted by another thread?
For example:
def f():
linef1
linef2
linef3
def g():
lineg1
lineg2
And at the execution we... | _lsprof.c profiler behaviour towards python multi-threading | 0 | 0 | 0 | 259 |
443,885 | 2009-01-14T17:20:00.000 | 0 | 1 | 1 | 0 | python,events,delegates,callback | 443,934 | 8 | false | 0 | 0 | Personally, I've only seen callbacks used. However, I haven't seen that much event driven python code so YMMV. | 2 | 25 | 0 | Just want to know what's the common way to react on events in python. There are several ways in other languages like callback functions, delegates, listener-structures and so on.
Is there a common way? Which default language concepts or additional modules are there and which can you recommend? | Python: Callbacks, Delegates, ... ? What is common? | 0 | 0 | 0 | 23,479 |
443,885 | 2009-01-14T17:20:00.000 | 0 | 1 | 1 | 0 | python,events,delegates,callback | 444,003 | 8 | false | 0 | 0 | I have seen listeners and callbacks used. But AFAIK there is no Python way. They should be equally feasible if the application in question is suitable. | 2 | 25 | 0 | Just want to know what's the common way to react on events in python. There are several ways in other languages like callback functions, delegates, listener-structures and so on.
Is there a common way? Which default language concepts or additional modules are there and which can you recommend? | Python: Callbacks, Delegates, ... ? What is common? | 0 | 0 | 0 | 23,479 |
443,996 | 2009-01-14T17:49:00.000 | 0 | 1 | 0 | 0 | ironpython,ironruby | 592,844 | 3 | false | 1 | 0 | We're looking at attribute support again for a .NET interop-focused release in the near future. Keep an eye on ironruby-core@rubyforge.org for an updates. | 1 | 1 | 0 | I have scanned 'the Google' and have not found the definitive answer on whether the Iron* languages (any or all) will end up with Attribute support..
Anyone?
Thanks - Jon | Has anyone tracked down whether IronPython or IronRuby will support Attributes? | 0 | 0 | 0 | 316 |
444,509 | 2009-01-14T20:17:00.000 | 6 | 0 | 1 | 0 | python,debugging,interactive | 444,918 | 5 | false | 0 | 0 | You could try looking at the python debugger pdb. It's like gdb in how you use it, but implemented in pure python. Have a look for pdb.py in your python install directory. | 1 | 11 | 0 | I've seen a couple of Python IDE's (e.g. PyDev Extensions, WingIDE) that provide a debug console - an interactive terminal that runs in the context of the method where the breakpoint is. This lets you print members, call other methods and see the results, and redefine methods to try to fix bugs. Cool.
Can anyone tell m... | How are debug consoles implemented in Python? | 1 | 0 | 0 | 1,515 |
445,037 | 2009-01-14T22:57:00.000 | 2 | 0 | 0 | 0 | python,user-interface,wxpython,wxwidgets,toolbar | 446,014 | 3 | false | 0 | 1 | Doesn't the size of the toolbar adapts itself automatically to the size of the bitmap icons? I think if you want a bigger toolbar, you need bigger bitmaps. | 1 | 2 | 0 | I've got a wx.Toolbar and I'd like to make the buttons larger. I've searched and can't seem to find any concrete documentation on how to do this.
I'm also wondering how well this will translate across platforms; what will happen to the buttons and icons on OSX? | How to make a wx Toolbar buttons larger? | 0.132549 | 0 | 0 | 3,854 |
445,595 | 2009-01-15T04:01:00.000 | 3 | 0 | 1 | 1 | python,windows,python-idle | 445,607 | 9 | false | 0 | 0 | However, I want to run programs in
some other shell than the crappy
windows command prompt, which can't be
widened to more than 80 characters.
Click on the system box (top-left) in the command prompt and click properties. In the layout tab you can set the width and height of the window and the width and height o... | 3 | 24 | 0 | Python for Windows by default comes with IDLE, which is the barest-bones IDE I've ever encountered. For editing files, I'll stick to emacs, thank you very much.
However, I want to run programs in some other shell than the crappy windows command prompt, which can't be widened to more than 80 characters.
IDLE lets me ... | Cleanest way to run/debug python programs in windows | 0.066568 | 0 | 0 | 35,429 |
445,595 | 2009-01-15T04:01:00.000 | 0 | 0 | 1 | 1 | python,windows,python-idle | 679,859 | 9 | false | 0 | 0 | I replaced cmd with Cygwin and Poderosa. May be a little overkill though, if the only problem you have with cmd is that it's a pain to resize.
Although you use Emacs instead of Vim, so I guess you're into overkill... ;-) | 3 | 24 | 0 | Python for Windows by default comes with IDLE, which is the barest-bones IDE I've ever encountered. For editing files, I'll stick to emacs, thank you very much.
However, I want to run programs in some other shell than the crappy windows command prompt, which can't be widened to more than 80 characters.
IDLE lets me ... | Cleanest way to run/debug python programs in windows | 0 | 0 | 0 | 35,429 |
445,595 | 2009-01-15T04:01:00.000 | 9 | 0 | 1 | 1 | python,windows,python-idle | 445,618 | 9 | false | 0 | 0 | You can easily widen the Windows console by doing the following:
click the icon for the console window in the upper right
select Properties from the menu
click the Layout tab
change the Window Size > Width to 140
This can also be saved universally by changing the Defaults on the menu. | 3 | 24 | 0 | Python for Windows by default comes with IDLE, which is the barest-bones IDE I've ever encountered. For editing files, I'll stick to emacs, thank you very much.
However, I want to run programs in some other shell than the crappy windows command prompt, which can't be widened to more than 80 characters.
IDLE lets me ... | Cleanest way to run/debug python programs in windows | 1 | 0 | 0 | 35,429 |
445,827 | 2009-01-15T06:07:00.000 | 13 | 0 | 0 | 1 | python,google-app-engine,join,google-cloud-datastore | 446,471 | 4 | false | 1 | 0 | If you look at how the SQL solution you provided will be executed, it will go basically like this:
Fetch a list of friends for the current user
For each user in the list, start an index scan over recent posts
Merge-join all the scans from step 2, stopping when you've retrieved enough entries
You can carry out exactly... | 2 | 13 | 0 | Example Problem:
Entities:
User contains name and a list of friends (User references)
Blog Post contains title, content, date and Writer (User)
Requirement:
I want a page that displays the title and a link to the blog of the last 10 posts by a user's friend. I would also like the ability to keep paging back through ... | GAE - How to live with no joins? | 1 | 1 | 0 | 2,112 |
445,827 | 2009-01-15T06:07:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine,join,google-cloud-datastore | 446,477 | 4 | false | 1 | 0 | "Load user, loop through the list of friends and load their latest blog posts."
That's all a join is -- nested loops. Some kinds of joins are loops with lookups. Most lookups are just loops; some are hashes.
"Finally merge all the blog posts to find the latest 10 blog entries"
That's a ORDER BY with a LIMIT. That's ... | 2 | 13 | 0 | Example Problem:
Entities:
User contains name and a list of friends (User references)
Blog Post contains title, content, date and Writer (User)
Requirement:
I want a page that displays the title and a link to the blog of the last 10 posts by a user's friend. I would also like the ability to keep paging back through ... | GAE - How to live with no joins? | 0.049958 | 1 | 0 | 2,112 |
446,685 | 2009-01-15T13:21:00.000 | 0 | 0 | 1 | 0 | python,ruby,perl | 447,176 | 9 | false | 0 | 0 | "installing Perl on Windows would not be worth it for them" Really? It's that complex?
Python has a simple .MSI that neatly installs itself with no muss or fuss.
A simple application program is just a few .py files, so, I don't see a big pain factor there.
You know your customers best.
I find that the following isn't... | 1 | 22 | 0 | I want to write a piece of software which is essentially a regex data scrubber. I am going to take a contact list in CSV and remove all non-word characters and such from the person's name.
This project has Perl written all over it but my client base is largely non-technical and installing Perl on Windows would not be w... | How can I deploy a Perl/Python/Ruby script without installing an interpreter? | 0 | 0 | 0 | 11,996 |
446,782 | 2009-01-15T13:48:00.000 | 3 | 0 | 1 | 0 | python,exception,function | 446,817 | 5 | false | 0 | 0 | Assuming you want to "stop" execution inside of that method. There's a few things you can do.
Don't catch the exception. This will return control to the method that called it in the first place. You can then do whatever you want with it.
sys.exit(0) This one actually exits the entire program.
return I know you said y... | 2 | 11 | 0 | I want to get out of a function when an exception occurs or so.
I want to use other method than 'return' | Getting out of a function in Python | 0.119427 | 0 | 0 | 56,237 |
446,782 | 2009-01-15T13:48:00.000 | 4 | 0 | 1 | 0 | python,exception,function | 446,805 | 5 | false | 0 | 0 | Can't think of another way to "get out" of a function other than a) return, b) throw an exception, or c) terminate execution of the program. | 2 | 11 | 0 | I want to get out of a function when an exception occurs or so.
I want to use other method than 'return' | Getting out of a function in Python | 0.158649 | 0 | 0 | 56,237 |
447,107 | 2009-01-15T15:13:00.000 | 12 | 0 | 1 | 0 | python,string,unicode,character-encoding,python-2.x | 447,401 | 6 | false | 0 | 0 | mybytestring.encode(somecodec) is meaningful for these values of somecodec:
base64
bz2
zlib
hex
quopri
rot13
string_escape
uu
I am not sure what decoding an already decoded unicode text is good for. Trying that with any encoding seems to always try to encode with the system's default encoding first. | 3 | 185 | 0 | I've never been sure that I understand the difference between str/unicode decode and encode.
I know that str().decode() is for when you have a string of bytes that you know has a certain character encoding, given that encoding name it will return a unicode string.
I know that unicode().encode() converts unicode chars i... | What is the difference between encode/decode? | 1 | 0 | 0 | 111,429 |
447,107 | 2009-01-15T15:13:00.000 | 16 | 0 | 1 | 0 | python,string,unicode,character-encoding,python-2.x | 452,378 | 6 | false | 0 | 0 | anUnicode.encode('encoding') results in a string object and can be called on a unicode object
aString.decode('encoding') results in an unicode object and can be called on a string, encoded in given encoding.
Some more explanations:
You can create some unicode object, which doesn't have any encoding set. The way it i... | 3 | 185 | 0 | I've never been sure that I understand the difference between str/unicode decode and encode.
I know that str().decode() is for when you have a string of bytes that you know has a certain character encoding, given that encoding name it will return a unicode string.
I know that unicode().encode() converts unicode chars i... | What is the difference between encode/decode? | 1 | 0 | 0 | 111,429 |
447,107 | 2009-01-15T15:13:00.000 | 1 | 0 | 1 | 0 | python,string,unicode,character-encoding,python-2.x | 48,072,847 | 6 | false | 0 | 0 | The simple answer is that they are the exact opposite of each other.
The computer uses the very basic unit of byte to store and process information; it is meaningless for human eyes.
For example,'\xe4\xb8\xad\xe6\x96\x87' is the representation of two Chinese characters, but the computer only knows (meaning print or sto... | 3 | 185 | 0 | I've never been sure that I understand the difference between str/unicode decode and encode.
I know that str().decode() is for when you have a string of bytes that you know has a certain character encoding, given that encoding name it will return a unicode string.
I know that unicode().encode() converts unicode chars i... | What is the difference between encode/decode? | 0.033321 | 0 | 0 | 111,429 |
448,095 | 2009-01-15T19:23:00.000 | 0 | 0 | 1 | 0 | java,python | 2,746,114 | 7 | false | 1 | 0 | I've used Java2Python. It's not too bad, you still need to understand the code as it doesn't do everything correctly, but it does help. | 6 | 6 | 0 | I'm about to port a smallish library from Java to Python and wanted some advice (smallish ~ a few thousand lines of code). I've studied the Java code a little, and noticed some design patterns that are common in both languages. However, there were definitely some Java-only idioms (singletons, etc) present that are ge... | Porting library from Java to Python | 0 | 0 | 0 | 1,699 |
448,095 | 2009-01-15T19:23:00.000 | 9 | 0 | 1 | 0 | java,python | 448,137 | 7 | true | 1 | 0 | If it were me, I'd consider doing the work by hand. A couple thousand lines of code isn't a lot of code, and by rewriting it yourself (rather than translating it automatically), you'll be in a position to decide how to take advantage of Python idioms appropriately. (FWIW, I worked Java almost exclusively for 9 years, a... | 6 | 6 | 0 | I'm about to port a smallish library from Java to Python and wanted some advice (smallish ~ a few thousand lines of code). I've studied the Java code a little, and noticed some design patterns that are common in both languages. However, there were definitely some Java-only idioms (singletons, etc) present that are ge... | Porting library from Java to Python | 1.2 | 0 | 0 | 1,699 |
448,095 | 2009-01-15T19:23:00.000 | 2 | 0 | 1 | 0 | java,python | 448,330 | 7 | false | 1 | 0 | Jython's not what you're looking for in the final solution, but it will make the porting go much smoother.
My approach would be:
If there are existing tests (unit or otherwise), rewrite them in Jython (using Python's unittest)
Write some characterization tests in Jython (tests that record the current behavior)
Start p... | 6 | 6 | 0 | I'm about to port a smallish library from Java to Python and wanted some advice (smallish ~ a few thousand lines of code). I've studied the Java code a little, and noticed some design patterns that are common in both languages. However, there were definitely some Java-only idioms (singletons, etc) present that are ge... | Porting library from Java to Python | 0.057081 | 0 | 0 | 1,699 |
448,095 | 2009-01-15T19:23:00.000 | 3 | 0 | 1 | 0 | java,python | 448,245 | 7 | false | 1 | 0 | I would write it again by hand. I don't know of any automated tools that would generate non-disgusting looking Python, and having ported Java code to Python myself, I found the result was both higher quality than the original and considerably shorter.
You gain quality because Python is more expressive (for example, ano... | 6 | 6 | 0 | I'm about to port a smallish library from Java to Python and wanted some advice (smallish ~ a few thousand lines of code). I've studied the Java code a little, and noticed some design patterns that are common in both languages. However, there were definitely some Java-only idioms (singletons, etc) present that are ge... | Porting library from Java to Python | 0.085505 | 0 | 0 | 1,699 |
448,095 | 2009-01-15T19:23:00.000 | 3 | 0 | 1 | 0 | java,python | 448,213 | 7 | false | 1 | 0 | Automatic translators (f2c, j2py, whatever) normally emit code you wouldn't want to touch by hand. This is fine when all you need to do is use the output (for example, if you have a C compiler and no Fortran compiler, f2c allows you to compile Fortran programs), but terrible when you need to do anything to the code af... | 6 | 6 | 0 | I'm about to port a smallish library from Java to Python and wanted some advice (smallish ~ a few thousand lines of code). I've studied the Java code a little, and noticed some design patterns that are common in both languages. However, there were definitely some Java-only idioms (singletons, etc) present that are ge... | Porting library from Java to Python | 0.085505 | 0 | 0 | 1,699 |
448,095 | 2009-01-15T19:23:00.000 | 6 | 0 | 1 | 0 | java,python | 448,188 | 7 | false | 1 | 0 | Code is always better the second time you write it anyway....
Plus a few thousand lines of Java can probably be translated into a few hundred of Python. | 6 | 6 | 0 | I'm about to port a smallish library from Java to Python and wanted some advice (smallish ~ a few thousand lines of code). I've studied the Java code a little, and noticed some design patterns that are common in both languages. However, there were definitely some Java-only idioms (singletons, etc) present that are ge... | Porting library from Java to Python | 1 | 0 | 0 | 1,699 |
448,837 | 2009-01-15T22:58:00.000 | 0 | 0 | 0 | 0 | python,windows,web-services,cgi | 449,199 | 9 | false | 1 | 0 | When setting this up, please be careful to restrict access to the scripts that take some action on your web server. It is not sufficient to place them in a directory where you just don't publish the URL, because sooner or later somebody will find them.
At the very least, put these scripts in a location that is password... | 2 | 25 | 0 | I'm a hobbyist (and fairly new) programmer who has written several useful (to me) scripts in python to handle various system automation tasks that involve copying, renaming, and downloading files amongst other sundry activities.
I'd like to create a web page served from one of my systems that would merely present a few... | How do I create a webpage with buttons that invoke various Python scripts on the system serving the webpage? | 0 | 0 | 1 | 38,798 |
448,837 | 2009-01-15T22:58:00.000 | 1 | 0 | 0 | 0 | python,windows,web-services,cgi | 449,062 | 9 | false | 1 | 0 | A simple cgi script (or set of scripts) is all you need to get started. The other answers have covered how to do this so I won't repeat it; instead, I will stress that using plain text will get you a long way. Just output the header (print("Content-type: text/plain\n") plus print adds its own newline to give you the ne... | 2 | 25 | 0 | I'm a hobbyist (and fairly new) programmer who has written several useful (to me) scripts in python to handle various system automation tasks that involve copying, renaming, and downloading files amongst other sundry activities.
I'd like to create a web page served from one of my systems that would merely present a few... | How do I create a webpage with buttons that invoke various Python scripts on the system serving the webpage? | 0.022219 | 0 | 1 | 38,798 |
450,210 | 2009-01-16T12:01:00.000 | 4 | 0 | 0 | 1 | python,windows,winapi,windows-vista,permissions | 450,297 | 4 | true | 0 | 0 | I recently wrote a App to pass a set of test to obtain the ISV status from Microsoft and I also add that condition.
The way I understood it was that if the user is Least Priveledge then he won't have permission to write in the system folders. So I approached the problem the the way Ishmaeel described. I try to create t... | 2 | 6 | 0 | I have a code that creates file(s) in user-specified directory. User can point to a directory in which he can't create files, but he can rename it.
I have created directory for test purposes, let's call it C:\foo.
I have following permissions to C:\foo:
Traversing directory/Execute file
Removing subfolders and f... | How to check if a file can be created inside given directory on MS XP/Vista? | 1.2 | 0 | 0 | 3,469 |
450,210 | 2009-01-16T12:01:00.000 | 4 | 0 | 0 | 1 | python,windows,winapi,windows-vista,permissions | 450,259 | 4 | false | 0 | 0 | I wouldn't waste time and LOCs on checking for permissions. Ultimate test of file creation in Windows is the creation itself. Other factors may come into play (such as existing files (or worse, folders) with the same name, disk space, background processes. These conditions can even change between the time you make the ... | 2 | 6 | 0 | I have a code that creates file(s) in user-specified directory. User can point to a directory in which he can't create files, but he can rename it.
I have created directory for test purposes, let's call it C:\foo.
I have following permissions to C:\foo:
Traversing directory/Execute file
Removing subfolders and f... | How to check if a file can be created inside given directory on MS XP/Vista? | 0.197375 | 0 | 0 | 3,469 |
450,290 | 2009-01-16T12:33:00.000 | 0 | 0 | 1 | 0 | python | 450,545 | 3 | false | 1 | 0 | Remember that in addition to setting PYTHONPATH in your system environment, you'll also want to assign DJANGO_SETTINGS_MODULE. | 1 | 2 | 0 | I am installing active python, django. I really dont know how to set the python path in vista environment system. first of all will it work in vista. | Python Path | 0 | 0 | 0 | 1,226 |
450,306 | 2009-01-16T12:38:00.000 | 0 | 0 | 0 | 0 | python,wxpython,wx.textctrl | 450,324 | 4 | false | 0 | 0 | Remove() should do the trick.
TextCtrl without wx.TE_RICH flag can't have more than 64 KB on Windows. | 2 | 3 | 0 | I am using a wx.TextCtrl to output text from a network daemon.
As the output is quite verbose, the size of text in the TextCtrl can become huge (BTW is there any limitation on the size of the contents of a TextCtrl?)
I would like to delete the top N lines from the TextCtrl when TextCtrl.GetNumberOfLines() exceeds a pre... | Deleting lines from wx.TextCtrl | 0 | 0 | 0 | 3,535 |
450,306 | 2009-01-16T12:38:00.000 | 0 | 0 | 0 | 0 | python,wxpython,wx.textctrl | 450,315 | 4 | false | 0 | 0 | How about the Remove method of wx.TextCtrl?
Whenever you're about to add new text, you can check if the current text appears too long and remove some from the start. | 2 | 3 | 0 | I am using a wx.TextCtrl to output text from a network daemon.
As the output is quite verbose, the size of text in the TextCtrl can become huge (BTW is there any limitation on the size of the contents of a TextCtrl?)
I would like to delete the top N lines from the TextCtrl when TextCtrl.GetNumberOfLines() exceeds a pre... | Deleting lines from wx.TextCtrl | 0 | 0 | 0 | 3,535 |
451,952 | 2009-01-16T20:51:00.000 | 13 | 0 | 0 | 0 | python,plone,zope,zodb,blobstorage | 2,664,479 | 4 | false | 0 | 0 | It should be safe to do a repozo backup of the Data.fs followed by an rsync of the blobstorage directory, as long as the database doesn't get packed while those two operations are happening.
This is because, at least when using blobs with FileStorage, modifications to a blob always results in the creation of a new file... | 3 | 8 | 0 | I am using plone.app.blob to store large ZODB objects in a blobstorage directory. This reduces size pressure on Data.fs but I have not been able to find any advice on backing up this data.
I am already backing up Data.fs by pointing a network backup tool at a directory of repozo backups. Should I simply point that tool... | What is the correct way to backup ZODB blobs? | 1 | 1 | 0 | 2,618 |
451,952 | 2009-01-16T20:51:00.000 | 3 | 0 | 0 | 0 | python,plone,zope,zodb,blobstorage | 453,942 | 4 | true | 0 | 0 | Backing up "blobstorage" will do it. No need for a special order or anything else, it's very simple.
All operations in Plone are fully transactional, so hitting the backup in the middle of a transaction should work just fine. This is why you can do live backups of the ZODB. Without knowing what file system you're on, I... | 3 | 8 | 0 | I am using plone.app.blob to store large ZODB objects in a blobstorage directory. This reduces size pressure on Data.fs but I have not been able to find any advice on backing up this data.
I am already backing up Data.fs by pointing a network backup tool at a directory of repozo backups. Should I simply point that tool... | What is the correct way to backup ZODB blobs? | 1.2 | 1 | 0 | 2,618 |
451,952 | 2009-01-16T20:51:00.000 | 1 | 0 | 0 | 0 | python,plone,zope,zodb,blobstorage | 676,364 | 4 | false | 0 | 0 | Your backup strategy for the FileStorage is fine. However, making a backup of any database that stores data in multiple files never is easy as your copy has to happen with no writes to the various files. For the FileStorage a blind stupid copy is fine as it's just a single file. (Using repozo is even better.)
In this c... | 3 | 8 | 0 | I am using plone.app.blob to store large ZODB objects in a blobstorage directory. This reduces size pressure on Data.fs but I have not been able to find any advice on backing up this data.
I am already backing up Data.fs by pointing a network backup tool at a directory of repozo backups. Should I simply point that tool... | What is the correct way to backup ZODB blobs? | 0.049958 | 1 | 0 | 2,618 |
452,305 | 2009-01-16T22:38:00.000 | 0 | 1 | 1 | 0 | python,programming-languages | 452,352 | 12 | false | 0 | 0 | Dynamic languages are in general good for web apps because the speed of development. Python in particular has two advantages over most of them:
"batteries included" means lots of available libraries
Django. For me this is the only reason why i use Python instead of Lua (which i like a lot more). | 5 | 10 | 0 | What makes Python stand out for use in web development? What are some examples of highly successful uses of Python on the web? | What are the benefits of using Python for web programming? | 0 | 0 | 0 | 15,173 |
452,305 | 2009-01-16T22:38:00.000 | 1 | 1 | 1 | 0 | python,programming-languages | 452,356 | 12 | false | 0 | 0 | GNU Mailman is another project written in python that is widely successful. | 5 | 10 | 0 | What makes Python stand out for use in web development? What are some examples of highly successful uses of Python on the web? | What are the benefits of using Python for web programming? | 0.016665 | 0 | 0 | 15,173 |
452,305 | 2009-01-16T22:38:00.000 | 0 | 1 | 1 | 0 | python,programming-languages | 452,384 | 12 | false | 0 | 0 | Besides the frameworks...
Python's pervasive support for Unicode should make i18n much smoother.
A sane namespace system makes debugging much nicer, because it's typically easier to find where things are defined.
Python's inability to function as a standalone templating language should discourage the mixture of HTML w... | 5 | 10 | 0 | What makes Python stand out for use in web development? What are some examples of highly successful uses of Python on the web? | What are the benefits of using Python for web programming? | 0 | 0 | 0 | 15,173 |
452,305 | 2009-01-16T22:38:00.000 | 0 | 1 | 1 | 0 | python,programming-languages | 452,392 | 12 | false | 0 | 0 | Other examples of Python sites are Reddit and YouTube. | 5 | 10 | 0 | What makes Python stand out for use in web development? What are some examples of highly successful uses of Python on the web? | What are the benefits of using Python for web programming? | 0 | 0 | 0 | 15,173 |
452,305 | 2009-01-16T22:38:00.000 | 1 | 1 | 1 | 0 | python,programming-languages | 452,600 | 12 | false | 0 | 0 | As many have pointed out, Django is a great reason to use Python...so in order to figure out why Python is great for web development, the best bet is to look at why it is a good language to build a framework like Django.
IMHO Python combines the cleanest, or at least one of the cleanest, metaprogramming models of any l... | 5 | 10 | 0 | What makes Python stand out for use in web development? What are some examples of highly successful uses of Python on the web? | What are the benefits of using Python for web programming? | 0.016665 | 0 | 0 | 15,173 |
453,158 | 2009-01-17T11:19:00.000 | 4 | 1 | 0 | 0 | python,xml,json,twitter,twisted | 453,160 | 3 | false | 0 | 0 | RSS and Atom are XML formats.
JSON is a string which can be evaluated as Javascript code. | 2 | 6 | 0 | I'm new to web services and as an introduction I'm playing around with the Twitter API using the Twisted framework in python. I've read up on the different formats they offer, but it's still not clear to me which one I should use in my fairly simple project.
Specifically the practical difference between using JSON or X... | What is the practical difference between xml, json, rss and atom when interfacing with Twitter? | 0.26052 | 0 | 1 | 8,204 |
453,158 | 2009-01-17T11:19:00.000 | 1 | 1 | 0 | 0 | python,xml,json,twitter,twisted | 453,164 | 3 | false | 0 | 0 | I would say the amount of data being sent over the wire is one factor. XML data stream will be bigger than JSON for the same data. But you can use whatever you know more/have more experience.
I would recommend JSON, as it's more "pythonic" than XML. | 2 | 6 | 0 | I'm new to web services and as an introduction I'm playing around with the Twitter API using the Twisted framework in python. I've read up on the different formats they offer, but it's still not clear to me which one I should use in my fairly simple project.
Specifically the practical difference between using JSON or X... | What is the practical difference between xml, json, rss and atom when interfacing with Twitter? | 0.066568 | 0 | 1 | 8,204 |
454,456 | 2009-01-18T01:27:00.000 | 0 | 0 | 1 | 0 | python,regex,performance,file | 454,471 | 9 | false | 0 | 0 | For single line patterns you can iterate over the lines of the file, but for multi-line patterns, You will have to read all (or part, but that'll be hard to keep track of) of the file into memory. | 1 | 38 | 0 | I want to be able to run a regular expression on an entire file, but I'd like to be able to not have to read the whole file into memory at once as I may be working with rather large files in the future. Is there a way to do this? Thanks!
Clarification: I cannot read line-by-line because it can span multiple lines. | How do I re.search or re.match on a whole file without reading it all into memory? | 0 | 0 | 0 | 31,453 |
454,725 | 2009-01-18T06:01:00.000 | 1 | 0 | 1 | 0 | python,line-endings | 49,930,731 | 4 | false | 0 | 0 | os.linesep is important as it depends (as the name implied:)) on os.
E.g. on Windows, it is not "\n" but rather "\r\n".
But if you don't care about multi-platform stuff you can just use '\n'. | 1 | 90 | 0 | Is there an easy way to get the type of line ending that the current operating system uses? | Python get proper line ending | 0.049958 | 0 | 0 | 64,455 |
454,854 | 2009-01-18T09:13:00.000 | 5 | 0 | 0 | 0 | python,django,python-2.x | 28,278,997 | 32 | false | 1 | 0 | Go to your project directory with cd.
source/bin/activate (activate your env. if not previously).
Run the command easy_install MySQL-python | 5 | 493 | 0 | I am using Python version 2.5.4 and install MySQL version 5.0 and Django. Django is working fine with Python, but not MySQL. I am using it in Windows Vista. | No module named MySQLdb | 0.03124 | 1 | 0 | 804,257 |
454,854 | 2009-01-18T09:13:00.000 | 6 | 0 | 0 | 0 | python,django,python-2.x | 58,246,337 | 32 | false | 1 | 0 | I personally recommend using pymysql instead of using the genuine MySQL connector, which provides you with a platform independent interface and could be installed through pip.
And you could edit the SQLAlchemy URL schema like this:
mysql+pymysql://username:passwd@host/database | 5 | 493 | 0 | I am using Python version 2.5.4 and install MySQL version 5.0 and Django. Django is working fine with Python, but not MySQL. I am using it in Windows Vista. | No module named MySQLdb | 1 | 1 | 0 | 804,257 |
454,854 | 2009-01-18T09:13:00.000 | 93 | 0 | 0 | 0 | python,django,python-2.x | 38,310,817 | 32 | false | 1 | 0 | if your python version is 3.5, do a pip install mysqlclient, other things didn't work for me | 5 | 493 | 0 | I am using Python version 2.5.4 and install MySQL version 5.0 and Django. Django is working fine with Python, but not MySQL. I am using it in Windows Vista. | No module named MySQLdb | 1 | 1 | 0 | 804,257 |
454,854 | 2009-01-18T09:13:00.000 | 2 | 0 | 0 | 0 | python,django,python-2.x | 58,825,148 | 32 | false | 1 | 0 | None of the above worked for me on an Ubuntu 18.04 fresh install via docker image.
The following solved it for me:
apt-get install holland python3-mysqldb | 5 | 493 | 0 | I am using Python version 2.5.4 and install MySQL version 5.0 and Django. Django is working fine with Python, but not MySQL. I am using it in Windows Vista. | No module named MySQLdb | 0.012499 | 1 | 0 | 804,257 |
454,854 | 2009-01-18T09:13:00.000 | 0 | 0 | 0 | 0 | python,django,python-2.x | 72,496,371 | 32 | false | 1 | 0 | For CentOS 8 and Python3
$ sudo dnf install python3-mysqlclient -y | 5 | 493 | 0 | I am using Python version 2.5.4 and install MySQL version 5.0 and Django. Django is working fine with Python, but not MySQL. I am using it in Windows Vista. | No module named MySQLdb | 0 | 1 | 0 | 804,257 |
454,944 | 2009-01-18T10:42:00.000 | 6 | 0 | 0 | 0 | python,django,message-queue | 714,637 | 8 | false | 1 | 0 | Stompserver is a good option. It's lightweight, easy to install and easy to use from Django/python.
We have a system using stompserver in production for sending out emails and processing other jobs asynchronously.
Django saves the emails to the database, a model.post_save handler in Django sends an event to stompserver... | 4 | 44 | 0 | I have an application in Django, that needs to send a large number of emails to users in various use cases. I don't want to handle this synchronously within the application for obvious reasons.
Has anyone any recommendations for a message queuing server which integrates well with Python, or they have used on a Django p... | Advice on Python/Django and message queues | 1 | 0 | 0 | 20,229 |
454,944 | 2009-01-18T10:42:00.000 | 1 | 0 | 0 | 0 | python,django,message-queue | 3,696,792 | 8 | false | 1 | 0 | Is there anything wrong is solving this using the mail infrastructure? Like, every app server running their own mail daemons which will queue any locally submitted mail, which forward to a centralized mail server which can do the mail heavy lifting? | 4 | 44 | 0 | I have an application in Django, that needs to send a large number of emails to users in various use cases. I don't want to handle this synchronously within the application for obvious reasons.
Has anyone any recommendations for a message queuing server which integrates well with Python, or they have used on a Django p... | Advice on Python/Django and message queues | 0.024995 | 0 | 0 | 20,229 |
454,944 | 2009-01-18T10:42:00.000 | 0 | 0 | 0 | 0 | python,django,message-queue | 454,996 | 8 | false | 1 | 0 | If you already have MySQL installed, you could create a table to use as a "todo list" of sorts.
Threads synchronously add jobs to the table, and a batched task removes jobs as they're completed.
That way, there's no need to install and learn more software, and it should work fine as a persistent job store so long as yo... | 4 | 44 | 0 | I have an application in Django, that needs to send a large number of emails to users in various use cases. I don't want to handle this synchronously within the application for obvious reasons.
Has anyone any recommendations for a message queuing server which integrates well with Python, or they have used on a Django p... | Advice on Python/Django and message queues | 0 | 0 | 0 | 20,229 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.