Q_Id int64 337 49.3M | CreationDate stringlengths 23 23 | Users Score int64 -42 1.15k | Other int64 0 1 | Python Basics and Environment int64 0 1 | System Administration and DevOps int64 0 1 | Tags stringlengths 6 105 | A_Id int64 518 72.5M | AnswerCount int64 1 64 | is_accepted bool 2
classes | Web Development int64 0 1 | GUI and Desktop Applications int64 0 1 | Answer stringlengths 6 11.6k | Available Count int64 1 31 | Q_Score int64 0 6.79k | Data Science and Machine Learning int64 0 1 | Question stringlengths 15 29k | Title stringlengths 11 150 | Score float64 -1 1.2 | Database and SQL int64 0 1 | Networking and APIs int64 0 1 | ViewCount int64 8 6.81M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,329,762 | 2010-07-25T15:30:00.000 | 1 | 0 | 0 | 0 | python,wxpython,wxwidgets | 3,330,832 | 3 | false | 0 | 1 | afaik... none. I'll follow the answers to see if someone has one and try it of course but I'm not convinced this will be THAT useful. When using wxPython, you usually work with sizers (at least I think the results are better) so you don't really need to "place" the controls on the frame and I think a GUI "design" would... | 2 | 2 | 0 | What are the usable tools?
I am aware of wxformbuilder and wxGlade, but none of them seems to be complete yet. | What are the existing open-source Python WxWidgets designers? | 0.066568 | 0 | 0 | 831 |
3,329,775 | 2010-07-25T15:35:00.000 | 10 | 1 | 1 | 0 | python,syntax | 3,329,797 | 4 | true | 0 | 0 | It's an old control character from typewriters.
It means "carriage return". In this time, when you pressed "enter", you were going to the next line, then the carriage went back to the beginning of the line (hence the carriage return).
Then with computers, different OSes made different choices to represent new lines.
On... | 1 | 3 | 0 | What does '\r' mean? What does it do? I have never seen it before and its giving me headaches. It doesnt seem to have any purpose, since 'a\ra' prints as 'aa', but its not the same as the string 'aa'. Im using python 2.6 | What does this stand for? | 1.2 | 0 | 0 | 11,032 |
3,330,643 | 2010-07-25T19:16:00.000 | 2 | 0 | 1 | 0 | python,osx-snow-leopard,memory-management,x86-64,i386 | 3,330,648 | 2 | false | 0 | 0 | No, it's physically impossible. That doesn't stop the OS assigning more than it can use due to alignment and fragmentation, say, it could have a whole page and not actually map in all of it. However it's impossible to actually use over 4GB for any process, and most likely substantially less than that for kernel space. | 2 | 3 | 0 | Is it possible for a single process running a 32-bit compiled version of python in Snow Leopard (64-bit machine) to appear to consume > 4GB (say 5.4GB) of virtual memory as seen by the top command?
I did a file ...python to see that the binary was not x86, yet it appeared to be consuming over 5GB of memory.
My guess i... | Can a process running a 32-bit compiled binary use more than 4GB of memory? | 0.197375 | 0 | 0 | 307 |
3,330,643 | 2010-07-25T19:16:00.000 | 1 | 0 | 1 | 0 | python,osx-snow-leopard,memory-management,x86-64,i386 | 3,347,445 | 2 | false | 0 | 0 | It is possible if the processes is using some kind of insane long/far/extended pointers and mapping data into and outof a 32-bit address space as it needs it, but at that point it hardly qualifies as 32-bit anyway. (Python most definitely does not do this, so @DeadMG's answer is almost certainly what is actually happe... | 2 | 3 | 0 | Is it possible for a single process running a 32-bit compiled version of python in Snow Leopard (64-bit machine) to appear to consume > 4GB (say 5.4GB) of virtual memory as seen by the top command?
I did a file ...python to see that the binary was not x86, yet it appeared to be consuming over 5GB of memory.
My guess i... | Can a process running a 32-bit compiled binary use more than 4GB of memory? | 0.099668 | 0 | 0 | 307 |
3,330,668 | 2010-07-25T19:23:00.000 | 1 | 0 | 1 | 0 | python,parsing,list,sorting,dictionary | 3,333,193 | 3 | false | 0 | 0 | Are you loading all the data into memory at once? If so you could be causing the OS to swap memory to disk, which can bring any system to a crawl. Dictionaries are hashtables so even an empty dict will use up a lot of memory, and from what you say you are creating a lot of them at once. I don't know the MongoDB API,... | 2 | 0 | 0 | I'm using MongoDB an nosql database. Basically as a result of a query I have a list of dicts which themselves contains lists of dictionaries... which I need to work with.
Unfortunately dealing with all this data within Python can be brought to a crawl when the data is too much.
I have never had to deal with this probl... | Speeding up parsing of HUGE lists of dictionaries - Python | 0.066568 | 1 | 0 | 406 |
3,330,668 | 2010-07-25T19:23:00.000 | 3 | 0 | 1 | 0 | python,parsing,list,sorting,dictionary | 3,333,236 | 3 | true | 0 | 0 | Do you really want all of that data back in your Python program? If so fetch it back a little at a time, but if all you want to do is summarise the data then use mapreduce in MongoDB to distribute the processing and just return the summarised data.
After all, the point about using a NoSQL database that cleanly shards a... | 2 | 0 | 0 | I'm using MongoDB an nosql database. Basically as a result of a query I have a list of dicts which themselves contains lists of dictionaries... which I need to work with.
Unfortunately dealing with all this data within Python can be brought to a crawl when the data is too much.
I have never had to deal with this probl... | Speeding up parsing of HUGE lists of dictionaries - Python | 1.2 | 1 | 0 | 406 |
3,330,983 | 2010-07-25T20:59:00.000 | 5 | 0 | 0 | 0 | python,ironpython | 3,331,020 | 5 | true | 0 | 0 | IronPython doesn't have an alternate syntax. It's an implementation of Python, and Python uses significant indentation (all languages use significant whitespace, not sure why we talk about whitespace when it's only indentation that's unusual in the Python case). | 1 | 0 | 0 | For rapidly changing business rules, I'm storing IronPython fragments in XML files. So far this has been working out well, but I'm starting to get to the point where I need more that just one-line expressions.
The problem is that XML and significant whilespace don't play well together. Before I abandon it for another l... | IronPython: Is there an alternative to significant whitespace? | 1.2 | 0 | 0 | 427 |
3,331,027 | 2010-07-25T21:13:00.000 | 6 | 1 | 0 | 1 | python,tcl,irc,node.js,eggdrop | 3,331,115 | 2 | true | 0 | 0 | As you suspected, eggdrop is not written in tcl, it is written in C, however it does use tcl as its scripting/extension language.
I would expect that in the case of an eggdrop, the performance difference between using tcl as a scripting language, and using Python, Lua, JS, or virtually anything else would be negligible... | 1 | 3 | 0 | I believe eggdrop is the most active/popular bot and it's written in tcl ( and according to wiki the core is C but I haven't confirmed that ).
I'm wondering if there would be any performance benefit of recoding it's functionality in node.js or Python, in addition to making it more accessible since Python and JS are arg... | How would an irc bot written in tcl stack up against a python/node.js clone? | 1.2 | 0 | 0 | 964 |
3,332,263 | 2010-07-26T04:48:00.000 | 0 | 0 | 0 | 0 | user-interface,wxpython,real-time | 5,598,605 | 1 | false | 0 | 1 | If you can connect to this mysterious device and receive data from it from Python, then you can display said data with wxPython or any other GUI toolkit. You don't really say what kind of data it is or what you want to display? Lines? Graphs? Or what? If it's just tabular data, use the wx.ListCtrl (or ObjectListView) w... | 1 | 0 | 0 | I am new to this post as well as to python GUI programming.I want to make a realtime graphical GUI in wxpython.My requirement is that i have to catch signals from a device and i have to display the data in graphical as well as in textual form.The system should be accurate and be specific with the time constraints.Pleas... | Help : Realtime graphical interface in wxpython | 0 | 0 | 0 | 179 |
3,332,494 | 2010-07-26T05:59:00.000 | 1 | 0 | 0 | 0 | python,html,string,templates,parsing | 3,332,528 | 3 | false | 1 | 0 | It's very hard to come up with a rule that works 100% of the time, obviously, but my suggestion as a starting point would be to look for the first <h1> tag (or <h2>, <h3>, etc - the highest one you can find) then the bit of text after that can be used as the description. As long as the site is semantically marked-up, t... | 1 | 6 | 0 | Suppose I downloaded the HTML code, and I can parse it.
How do I get the "best" description of that website, if that website does not have meta-description tag? | What's the best way to get a description of the website, in Python? | 0.066568 | 0 | 1 | 519 |
3,332,897 | 2010-07-26T07:14:00.000 | 2 | 0 | 0 | 1 | python,google-app-engine,parsing | 3,334,425 | 1 | false | 1 | 0 | The 1MB limit doesn't apply to parsing; however, you can't fetch more than 1MB from URLfetch; you'll only get the first 1MB from the API.
It's probably not going to be possible to get the XML into your application using the URLfetch API. If the data is smaller than 10MB, you can arrange for an external process to POST... | 1 | 1 | 0 | Hi i need to parse xml file which is more then 1 mb in size, i know GAE can handle request and response up to 10 MB but as we need to use SAX parser API and API GAE has limit of 1 MB so is there way we can parse file more then 1 mb any ways. | Google app engine parsing xml more then 1 mb | 0.379949 | 0 | 1 | 485 |
3,333,095 | 2010-07-26T07:54:00.000 | 6 | 0 | 1 | 0 | python,build,linker,sqlite | 3,341,117 | 3 | false | 0 | 0 | download the latest version of sqlite3.dll from sqlite website and replace the the sqlite3.dll in the python dir. | 2 | 9 | 0 | I was using Python 2.6.5 to build my application, which came with sqlite3 3.5.9. Apparently though, as I found out in another question of mine, foreign key support wasn't introduced in sqlite3 until version 3.6.19. However, Python 2.7 comes with sqlite3 3.6.21, so this work -- I decided I wanted to use foreign keys in ... | How can I upgrade the sqlite3 package in Python 2.6? | 1 | 1 | 0 | 4,281 |
3,333,095 | 2010-07-26T07:54:00.000 | 1 | 0 | 1 | 0 | python,build,linker,sqlite | 3,333,348 | 3 | false | 0 | 0 | I decided I'd just give this a shot when I realized that every library I've ever installed in python 2.6 resided in my site-packages folder. I just... copied site-packages to my 2.7 installation, and it works so far. This is by far the easiest route for me if this works -- I'll look further into it but at least I can c... | 2 | 9 | 0 | I was using Python 2.6.5 to build my application, which came with sqlite3 3.5.9. Apparently though, as I found out in another question of mine, foreign key support wasn't introduced in sqlite3 until version 3.6.19. However, Python 2.7 comes with sqlite3 3.6.21, so this work -- I decided I wanted to use foreign keys in ... | How can I upgrade the sqlite3 package in Python 2.6? | 0.066568 | 1 | 0 | 4,281 |
3,333,113 | 2010-07-26T07:57:00.000 | 0 | 1 | 0 | 1 | python,web-services,pylons | 3,358,288 | 2 | false | 0 | 0 | I'm using Nginx (with fastcgi) or Apache for hosting Pylons sites, mostly because lack of some "production" features in Paste, but for development Paste is very usefull and handy. | 1 | 5 | 0 | I'm looking into Pylons and was wondering, should I use Paste as the webserver or can I use Apache?
Are there advantages to using Paste?
Would you recommend against using Apache?
How should I host the sites? | Should I use Pylon's Paste to host my Pylons website? Or can I use Apache? | 0 | 0 | 0 | 511 |
3,333,929 | 2010-07-26T10:16:00.000 | -2 | 0 | 0 | 0 | python,networking,ftplib | 68,453,582 | 2 | false | 0 | 0 | Since Python 3.3, ftplib functions that establish connections take a source_addr argument that allows you to do exactly this. | 1 | 0 | 0 | I use python ftplib to connect to a ftp server which is running on active mode; That means the server will connect my client machine on a random port when data is sent between us.
Considering security issue, Can I specify the client's data port (or port range) and let the server connect the certain port?
Many Thanks f... | How can I specify the client's data port for a ftp server in active mode? | -0.197375 | 0 | 1 | 1,268 |
3,334,777 | 2010-07-26T12:31:00.000 | 1 | 0 | 0 | 0 | python,django,long-polling,gevent | 3,338,935 | 3 | true | 0 | 0 | This depends on which WSGI server you use. AFAIK gevent.wsgi will not notify your handler in any way when the client closes the connection, because libevent-http does not do that. However, with gevent.pywsgi it should be possible. You'll probably need to start an additional greenlet to monitor the socket condition and ... | 1 | 7 | 0 | I'm using long polling for a chat with gevent. I'm using Event.wait() when waiting for new messages to be posted on the chat.
I would like to handle the occasion a client disconnects with some functionality:
e.g. Return "client has disconnected" as a message for other chat users
Is this possible? =) | Capturing event of client disconnecting! - Gevent/Python | 1.2 | 0 | 1 | 1,701 |
3,336,457 | 2010-07-26T15:42:00.000 | 0 | 0 | 0 | 0 | python,multithreading,pygtk,wrapper | 3,337,085 | 2 | true | 0 | 1 | Turns out the problem was that I couldn't find a working solution because I was utilizing the Thread module the wrong way and calling run() directly when I should have been calling start(). Because of that, I was thinking that nothing I did worked (especially with no error or complaint from anything) and figured it was... | 2 | 0 | 0 | I have an application where my DataFetch() class "Wraps" around my HBHTray() class for the purpose of interacting with the functions/variables of that class. Unfortunately, I can't seem to be able to get the code to continue execution after my DataFetch() class makes a instance of HBHTray and calls it, and on the Start... | Continuing code execution after a pygtk.main() in python | 1.2 | 0 | 0 | 356 |
3,336,457 | 2010-07-26T15:42:00.000 | 0 | 0 | 0 | 0 | python,multithreading,pygtk,wrapper | 3,336,490 | 2 | false | 0 | 1 | gobject.threads_init() does not magically put your things into separate threads. It only tells the library that you're going to use threads, and sets up some locking. You'll still have to create the threads yourself. | 2 | 0 | 0 | I have an application where my DataFetch() class "Wraps" around my HBHTray() class for the purpose of interacting with the functions/variables of that class. Unfortunately, I can't seem to be able to get the code to continue execution after my DataFetch() class makes a instance of HBHTray and calls it, and on the Start... | Continuing code execution after a pygtk.main() in python | 0 | 0 | 0 | 356 |
3,336,787 | 2010-07-26T16:21:00.000 | 4 | 1 | 0 | 0 | python,webserver,mod-wsgi | 3,339,594 | 6 | false | 1 | 0 | Don't get carried away with trying to work out what is the fastest web server. All you will do in doing that is waste your time. This is because the web server is nearly never the bottleneck if you set them up properly. The real bottleneck is your web application, database access etc.
As such, choose whatever web hosti... | 2 | 2 | 0 | I am leasing a dedicated web server.
I have a Python web-application.
Which configuration option (CGI, FCGI, mod_python, Passenger, etc) would result in Python being served the fastest on my web server and how do I set it up that way?
UPDATE:
Note, I'm not using a Python framework such as Django or Pylons. | Python/Web: What's the best way to run Python on a web server? | 0.132549 | 0 | 0 | 5,769 |
3,336,787 | 2010-07-26T16:21:00.000 | -1 | 1 | 0 | 0 | python,webserver,mod-wsgi | 3,336,816 | 6 | false | 1 | 0 | You don't usually just serve Python, you serve a specific web server or framework based on Python. eg. Zope, TurboGears, Django, Pylons, etc. Although they tend to be able to operate on different web server back-ends (and some provide an internal web server themselves), the best solution will depend on which one you us... | 2 | 2 | 0 | I am leasing a dedicated web server.
I have a Python web-application.
Which configuration option (CGI, FCGI, mod_python, Passenger, etc) would result in Python being served the fastest on my web server and how do I set it up that way?
UPDATE:
Note, I'm not using a Python framework such as Django or Pylons. | Python/Web: What's the best way to run Python on a web server? | -0.033321 | 0 | 0 | 5,769 |
3,337,301 | 2010-07-26T17:25:00.000 | 2 | 0 | 0 | 0 | python,arrays,matrix,numpy | 32,098,823 | 10 | false | 0 | 0 | First, Mv = numpy.asarray(M.T), which gives you a 4x1 but 2D array.
Then, perform A = Mv[0,:], which gives you what you want. You could put them together, as numpy.asarray(M.T)[0,:]. | 1 | 184 | 1 | I am using numpy. I have a matrix with 1 column and N rows and I want to get an array from with N elements.
For example, if i have M = matrix([[1], [2], [3], [4]]), I want to get A = array([1,2,3,4]).
To achieve it, I use A = np.array(M.T)[0]. Does anyone know a more elegant way to get the same result?
Thanks! | Numpy matrix to array | 0.039979 | 0 | 0 | 319,127 |
3,337,725 | 2010-07-26T18:19:00.000 | 5 | 0 | 1 | 0 | python,user-interface,ironpython,jython,cpython | 3,337,830 | 8 | false | 0 | 1 | Well, Mono does not come with the base of most Linux distributions. It's not a terribly lightweight dependency either, and I think Java is considerably more likely for people to already have. Would you plan on using "Winforms" with Mono? If so, and you don't have experience with Winforms, read about what others have... | 5 | 9 | 0 | I'm thinking of making some kind of experimental IDE for digital hardware design. So I can't decide witch platform to choose.
I'm going to have text-editor with syntax highlighting, some vector graphics and lots of tabbed windows.
My goals:
1. to make GUI using as less custom components as possible.
2. to make it as cr... | CPython vs. Jython vs. IronPython for cross-platform GUI development | 0.124353 | 0 | 0 | 6,247 |
3,337,725 | 2010-07-26T18:19:00.000 | 2 | 0 | 1 | 0 | python,user-interface,ironpython,jython,cpython | 3,337,760 | 8 | false | 0 | 1 | Take a look at comparable GUI's written in python/jython/ironpython. Look for programs that you like and find out what they use. I guess most if not all will be written in cpython + gtk or cpython + qt. I think all gui toolkits in python are cross platform. | 5 | 9 | 0 | I'm thinking of making some kind of experimental IDE for digital hardware design. So I can't decide witch platform to choose.
I'm going to have text-editor with syntax highlighting, some vector graphics and lots of tabbed windows.
My goals:
1. to make GUI using as less custom components as possible.
2. to make it as cr... | CPython vs. Jython vs. IronPython for cross-platform GUI development | 0.049958 | 0 | 0 | 6,247 |
3,337,725 | 2010-07-26T18:19:00.000 | 5 | 0 | 1 | 0 | python,user-interface,ironpython,jython,cpython | 3,337,744 | 8 | false | 0 | 1 | I'd say that if cross-platform is a goal, forget IronPython. A lot of people hate the dependency hell it causes so it'll be too much work to get it up in running in some OSes/distributions. Jython will suffer this also, albeit to a lesser degree. | 5 | 9 | 0 | I'm thinking of making some kind of experimental IDE for digital hardware design. So I can't decide witch platform to choose.
I'm going to have text-editor with syntax highlighting, some vector graphics and lots of tabbed windows.
My goals:
1. to make GUI using as less custom components as possible.
2. to make it as cr... | CPython vs. Jython vs. IronPython for cross-platform GUI development | 0.124353 | 0 | 0 | 6,247 |
3,337,725 | 2010-07-26T18:19:00.000 | 2 | 0 | 1 | 0 | python,user-interface,ironpython,jython,cpython | 3,341,283 | 8 | false | 0 | 1 | Java is the most portable platform. Jython is written in 100% pure Java. 'Nuff said.
BTW I just switched a CPython/GTK project to Jython (trying to remove as much unmanaged code as possible), the only problem is that Jython is at 2.5 still, which kind of sucks when you're used to 2.6/2.7/3 :) | 5 | 9 | 0 | I'm thinking of making some kind of experimental IDE for digital hardware design. So I can't decide witch platform to choose.
I'm going to have text-editor with syntax highlighting, some vector graphics and lots of tabbed windows.
My goals:
1. to make GUI using as less custom components as possible.
2. to make it as cr... | CPython vs. Jython vs. IronPython for cross-platform GUI development | 0.049958 | 0 | 0 | 6,247 |
3,337,725 | 2010-07-26T18:19:00.000 | 1 | 0 | 1 | 0 | python,user-interface,ironpython,jython,cpython | 3,337,836 | 8 | false | 0 | 1 | There are plenty of answers already, but I'd like to add one important thing - regardless of which library you learn, most of the principles will be the same when you move to another library.
I don't know about Qt, but for most graphics programs (in PyGTK or Tkinter) the best thing to do, as far as editing goes, is to ... | 5 | 9 | 0 | I'm thinking of making some kind of experimental IDE for digital hardware design. So I can't decide witch platform to choose.
I'm going to have text-editor with syntax highlighting, some vector graphics and lots of tabbed windows.
My goals:
1. to make GUI using as less custom components as possible.
2. to make it as cr... | CPython vs. Jython vs. IronPython for cross-platform GUI development | 0.024995 | 0 | 0 | 6,247 |
3,337,973 | 2010-07-26T18:52:00.000 | 0 | 0 | 1 | 0 | python,keyboard,wxpython,hotkeys,keyboard-shortcuts | 3,345,475 | 4 | false | 0 | 0 | If you want hotkeys in your wxPython program (which I assume you do because of the wxPython tag), then you should use a wx.AcceleratorTable. | 1 | 11 | 0 | I wanna setup a global hotkey in python 2.6 that listens to the keyboard shortcut ctrl + D or ctrl+ alt+ D on windows, please help me | Set global hotkey with Python 2.6 | 0 | 0 | 0 | 13,435 |
3,338,616 | 2010-07-26T20:13:00.000 | 5 | 0 | 1 | 1 | python,linux,centos | 3,338,914 | 7 | false | 0 | 0 | One of the problems with system() is that it implies knowledge of the shell's syntax and language for parsing and executing your command line. This creates potential for a bug where you didn't validate input properly, and the shell might interpet something like variable substitution or determining where an argument be... | 6 | 12 | 0 | Spinning off from another thread, when is it appropriate to use os.system() to issue commands like rm -rf, cd, make, xterm, ls ?
Considering there are analog versions of the above commands (except make and xterm), I'm assuming it's safer to use these built-in python commands instead of using os.system()
Any thoughts? I... | Python - When Is It Ok to Use os.system() to issue common Linux commands | 0.141893 | 0 | 0 | 3,734 |
3,338,616 | 2010-07-26T20:13:00.000 | 3 | 0 | 1 | 1 | python,linux,centos | 3,338,752 | 7 | false | 0 | 0 | The only time that os.system might be appropriate is for a quick-and-dirty solution for a non-production script or some kind of testing. Otherwise, it is best to use built-in functions. | 6 | 12 | 0 | Spinning off from another thread, when is it appropriate to use os.system() to issue commands like rm -rf, cd, make, xterm, ls ?
Considering there are analog versions of the above commands (except make and xterm), I'm assuming it's safer to use these built-in python commands instead of using os.system()
Any thoughts? I... | Python - When Is It Ok to Use os.system() to issue common Linux commands | 0.085505 | 0 | 0 | 3,734 |
3,338,616 | 2010-07-26T20:13:00.000 | 18 | 0 | 1 | 1 | python,linux,centos | 3,338,632 | 7 | true | 0 | 0 | Rule of thumb: if there's a built-in Python function to achieve this functionality use this function. Why? It makes your code portable across different systems, more secure and probably faster as there will be no need to spawn an additional process. | 6 | 12 | 0 | Spinning off from another thread, when is it appropriate to use os.system() to issue commands like rm -rf, cd, make, xterm, ls ?
Considering there are analog versions of the above commands (except make and xterm), I'm assuming it's safer to use these built-in python commands instead of using os.system()
Any thoughts? I... | Python - When Is It Ok to Use os.system() to issue common Linux commands | 1.2 | 0 | 0 | 3,734 |
3,338,616 | 2010-07-26T20:13:00.000 | 4 | 0 | 1 | 1 | python,linux,centos | 3,338,678 | 7 | false | 0 | 0 | Darin's answer is a good start.
Beyond that, it's a matter of how portable you plan to be. If your program is only ever going to run on a reasonably "standard" and "modern" Linux then there's no reason for you to re-invent the wheel; if you tried to re-write make or xterm they'd be sending the men in the white coats fo... | 6 | 12 | 0 | Spinning off from another thread, when is it appropriate to use os.system() to issue commands like rm -rf, cd, make, xterm, ls ?
Considering there are analog versions of the above commands (except make and xterm), I'm assuming it's safer to use these built-in python commands instead of using os.system()
Any thoughts? I... | Python - When Is It Ok to Use os.system() to issue common Linux commands | 0.113791 | 0 | 0 | 3,734 |
3,338,616 | 2010-07-26T20:13:00.000 | 3 | 0 | 1 | 1 | python,linux,centos | 3,339,586 | 7 | false | 0 | 0 | Your question seems to have two parts. You mention calling commands like "xterm", "rm -rf", and "cd".
Side Note: you cannot call 'cd' in a sub-shell. I bet that was a trick question ...
As far as other command-level things you might want to do, like "rm -rf SOMETHING", there is already a python equivalent. This answers... | 6 | 12 | 0 | Spinning off from another thread, when is it appropriate to use os.system() to issue commands like rm -rf, cd, make, xterm, ls ?
Considering there are analog versions of the above commands (except make and xterm), I'm assuming it's safer to use these built-in python commands instead of using os.system()
Any thoughts? I... | Python - When Is It Ok to Use os.system() to issue common Linux commands | 0.085505 | 0 | 0 | 3,734 |
3,338,616 | 2010-07-26T20:13:00.000 | 2 | 0 | 1 | 1 | python,linux,centos | 3,338,709 | 7 | false | 0 | 0 | I would suggest that you only use use os.system for things that there are not already equivalents for within the os module. Why make your life harder? | 6 | 12 | 0 | Spinning off from another thread, when is it appropriate to use os.system() to issue commands like rm -rf, cd, make, xterm, ls ?
Considering there are analog versions of the above commands (except make and xterm), I'm assuming it's safer to use these built-in python commands instead of using os.system()
Any thoughts? I... | Python - When Is It Ok to Use os.system() to issue common Linux commands | 0.057081 | 0 | 0 | 3,734 |
3,339,263 | 2010-07-26T21:50:00.000 | 1 | 0 | 0 | 0 | python,wxpython,refresh | 3,339,765 | 2 | false | 0 | 1 | Call the SetLabel method in your static text instance. So you don't run into conflict with the size, make sure your StaticText instance is created with enough space to write the future labels you'll want to write to it. | 1 | 5 | 0 | i was wondering how to update a StaticText dynamically in wxpython?
I have a script that goes every five minutes and reads a status from a webpage, then prints using wxpython the status in a static input.
How would i dynamically, every 5 minutes update the statictext to reflect the status?
thanks alot
-soule | Dynamically update wxPython staticText | 0.099668 | 0 | 0 | 12,769 |
3,339,399 | 2010-07-26T22:14:00.000 | 18 | 0 | 1 | 0 | python,ide,intellij-idea,pycharm | 3,344,714 | 5 | true | 0 | 0 | Right now PyCharm is quite a bit farther ahead in terms of functionality compared to the Python plugin for IntelliJ IDEA 9. Once we start the EAP for IntelliJ IDEA 10, we'll also release a new version of the Python plugin containing all the latest features of PyCharm, but we don't currently plan to backport the new fea... | 3 | 37 | 0 | So I have IntelliJ and love it, and have been using the Python plugin for a while. But I noticed that they have PyCharm coming out in beta now. I haven't been using PyCharm since I just use IntelliJ for everything, but is there a compelling reason to buy PyCharm? | Comparison of IntelliJ Python plugin or PyCharm | 1.2 | 0 | 0 | 23,201 |
3,339,399 | 2010-07-26T22:14:00.000 | -1 | 0 | 1 | 0 | python,ide,intellij-idea,pycharm | 3,339,453 | 5 | false | 0 | 0 | PyCharm supports django and Google App Engine. The django support is really nice if you use django. | 3 | 37 | 0 | So I have IntelliJ and love it, and have been using the Python plugin for a while. But I noticed that they have PyCharm coming out in beta now. I haven't been using PyCharm since I just use IntelliJ for everything, but is there a compelling reason to buy PyCharm? | Comparison of IntelliJ Python plugin or PyCharm | -0.039979 | 0 | 0 | 23,201 |
3,339,399 | 2010-07-26T22:14:00.000 | 2 | 0 | 1 | 0 | python,ide,intellij-idea,pycharm | 5,943,176 | 5 | false | 0 | 0 | Right now Pycharm does a much better job of detecting and automatically configuring itself to run existing Google App Engine apps. Using IntelliJ and the plugin requires quite a few steps to get an existing project to run.
In PyCharm all you really have to do is configure a run configuration
Script: /path/to/dev_apps... | 3 | 37 | 0 | So I have IntelliJ and love it, and have been using the Python plugin for a while. But I noticed that they have PyCharm coming out in beta now. I haven't been using PyCharm since I just use IntelliJ for everything, but is there a compelling reason to buy PyCharm? | Comparison of IntelliJ Python plugin or PyCharm | 0.07983 | 0 | 0 | 23,201 |
3,339,403 | 2010-07-26T22:15:00.000 | 14 | 0 | 1 | 0 | python,excel,vba,csv | 3,339,421 | 13 | false | 0 | 0 | Python is an excellent choice. The csv module makes reading and writing CSV files easy (even Microsoft's, uh, "idiosyncratic" version) and Python syntax is a breeze to pick up.
I'd actually recommend against Perl, if you're coming to it fresh. While Perl is certainly powerful and fast, it's often cryptic to the point... | 4 | 17 | 0 | VBA is not cutting it for me anymore. I have lots of huge Excel files to which I need to make lots of calculations and break them down into other Excel/CSV files.
I need a language that I can pick up within the next couple of days to do what I need, because it is kind of an emergency. I have been suggested python, but ... | Smallest learning curve language to work with CSV files | 1 | 0 | 0 | 11,359 |
3,339,403 | 2010-07-26T22:15:00.000 | 5 | 0 | 1 | 0 | python,excel,vba,csv | 3,339,414 | 13 | false | 0 | 0 | Python definitely has a small learning curve, and works with csv files well | 4 | 17 | 0 | VBA is not cutting it for me anymore. I have lots of huge Excel files to which I need to make lots of calculations and break them down into other Excel/CSV files.
I need a language that I can pick up within the next couple of days to do what I need, because it is kind of an emergency. I have been suggested python, but ... | Smallest learning curve language to work with CSV files | 0.076772 | 0 | 0 | 11,359 |
3,339,403 | 2010-07-26T22:15:00.000 | 2 | 0 | 1 | 0 | python,excel,vba,csv | 3,339,424 | 13 | false | 0 | 0 | That depends on what you want to do with the files.
Python's learning curve is less steep than R's. However, R has a bunch of built-in functions that make it very well suited for manipulating .csv files easily, particularly for statistical purposes.
Edit: I'd recommend R over Python for this purpose alone, if only bec... | 4 | 17 | 0 | VBA is not cutting it for me anymore. I have lots of huge Excel files to which I need to make lots of calculations and break them down into other Excel/CSV files.
I need a language that I can pick up within the next couple of days to do what I need, because it is kind of an emergency. I have been suggested python, but ... | Smallest learning curve language to work with CSV files | 0.03076 | 0 | 0 | 11,359 |
3,339,403 | 2010-07-26T22:15:00.000 | 2 | 0 | 1 | 0 | python,excel,vba,csv | 3,339,417 | 13 | false | 0 | 0 | Perl is surprisingly efficient for a scripting language for text. cpan.org has a tremendous number of modules for dealing with CSV data. I've also both written and wrote data in XLS format with another Perl module. If you were able to use VBA, you can certainly learn Perl (the basics of Perl are easy, though it's ju... | 4 | 17 | 0 | VBA is not cutting it for me anymore. I have lots of huge Excel files to which I need to make lots of calculations and break them down into other Excel/CSV files.
I need a language that I can pick up within the next couple of days to do what I need, because it is kind of an emergency. I have been suggested python, but ... | Smallest learning curve language to work with CSV files | 0.03076 | 0 | 0 | 11,359 |
3,339,971 | 2010-07-27T00:39:00.000 | 0 | 0 | 0 | 1 | java,python,android,sockets | 8,259,497 | 4 | false | 0 | 0 | The Android code is reading lines, so you need probably to send a \n or possibly \r\n at the end of your Python send string. | 1 | 0 | 0 | So I have a simple socket server on an android emulator. When I'm only sending data to it, it works just fine. But then if I want to echo that data back to the python script, it doesn't work at all. Here's the code that works:
android:
try {
serverSocket = new ServerSocket(port);
} catch ... | python receiving from a socket | 0 | 0 | 1 | 2,058 |
3,340,152 | 2010-07-27T01:28:00.000 | 3 | 0 | 0 | 0 | python,urllib | 3,340,185 | 1 | false | 0 | 0 | You can call getcode() on the object you get back from urlopen().
getcode() gives you the HTTP status response from the server, so you can test to see if you got an HTTP 200 response, which would mean the download was successful. | 1 | 1 | 0 | I want to download an image file from potentially 5 sites.
Meaning that if the image wasn't found in site#1, try site#2, etc.
How can I test if the file was downloaded? | When download an image, does urllib have a return code if it's successful or not? | 0.53705 | 0 | 1 | 153 |
3,340,639 | 2010-07-27T03:55:00.000 | 0 | 0 | 1 | 0 | python,user-interface | 3,340,779 | 2 | false | 0 | 1 | For a cross-platform solution, you could use wxPython with a wxSTAY_ON_TOP style bit in a main window. I believe that this will give you the behavior you desire on Mac and Unix GUIs as well as Microsoft Windows ones. | 1 | 0 | 0 | Just wondering if there is any kind of framework or method of making a Gui that will override (Stay on top of) all other windows in python. Including Games or other programs that seem to "Take over" the computers Graphical processes. Any point in the right direction would be much appreciated...
PS. The OS in question i... | GUI's Over Running Programs in python | 0 | 0 | 0 | 99 |
3,340,775 | 2010-07-27T04:39:00.000 | 1 | 0 | 1 | 0 | python,installation | 3,365,859 | 4 | false | 0 | 0 | In Python 3.x, print is now function and needs (). | 2 | 0 | 0 | I downloaded and installed Python 3.1.2 on Windows 7 x64. But it seems that it's not working as expected.
What's wrong here? | What's wrong with my Python installation? | 0.049958 | 0 | 0 | 181 |
3,340,775 | 2010-07-27T04:39:00.000 | 0 | 0 | 1 | 0 | python,installation | 3,340,871 | 4 | false | 0 | 0 | As stated above python 3.x now requires all statements such as those to be function calls, Python 3.x is supposed to bring back the functional aspect of C to python although code that works in 3.x will most likely work in 2.x but not necessarily the other way around. | 2 | 0 | 0 | I downloaded and installed Python 3.1.2 on Windows 7 x64. But it seems that it's not working as expected.
What's wrong here? | What's wrong with my Python installation? | 0 | 0 | 0 | 181 |
3,340,803 | 2010-07-27T04:44:00.000 | 2 | 0 | 1 | 0 | python | 3,340,981 | 3 | false | 0 | 0 | The "asking" part, as @Zonda's answer says, could use raw_input (or Python 3's input) at a terminal ("command window" in Windows); but it could also use a web application, or a GUI application -- you don't really tell us enough about where the users will be (on the same machine you're using to run your code, or at a br... | 1 | 0 | 0 | say i want to ask the many users to give me their ID number and their name, than save it.
and than i can call any ID and get the name. can someone tell me how i can do that by making a class and using the _ _ init _ _ method? | saving data and calling data python | 0.132549 | 0 | 0 | 250 |
3,343,082 | 2010-07-27T11:25:00.000 | 0 | 0 | 0 | 0 | python,soap,xml-rpc,xmlrpclib | 3,343,497 | 2 | false | 0 | 0 | Whether or not possible support of multicall makes any difference to you depends on where the 700ms is going.
How did you measure your 700ms?
Run a packet capture of a query and analyse the results. It should be possible to infer roughly round-trip-time, bandwidth constraints, whether it's the application layer of the ... | 1 | 0 | 0 | Can I ask for few question in one post to XML-RPC server?
If yes, how can I do it in python and xmlrpclib?
I'm using XML-RPC server on slow connection, so I would like to call few functions at once, because each call costs me 700ms. | Does XML-RPC in general allows to call few functions at once? | 0 | 0 | 1 | 231 |
3,343,793 | 2010-07-27T12:54:00.000 | 3 | 0 | 1 | 1 | python,user-interface,windows-services | 3,343,894 | 2 | true | 0 | 0 | If you give your Service the Allow service to interact with desktop permission it will be able to create windows without the need to launch a subprocess. | 1 | 0 | 0 | I am creating Windows service class in Python that will eventually display a Window when certain conditions are met. Since (as I understand it) services cannot have GUIs, I'm trying to start up a GUI in a seperate process (using subprocess.Popen) when the conditions are right. This isn't working, presumably because the... | Starting a GUI process from a Python Windows Service | 1.2 | 0 | 0 | 1,456 |
3,345,785 | 2010-07-27T16:32:00.000 | 0 | 0 | 1 | 0 | python,iterator | 19,849,720 | 19 | false | 0 | 0 | This is against the very definition of an iterator, which is a pointer to an object, plus information about how to get to the next object.
An iterator does not know how many more times it will be able to iterate until terminating. This could be infinite, so infinity might be your answer. | 5 | 192 | 0 | Is there an efficient way to know how many elements are in an iterator in Python, in general, without iterating through each and counting? | Getting number of elements in an iterator in Python | 0 | 0 | 0 | 184,194 |
3,345,785 | 2010-07-27T16:32:00.000 | 0 | 0 | 1 | 0 | python,iterator | 3,346,287 | 19 | false | 0 | 0 | It's common practice to put this type of information in the file header, and for pysam to give you access to this. I don't know the format, but have you checked the API?
As others have said, you can't know the length from the iterator. | 5 | 192 | 0 | Is there an efficient way to know how many elements are in an iterator in Python, in general, without iterating through each and counting? | Getting number of elements in an iterator in Python | 0 | 0 | 0 | 184,194 |
3,345,785 | 2010-07-27T16:32:00.000 | 3 | 0 | 1 | 0 | python,iterator | 3,345,950 | 19 | false | 0 | 0 | There are two ways to get the length of "something" on a computer.
The first way is to store a count - this requires anything that touches the file/data to modify it (or a class that only exposes interfaces -- but it boils down to the same thing).
The other way is to iterate over it and count how big it is. | 5 | 192 | 0 | Is there an efficient way to know how many elements are in an iterator in Python, in general, without iterating through each and counting? | Getting number of elements in an iterator in Python | 0.031568 | 0 | 0 | 184,194 |
3,345,785 | 2010-07-27T16:32:00.000 | 9 | 0 | 1 | 0 | python,iterator | 3,345,902 | 19 | false | 0 | 0 | An iterator is just an object which has a pointer to the next object to be read by some kind of buffer or stream, it's like a LinkedList where you don't know how many things you have until you iterate through them. Iterators are meant to be efficient because all they do is tell you what is next by references instead of... | 5 | 192 | 0 | Is there an efficient way to know how many elements are in an iterator in Python, in general, without iterating through each and counting? | Getting number of elements in an iterator in Python | 1 | 0 | 0 | 184,194 |
3,345,785 | 2010-07-27T16:32:00.000 | 8 | 0 | 1 | 0 | python,iterator | 3,505,917 | 19 | false | 0 | 0 | Regarding your original question, the answer is still that there is no way in general to know the length of an iterator in Python.
Given that you question is motivated by an application of the pysam library, I can give a more specific answer: I'm a contributer to PySAM and the definitive answer is that SAM/BAM files do... | 5 | 192 | 0 | Is there an efficient way to know how many elements are in an iterator in Python, in general, without iterating through each and counting? | Getting number of elements in an iterator in Python | 1 | 0 | 0 | 184,194 |
3,345,916 | 2010-07-27T16:49:00.000 | 10 | 0 | 0 | 0 | java,python,html,django,mobile | 3,346,150 | 8 | false | 1 | 0 | Django wasn't trying to innovate in how web sites are displayed in the browser. Their goal was to simplify the process of building a web site. They could have taken on new ways of creating widgets in the browser as part of that goal, but they didn't. There was plenty of pain to relieve in the classic construction of ... | 5 | 6 | 0 | I am trying to get a handle on the state of the art regarding web site development and have several questions. Maybe I'll end up finding most of the answers on my own. I come from a background of C++ and Windows development, and generally I am befuddled by what seems to be the ad-hoc nature of web development.
I focus... | Big picture questions regarding Django, Java, Python, HTML and web-site development in general | 1 | 0 | 0 | 1,807 |
3,345,916 | 2010-07-27T16:49:00.000 | 7 | 0 | 0 | 0 | java,python,html,django,mobile | 3,346,994 | 8 | false | 1 | 0 | All the innovation would concern database issues, business logic, reusability of code, etc - but not actually anything new regarding innovative visual controls or graphics for a web-site
Correct. Good assessment. Is that a problem?
html might be analagous to assembler, so a conventional application developer from y... | 5 | 6 | 0 | I am trying to get a handle on the state of the art regarding web site development and have several questions. Maybe I'll end up finding most of the answers on my own. I come from a background of C++ and Windows development, and generally I am befuddled by what seems to be the ad-hoc nature of web development.
I focus... | Big picture questions regarding Django, Java, Python, HTML and web-site development in general | 1 | 0 | 0 | 1,807 |
3,345,916 | 2010-07-27T16:49:00.000 | 1 | 0 | 0 | 0 | java,python,html,django,mobile | 3,452,710 | 8 | false | 1 | 0 | And I would have thought previously that html might be analagous to assembler, so a conventional application developer from years past might know and occasionally even use a little assembler, but generally would hardly ever use it, whereas from what I can see, html (and also CSS and javascript) still have to be mastere... | 5 | 6 | 0 | I am trying to get a handle on the state of the art regarding web site development and have several questions. Maybe I'll end up finding most of the answers on my own. I come from a background of C++ and Windows development, and generally I am befuddled by what seems to be the ad-hoc nature of web development.
I focus... | Big picture questions regarding Django, Java, Python, HTML and web-site development in general | 0.024995 | 0 | 0 | 1,807 |
3,345,916 | 2010-07-27T16:49:00.000 | 1 | 0 | 0 | 0 | java,python,html,django,mobile | 3,347,792 | 8 | false | 1 | 0 | From what I read, ROR tries to do everything for you behind the scenes and so therefore is slow and unscalable (and overhyped and not ready for prime time).
Well, first of all, you shouldn't believe everything you read on the Internet:
I wouldn't say RoR isn't ready for primetime. RoR, like any tool, has its uses. If... | 5 | 6 | 0 | I am trying to get a handle on the state of the art regarding web site development and have several questions. Maybe I'll end up finding most of the answers on my own. I come from a background of C++ and Windows development, and generally I am befuddled by what seems to be the ad-hoc nature of web development.
I focus... | Big picture questions regarding Django, Java, Python, HTML and web-site development in general | 0.024995 | 0 | 0 | 1,807 |
3,345,916 | 2010-07-27T16:49:00.000 | 2 | 0 | 0 | 0 | java,python,html,django,mobile | 3,347,103 | 8 | false | 1 | 0 | And I would have thought previously that html might be analagous to assembler, so a conventional application developer from years past might know and occasionally even use a little assembler, but generally would hardly ever use it, whereas from what I can see, html (and also CSS and javascript) still have to be mastere... | 5 | 6 | 0 | I am trying to get a handle on the state of the art regarding web site development and have several questions. Maybe I'll end up finding most of the answers on my own. I come from a background of C++ and Windows development, and generally I am befuddled by what seems to be the ad-hoc nature of web development.
I focus... | Big picture questions regarding Django, Java, Python, HTML and web-site development in general | 0.049958 | 0 | 0 | 1,807 |
3,346,262 | 2010-07-27T17:34:00.000 | 1 | 1 | 1 | 0 | python,metaclass,traits | 4,833,132 | 2 | false | 0 | 0 | Specifically, all of the classes in the "published" API will subclass a particular base class, PythonDirectPublic
Rather than adding another metaclass, you could recursively use the result of PythonDirectPublic.subclasses(). | 1 | 9 | 0 | I have an esoteric question involving Python metaclasses. I am creating a Python package for web-server-side code that will make it easy to access arbitrary Python classes via client-side proxies. My proxy-generating code needs a catalog of all of the Python classes that I want to include in my API. To create this c... | Python: Metaclasses all the way down | 0.099668 | 0 | 0 | 715 |
3,346,430 | 2010-07-27T17:58:00.000 | 10 | 1 | 1 | 0 | python,file,seek | 3,346,499 | 12 | false | 0 | 0 | Can you use unix commands? I think using head -1 and tail -n 1 are probably the most efficient methods. Alternatively, you could use a simple fid.readline() to get the first line and fid.readlines()[-1], but that may take too much memory. | 1 | 77 | 0 | I have a text file which contains a time stamp on each line. My goal is to find the time range. All the times are in order so the first line will be the earliest time and the last line will be the latest time. I only need the very first and very last line. What would be the most efficient way to get these lines in pyth... | What is the most efficient way to get first and last line of a text file? | 1 | 0 | 0 | 139,998 |
3,346,482 | 2010-07-27T18:05:00.000 | 2 | 1 | 1 | 0 | python,pythonpath | 3,346,786 | 3 | false | 0 | 0 | If you really must have a split package like this, read up on the module level attribute __path__.
In short, make one of the 'src' directories the main one, and give it an __init__.py that appends the path of other 'src' to the __path__ list. Python will now look in both places when looking up submodules of 'src'.
I re... | 1 | 3 | 0 | I'm having problems with my PythonPath on windows XP, and I'm wondering if I'm doing something wrong.
Say that I have a project (created with Pydev) that has an src directory. Under src I have a single package, named common, and in it a single class module, named service.py with a class name Service
Say now that I have... | PYTHONPATH hell with overlapping package structures | 0.132549 | 0 | 0 | 1,088 |
3,346,970 | 2010-07-27T19:04:00.000 | 2 | 0 | 0 | 0 | java,python,android,sl4a | 3,347,032 | 5 | false | 1 | 0 | More likely will depend what type of applications you will develop.
I would start with Java to become familiar with Android SDK. Anyway first you need to look into some examples, tutorials. Most of them are done in Java, and only a few, probably on the dev site of SL4A for that.
Also there is native development Androi... | 1 | 12 | 0 | I just ordered an Android smartphone and want to start playing around with creating my own applications. Now the question is which language to use, the native Java or Python using SL4A (former ASE).
I tend to Python, as I know it much better than Java, but I'm wondering what I would be missing using a "second class" la... | Starting with Android: Java or Python (SL4A) | 0.07983 | 0 | 0 | 11,760 |
3,347,102 | 2010-07-27T19:20:00.000 | 5 | 0 | 1 | 0 | python,iterator | 3,347,150 | 6 | false | 0 | 0 | Nope sorry iterators are not meant to know length they just know what's next which makes them very efficient at going through Collections. Although they are faster they do no allow for indexing which including knowing the length of a collection. | 1 | 14 | 0 | I am looking through some text file for a certain string with the method.
re.finditer(pattern,text) I would like to know when this returns nothing. meaning that it could find nothing in the passed text.
I know that callable iterators, have next() and __iter__
I would like to know if I could get the size or find out if... | python -- callable iterator size? | 0.16514 | 0 | 0 | 15,464 |
3,348,912 | 2010-07-27T23:59:00.000 | 0 | 0 | 0 | 0 | python,django,web-applications | 33,887,695 | 3 | false | 1 | 0 | Try Django Rest Framework with angular.
You can have the Django/Django Rest as backend.
For frontend you can have angular or react.js with nodejs or python simplehttp server or grunt or gulp running.
So front end will communicate to django server to get data. For logging in, you could use auth-token and angular cooki... | 1 | 0 | 0 | I am trying to build a django service to which numerous clients will send data. Each client will represent an authenticated user, who might be connected to the internet or not, so the client will aggregate the data and send them when a connection is available. The data should also be persisted locally so that they are ... | Sending data to django site | 0 | 0 | 0 | 2,883 |
3,349,156 | 2010-07-28T00:56:00.000 | 0 | 1 | 1 | 0 | php,python,c | 3,599,951 | 6 | true | 0 | 0 | No such tool exists yet. | 1 | 5 | 0 | I am looking for a command-line tool that removes all comments from an input
file and returns the stripped output. It'd be nice it supports popular
programming languages like c, c++, python, php, javascript, html, css, etc. It
has to be syntax-aware as opposed to regexp-based, since the latter will catch
the pattern i... | General utility to remove/strip all comments from source code in various languages? | 1.2 | 0 | 0 | 3,169 |
3,349,445 | 2010-07-28T02:23:00.000 | 4 | 0 | 0 | 0 | php,python,mysql,variables,share | 3,349,485 | 1 | true | 0 | 0 | Store the shared configuration in a plain text file, preferably in a standard format.
You might consider yaml, ini, or json.
I'm pretty sure both PHP and python can very trivially read and parse all three of those formats. | 1 | 0 | 0 | I have some MySQL database server information that needs to be shared between a Python backend and a PHP frontend.
What is the best way to go about storing the information in a manner wherein it can be read easily by Python and PHP?
I can always brute force it with a bunch of str.replace() calls in Python and hope it w... | Python - PHP Shared MySQL server connection info? | 1.2 | 1 | 0 | 200 |
3,349,614 | 2010-07-28T03:07:00.000 | 0 | 0 | 0 | 0 | python,concurrency,memcached | 3,349,680 | 2 | false | 1 | 0 | Which is a bigger problem: having redundant data, or getting more than one result back for a query?
If the former is the problem, then you've got a nasty concurrency issue to solve on your hands.
If the latter is the problem, however, why not just give each host that's storing values in memcache a unique identifier, an... | 1 | 0 | 0 | We are using a cluster of memcached servers for caching purpose, in a Django(Python) production, having tried both cmemcache and python-memcache as the API. The problem is under high concurrency, we started to have duplicate key-value pairs, that is to say we are having multi values for a single key. Is there anyone ha... | Duplicate key-value pairs returned by memcached | 0 | 0 | 0 | 757 |
3,350,068 | 2010-07-28T05:06:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine | 3,350,082 | 2 | false | 1 | 0 | Looks like you are not doing a commit on the transaction before querying
start a db transaction
update entityX by setting entityX.flag = True
save entityX
COMMIT TRANSACTION
query for entity where flag == True. BUT, here is the problem. This query does NOT return any results. It should have returned entityX, but it d... | 1 | 2 | 0 | I store groups of entities in the google app engine Data Store with the same ancestor/parent/entityGroup. This is so that the entities can be updated in one atomic datastore transaction.
The problem is as follows:
I start a db transaction
I update entityX by setting entityX.flag = True
I save entityX
I query for entit... | On the google app engine, why do updates not reflect in a transaction? | 0 | 1 | 0 | 215 |
3,350,282 | 2010-07-28T06:02:00.000 | 1 | 0 | 0 | 1 | python,twisted,stackless | 3,350,509 | 2 | false | 0 | 0 | Multiple NICs, the hardware or the kernel interface is the limit. I can only reach 69,000 packets per second with a Broadcom Corporation NetXtreme BCM5704S Gigabit Ethernet adapter. Try a quad Intel Gigabit Server Adapter with all four NICs on the same subnet. | 2 | 1 | 0 | We're building a test harness to push binary messages out on a UDP multicast.
The prototype is using the Twisted reactor loop to push out messages, which is achieving just about the level of traffic we require - about 120000 messages per second.
We have a 16 cores on our test machine, and obviously I'd like to spread t... | Fastest way to produce UDP packets | 0.099668 | 0 | 0 | 371 |
3,350,282 | 2010-07-28T06:02:00.000 | 1 | 0 | 0 | 1 | python,twisted,stackless | 3,352,556 | 2 | false | 0 | 0 | The obvious answer when the question of exploiting multiple cores in a Python application comes up is to use multiple processes. With Twisted, you can use reactor.spawnProcess to launch a child process. You could also just start 16 instances of your application some other way (like a shell script). This requires tha... | 2 | 1 | 0 | We're building a test harness to push binary messages out on a UDP multicast.
The prototype is using the Twisted reactor loop to push out messages, which is achieving just about the level of traffic we require - about 120000 messages per second.
We have a 16 cores on our test machine, and obviously I'd like to spread t... | Fastest way to produce UDP packets | 0.099668 | 0 | 0 | 371 |
3,350,972 | 2010-07-28T08:06:00.000 | 0 | 0 | 0 | 0 | python,model-view-controller,design-patterns,pylons | 3,410,261 | 2 | false | 1 | 0 | Model is for your db-related code. All queries go there, including adding new records/updating existing ones.
Controllers are somewhat ambigous, different projects use different approaches to it. Reddit for example does fair bit of what should be View in controllers.
I, for one, prefer to limit my controllers to reques... | 1 | 0 | 0 | I've been getting more and more interested in using Pylons as my Python web framework and I like the idea of MVC but, coming from a background of never using 'frameworks/design patterns/ what ever it\'s called', I don't really know how to approach it.
From what I've read in the Pylons Book, so far, it seems I do the fo... | Getting started with Pylons and MVC - Need some guidance on design | 0 | 0 | 0 | 155 |
3,351,110 | 2010-07-28T08:28:00.000 | 2 | 1 | 1 | 0 | c++,python,visual-studio,eclipse | 3,776,671 | 2 | false | 0 | 0 | If the C++ app runs as a separate process then its pretty easy. You can run the process yourself or attach visual studio to existing running process and put break points.
If C++ code is an embedded DLL/LIB then you can use python as debug/launch process. As soon as python will load the DLL/LIB into your python code v... | 1 | 4 | 0 | Does any one know how we can do this?
I have python code in eclipse and whenever it calls c++ functions, i want the break point to go to the visual studio c++ project. | Debug C++ code in visual studio from python code running in eclipse | 0.197375 | 0 | 0 | 1,619 |
3,351,484 | 2010-07-28T09:22:00.000 | 1 | 1 | 1 | 0 | python,file | 3,351,513 | 3 | false | 0 | 0 | This is just impossible.
Any user with administrative rights can remove readonly restrictions of any kind.
Another option might be "Write a python program to kill all users over the worls so that they would not be able to change file attributes or security settings" :-) | 3 | 0 | 0 | Is it possible to create read only files in python which can not be changed later and in which users can not change its attribute from read-only to normal file?
Please suggest.
Thanks in advance. | Creating read only text files with python | 0.066568 | 0 | 0 | 3,100 |
3,351,484 | 2010-07-28T09:22:00.000 | 3 | 1 | 1 | 0 | python,file | 3,351,517 | 3 | true | 0 | 0 | This is not python specific.
If the files are made by a different user that the one viewing it the script can make it read-only. As the file is owned by the python user, the viewing user cannot just change the attributes.
So it's very much an OS question, and not a Python question.
Oh, and there is no way to prevent an... | 3 | 0 | 0 | Is it possible to create read only files in python which can not be changed later and in which users can not change its attribute from read-only to normal file?
Please suggest.
Thanks in advance. | Creating read only text files with python | 1.2 | 0 | 0 | 3,100 |
3,351,484 | 2010-07-28T09:22:00.000 | 0 | 1 | 1 | 0 | python,file | 3,352,472 | 3 | false | 0 | 0 | Take a look at os.chmod() function and execute it with appropriate parameters (filename, stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH) for your just created file.
On linux other users then you will not be able to change file or change attributes to writable.
Some root user or someone logged into you account will be able ... | 3 | 0 | 0 | Is it possible to create read only files in python which can not be changed later and in which users can not change its attribute from read-only to normal file?
Please suggest.
Thanks in advance. | Creating read only text files with python | 0 | 0 | 0 | 3,100 |
3,351,963 | 2010-07-28T10:28:00.000 | 1 | 0 | 0 | 0 | python,live,charts | 3,352,172 | 3 | false | 0 | 0 | I havent worked with Matplotlib but I've always found gnuplot to be adequate for all my charting needs.
You have the option of calling gnuplot from python or using gnuplot.py
(gnuplot-py.sourceforge.net) to interface to gnuplot. | 1 | 6 | 1 | I am working on a Python application that involves running regression analysis on live data, and charting both. That is, the application gets fed with live data, and the regression models re-calculates as the data updates. Please note that I want to plot both the input (the data) and output (the regression analysis) in... | Good framework for live charting in Python? | 0.066568 | 0 | 0 | 5,782 |
3,352,563 | 2010-07-28T11:58:00.000 | 2 | 0 | 0 | 0 | python,html,parsing,beautifulsoup,case-insensitive | 3,352,681 | 2 | false | 1 | 0 | BeautifulSoup standardises the parse tree on input. It converts tags to lower-case. You don't have anything to worry about IMO. | 1 | 4 | 0 | I want to catch some tags with BeautifulSoup: Some <p> tags, the <title> tag, some <meta> tags. But I want to catch them regardless of their case; I know that some sites do meta like this: <META> and I want to be able to catch that.
I noticed that BeautifulSoup is case-sensitive by default. How do I catch these tags in... | Getting BeautifulSoup to catch tags in a non-case-sensitive way | 0.197375 | 0 | 0 | 3,331 |
3,355,822 | 2010-07-28T17:51:00.000 | 0 | 0 | 0 | 0 | python,authentication,httprequest,token | 3,355,925 | 4 | true | 0 | 0 | class urllib2.HTTPSHandler
A class to handle opening of HTTPS URLs.
21.6.7. HTTPPasswordMgr Objects
These methods are available on HTTPPasswordMgr and HTTPPasswordMgrWithDefaultRealm objects.
HTTPPasswordMgr.add_password(realm, uri, user, passwd)
uri can be either a single URI, or a sequence of URIs. realm, user and ... | 1 | 7 | 0 | how and with which python library is it possible to make an httprequest (https) with a user:password or a token?
basically the equivalent to curl -u user:pwd https://www.mysite.com/
thank you | python http request with token | 1.2 | 0 | 1 | 2,459 |
3,355,832 | 2010-07-28T17:52:00.000 | 2 | 1 | 0 | 0 | c#,python,file | 3,355,927 | 6 | false | 0 | 0 | You may consider running IronPython - then you can pass values back and forth across C#/Python | 2 | 4 | 1 | I have a C# application that needs to be run several thousand times. Currently it precomputes a large table of constant values at the start of the run for reference. As these values will be the same from run to run I would like to compute them independently in a simple python script and then just have the C# app impo... | Suggestions for passing large table between Python and C# | 0.066568 | 0 | 0 | 1,046 |
3,355,832 | 2010-07-28T17:52:00.000 | 1 | 1 | 0 | 0 | c#,python,file | 3,356,036 | 6 | false | 0 | 0 | CSV is fine suggestion, but may be clumsy with values being int and double. Generally tab or semicomma are best separators. | 2 | 4 | 1 | I have a C# application that needs to be run several thousand times. Currently it precomputes a large table of constant values at the start of the run for reference. As these values will be the same from run to run I would like to compute them independently in a simple python script and then just have the C# app impo... | Suggestions for passing large table between Python and C# | 0.033321 | 0 | 0 | 1,046 |
3,355,962 | 2010-07-28T18:06:00.000 | 0 | 1 | 0 | 0 | python,compression,tiff,imaging,image-formats | 3,357,139 | 2 | false | 0 | 0 | How about running tiffcp with subprocess to convert to LZW (-c lzw switch), then process normally with pylibtiff? There are Windows builds of tiffcp lying around on the web. Not exactly Python-native solution, but still... | 1 | 2 | 1 | I am trying to load a CCITT T.3 compressed tiff into python, and get the pixel matrix from it. It should just be a logical matrix.
I have tried using pylibtiff and PIL, but when I load it with them, the matrix it returns is empty. I have read in a lot of places that these two tools support loading CCITT but not access... | What is the best way to load a CCITT T.3 compressed tiff using python? | 0 | 0 | 0 | 1,297 |
3,356,262 | 2010-07-28T18:42:00.000 | 1 | 0 | 1 | 0 | python | 3,356,307 | 7 | false | 0 | 0 | Yes, it would be bad practice to access sys.argv from f.
I would suggest passing the neccessary arguments into f. But since f won't neccessarily be called from main...maybe use a global variable? I normally try to avoid them, but in your case... >.>
I guess it would help to know a little more info about the way the pr... | 6 | 3 | 0 | I am writing a script and I have a function, call it f(), that needs one of the command line arguments (a filename it needs to open). However, f() is not called directly in the main function.
I was wondering if it was bad coding convention to call sys.argv[1] straight from f()? If I don't I would have to pass it as an... | is it bad convention to call sys.argv from somewhere besides main function in python | 0.028564 | 0 | 0 | 494 |
3,356,262 | 2010-07-28T18:42:00.000 | 0 | 0 | 1 | 0 | python | 3,356,911 | 7 | false | 0 | 0 | I would generally advise against it, but BaseHttpServer in python actually uses sys.argv[1] to determine which port to listen on. Convenience maybe. | 6 | 3 | 0 | I am writing a script and I have a function, call it f(), that needs one of the command line arguments (a filename it needs to open). However, f() is not called directly in the main function.
I was wondering if it was bad coding convention to call sys.argv[1] straight from f()? If I don't I would have to pass it as an... | is it bad convention to call sys.argv from somewhere besides main function in python | 0 | 0 | 0 | 494 |
3,356,262 | 2010-07-28T18:42:00.000 | 0 | 0 | 1 | 0 | python | 3,356,308 | 7 | false | 0 | 0 | You definitely don't want to parse sys.argv in some low-level function. To avoid lots of parameter-passing, you could provide a helper-function called by main() that simply stores the filename into a static variable for later use by f(). | 6 | 3 | 0 | I am writing a script and I have a function, call it f(), that needs one of the command line arguments (a filename it needs to open). However, f() is not called directly in the main function.
I was wondering if it was bad coding convention to call sys.argv[1] straight from f()? If I don't I would have to pass it as an... | is it bad convention to call sys.argv from somewhere besides main function in python | 0 | 0 | 0 | 494 |
3,356,262 | 2010-07-28T18:42:00.000 | 4 | 0 | 1 | 0 | python | 3,356,276 | 7 | false | 0 | 0 | It is bad form to access sys.argv from anywhere other than your main routine since it couples that code to the command line, making it difficult to use from other Python scripts. | 6 | 3 | 0 | I am writing a script and I have a function, call it f(), that needs one of the command line arguments (a filename it needs to open). However, f() is not called directly in the main function.
I was wondering if it was bad coding convention to call sys.argv[1] straight from f()? If I don't I would have to pass it as an... | is it bad convention to call sys.argv from somewhere besides main function in python | 0.113791 | 0 | 0 | 494 |
3,356,262 | 2010-07-28T18:42:00.000 | 1 | 0 | 1 | 0 | python | 3,356,311 | 7 | false | 0 | 0 | I would recommend setting the file name once, from sys.argv[1] if it exists, or demand user input if it doesn't. Then store it as part of an object, or a global variable. That will prevent having to pass what is essentially a static string all over the place, once it is set. | 6 | 3 | 0 | I am writing a script and I have a function, call it f(), that needs one of the command line arguments (a filename it needs to open). However, f() is not called directly in the main function.
I was wondering if it was bad coding convention to call sys.argv[1] straight from f()? If I don't I would have to pass it as an... | is it bad convention to call sys.argv from somewhere besides main function in python | 0.028564 | 0 | 0 | 494 |
3,356,262 | 2010-07-28T18:42:00.000 | 6 | 0 | 1 | 0 | python | 3,356,278 | 7 | true | 0 | 0 | It would be a bad practice to always assume that the arguments that your function needs are available on the command-line - what if this code was invoked in some other manner?
A function should declare input parameters for the data it needs to access.
At the very least, passing the necessary argument into f() rather th... | 6 | 3 | 0 | I am writing a script and I have a function, call it f(), that needs one of the command line arguments (a filename it needs to open). However, f() is not called directly in the main function.
I was wondering if it was bad coding convention to call sys.argv[1] straight from f()? If I don't I would have to pass it as an... | is it bad convention to call sys.argv from somewhere besides main function in python | 1.2 | 0 | 0 | 494 |
3,356,554 | 2010-07-28T19:16:00.000 | 0 | 0 | 0 | 0 | java,python,ipc,multiprocessing,multiple-processes | 35,616,834 | 6 | false | 1 | 0 | I had a similar situation where I had to communicate between a Java process and a Linux process. I used named pipes.
Try mkfifo() implementation in python. | 1 | 17 | 0 | First, a little explanation of why I'm asking this question in the first place:
I'm writing a python program (with a wxPython gui) that needs to call a Java AWT program from python and extract data from it. I have an in-process working solution on Windows. I also have an in-process solution on OSX so long as I run the ... | IPC (inter process communication) between python and java | 0 | 0 | 0 | 16,516 |
3,356,964 | 2010-07-28T20:01:00.000 | 101 | 0 | 0 | 0 | python,django,internationalization | 3,359,880 | 6 | false | 1 | 0 | Or you can also get this in your views
request.LANGUAGE_CODE | 2 | 110 | 0 | How can I get the current language in the current thread in a model or in the admin? | How can I get the current language in Django? | 1 | 0 | 0 | 85,439 |
3,356,964 | 2010-07-28T20:01:00.000 | 9 | 0 | 0 | 0 | python,django,internationalization | 19,680,511 | 6 | false | 1 | 0 | Just to add that if you do use django.utils.translation.get_language() then you should bear in mind that if that section of code will be called asynchronously (e.g. as a celery task) then this approach won't work due to it running in a different thread. | 2 | 110 | 0 | How can I get the current language in the current thread in a model or in the admin? | How can I get the current language in Django? | 1 | 0 | 0 | 85,439 |
3,357,472 | 2010-07-28T21:03:00.000 | 1 | 0 | 0 | 1 | python,django,celery | 3,358,271 | 2 | false | 0 | 0 | You should store some 'pause' value outside of celery/task queue. I do this with a mailer using celery. I can pause parts of the system by setting values in either memcache or mysql. The tasks then make sure to query the outside resource before executing the task. If it's meant to be paused it sets it does a task.retry... | 1 | 7 | 0 | Not talking about the delay method.
I want to be able to get a task, given it's task_id and change it's ETA on the fly, before it is executed.
For now I have to cancel it, and re-schedule one. Troublesome if the scheduled process involve a lot of stuff. | How do I delay a task using Celery? | 0.099668 | 0 | 0 | 4,358 |
3,357,489 | 2010-07-28T21:06:00.000 | 4 | 0 | 0 | 1 | python,django,celery | 3,379,809 | 1 | true | 1 | 0 | You can certainly use "natural ids", but then to be really useful they would have to
be reverseable, which doesn't work if you add that timestamp. Also the ids are unique, so two tasks can't have the same id (the behavior then is undefined)
If you have a task to refresh the timeline of a twitter user, then you know tha... | 1 | 4 | 0 | For now I get a task_id from the async_result and have to save it the get it back later.
Would be better if I knew what the task_id what made of so I can calculate it back instead of pulling from the DB. E.G: set a task with task_id=("%s-%s" % (user_id, datetime)). | How do I choose a task_id using celery? | 1.2 | 0 | 0 | 604 |
3,357,608 | 2010-07-28T21:23:00.000 | 0 | 0 | 1 | 0 | ironpython | 46,282,462 | 4 | false | 0 | 0 | This will work :
os.rename("c://your_directory/old_folder_name","c://your_directory/new_folder_name") | 2 | 4 | 0 | for example:
how to rename C:\Program Files\Music_Files to C:\Program Files\MusicFiles | IronPython - how to rename a folder name | 0 | 0 | 0 | 5,069 |
3,357,608 | 2010-07-28T21:23:00.000 | 0 | 0 | 1 | 0 | ironpython | 3,357,656 | 4 | false | 0 | 0 | Why not use the .Net libraries, since IronPython can access them?
System.IO.Directory should have a Move method that you can use. | 2 | 4 | 0 | for example:
how to rename C:\Program Files\Music_Files to C:\Program Files\MusicFiles | IronPython - how to rename a folder name | 0 | 0 | 0 | 5,069 |
3,357,779 | 2010-07-28T21:46:00.000 | 0 | 0 | 0 | 0 | python,django,django-admin | 3,357,805 | 1 | true | 1 | 0 | You are probably not serving javascript files properly. To have this functionality, proper javascript must loaded. | 1 | 0 | 0 | In my localhost Django administrator I am able to fill-in Date and Time fields by clicking on the little "Date" and "Time" helper icons next to my pub_date field. However, the same administrator on my Server does NOT show these icons. The server-side admin also doesn't pop open a pop-up window for the little "+" plus s... | Django Admin "Helper" Functionality Not Working on Server | 1.2 | 0 | 0 | 78 |
3,357,984 | 2010-07-28T22:13:00.000 | 3 | 0 | 1 | 0 | python,list,tuples | 3,357,997 | 4 | false | 0 | 0 | Lists are mutable (can be changed), tuples are immutable. Typical use: it sounds rather trite but you use lists when you need to change the values. Tuples are generally a little more efficient because of their immutability (unless you are using them like lists and duplicating them a lot...) | 1 | 7 | 0 | Which is more efficient? What is the typical use of each? | What is the difference between lists and tuples in Python? | 0.148885 | 0 | 0 | 3,089 |
3,358,126 | 2010-07-28T22:42:00.000 | 4 | 1 | 0 | 1 | python,winapi,io | 3,358,136 | 2 | false | 0 | 0 | The most obvious thing seems to be losing cross-platform compatibilty. Python runs on a number of different platforms, none of which has a win32 API except MS Windows. | 2 | 1 | 0 | What are the Pro's and Con's of using win32api for I/O and other things instead of simply Python, if both have a specific function for it
I mean, using PyWin32 vs Win32Api | win32api vs Python | 0.379949 | 0 | 0 | 390 |
3,358,126 | 2010-07-28T22:42:00.000 | 5 | 1 | 0 | 1 | python,winapi,io | 3,358,143 | 2 | true | 0 | 0 | con
(lack of) portability
harder/more error prone
pro
performance (potentially, it must be measured, as will depend on more than just the api calls) | 2 | 1 | 0 | What are the Pro's and Con's of using win32api for I/O and other things instead of simply Python, if both have a specific function for it
I mean, using PyWin32 vs Win32Api | win32api vs Python | 1.2 | 0 | 0 | 390 |
3,358,666 | 2010-07-29T00:41:00.000 | 0 | 0 | 0 | 0 | python,oracle,cx-oracle | 3,373,296 | 2 | false | 0 | 0 | In the interest of getting shit done that is good enough, we did the abuse of the CLOB I mentioned in my comment. It took less than 30 minutes to get coded up, runs fast and works. | 1 | 0 | 0 | We need to bulk load many long strings (>4000 Bytes, but <10,000 Bytes) using cx_Oracle. The data type in the table is CLOB. We will need to load >100 million of these strings. Doing this one by one would suck. Doing it in a bulk fashion, ie using cursor.arrayvar() would be ideal. However, CLOB does not support arrays.... | Passing an array of long strings ( >4000 bytes) to an Oracle (11gR2) stored procedure using cx_Oracle | 0 | 1 | 0 | 1,252 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.