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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
250,151 | 2008-10-30T13:21:00.000 | 3 | 1 | 1 | 0 | python,scripting,lua | 781,316 | 11 | false | 0 | 0 | In order for Lua to be easy to embed it has to have few dependencies and be small. That makes it poorly suited as a general purpose scripting language. Because using it as a general purpose script language would require a lot of standard libraries. But if Lua had a lot of standard libraries it would be harder to embed ... | 4 | 37 | 0 | When I see Lua, the only thing I ever read is "great for embedding", "fast", "lightweight" and more often than anything else: "World of Warcraft" or in short "WoW".
Why is it limited to embedding the whole thing into another application? Why not write general-purpose scripts like you do with Python or Perl?
Lua seems t... | Lua as a general-purpose scripting language? | 0.054491 | 0 | 0 | 12,626 |
250,151 | 2008-10-30T13:21:00.000 | 4 | 1 | 1 | 0 | python,scripting,lua | 253,659 | 11 | false | 0 | 0 | I think the answer about it being a "marketing" thing is probably correct, along with the lack of a large set of libraries to choose from. I would like to point out another case of this: Ruby. Ruby is meant to be a general purpose scripting language. The problem is that since Ruby on Rails has risen to be so popular, ... | 4 | 37 | 0 | When I see Lua, the only thing I ever read is "great for embedding", "fast", "lightweight" and more often than anything else: "World of Warcraft" or in short "WoW".
Why is it limited to embedding the whole thing into another application? Why not write general-purpose scripts like you do with Python or Perl?
Lua seems t... | Lua as a general-purpose scripting language? | 0.072599 | 0 | 0 | 12,626 |
250,151 | 2008-10-30T13:21:00.000 | 6 | 1 | 1 | 0 | python,scripting,lua | 251,372 | 11 | false | 0 | 0 | Definitely a lack of standard libraries. It's also lesser known than Python, Perl or Ruby. | 4 | 37 | 0 | When I see Lua, the only thing I ever read is "great for embedding", "fast", "lightweight" and more often than anything else: "World of Warcraft" or in short "WoW".
Why is it limited to embedding the whole thing into another application? Why not write general-purpose scripts like you do with Python or Perl?
Lua seems t... | Lua as a general-purpose scripting language? | 1 | 0 | 0 | 12,626 |
252,703 | 2008-10-31T05:55:00.000 | 15 | 0 | 1 | 0 | python,list,data-structures,append,extend | 25,144,368 | 20 | false | 0 | 0 | An interesting point that has been hinted, but not explained, is that extend is faster than append. For any loop that has append inside should be considered to be replaced by list.extend(processed_elements).
Bear in mind that apprending new elements might result in the realloaction of the whole list to a better locatio... | 2 | 3,113 | 0 | What's the difference between the list methods append() and extend()? | What is the difference between Python's list methods append and extend? | 1 | 0 | 0 | 3,183,036 |
252,703 | 2008-10-31T05:55:00.000 | 7 | 0 | 1 | 0 | python,list,data-structures,append,extend | 42,171,373 | 20 | false | 0 | 0 | I hope I can make a useful supplement to this question. If your list stores a specific type object, for example Info, here is a situation that extend method is not suitable: In a for loop and and generating an Info object every time and using extend to store it into your list, it will fail. The exception is like below:... | 2 | 3,113 | 0 | What's the difference between the list methods append() and extend()? | What is the difference between Python's list methods append and extend? | 1 | 0 | 0 | 3,183,036 |
252,859 | 2008-10-31T08:13:00.000 | 1 | 0 | 0 | 0 | c,windows-mobile,extending,pythonce | 253,562 | 3 | false | 0 | 1 | MSDN has plenty of samples for C++ development on Windows Mobile, and the SDK comes with several sample application. Unfortunately VS Express editions (the free ones) do not come with compilers for Smart Devices. The only free option is the older eMbedded Visual C++ (eVC), which is now something like 8 years old and n... | 1 | 1 | 0 | As it seems there is no scripting language for Windows mobile devices that gives access to phone (sms, mms, make a call, take photo). I wonder how complex it would be to make a Python library that would enable that (write something in C, compile, and import in PythonCE).
Question: Where shall start to understand how to... | Extending PythonCE to Access gsm/camera/gps Easily from PythonCE | 0.066568 | 0 | 0 | 871 |
254,350 | 2008-10-31T17:47:00.000 | 2 | 0 | 1 | 0 | python,file,compare | 254,362 | 9 | false | 0 | 0 | f = open(filename1, "r").read()
f2 = open(filename2,"r").read()
print f == f2 | 1 | 70 | 0 | I don't care what the differences are. I just want to know whether the contents are different. | In Python, is there a concise way of comparing whether the contents of two text files are the same? | 0.044415 | 0 | 0 | 36,226 |
254,635 | 2008-10-31T19:20:00.000 | 3 | 0 | 1 | 0 | python,executable,pyinstaller | 4,902,830 | 3 | false | 0 | 0 | Using a earlier Python version will also decrease the size considerably if your really needing a small file size. I don't recommend using a very old version, Python2.3 would be the best option. I got my Python executable size to 700KB's! Also I prefer Py2Exe over Pyinstaller. | 3 | 9 | 0 | I plan to use PyInstaller to create a stand-alone python executable. PythonInstaller comes with built-in support for UPX and uses it to compress the executable but they are still really huge (about 2,7 mb).
Is there any way to create even smaller Python executables? For example using a shrinked python.dll or something ... | Tiny python executable? | 0.197375 | 0 | 0 | 3,991 |
254,635 | 2008-10-31T19:20:00.000 | 10 | 0 | 1 | 0 | python,executable,pyinstaller | 254,723 | 3 | true | 0 | 0 | If you recompile pythonxy.dll, you can omit modules that you don't need. Going by size, stripping off the unicode database and the CJK codes creates the largest code reduction. This, of course, assumes that you don't need these. Remove the modules from the pythoncore project, and also remove them from PC/config.c | 3 | 9 | 0 | I plan to use PyInstaller to create a stand-alone python executable. PythonInstaller comes with built-in support for UPX and uses it to compress the executable but they are still really huge (about 2,7 mb).
Is there any way to create even smaller Python executables? For example using a shrinked python.dll or something ... | Tiny python executable? | 1.2 | 0 | 0 | 3,991 |
254,635 | 2008-10-31T19:20:00.000 | 1 | 0 | 1 | 0 | python,executable,pyinstaller | 255,582 | 3 | false | 0 | 0 | You can't go too low in size, because you obviously need to bundle the Python interpreter in, and only that takes a considerable amount of space.
I had the same concerns once, and there are two approaches:
Install Python on the computers you want to run on and only distribute the scripts
Install Python in the internal... | 3 | 9 | 0 | I plan to use PyInstaller to create a stand-alone python executable. PythonInstaller comes with built-in support for UPX and uses it to compress the executable but they are still really huge (about 2,7 mb).
Is there any way to create even smaller Python executables? For example using a shrinked python.dll or something ... | Tiny python executable? | 0.066568 | 0 | 0 | 3,991 |
255,157 | 2008-10-31T22:37:00.000 | 3 | 0 | 0 | 1 | python,google-app-engine,rest,metaclass | 255,906 | 2 | false | 1 | 0 | Calling the handler from initialize isn't the right way anyway - if you do that, the webapp will then call the original handler as well.
Instead, you have a couple of options:
You can subclass webapp.WSGIApplication and override call to select the method based on _method when it exists.
You can check for the existence... | 2 | 1 | 0 | In the context of a Google App Engine Webapp framework application:
I want to changed the request verb of a request in the case a
parameter _method is provided, for example if a POST request comes in
with a parameter _method=PUT, I need to change the request to call the
put method of the handler. This is to cope with t... | How to override HTTP request verb in GAE | 0.291313 | 0 | 0 | 1,104 |
255,157 | 2008-10-31T22:37:00.000 | 2 | 0 | 0 | 1 | python,google-app-engine,rest,metaclass | 257,094 | 2 | false | 1 | 0 | Thats Arachnid for your response. Pointing me to the source of the framework was really helpful. Last I looked the source wasn't there(there was only .pyc), maybe it changed with the new version of the SDK. For my situation I think overriding WSGIApplication would have been the right thing to do. However, I chose to us... | 2 | 1 | 0 | In the context of a Google App Engine Webapp framework application:
I want to changed the request verb of a request in the case a
parameter _method is provided, for example if a POST request comes in
with a parameter _method=PUT, I need to change the request to call the
put method of the handler. This is to cope with t... | How to override HTTP request verb in GAE | 0.197375 | 0 | 0 | 1,104 |
256,021 | 2008-11-01T19:52:00.000 | 0 | 0 | 0 | 0 | python,web-applications,browser | 256,028 | 4 | false | 1 | 0 | You would have to write the web page in Python. There are many Python web frameworks out there (e.g. Django) that are easy to work with. You could convert your entire scripting framework to a web application that has a worker thread going and crawling through html pages, saving them to a particular location, indexing t... | 2 | 2 | 0 | I have written a script that goes through a bunch of files and snips out a portion of the files for further processing. The script creates a new directory and creates new files for each snip that is taken out. I have to now evaluate each of the files that were created to see if it is what I needed. The script also cr... | Can I Use Python to Make a Delete Button in a 'web page' | 0 | 0 | 1 | 1,222 |
256,021 | 2008-11-01T19:52:00.000 | 1 | 0 | 0 | 0 | python,web-applications,browser | 256,040 | 4 | false | 1 | 0 | You could make this even simpler by making it all happen in one main page. Instead of having a list of hyperlinks, just have the main page have one frame that loads one of the autocreated pages in it. Put a couple of buttons at the bottom - a "Keep this page" and a "Delete this page." When you click either button, the ... | 2 | 2 | 0 | I have written a script that goes through a bunch of files and snips out a portion of the files for further processing. The script creates a new directory and creates new files for each snip that is taken out. I have to now evaluate each of the files that were created to see if it is what I needed. The script also cr... | Can I Use Python to Make a Delete Button in a 'web page' | 0.049958 | 0 | 1 | 1,222 |
257,398 | 2008-11-02T21:22:00.000 | 11 | 0 | 0 | 0 | python,user-controls,user-interface | 257,403 | 4 | true | 0 | 1 | Your best bet is the tkMessageBox module, which should work on all systems (as Python will typically come with Tkinter).
If you can restrict yourself to a specific operating system, better choices might be available. | 2 | 6 | 0 | Is there a UI library to create a message box or input box in python? | Message Box in Python | 1.2 | 0 | 0 | 6,196 |
257,398 | 2008-11-02T21:22:00.000 | 2 | 0 | 0 | 0 | python,user-controls,user-interface | 257,532 | 4 | false | 0 | 1 | I've heard good things about wx python, which is also multi-platform. | 2 | 6 | 0 | Is there a UI library to create a message box or input box in python? | Message Box in Python | 0.099668 | 0 | 0 | 6,196 |
257,409 | 2008-11-02T21:31:00.000 | 3 | 0 | 0 | 0 | python,screen-scraping | 257,413 | 7 | false | 1 | 0 | Use htmllib to extract all img tags (override do_img), then use urllib2 to download all the images. | 2 | 47 | 0 | I am writing a scraper that downloads all the image files from a HTML page and saves them to a specific folder. all the images are the part of the HTML page. | Download image file from the HTML page source using python? | 0.085505 | 0 | 1 | 97,893 |
257,409 | 2008-11-02T21:31:00.000 | 8 | 0 | 0 | 0 | python,screen-scraping | 257,412 | 7 | false | 1 | 0 | You have to download the page and parse html document, find your image with regex and download it.. You can use urllib2 for downloading and Beautiful Soup for parsing html file. | 2 | 47 | 0 | I am writing a scraper that downloads all the image files from a HTML page and saves them to a specific folder. all the images are the part of the HTML page. | Download image file from the HTML page source using python? | 1 | 0 | 1 | 97,893 |
257,481 | 2008-11-02T22:22:00.000 | 12 | 1 | 0 | 0 | python,wsgi,scgi | 778,530 | 3 | false | 0 | 0 | SCGI (like FastCGI) is a (serialized) protocol suitable for inter-process communication between a web-server and a web-application.
WSGI is a Python API, connecting two (or more) Python WSGI-compatible modules inside the same process (Python interpreter). One module represents the web-server (being either a Python in-p... | 2 | 19 | 0 | What's the difference between these two?
Which is better/faster/reliable? | What's the difference between scgi and wsgi? | 1 | 0 | 0 | 16,163 |
257,481 | 2008-11-02T22:22:00.000 | 27 | 1 | 0 | 0 | python,wsgi,scgi | 257,642 | 3 | true | 0 | 0 | SCGI is a language-neutral means of connecting a front-end web server and a web application. WSGI is a Python-specific interface standard for web applications.
Though they both have roots in CGI, they're rather different in scope and you could indeed quite reasonably use both at once, for example having a mod_scgi on t... | 2 | 19 | 0 | What's the difference between these two?
Which is better/faster/reliable? | What's the difference between scgi and wsgi? | 1.2 | 0 | 0 | 16,163 |
257,730 | 2008-11-03T01:31:00.000 | 3 | 1 | 0 | 0 | python,ruby,scripting,groovy | 257,770 | 10 | false | 1 | 0 | This sort of adding-up-scores-by-features is not a good way to choose a programming language. You'd be better off choosing whichever you know the best. If you don't know any of them, try them out for a little while. If you have a really specific project in mind, then maybe some programming languages would be better, bu... | 7 | 35 | 0 | Considering the criteria listed below, which of Python, Groovy or Ruby would you use?
Criteria (Importance out of 10, 10 being most important)
Richness of API/libraries available (eg. maths, plotting, networking) (9)
Ability to embed in desktop (java/c++) applications (8)
Ease of deployment (8)
Ability to interface wi... | Python vs Groovy vs Ruby? (based on criteria listed in question) | 0.059928 | 0 | 0 | 36,111 |
257,730 | 2008-11-03T01:31:00.000 | 33 | 1 | 0 | 0 | python,ruby,scripting,groovy | 257,746 | 10 | true | 1 | 0 | I think it's going to be difficult to get an objective comparison. I personally prefer Python. To address one of your criteria, Python was designed from the start to be an embeddable language. It has a very rich C API, and the interpreter is modularized to make it easy to call from C. If Java is your host environme... | 7 | 35 | 0 | Considering the criteria listed below, which of Python, Groovy or Ruby would you use?
Criteria (Importance out of 10, 10 being most important)
Richness of API/libraries available (eg. maths, plotting, networking) (9)
Ability to embed in desktop (java/c++) applications (8)
Ease of deployment (8)
Ability to interface wi... | Python vs Groovy vs Ruby? (based on criteria listed in question) | 1.2 | 0 | 0 | 36,111 |
257,730 | 2008-11-03T01:31:00.000 | 28 | 1 | 0 | 0 | python,ruby,scripting,groovy | 1,401,616 | 10 | false | 1 | 0 | Having worked with all 3 of them, this is what I can say:
Python
has very mature libraries
libraries are documented
documentation can be accessed from your debugger/shell at runtime through the docstrings
you can develop code without an IDE
Ruby
has some great libraries ( even though some are badly documented )
Ru... | 7 | 35 | 0 | Considering the criteria listed below, which of Python, Groovy or Ruby would you use?
Criteria (Importance out of 10, 10 being most important)
Richness of API/libraries available (eg. maths, plotting, networking) (9)
Ability to embed in desktop (java/c++) applications (8)
Ease of deployment (8)
Ability to interface wi... | Python vs Groovy vs Ruby? (based on criteria listed in question) | 1 | 0 | 0 | 36,111 |
257,730 | 2008-11-03T01:31:00.000 | 8 | 1 | 0 | 0 | python,ruby,scripting,groovy | 326,962 | 10 | false | 1 | 0 | try Groovy .. it has all features that you need there. You can use existing java lib without any modification on its classes.
basically .. groovy is java++, it is more dynamic and fun to learn (just like ruby)
I dont like ruby or python syntax so I will put them behind. Groovy is just like C/C++ syntax so I like him l... | 7 | 35 | 0 | Considering the criteria listed below, which of Python, Groovy or Ruby would you use?
Criteria (Importance out of 10, 10 being most important)
Richness of API/libraries available (eg. maths, plotting, networking) (9)
Ability to embed in desktop (java/c++) applications (8)
Ease of deployment (8)
Ability to interface wi... | Python vs Groovy vs Ruby? (based on criteria listed in question) | 1 | 0 | 0 | 36,111 |
257,730 | 2008-11-03T01:31:00.000 | 7 | 1 | 0 | 0 | python,ruby,scripting,groovy | 257,831 | 10 | false | 1 | 0 | Python has all nine criteria. It scores a 56.
I'm sure Ruby has everything Python has. It seems to have fewer libraries. So it scores a 51.
I don't know if Groovy has every feature.
Since Python is 56 and Ruby is a 51, Python just barely edges out Ruby.
However, I think this kind of decision can still boil down to s... | 7 | 35 | 0 | Considering the criteria listed below, which of Python, Groovy or Ruby would you use?
Criteria (Importance out of 10, 10 being most important)
Richness of API/libraries available (eg. maths, plotting, networking) (9)
Ability to embed in desktop (java/c++) applications (8)
Ease of deployment (8)
Ability to interface wi... | Python vs Groovy vs Ruby? (based on criteria listed in question) | 1 | 0 | 0 | 36,111 |
257,730 | 2008-11-03T01:31:00.000 | 24 | 1 | 0 | 0 | python,ruby,scripting,groovy | 257,776 | 10 | false | 1 | 0 | Just to muddy the waters...
Groovy give you access to Java. Java has an extremely rich set of APIs/Libraries, applications, etc.
Groovy is embeddable, although easiest in Java.
DLLs/Libraries (if you're talking about non-Groovy/Java) may be somewhat problematic, although there are ways and some APIs to help.
I've done... | 7 | 35 | 0 | Considering the criteria listed below, which of Python, Groovy or Ruby would you use?
Criteria (Importance out of 10, 10 being most important)
Richness of API/libraries available (eg. maths, plotting, networking) (9)
Ability to embed in desktop (java/c++) applications (8)
Ease of deployment (8)
Ability to interface wi... | Python vs Groovy vs Ruby? (based on criteria listed in question) | 1 | 0 | 0 | 36,111 |
257,730 | 2008-11-03T01:31:00.000 | 0 | 1 | 0 | 0 | python,ruby,scripting,groovy | 257,738 | 10 | false | 1 | 0 | I know it's not on your list, but at least look at perl.
Richness of Api/Libraries to sink a ship.
Runs on more systems than most people realise exists.
Works well with Binary libraries.
Has a huge community.
Portability, See above.
Database manipulation: more ways to do it. ( Pick your favorite module )
And one o... | 7 | 35 | 0 | Considering the criteria listed below, which of Python, Groovy or Ruby would you use?
Criteria (Importance out of 10, 10 being most important)
Richness of API/libraries available (eg. maths, plotting, networking) (9)
Ability to embed in desktop (java/c++) applications (8)
Ease of deployment (8)
Ability to interface wi... | Python vs Groovy vs Ruby? (based on criteria listed in question) | 0 | 0 | 0 | 36,111 |
258,775 | 2008-11-03T14:28:00.000 | 5 | 0 | 0 | 0 | python,sqlalchemy | 261,191 | 3 | true | 0 | 0 | I think you could look at the child's __dict__ attribute dictionary to check if the data is already there or not. | 1 | 16 | 0 | With SQLAlchemy, is there a way to know beforehand whether a relation would be lazy-loaded?
For example, given a lazy parent->children relation and an instance X of "parent", I'd like to know if "X.children" is already loaded, without triggering the query. | How to find out if a lazy relation isn't loaded yet, with SQLAlchemy? | 1.2 | 1 | 0 | 3,701 |
260,165 | 2008-11-03T22:08:00.000 | 14 | 1 | 1 | 0 | python,uml,diagram | 260,196 | 10 | false | 0 | 0 | Certain classes of well-behaved programs may be diagrammable, but in the general case, it can't be done. Python objects can be extended at run time, and objects of any type can be assigned to any instance variable. Figuring out what classes an object can contain pointers to (composition) would require a full understa... | 2 | 355 | 0 | A colleague is looking to generate UML class diagrams from heaps of Python source code.
He's primarily interested in the inheritance relationships, and mildly interested in compositional relationships, and doesn't care much about class attributes that are just Python primitives.
The source code is pretty straightforwa... | What's the best way to generate a UML diagram from Python source code? | 1 | 0 | 0 | 274,257 |
260,165 | 2008-11-03T22:08:00.000 | 5 | 1 | 1 | 0 | python,uml,diagram | 6,606,829 | 10 | false | 0 | 0 | Umbrello does that too. in the menu go to Code -> import project and then point to the root deirectory of your project. then it reverses the code for ya... | 2 | 355 | 0 | A colleague is looking to generate UML class diagrams from heaps of Python source code.
He's primarily interested in the inheritance relationships, and mildly interested in compositional relationships, and doesn't care much about class attributes that are just Python primitives.
The source code is pretty straightforwa... | What's the best way to generate a UML diagram from Python source code? | 0.099668 | 0 | 0 | 274,257 |
260,738 | 2008-11-04T03:11:00.000 | -1 | 1 | 0 | 1 | python,audio | 22,689,253 | 25 | false | 0 | 0 | If you're on OSX, you can use the "os" module or "subprocess" etc. to call the OSX "play" command. From the OSX shell, it looks like
play "bah.wav"
It starts to play in about a half-second on my machine. | 1 | 135 | 0 | How can I play audio (it would be like a 1 second sound) from a Python script?
It would be best if it was platform independent, but firstly it needs to work on a Mac.
I know I could just execute the afplay file.mp3 command from within Python, but is it possible to do it in raw Python? I would also be better if it didn'... | Play audio with Python | -0.008 | 0 | 0 | 259,664 |
261,638 | 2008-11-04T11:57:00.000 | 318 | 0 | 1 | 0 | python,licensing,obfuscation,copy-protection | 261,817 | 28 | false | 0 | 0 | Python is not the tool you need
You must use the right tool to do the right thing, and Python was not designed to be obfuscated. It's the contrary; everything is open or easy to reveal or modify in Python because that's the language's philosophy.
If you want something you can't see through, look for another tool. This ... | 12 | 729 | 0 | I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time-restricted license file.
If we distribute the .py files or even .pyc files it will be easy to (decompile and) remove the code that checks the license file.
... | How do I protect Python code from being read by users? | 1 | 0 | 0 | 386,257 |
261,638 | 2008-11-04T11:57:00.000 | 10 | 0 | 1 | 0 | python,licensing,obfuscation,copy-protection | 261,797 | 28 | false | 0 | 0 | Depending in who the client is, a simple protection mechanism, combined with a sensible license agreement will be far more effective than any complex licensing/encryption/obfuscation system.
The best solution would be selling the code as a service, say by hosting the service, or offering support - although that isn't a... | 12 | 729 | 0 | I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time-restricted license file.
If we distribute the .py files or even .pyc files it will be easy to (decompile and) remove the code that checks the license file.
... | How do I protect Python code from being read by users? | 1 | 0 | 0 | 386,257 |
261,638 | 2008-11-04T11:57:00.000 | 5 | 0 | 1 | 0 | python,licensing,obfuscation,copy-protection | 2,987,179 | 28 | false | 0 | 0 | Idea of having time restricted license and check for it in locally installed program will not work. Even with perfect obfuscation, license check can be removed. However if you check license on remote system and run significant part of the program on your closed remote system, you will be able to protect your IP.
Preven... | 12 | 729 | 0 | I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time-restricted license file.
If we distribute the .py files or even .pyc files it will be easy to (decompile and) remove the code that checks the license file.
... | How do I protect Python code from being read by users? | 0.035699 | 0 | 0 | 386,257 |
261,638 | 2008-11-04T11:57:00.000 | 4 | 0 | 1 | 0 | python,licensing,obfuscation,copy-protection | 261,723 | 28 | false | 0 | 0 | I have looked at software protection in general for my own projects and the general philosophy is that complete protection is impossible. The only thing that you can hope to achieve is to add protection to a level that would cost your customer more to bypass than it would to purchase another license.
With that said I ... | 12 | 729 | 0 | I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time-restricted license file.
If we distribute the .py files or even .pyc files it will be easy to (decompile and) remove the code that checks the license file.
... | How do I protect Python code from being read by users? | 0.028564 | 0 | 0 | 386,257 |
261,638 | 2008-11-04T11:57:00.000 | 13 | 0 | 1 | 0 | python,licensing,obfuscation,copy-protection | 11,315,793 | 28 | false | 0 | 0 | I think there is one more method to protect your Python code; part of the Obfuscation method. I believe there was a game like Mount and Blade or something that changed and recompiled their own python interpreter (the original interpreter which i believe is open source) and just changed the OP codes in the OP code table... | 12 | 729 | 0 | I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time-restricted license file.
If we distribute the .py files or even .pyc files it will be easy to (decompile and) remove the code that checks the license file.
... | How do I protect Python code from being read by users? | 1 | 0 | 0 | 386,257 |
261,638 | 2008-11-04T11:57:00.000 | 20 | 0 | 1 | 0 | python,licensing,obfuscation,copy-protection | 554,565 | 28 | false | 0 | 0 | Shipping .pyc files has its problems - they are not compatible with any other python version than the python version they were created with, which means you must know which python version is running on the systems the product will run on. That's a very limiting factor. | 12 | 729 | 0 | I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time-restricted license file.
If we distribute the .py files or even .pyc files it will be easy to (decompile and) remove the code that checks the license file.
... | How do I protect Python code from being read by users? | 1 | 0 | 0 | 386,257 |
261,638 | 2008-11-04T11:57:00.000 | 6 | 0 | 1 | 0 | python,licensing,obfuscation,copy-protection | 262,895 | 28 | false | 0 | 0 | The best you can do with Python is to obscure things.
Strip out all docstrings
Distribute only the .pyc compiled files.
freeze it
Obscure your constants inside a class/module so that help(config) doesn't show everything
You may be able to add some additional obscurity by encrypting part of it and decrypting it on the... | 12 | 729 | 0 | I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time-restricted license file.
If we distribute the .py files or even .pyc files it will be easy to (decompile and) remove the code that checks the license file.
... | How do I protect Python code from being read by users? | 1 | 0 | 0 | 386,257 |
261,638 | 2008-11-04T11:57:00.000 | 12 | 0 | 1 | 0 | python,licensing,obfuscation,copy-protection | 263,314 | 28 | false | 0 | 0 | The reliable only way to protect code is to run it on a server you control and provide your clients with a client which interfaces with that server. | 12 | 729 | 0 | I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time-restricted license file.
If we distribute the .py files or even .pyc files it will be easy to (decompile and) remove the code that checks the license file.
... | How do I protect Python code from being read by users? | 1 | 0 | 0 | 386,257 |
261,638 | 2008-11-04T11:57:00.000 | 6 | 0 | 1 | 0 | python,licensing,obfuscation,copy-protection | 261,704 | 28 | false | 0 | 0 | You should take a look at how the guys at getdropbox.com do it for their client software, including Linux. It's quite tricky to crack and requires some quite creative disassembly to get past the protection mechanisms. | 12 | 729 | 0 | I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time-restricted license file.
If we distribute the .py files or even .pyc files it will be easy to (decompile and) remove the code that checks the license file.
... | How do I protect Python code from being read by users? | 1 | 0 | 0 | 386,257 |
261,638 | 2008-11-04T11:57:00.000 | 16 | 0 | 1 | 0 | python,licensing,obfuscation,copy-protection | 264,450 | 28 | false | 0 | 0 | Though there's no perfect solution, the following can be done:
Move some critical piece of startup code into a native library.
Enforce the license check in the native library.
If the call to the native code were to be removed, the program wouldn't start anyway. If it's not removed then the license will be enforced.
T... | 12 | 729 | 0 | I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time-restricted license file.
If we distribute the .py files or even .pyc files it will be easy to (decompile and) remove the code that checks the license file.
... | How do I protect Python code from being read by users? | 1 | 0 | 0 | 386,257 |
261,638 | 2008-11-04T11:57:00.000 | 18 | 0 | 1 | 0 | python,licensing,obfuscation,copy-protection | 261,728 | 28 | false | 0 | 0 | In some circumstances, it may be possible to move (all, or at least a key part) of the software into a web service that your organization hosts.
That way, the license checks can be performed in the safety of your own server room. | 12 | 729 | 0 | I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time-restricted license file.
If we distribute the .py files or even .pyc files it will be easy to (decompile and) remove the code that checks the license file.
... | How do I protect Python code from being read by users? | 1 | 0 | 0 | 386,257 |
261,638 | 2008-11-04T11:57:00.000 | 35 | 0 | 1 | 0 | python,licensing,obfuscation,copy-protection | 261,719 | 28 | false | 0 | 0 | Is your employer aware that he can "steal" back any ideas that other people get from your code? I mean, if they can read your work, so can you theirs. Maybe looking at how you can benefit from the situation would yield a better return of your investment than fearing how much you could lose.
[EDIT] Answer to Nick's comm... | 12 | 729 | 0 | I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time-restricted license file.
If we distribute the .py files or even .pyc files it will be easy to (decompile and) remove the code that checks the license file.
... | How do I protect Python code from being read by users? | 1 | 0 | 0 | 386,257 |
262,460 | 2008-11-04T16:53:00.000 | 2 | 0 | 1 | 0 | python,time,key,indefinite | 262,490 | 7 | true | 0 | 0 | The simplest way is just to write a program with an infinite loop, and then hit control-C to stop it. Without more description it's hard to know if this works for you.
If you do it time-based, you don't need a generator. You can just have it pause for user input, something like a "Continue? [y/n]", read from stdin, and... | 1 | 1 | 0 | Is there any way to make a function (the ones I'm thinking of are in the style of the simple ones I've made which generate the fibonnacci sequence from 0 to a point, and all the primes between two points) run indefinitely. E.g. until I press a certain key or until a time has passed, rather than until a number reaches... | making a programme run indefinitely in python | 1.2 | 0 | 0 | 3,719 |
263,773 | 2008-11-04T22:47:00.000 | 4 | 0 | 0 | 1 | python,linux,ubuntu | 263,859 | 3 | false | 0 | 0 | Instead of chmod u+sing the shutdown command, allowing passwordless sudo access to that command would be better..
As for allowing shutdown at the end of the script, I suppose you could run the entire script with sudo, then drop privileges to the initial user at the start of the script? | 3 | 7 | 0 | I have a python script that I would like to add a "Shutdown when done" feature to.
I know I can use gksudo (when the user clicks on "shutdown when done") to ask the user for root privileges but how can I use those privileges at a later time (when the script is actually finished).
I have thought about chmod u+s on the s... | How can I ask for root password but perform the action at a later time? | 0.26052 | 0 | 0 | 552 |
263,773 | 2008-11-04T22:47:00.000 | 1 | 0 | 0 | 1 | python,linux,ubuntu | 263,851 | 3 | false | 0 | 0 | Escalate priority, spawn (fork (2)) a separate process that will wait (2), and drop priority in the main process. | 3 | 7 | 0 | I have a python script that I would like to add a "Shutdown when done" feature to.
I know I can use gksudo (when the user clicks on "shutdown when done") to ask the user for root privileges but how can I use those privileges at a later time (when the script is actually finished).
I have thought about chmod u+s on the s... | How can I ask for root password but perform the action at a later time? | 0.066568 | 0 | 0 | 552 |
263,773 | 2008-11-04T22:47:00.000 | 3 | 0 | 0 | 1 | python,linux,ubuntu | 263,804 | 3 | true | 0 | 0 | gksudo should have a timeout, I believe it's from the time you last executed a gksudo command.
So I think I'd just throw out a "gksudo echo meh" or something every minute. Should reset the timer and keep you active until you reboot. | 3 | 7 | 0 | I have a python script that I would like to add a "Shutdown when done" feature to.
I know I can use gksudo (when the user clicks on "shutdown when done") to ask the user for root privileges but how can I use those privileges at a later time (when the script is actually finished).
I have thought about chmod u+s on the s... | How can I ask for root password but perform the action at a later time? | 1.2 | 0 | 0 | 552 |
264,154 | 2008-11-05T01:56:00.000 | 0 | 0 | 0 | 0 | python,google-app-engine,google-cloud-datastore | 1,000,121 | 16 | false | 1 | 0 | The proposed solution only works if entries are sorted by key... If you are sorting by another column first, you still have to use a limit(offset, count) clause, then the 1000 entries limitation still apply. It is the same if you use two requests : one for retrieving indexes (with conditions and sort) and another using... | 1 | 51 | 0 | How can I fetch more than 1000 record from data store and put all in one single list to pass to django? | How to fetch more than 1000? | 0 | 0 | 0 | 32,035 |
265,687 | 2008-11-05T16:23:00.000 | 12 | 0 | 1 | 0 | python,multithreading,scripting,locking,bytecode | 266,111 | 6 | false | 0 | 0 | Python, like perl 5, was not designed from the ground up to be thread safe. Threads were grafted on after the fact, so the global interpreter lock is used to maintain mutual exclusion to where only one thread is executing code at a given time in the bowels of the interpreter.
Individual Python threads are cooperatively... | 1 | 91 | 0 | What is exactly the function of Python's Global Interpreter Lock?
Do other languages that are compiled to bytecode employ a similar mechanism? | Why the Global Interpreter Lock? | 1 | 0 | 0 | 17,616 |
266,849 | 2008-11-05T21:50:00.000 | 1 | 1 | 0 | 0 | python,smtp,tor | 275,164 | 2 | true | 0 | 0 | Because of abuse by spammers, many Tor egress nodes decline to emit port 25 (SMTP) traffic, so you may have problems. | 1 | 2 | 0 | I'm conducting experiments regarding e-mail spam. One of these experiments require sending mail thru Tor. Since I'm using Python and smtplib for my experiments, I'm looking for a way to use the Tor proxy (or other method) to perform that mail sending.
Ideas how this can be done? | Using Python's smtplib with Tor | 1.2 | 0 | 1 | 2,405 |
267,660 | 2008-11-06T04:44:00.000 | 2 | 0 | 0 | 0 | python,image,graphics,animation,drawing | 267,698 | 3 | false | 0 | 1 | The client will present this as a slide in a presentation in a windows machine
I think this is the key to your answer. Before going to a 3d implementation and writing all the code in the world to create this feature, you need to look at the presentation software. Chances are, your options will boil down to two things... | 2 | 1 | 0 | Background
I have been asked by a client to create a picture of the world which has animated arrows/rays that come from one part of the world to another.
The rays will be randomized, will represent a transaction, will fade out after they happen and will increase in frequency as time goes on. The rays will start in ... | How to create a picture with animated aspects programmatically | 0.132549 | 0 | 0 | 902 |
267,660 | 2008-11-06T04:44:00.000 | 1 | 0 | 0 | 0 | python,image,graphics,animation,drawing | 267,676 | 3 | false | 0 | 1 | It depends largely on the effort you want to expend on this, but the basic outline of an easy way. Would be to load an image of an arrow, and use a drawing library to color and rotate it in the direction you want to point(or draw it using shapes/curves).
Finally to actually animate it interpolate between the coordinate... | 2 | 1 | 0 | Background
I have been asked by a client to create a picture of the world which has animated arrows/rays that come from one part of the world to another.
The rays will be randomized, will represent a transaction, will fade out after they happen and will increase in frequency as time goes on. The rays will start in ... | How to create a picture with animated aspects programmatically | 0.066568 | 0 | 0 | 902 |
267,977 | 2008-11-06T08:50:00.000 | -1 | 0 | 1 | 1 | python | 268,348 | 5 | false | 0 | 0 | "I often find a need to put paths in my code" -- this isn't very Pythonic to begin with.
Ideally, your code lives in some place like site-packages and that's the end of that.
Often, we have an installed "application" that uses a fairly fixed set of directories for working files. In linux, we get this information from... | 2 | 2 | 0 | I often find a need to put paths in my code in order to find data or in some cases tool-specific modules. I've so far always used autotools because of this--it's just so easy to call sed to replace a few strings at build time. However, I'd like to find a more Pythonic way of doing this, i.e. use distutils or some oth... | Python distutils and replacing strings in code | -0.039979 | 0 | 0 | 283 |
267,977 | 2008-11-06T08:50:00.000 | 0 | 0 | 1 | 1 | python | 348,082 | 5 | false | 0 | 0 | The OP here, I've not finally managed to log in using my OpenID.
@S.Lott
Point well taken, but for some Linux distros it seems to be standard to install application-specific data and application-specific modules in specific locations. I think that making these locations configurable at build/install time is a nice thi... | 2 | 2 | 0 | I often find a need to put paths in my code in order to find data or in some cases tool-specific modules. I've so far always used autotools because of this--it's just so easy to call sed to replace a few strings at build time. However, I'd like to find a more Pythonic way of doing this, i.e. use distutils or some oth... | Python distutils and replacing strings in code | 0 | 0 | 0 | 283 |
268,089 | 2008-11-06T09:39:00.000 | 3 | 0 | 0 | 0 | python,django,database-connection | 272,522 | 10 | false | 1 | 0 | If you read a few of the many (many) threads on this subject in django-dev, you will see that what looks straightforward, isn't. If you pick a single use case, then it looks easy, but as soon as you start to generalize in any way you start to run into trouble.
To use the above-referenced thread as an example, when you ... | 1 | 10 | 0 | From some forum I came to know that Multiple database support is added in Django at lower level, but the higher level apis are not added yet.
Can anyone please tell me how one can achieve multiple database connections in Django.
Does anyone have any idea by when Django will fully/officially support Multiple database co... | Multiple database support in django | 0.059928 | 0 | 0 | 9,347 |
268,629 | 2008-11-06T13:10:00.000 | 15 | 0 | 0 | 0 | python,http,basehttpserver | 4,020,093 | 11 | false | 0 | 0 | I think you can use [serverName].socket.close() | 1 | 58 | 0 | I am running my HTTPServer in a separate thread (using the threading module which has no way to stop threads...) and want to stop serving requests when the main thread also shuts down.
The Python documentation states that BaseHTTPServer.HTTPServer is a subclass of SocketServer.TCPServer, which supports a shutdown metho... | How to stop BaseHTTPServer.serve_forever() in a BaseHTTPRequestHandler subclass? | 1 | 0 | 1 | 87,640 |
269,060 | 2008-11-06T15:18:00.000 | 1 | 1 | 1 | 0 | python,email,character-encoding,invalid-characters | 271,058 | 3 | false | 0 | 0 | The best way to do this that I've found is to iteratively try decoding a prospective with each of the most common encodings inside of a try except block. | 1 | 18 | 0 | I'm writing some mail-processing software in Python that is encountering strange bytes in header fields. I suspect this is just malformed mail; the message itself claims to be us-ascii, so I don't think there is a true encoding, but I'd like to get out a unicode string approximating the original one without throwing a... | Is there a Python library function which attempts to guess the character-encoding of some bytes? | 0.066568 | 0 | 0 | 12,045 |
269,292 | 2008-11-06T16:19:00.000 | 8 | 1 | 1 | 0 | python,http,mime-types | 269,364 | 2 | false | 0 | 0 | I doubt there's an established MIME type. Have you considered using JSON instead, it is almost the same as a Python dict, and has a better established culture of tools and techniques. | 1 | 3 | 0 | I have a web API that returns python dictionaries or lists as a response that I eval() in python scripts that use the API, for completness I wanted to set a proper content-type but not sure what would be best to use "text/x-python" or maybe "application/python", or something else?
[edit] I'm also outputting JSON, I'm ... | What mime-type should I return for a python string | 1 | 0 | 0 | 3,601 |
269,676 | 2008-11-06T18:06:00.000 | 1 | 0 | 0 | 0 | python,mysql,database,deadlock | 270,449 | 5 | false | 0 | 0 | you can always run LOCK TABLE tablename from another session (mysql CLI for instance). That might do the trick.
It will remain locked until you release it or disconnect the session. | 1 | 10 | 0 | I want to make my Python library working with MySQLdb be able to detect deadlocks and try again. I believe I've coded a good solution, and now I want to test it.
Any ideas for the simplest queries I could run using MySQLdb to create a deadlock condition would be?
system info:
MySQL 5.0.19
Client 5.1.11
Windows XP
P... | How can I Cause a Deadlock in MySQL for Testing Purposes | 0.039979 | 1 | 0 | 7,080 |
269,795 | 2008-11-06T18:36:00.000 | 1 | 0 | 1 | 1 | python,module | 269,814 | 20 | false | 0 | 0 | Not all python modules are written in python. Datetime happens to be one of them that is not, and (on linux) is datetime.so.
You would have to download the source code to the python standard library to get at it. | 5 | 564 | 0 | How do I learn where the source file for a given Python module is installed? Is the method different on Windows than on Linux?
I'm trying to look for the source of the datetime module in particular, but I'm interested in a more general answer as well. | How do I find the location of Python module sources? | 0.01 | 0 | 0 | 717,501 |
269,795 | 2008-11-06T18:36:00.000 | 103 | 0 | 1 | 1 | python,module | 32,784,452 | 20 | false | 0 | 0 | If you're using pip to install your modules, just pip show $module the location is returned. | 5 | 564 | 0 | How do I learn where the source file for a given Python module is installed? Is the method different on Windows than on Linux?
I'm trying to look for the source of the datetime module in particular, but I'm interested in a more general answer as well. | How do I find the location of Python module sources? | 1 | 0 | 0 | 717,501 |
269,795 | 2008-11-06T18:36:00.000 | 1 | 0 | 1 | 1 | python,module | 27,230,006 | 20 | false | 0 | 0 | For those who prefer a GUI solution: if you're using a gui such as Spyder (part of the Anaconda installation) you can just right-click the module name (such as "csv" in "import csv") and select "go to definition" - this will open the file, but also on the top you can see the exact file location ("C:....csv.py") | 5 | 564 | 0 | How do I learn where the source file for a given Python module is installed? Is the method different on Windows than on Linux?
I'm trying to look for the source of the datetime module in particular, but I'm interested in a more general answer as well. | How do I find the location of Python module sources? | 0.01 | 0 | 0 | 717,501 |
269,795 | 2008-11-06T18:36:00.000 | -1 | 0 | 1 | 1 | python,module | 72,396,307 | 20 | false | 0 | 0 | as written above
in python just use help(module)
ie
import fractions
help(fractions)
if your module, in the example fractions, is installed then it will tell you location and info about it, if its not installed it says module not available
if its not available it doesn't come by default with python in which case yo... | 5 | 564 | 0 | How do I learn where the source file for a given Python module is installed? Is the method different on Windows than on Linux?
I'm trying to look for the source of the datetime module in particular, but I'm interested in a more general answer as well. | How do I find the location of Python module sources? | -0.01 | 0 | 0 | 717,501 |
269,795 | 2008-11-06T18:36:00.000 | 5 | 0 | 1 | 1 | python,module | 61,095,592 | 20 | false | 0 | 0 | Another way to check if you have multiple python versions installed, from the terminal.
$ python3 -m pip show pyperclip
Location: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
$ python -m pip show pyperclip
Location: /Users/umeshvuyyuru/Library/Python/2.7/lib/python/site-packages | 5 | 564 | 0 | How do I learn where the source file for a given Python module is installed? Is the method different on Windows than on Linux?
I'm trying to look for the source of the datetime module in particular, but I'm interested in a more general answer as well. | How do I find the location of Python module sources? | 0.049958 | 0 | 0 | 717,501 |
271,625 | 2008-11-07T09:34:00.000 | 0 | 0 | 1 | 1 | python,debugging,console,pydev,interactive | 1,116,728 | 5 | false | 0 | 0 | When I set a break point and hit F11 Eclipse launches the debugger and prompts to open the "Debug Perspective". You can then open the Window-->Show View --> Expressions which opens the expressions view, you can then right click in the Expressions view windows and choose "Add Watch Expression" to add any expression(suc... | 3 | 36 | 0 | I'm debugging my Python code in Eclipse using the Pydev plugin. I'm able to open a Pydev console and it gives me two options: "Console for currently active editor" and "Python console". However none of them is useful to inspect current variable status after a breakpoint.
For example, the code stopped at a breakpoint an... | Interactive console using Pydev in Eclipse? | 0 | 0 | 0 | 27,430 |
271,625 | 2008-11-07T09:34:00.000 | 0 | 0 | 1 | 1 | python,debugging,console,pydev,interactive | 31,548,800 | 5 | false | 0 | 0 | On a small monitor, you may not realize that the debug interactive console is different from the regular interactive console: it has a second command prompt at the bottom where you type, not at the top like the normal console. | 3 | 36 | 0 | I'm debugging my Python code in Eclipse using the Pydev plugin. I'm able to open a Pydev console and it gives me two options: "Console for currently active editor" and "Python console". However none of them is useful to inspect current variable status after a breakpoint.
For example, the code stopped at a breakpoint an... | Interactive console using Pydev in Eclipse? | 0 | 0 | 0 | 27,430 |
271,625 | 2008-11-07T09:34:00.000 | 1 | 0 | 1 | 1 | python,debugging,console,pydev,interactive | 271,692 | 5 | false | 0 | 0 | Double click on "action" or any other variable.
ctrl+shift+D
And if you're using watches, I cant imagine better interaction. You are able to see every change. | 3 | 36 | 0 | I'm debugging my Python code in Eclipse using the Pydev plugin. I'm able to open a Pydev console and it gives me two options: "Console for currently active editor" and "Python console". However none of them is useful to inspect current variable status after a breakpoint.
For example, the code stopped at a breakpoint an... | Interactive console using Pydev in Eclipse? | 0.039979 | 0 | 0 | 27,430 |
271,825 | 2008-11-07T11:35:00.000 | 5 | 1 | 0 | 0 | python,database,client-server,load-testing,stress-testing | 271,918 | 5 | false | 0 | 0 | For performance you are looking at two things: latency (the responsiveness of the application) and throughput (how many ops per interval). For latency you need to have an acceptable benchmark. For throughput you need to have a minimum acceptable throughput.
These are you starting points. For telling a client how many x... | 2 | 13 | 0 | I develop a client-server style, database based system and I need to devise a way to stress / load test the system. Customers inevitably want to know such things as:
• How many clients can a server support?
• How many concurrent searches can a server support?
• How much data can we store in the database?
• Etc.
Key to... | How should I stress test / load test a client server application? | 0.197375 | 0 | 1 | 10,487 |
271,825 | 2008-11-07T11:35:00.000 | 0 | 1 | 0 | 0 | python,database,client-server,load-testing,stress-testing | 271,891 | 5 | false | 0 | 0 | If you have the budget, LoadRunner would be perfect for this. | 2 | 13 | 0 | I develop a client-server style, database based system and I need to devise a way to stress / load test the system. Customers inevitably want to know such things as:
• How many clients can a server support?
• How many concurrent searches can a server support?
• How much data can we store in the database?
• Etc.
Key to... | How should I stress test / load test a client server application? | 0 | 0 | 1 | 10,487 |
272,042 | 2008-11-07T13:21:00.000 | 4 | 0 | 0 | 0 | python,django | 272,470 | 2 | false | 1 | 0 | A site I did last year was concerned that usernames/passwords might be posted to a forum. I dealt with this by adding a model and a check to the login view that looked at how many unique IPs the name had been used from in the last X hours. I gave the site admins two values in settings.py to adjust the number of hours a... | 2 | 2 | 0 | is there any way of making sure that, one user is logged in only once?
I would like to avoid two different persons logging into the system with the same login/password.
I guess I could do it myself by checking in the django_session table before logging in the user, but I rather prefer using the framework, if there is a... | User Authentication in Django | 0.379949 | 0 | 0 | 1,232 |
272,042 | 2008-11-07T13:21:00.000 | 5 | 0 | 0 | 0 | python,django | 272,071 | 2 | true | 1 | 0 | Logged in twice is ambiguous over HTTP. There's no "disconnecting" signal that's sent. You can frustrate people if you're not careful.
If I shut down my browser and drop the cookies -- accidentally -- I might be prevented from logging in again.
How would the server know it was me trying to re-login vs. me trying to... | 2 | 2 | 0 | is there any way of making sure that, one user is logged in only once?
I would like to avoid two different persons logging into the system with the same login/password.
I guess I could do it myself by checking in the django_session table before logging in the user, but I rather prefer using the framework, if there is a... | User Authentication in Django | 1.2 | 0 | 0 | 1,232 |
273,043 | 2008-11-07T18:13:00.000 | 0 | 0 | 1 | 1 | python,linux,debugging,openssl | 273,204 | 4 | false | 0 | 0 | If you're using CDLL to wrap a C library in python, and this is 64-bit linux, there's a good chance that you're CDLL wrapper is misconfigured. CDLL defaults to int return types on all platforms (should be a long long on 64-bit systems) and just expects you to pass the right arguments in. You may need to verify the CD... | 1 | 4 | 0 | We have a Linux application that makes use of OpenSSL's Python bindings and I suspect it is causing random crashes. Occasionally, we see it crash with the message:
Python Fatal Error: GC Object already tracked
which would appear to be either a programming error on the part of the library, or a symptom of memory corr... | Python memory debugging with GDB | 0 | 0 | 0 | 4,500 |
273,524 | 2008-11-07T20:23:00.000 | 4 | 0 | 1 | 0 | python,programming-languages,python-3.x | 273,543 | 12 | false | 0 | 0 | C# and the .NET framework broke compatibility between versions 1.0 and 1.1 as well as between 1.1 and 2.0. Running applications in different versions required having multiple versions of the .NET runtime installed.
At least they did include an upgrade wizard to upgrade source from one version to the next (it worked fo... | 9 | 12 | 0 | Python 3.0 breaks backwards compatibility with previous versions and splits the language into two paths (at least temporarily). Do you know of any other language that went through such a major design phase while in maturity?
Also, do you believe that this is how programming languages should evolve or is the price to pa... | Python 3.0 and language evolution | 0.066568 | 0 | 0 | 1,474 |
273,524 | 2008-11-07T20:23:00.000 | 2 | 0 | 1 | 0 | python,programming-languages,python-3.x | 273,646 | 12 | false | 0 | 0 | In the Lisp world it has happened a few times. of course, the language is so dynamic that usually evolution is simply deprecating part of the standard library and making standard another part.
also, Lua 4 to 5 was pretty significant; but the language core is so minimal that even wide-reaching changes are documented in... | 9 | 12 | 0 | Python 3.0 breaks backwards compatibility with previous versions and splits the language into two paths (at least temporarily). Do you know of any other language that went through such a major design phase while in maturity?
Also, do you believe that this is how programming languages should evolve or is the price to pa... | Python 3.0 and language evolution | 0.033321 | 0 | 0 | 1,474 |
273,524 | 2008-11-07T20:23:00.000 | 4 | 0 | 1 | 0 | python,programming-languages,python-3.x | 273,994 | 12 | false | 0 | 0 | Wouldn't VB6 to VB.net be the biggest example of this? Or do you all consider them two separate languages? | 9 | 12 | 0 | Python 3.0 breaks backwards compatibility with previous versions and splits the language into two paths (at least temporarily). Do you know of any other language that went through such a major design phase while in maturity?
Also, do you believe that this is how programming languages should evolve or is the price to pa... | Python 3.0 and language evolution | 0.066568 | 0 | 0 | 1,474 |
273,524 | 2008-11-07T20:23:00.000 | 0 | 0 | 1 | 0 | python,programming-languages,python-3.x | 427,917 | 12 | false | 0 | 0 | The new version of the Ruby programming language will also break compatibility.
And think of the libraries one might use: gtk, Qt, and so on (they also have incompatible versions).
I think incompatibility is necessary sometimes (but not too often) to support progress. | 9 | 12 | 0 | Python 3.0 breaks backwards compatibility with previous versions and splits the language into two paths (at least temporarily). Do you know of any other language that went through such a major design phase while in maturity?
Also, do you believe that this is how programming languages should evolve or is the price to pa... | Python 3.0 and language evolution | 0 | 0 | 0 | 1,474 |
273,524 | 2008-11-07T20:23:00.000 | 9 | 0 | 1 | 0 | python,programming-languages,python-3.x | 273,576 | 12 | false | 0 | 0 | The python team has worked very hard to make the lack of backward compatibility as painless as possible, to the point where the 2.6 release of python was created with a mind towards a painless upgrade process. Once you have upgraded to 2.6 there are scripts that you can run that will move you to 3.0 without issue. | 9 | 12 | 0 | Python 3.0 breaks backwards compatibility with previous versions and splits the language into two paths (at least temporarily). Do you know of any other language that went through such a major design phase while in maturity?
Also, do you believe that this is how programming languages should evolve or is the price to pa... | Python 3.0 and language evolution | 1 | 0 | 0 | 1,474 |
273,524 | 2008-11-07T20:23:00.000 | 7 | 0 | 1 | 0 | python,programming-languages,python-3.x | 273,661 | 12 | false | 0 | 0 | It's worth mentioning that backward compatibility incurs costs of its own. In some cases it's almost impossible to evolve a language in the ideal way if 100% backward compatibility is required. Java's implementation of generics (which erases type information at compile-time in order to be backwardly-compatible) is a go... | 9 | 12 | 0 | Python 3.0 breaks backwards compatibility with previous versions and splits the language into two paths (at least temporarily). Do you know of any other language that went through such a major design phase while in maturity?
Also, do you believe that this is how programming languages should evolve or is the price to pa... | Python 3.0 and language evolution | 1 | 0 | 0 | 1,474 |
273,524 | 2008-11-07T20:23:00.000 | 13 | 0 | 1 | 0 | python,programming-languages,python-3.x | 273,688 | 12 | false | 0 | 0 | The price of insisting on near-absolute backwards compatibility is just too high. Spend two minutes programming in C++ if you want to see why. | 9 | 12 | 0 | Python 3.0 breaks backwards compatibility with previous versions and splits the language into two paths (at least temporarily). Do you know of any other language that went through such a major design phase while in maturity?
Also, do you believe that this is how programming languages should evolve or is the price to pa... | Python 3.0 and language evolution | 1 | 0 | 0 | 1,474 |
273,524 | 2008-11-07T20:23:00.000 | 16 | 0 | 1 | 0 | python,programming-languages,python-3.x | 273,571 | 12 | false | 0 | 0 | The only language I can think of to attempt such a mid-stream change would be Perl. Of course, Python is beating Perl to that particular finish line by releasing first. It should be noted, however, that Perl's changes are much more extensive than Python's and likely will be harder to detangle.
(There's a price for Perl... | 9 | 12 | 0 | Python 3.0 breaks backwards compatibility with previous versions and splits the language into two paths (at least temporarily). Do you know of any other language that went through such a major design phase while in maturity?
Also, do you believe that this is how programming languages should evolve or is the price to pa... | Python 3.0 and language evolution | 1 | 0 | 0 | 1,474 |
273,524 | 2008-11-07T20:23:00.000 | 0 | 0 | 1 | 0 | python,programming-languages,python-3.x | 274,338 | 12 | false | 0 | 0 | gcc regularly changes how it handles C++ almost every minor release. Of course, this is more a consequence of gcc tightening how they follow the rules, and less of C++ itself changing. | 9 | 12 | 0 | Python 3.0 breaks backwards compatibility with previous versions and splits the language into two paths (at least temporarily). Do you know of any other language that went through such a major design phase while in maturity?
Also, do you believe that this is how programming languages should evolve or is the price to pa... | Python 3.0 and language evolution | 0 | 0 | 0 | 1,474 |
275,572 | 2008-11-09T03:46:00.000 | 2 | 0 | 0 | 0 | python,mysql,database,sqlite,sqlobject | 275,676 | 3 | false | 0 | 0 | Your success with createTable() will depend on your existing underlying table schema / data types. In other words, how well SQLite maps to the database you choose and how SQLObject decides to use your data types.
The safest option may be to create the new database by hand. Then you'll have to deal with data migration... | 1 | 1 | 0 | I'm starting a web project that likely should be fine with SQLite. I have SQLObject on top of it, but thinking long term here -- if this project should require a more robust (e.g. able to handle high traffic), I will need to have a transition plan ready. My questions:
How easy is it to transition from one DB (SQLite... | Database change underneath SQLObject | 0.132549 | 1 | 0 | 876 |
276,679 | 2008-11-09T23:40:00.000 | 7 | 0 | 1 | 0 | python | 276,696 | 4 | false | 0 | 0 | You most probably should not use import for what you are trying to do.
Without further information I can only guess, but you should move the code in the module you import from the top level into a function, do the import once and than simply call the function from you loop. | 2 | 2 | 0 | Is it possible to import a python file more than once in a python script because i run a loop back to my driver file in a function by using the import command but it only works once? thanks
edit: Resolved myself thanks | How to import a python file in python script more than once | 1 | 0 | 0 | 7,985 |
276,679 | 2008-11-09T23:40:00.000 | 1 | 0 | 1 | 0 | python | 276,694 | 4 | false | 0 | 0 | The import statement -- by definition -- only imports once.
You can, if you want, try to use execfile() (or eval()) to execute a separate file more than once. | 2 | 2 | 0 | Is it possible to import a python file more than once in a python script because i run a loop back to my driver file in a function by using the import command but it only works once? thanks
edit: Resolved myself thanks | How to import a python file in python script more than once | 0.049958 | 0 | 0 | 7,985 |
276,761 | 2008-11-10T00:34:00.000 | 23 | 1 | 0 | 0 | c++,python,boost,swig | 277,306 | 5 | true | 0 | 1 | I've used both (for the same project): Boost is better integrated with the STL, and especially C++ exceptions. Also, its memory management mechanism (which tries to bridge C++ memory management and Python GC) is way more flexible than SWIG's. However, SWIG has much better documentation, no external dependencies, and ... | 2 | 41 | 0 | I'm currently working on a project were I had to wrap the C++ classes with Python to be able to script the program. So my specific experience also involved embedding the Python interpreter in our program.
The alternatives I tried were:
Boost.Python
I liked the cleaner API produced by Boost.Python, but the fact that it... | Exposing a C++ API to Python | 1.2 | 0 | 0 | 12,800 |
276,761 | 2008-11-10T00:34:00.000 | 2 | 1 | 0 | 0 | c++,python,boost,swig | 847,688 | 5 | false | 0 | 1 | A big plus for Boost::Python is that it allows for tab completion in the ipython shell: You import a C++ class, exposed by Boost directly, or you subclass it, and from then on, it really behaves like a pure Python class.
The downside: It takes so long to install and use Boost that all the Tab-completion time-saving wo... | 2 | 41 | 0 | I'm currently working on a project were I had to wrap the C++ classes with Python to be able to script the program. So my specific experience also involved embedding the Python interpreter in our program.
The alternatives I tried were:
Boost.Python
I liked the cleaner API produced by Boost.Python, but the fact that it... | Exposing a C++ API to Python | 0.07983 | 0 | 0 | 12,800 |
279,094 | 2008-11-10T20:41:00.000 | 2 | 0 | 0 | 0 | python,windows,scripting,activex,ole | 363,885 | 5 | false | 0 | 0 | win32com is a good package to use if you want to use the IDispatch interface to control your objects, but it's slow.
comtypes is a better, native Python, package that uses the raw COM approach to talk to your controls.
WxPython uses comtypes to give you an ActiveX container window from Python. | 1 | 9 | 0 | I would like to use Python to script an application that advertises itself as providing an OLE component. How should I get started?
I don't yet know what methods I need to call on the COMponents I will be accessing. Should I use win32com to load those components, and then start pressing 'tab' in IPython? | How to script an OLE component using Python | 0.07983 | 0 | 0 | 15,172 |
279,434 | 2008-11-10T22:41:00.000 | 0 | 1 | 0 | 1 | python,keypress,popen | 279,627 | 3 | false | 0 | 0 | What platform is this on?
You may have to actually feed events into the event loop, if it's running on Win32. | 2 | 1 | 0 | I am opening a process (with os.popen() ) that, for some commands, detects certain keypresses (e.g. ESC - not the character, the key). Is there a way to send keypress events to the process? | Python: How do I generate a keypress? | 0 | 0 | 0 | 2,607 |
279,434 | 2008-11-10T22:41:00.000 | 0 | 1 | 0 | 1 | python,keypress,popen | 279,460 | 3 | false | 0 | 0 | The obvious way would be to start the process in it's own shell.
something like os.popen("sh command") | 2 | 1 | 0 | I am opening a process (with os.popen() ) that, for some commands, detects certain keypresses (e.g. ESC - not the character, the key). Is there a way to send keypress events to the process? | Python: How do I generate a keypress? | 0 | 0 | 0 | 2,607 |
279,707 | 2008-11-11T00:56:00.000 | 0 | 0 | 1 | 0 | python,user-interface | 279,754 | 4 | false | 0 | 0 | We started down the path of wxPython a few years ago and found it to be quite easy to do for simple, quick and dirty app. However, you are not going to get something you can put on the modern desktop. So we switched to WinForms and Python.Net and haven't looked back since. It's fairly easy to get going and you get a... | 1 | 2 | 0 | How do I make a GUI for my python program because now it only runs in Idle and a command line and what software packages can I use and where can I get them? Thanks. | making a python GUI | 0 | 0 | 0 | 4,584 |
279,912 | 2008-11-11T03:17:00.000 | 32 | 0 | 0 | 0 | python,pyglet,pyopengl | 4,246,325 | 9 | false | 0 | 1 | Start with pyglet. It contains the best high-level API, which contains all you need to get started, from opening a window to drawing sprites and OpenGL primitives using their friendly and powerful Sprite and Batch classes.
Later, you might also want to write your own lower-level code, that makes calls directly to OpenG... | 5 | 25 | 0 | I am looking to do some tinkering with openGL and Python and haven't been able to find good reasons for using PyOpenGl versus pyglet
Which would you recommend and why? | PyOpenGl or pyglet? | 1 | 0 | 0 | 18,513 |
279,912 | 2008-11-11T03:17:00.000 | 4 | 0 | 0 | 0 | python,pyglet,pyopengl | 2,396,038 | 9 | false | 0 | 1 | pyglet's GL API is nowhere near as nice as PyOpenGL's - pyglet's is at the raw ctypes layer which means you'll need to learn ctypes as well. If you're planning on doing a bunch of OpenGL programming you'll want to use PyOpenGL.
The nice thing is you can mix the two just fine. Use pyglet to provide the GL context, soun... | 5 | 25 | 0 | I am looking to do some tinkering with openGL and Python and haven't been able to find good reasons for using PyOpenGl versus pyglet
Which would you recommend and why? | PyOpenGl or pyglet? | 0.088656 | 0 | 0 | 18,513 |
279,912 | 2008-11-11T03:17:00.000 | 4 | 0 | 0 | 0 | python,pyglet,pyopengl | 279,942 | 9 | false | 0 | 1 | pyglet has a lot of nice extras included with it (like image loading and sound). If you're starting out, I'd try pyglet first, and then switch to PyOpenGL if you feel like you want to get closer to the metal.
The real important question though is: what are you trying to accomplish? | 5 | 25 | 0 | I am looking to do some tinkering with openGL and Python and haven't been able to find good reasons for using PyOpenGl versus pyglet
Which would you recommend and why? | PyOpenGl or pyglet? | 0.088656 | 0 | 0 | 18,513 |
279,912 | 2008-11-11T03:17:00.000 | 4 | 0 | 0 | 0 | python,pyglet,pyopengl | 281,395 | 9 | false | 0 | 1 | I promote pyglet because it has the nicest API I've yet seen on stuff like this.
Pyglet has opengl API as well. But it's often nicer to use the recently added vertex list support.
pyglet.gl | 5 | 25 | 0 | I am looking to do some tinkering with openGL and Python and haven't been able to find good reasons for using PyOpenGl versus pyglet
Which would you recommend and why? | PyOpenGl or pyglet? | 0.088656 | 0 | 0 | 18,513 |
279,912 | 2008-11-11T03:17:00.000 | 3 | 0 | 0 | 0 | python,pyglet,pyopengl | 397,041 | 9 | false | 0 | 1 | I would recommend Pyglet because it is very easy to get started and have something basic running, and then you can add more advanced techniques at your own pace. | 5 | 25 | 0 | I am looking to do some tinkering with openGL and Python and haven't been able to find good reasons for using PyOpenGl versus pyglet
Which would you recommend and why? | PyOpenGl or pyglet? | 0.066568 | 0 | 0 | 18,513 |
282,907 | 2008-11-12T03:15:00.000 | 1 | 0 | 1 | 1 | python,windows,linux,cygwin,turbogears | 282,939 | 5 | false | 0 | 0 | Add python to the firewall exceptions list. Just make sure you don't run any questionable code made in python, of course. | 2 | 1 | 0 | I'm going to try out turbogears however I'm on windows vista.
however due to firewall proxy problems, it seems i can't download .egg files which is required for setup turbogears to get installed in my windows environment.
I do have a bootable, or I can make a bootable Linux USB, I can try cygwin but I am not sure where... | How can I download python .egg files, when behind a firewall | 0.039979 | 0 | 0 | 1,615 |
282,907 | 2008-11-12T03:15:00.000 | 2 | 0 | 1 | 1 | python,windows,linux,cygwin,turbogears | 283,271 | 5 | false | 0 | 0 | You could use the old firewall hack... try throwing "?file.jpg" or "#file.jpg" on the end (sans quotes). The firewall may see this as you're trying to download an image file which it'll allow, the responding server probably won't care that you've attached a query string, and (I think) python will just see an egg. | 2 | 1 | 0 | I'm going to try out turbogears however I'm on windows vista.
however due to firewall proxy problems, it seems i can't download .egg files which is required for setup turbogears to get installed in my windows environment.
I do have a bootable, or I can make a bootable Linux USB, I can try cygwin but I am not sure where... | How can I download python .egg files, when behind a firewall | 0.07983 | 0 | 0 | 1,615 |
283,431 | 2008-11-12T09:38:00.000 | 0 | 0 | 0 | 1 | python,windows | 286,436 | 2 | false | 0 | 0 | The suggested answer seems to have fixed the problem. I also realized that I needed to use os.name to determine which OS is being used, then I can use the correct path format for loading the external Python file. | 1 | 1 | 0 | My record sheet app has a menu option for creating a new, blank record sheet. When I open a sheet window, I can open new windows without a problem, using subprocess.Popen() to do it.
However, under Windows (I haven't tested it on other OSes yet), if I open a new window then use the "open file" dialog to populate the fi... | Why would an "command not recognized" error occur only when a window is populated? | 0 | 0 | 0 | 1,123 |
283,707 | 2008-11-12T11:49:00.000 | 7 | 0 | 1 | 0 | python,file,file-io,filesize,tarfile | 283,718 | 5 | false | 0 | 0 | If you have the file descriptor, you can use fstat to find out the size, if any. A more generic solution is to seek to the end of the file, and read its location there. | 1 | 71 | 0 | Is there a way to find the size of a file object that is currently open?
Specifically, I am working with the tarfile module to create tarfiles, but I don't want my tarfile to exceed a certain size. As far as I know, tarfile objects are file-like objects, so I imagine a generic solution would work. | Size of an open file object | 1 | 0 | 0 | 74,503 |
284,115 | 2008-11-12T14:35:00.000 | -4 | 0 | 0 | 0 | python,cross-platform,filesystems | 284,363 | 5 | false | 0 | 0 | "Is there a standard way to deal with this?" Yes. Use a standard (i.e., POSIX-compliant) OS.
Since Windows is non-standard -- well -- there's no applicable standard. Wouldn't it be great if there was? I feel your pain.
Anything you try to do that's cross-platform like that will have Win32 oddities.
Your solution is... | 1 | 21 | 0 | What is the best way to do cross-platform handling of hidden files?
(preferably in Python, but other solutions still appreciated)
Simply checking for a leading '.' works for *nix/Mac, and file attributes work on Windows. However, this seems a little simplistic, and also doesn't account for alternative methods of hiding... | Cross platform hidden file detection | -1 | 0 | 0 | 21,243 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.