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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,630,142 | 2011-10-03T00:23:00.000 | 1 | 0 | 0 | 0 | python,excel,ms-access | 7,636,416 | 5 | false | 0 | 0 | Another idea - how important is the formatting part? If you can ditch the formatting, you can output your data as CSV. Excel can open CSV files, and the CSV format is much simpler then the Excel format - it's so simple you can write it directly from Python like a text file, and that way you won't need to mess with Offi... | 2 | 2 | 0 | I've been spending the better part of the weekend trying to figure out the best way to transfer data from an MS Access table into an Excel sheet using Python. I've found a few modules that may help (execsql, python-excel), but with my limited knowledge and the modules I have to use to create certain data (I'm a GIS pro... | Copy data from MS Access to MS Excel using Python | 0.039979 | 1 | 0 | 4,767 |
7,630,142 | 2011-10-03T00:23:00.000 | 1 | 0 | 0 | 0 | python,excel,ms-access | 7,630,189 | 5 | false | 0 | 0 | The best approach might be to not use Python for this task.
You could use the macro recorder in Excel to record the import of the External data into Excel.
After starting the macro recorder click Data -> Get External Data -> New Database Query and enter your criteria. Once the data import is complete you can look at t... | 2 | 2 | 0 | I've been spending the better part of the weekend trying to figure out the best way to transfer data from an MS Access table into an Excel sheet using Python. I've found a few modules that may help (execsql, python-excel), but with my limited knowledge and the modules I have to use to create certain data (I'm a GIS pro... | Copy data from MS Access to MS Excel using Python | 0.039979 | 1 | 0 | 4,767 |
7,630,251 | 2011-10-03T00:55:00.000 | 0 | 0 | 1 | 0 | python,streaming,gstreamer,multimedia,gnonlin | 7,918,968 | 1 | false | 0 | 0 | Yes, gnonlin compositions work on one media type at a time. Audio and Video are treated separately. | 1 | 0 | 0 | I've been messing around with Gstreamer and Gnonlin lately, I've been concatenating segments of video files but when I dynamically connect the src pad on the composition, I can choose either the audio or video portion of the files, producing silent playback or videoless audio. How can I attach my composition to an audi... | Play audio and video with gnonlin | 0 | 0 | 0 | 230 |
7,630,548 | 2011-10-03T02:17:00.000 | 1 | 0 | 0 | 1 | python,audio,stream,gstreamer | 7,634,531 | 1 | false | 1 | 0 | You might want to look at Flumotion (www.flumotion.org). It is a python based streaming server using GStreamer, you might be able to get implementation ideas from that in terms of how you do your application. It relies heavily on the python library Twisted for its network handling. | 1 | 2 | 0 | I'm working on an audio mixing program (DAW) web app, and considering using Python and Python Gstreamer for the backend. I understand that I can contain the audio tracks of a single music project in a gst.Pipeline bin, but playback also appears to be controlled by this Pipeline.
Is it possible to create several "views... | Can Gstreamer be used server-side to stream audio to multiple clients on demand? | 0.197375 | 0 | 0 | 1,045 |
7,631,929 | 2011-10-03T07:02:00.000 | 3 | 0 | 1 | 0 | python,data-structures | 7,631,961 | 5 | false | 0 | 0 | The difference is that if the key is missing, d[key] will raise a KeyError exception, whereas d.get(key) will return None (and d.get(key, default) will return a default value).
There are no noticeable differences in memory requirements. | 3 | 24 | 0 | While Using Python Dictionary DataStructure (which contains key-value pair) if i want to retrieve some value from my Dictionary i have two options d[''] and g.get('key') so i am confused now which is better and Why ?? I understand both some way but when it comes to memory consumption and evaluation in memory which one... | Python Dictionary DataStructure which method d[] or d.get()? | 0.119427 | 0 | 0 | 15,626 |
7,631,929 | 2011-10-03T07:02:00.000 | 4 | 0 | 1 | 0 | python,data-structures | 7,631,979 | 5 | false | 0 | 0 | If 'key' does not exist in the dictionary,
d['key']
will throw a KeyError, while
d.get('key')
will return None. | 3 | 24 | 0 | While Using Python Dictionary DataStructure (which contains key-value pair) if i want to retrieve some value from my Dictionary i have two options d[''] and g.get('key') so i am confused now which is better and Why ?? I understand both some way but when it comes to memory consumption and evaluation in memory which one... | Python Dictionary DataStructure which method d[] or d.get()? | 0.158649 | 0 | 0 | 15,626 |
7,631,929 | 2011-10-03T07:02:00.000 | 0 | 0 | 1 | 0 | python,data-structures | 7,632,000 | 5 | false | 0 | 0 | They both behave the same if the key exists. But if the key is not found d['key'] will raise a KeyError exception, whereas d.get('key') will return None. You can also supply a second argument to the get method which will be returned on a not-found condition: d.get('key', '') will return a null string if the key is not ... | 3 | 24 | 0 | While Using Python Dictionary DataStructure (which contains key-value pair) if i want to retrieve some value from my Dictionary i have two options d[''] and g.get('key') so i am confused now which is better and Why ?? I understand both some way but when it comes to memory consumption and evaluation in memory which one... | Python Dictionary DataStructure which method d[] or d.get()? | 0 | 0 | 0 | 15,626 |
7,632,642 | 2011-10-03T08:27:00.000 | 0 | 1 | 0 | 1 | python,windows,python-3.x,serial-port,automated-tests | 7,712,917 | 3 | false | 0 | 0 | I was also able to solve this using WScript, but pySerial was the preferred solution. | 1 | 2 | 0 | I am testing a piece of hardware which hosts an ftp server. I connect to the server in order to configure the hardware in question.
My test environment is written in Python 3.
To start the ftp server, I need to launch a special proprietary terminal application on my pc. I must use this software as far as I know and I h... | Control rs232 windows terminal program from python | 0 | 0 | 0 | 1,707 |
7,635,456 | 2011-10-03T13:12:00.000 | 1 | 1 | 0 | 0 | python | 7,635,473 | 3 | false | 0 | 0 | Store a timestamp in each object - update the timestamp to the current time whenever you modify it.
Then have something that runs every so often, looks at all of the objects, and removes any with a timestamp earlier than a certain amount before the current time. | 1 | 4 | 0 | In my script I read messages from socket and change the state of some objects in memory depending on the content in message. Everything works fine.
But I want to implement deletion of non-active objects: for example, if there's no message for specified object during some time, it should be deleted. What is the best way... | How to track an objects state in time? | 0.066568 | 0 | 0 | 204 |
7,636,732 | 2011-10-03T14:56:00.000 | 2 | 0 | 0 | 0 | python,android-widget,android,sl4a | 13,672,739 | 4 | true | 0 | 1 | Personally I wrote a google app engine app in python to collect and display the data, and then used an app called "meta widget" that allows you to turn a website's content into a widget. The app pulls the content from my GAE website and shows it in a widget on the android homescreen.
You might be able to do something c... | 1 | 3 | 0 | Is there any way to make widgets with Python on Android?
I mean, that I know only Python, HTML, DOM, JS, maybe jQuery and nothing more (not C, Java or something).
Maybe it's simple?
I honestly searched stackoverflow but search returned no answers :(
Help me, please. Give me a hope. | How to make android widgets using python? | 1.2 | 0 | 0 | 4,546 |
7,636,806 | 2011-10-03T15:02:00.000 | 3 | 0 | 0 | 1 | python,google-app-engine,google-cloud-datastore | 7,637,063 | 1 | true | 1 | 0 | This will test key existence without returning an entity:
db.Query(keys_only=True).filter('__key__ =', test_key).count(1) == 1
I'm not certain that it's computationally cheaper than fetching the entity. | 1 | 2 | 0 | I am currently testing a small application I have written. I have not been sufficiently careful in ensuring the data in my datastore is consistent and now I have an issue that I have some records referencing objects which no longer exist. More specifially, I have some objects which have ReferenceProperty's which have b... | How can I test the validity of a ReferenceProperty in Appengine? | 1.2 | 0 | 0 | 199 |
7,637,199 | 2011-10-03T15:36:00.000 | 2 | 0 | 0 | 0 | python,qt,user-interface,pyqt | 7,637,393 | 2 | true | 0 | 1 | You might want to look at matplotlib, which is probably the most widely used library for doing graphs, including 3-D. | 1 | 2 | 0 | I have a project where I have to show some sort of changing bar graph with results from a function. This bar graph should be in colour and 3d. I want it to look good since it's an open source educational program where it teaches the user about different voting systems and how they effect the outcome of an election. I w... | Picking a suitable GUI framework for project | 1.2 | 0 | 0 | 228 |
7,637,671 | 2011-10-03T16:15:00.000 | 2 | 0 | 0 | 0 | python,osx-lion,pycharm | 7,645,408 | 2 | false | 0 | 0 | esc-ctrl-b works for me, but alt-b doesn't. It's right there in the emacs keymap, so it's strange at first, but I think the problem is that alt-b is mapped to a character (∫ rather than ß in my case) so PyCharm doesn't see it as a key-modifier pair, just a single character.
Switching to a different international keybo... | 1 | 6 | 0 | I am trying to use the emacs keybindings in Pycharm 1.5 in OS X 10.7. They all work except that ALT+B inserts a beta symbol rather than moving back a word. It's puzzling since ALT+F does correctly move forward a word.
Also, I was wondering if Pycharm has support for moving between matching parentheses or brackets, lik... | Using the emacs bindings in pycharm in OS X Lion | 0.197375 | 0 | 0 | 2,519 |
7,637,789 | 2011-10-03T16:25:00.000 | 6 | 0 | 1 | 0 | python,haml,pug | 20,442,720 | 4 | false | 1 | 0 | I really love jade. Pyjade made it possible to use jade in some python project with jinja or django.
But I have to say that pyjade is not 100% compatible with jade.
For example, ternary operator is not supported in pyjade. You can use some python syntax to do the same thing, But that will make the template only can be ... | 1 | 18 | 0 | Are there any template engines for Python with a syntax similar to Jade or HAML? | HAML or Jade template syntax available for Python? | 1 | 0 | 0 | 7,585 |
7,638,109 | 2011-10-03T16:51:00.000 | 1 | 0 | 1 | 1 | python,windows-7,easy-install | 7,638,140 | 1 | false | 0 | 0 | This error:
bad local file header
seems to say that the file header (which usually determines the filetype) isn't passing Python's test. It could be the zipping program you used.
Try 7-Zip (free) or a different program when creating your egg. I haven't made them before, but I think there is even a way to do it with p... | 1 | 0 | 0 | I have created two eggs using bdist and egg_A is defines as a dependency of egg_B.
I check both egg using the command unzip and both are ok, however when I try to insall the egg using easy_install I get the following stack trace :
Installed c:\virtualenv\lib\site-packages\pymarketdata-1.0-py2.7.egg
Reading file:C:/pyt... | easy_install failure on windows 7 | 0.197375 | 0 | 0 | 541 |
7,638,787 | 2011-10-03T17:59:00.000 | 0 | 1 | 1 | 0 | python,unicode,localization,fonts | 7,638,836 | 2 | false | 0 | 0 | Use utf-8 text and a font that has glyphs for every possible character defined, like Arial/Verdana in Windows. That bypasses the entire detection problem. One font will handle everything. | 2 | 1 | 0 | For a program of mine I have a database full of street name (using GIS stuff) in unicode. The user selects any part of the world he wants to see (using openstreetmap, google maps or whatever) and my program displays every streets selected using a nice font to show their names. As you may know not every font can display... | How to detect the right font to use depending on the langage | 0 | 0 | 0 | 210 |
7,638,787 | 2011-10-03T17:59:00.000 | 0 | 1 | 1 | 0 | python,unicode,localization,fonts | 7,684,888 | 2 | true | 0 | 0 | You need information about the language of the text.
And when you decide what fonts you want, you do a mapping from language to font.
If you try to do it automatically, it does not work. The fonts for Japanese, Chinese Traditional, and Chinese Simplified look differently even for the same character. They might be intel... | 2 | 1 | 0 | For a program of mine I have a database full of street name (using GIS stuff) in unicode. The user selects any part of the world he wants to see (using openstreetmap, google maps or whatever) and my program displays every streets selected using a nice font to show their names. As you may know not every font can display... | How to detect the right font to use depending on the langage | 1.2 | 0 | 0 | 210 |
7,639,141 | 2011-10-03T18:33:00.000 | 3 | 1 | 0 | 1 | python,c,django,freebsd | 7,639,481 | 3 | false | 0 | 0 | The correct thing is called privilege separation: clearly identify minimal set of tasks which have to be done on elevated privileges. Write a separate daemon and an as much limited as possible way of communicating the task to do. Run this daemon as another user with elevated privileges. A bit more work, but also more s... | 1 | 13 | 0 | I have a quick one off task in a python script that I'd like to call from Django (www user), that's going to need to root privileges.
At first I thought I would could use Python's os.seteuid() and set the setuid bit on the script, but then I realized that I would have to set the setuid bit on Python itself, which I as... | Execute Python Script as Root (seteuid vs c-wrapper) | 0.197375 | 0 | 0 | 4,966 |
7,639,483 | 2011-10-03T19:06:00.000 | 2 | 0 | 0 | 0 | c#,python,ruby,perl,x509 | 7,641,318 | 3 | false | 0 | 0 | I'd use OpenSSL or a direct wrapper around the library like Ruby's openssl library.
OpenSSL is a very powerful and trusted toolkit -- and it has the additional advantage that you can call it the same way from any scripting language. Using the OpenSSL commandline tools, you have the advantage that you can interact with... | 1 | 6 | 0 | I'm looking for a library/module/package with which I could create and sign X.509 certificates, with the ability to conditionally add custom v3 extensions – which can be fairly complicated; for example, this bletchful OpenSSL.cnf snippet used by Kerberos PKINIT, just to represent foo@EXAMPLE.ORG:
[v3_extensions]
s... | X.509 libraries | 0.132549 | 0 | 0 | 1,206 |
7,641,481 | 2011-10-03T22:39:00.000 | 1 | 0 | 0 | 1 | python | 7,641,519 | 2 | true | 0 | 0 | NFS mount the filesystem, then both systems can access the same files as if they were local. Otherwise you could use sockets. | 1 | 0 | 0 | I am trying to move a log file from a computer, where an operation is performed, to another computer, that will get the log file and process it, returning a document with the result of the analysis.
I am using Python for the job, but I am open to other options (I have to run this copy via console on OSX, due the fact t... | how to copy a file between 2 computers on the network in python | 1.2 | 0 | 0 | 2,350 |
7,641,916 | 2011-10-03T23:47:00.000 | 1 | 0 | 1 | 0 | python,user-interface | 7,641,967 | 2 | false | 0 | 0 | How do you create a go back to this point command?
You don't. Programming structure - in Python and in other programming languages - really doesn't work this way. You need to think about the problem differently.
You can create loops (that can be nested, and that can be broken out of), and you can remember some kind of... | 1 | 0 | 0 | I'm new to coding with python and did not know what header to search up my problem in python.
My question is: How do you create a go back to this point command? You know, like in menus where you open a tab and don't want to be there, so you press Back.
Also, whenever I search it up I always find questions or explanatio... | How do you create a "go back to this point" code in Python? | 0.099668 | 0 | 0 | 954 |
7,642,309 | 2011-10-04T01:02:00.000 | 0 | 0 | 1 | 0 | python,sockets,irc | 7,642,402 | 2 | false | 0 | 0 | Stream-mode sockets (e.g, TCP) never guarantee that you'll receive messages in any sort of neatly framed format. If you receive partial lines of input -- which will inevitably happen sometimes -- you need to hold onto the partial line until the rest of the line shows up.
Using Twisted will save you a lot of time. Bette... | 1 | 1 | 0 | So I'm working on a Python IRC framework, and I'm using Python's socket module. Do I feel like using Twisted? No, not really.
Anyway, I have an infinite loop reading and processing data from socket.recv(xxxx), where xxxx is really irrelevant in this situation. I split the received data into messages using str.split(... | Issues with Python socket module | 0 | 0 | 1 | 195 |
7,643,579 | 2011-10-04T05:19:00.000 | 8 | 0 | 1 | 0 | python | 7,643,592 | 2 | false | 0 | 0 | Python's print feature does not convert tabs to spaces - it outputs a literal tab. The way it appears depends on what program you use to view it. | 2 | 12 | 0 | Is it possible to redefine the space width of a tab when printing a \t character in python? | Modify the width of a tab in a format string | 1 | 0 | 0 | 14,290 |
7,643,579 | 2011-10-04T05:19:00.000 | 18 | 0 | 1 | 0 | python | 7,644,193 | 2 | true | 0 | 0 | Try pydoc string.expandtabs, I think it will do what you want. | 2 | 12 | 0 | Is it possible to redefine the space width of a tab when printing a \t character in python? | Modify the width of a tab in a format string | 1.2 | 0 | 0 | 14,290 |
7,643,809 | 2011-10-04T05:55:00.000 | 0 | 0 | 1 | 0 | python,printing | 61,394,290 | 6 | false | 0 | 0 | To see all the installed modules you can use the following command in python interpreter.help("modules"). It will show all the installed modules.If you are looking for inbuilt functions like print use the command help(__builtins__) in python shell. | 2 | 5 | 0 | What are the default modules in Python which are automatically imported when Python compiler is launched?
These are, for example, print, addition, and other mathematical functions.
They must be defined somewhere in Python
I had guessed that we can extract this information by finding (for example from where print funct... | What are default modules in python (which are imported when we run Python as for example "print") | 0 | 0 | 0 | 12,188 |
7,643,809 | 2011-10-04T05:55:00.000 | 1 | 0 | 1 | 0 | python,printing | 7,644,270 | 6 | false | 0 | 0 | The __builtins__ module contains the print function, as well as many other functions and classes. In a shell, help(__builtins__) will give you an almost absurdly-detailed list of functions, classes, and those classes functions. Using dir(__builtins__) may be more useful, as it simply returns a list of the names of th... | 2 | 5 | 0 | What are the default modules in Python which are automatically imported when Python compiler is launched?
These are, for example, print, addition, and other mathematical functions.
They must be defined somewhere in Python
I had guessed that we can extract this information by finding (for example from where print funct... | What are default modules in python (which are imported when we run Python as for example "print") | 0.033321 | 0 | 0 | 12,188 |
7,650,348 | 2011-10-04T15:30:00.000 | 1 | 0 | 0 | 0 | python,com,pyqt,pywin | 10,190,909 | 1 | false | 0 | 1 | Your software is built from three different parts:
The program core - what actually does the stuff.
The GUI - in this case built in pyqt.
The COM server - one more UI that has nothing to do with 2.
Let the COM client do its thing. The output can be doing stuff and updating the GUI interface.
What I am saying is that ... | 1 | 2 | 0 | I want to create an application in PYTHON with graphical interface (using pyqt), with a COM automation server.
So that COM clients could call this app using COM, and this would result in events in the main gui window. But I'm not sure how to integrate pyqt (signals/slots) to COM automation server (using pywin). | Using COM automation server and PyQt | 0.197375 | 0 | 0 | 441 |
7,653,276 | 2011-10-04T19:51:00.000 | 3 | 0 | 1 | 0 | python,multithreading,web-crawler,web-mining | 11,539,776 | 5 | false | 0 | 0 | Around 2 years ago i have developed a crawler. And it can download almost 250urls per second. You could flow my steps.
Optimize your file pointer use. Try to use minimal file pointer.
Don't write your data every time. Try to dump your data after
storing around 5000 url or 10000 url.
For your robustness you don't need ... | 1 | 8 | 0 | I'd like to do perform data mining on a large scale. For this, I need a fast crawler. All I need is something to download a web page, extract links and follow them recursively, but without visiting the same url twice. Basically, I want to avoid looping.
I already wrote a crawler in python, but it's too slow. I'm not ab... | Fast internet crawler | 0.119427 | 0 | 1 | 7,297 |
7,654,267 | 2011-10-04T21:29:00.000 | 25 | 0 | 1 | 0 | python,eclipse,pydev,code-formatting,indentation | 10,854,068 | 10 | false | 0 | 0 | If you want to change from 2 space to 4 space indentation (for instance), use "Source->Convert space to tab" with 2 spaces, then "Soruce->Convert tab to space" with 4 spaces. | 7 | 18 | 0 | I'm a newbie in eclipse. I want to indent all the lines of my code and formatting the open file by pressing a shortcut or something like that...
I know the CTRL+SHIFT+F (as it actually doesn't work in pydev!!)
I've been searching for hours with no success. Is there any way to do that in eclipse. kind of like CTRL+K,D i... | indent python file (with pydev) in eclipse | 1 | 0 | 0 | 29,114 |
7,654,267 | 2011-10-04T21:29:00.000 | 14 | 0 | 1 | 0 | python,eclipse,pydev,code-formatting,indentation | 25,383,536 | 10 | false | 0 | 0 | It is much easier:
Select multiple lines
Press Tab to indent (move right), Shift + Tab to unindent (move left) all selected
lines. | 7 | 18 | 0 | I'm a newbie in eclipse. I want to indent all the lines of my code and formatting the open file by pressing a shortcut or something like that...
I know the CTRL+SHIFT+F (as it actually doesn't work in pydev!!)
I've been searching for hours with no success. Is there any way to do that in eclipse. kind of like CTRL+K,D i... | indent python file (with pydev) in eclipse | 1 | 0 | 0 | 29,114 |
7,654,267 | 2011-10-04T21:29:00.000 | 16 | 0 | 1 | 0 | python,eclipse,pydev,code-formatting,indentation | 10,738,859 | 10 | false | 0 | 0 | Although auto-indentation is not a feature of PyDev because of the language design you should be able to indent with a simple tab. Just select the lines you want to indent and press Tab. If you want to unindent lines you have to press Shift+Tab.
Thats all. | 7 | 18 | 0 | I'm a newbie in eclipse. I want to indent all the lines of my code and formatting the open file by pressing a shortcut or something like that...
I know the CTRL+SHIFT+F (as it actually doesn't work in pydev!!)
I've been searching for hours with no success. Is there any way to do that in eclipse. kind of like CTRL+K,D i... | indent python file (with pydev) in eclipse | 1 | 0 | 0 | 29,114 |
7,654,267 | 2011-10-04T21:29:00.000 | 1 | 0 | 1 | 0 | python,eclipse,pydev,code-formatting,indentation | 10,686,933 | 10 | false | 0 | 0 | I think that what you're looking for is some kind of shortcut in Eclipse/PyDev so that the selected code can be idented all at once. Just like when you create a new "if" or a "for" loop above a block of code and then need to rearrange the identation. The IDLE Editor has the "Ctrl + ]" shortcut that works exactly that w... | 7 | 18 | 0 | I'm a newbie in eclipse. I want to indent all the lines of my code and formatting the open file by pressing a shortcut or something like that...
I know the CTRL+SHIFT+F (as it actually doesn't work in pydev!!)
I've been searching for hours with no success. Is there any way to do that in eclipse. kind of like CTRL+K,D i... | indent python file (with pydev) in eclipse | 0.019997 | 0 | 0 | 29,114 |
7,654,267 | 2011-10-04T21:29:00.000 | 1 | 0 | 1 | 0 | python,eclipse,pydev,code-formatting,indentation | 28,980,902 | 10 | false | 0 | 0 | One can also select the lines, right click, then shift right / shift left | 7 | 18 | 0 | I'm a newbie in eclipse. I want to indent all the lines of my code and formatting the open file by pressing a shortcut or something like that...
I know the CTRL+SHIFT+F (as it actually doesn't work in pydev!!)
I've been searching for hours with no success. Is there any way to do that in eclipse. kind of like CTRL+K,D i... | indent python file (with pydev) in eclipse | 0.019997 | 0 | 0 | 29,114 |
7,654,267 | 2011-10-04T21:29:00.000 | 2 | 0 | 1 | 0 | python,eclipse,pydev,code-formatting,indentation | 13,011,600 | 10 | false | 0 | 0 | Obviously this is only for Pydev, but I've worked out that you can get the very useful functions "Shift Right" and "Shift Left" (mapped by default to CTRL + ALT + . and CTRL + ALT + ,) to become useful by changing their keybindings to "Pydev Editor Scope" from "Pydev View". This effectively indents/dedents all lines t... | 7 | 18 | 0 | I'm a newbie in eclipse. I want to indent all the lines of my code and formatting the open file by pressing a shortcut or something like that...
I know the CTRL+SHIFT+F (as it actually doesn't work in pydev!!)
I've been searching for hours with no success. Is there any way to do that in eclipse. kind of like CTRL+K,D i... | indent python file (with pydev) in eclipse | 0.039979 | 0 | 0 | 29,114 |
7,654,267 | 2011-10-04T21:29:00.000 | 0 | 0 | 1 | 0 | python,eclipse,pydev,code-formatting,indentation | 44,596,375 | 10 | false | 0 | 0 | Like earlier said python requires to indent your code, so for other things like: space between variables passed as arguments to methods, etc., one can use ctrl+shift+f to format the code. This what is used for java, I tried for pydev and does some formatting. | 7 | 18 | 0 | I'm a newbie in eclipse. I want to indent all the lines of my code and formatting the open file by pressing a shortcut or something like that...
I know the CTRL+SHIFT+F (as it actually doesn't work in pydev!!)
I've been searching for hours with no success. Is there any way to do that in eclipse. kind of like CTRL+K,D i... | indent python file (with pydev) in eclipse | 0 | 0 | 0 | 29,114 |
7,654,316 | 2011-10-04T21:34:00.000 | 1 | 0 | 1 | 1 | python,macos,build,cross-compiling,distutils | 13,315,980 | 2 | false | 0 | 0 | I found the solution, go into your /System/Library/Frameworks/Python.framework/Versions/2.7/lib/distutils/sysconfig.py
Goto line 408 that says "raise DistutilsPlatformError" and add a '#' to comment out that line of code... This will "unleash the python"
You are basically telling python "don't worry its not 10.7, I kno... | 1 | 3 | 0 | I am attempting to build a python application with binary modules on OS X. I want to build versions for Snow Leopard and Leopard from Lion. I have XCode 4 installed with the 10.5 and 10.6 sdks and have been attempting to build using the MACOSX_DEPLOYMENT_TARGET flag set to 10.6. I receive an error from distutils com... | Building binary python distributions for multiple OS X versions | 0.099668 | 0 | 0 | 1,843 |
7,655,020 | 2011-10-04T23:03:00.000 | 0 | 0 | 0 | 0 | .net,python,mathgl | 7,697,434 | 2 | true | 0 | 0 | I ended up calling the Matlab runtime functions. MatPlotLib also works well, but would require IronPython for interop between .NET and Python. | 2 | 0 | 0 | As in the subject - if I would like to create a publication ready graph from .NET, is this possible? | Is it possible to call MathGL functions from .NET? | 1.2 | 0 | 0 | 328 |
7,655,020 | 2011-10-04T23:03:00.000 | 0 | 0 | 0 | 0 | .net,python,mathgl | 16,375,530 | 2 | false | 0 | 0 | I think it is possible. You just need to use C functions of MathGL from .NET. | 2 | 0 | 0 | As in the subject - if I would like to create a publication ready graph from .NET, is this possible? | Is it possible to call MathGL functions from .NET? | 0 | 0 | 0 | 328 |
7,655,323 | 2011-10-04T23:56:00.000 | 1 | 0 | 1 | 0 | python,matplotlib | 7,673,206 | 1 | true | 0 | 0 | There is no simple way to reuse plot windows if you must use eclipse to run it. When I am working interactively with matplotlib, I use either spyder or ipython. Edit class, reload class, and run code again. If you just want to get rid of all the open plot windows, hit the stacked stop icons to kill all your runing py... | 1 | 3 | 1 | I am using matplotlib.pyplot (with Eclipse on Windows). Every time I run my code it opens several pyplot figure windows.
The problem is that if I don't close those windows manually they accumulate. I would like to use pyplot to find those windows (opened by another process of python.exe) and re-use them. In other word... | Pyplot/Matplotlib: How to access figures opened by another interpreter? | 1.2 | 0 | 0 | 302 |
7,657,457 | 2011-10-05T06:27:00.000 | 0 | 0 | 1 | 0 | python,dictionary,key | 35,837,521 | 4 | false | 0 | 0 | Building a opposite dictionary is not at all good manner as one or more key have same value but if you invert it you need to insert key:[value1,... ] structure which will lead you to another problem. | 2 | 15 | 0 | Fairly new to Python, still struggling with so much information.
All the documentation I've seen about dictionaries explain various ways of getting a value via a key - but I'm looking for a pythonic way to do the opposite - get a key via a value.
I know I can loop through the keys and inspect their values until I find... | Finding key from value in Python dictionary: | 0 | 0 | 0 | 44,782 |
7,657,457 | 2011-10-05T06:27:00.000 | 6 | 0 | 1 | 0 | python,dictionary,key | 7,657,479 | 4 | false | 0 | 0 | Since your dictionary can contain duplicate values (i.e. {'a': 'A', 'b': 'A'}), the only way to find a key from value is to iterate over the dictionary as you describe.
Or... build the opposite dictionary. you have to recreate it after each modification of the original dictionary.
Or... write a class that maintains bot... | 2 | 15 | 0 | Fairly new to Python, still struggling with so much information.
All the documentation I've seen about dictionaries explain various ways of getting a value via a key - but I'm looking for a pythonic way to do the opposite - get a key via a value.
I know I can loop through the keys and inspect their values until I find... | Finding key from value in Python dictionary: | 1 | 0 | 0 | 44,782 |
7,657,937 | 2011-10-05T07:21:00.000 | 3 | 0 | 1 | 0 | python,virtualenv,pip | 7,660,908 | 1 | true | 0 | 0 | Check which pip you are actually running (which pip), also try running pip -E path-to-your-env install .... | 1 | 3 | 0 | I installed virtualenv and created a virtual environment called ENV1.
Then I activated the environment by running 'source bin/activate'. I am sure the virtual environment is activated because the command prompt has changed, reflecting the new environment.
Then from that command prompt, I ran 'pip install lpthw.web'. I ... | Installing a package in Python virtualenv still causes it to be installed globally | 1.2 | 0 | 0 | 373 |
7,658,513 | 2011-10-05T08:21:00.000 | 0 | 0 | 0 | 0 | python | 70,290,332 | 6 | false | 0 | 0 | If you trying to write to the columns in the for loop and getting this error, then re-initalize the column to 0 while iterating. | 2 | 14 | 0 | I am importing text files into excel using xlwt module. But it allows only 256 columns to be stored. Are there any ways to solve this problem? | Python - Xlwt more than 256 columns | 0 | 1 | 0 | 18,626 |
7,658,513 | 2011-10-05T08:21:00.000 | 1 | 0 | 0 | 0 | python | 7,658,627 | 6 | false | 0 | 0 | Is that a statement of fact or should xlwt support more than 256 columns? What error do you get? What does your code look like?
If it truly does have a 256 column limit, just write your data in a csv-file using the appropriate python module and import the file into Excel. | 2 | 14 | 0 | I am importing text files into excel using xlwt module. But it allows only 256 columns to be stored. Are there any ways to solve this problem? | Python - Xlwt more than 256 columns | 0.033321 | 1 | 0 | 18,626 |
7,659,246 | 2011-10-05T09:31:00.000 | 1 | 0 | 0 | 0 | python,database,asynchronous,rabbitmq,celery | 7,780,116 | 1 | true | 0 | 0 | For write intensive operation like Counters and Logs NoSQL solution are always the best choice. Personally I use a mongoDB for this kind of tasks. | 1 | 0 | 0 | I'm using Python with Celery and RabbitMQ to make a web spider to count the number of links on a page.
Can a database, such as MySQL, be written into asynchronously? Is it OK to commit the changes after every row added, or is it required to batch them (multi-add) and then commit after a certain number of rows/duration... | Python Celery Save Results in Database Asynchronously | 1.2 | 1 | 0 | 728 |
7,660,059 | 2011-10-05T10:42:00.000 | 11 | 1 | 0 | 1 | python,google-app-engine,oauth,openid,facebook-authentication | 7,662,946 | 1 | true | 1 | 0 | In my research on this question I found that there are essentially three options:
Use Google's authentication mechanisms (including their federated login via OpenID)
Pros:
You can easily check who is logged in via the Users service provided with Appengine
Google handles the security so you can be quite sure it's wel... | 1 | 6 | 0 | [This question is intended as a means to both capture my findings and sanity check them - I'll put up my answer toute suite and see what other answers and comments appear.]
I spent a little time trying to get my head around the different social authentication options for (python) Appengine. I was particularly confused ... | What are the different options for social authentication on Appengine - how do they compare? | 1.2 | 0 | 0 | 552 |
7,660,231 | 2011-10-05T10:57:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine | 7,661,286 | 3 | true | 1 | 0 | You need to measure but for all intended purposes the results should be that its about the same speed.
If any method tend to be faster I don't really think its going to impact you overall performance that much.
Your main latency will be the RPC call to the memache which might be two factor slower then the slowest seria... | 1 | 0 | 0 | I have page handler with 95% traffic, it fetches model from DB using its key and then uses fields in the fetched model to fill a django template.
I want to memcache the fetched model so as to avoid DB reads. Not all fields of the model are used in template so i want to cache it with just the required feilds so as to i... | App Engine memcache speed "dict" vs "Class Object" | 1.2 | 0 | 0 | 409 |
7,662,383 | 2011-10-05T13:52:00.000 | 1 | 0 | 1 | 0 | python,list | 7,663,488 | 10 | false | 0 | 0 | with a = [1,2,3] :
a[2:3] is [3]
a[3:4] is [ ]
So a[i:i+1] != [ ] tells if is an index of a
a[i:] does the same, but a[i:] creates another list, possible very long, while a[i:i+1] is 1 element if not empty | 2 | 8 | 0 | If have a list, say a=[1,2,3], and I want to see if a[4] is null, is there a way to do that, without using an exception or assertion? | How to check if end of list was reached? | 0.019997 | 0 | 0 | 51,736 |
7,662,383 | 2011-10-05T13:52:00.000 | 1 | 0 | 1 | 0 | python,list | 7,662,460 | 10 | false | 0 | 0 | The general way to check if you're currently looking at the element at the end of a list (in any language) is to compare the current index you're looking at with the length of the list minus one (since indexes start at 0).
a[4] isn't really anything, because it doesn't exist - some languages may implement that as being... | 2 | 8 | 0 | If have a list, say a=[1,2,3], and I want to see if a[4] is null, is there a way to do that, without using an exception or assertion? | How to check if end of list was reached? | 0.019997 | 0 | 0 | 51,736 |
7,665,486 | 2011-10-05T17:52:00.000 | 1 | 0 | 0 | 0 | python,excel,formula,xlwt,xlrd | 7,667,880 | 4 | false | 0 | 0 | As of now, xlrd doesn't read formulas. It's not that it evaluates them, it simply doesn't read them.
For now, your best bet is to programmatically control a running instance of Excel, either via pywin32 or Visual Basic or VBScript (or some other Microsoft-friendly language which has a COM interface). If you can't run... | 1 | 0 | 0 | I am trying to edit several excel files (.xls) without changing the rest of the sheet. The only thing close so far that I've found is the xlrd, xlwt, and xlutils modules. The problem with these is it seems that xlrd evaluates formulae when reading, then puts the answer as the value of the cell. Does anybody know of a w... | Is there any way to edit an existing Excel file using Python preserving formulae? | 0.049958 | 1 | 0 | 8,902 |
7,666,944 | 2011-10-05T19:54:00.000 | 0 | 0 | 0 | 0 | python,database,firebird | 7,670,749 | 3 | false | 0 | 0 | I think we need a bit more info.
Do you want database access - as in "I want to be able to edit table layout and define new tables, views, procedures and so on" ?
Or do you only need to get data from the database using python ?
The latter could be achieved by installing a Firebird client (in essence its a dll (fbclient... | 2 | 0 | 0 | I have a Firebird DB set up on my computer and I want to be able to retrieve data from a different computer. What is the best way to go about this?
I am running windows and using python. | Best way to access Firebird DB from a remote desktop. | 0 | 0 | 0 | 2,775 |
7,666,944 | 2011-10-05T19:54:00.000 | 0 | 0 | 0 | 0 | python,database,firebird | 7,670,479 | 3 | false | 0 | 0 | Run Firebird server on the computer with database file and connect to it from remote computer. You will need in Firebird client library installed on remote computer. | 2 | 0 | 0 | I have a Firebird DB set up on my computer and I want to be able to retrieve data from a different computer. What is the best way to go about this?
I am running windows and using python. | Best way to access Firebird DB from a remote desktop. | 0 | 0 | 0 | 2,775 |
7,668,822 | 2011-10-05T23:11:00.000 | 4 | 0 | 0 | 0 | python,postgresql,psycopg2 | 7,668,912 | 1 | true | 0 | 0 | The PostgreSQL interval type isn't really what you're looking for -- it's specifically intended for storing an arbitrary length of time, ranging anywhere from a microsecond to a few million years. An interval has no starting or ending point; it's just a measure of "how long".
If you're specifically after storing which ... | 1 | 0 | 0 | I'm using postgresql and python and I need to store data group by week of the year. So, there's plenty alternatives:
week and year in two separated fields
a date pointing to the start of the week (or a random day of the week)
And, the one I like: an interval type.
I never use it, but reading the docs, seems to fit. B... | psycopg2: interval type for storing weeks | 1.2 | 1 | 0 | 661 |
7,668,850 | 2011-10-05T23:15:00.000 | 1 | 1 | 1 | 0 | c++,python,gdb,core-file | 7,669,126 | 1 | false | 0 | 0 | You need to compile a version of Python with debugging symbols. You can do this by building Python with ./configure --with-pydebug. Hopefully you will be able to find the error that way.
That will change the behavior of Python internally in some ways. If you don't still get the segfault that way, you might try running ... | 1 | 3 | 0 | I have a test that runs a python script, which calls into C++ code, where it segfaults and dumps core. I've tried to load the core file in GDB using /usr/bin/python2.6, but this just gives me ?? for all the items in the stack trace. How do I debug this core file? | Debugging a segmentation fault in C++ code called from Python | 0.197375 | 0 | 0 | 473 |
7,669,434 | 2011-10-06T01:15:00.000 | 2 | 0 | 0 | 0 | python,postgresql,pgdb | 7,670,330 | 2 | false | 0 | 0 | I suggest using psycopg2 instead of pgdb. pgdb uses the following semantics:
connect() -> open database connection, begin transaction
commit() -> commit, begin transaction
rollback() -> rollback, begin transaction
execute() -> execute statement
psycopg2, on the other hand, uses the following semantics:
connect() -> ... | 2 | 2 | 0 | I'm writing a script to access data in an established database and unfortunately, I'm breaking the DB. I'm able to recreate the issue from the command line:
[user@box tmp]# python
Python 2.7.2 (default, Sep 19 2011, 15:02:41)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright",... | python pgdb hanging database | 0.197375 | 1 | 0 | 1,471 |
7,669,434 | 2011-10-06T01:15:00.000 | 2 | 0 | 0 | 0 | python,postgresql,pgdb | 7,669,476 | 2 | true | 0 | 0 | Try calling db.rollback() before you close the cursor (or if you're doing a write operation, db.commit()). | 2 | 2 | 0 | I'm writing a script to access data in an established database and unfortunately, I'm breaking the DB. I'm able to recreate the issue from the command line:
[user@box tmp]# python
Python 2.7.2 (default, Sep 19 2011, 15:02:41)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright",... | python pgdb hanging database | 1.2 | 1 | 0 | 1,471 |
7,670,303 | 2011-10-06T04:29:00.000 | 13 | 1 | 1 | 1 | python,scripting | 7,720,640 | 7 | false | 0 | 0 | This line helps find the program executable that will run the script. This shebang notation is fairly standard across most scripting languages (at least as used on grown-up operating systems).
An important aspect of this line is specifying which interpreter will be used. On many development-centered Linux distributions... | 4 | 221 | 0 | I have noticed this in a couple of scripting languages, but in this example, I am using python. In many tutorials, they would start with #!/usr/bin/python3 on the first line. I don't understand why we have this.
Shouldn't the operating system know it's a python script (obviously it's installed since you are making a r... | Purpose of #!/usr/bin/python3 shebang | 1 | 0 | 0 | 273,899 |
7,670,303 | 2011-10-06T04:29:00.000 | 7 | 1 | 1 | 1 | python,scripting | 7,670,323 | 7 | false | 0 | 0 | And this line is how.
It is ignored.
It will fail to run, and should be changed to point to the proper location. Or env should be used.
It will fail to run, and probably fail to run under a different version regardless. | 4 | 221 | 0 | I have noticed this in a couple of scripting languages, but in this example, I am using python. In many tutorials, they would start with #!/usr/bin/python3 on the first line. I don't understand why we have this.
Shouldn't the operating system know it's a python script (obviously it's installed since you are making a r... | Purpose of #!/usr/bin/python3 shebang | 1 | 0 | 0 | 273,899 |
7,670,303 | 2011-10-06T04:29:00.000 | 3 | 1 | 1 | 1 | python,scripting | 52,982,676 | 7 | false | 0 | 0 | Actually the determination of what type of file a file is very complicated, so now the operating system can't just know. It can make lots of guesses based on -
extension
UTI
MIME
But the command line doesn't bother with all that, because it runs on a limited backwards compatible layer, from when that fancy nonsense ... | 4 | 221 | 0 | I have noticed this in a couple of scripting languages, but in this example, I am using python. In many tutorials, they would start with #!/usr/bin/python3 on the first line. I don't understand why we have this.
Shouldn't the operating system know it's a python script (obviously it's installed since you are making a r... | Purpose of #!/usr/bin/python3 shebang | 0.085505 | 0 | 0 | 273,899 |
7,670,303 | 2011-10-06T04:29:00.000 | 28 | 1 | 1 | 1 | python,scripting | 7,670,334 | 7 | false | 0 | 0 | That's called a hash-bang. If you run the script from the shell, it will inspect the first line to figure out what program should be started to interpret the script.
A non Unix based OS will use its own rules for figuring out how to run the script. Windows for example will use the filename extension and the # will caus... | 4 | 221 | 0 | I have noticed this in a couple of scripting languages, but in this example, I am using python. In many tutorials, they would start with #!/usr/bin/python3 on the first line. I don't understand why we have this.
Shouldn't the operating system know it's a python script (obviously it's installed since you are making a r... | Purpose of #!/usr/bin/python3 shebang | 1 | 0 | 0 | 273,899 |
7,671,348 | 2011-10-06T07:30:00.000 | 3 | 0 | 1 | 0 | python,package,main,demo,convention | 7,671,369 | 2 | false | 0 | 0 | I've never seen any real convention for this, but I personally put it in a main sentinel within __init__.py so that it can be invoked via python -m somepackage. | 2 | 5 | 0 | I am coding a new python package to be used by others. To demonstrate how it should be used, I am writing a demo script that executes the main parts of the new package.
What is the convention for doing this, so that other will find the script easily? Should it be a separate module (by what name)? Should it be located ... | Where should I place a Python package's demo script? | 0.291313 | 0 | 0 | 348 |
7,671,348 | 2011-10-06T07:30:00.000 | 4 | 0 | 1 | 0 | python,package,main,demo,convention | 7,672,997 | 2 | false | 0 | 0 | Should it be a separate module (by what name)?
demo/some_useful_name.py
A demo directory contains demo scripts. Similarly, a test directory contains all your unit tests.
Should it be located in the package's root directory?
No. It's not part of the package. It's a demo.
Out of the package?
Yes.
In init.py?
... | 2 | 5 | 0 | I am coding a new python package to be used by others. To demonstrate how it should be used, I am writing a demo script that executes the main parts of the new package.
What is the convention for doing this, so that other will find the script easily? Should it be a separate module (by what name)? Should it be located ... | Where should I place a Python package's demo script? | 0.379949 | 0 | 0 | 348 |
7,671,375 | 2011-10-06T07:34:00.000 | 0 | 0 | 0 | 1 | python,windows,process,taskmanager | 7,680,857 | 1 | false | 0 | 0 | Hopefully you aren't giving "public" general users administrative privileges. Don't give the public account permission to close your script. Then you just run your script from a different user account than the account the general public can use. | 1 | 0 | 0 | I want to run a python script for several days, performing a huge database calculation, on a "public" windows computer in my work place.
Since this task is important, I want to prevent closing it from the task manager.
Is it possible to protect a python script from being closed by the task manager (windows xp)? If it... | How can I keep Task Manager from killing my pythonw script? | 0 | 0 | 0 | 734 |
7,672,569 | 2011-10-06T09:40:00.000 | 4 | 0 | 0 | 0 | python,postgresql,inheritance,sqlalchemy | 7,675,115 | 2 | false | 0 | 0 | Welcome to Stack Overflow: in the future, if you have more than one question; you should provide a separate post for each. Feel free to link them together if it might help provide context.
Table inheritance in postgres is a very different thing and solves a different set of problems from class inheritance in python, ... | 1 | 1 | 0 | Pretty recent (but not newborn) to both Python, SQLAlchemy and Postgresql, and trying to understand inheritance very hard.
As I am taking over another programmer's code, I need to understand what is necessary, and where, for the inheritance concept to work.
My questions are:
Is it possible to rely only on SQLAlchemy f... | Python, SQLAlchemy and Postgresql: understanding inheritance | 0.379949 | 1 | 0 | 1,451 |
7,673,840 | 2011-10-06T11:49:00.000 | 2 | 0 | 0 | 0 | python,amazon-s3 | 7,791,237 | 2 | true | 0 | 0 | This hadn't currently been implemented in boto but has been now and will be in version 2.1 or is available now if you check out the source from github.
You can use a session token by passing the token with the key word argument security_token to boto.connect_s3. I think the session token will be implemented elsewhere s... | 1 | 1 | 0 | In boto and S3 modules the S3 connection constructor takes the access key and the secret key. Is there a connection object that exists that also takes a session token? | Is there a way to create a S3 connection with a sessions token? | 1.2 | 0 | 1 | 2,197 |
7,674,580 | 2011-10-06T13:01:00.000 | 0 | 0 | 1 | 0 | c++,python,image,boost,image-processing | 7,674,970 | 3 | false | 0 | 1 | You can guess by attempting to load the image into memory (using PIL or somesuch), but it's possible that some images could be loaded ok without being complete - for example an animated GIF might load fine if you have the header and the first frame of the animation, and you won't notice that later frames of the animati... | 1 | 2 | 0 | I want to check whether the images is downloaded completely. Is there any library to use?
The images I want to verify including various formats such jpeg, png, bmp etc. | How to verify the integrity of a image file in c++ or python? | 0 | 0 | 0 | 1,726 |
7,674,895 | 2011-10-06T13:27:00.000 | 3 | 0 | 0 | 0 | java,python,database,graph | 7,675,078 | 1 | true | 0 | 0 | Neo4J is the most mature graphDB I know of - and is java, with bindings for python too, or REST | 1 | 2 | 0 | At work we want our next generation product to be based on a graph database. I'm looking for suggestions as to what database engine might be appropriate for our new project:
Out product is intended to keep track of a large number of prices for goods. Here's a simplistic example of what it does - supposing you wanted to... | I'm looking for a graph-database for a Java/Python centric organization | 1.2 | 1 | 0 | 303 |
7,679,487 | 2011-10-06T19:30:00.000 | 6 | 0 | 1 | 0 | python,multithreading,dictionary,thread-safety,conflict | 7,679,529 | 1 | false | 0 | 0 | Using threading, no, you're not going to have a problem. You're also not going to achieve parallelism. The Global Interpreter Lock (GIL) in Python only allows a single thread to process at any time. If you want true parallel processing you need to look at the multiprocessing module. It has the ability to actually l... | 1 | 4 | 0 | I have a function (myFunc for e.g.) that takes a start and end date & iterates over it and accesses some dictionaries to process the data for this time period. I am looking to use threads to parallelize this code.
My main() function reads in data from a bunch of files & stores them in dictionaries. Every time I call my... | Different threads accessing the same dictionaries (for read only) | 1 | 0 | 0 | 604 |
7,679,557 | 2011-10-06T19:37:00.000 | 2 | 0 | 0 | 0 | python,windows | 7,679,786 | 1 | true | 0 | 0 | Write the output to disk- the virus scanner will see it then. | 1 | 1 | 0 | I need to trigger my AntiVirus (McAfee) when accessing a test-virus URL (http://eicar.org/download/eicar.com) via python. If I use IE, Firefox or even wget for windows, the AntiVirus detects that a virus URL was accessed, which is the expected behavior. However, when using urllib or urllib2, the virus URL is successful... | Python and Opswat | 1.2 | 0 | 1 | 145 |
7,681,017 | 2011-10-06T22:03:00.000 | 0 | 0 | 0 | 0 | python,mysql,sqlalchemy,foxpro,data-cleaning | 7,681,237 | 1 | false | 0 | 0 | It seems like you're trying to do several things all at once. Could you take a step-by-step approach? Perhaps cleansing the data as they are right now using your normal, usual scripts. Then migrate the database to MySQL.
It is easy to migrate the database if VisualFoxPro offers a way to export the database to, say, CSV... | 1 | 1 | 0 | We have a bunch of utility scripts in Visual FoxPro, which we use to interactively cleanse/format data. We'd like to start migrating this code to make use of other database platforms, like MySQL or SQLite.
For instance we have a script that we run which converts the name and/or address lines to proper upper/lower ca... | What's the best language/technique to perform advanced data cleansing and formatting on a SQL/MySQL/PostgreSQL table? | 0 | 1 | 0 | 789 |
7,681,431 | 2011-10-06T23:00:00.000 | 0 | 0 | 1 | 0 | python | 12,607,135 | 6 | false | 0 | 0 | Have a look at ipython, you should be able to use a combination of pdb and ipython, like loading pdb inside ipython to achieve what you need. | 3 | 17 | 0 | Given a Python source code, is it possible to run the code line by line, as if you were debugging?
And when it comes to a function call, I would like to 'step into' the function also. | run python source code line by line | 0 | 0 | 0 | 40,181 |
7,681,431 | 2011-10-06T23:00:00.000 | 2 | 0 | 1 | 0 | python | 7,681,453 | 6 | false | 0 | 0 | I'd suggest looking at Eclipse and PyDev for debugging. I imagine there are many alternatives though. | 3 | 17 | 0 | Given a Python source code, is it possible to run the code line by line, as if you were debugging?
And when it comes to a function call, I would like to 'step into' the function also. | run python source code line by line | 0.066568 | 0 | 0 | 40,181 |
7,681,431 | 2011-10-06T23:00:00.000 | 3 | 0 | 1 | 0 | python | 45,438,083 | 6 | false | 0 | 0 | If you're using PyCharm, you can change the keyboard shortcut settings -
Settings>>Keymap>>Other>>Execute selection in console
If you have migrated from R, changing this to Ctrl+Enter would help you run the code line by line. | 3 | 17 | 0 | Given a Python source code, is it possible to run the code line by line, as if you were debugging?
And when it comes to a function call, I would like to 'step into' the function also. | run python source code line by line | 0.099668 | 0 | 0 | 40,181 |
7,681,871 | 2011-10-07T00:08:00.000 | 3 | 0 | 1 | 0 | python,parsing,user-interface | 7,681,882 | 2 | true | 1 | 0 | MVC is just as applicable to non-web applications. The only things that change are the View (GUI controls instead of web controls) and the types of input the Controller can/must deal with. | 1 | 1 | 0 | In web design I use MVC pattern, but sometimes I need to create non-web application.
This may be some parser or GUI utility program.
What pattern is a classic solution for this kind of application? | python non-web application pattern | 1.2 | 0 | 0 | 230 |
7,683,597 | 2011-10-07T06:05:00.000 | 1 | 1 | 0 | 0 | python,ajax,apache,cgi | 7,683,660 | 2 | false | 1 | 0 | You need to send a Content-Type header to tell the browser what type of data you're sending it. Without that you'll get the 500 error you're experiencing. | 1 | 1 | 0 | I have an apache server that I am using for cgi. I am writing my cgis in Python.
As long as my responses are of the form "Content-Type: text/html\n #" it works.
But if I send anything else, I get a 500 error and my logs say "malformed header from script. Bad header" Can I change my configurations to make it work? Is... | Getting Apache cgi to send json in Python | 0.099668 | 0 | 0 | 1,336 |
7,683,769 | 2011-10-07T06:31:00.000 | 4 | 0 | 0 | 0 | python,django,api | 7,683,885 | 1 | false | 1 | 0 | Django is a web development framework; remote desktop viewing is a client-side task. It may be possible to integrate screen sharing into a web site that is built using Django, but Django itself will likely have no involvement with the "guts" of the task. | 1 | 4 | 0 | I am looking for a screen sharing functionality api in django/python which allows remote users to view your desktop in real time.
Any recommendations on a library/api to use?
Thanks. | django/python: screen sharing api | 0.664037 | 0 | 0 | 2,038 |
7,687,332 | 2011-10-07T12:35:00.000 | 2 | 1 | 0 | 1 | python,centos,virtualenv,rsyslog | 8,363,498 | 1 | true | 0 | 0 | Have you ever asked a question while researching something, then learned what you needed to do and then wished you hadn't asked the question?
All you need to do is modify your python path and add the path to the site-packages directory of the virtualenv you want to use. | 1 | 1 | 0 | I'm using a shell execute action in rsyslog to a python script on a CentOS machine. How can I ensure that it runs in a specified virtualenv? | Rsyslog + Virtualenv | 1.2 | 0 | 0 | 321 |
7,688,398 | 2011-10-07T14:06:00.000 | 6 | 0 | 1 | 0 | python,ubuntu,ide,pycharm | 7,688,610 | 1 | true | 0 | 0 | Settings | Code Style | General | Line Separator, set to \n (Unix). | 1 | 0 | 0 | When I load .py edited with PyCharm for Win on Ubuntu platform, I can see each line
trailed with ^M.
Is there a setting in PyCharm that I can avoid this annoying character? | How to setup PyCharm so '^M' doesn't show up in ubuntu | 1.2 | 0 | 0 | 2,306 |
7,688,442 | 2011-10-07T14:10:00.000 | 0 | 0 | 0 | 1 | python,deployment | 7,721,670 | 3 | false | 1 | 0 | cherrypy is the easiest one to use, django is feature rich and tornado is more advanced with asynchrounous web server(in my opinion it is better than multithreaded web server).
For what you want, django is best suitable for you IMO. | 1 | 6 | 0 | What is a good and easy way to distribute a web application and server bundled together, python way?
So I can say to a user "Here take this tar/whatever, unpack it and run blahblah.py" and blahblah.py will run a http/wsgi server and serve my application?
Im looking for a stable production-ready multi-threaded wsgi-serv... | Python self contained web application and server? | 0 | 0 | 0 | 1,744 |
7,689,527 | 2011-10-07T15:36:00.000 | 0 | 1 | 1 | 0 | python,unicode | 7,689,574 | 4 | false | 0 | 0 | You could do chr(0x43) do get C. | 1 | 1 | 0 | Does something exist that can take as input U+0043 and produce as output the letter C, maybe even a small description of the character ( like LATIN CAPITAL LETTER C )?
EDIT: the U+0043 is just an example. I would like a generic solution please, that could work for as many codepoints as possible. | How can I convert from U+0043 to C using Python? | 0 | 0 | 0 | 109 |
7,689,695 | 2011-10-07T15:49:00.000 | 6 | 0 | 0 | 0 | javascript,python,variables,sqlalchemy | 7,689,717 | 3 | false | 1 | 0 | python has a json module, which is a perfect fit for this scenario.
using a good old AJAX, with json as the data format will allow you to exchange data between javascript and your python module.
(unless your python module is running on the client side, but then i don't see how you could execute it from the browser...) | 1 | 15 | 0 | Imagine that you need to write some Javascript that simply changes a set of checkboxes when a drop down list is changed.
Depending on which item is selected in the list, some of the checkboxes will become checked/unchecked.
In the back, you have Python code along with some SQLAlchemy.
The Javascript needs to identify t... | Passing variables between Python and Javascript | 1 | 0 | 1 | 18,016 |
7,690,324 | 2011-10-07T16:47:00.000 | 0 | 0 | 0 | 0 | wxpython,widget | 7,691,411 | 1 | false | 0 | 1 | The wxPython demo has a fairly complicated window in their MDI with SashWindows demo. However, I keep seeing on the wxPython mailing list that MDI in general isn't usually recommended anyway. If I were you, I'd look at wx.lib.agw.aui. It's a pure python implementation of AUI and fixes a lot of the bugs in wx.aui. I kno... | 1 | 0 | 0 | I want to put a bunch of widgets into an MDIChildFrame , using wxpython, but i cant find much documentation on how to do so. has anyone created a child frame with alot going on it in so i can take a look at the source code? would be really Helpful
Cheers
Kemill | Using wx.MDIChildFrame Widgets | 0 | 0 | 0 | 317 |
7,694,006 | 2011-10-08T00:30:00.000 | 1 | 0 | 1 | 0 | python,pygtk,python-2.6,pysqlite,python-2.4 | 7,694,324 | 5 | false | 0 | 0 | My main worry would be third party libraries -- most library authors will be running 2.7 and thinking about 3.X, so any bugs that only show up with older versions are likely to get a lower priority (or ignored completely - if the bug is to do with python itself, the author could easily say it's not their library's faul... | 2 | 2 | 0 | I'm starting a new python project at work that is targeted primarily at RHEL5 machines that may be upgraded to RHEL6 in couple years. Given that python 2.4 is standard on RHEL5 and the system admins won't support more than they have to, getting python 2.6 in our local repo will take some convincing. While it seems I ... | Future Development in Python 2.4 | 0.039979 | 0 | 0 | 179 |
7,694,006 | 2011-10-08T00:30:00.000 | 0 | 0 | 1 | 0 | python,pygtk,python-2.6,pysqlite,python-2.4 | 7,694,045 | 5 | false | 0 | 0 | Count yourself lucky -- last time I did real Python work, I had to aim for Python 1.5.2, because that was the greatest common denominator available on the RHEL systems we were targeting. Hopefully all those systems have migrated to newer tools by now.
It might feel archaic, but that's the current ecosystem: either make... | 2 | 2 | 0 | I'm starting a new python project at work that is targeted primarily at RHEL5 machines that may be upgraded to RHEL6 in couple years. Given that python 2.4 is standard on RHEL5 and the system admins won't support more than they have to, getting python 2.6 in our local repo will take some convincing. While it seems I ... | Future Development in Python 2.4 | 0 | 0 | 0 | 179 |
7,694,637 | 2011-10-08T03:34:00.000 | 1 | 0 | 1 | 0 | python,regex | 7,694,645 | 5 | false | 1 | 0 | Parse the HTML using BeautifulSoup, then only retrieve the text. | 2 | 0 | 0 | I wanted to remove all the tags in HTML file. For that I used re module of python.
For example, consider the line <h1>Hello World!</h1>.I want to retain only "Hello World!". In order to remove the tags, I used re.sub('<.*>','',string). For obvious reasons the result I get is an empty string (The regexp identifies the ... | Processing a HTML file using Python | 0.039979 | 0 | 0 | 278 |
7,694,637 | 2011-10-08T03:34:00.000 | 1 | 0 | 1 | 0 | python,regex | 7,694,658 | 5 | true | 1 | 0 | You can make the match non-greedy: '<.*?>'
You also need to be careful, HTML is a crafty beast, and can thwart your regexes. | 2 | 0 | 0 | I wanted to remove all the tags in HTML file. For that I used re module of python.
For example, consider the line <h1>Hello World!</h1>.I want to retain only "Hello World!". In order to remove the tags, I used re.sub('<.*>','',string). For obvious reasons the result I get is an empty string (The regexp identifies the ... | Processing a HTML file using Python | 1.2 | 0 | 0 | 278 |
7,695,982 | 2011-10-08T09:42:00.000 | 30 | 0 | 1 | 0 | python | 7,696,131 | 4 | true | 0 | 0 | It gives you an alphabetical listing of valid names (attributes) in the scope (object). This is pretty much the meaning of the word directory in english. | 2 | 32 | 0 | I know that the dir() function gives you back either the names defined in the current scope or the names defined in an object. But why is it called dir()? Is it some mysterious acronyms like LISP's CAR and CDR? | What does Python's dir() function stand for? | 1.2 | 0 | 0 | 28,861 |
7,695,982 | 2011-10-08T09:42:00.000 | 3 | 0 | 1 | 0 | python | 7,696,013 | 4 | false | 0 | 0 | It's probably just an analogy to directory listing. list() is used for creating a lists, so dir() is used for listing elements object which has a similar tree-like structure to file system.
Just a guess. | 2 | 32 | 0 | I know that the dir() function gives you back either the names defined in the current scope or the names defined in an object. But why is it called dir()? Is it some mysterious acronyms like LISP's CAR and CDR? | What does Python's dir() function stand for? | 0.148885 | 0 | 0 | 28,861 |
7,696,565 | 2011-10-08T11:45:00.000 | 0 | 0 | 0 | 0 | python,openerp | 7,842,932 | 2 | false | 1 | 0 | I just experimented with the calendar view for the CRM cases screen. (I don't have the meetings module installed.) It looks like the calender view doesn't update itself right away, and you can force it by moving to the next month and then back.
Here's what I did, maybe you can do something similar:
Open the list view.... | 2 | 1 | 0 | When I create meetings in openerp for any user.. I can see them on both Calendar View and List View.. How ever When My meetings exceeds 100 for a single user it doesn't show newly created meetings in calendar view. How ever I can see all of them in my list view... Have any one faced this problem before.. Please Help | Openerp Unable to Show more then 100 Meetings in Calendar View? | 0 | 0 | 0 | 270 |
7,696,565 | 2011-10-08T11:45:00.000 | 0 | 0 | 0 | 0 | python,openerp | 8,137,529 | 2 | false | 1 | 0 | Yes,even I encountered the same problem.This is actually a limitation in OpenERP.So I created a new class called Meeting_history.So when meetings exceeds more than 90,the first 10 meetings or the older ten meetings gets removed from crm_meeting table and gets stored in meeting_history class where we can view older mee... | 2 | 1 | 0 | When I create meetings in openerp for any user.. I can see them on both Calendar View and List View.. How ever When My meetings exceeds 100 for a single user it doesn't show newly created meetings in calendar view. How ever I can see all of them in my list view... Have any one faced this problem before.. Please Help | Openerp Unable to Show more then 100 Meetings in Calendar View? | 0 | 0 | 0 | 270 |
7,698,217 | 2011-10-08T16:32:00.000 | 1 | 0 | 0 | 0 | python,gtk,pygtk | 7,705,370 | 2 | false | 0 | 1 | You might be able to set the pixmap opacity by implementing a custom gtk.CellRenderer that draws the pixmap according to the selection state, and replacing the gtk.IconView's default cell renderer with your own. | 1 | 0 | 0 | I want to change the opacity or color of a gtk.IconView select box (I want actually to make the selection more visible).
I noticed that the gtk.IconView widget had style properties selection-box-alpha & selection-box-color but only accessible for reading.
The set_select_function() method of the gtk.TreeSelection class ... | How to get the control over the selection in a gtk.IconView? | 0.099668 | 0 | 0 | 735 |
7,700,562 | 2011-10-09T00:11:00.000 | 10 | 0 | 0 | 0 | python,bittorrent,xor,dht,kademlia | 7,708,738 | 1 | true | 0 | 0 | The kademlia paper actually calls out the optimization of dynamically splitting buckets as the routing table grows. There is no logic difference between these two approaches, it's just an optimization to save some space. When implementing a fixed full sized routing table, you have to find k nodes to send requests to. I... | 1 | 9 | 0 | I'm in the middle of implementing my own dht for internal cluster. Since it will be used in file-sharing program like bittorrent, "Mainline DHT" was the first thing I was look at. After that I found "entangled" (python, dht using twisted matrix), congress (python, dht using pyev + libev) and of course original "kademli... | DHT: BitTorrent vs kademlia vs clones (python) | 1.2 | 0 | 0 | 3,428 |
7,700,743 | 2011-10-09T00:55:00.000 | 3 | 0 | 0 | 0 | python,django,random | 7,700,751 | 1 | true | 1 | 0 | If the error is exactly "No module named Random", then you've written import Random when you really meant import random. There is no module in the Python standard library called Random. Module names are case sensitive in Python. If that doesn't solve your problem, please show us some code from whatever module imports r... | 1 | 0 | 0 | Python 2.4.3, when I run python via the command line and import random, it works just fine. When I run a django based website "python manage.py runserver", the server starts up fine, but as soon as I load a page, it tosses me this error.
I really have no clue how to fix this. I've done some searching, random is core to... | Error was: No module named Random | 1.2 | 0 | 0 | 9,192 |
7,701,633 | 2011-10-09T05:28:00.000 | 2 | 0 | 0 | 0 | python,django | 7,701,968 | 4 | true | 1 | 0 | What for. Make your desktop app speak HTTP and use an alternate API provided by another application. | 1 | 1 | 0 | I was going to write this website for communicating with others and i want to implement a desktop app too so now I was wondering whether is is possible to integrate a python, maybe twisted tcp ip server within django so that both the site and the custom tcp could run alongside each other...?
Thanks in Advance | Custom TCP/IP server in django webapp? | 1.2 | 0 | 0 | 1,043 |
7,701,989 | 2011-10-09T07:12:00.000 | 2 | 0 | 1 | 1 | python,hadoop,parallel-processing | 7,704,037 | 2 | false | 0 | 0 | The main difference is that Hadoop is good at processing big data (dozen to terabytes of data). It provides a simple logical framework called MapReduce which is well appropriate for data aggregation, and a distributed storage system called HDFS.
If your inputs are smaller than 1 gigabyte, you probably don't want to use... | 2 | 3 | 0 | I'm new to using multiple cpu's to process jobs and was wondering if people could let me know the pro/cons of parallelpython(or any type of python module) versus hadoop streaming?
I have a very large cpu intensive process that I would like to spread across several servers. | Can someone explain parallelpython versus hadoop for distributing python process across various servers? | 0.197375 | 0 | 0 | 540 |
7,701,989 | 2011-10-09T07:12:00.000 | 2 | 0 | 1 | 1 | python,hadoop,parallel-processing | 7,705,052 | 2 | true | 0 | 0 | Since moving data becomes harder and harder with size; when it comes to parallel computing, data localization becomes very important. Hadoop as a map/reduce framework maximizes the localization of data being processed. It also gives you a way to spread your data efficiently across your cluster (hdfs). So basically, eve... | 2 | 3 | 0 | I'm new to using multiple cpu's to process jobs and was wondering if people could let me know the pro/cons of parallelpython(or any type of python module) versus hadoop streaming?
I have a very large cpu intensive process that I would like to spread across several servers. | Can someone explain parallelpython versus hadoop for distributing python process across various servers? | 1.2 | 0 | 0 | 540 |
7,702,050 | 2011-10-09T07:28:00.000 | 2 | 0 | 1 | 0 | python,regex | 7,702,061 | 2 | false | 0 | 0 | Add \.html? to the end of what you already have, optionally removing or moving the existing ?. | 2 | 0 | 0 | My pattern that already matches e.g. /vi/9822 is /vi/([^/]+)?
I also want to match e.g. /vi/9822.htm and /vi/9822.html. Can you help me?
Thank you | How to make a regex for /vi/.htm(l)? | 0.197375 | 0 | 0 | 70 |
7,702,050 | 2011-10-09T07:28:00.000 | 3 | 0 | 1 | 0 | python,regex | 7,702,073 | 2 | true | 0 | 0 | If the .htm or .html part is optional, this should suit your needs: /vi/(\d+)(\.html?)?, otherwise use just /vi/(\d+)\.html?. | 2 | 0 | 0 | My pattern that already matches e.g. /vi/9822 is /vi/([^/]+)?
I also want to match e.g. /vi/9822.htm and /vi/9822.html. Can you help me?
Thank you | How to make a regex for /vi/.htm(l)? | 1.2 | 0 | 0 | 70 |
7,709,023 | 2011-10-10T05:57:00.000 | 0 | 1 | 0 | 0 | python,weblogic11g,wlst | 8,122,676 | 1 | true | 0 | 0 | So, I am answering my own question! Yes it is possible to profile. The JVM arguements needed for JProfiler/any other profiler needs to be added to wlst.sh and it works. | 1 | 0 | 0 | Is it possible to profile a script run in wlst? I need to profile a python script that migrates data from an XML file to an LDAP. | Is it possible to profile a script run in WLST? | 1.2 | 0 | 0 | 244 |
7,710,895 | 2011-10-10T09:35:00.000 | 3 | 0 | 0 | 0 | python,sqlite,sqlalchemy | 7,712,124 | 2 | true | 0 | 0 | Yes, SQLite has its own memory cache. Check PRAGMA cache_size for instance. Also, if you're looking for speedups, check PRAGMA temp_store. There is also API for implementing your own cache.
The SQLite database is just a file to the OS. Nothing is 'automatically' done for it. To ensure caching does happen, there are sql... | 1 | 5 | 0 | I have a Pylons application using SQLAlchemy with SQLite as backend. I would like to know if every read operation going to SQLite will always lead to a hard disk read (which is very slow compared to RAM) or some caching mechanisms are already involved.
does SQLite maintain a subset of the database in RAM for faster a... | Are SQLite reads always hitting disk? | 1.2 | 1 | 0 | 339 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.