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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4,320,761 | 2010-12-01T02:47:00.000 | 13 | 0 | 0 | 1 | python,cx-freeze,winreg | 48,344,053 | 4 | false | 0 | 0 | I know this is an old question, but this was the first search result when Googling for ModuleNotFoundError: No module named '_winreg', and perhaps may be helpful for someone.
I got the same error when trying to use a virtual environment folder, which has been created using different (already deleted) python binaries. T... | 1 | 22 | 0 | Where can I download _winreg for python3 if I can at all. I have my 'windir' on E:\Windows. I do not know if cx_Freeze did not notice that. I am using cx_Freeze to create an msi installer. | importError: no module named _winreg python3 | 1 | 0 | 0 | 38,800 |
4,321,160 | 2010-12-01T04:18:00.000 | 0 | 0 | 1 | 0 | python,dictionary,key | 4,321,256 | 7 | false | 0 | 0 | The answer is no.
If you want to know if there are solutions that are fast to type, then, sure, check out the other replies. But none of them will run quickly on large dictionaries, which I believe was the spirit of your question.
If this is really something you need to do often, you should modify the points in your c... | 1 | 2 | 0 | Is there a way to quickly query a dictionary object in order to find the key (all keys are of string type) with the most words?
I.e., if the item with the largest key had five words {'this is the largest key': 3}, how could I quickly query the dict and have the int '5' returned?
Best,
Georgina | Python - Find longest (most words) key in dictionary | 0 | 0 | 0 | 3,861 |
4,321,173 | 2010-12-01T04:21:00.000 | 3 | 0 | 0 | 0 | python,django,google-app-engine,caching,internationalization | 4,321,229 | 2 | false | 1 | 0 | I don't know how this works with django, but looking at it from a general web-development perspective, you could:
use a query parameter to determine the language (e.g. /foo/bar/page.py?lang=en)
Add the language code to the url path (e.g. /foo/bar/en/page.py), and optionally use mod_rewrite so that that part of the pat... | 1 | 1 | 0 | I have developed an AppEngine/Python/Django application that currently works in Spanish, and I am in the process of internationalizing with multi-language support. It is basically a dating website, in which people can browse other profiles and send messages. Viewing a profile in different languages will result in some ... | Multi-language website - unique URLs required for different languages (to prevent caching)? | 0.291313 | 0 | 0 | 552 |
4,321,836 | 2010-12-01T06:35:00.000 | 1 | 0 | 1 | 0 | python | 4,321,874 | 4 | false | 0 | 0 | Function declarations in Python do not involve any types, because variables in Python don't have types - values have types.
You don't declare the function separately, you just write it. The first line of a function looks like def name_of_function(arguments, go, here):. In your case, there are two things that are being ... | 2 | 1 | 0 | Homework question:
Write a function which is called like: replace_all({'a':'123', 'b':'Zab'}, 'acb')
What does the function declaration look like?
What kind of variable is 'a':'123' and {}? | Meaning of curly brackets and colons? | 0.049958 | 0 | 0 | 6,589 |
4,321,836 | 2010-12-01T06:35:00.000 | 0 | 0 | 1 | 0 | python | 4,324,190 | 4 | false | 0 | 0 | The declaration of such a function is " def replace_all(Dictionary, String): ". with the '{}' is designating a dictionary data structure of python in which 'a', 'b' are keys and they have there own corresponding values." 'a':'123' " is called an item of the dictionary (if you are considering " 'a':'123' " in context of... | 2 | 1 | 0 | Homework question:
Write a function which is called like: replace_all({'a':'123', 'b':'Zab'}, 'acb')
What does the function declaration look like?
What kind of variable is 'a':'123' and {}? | Meaning of curly brackets and colons? | 0 | 0 | 0 | 6,589 |
4,321,993 | 2010-12-01T07:04:00.000 | 1 | 0 | 1 | 0 | python,windows,processor | 4,322,005 | 6 | false | 0 | 0 | Assuming your task is parallelizable, then yes, threading is certainly a solution. In particular, if you have a lot of data items to process but they can all be handled independently then it should be relatively straightforward to parallelize.
Using multiple processes instead of multiple threads might be another soluti... | 2 | 5 | 0 | I am running a single-threaded python program that performs massive data processing on my windows box. My machine has 8 processors. When I monitor the CPU usage in performance tab under Windows Task Manager, it shows that I am using only a very small fraction of the processing power available to me. Only one processor ... | How to program to have all processors on your machine used? | 0.033321 | 0 | 0 | 2,647 |
4,321,993 | 2010-12-01T07:04:00.000 | 2 | 0 | 1 | 0 | python,windows,processor | 4,322,009 | 6 | false | 0 | 0 | Multithreading is required for a single process, but it is not necessarily a solution; processor affinity can restrict it to a subset of available cores even if you have more than enough threads to use all. | 2 | 5 | 0 | I am running a single-threaded python program that performs massive data processing on my windows box. My machine has 8 processors. When I monitor the CPU usage in performance tab under Windows Task Manager, it shows that I am using only a very small fraction of the processing power available to me. Only one processor ... | How to program to have all processors on your machine used? | 0.066568 | 0 | 0 | 2,647 |
4,322,250 | 2010-12-01T07:52:00.000 | 0 | 0 | 1 | 1 | python,linux,macos,executable | 4,322,272 | 3 | false | 0 | 0 | Dont know if available for OS X but take a look at cx_freeze | 2 | 1 | 0 | is it possible to create python executable targeted for linux, from mac os x?
PyInstaller seems to be at an early stage, and I don't know much else.
Thanks | python executable | 0 | 0 | 0 | 4,099 |
4,322,250 | 2010-12-01T07:52:00.000 | 5 | 0 | 1 | 1 | python,linux,macos,executable | 4,322,264 | 3 | false | 0 | 0 | Do you really need a standalone executable? For most Linux distributions, the easier and more common way to distribute Python software is to just distribute the source.
Every major Linux distribution already has Python installed, and some have it installed by default. | 2 | 1 | 0 | is it possible to create python executable targeted for linux, from mac os x?
PyInstaller seems to be at an early stage, and I don't know much else.
Thanks | python executable | 0.321513 | 0 | 0 | 4,099 |
4,322,559 | 2010-12-01T08:45:00.000 | 29 | 0 | 0 | 0 | python,r,hadoop,bigdata | 4,323,638 | 2 | true | 0 | 0 | Using the Python Disco project for example.
Good. Play with that.
Using the RHIPE package and finding toy datasets and problem areas.
Fine. Play with that, too.
Don't sweat finding "big" datasets. Even small datasets present very interesting problems. Indeed, any dataset is a starting-off point.
I once built a s... | 1 | 41 | 1 | I've been a long time user of R and have recently started working with Python. Using conventional RDBMS systems for data warehousing, and R/Python for number-crunching, I feel the need now to get my hands dirty with Big Data Analysis.
I'd like to know how to get started with Big Data crunching.
- How to start simple wi... | How to get started with Big Data Analysis | 1.2 | 0 | 0 | 18,227 |
4,324,407 | 2010-12-01T12:36:00.000 | 17 | 0 | 0 | 0 | python,sqlalchemy,nosql,redis | 4,331,070 | 2 | false | 0 | 0 | While it is possible to set up an ORM that puts data in redis, it isn't a particularly good idea. ORMs are designed to expose standard SQL features. Many things that are standard in SQL such as querying on arbitrary columns are not available in redis unless you do a lot of extra work. At the same time redis has feature... | 2 | 15 | 0 | I'm learning to use SQLAlchemy connected to a SQL database for 12 standard relational tables (e.g. SQLite or PostgreSQL). But then I'd like to use Redis with Python for a couple of tables, particularly for Redis's fast set manipulation. I realise that Redis is NoSQL, but can I integrate this with SQLAlchemy for the ben... | How to integrate Redis with SQLAlchemy | 1 | 1 | 0 | 13,868 |
4,324,407 | 2010-12-01T12:36:00.000 | 14 | 0 | 0 | 0 | python,sqlalchemy,nosql,redis | 4,332,791 | 2 | false | 0 | 0 | Redis is very good at what it does, storing key values and making simple atomic operations, but if you want to use it as a relational database you're really gonna SUFFER!, as I had... and here is my story...
I've done something like that, making several objects to abstracting all the redis internals exposing primitives... | 2 | 15 | 0 | I'm learning to use SQLAlchemy connected to a SQL database for 12 standard relational tables (e.g. SQLite or PostgreSQL). But then I'd like to use Redis with Python for a couple of tables, particularly for Redis's fast set manipulation. I realise that Redis is NoSQL, but can I integrate this with SQLAlchemy for the ben... | How to integrate Redis with SQLAlchemy | 1 | 1 | 0 | 13,868 |
4,325,194 | 2010-12-01T14:10:00.000 | 1 | 0 | 1 | 0 | python,regex,mongodb,datetime,database | 4,325,260 | 4 | false | 0 | 0 | I agree with the other poster. Though this doesn't solve your immediate problem, if you have any control over the database, you should seriously consider creating a time/column, with either a DATE or TIMESTAMP datatype. That would make your system much more robust, & completely avoid the problem of trying to parse date... | 1 | 3 | 0 | I have a database full of data, including a date and time string, e.g. Tue, 21 Sep 2010 14:16:17 +0000
What I would like to be able to do is extract various documents (records) from the database based on the time contained within the date string, Tue, 21 Sep 2010 14:16:17 +0000.
From the above date string, how would I ... | Extracting Date and Time info from a string. | 0.049958 | 1 | 0 | 563 |
4,328,223 | 2010-12-01T19:25:00.000 | 3 | 1 | 0 | 0 | python,size,byte,pyserial | 4,328,281 | 2 | false | 0 | 0 | Historically, it was common to only send ASCII text over a serial connection, which fit into seven bits, and an eighth bit would be used as a parity marker which could indicate if the data was being transmitted correctly.
Since the parity check doesn't catch errors on an even number of bits, and can't correct the data... | 1 | 1 | 0 | I want to send messages through the serial port using PySerial. One of the parameters for the serial constructor is 'bytesize'. I have been trying serial.SEVENBITS and serial.EIGHTBITS and haven't noticed a difference. The documentation is a bit vague and I am new to both Python and serial communication.
Does this just... | 'bytesize' in PySerial module | 0.291313 | 0 | 0 | 4,981 |
4,328,416 | 2010-12-01T19:47:00.000 | 0 | 0 | 0 | 0 | jquery,python,html | 4,329,025 | 1 | true | 0 | 0 | Do you really want to do this?If the server is supposed to read the file with the path,why not simply upload it? Is it so large that it takes am unaceptable amount of time on an intranet? Anyway, you can probably do this with a java applet embedded. | 1 | 0 | 0 | I'm working on an intranet site, and would like to be able to click on a file (I'm not picky on how) and have the server "know" the filenme + path that I just picked. The local path is relevent because the server hosting the application has the same mapped network drive as all of the clients, so x:\someplace\something... | How to get the full path for a local file in Firefox 3 | 1.2 | 0 | 0 | 563 |
4,328,603 | 2010-12-01T20:09:00.000 | 3 | 0 | 0 | 0 | python,tkinter | 4,328,747 | 1 | false | 0 | 1 | This is not the right way to do an informational popup. On the Mac and on windows machines menus are native controls. Because of this the unpost command doesn't work because tk cedes control to the system event loop in order to get platform-specific behavior.
What you want is to use instead is a toplevel window with t... | 1 | 1 | 0 | I have implemented an informational popup in a python app using a Tkinter Menu widget. I have a Text widget on a canvas in the root window. I created a Menu widget that has root as its parent. When I detect a mouse hover over the text widget I post the popup menu with menuWidget.post(). When I get a leave event from ... | 'hover over' popup with Tkinter | 0.53705 | 0 | 0 | 2,151 |
4,328,681 | 2010-12-01T20:18:00.000 | 0 | 1 | 1 | 0 | python,module,profiling | 4,328,745 | 2 | false | 0 | 0 | Why not just create a branch with all the profiling changes, and then merge the branch when you want to test ... and revert everything afterwards.
git makes this somewhat easier with it's "git stash", but using branches shouldn't be significantly harder. | 1 | 0 | 0 | So I have a big project with many modules in it, and I want to run some profiling on it. I have a profile module that basically just provides a decorator that I can add to a function to profile it when it's called.
The problem is, I'll have to import that module into the dozens of modules that I have. This is fine I gu... | python module import question | 0 | 0 | 0 | 516 |
4,328,837 | 2010-12-01T20:33:00.000 | 1 | 0 | 0 | 0 | python,algorithm,r,graph,networkx | 19,205,464 | 4 | false | 0 | 0 | I know this is very late, but you can do the same thing, albeit a little more straightforward, with mathematica.
RandomGraph[DegreeGraphDistribution[{3, 3, 3, 3, 3, 3, 3, 3}], 4]
This will generate 4 random graphs, with each node having a prescribed degree. | 2 | 7 | 1 | I am trying to generate a random graph that has small-world properties (exhibits a power law distribution). I just started using the networkx package and discovered that it offers a variety of random graph generation. Can someone tell me if it possible to generate a graph where a given node's degree follows a gamma dis... | Generating a graph with certain degree distribution? | 0.049958 | 0 | 0 | 9,242 |
4,328,837 | 2010-12-01T20:33:00.000 | 2 | 0 | 0 | 0 | python,algorithm,r,graph,networkx | 4,329,072 | 4 | false | 0 | 0 | I did this a while ago in base Python... IIRC, I used the following method. From memory, so this may not be entirely accurate, but hopefully it's worth something:
Chose the number of nodes, N, in your graph, and the density (existing edges over possible edges), D. This implies the number of edges, E.
For each node, as... | 2 | 7 | 1 | I am trying to generate a random graph that has small-world properties (exhibits a power law distribution). I just started using the networkx package and discovered that it offers a variety of random graph generation. Can someone tell me if it possible to generate a graph where a given node's degree follows a gamma dis... | Generating a graph with certain degree distribution? | 0.099668 | 0 | 0 | 9,242 |
4,329,330 | 2010-12-01T21:28:00.000 | 2 | 0 | 1 | 1 | python,windows,installation | 4,329,365 | 1 | false | 0 | 0 | My first question would be, do you have administration rights when you try to run setup.py? | 1 | 0 | 0 | I would like to install a python package to windows. I have tried to run setup.py install on command prompt but it returned an error:
could not create 'C:\Program Files\Python...': access is denied.
Please, help.
Špela | how to install a python package to windows? | 0.379949 | 0 | 0 | 240 |
4,329,377 | 2010-12-01T21:32:00.000 | 2 | 0 | 0 | 0 | button,wxpython | 4,329,486 | 1 | true | 0 | 1 | I think I would catch the EVT_LEFT_DOWN and the EVT_LEFT_UP. Then start a wx.Timer to run your process on EVT_LEFT_DOWN until the EVT_LEFT_UP is fired. Alternatively, you could use a ToggleButton. | 1 | 1 | 0 | hey all,
im looking for a way of catching a button held down event in wxpython i cant seem to find anything. theres just wx.EVT_BUTTON which isnt quite what i want. i want my event to continue processing as long as the button is down. any help would be appreciated
thanks james | wxpython button held down event | 1.2 | 0 | 0 | 1,279 |
4,330,026 | 2010-12-01T23:01:00.000 | 3 | 0 | 1 | 0 | python | 4,330,042 | 5 | false | 0 | 0 | The simplest way is to remove the letter 'S' before you create the dictionary.
Use string.ascii_uppercase.replace('S', '') instead of string.ascii_uppercase. | 2 | 1 | 0 | I need to assign the uppercase to numbers in a dictionary but with one letter S not there.
ie.
in this alphadict = dict((x, i) for i, x in enumerate(string.ascii_uppercase)) I have currently all the alphabets of the dictionary.
What is the simplest way to delete the entry for S and shift rest of the values to the left... | Skip a letter in dictionary | 0.119427 | 0 | 0 | 209 |
4,330,026 | 2010-12-01T23:01:00.000 | 1 | 0 | 1 | 0 | python | 4,330,053 | 5 | false | 0 | 0 | alphadict = dict((x, i) for i, x in enumerate(string.ascii_uppercase) if x != 'S') | 2 | 1 | 0 | I need to assign the uppercase to numbers in a dictionary but with one letter S not there.
ie.
in this alphadict = dict((x, i) for i, x in enumerate(string.ascii_uppercase)) I have currently all the alphabets of the dictionary.
What is the simplest way to delete the entry for S and shift rest of the values to the left... | Skip a letter in dictionary | 0.039979 | 0 | 0 | 209 |
4,330,339 | 2010-12-01T23:52:00.000 | 0 | 0 | 0 | 0 | python,model,sqlalchemy,data-modeling | 4,330,995 | 3 | false | 0 | 0 | "I would specify the column names and some attributes, e.g, type, length, etc."
Isn't that the exact same thing as
"tediously typing in all these into an SQLAlchemy model.py file"?
If those two things aren't identical, please explain how they're different. | 1 | 5 | 0 | I am implementing a database model to store the 20+ fields of the iCal calendar format and am faced with tediously typing in all these into an SQLAlchemy model.py file. Is there a smarter approach? I am looking for a GUI or model designer that can create the model.py file for me. I would specify the column names and... | Is there any database model designer that can output SQLAlchemy models? | 0 | 1 | 0 | 2,698 |
4,330,580 | 2010-12-02T00:31:00.000 | 2 | 0 | 1 | 0 | python,unicode | 4,330,599 | 3 | false | 0 | 0 | The key to understanding unicode in python is that unicode means UNICODE. A unicode object is an idealized representation to the characters, not actual bytes. | 2 | 1 | 0 | I'm trying to figure out how to use the unicode support in python;
I would like to convert this string to unicode :
"ABCDE"
-->
"\x00A\x00B\x00C\x00D\x00E"
Any built-in functionnality can do that, or shall i use join() ?
Thanks ! | python unicode support | 0.132549 | 0 | 0 | 759 |
4,330,580 | 2010-12-02T00:31:00.000 | 0 | 0 | 1 | 0 | python,unicode | 9,630,913 | 3 | false | 0 | 0 | the str object should be firstly converted to unicode object by decode method.
then convert the unicode object to str object using encode method with character-encoding you want. | 2 | 1 | 0 | I'm trying to figure out how to use the unicode support in python;
I would like to convert this string to unicode :
"ABCDE"
-->
"\x00A\x00B\x00C\x00D\x00E"
Any built-in functionnality can do that, or shall i use join() ?
Thanks ! | python unicode support | 0 | 0 | 0 | 759 |
4,331,006 | 2010-12-02T02:03:00.000 | 0 | 0 | 1 | 0 | python,recursion,persistent | 4,331,026 | 6 | false | 0 | 0 | If the object you pass is mutable then changes to it in deeper recursions will be seen in earlier recursions. | 2 | 2 | 0 | I am trying to write a recursive function that needs to store and modify an object (say a set) as it recurses. Should I use a global name inside the function? Another option is to modify or inherit the class of the parameter of the function so that it can keep this persistent object but I don't find it elegant. I coul... | Persistent objects in recursive python functions | 0 | 0 | 0 | 6,862 |
4,331,006 | 2010-12-02T02:03:00.000 | 2 | 0 | 1 | 0 | python,recursion,persistent | 4,331,036 | 6 | false | 0 | 0 | Pass the set into the recursive method as an argument, then modify it there before passing it to the next step. Complex objects are passed by reference. | 2 | 2 | 0 | I am trying to write a recursive function that needs to store and modify an object (say a set) as it recurses. Should I use a global name inside the function? Another option is to modify or inherit the class of the parameter of the function so that it can keep this persistent object but I don't find it elegant. I coul... | Persistent objects in recursive python functions | 0.066568 | 0 | 0 | 6,862 |
4,331,894 | 2010-12-02T05:12:00.000 | 1 | 0 | 0 | 0 | php,.net,python,orm,xforms | 4,349,392 | 1 | false | 1 | 0 | To answer the question: no; not that I am aware of.
This being said, XForms doesn't much to do with ORM. With XRX, it can be seen as the opposite of ORM, the goal being to avoid mapping, and the complexity it creates. If you use the same data structure (XML in the case of XRX) to hold data all the way, from your UI, to... | 1 | 0 | 0 | There are literally dozens of XML, YAML, JSON, and nested array based (that whole convention over configuration thang) standards for describing : Database tables, Classes, Maps between Tables and Classes, Constraints, User Interface descriptions, Maps between Entities and User Interfaces, Rules for user Interfaces, etc... | Is the W3C or any standards body working on a single standard for Entity Attribute ORM definitions? | 0.197375 | 0 | 0 | 226 |
4,332,293 | 2010-12-02T06:26:00.000 | 0 | 1 | 0 | 1 | python,windows,apache,cgi,mime | 5,335,384 | 2 | true | 1 | 0 | Now I know how to solve this problem:
For windows+IIS:
While adding the application mapping(IIS), write C:\Python20\python.exe -u %s %s. I used to write like this c:\Python26\python.exe %s %s, that will create wrong mime data. And "-u" means unbuffered binary stdout and stderr.
For windows+Apache:
Add #!E:/program f... | 1 | 0 | 0 | I met a problem while using python(2.6) cgi to show a mime data in windows(apache).
For example, to show a image, here is my code:
image.py
#!E:/program files/Python26/python.exe
# -*- coding: UTF-8 -*-
data = open('logo.png','rb').read()
print 'Content-Type:image/png;Content-Disposition:attachment;filename=logo.png\n... | how to show mime data using python cgi in windows+apache | 1.2 | 0 | 0 | 381 |
4,333,359 | 2010-12-02T09:16:00.000 | 0 | 0 | 0 | 0 | python,image,label,tkinter | 4,334,872 | 1 | true | 0 | 1 | There is no built-in way to do what you want. Your own suggestions are good. Another option is to create a frame, and place separate image and label widgets in the frame. You then have complete control of the placement of the widgets | 1 | 0 | 0 | Is there a way to customize the horizontal padding between an image and text in a Label widget when compound=left or right?
The 2 ways I can think of are:
Use PIL to dynamically add columns of pixels to an image
Insert or append spaces to the text= option of the label to force the separation of image and text
What I'... | Python/Tkinter: Customize horizontal padding between image and text in Label widget? | 1.2 | 0 | 0 | 912 |
4,333,711 | 2010-12-02T10:05:00.000 | 2 | 0 | 0 | 0 | python,registration | 4,333,979 | 2 | true | 1 | 0 | I've found it useful to put a verification code in the database and use it as you've suggested. The same field can do double duty for e.g. password reset requests.
I also use an expiry timeout field, where registrations or password resets need to be dealt with by the user in a timely fashion. | 1 | 1 | 0 | I am going to let new users register on my service. Here is the way I think it should go:
1. User enters his email in a field and clicks Register button.
2. User receives a confirmation email with a link containing a verification code.
3. User goes by that link from the email message where he sees a message that his ac... | What is the best practice for registering a new user in my case? | 1.2 | 0 | 0 | 150 |
4,336,228 | 2010-12-02T14:47:00.000 | 4 | 1 | 1 | 0 | .net,python,ironpython,dynamic-language-runtime | 4,336,338 | 12 | false | 0 | 0 | I think the Iron family of languages is primarily for adding more flavours to the platform, allowing you to get into .NET using a language that you are familiar with. It lowers the bar a lot for getting new people with different backgrounds into .NET
Even though the syntax is Python, the implementation is still built o... | 8 | 29 | 0 | I have an affinity for python, but I work in a .NET environment, so I was looking into Iron Python, and wondering what it would be used for.
Could you write an app in it? or is it for adding a scripting language to your app?
How do you guys use it? | Iron Python : what are good uses for Iron Python | 0.066568 | 0 | 0 | 19,054 |
4,336,228 | 2010-12-02T14:47:00.000 | 1 | 1 | 1 | 0 | .net,python,ironpython,dynamic-language-runtime | 4,336,257 | 12 | false | 0 | 0 | You can write an app in it, you can use it as a scripting language in your app.
It's used for accessing existing Python libraries and, if needed, writing parts of your code in Python if a .NET languages doesn't seem well enough suited for that job. | 8 | 29 | 0 | I have an affinity for python, but I work in a .NET environment, so I was looking into Iron Python, and wondering what it would be used for.
Could you write an app in it? or is it for adding a scripting language to your app?
How do you guys use it? | Iron Python : what are good uses for Iron Python | 0.016665 | 0 | 0 | 19,054 |
4,336,228 | 2010-12-02T14:47:00.000 | 4 | 1 | 1 | 0 | .net,python,ironpython,dynamic-language-runtime | 4,336,253 | 12 | false | 0 | 0 | We use it as an embedded language inside of our software.
I had an article on my blog, but recently switched to a new system. You can find an archived version (with broken image links) here:
Our field engineers now use the embedded language to test things on the fly,
our quality assurance people use it to create small ... | 8 | 29 | 0 | I have an affinity for python, but I work in a .NET environment, so I was looking into Iron Python, and wondering what it would be used for.
Could you write an app in it? or is it for adding a scripting language to your app?
How do you guys use it? | Iron Python : what are good uses for Iron Python | 0.066568 | 0 | 0 | 19,054 |
4,336,228 | 2010-12-02T14:47:00.000 | 2 | 1 | 1 | 0 | .net,python,ironpython,dynamic-language-runtime | 4,336,268 | 12 | false | 0 | 0 | My experience of IronPython is usage it as part of engine that can be changed after installation of base .Net application.
With help of Python we have described really large set of business rules, that can be changed from two system installation. Partially IronPython was used as plugin language.
The difference from scr... | 8 | 29 | 0 | I have an affinity for python, but I work in a .NET environment, so I was looking into Iron Python, and wondering what it would be used for.
Could you write an app in it? or is it for adding a scripting language to your app?
How do you guys use it? | Iron Python : what are good uses for Iron Python | 0.033321 | 0 | 0 | 19,054 |
4,336,228 | 2010-12-02T14:47:00.000 | 31 | 1 | 1 | 0 | .net,python,ironpython,dynamic-language-runtime | 4,336,244 | 12 | true | 0 | 0 | Either or both :)
I wouldn't claim to know a specific "purpose" for IronPython but it certainly can be used to write applications, and it can be used for scripting within a larger .NET application.
Aside from anything else, it's a handy way of gently easing Python developers into the world of .NET. (Why not learn C# at... | 8 | 29 | 0 | I have an affinity for python, but I work in a .NET environment, so I was looking into Iron Python, and wondering what it would be used for.
Could you write an app in it? or is it for adding a scripting language to your app?
How do you guys use it? | Iron Python : what are good uses for Iron Python | 1.2 | 0 | 0 | 19,054 |
4,336,228 | 2010-12-02T14:47:00.000 | 2 | 1 | 1 | 0 | .net,python,ironpython,dynamic-language-runtime | 4,336,262 | 12 | false | 0 | 0 | You use it to write Python code that runs on the .NET platform. It's good for anything that Python is good for.
The Python language is the Python language, no matter what. IronPython is an implementation of the runtime for that language - the support code that compiles your source, creates a virtual machine to execute ... | 8 | 29 | 0 | I have an affinity for python, but I work in a .NET environment, so I was looking into Iron Python, and wondering what it would be used for.
Could you write an app in it? or is it for adding a scripting language to your app?
How do you guys use it? | Iron Python : what are good uses for Iron Python | 0.033321 | 0 | 0 | 19,054 |
4,336,228 | 2010-12-02T14:47:00.000 | 6 | 1 | 1 | 0 | .net,python,ironpython,dynamic-language-runtime | 4,336,304 | 12 | false | 0 | 0 | IronPython is just Yet Another Python Implementation. You can use it anywhere you would use any other Python implementation. (Modulo platform constraints, of course – obviously you can't use IronPython on a Java-only device.)
IronPython is just Yet Another .NET Compiler. You can use it anywhere you would use any other ... | 8 | 29 | 0 | I have an affinity for python, but I work in a .NET environment, so I was looking into Iron Python, and wondering what it would be used for.
Could you write an app in it? or is it for adding a scripting language to your app?
How do you guys use it? | Iron Python : what are good uses for Iron Python | 1 | 0 | 0 | 19,054 |
4,336,228 | 2010-12-02T14:47:00.000 | 1 | 1 | 1 | 0 | .net,python,ironpython,dynamic-language-runtime | 4,358,367 | 12 | false | 0 | 0 | You can use it for cool things like having an embedded web server within your application which can be developed with one of the available Python web frameworks. It is much easier and smoother to develop for than hosting an ASP.NET web server within your application. CherryPy for example comes with a builtin web server... | 8 | 29 | 0 | I have an affinity for python, but I work in a .NET environment, so I was looking into Iron Python, and wondering what it would be used for.
Could you write an app in it? or is it for adding a scripting language to your app?
How do you guys use it? | Iron Python : what are good uses for Iron Python | 0.016665 | 0 | 0 | 19,054 |
4,336,935 | 2010-12-02T15:56:00.000 | 2 | 0 | 0 | 0 | silverlight,silverlight-4.0,ironpython | 4,358,122 | 1 | true | 1 | 1 | You have to use binaries from IronPython-2.6.1\Silverlight\bin folder in Silverlight. | 1 | 3 | 0 | I am trying to integrate IronPython in my Silverlight application but am unable to do so. After downloading the binaries, every time I try to add the dlls as references in my VS2010 solution all I get is an error about them not being compiled for Silverlight. I have even tried downloading the source distribution, but c... | Ironpython 2.6.1 on Silverlight 4 | 1.2 | 0 | 0 | 127 |
4,337,736 | 2010-12-02T17:11:00.000 | 0 | 0 | 1 | 0 | python,data-structures,types | 4,338,035 | 4 | false | 0 | 0 | Include an example somewhere in your code, or in your tests. | 2 | 3 | 0 | I am quite new to python programming (C/C++ background).
I'm writing code where I need to use complex data structures like dictionaries of dictionaries of lists.
The issue is that when I must use these objects I barely remember their structure and so how to access them.
This makes it difficult to resume working on code... | Declaring types for complex data structures in python | 0 | 0 | 0 | 716 |
4,337,736 | 2010-12-02T17:11:00.000 | 1 | 0 | 1 | 0 | python,data-structures,types | 4,337,932 | 4 | false | 0 | 0 | I believe you should take a good look some of your complex structures, what you are doing with them, and ask... Is This Pythonic? Ask here on SO. I think you will find some cases where the complexity is an artifact of C/C++. | 2 | 3 | 0 | I am quite new to python programming (C/C++ background).
I'm writing code where I need to use complex data structures like dictionaries of dictionaries of lists.
The issue is that when I must use these objects I barely remember their structure and so how to access them.
This makes it difficult to resume working on code... | Declaring types for complex data structures in python | 0.049958 | 0 | 0 | 716 |
4,338,474 | 2010-12-02T18:30:00.000 | 2 | 0 | 1 | 0 | python,arrays,oop,object | 4,338,526 | 6 | true | 0 | 0 | No. The object could be inside everything and multiple objects at the same time, so it can't know unless you tell it. | 4 | 0 | 0 | Is there a way in Python for an object to 'know' what its array element id is? I.e 6 in an array, and the object itself prints out its own array element number, so '0,1,2,3,4,5' | Python Object awareness of being in an array? | 1.2 | 0 | 0 | 172 |
4,338,474 | 2010-12-02T18:30:00.000 | -1 | 0 | 1 | 0 | python,arrays,oop,object | 4,338,640 | 6 | false | 0 | 0 | If the object knows the list it is part of, it could find out by doing the_list.index(self). Otherwise, no. | 4 | 0 | 0 | Is there a way in Python for an object to 'know' what its array element id is? I.e 6 in an array, and the object itself prints out its own array element number, so '0,1,2,3,4,5' | Python Object awareness of being in an array? | -0.033321 | 0 | 0 | 172 |
4,338,474 | 2010-12-02T18:30:00.000 | 2 | 0 | 1 | 0 | python,arrays,oop,object | 4,338,520 | 6 | false | 0 | 0 | In a word, no... | 4 | 0 | 0 | Is there a way in Python for an object to 'know' what its array element id is? I.e 6 in an array, and the object itself prints out its own array element number, so '0,1,2,3,4,5' | Python Object awareness of being in an array? | 0.066568 | 0 | 0 | 172 |
4,338,474 | 2010-12-02T18:30:00.000 | 0 | 0 | 1 | 0 | python,arrays,oop,object | 4,338,679 | 6 | false | 0 | 0 | Not unless you tell it, and telling it leads to very annoying coupling and/or separation of responsibility problems. What are you really trying to do? | 4 | 0 | 0 | Is there a way in Python for an object to 'know' what its array element id is? I.e 6 in an array, and the object itself prints out its own array element number, so '0,1,2,3,4,5' | Python Object awareness of being in an array? | 0 | 0 | 0 | 172 |
4,339,325 | 2010-12-02T20:05:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine,bulkloader | 4,340,593 | 1 | true | 1 | 0 | Defining a custom conversion function, as you did, is the correct method. You don't have to modify transform.py, though - put the function in a file in your own app, and import it in the yaml file's python_preamble. | 1 | 1 | 0 | I have successfully used the bulkloader with my project before, but I recently added a new field to timestamp when the record was modified. This new field is giving me trouble, though, because it's defaulting to null. Short of manually inserting the timestamp in the csv before importing it, is there a way I can inser... | Generating a default value with the Google App Engine Bulkloader | 1.2 | 0 | 0 | 296 |
4,339,708 | 2010-12-02T20:51:00.000 | 4 | 0 | 1 | 0 | python | 4,339,741 | 1 | true | 0 | 0 | Try hasattr(). | 1 | 0 | 0 | I have an lxml object called item and it may have a child called item.brand, however it's possible that there is none as this is returned from an API. How can I check this in Python? | How can I see if a child exists in Python? | 1.2 | 0 | 1 | 706 |
4,339,745 | 2010-12-02T20:53:00.000 | 2 | 0 | 1 | 0 | python,scapy | 4,339,911 | 1 | true | 0 | 0 | got it , from the version v.2 onward the it should be used as from scapy.all import * | 1 | 1 | 0 | i am trying to use scapy in python
while i try to import the scapy import scapy
its just fine but the line scapy.ARP() causes a
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'ARP'
a dir(scapy) produces
'['__builtins__', '__doc__', '__file__', '__name__... | ARP missing from the module scapy | 1.2 | 0 | 0 | 1,937 |
4,340,873 | 2010-12-02T22:55:00.000 | 1 | 0 | 1 | 0 | python,python-3.x,python-2.6 | 4,340,917 | 12 | false | 0 | 0 | Yes you can. On my machine at least(Vista), v2 and v3 have completely separate idles allowing me to run whichever version I feel like when I feel like it. So go ahead and download v3. | 3 | 45 | 0 | I am reading How To Learn Python The Hard Way, which uses 2. Recently discovered Invent With Python, which uses 3.
Can I download python 3, and use it when I read Invent With Python, then switch back to python 2 when I want to read How To Learn Python The Hard Way. If so, how would I choose which version I use? | How do you switch between python 2 and 3, and vice versa? | 0.016665 | 0 | 0 | 97,645 |
4,340,873 | 2010-12-02T22:55:00.000 | 1 | 0 | 1 | 0 | python,python-3.x,python-2.6 | 43,423,351 | 12 | false | 0 | 0 | if you are using windows 10 and have python 2.x and 3.x.
open control panel > system and security > system
click advanced system settings.
click environment variables.
click path and edit and then make the path of python version you want to use above that you don't want to use [by click the moveu Up button]
restart ... | 3 | 45 | 0 | I am reading How To Learn Python The Hard Way, which uses 2. Recently discovered Invent With Python, which uses 3.
Can I download python 3, and use it when I read Invent With Python, then switch back to python 2 when I want to read How To Learn Python The Hard Way. If so, how would I choose which version I use? | How do you switch between python 2 and 3, and vice versa? | 0.016665 | 0 | 0 | 97,645 |
4,340,873 | 2010-12-02T22:55:00.000 | 1 | 0 | 1 | 0 | python,python-3.x,python-2.6 | 4,340,933 | 12 | false | 0 | 0 | A couple ways on *nix systems:
Install into separate directories (e.g. /usr/local/python2 and /usr/local/python3) and create a link (e.g. /usr/bin/python) which you change to point to whichever executable you want to use.
Same install as above, but set up separate python commands (e.g. /usr/bin/python2 and /usr/bin/py... | 3 | 45 | 0 | I am reading How To Learn Python The Hard Way, which uses 2. Recently discovered Invent With Python, which uses 3.
Can I download python 3, and use it when I read Invent With Python, then switch back to python 2 when I want to read How To Learn Python The Hard Way. If so, how would I choose which version I use? | How do you switch between python 2 and 3, and vice versa? | 0.016665 | 0 | 0 | 97,645 |
4,341,746 | 2010-12-03T01:41:00.000 | 1 | 0 | 1 | 0 | python,pylint | 48,765,416 | 13 | false | 0 | 1 | Python syntax does permit more than one statement on a line, separated by semicolon (;). However, limiting each line to one statement makes it easier for a human to follow a program's logic when reading through it.
So, another way of solving this issue, is to understand why the lint message is there and not put more th... | 1 | 346 | 0 | I'm trying to disable warning C0321 ("more than one statement on a single line" -- I often put if statements with short single-line results on the same line), in Pylint 0.21.1 (if it matters: astng 0.20.1, common 0.50.3, and Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)).
I've tried adding disable=C0321 in the Pylin... | How do I disable a Pylint warning? | 0.015383 | 0 | 0 | 404,539 |
4,342,176 | 2010-12-03T03:24:00.000 | 1 | 0 | 1 | 0 | python,string,list,serialization,dictionary | 4,342,203 | 9 | false | 0 | 0 | While not strictly serialization, json may be reasonable approach here. That will handled nested dicts and lists, and data as long as your data is "simple": strings, and basic numeric types. | 1 | 79 | 0 | How do I serialize a Python dictionary into a string, and then back to a dictionary? The dictionary will have lists and other dictionaries inside it. | How do I serialize a Python dictionary into a string, and then back to a dictionary? | 0.022219 | 0 | 0 | 138,127 |
4,343,014 | 2010-12-03T06:23:00.000 | 9 | 1 | 1 | 1 | c#,java,python,perl,programming-languages | 4,343,035 | 5 | false | 0 | 0 | As with a great many things in IT, the line is blurry. For example, C started its life as a systems programming language (and was used to implement Unix), but was and is used for applications development too.
Having said that, there are clearly some languages better suited to systems programming than others (eg. C/C++... | 5 | 13 | 0 | What are the differences between a systems programming language and Application programming language? | Difference between Systems programming language and Application programming languages | 1 | 0 | 0 | 13,401 |
4,343,014 | 2010-12-03T06:23:00.000 | 16 | 1 | 1 | 1 | c#,java,python,perl,programming-languages | 4,343,639 | 5 | true | 0 | 0 | A few factors should in my opinon come into consideration
In a system programming language you must be able to reach low-level stuff, getting close to the real hardware world. In an application language instead there is a sort of "virtual world" (hopefully nicer and easier to interact with) that has been designed with... | 5 | 13 | 0 | What are the differences between a systems programming language and Application programming language? | Difference between Systems programming language and Application programming languages | 1.2 | 0 | 0 | 13,401 |
4,343,014 | 2010-12-03T06:23:00.000 | 5 | 1 | 1 | 1 | c#,java,python,perl,programming-languages | 4,343,077 | 5 | false | 0 | 0 | These are not exact concepts, but in essence, systems programming languages are suitable for writing operating systems (so they have low-level concepts such as pointers, integration with assembler, data types corresponding to memory and register organization), while the application programming languages are more suitab... | 5 | 13 | 0 | What are the differences between a systems programming language and Application programming language? | Difference between Systems programming language and Application programming languages | 0.197375 | 0 | 0 | 13,401 |
4,343,014 | 2010-12-03T06:23:00.000 | 2 | 1 | 1 | 1 | c#,java,python,perl,programming-languages | 4,343,085 | 5 | false | 0 | 0 | In general, a systems programming language is lower level than applications programming languages. However, the language itself has nothing to do with it.. it's more the particulars of the implementation of the language.
For example, Pascal started life as a teaching language, and was pretty much strictly applications... | 5 | 13 | 0 | What are the differences between a systems programming language and Application programming language? | Difference between Systems programming language and Application programming languages | 0.07983 | 0 | 0 | 13,401 |
4,343,014 | 2010-12-03T06:23:00.000 | 2 | 1 | 1 | 1 | c#,java,python,perl,programming-languages | 4,350,156 | 5 | false | 0 | 0 | i don't think there is a final answer here anymore.
perl and python come by default with almost every linux distro...both can inline C...both can do job control and other "low level" tasks...threading etc.
any language with a good set of system call bindings and/or FFI should be as fundamentally system-aware as C or C... | 5 | 13 | 0 | What are the differences between a systems programming language and Application programming language? | Difference between Systems programming language and Application programming languages | 0.07983 | 0 | 0 | 13,401 |
4,343,575 | 2010-12-03T08:07:00.000 | 2 | 0 | 0 | 1 | python,networking,bonjour,zeroconf | 4,343,600 | 4 | false | 0 | 0 | Zeroconf/DNS-SD is an excellent idea in this case. It's provided by Bonjour on OS X and Windows (but must be installed separately or as part of an Apple product on Windows), and by Avahi on FOSS *nix. | 1 | 2 | 0 | My app opens a TCP socket and waits for data from other users on the network using the same application. At the same time, it can broadcast data to a specified host on the network.
Currently, I need to manually enter the IP of the destination host to be able to send data. I want to be able to find a list of all hosts ... | Proper way to publish and find services on a LAN using Python | 0.099668 | 0 | 1 | 1,210 |
4,344,017 | 2010-12-03T09:16:00.000 | 16 | 0 | 1 | 0 | python,concatenation,sequence,list-manipulation | 4,345,688 | 7 | false | 0 | 0 | Just to let you know:
When you write list1 + list2, you are calling the __add__ method of list1, which returns a new list. in this way you can also deal with myobject + list1 by adding the __add__ method to your personal class. | 3 | 699 | 0 | In Python, the only way I can find to concatenate two lists is list.extend, which modifies the first list. Is there any concatenation function that returns its result without modifying its arguments? | How can I get the concatenation of two lists in Python without modifying either one? | 1 | 0 | 0 | 909,604 |
4,344,017 | 2010-12-03T09:16:00.000 | 117 | 0 | 1 | 0 | python,concatenation,sequence,list-manipulation | 4,344,032 | 7 | false | 0 | 0 | concatenated_list = list_1 + list_2 | 3 | 699 | 0 | In Python, the only way I can find to concatenate two lists is list.extend, which modifies the first list. Is there any concatenation function that returns its result without modifying its arguments? | How can I get the concatenation of two lists in Python without modifying either one? | 1 | 0 | 0 | 909,604 |
4,344,017 | 2010-12-03T09:16:00.000 | 1,147 | 0 | 1 | 0 | python,concatenation,sequence,list-manipulation | 4,344,029 | 7 | true | 0 | 0 | Yes: list1 + list2. This gives a new list that is the concatenation of list1 and list2. | 3 | 699 | 0 | In Python, the only way I can find to concatenate two lists is list.extend, which modifies the first list. Is there any concatenation function that returns its result without modifying its arguments? | How can I get the concatenation of two lists in Python without modifying either one? | 1.2 | 0 | 0 | 909,604 |
4,345,337 | 2010-12-03T12:04:00.000 | 3 | 0 | 0 | 0 | python,python-imaging-library,imaging | 4,345,485 | 1 | true | 0 | 0 | You might want to look into converting your image to a numpy array, performing your quantisation, then converting back to PIL.
There are modules in numpy to convert to/from PIL images. | 1 | 4 | 1 | I would like to quantize a 24bit image to 16bit color depth using Python Imaging.
PIL used to provide a method im.quantize(colors, **options) however this has been deprecated for out = im.convert("P", palette=Image.ADAPTIVE, colors=256)
Unfortunately 256 is the MAXIMUM number of colors that im.convert() will quantize t... | Python Imaging, how to quantize an image to 16bit depth? | 1.2 | 0 | 0 | 4,447 |
4,346,318 | 2010-12-03T14:08:00.000 | 1 | 0 | 0 | 1 | python,django,profiling,memory-management,celery | 4,349,979 | 4 | false | 1 | 0 | The natural number of workers is close to the number of cores you have. The workers are there so that cpu-intensive tasks can use an entire core efficiently. The broker is there so that requests that don't have a worker on hand to process them are kept queued. The number of queues can be high, but that doesn't mean you... | 1 | 13 | 0 | We have ~300 celeryd processes running under Ubuntu 10.4 64-bit , in idle every process takes ~19mb RES, ~174mb VIRT, thus - it's around 6GB of RAM in idle for all processes.
In active state - process takes up to 100mb of RES and ~300mb VIRT
Every process uses minidom(xml files are < 500kb, simple structure) and urllib... | Celery - minimize memory consumption | 0.049958 | 0 | 0 | 19,420 |
4,348,061 | 2010-12-03T17:15:00.000 | 21 | 0 | 1 | 0 | python,json,urllib2 | 7,469,725 | 4 | false | 0 | 0 | For Python 3.x
Note the following
In Python 3.x the urllib and urllib2 modules have been combined. The module is named urllib. So, remember that urllib in Python 2.x and urllib in Python 3.x are DIFFERENT modules.
The POST data for urllib.request.Request in Python 3 does NOT accept a string (str) -- you have to pass a... | 1 | 16 | 0 | I want to use python urllib2 to simulate a login action, I use Fiddler to catch the packets and got that the login action is just an ajax request and the username and password is sent as json data, but I have no idea how to use urllib2 to send json data, help... | How to use python urllib2 to send json data for login | 1 | 0 | 1 | 32,746 |
4,348,658 | 2010-12-03T18:30:00.000 | 0 | 0 | 0 | 0 | python,sqlite | 4,348,768 | 3 | false | 0 | 0 | Just execute sqlite3 foo.db? This will permanently store everything you do afterwards in this file. (No need for .backup.) | 1 | 0 | 0 | I just downloaded sqlite3.exe. It opens up as a command prompt. I created a table test & inserted a few entries in it. I used .backup test just in case. After I exit the program using .exit and reopened it I don't find the table listed under .tables nor can I run any query on it.
I need to quickly run an open source py... | How to create tables in sqlite 3? | 0 | 1 | 0 | 2,598 |
4,348,660 | 2010-12-03T18:30:00.000 | 1 | 1 | 1 | 0 | python,file,compression | 4,348,705 | 2 | false | 0 | 0 | If you would like to learn more about how file compression works, the code is available right in the python source code in the file gzip.py. You should also check out the zlib source code, on which the gzip module is based.
You can get zlib source code from zlib.net. | 1 | 1 | 0 | python programmers,
I'm am new to python ,I read that we have built in functions to achieve file compression in python . I just wanted to know if a file compression can be done without using these built in functions (maybe a longer code perhaps) .I wanted to understand the working of these built in functions(how they a... | file compression without using built in functions | 0.099668 | 0 | 0 | 419 |
4,348,707 | 2010-12-03T18:37:00.000 | 1 | 0 | 0 | 0 | python,html | 4,348,712 | 2 | false | 1 | 0 | It will be a simple GET request, just like any other resource embedded in an HTML document.
If you really want to examine exactly what browsers send, then use something like Charles or the Net tab of Firebug. | 2 | 0 | 0 | I am iusing in my html. I am trying to handle the request on server side using python BaseHTTPServer. I want to figure out how the request from video tag looks like??? | is Video tag in html a POST request or GET request? | 0.099668 | 0 | 1 | 513 |
4,348,707 | 2010-12-03T18:37:00.000 | 0 | 0 | 0 | 0 | python,html | 4,348,815 | 2 | false | 1 | 0 | POST is usually reserved for form submissions because you are POSTing form information to the server. In this case you are just GETing the contents of a <video> source. | 2 | 0 | 0 | I am iusing in my html. I am trying to handle the request on server side using python BaseHTTPServer. I want to figure out how the request from video tag looks like??? | is Video tag in html a POST request or GET request? | 0 | 0 | 1 | 513 |
4,348,733 | 2010-12-03T18:41:00.000 | 2 | 0 | 0 | 0 | python,matplotlib | 4,348,902 | 7 | false | 0 | 0 | Good question. Here is the doc text from pylab.save:
pylab no longer provides a save function, though the old pylab
function is still available as matplotlib.mlab.save (you can still
refer to it in pylab as "mlab.save"). However, for plain text
files, we recommend numpy.savetxt. For saving numpy ar... | 1 | 144 | 1 | Is there a way to save a Matplotlib figure such that it can be re-opened and have typical interaction restored? (Like the .fig format in MATLAB?)
I find myself running the same scripts many times to generate these interactive figures. Or I'm sending my colleagues multiple static PNG files to show different aspects of a... | Saving interactive Matplotlib figures | 0.057081 | 0 | 0 | 98,342 |
4,349,714 | 2010-12-03T20:46:00.000 | 0 | 0 | 1 | 0 | python,class | 4,349,752 | 5 | false | 0 | 0 | You can organize it in whatever way makes the most sense for your application. I don't exactly know what you're doing so I can't be certain what the best organization would be for you, but you can pretty much split it up as you see fit and just import what you need.
You can define classes in any file, and you can defin... | 1 | 1 | 0 | I am doing some heavy commandline stuff (not really web based) and am new to Python, so I was wondering how to set up my files/folders/etc. Are there "header" files where I can keep all the DB connection stuff?
How/where do I define classes and objects? | How is a Python project set up? | 0 | 0 | 0 | 1,866 |
4,350,627 | 2010-12-03T22:53:00.000 | 3 | 1 | 1 | 1 | python,eclipse | 4,350,649 | 4 | false | 0 | 0 | I'd suggest using a version control system.
Git might be good for you - it doesn't require a central server and there is also support for Windows these days. | 2 | 3 | 0 | I'm currently in college, and we work in groups of three to create small python projects on a weekly basis.
We code with Eclipse and PyDev but we've got a problem when it comes to sharing our work. We end up sending an infinite stream of emails with compressed projects.
What we need is a way to keep the source code upd... | Code sharing between small student group | 0.148885 | 0 | 0 | 582 |
4,350,627 | 2010-12-03T22:53:00.000 | 1 | 1 | 1 | 1 | python,eclipse | 4,350,652 | 4 | false | 0 | 0 | What you need is a control version server (SVN for instance). You will be able to commit the changes and update the local version of your code to the current server version.
It is for free:
http://code.google.com/
You should set up your repo and share your work! :-)
I hope it helps. | 2 | 3 | 0 | I'm currently in college, and we work in groups of three to create small python projects on a weekly basis.
We code with Eclipse and PyDev but we've got a problem when it comes to sharing our work. We end up sending an infinite stream of emails with compressed projects.
What we need is a way to keep the source code upd... | Code sharing between small student group | 0.049958 | 0 | 0 | 582 |
4,350,879 | 2010-12-03T23:31:00.000 | 2 | 0 | 1 | 0 | python | 4,350,903 | 6 | false | 0 | 0 | 'man expand' for some info
it's in coreutils on Debian | 2 | 6 | 0 | I have some tab formatted code in python and I have some space formatted code in python.
Integrating the code in a pain... my editor wants to work in tabs or spaces, but not both.
Is there a command line function in linux or, well, anything which will convert python code formatting one way or the other? | converting white space in python files? | 0.066568 | 0 | 0 | 752 |
4,350,879 | 2010-12-03T23:31:00.000 | 0 | 0 | 1 | 0 | python | 4,351,098 | 6 | false | 0 | 0 | A good programmer's editor will have a command that converts tabs to spaces or vice/versa; you can also do it with search-and-replace in the editor. | 2 | 6 | 0 | I have some tab formatted code in python and I have some space formatted code in python.
Integrating the code in a pain... my editor wants to work in tabs or spaces, but not both.
Is there a command line function in linux or, well, anything which will convert python code formatting one way or the other? | converting white space in python files? | 0 | 0 | 0 | 752 |
4,351,048 | 2010-12-04T00:06:00.000 | 4 | 0 | 1 | 0 | python,unit-testing,cross-platform,temporary-files,ramdisk | 4,351,289 | 4 | false | 0 | 0 | Because file and directory-handling is so low-level and OS dependent, I doubt anything like what you want exists (or is even possible). Your best bet might be to implement a "virtual" file-system-like set of functions, classes, and methods that keep track of the files and directory-hierarchy created and their content. ... | 2 | 47 | 0 | I want to create a ramdisk in Python. I want to be able to do this in a cross-platform way, so it'll work on Windows XP-to-7, Mac, and Linux. I want to be able to read/write to the ramdisk like it's a normal drive, preferably with a drive letter/path.
The reason I want this is to write tests for a script that creates a... | How can I create a ramdisk in Python? | 0.197375 | 0 | 0 | 21,157 |
4,351,048 | 2010-12-04T00:06:00.000 | 1 | 0 | 1 | 0 | python,unit-testing,cross-platform,temporary-files,ramdisk | 4,351,325 | 4 | false | 0 | 0 | One option might be to inject (monkey patch) modified versions of the methods used in the os module as well as the builtins open and file that write to StringIO files instead of to disk. Obviously this substitution should only occur for the module being tested; | 2 | 47 | 0 | I want to create a ramdisk in Python. I want to be able to do this in a cross-platform way, so it'll work on Windows XP-to-7, Mac, and Linux. I want to be able to read/write to the ramdisk like it's a normal drive, preferably with a drive letter/path.
The reason I want this is to write tests for a script that creates a... | How can I create a ramdisk in Python? | 0.049958 | 0 | 0 | 21,157 |
4,353,019 | 2010-12-04T10:08:00.000 | 1 | 0 | 1 | 0 | python,image,compression,python-imaging-library | 4,353,063 | 4 | false | 0 | 0 | a) change the size: Image.resize(size, filter) b) explicitly convert it to JPEG (if it is not) and set the desired quality. c) use a combination of a) and b)
Whatever you do, there is a trade-off between size and quality. | 1 | 8 | 0 | I want to degrade the quality of the image to a few kilobytes.
What's the best way to do this?
Thanks! | In Python's PIL, how do I change the quality of an image? | 0.049958 | 0 | 0 | 11,769 |
4,353,491 | 2010-12-04T12:29:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine,cookies | 4,368,390 | 2 | false | 1 | 0 | As mentioned above gaeutilties provides sessions support. If that's what you're looking for overall you may want to check it out.
However, also to answer your question. Cookies set persist between requests, you don't need to keep resetting it unless you the expiration extremely low. If you do not set an expiration the... | 1 | 1 | 0 | I want to set some value to cookie when user visits the homepage so that when he hits some url I'll get that value and compare it with what I've stored in db. Now do I have to set the same cookie value again to handle the next request(in order to maintain session).
I'm using python on GAE and I couldn't find any sessio... | Need some help on Cookie Handling and session in python | 0.099668 | 0 | 0 | 383 |
4,354,647 | 2010-12-04T16:58:00.000 | 4 | 0 | 0 | 1 | python,google-app-engine | 4,355,054 | 1 | true | 1 | 0 | No.
However, you could get the desired behavior if you write your own deployment script. This script could be a thin wrapper around appcfg.py which makes a request to your app once the deployment is complete (the request handler can execute the logic you wanted to put in your "deploy hook"). | 1 | 5 | 0 | I want to increase the version number on a model whenever there is a new deployment to the server.
So the idea behind this is: Everytime there is a deployment I wanna run some code.
Is this possible within App Engine using hooks or events?
I'm using App Engine for Python. | Does app engine have a Deploy Hook or Event? | 1.2 | 0 | 0 | 525 |
4,354,894 | 2010-12-04T17:47:00.000 | 1 | 0 | 1 | 0 | python,macos,mp3,decode | 4,354,935 | 4 | true | 0 | 0 | I did try an easy_install of PyMedia on OS X / Fink, and it did not work because it could not find the source. This module does look quite dead…
One way of decoding MP3 is to call ffmpeg without going through pyffmpeg, but by calling ffmpeg using the standard subprocess module instead. | 1 | 7 | 0 | I need to decode an MP3 file with Python. What is a good library which can do that?
I looked at PyMedia but the project seems dead and it didn't worked on MacOSX. Then I found out about pyffmpeg but I didn't got it working on MacOSX so far.
Any suggestion? | Python: decode mp3 | 1.2 | 0 | 0 | 4,285 |
4,354,963 | 2010-12-04T18:00:00.000 | 0 | 0 | 0 | 0 | python,audio,midi | 4,355,275 | 4 | false | 0 | 0 | Is using Jython an option ?
I think the javax.sound.midi classes would handle this. | 1 | 10 | 0 | I need convert/synthesize MIDI data to audio stream PCM data. What would be an easy way to do so? | Python: midi to audio stream | 0 | 0 | 0 | 7,115 |
4,355,435 | 2010-12-04T19:41:00.000 | 0 | 0 | 0 | 0 | python,excel | 4,355,455 | 4 | false | 0 | 0 | The easiest way would be to run excel up under Wine or as a VM and do it from Windows. You can use Mark Hammond's COM bindings, which come bundled with ActiveState Python. Alternatively, you could export the data in CSV format and read it from that. | 1 | 3 | 0 | I have some (Excel 2000) workbooks. I want to extract the data in each worksheet to a separate file.
I am running on Linux.
Is there a library I can use to access (read) XLS files on Linux from Python? | Cross platform way to read Excel files in Python? | 0 | 1 | 0 | 2,104 |
4,355,909 | 2010-12-04T21:24:00.000 | 0 | 0 | 0 | 0 | python,mysql,ruby-on-rails,nosql | 4,357,332 | 3 | false | 1 | 0 | The NoSQL effort has to do with creating a persistence layer that scales with modern applications using non-normalized data structures for fast reads & writes and data formats like JSON, the standard format used by ajax based systems. It is sometimes the case that transaction based relational databases do not scale wel... | 3 | 0 | 0 | With the rise of NoSQL, is it more common these days to have a webapp without any model and process everything in the controller? Is this a bad pattern in web development? Why should we abstract our database related function in a model when it is easy enough to fetch the data in nosql?
Note
I am not asking whether RDBM... | With the rise of NoSQL, Is it more common these days to have a webapp without any model? | 0 | 1 | 0 | 210 |
4,355,909 | 2010-12-04T21:24:00.000 | 0 | 0 | 0 | 0 | python,mysql,ruby-on-rails,nosql | 4,355,924 | 3 | false | 1 | 0 | SQL databases are still the order of the day. But it's becoming more common to use unstructured stores. NoSQL databases are well suited for some web apps, but not necessarily all of them. | 3 | 0 | 0 | With the rise of NoSQL, is it more common these days to have a webapp without any model and process everything in the controller? Is this a bad pattern in web development? Why should we abstract our database related function in a model when it is easy enough to fetch the data in nosql?
Note
I am not asking whether RDBM... | With the rise of NoSQL, Is it more common these days to have a webapp without any model? | 0 | 1 | 0 | 210 |
4,355,909 | 2010-12-04T21:24:00.000 | 4 | 0 | 0 | 0 | python,mysql,ruby-on-rails,nosql | 4,355,976 | 3 | true | 1 | 0 | I don't think "NoSQL" has anything to do with "no model".
For one, MVC originated in the Smalltalk world for desktop applications, long before the current web server architecture (or even the web itself) existed. Most apps I've written have used MVC (including the M), even those that didn't use a DBMS (R or otherwise)... | 3 | 0 | 0 | With the rise of NoSQL, is it more common these days to have a webapp without any model and process everything in the controller? Is this a bad pattern in web development? Why should we abstract our database related function in a model when it is easy enough to fetch the data in nosql?
Note
I am not asking whether RDBM... | With the rise of NoSQL, Is it more common these days to have a webapp without any model? | 1.2 | 1 | 0 | 210 |
4,356,234 | 2010-12-04T22:43:00.000 | 1 | 0 | 0 | 1 | python,django,user-interface,login | 4,361,550 | 2 | false | 1 | 0 | Django auth also provide generic views for login/logout etc. You can use build-in templates or expand it.
See in documentation for generic views: django.contrib.auth.views.login, django.contrib.auth.views.logout | 1 | 0 | 0 | i love gae(google app engine),because it is easy to create a user interface for user login and signup,
but now , my boss want me to create a site use django ,
so the first is to create a site that someone can be login ,
which is the esaist way to create a user interface ?
thanks | how to create a user interface that a user can signup and login using django | 0.099668 | 0 | 0 | 888 |
4,356,293 | 2010-12-04T22:56:00.000 | 1 | 0 | 1 | 1 | python,shared-libraries,compiled | 5,087,086 | 2 | true | 0 | 0 | bbfreeze will put everything in a single executable. | 1 | 3 | 0 | I am using cx_freeze to compile my python script and when I compile the program, all the files are placed in one specified folder. The executable wont run if the shared libs are not within the same directory.
How would I set it up so the executable looks within /usr/lib/PROGRAMNAME/ to run the libraries? | Cx_freeze - How can I Install the shared libraries to /usr/lib | 1.2 | 0 | 0 | 700 |
4,356,776 | 2010-12-05T00:56:00.000 | 9 | 1 | 0 | 0 | python,google-app-engine,email | 4,356,783 | 1 | true | 1 | 0 | Put a hash in the URL that uniquely identifies the address you sent it to. | 1 | 2 | 0 | I am working with Google App Engine python version. The app sends an
email to the user with a link to a page to upload an image as an
avatar. It would be nice to have the email so that I can associate the
avatar with that email. How can I get the email of the person who just clicked the link? Thank you. | How do I get the email address of the person who clicked the link in the email? | 1.2 | 0 | 0 | 1,324 |
4,357,176 | 2010-12-05T03:16:00.000 | 6 | 0 | 0 | 0 | c#,asp.net,python,django | 4,357,364 | 3 | true | 1 | 0 | I've been an ASP.NET programmer for a few years, and I think it's pretty easy to get into. The downsides here are that Microsoft products (TFS in particular) are expensive. Of course, my experiences have been directly related to that -- I've never tried Python in any regard -- so I can only offer my perspectives as an ... | 2 | 5 | 0 | Hello I am interested in hearing objective responses in what should a beginner dedicate his or her time into:
ASP.NET, Visual Studio, C#, IIS, Team Foundation Server?
or
Python, Django, PyCharm?
These are just some criteria that I am interested in:
Easy to start out with.
Good documentation.
Highly-scalable.
Big Care... | New to web development. ASP.NET or Django? | 1.2 | 0 | 0 | 12,666 |
4,357,176 | 2010-12-05T03:16:00.000 | 16 | 0 | 0 | 0 | c#,asp.net,python,django | 4,357,372 | 3 | false | 1 | 0 | C# or java will pay the bills, python will be way more fun | 2 | 5 | 0 | Hello I am interested in hearing objective responses in what should a beginner dedicate his or her time into:
ASP.NET, Visual Studio, C#, IIS, Team Foundation Server?
or
Python, Django, PyCharm?
These are just some criteria that I am interested in:
Easy to start out with.
Good documentation.
Highly-scalable.
Big Care... | New to web development. ASP.NET or Django? | 1 | 0 | 0 | 12,666 |
4,357,841 | 2010-12-05T07:35:00.000 | 4 | 0 | 1 | 0 | python | 4,357,850 | 3 | false | 0 | 0 | Use zip: [x + y for x, y in zip(list1, list2)]. | 1 | 0 | 0 | I have 2 lists :
list1 contains "T" "F" "T" "T"
list2 contains "a" "b" "c" "d"
I want to create a third list such that I append element1 in list1 to element1 in list2.
So list3 would be the following: "Ta" "Fb" "Tc" "Td"
How can i do that? | appending a string to another string | 0.26052 | 0 | 0 | 135 |
4,358,179 | 2010-12-05T09:35:00.000 | 1 | 0 | 1 | 0 | python,ide,enthought | 4,358,228 | 2 | true | 0 | 0 | Any reason why such an IDE does not
make sense?
Most people who use Python don't use the Enthought tool suite, so there's not enough interest to create a project (or demand for a company to sell a product).
I know that's not what you want to hear, so here's a few options:
Find a bunch of smart people who also like ... | 1 | 0 | 0 | Has anybody come across an Enthought TraitsUI (Envisage etc) based Python IDE?
I wonder why there is none, when Enthought Tool Suite makes it so easy to create extensible python GUI applications.
One reason I can think of, why such an IDE makes a lot of sense, is because it will be cross platform.
Any reason why such... | Enthought TraitsUI based Python IDE | 1.2 | 0 | 0 | 717 |
4,358,701 | 2010-12-05T12:12:00.000 | 0 | 0 | 1 | 0 | python | 4,358,722 | 5 | false | 0 | 0 | Use glob to find the filenames, slice the strings, and use os.rename() to rename them. | 1 | 5 | 0 | I wanted to know what is the easiest way to rename multiple files using re module in python if at all it is possible.
In my directory their are 25 files all with the file names in the format ' A unique name followed by 20 same characters.mkv '
What I wanted was to delete all the 20 characters.
How can I do this using ... | Renaming multiple files in python | 0 | 0 | 0 | 9,424 |
4,360,407 | 2010-12-05T18:24:00.000 | 1 | 0 | 0 | 0 | python,sqlite | 4,360,475 | 2 | true | 1 | 0 | I could be wrong, but I think there is no definite answer to this question. It depends on "language" level your framework provides. For example, if another parts of the framework accept data in non-canonical form and then convert it to an internal canonical form, it this case it would worth to support some input date f... | 2 | 0 | 0 | When committing data that has originally come from a webpage, sometimes data has to be converted to a data type or format which is suitable for the back-end database. For instance, a date in 'dd/mm/yyyy' format needs to be converted to a Python date-object or 'yyyy-mm-dd' in order to be stored in a SQLite date column ... | Framework design question | 1.2 | 1 | 0 | 75 |
4,360,407 | 2010-12-05T18:24:00.000 | 2 | 0 | 0 | 0 | python,sqlite | 4,360,452 | 2 | false | 1 | 0 | I think it belongs in the validation. You want a date, but the web page inputs strings only, so the validator needs to check if the value van be converted to a date, and from that point on your application should process it like a date. | 2 | 0 | 0 | When committing data that has originally come from a webpage, sometimes data has to be converted to a data type or format which is suitable for the back-end database. For instance, a date in 'dd/mm/yyyy' format needs to be converted to a Python date-object or 'yyyy-mm-dd' in order to be stored in a SQLite date column ... | Framework design question | 0.197375 | 1 | 0 | 75 |
4,362,721 | 2010-12-06T02:37:00.000 | 5 | 0 | 0 | 0 | python,http | 4,362,770 | 1 | true | 0 | 0 | Assuming that the server is sending the response body size in the Content-Length response header field, you can do it yourself.
First, call Http.request(method="HEAD") to retrieve only the headers and not the body. Then inspect the Content-Length field of the response to see if it is below your threshold. If it is, mak... | 1 | 4 | 0 | Is it possible to limit the response size with httplib2? For instance if it sees an HTTP body over X bytes the connection will just close without consuming more bandwidth. Or perhaps only download the first X bytes of a file. | Limiting response size with httplib2 | 1.2 | 0 | 1 | 720 |
4,362,902 | 2010-12-06T03:20:00.000 | 2 | 0 | 1 | 0 | python,django,django-templates | 4,366,241 | 4 | false | 1 | 0 | Don't forget that you aren't limited to Django's template language. You're free to use whatever templating system you like in your view functions. However you want to create the HTML to return from your view function is fine. There are many templating implementations in the Python world: choose one that suits you be... | 3 | 9 | 0 | I mean I understand that these templates are aimed at designers and other less code-savvy people, but for developers I feel the template language is just a hassle. I need to re-learn how to do very simple things like iterate through dictionaries or lists that I pass into the template, and it doesn't even seem to work v... | Why don't django templates just use python code? | 0.099668 | 0 | 0 | 594 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.