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
8,274,703
2011-11-25T22:13:00.000
1
0
0
1
python,image-processing
8,274,728
4
false
0
0
Read up your favorite literature on the subject of digital watermarking. It's not trivial if you want it to be robust to various distortions, image compression, transparency, etc. - nothing I can answer here in a few lines.
2
2
0
can anybody give me advice how i process a BMP file so that i can check if a logo is present in that file? E.g. I have a Foto. My logo is supplied in another bmp file. I want to check if my logo is part of that foto, if it is visible. Bonus question: My logo can have transparencies in it. Does that change anything?
How do i check if a logo is in a BMP file?
0.049958
0
0
207
8,274,703
2011-11-25T22:13:00.000
-2
0
0
1
python,image-processing
8,274,772
4
false
0
0
Bonus answer: if you what the logo with a transparent background let say no background use a .png or .gif file, if you want 20% transparencies u can use CSS Image Opacity / Transparency or save you logo as a png with a transparent filter you can do this in adobe fireworks
2
2
0
can anybody give me advice how i process a BMP file so that i can check if a logo is present in that file? E.g. I have a Foto. My logo is supplied in another bmp file. I want to check if my logo is part of that foto, if it is visible. Bonus question: My logo can have transparencies in it. Does that change anything?
How do i check if a logo is in a BMP file?
-0.099668
0
0
207
8,275,095
2011-11-25T23:28:00.000
4
1
1
0
python,vim,pyflakes
8,275,265
3
false
0
0
PyFlakes won't run if b:did_pyflakes_plugin is defined when the plugin is loaded, but once it's loaded I don't think there's an easy way to disable it. What I would do is give the auto-generated files a specific file name pattern (say *_auto.py) and then add to my .vimrc: autocmd BufReadPre *_auto.py :let b:did_pyflake...
1
0
0
I have some autogenerated python files that are extremely large (long mathematical equations). Vim slows to a crawl when I open them for editing because I have pyflakes-vim installed. I'd like to be able to disable pyflakes-vim only when I open these long files. Is there a simple way to do this, either before opening t...
How do I disable pyflakes-vim for a particular file?
0.26052
0
0
2,784
8,280,373
2011-11-26T17:53:00.000
1
0
0
0
python,twisted
8,282,424
1
false
0
0
No, there isn't. Twisted calls select (or something like it) for you. You don't ever need to call a function like select; just let the reactor run, and do its work for you.
1
2
0
I am doing a muticlient chat server program in twisted python. Is there any function in twisted python similar to 'select' in in socket programming? Can anybody give me the answer please?.. If yes, please tell me the implementation, please.
Is there any function in twisted python similar to 'select' in socket programming?
0.197375
0
1
213
8,280,667
2011-11-26T18:39:00.000
0
0
1
0
python,user-interface,console,wxpython
8,298,887
1
true
0
1
You can use a wx.TextCtrl for input and then when the user is done typing, you can have them press a button to do whatever checking you want done. Alternatively, you could use a wx.Timer to watch for idleness so when the user is idle for x seconds, it does the checking you want automatically too.
1
0
0
Is there any way that I can build an interactive text console using wxPython window application? It will be used to allow user to provide natural language input for the application to parse the grammar based on the language selected. It is not going to be used to run any shell or commands.
Specialized Text Console in wxPython
1.2
0
0
194
8,280,859
2011-11-26T19:05:00.000
0
0
0
0
python,django,data-migration,filefield
8,280,938
1
false
1
0
One approach would be to create a utility django project specifying your legacy database in settings.py. Then use the inspectdb management command to create a django model representation of your legacy database. And finally use dumpdata to get you data in JSON format. You could then finally make your own JSON script th...
1
1
0
I have a SQL dump of a legacy DB, and a folder with images, and those are referenced by some rows of certain tables, and I need to migrate that data to the new Django models. The specific problem is how to "perform" the upload, but in a management command. When the table with the field referenced is migrated to it's co...
Migrate a legacy DB to Django, with image files
0
1
0
438
8,281,067
2011-11-26T19:41:00.000
0
0
1
0
python,py2exe
8,281,140
1
false
0
1
files that are imported are bundled in the executable by py2exe. The way to go is to use a configuration file that you package with your executable in a zip or with Inno Setup. Configuration files are files made to be changed at some moment, contrarily a user should not be modifying a python script. I tell you because ...
1
1
0
I wrote a wxPython GUI where I currently configure some of the widgets and some default values by using "import data" for a module file containing several lists. But I need to compile the whole program using py2exe for a user without a python installation. In so doing, I lose the capability of letting the user edit the...
How to retain an "import" capability after py2exe compile
0
0
0
290
8,281,371
2011-11-26T20:25:00.000
1
0
0
0
python,networking,ip,nic
8,282,345
5
false
0
0
For the general case, there is no solution. Consider the case where the local machine is behind a machine with two IP addresses doing NAT. You can change your local interface to anything you like, but it's unlikely that you'll convince the NAT machine to make a different routing decision on its outgoing connections.
1
5
0
What is the most efficient way to get all of the external ip address of a machine with multiple nics, using python? I understand that an external server is neeeded (I have one available) but am un able to find a way to find a good way to specify the nic to use for the connection (So I can use a for loop to iterate thro...
Python, How to get all external ip addresses with multiple NICs
0.039979
0
1
5,595
8,281,565
2011-11-26T20:58:00.000
2
0
0
1
python,google-app-engine,webserver,parallel-processing
8,282,420
1
true
1
0
The Python dev_appserver is single-threaded and only serves one request at a time. The production environment, naturally, has no such restriction.
1
0
0
I am using Google App Engine for the first time, whenever I make requests using two instances of the application, the responses come sequentially.. For example, I opened two pages of the app's main page, made an AJAX request from one then refreshed the other, the page doesn't load until the first page gets its respons...
Google App Engine handling parallel requests
1.2
0
0
210
8,281,762
2011-11-26T21:29:00.000
3
0
1
0
python,emacs,elisp,ipython,python-mode
8,282,005
3
true
0
0
You need to rename your original python-shell before opening up a new one. Use M-x rename-buffer.
1
5
0
Is there a way to force a new instance of python-shell while running Emacs? It would be convenient when working on multiple projects with separate working directories (and different sets of modules). Any attempt to invoke python-shell will only pull up the current instance.
Using multiple Python shells in Emacs 'python-mode' with Python or IPython
1.2
0
0
1,097
8,282,130
2011-11-26T22:30:00.000
5
0
1
0
python,floating-point,number-formatting,exponent
8,282,181
2
false
0
0
g and G are similar to the output you would get on a calculator display if the output is very large or very small you will get a response in scientific notation. For example 0.000001 gives "1e-06" with g and "1E-06" with G. However numbers that are not too small or too large are displayed simply as decimals 1000 gives ...
1
8
0
I feel a bit silly for asking what I'm sure is a rather basic question, but I've been learning Python and I'm having difficulty understanding what exactly the "g" and "G" string formats actually do. The documentation has this to say: Floating point format. Uses lowercase exponential format if exponent is less than -4 ...
In laymans terms, what does the Python string format "g" actually mean?
0.462117
0
0
6,837
8,282,352
2011-11-26T23:13:00.000
0
0
1
1
python,xcode,applescript
13,686,960
2
false
0
1
You can also use the py-aemreceive module from py-appscript. I use that to implement AppleScript support in my Tkinter app.
1
5
0
I want my Python program to be AppleScript-able, just like an Objective C program would be. Is that possible? (Note, this is not about running AppleScript from Python programs, nor about calling Python programs from AppleScript via Unix program invocation. Those are straightforward. I need genuine AppleScriptability of...
Can a program written in Python be AppleScripted?
0
0
0
206
8,283,370
2011-11-27T03:12:00.000
0
0
1
1
python,macos
8,578,267
2
false
0
0
With the default python install you will get both the 32 and 64 bit versions. The 32 bit version can be called from the terminal with python2.7-32 or python-32.
1
0
0
I'm not sure if this is possible but I want to force my mac to run in 32-bit mode permanently. Currently I've been using this piece of code: arch -i386 /usr/bin/python to change it but once I exit python in the terminal it switches back to 64. The reason I want to do this is so I can install pygame. I've already instal...
Running in 32-bit mode permanently
0
0
0
3,887
8,284,086
2011-11-27T06:45:00.000
4
0
1
0
python,twisted
8,286,511
2
false
0
0
It's easy to support more than 10,000 concurrent connections. What can be harder is supporting so many active connections. The kind of activity you expect to find on your connections is more likely to determine how many you can support at once. What do you expect these connections to be doing? Construct a test whic...
1
1
0
Twisted server supports more than 10,000 concurrent connections. I want to write a test case to check it using Python. What I know is just using multiprocessing + threading + greenlet. My question is how to confirm Twisted's support for more than 10,000 concurrent connections? Something I know is using logger, but is ...
How to calculating and testing the number of concurrent connections?
0.379949
0
0
1,595
8,284,169
2011-11-27T07:11:00.000
3
1
1
0
python,error-handling,lexer,ply
8,291,315
3
false
0
0
In general, there is only very limited information available to the t_error() function. As input, it receives a token object where the value has been set to the remaining input text. Analysis of that text is entirely up to you. You can use the t.lexer.skip(n) function to have the lexer skip ahead by a certain numbe...
1
3
0
The t_error() function is used to handle lexing errors that occur when illegal characters are detected. My question is: How can I use this function to get more specific information on errors? Like error type, in which rule or section the error appears, etc.
lexer error-handling PLY Python
0.197375
0
0
3,180
8,287,017
2011-11-27T16:24:00.000
2
0
0
0
python,django
8,287,296
1
false
1
0
It depends on who are you working with. Personally I prefer having output of developer's stuff in english, even though it is not my native language. I think that anyone who is a professional developer has some grasp of english, and the fact is that it is much easier to find potential errors posted in english than in an...
1
1
0
It is comfortable for somebody to read messages on native language. Is it a good idea to add localization for output of manage.py in Django?
Django manage.py localization
0.379949
0
0
114
8,287,167
2011-11-27T16:46:00.000
4
0
1
0
python,random
8,287,239
4
false
0
0
The simplest way is to generate a random nuber between 0-1 then strech it by multiplying, and shifting it. So yo would multiply by (x-y) so the result is in the range of 0 to x-y, Then add x and you get the random number between x and y. To get a five multiplier use rounding. If this is unclear let me know and I'l...
1
46
0
I've read the manual for pseudo-randomness in Python, and to my knowledge, you can only generate numbers up to a given maximum value, i.e. 0-1, 0-30, 0-1000, etc. I want to: a) Generate a number between two ints, i.e. 5-55, and b) Only include multiples of 5 (or those ending in 5 or 0, if that's easier) I've looked ...
Python: Generate random number between x and y which is a multiple of 5
0.197375
0
0
187,564
8,289,157
2011-11-27T21:21:00.000
0
0
0
0
python
8,289,322
7
false
0
0
I sometimes have this problem..not sure if this works but I often install it using my own account then try to run it in an IDE(komodo in my case) and it doesn't work. Like your issue it says it cannot find it. The way I solve this is to use sudo -i to get into root and then install it from there. If that does not work ...
1
11
1
Is there a good (small and light) alternative to numpy for python, to do linear algebra? I only need matrices (multiplication, addition), inverses, transposes and such. Why? I am tired of trying to install numpy/scipy - it is such a pita to get it to work - it never seems to install correctly (esp. since I have tw...
Alternative to scipy and numpy for linear algebra?
0
0
0
10,052
8,289,540
2011-11-27T22:14:00.000
3
0
1
0
python,types,casting
8,289,581
2
false
0
0
There's no such thing as casting in Python. That's because there's no need for it: generally, any function that accepts a 'tile' object shouldn't care that it actually is a tile rather than a tile2, as long as it has the data and/or methods that it is expecting. This is called duck typing, and is a fundamental part of ...
1
1
0
How for example would I convert a type from some external class to another one? I've searched around, and gotten stuff like "int to string" and stuff, but I'm talking about something like class "tile" converting to something else, such as "tile2".
Type casting with non standard types in python
0.291313
0
0
245
8,289,859
2011-11-27T23:09:00.000
7
0
1
0
python,windows,registry,installation
8,290,228
1
true
1
0
32-bit applications installed on 64-bit OSes store their registry values in: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node. If you look there, you should see the settings you are looking for.
1
6
0
I have downloaded the Python 2.7.2 Windows x86 32-bit MSI from python.org and installed it on a 64-bit Windows 7 system. Everything works (at least the command-line interpreter starts and runs), but the install process does not create any Python entries under HKEY_LOCAL_MACHINE/SOFTWARE in the Windows registry. Variou...
Python 2.7 32-bit install on Win 7: No registry keys?
1.2
0
0
4,206
8,290,781
2011-11-28T02:03:00.000
0
0
0
0
python,user-interface,tablelayout
8,295,831
1
true
0
1
Tkinter would be enough for this. You can create any level of complexity on the layout even with the "grid" layout manager, which allows you to specify "columnspam" and "rowspam" for widgets that will take more than a single cell.
1
1
0
I need to create a GUI in Python for a client server interaction. The GUI is on the client side for which I want to create complex tables. I tried to use wxPython's grid class, but its too tough to create a complex table in that. I saw a couple of examples for simple table layouts. I tried to put up a snapshot of the...
Draw complex table layout in Python GUI
1.2
0
0
903
8,291,274
2011-11-28T03:39:00.000
1
0
0
0
python,tkinter,pygame
23,665,352
3
false
0
1
I have also found pgu is awful. However, what you say about the tkinter event loop taking control is wrong. You just call root.update instead of mainloop, and this can go inside of a while loop to replace the mainloop. Answering your main question however, there is something you should be aware of. It seems that whenev...
1
8
0
I am using pygame to write a program and I need some GUI configuration text field and button for control. I've already made the button using pygame, but I just can write a text field out of pygame. Maybe I need to use tkinter together with pygame. I think if there is no way to made to pygame part and tkinter part toget...
Is there anything I need aware of using Tkinter and pygame together?
0.066568
0
0
6,571
8,295,078
2011-11-28T11:22:00.000
0
0
0
1
python,rabbitmq
8,296,293
1
true
0
0
No, there is no way to find how many publishers are still publishing to a queue in AMQP. You'll have to roll your own system. A way to do this would be to have a fanout exchange that every worker binds a queue to (let's call it the "control" exchange), and have the publisher send a special message to it when it finish...
1
1
0
I'm using RabbitMQ with Python/pika to distribute some batch jobs. So I think I have a very common scenario: One process fills a queue with jobs to be done. Multiple workers retrieve jobs, transform data and put the results in a second queue. Another single process retrives the results and merges them. The works very f...
"Invalidate" RabbitMQ queue or sending "DONE signal"
1.2
0
0
177
8,295,644
2011-11-28T12:13:00.000
101
0
1
0
python,distutils,pypi
10,686,196
10
false
0
0
python setup.py uses distutils which doesn't support install_requires. setuptools does, also distribute (its successor), and pip (which uses either) do. But you actually have to use them. I.e. call setuptools through the easy_install command or pip install. Another way is to import setup from setuptools in your setup....
2
128
0
Does anybody encounter this warning when executing python setup.py install of a PyPI package? install_requires defines what the package requires. A lot of PyPI packages have this option. How can it be an "unknown distribution option"?
pypi UserWarning: Unknown distribution option: 'install_requires'
1
0
0
148,401
8,295,644
2011-11-28T12:13:00.000
0
0
1
0
python,distutils,pypi
57,168,473
10
false
0
0
I've now seen this in legacy tools using Python2.7, where a build (like a Dockerfile) installs an unpinned dependancy, for example pytest. PyTest has dropped Python 2.7 support, so you may need to specify version < the new package release. Or bite the bullet and convert that app to Python 3 if that is viable.
2
128
0
Does anybody encounter this warning when executing python setup.py install of a PyPI package? install_requires defines what the package requires. A lot of PyPI packages have this option. How can it be an "unknown distribution option"?
pypi UserWarning: Unknown distribution option: 'install_requires'
0
0
0
148,401
8,295,645
2011-11-28T12:13:00.000
6
0
1
0
c++,python,algorithm,vector,cython
8,295,693
1
true
0
0
Cython can only reasonably link against compiled code in some external library following the C calling conventions. To use template functions, you'll have to write an extern "C" wrapper function that uses a specific incarnation of the algorithm (i.e. you have to fix the template parameters).
1
6
0
How can I use the remove function from <algorithm>? (Or any other operation, I want to use this with vectors, I tried to cdef extern to declare it, but there is no template function yet, I think)
Cython vector operations
1.2
0
0
1,023
8,298,442
2011-11-28T15:51:00.000
0
0
1
0
python,image-processing,camera,ramdisk
8,299,093
3
false
0
0
Ah, proprietary binaries that only give certain options. Yay. The simplest solution would be adding a solid state hard drive. You will still be saving to disk, but disk IO will be much higher for reading and writing. A better solution would be outputting the tiff to stdout, perhaps in a different format, and piping it...
2
0
0
I have a little program here (python 2.7) that runs on an old machine and it basically keeps getting pictures (for timelapses) by running an external binary and converts them to an efficient format to save up disk space. I want to minimize the disk operations, because it's already pretty old and I want it to last some ...
Should I use a ramdisk for pictures that are converted and removed?
0
0
0
399
8,298,442
2011-11-28T15:51:00.000
0
0
1
0
python,image-processing,camera,ramdisk
24,181,039
3
false
0
0
If on Debian (and possibly its derivatives), use "/run/shm" directory.
2
0
0
I have a little program here (python 2.7) that runs on an old machine and it basically keeps getting pictures (for timelapses) by running an external binary and converts them to an efficient format to save up disk space. I want to minimize the disk operations, because it's already pretty old and I want it to last some ...
Should I use a ramdisk for pictures that are converted and removed?
0
0
0
399
8,298,571
2011-11-28T16:00:00.000
3
0
0
1
python,rest,concurrency,message-queue,data-warehouse
8,301,254
2
true
0
0
Message brokers such as Rabbit contain practical solutions for a number of problems: multiple producers and consumers are supported without risk of duplication of messages atomicity and unit-of-work logic provide transactional integrity, preventing duplication and loss of messages in the event of failure horizontal sc...
1
3
0
Server A has a process that exports n database tables as flat files. Server B contains a utility that loads the flat files into a DW appliance database. A process runs on server A that exports and compresses about 50-75 tables. Each time a table is exported and a file produced, a .flag file is also generated. Server B...
Coordinating distributed Python processes using queuing or REST web service
1.2
0
0
533
8,299,303
2011-11-28T16:51:00.000
4
1
1
0
python,audio
8,300,219
6
false
0
0
One of the more consistent andeasy to install ways to deal with sound in Python is the Pygame multimedia libraries. I'd recomend using it - there is the pygame.sndarray submodule that allows you to manipulate numbers in a data vector that become a high-level sound object that can be playerd in the pygame.mixer module. ...
1
46
0
I need to generate a sine wave sound in Python, and I need to be able to control frequency, duration, and relative volume. By 'generate' I mean that I want it to play though the speakers immediately, not save to a file. What is the easiest way to do this?
Generating sine wave sound in Python
0.132549
0
0
68,751
8,299,614
2011-11-28T17:14:00.000
0
1
0
0
python,mysql
8,299,759
3
false
0
0
Your strategy is reasonable though I would first look at doing as much of the work as possible in the database query using LIKE and other SQL functions. It should be possible to make a query that matches complex criteria.
2
0
0
Background: I am writing a matching script in python that will match records of a transaction in one database to names of customers in another database. The complexity is that names are not unique and can be represented multiple different ways from transaction to transaction. Rather than doing multiple queries on the d...
Could someone give me their two cents on this optimization strategy
0
1
0
98
8,299,614
2011-11-28T17:14:00.000
2
1
0
0
python,mysql
8,299,780
3
false
0
0
Regarding: "would this be faster:" The behind-the-scenes logistics of the SQL engine are really optimized for this sort of thing. You might need to create an SQL PROCEDURE or a fairly complex query, however. Caveat, if you're not particularly good at or fond of maintaining SQL, and this isn't a time-sensitive query, th...
2
0
0
Background: I am writing a matching script in python that will match records of a transaction in one database to names of customers in another database. The complexity is that names are not unique and can be represented multiple different ways from transaction to transaction. Rather than doing multiple queries on the d...
Could someone give me their two cents on this optimization strategy
0.132549
1
0
98
8,299,966
2011-11-28T17:40:00.000
1
0
1
0
python
8,425,387
1
true
0
1
Depending on graphical requirements, I would say that for a lightweight app you could get away with PyQt or PyGame. For more demanding real-time graphical requirements you could use something like PyOgre or PyOpenGL. You may need to also research graph-layout/data-visualisation algorithms or libraries (e.g. dot) depend...
1
3
0
I'm trying to create a Python implementation of Dawkins' biomorphs as described in his book, The Blind Watchmaker. It works like this: A parent organism is displayed, as well as its offspring which are just mutated versions of the parent. Then the user clicks on a descendant it wants to breed, and all the offspring wil...
Biomorph Implementation in Python
1.2
0
0
718
8,300,545
2011-11-28T18:32:00.000
0
1
0
0
python,twisted,irc
9,563,454
2
false
0
0
You can also use channel access lists if your bot has permissions to do so.
1
3
0
I'm writing an IRC bot using twisted python, and some actions should only be available to channel operators. How do I determine the 'user level' of a user in a channel using twisteds IRCClient?
Check if user is 'voiced' or 'op' in IRC channel using twisted
0
0
0
1,572
8,301,501
2011-11-28T19:53:00.000
1
1
0
0
python,html,mime-types,sendmail,mime-message
8,301,559
2
false
1
0
You need to write src="cid:ContentId" to refer to an attached image, where ContentId is the ID of the MIME part.
2
0
0
I am working with a Python function that sends mails wich include an attachment and a HTML message......I want to add an image on the HTML message using <img src="XXXX"> When I try it, the message respects the tag, but does not display the image I want (it displays the not found image "X")..... does anyone know if thi...
Image in the HTML email message
0.099668
0
1
431
8,301,501
2011-11-28T19:53:00.000
1
1
0
0
python,html,mime-types,sendmail,mime-message
8,301,539
2
true
1
0
In your html you need the fully qualified path to the image: http://yourdomain.com/images/image.jpg You should be able to take the URL in the image tag, paste it into the browser's address bar and view it there. If you can't see it, you've got the wrong path.
2
0
0
I am working with a Python function that sends mails wich include an attachment and a HTML message......I want to add an image on the HTML message using <img src="XXXX"> When I try it, the message respects the tag, but does not display the image I want (it displays the not found image "X")..... does anyone know if thi...
Image in the HTML email message
1.2
0
1
431
8,302,553
2011-11-28T21:26:00.000
1
1
0
0
java,python,text-processing,text-mining,spelling
8,546,969
4
false
1
0
Are you looking for something akin to the international phonetic alphabet (IPA) or some other phonetic output? If ARPAbet is ok, there is the CMU pronouncing dictionary (http://www.speech.cs.cmu.edu/cgi-bin/cmudict). That'll give the ARPAbet rendering of most words in English. I've written some code that converts the A...
1
8
0
I am trying to build a system that accepts text and outputs the phonetic spelling of the words of this text. Any ideas on what libraries can be used in Python and Java?
phonetic spelling in Python and Java
0.049958
0
0
5,615
8,302,810
2011-11-28T21:46:00.000
2
1
0
0
python,shared-libraries,undefined-symbol,openrave
8,313,757
4
true
0
0
The solution was linking the python2.6 library with my executable as well. Even though the executable made no python calls, it needed to be linked with the python library. I assume its because my shared library doesn't pass the symbols of python library through to the executable. If anyone could explain why my execut...
2
12
0
I have been trying to get a project of mine to run but I have run into trouble. After much debugging I have narrowed down the problem but have no idea how to proceed. Some background, I am using a python script inside C++ code. This is somewhat documented on Python, and I managed to get it running very well in my bas...
Undefined Symbol in C++ When Loading a Python Shared Library
1.2
0
0
9,662
8,302,810
2011-11-28T21:46:00.000
0
1
0
0
python,shared-libraries,undefined-symbol,openrave
8,303,699
4
false
0
0
Check your python-headers and python's runtime. It looks like you have mix of 2.5 and 2.6 versions.
2
12
0
I have been trying to get a project of mine to run but I have run into trouble. After much debugging I have narrowed down the problem but have no idea how to proceed. Some background, I am using a python script inside C++ code. This is somewhat documented on Python, and I managed to get it running very well in my bas...
Undefined Symbol in C++ When Loading a Python Shared Library
0
0
0
9,662
8,302,833
2011-11-28T21:48:00.000
6
1
1
0
python,unicode
8,302,860
2
true
0
0
Generally, I'm going to say "no" there's not a good reason to use string over unicode. Remember, as well, that you don't have to call unicode() to create a unicode string, you can do so by prefixing the string with a lowercase u like u"this is a unicode string".
1
6
0
Many problems I've ran into in Python have been related to not having something in Unicode. Is there any good reason to not use Unicode by default? I understand needing to translate something in ASCII, but it seems to be the exception and not the rule. I know Python 3 uses Unicode for all strings. Should this encourag...
Is there any good reason not to use unicode as opposed to string?
1.2
0
0
131
8,305,809
2011-11-29T04:21:00.000
0
1
1
0
python,ide
16,095,116
10
false
0
0
Wing IDE, and probably also other Python IDEs like PyCharm and PyDev have features like this. In Wing you can either select and execute code in the integrated Python Shell or if you're debugging something you can interact with the paused debug program in a shell (called the Debug Probe). There is also special support...
1
183
0
In RStudio, you can run parts of code in the code editing window, and the results appear in the console. You can also do cool stuff like selecting whether you want everything up to the cursor to run, or everything after the cursor, or just the part that you selected, and so on. And there are hot keys for all that stuff...
Is there something like RStudio for Python?
0
0
0
92,404
8,307,425
2011-11-29T07:51:00.000
2
1
0
1
python,debugging,gdb,shared-libraries,eclipse-cdt
34,515,642
1
false
0
0
I have been able to debug the c++ shared library loaded by the python in Eclipse successfully. The prerequisites: Two eclipse projects in an eclipse workspace: one is the C++ project, from which the c++ shared library is generated, the other is the python project (PyDev), which loads the generated c++ shared library. ...
1
3
0
In Linux, I am trying to debug the C++ code of a shared library which is loaded from Python code. The loading is done using the ctypes package. In Eclipse, I set breakpoints both in the Python and in the C++ code, however Eclipse just skips the breakpoints in the C++ code (breakpoints in the Python code work OK). I ha...
Eclipse: debug shared library loaded from python
0.379949
0
0
3,167
8,307,696
2011-11-29T08:19:00.000
1
0
1
0
python,parallel-processing,hpc
8,308,759
1
true
0
0
Python and High Performance Computing? I would use it only as front-end language for managing and monitoring the system... The actual computations should be done in a more machine-friendly language if performance is what you are seeking. About problems that are fit to be solved in parallel, as always, those composed of...
1
0
0
I am in need of doing some projects on parallel computing or HPC , can any one suggest me good projects on that , I prefer to use Python as the programming language, can I use it for these also? Please help me in this. Thanks in advance.
Suggest some projects on parallel computing or HPC
1.2
0
0
274
8,308,610
2011-11-29T09:42:00.000
1
0
0
0
python,thrift
8,842,820
1
false
0
0
Apparently TProcessPoolServer is a good server and forks different processes, avoiding threading issues.
1
1
0
I am making an internal API in Python (pardon my terms) that provides a layer over MySQL and Solr (databases) with only simple computing. A Python program that spawns from scratch waits 80ms for Solr, while taking negligible time by itself. I am worried about the incomplete threading support of Python. So which of the...
Performance of TNonblockingServer, TThreadPoolServer for DB-bound server in Python
0.197375
1
0
1,136
8,310,262
2011-11-29T11:55:00.000
4
0
0
0
java,python,web-services,corba
8,310,341
1
false
1
0
You will need a Java CORBA provider - for example IONA or JacORB. Generate the IDL files for your python service and then use whatever IDL -> stub compiler your Java ORB provides to generate the java client-side bindings. From there it should be as simple as binding to the corbaloc:// at which your python server is ru...
1
0
0
i'm working on a project thata i need develop one web service ( in java ) that get one simple number from a Corba python implementation... how can i proceed with this?? im using omniOrb and already done the server.py that genetares one simple number! thx a lot
Corba python integration with web service java
0.664037
0
1
375
8,310,404
2011-11-29T12:04:00.000
3
0
0
1
python
8,311,778
2
true
0
0
It was obvious: pythonw script.py|more
1
3
0
When a script is executed with pythonw it will not open a console. Is there a way to capture the stdout of such a script by keeping the usage of pythonw? Note, I am looking for a solution that does not require the modification of the script (I know that I can use logging) Update: pythonw script.py >somefile seems to wo...
How to capture stdout of a Python script executed with pythonw?
1.2
0
0
494
8,312,672
2011-11-29T14:43:00.000
0
0
0
0
python,audio,classification,fft,pyaudioanalysis
8,314,002
3
false
0
0
Try searching for algorithms on "music fingerprinting".
1
1
1
Anybody able to supply links, advice, or other forms of help to the following? Objective - use python to classify 10-second audio samples so that I afterwards can speak into a microphone and have python pick out and play snippets (faded together) of closest matches from db. My objective is not to have the closest matc...
python - audio classification of equal length samples / 'vocoder' thingy
0
0
0
1,085
8,313,051
2011-11-29T15:07:00.000
1
0
0
0
python,qt,dll,pyqt
8,314,327
1
true
0
1
It seems like libpython2 is missing. You will have to : Find out what package provides this library. You can Google for that. Or search a repo for the lib.
1
0
0
I have a project that has code which will communicate with a python script and call python functions. In the proj file, i've added the includePath for the python header files, and added external python library to the project (python27.a). However the qt compiler gave me an error: No rule to make target /home/pgeng/wor...
Error on connecting to python libraries
1.2
0
0
107
8,316,152
2011-11-29T18:54:00.000
12
0
0
0
python,selenium,beautifulsoup,web-scraping,urllib2
8,316,622
1
true
1
0
It's not possible to get the raw HTML from a WebElement. You can get the page source from the browser object though: browser.page_source.
1
6
0
I am using Selenium webdriver in Python for a web-scraping project. How to print the HTML text of the selenium.WebElement ? I intend to use the BeautifulSoup to parse the HTML to extract the data of interest. Thanks
Print HTML text of a selenium webelement in Python
1.2
0
1
7,324
8,318,688
2011-11-29T22:31:00.000
1
0
0
0
python,django
8,318,788
5
false
1
0
You can use django-admin.py with that environment variable. Commands are interchangeable, only django-admin.py doesn't override the variable you're trying to use.
1
15
0
I have a settings.py file and a dev_settings.py file that I use to override some values for dev purposes. Everytime I run the ./manage.py command, I have to specify --settings=whatever.local_settings. This becomes very tedious to do every time and I am trying to find a way to force manage.py to load my dev_settings.p...
django manage.py settings default
0.039979
0
0
12,459
8,319,090
2011-11-29T23:13:00.000
1
0
1
1
python
8,319,139
6
false
0
0
There are many editors... and IDE's that will allow you to run your code from directly within the editor / IDE enviroment
4
1
0
I am a pretty recent developer.. but I have a single monitor (big enough) but it is so annoying that every now and then I first use the text editor to write the code and then go to terminal to execute and debug I was wondering if there is any developer tools where I can like use half screen for that note pad and the ot...
developer tools used in programming
0.033321
0
0
1,656
8,319,090
2011-11-29T23:13:00.000
2
0
1
1
python
8,319,156
6
false
0
0
If you're developing in Python - have a look at PyCharm. It's a clone of IntelliJ IDEA, tailored for python development, written in Java, so work on any platform. If you like it, it also doesn't cost a whole truckload. That's for the easy and money-based way. More complex ways - you can use a text editor that allows ru...
4
1
0
I am a pretty recent developer.. but I have a single monitor (big enough) but it is so annoying that every now and then I first use the text editor to write the code and then go to terminal to execute and debug I was wondering if there is any developer tools where I can like use half screen for that note pad and the ot...
developer tools used in programming
0.066568
0
0
1,656
8,319,090
2011-11-29T23:13:00.000
3
0
1
1
python
8,319,361
6
false
0
0
Use ViM in split window mode, edit your script on the left side and start ConqueTerm (use :ConqueTerm bash) on the right side. Now you can code and execute Python code in the same terminal window at the same time using a superior text editor ;-) Disclaimer: Of course this only helps if you are familiar with ViM already...
4
1
0
I am a pretty recent developer.. but I have a single monitor (big enough) but it is so annoying that every now and then I first use the text editor to write the code and then go to terminal to execute and debug I was wondering if there is any developer tools where I can like use half screen for that note pad and the ot...
developer tools used in programming
0.099668
0
0
1,656
8,319,090
2011-11-29T23:13:00.000
1
0
1
1
python
8,319,143
6
false
0
0
Perhaps I'm misunderstanding the question, but it seems like the easiest way is to simply manually resize the windows and place them where you want them. Also, a handy tool in general is the Python IDLE, where you can code in the Python window and simply have it run in the shell by pressing F5.
4
1
0
I am a pretty recent developer.. but I have a single monitor (big enough) but it is so annoying that every now and then I first use the text editor to write the code and then go to terminal to execute and debug I was wondering if there is any developer tools where I can like use half screen for that note pad and the ot...
developer tools used in programming
0.033321
0
0
1,656
8,319,401
2011-11-29T23:48:00.000
2
0
1
0
python
8,319,580
3
false
0
0
It's hard to give a general answer on whether you should use less exception handling... you can definitely do too much and too little. It's almost certainly wrong to be catching every possible exception and also almost certainly wrong to be doing no exception handling. Here are some things to think about: It's usually...
1
4
0
I'm making a GUI and I'm finding myself to be using a lot of try except statements. My question is, should I be redesigning my program to use less try except statements or is try except a good practice to be using in python programs? I like them because they're informative and make debugging, for me, easier. Just wo...
try except and programming etiquette
0.132549
0
0
579
8,320,304
2011-11-30T02:06:00.000
0
1
0
1
python,bash,cron,crontab
8,320,318
4
false
0
0
Make it write a file and check if the file is there.
3
4
0
I have two python scripts running as cronjobs. ScriptA processes log files and insert records to a table, ScriptB uses the records to generate a report. I have arranged ScriptA to run one hour before ScriptB, but sometimes ScriptB run before ScriptA finish inserting, thus generating a incorrect report. How do I make su...
How to make sure a script only runs after another script
0
0
0
3,971
8,320,304
2011-11-30T02:06:00.000
0
1
0
1
python,bash,cron,crontab
8,320,328
4
false
0
0
an approach that you could use it! is having some flag of control! somewhere, for example in the DB! So ScriptB just runs after that flag is set! and right after it finish it it sets the flag back to default state! Another way that you could implement that flag approach is using file system! Like @Benjamin suggested!
3
4
0
I have two python scripts running as cronjobs. ScriptA processes log files and insert records to a table, ScriptB uses the records to generate a report. I have arranged ScriptA to run one hour before ScriptB, but sometimes ScriptB run before ScriptA finish inserting, thus generating a incorrect report. How do I make su...
How to make sure a script only runs after another script
0
0
0
3,971
8,320,304
2011-11-30T02:06:00.000
2
1
0
1
python,bash,cron,crontab
8,320,343
4
true
0
0
One approach would be to make sure that if those two jobs are separate cron jobs - there is enough time inbetween to surely cover the run of job 1. Another approach is locking, as others here suggested, but then note, that cron will not re-run your job just because it completed unsuccessfully because of a lock. So eit...
3
4
0
I have two python scripts running as cronjobs. ScriptA processes log files and insert records to a table, ScriptB uses the records to generate a report. I have arranged ScriptA to run one hour before ScriptB, but sometimes ScriptB run before ScriptA finish inserting, thus generating a incorrect report. How do I make su...
How to make sure a script only runs after another script
1.2
0
0
3,971
8,327,300
2011-11-30T14:16:00.000
0
0
0
0
python,django,performance,views
8,328,308
4
false
1
0
Do you use the django debug toolbar ? You could find what queries are run with it, middleware or not. How do you monitor the performance of the view ? Are there much more users in the big project than in the fresh one ?
1
0
0
Is there any smart way to find bottlenecks in business logic. For example, we have application, that have one view that doing HttpResponse('1') in big project. We are sure, that no SQL queries in middlewares exists. But HttpResponse working really slow(50 rps vs 200 rps on clear django project). What reasons can be? ...
Django. Business Logic Bottlenecks.
0
0
0
562
8,332,710
2011-11-30T20:46:00.000
12
0
1
0
python,collections
8,334,382
2
true
0
0
When duplicate entries don't exist, the usual choices are: If the elements are hashable: set(a) == set(b) If the elements are orderable: sorted(a) == sorted(b) If all you have is equality: len(a) == len(b) and all(x in b for x in a) If you have duplicates and their multiplicity matters, the choices are: If the ele...
1
7
0
I've got a dict where some of the values are not hashable. I need some way to compare two unordered groups of these to ensure they contain equal elements. I can't use lists because list equality takes the order into account but sets won't work because dicts aren't hashable. I had a look through the python docs, and th...
Unordered collection for unhashable objects?
1.2
0
0
669
8,334,999
2011-12-01T00:19:00.000
0
0
1
0
python
8,335,042
1
true
0
0
Unfortunately the only way to survive such a thing would be to have your test fixture run that particular test in a subcommand using subprocess.Popen(), and capture its output and error code so that you can see the nonzero error code and “out of memory” traceback that result. Note that sys.executable is the full path t...
1
0
0
I have a python script to allocate a huge memory space and eventually ended up overflow. Is there anyway nosetests can peacefully handle this?
How to get around memory allocation error in python nosetest?
1.2
0
0
313
8,335,651
2011-12-01T01:54:00.000
1
0
1
0
python,linux,algorithm,bash
8,336,279
4
false
0
0
You need to merge everything first, sort then finally remove duplicates #!/bin/bash for file in test/* do cat "$file" >> final done sort final > final2 uniq final2 final rm -rf final2
1
0
0
Here is my problem. I have n files and they all have overlapping and common text in them. I want to create a file using these n files such that the new file only contains unique lines in it that exist across all of the n files. I am looking for a bash command, python api that can do it for me. If there is an algorithm ...
Trying to merge files after removing duplicate content
0.049958
0
0
1,067
8,338,661
2011-12-01T08:55:00.000
0
0
0
0
python,oauth,sha1,hmac
62,871,193
8
false
0
0
In Python 3.7 there is an optimized way to do this. HMAC(key, msg, digest).digest() uses an optimized C or inline implementation, which is faster for messages that fit into memory.
1
57
0
I am trying to use the OAuth of a website, which requires the signature method to be 'HMAC-SHA1' only. I am wondering how to implement this in Python?
Implementation HMAC-SHA1 in python
0
0
1
70,277
8,340,567
2011-12-01T11:23:00.000
6
0
1
0
python,grammar,abstract-syntax-tree
8,341,353
2
true
0
0
If you look at ast.NodeVisitor, it's a fairly trivial class. You can either subclass it or just reimplement its walking strategy to whatever you need. For instance, keeping references to the parent when nodes are visited is very simple to implement this way, just add a visit method that also accepts the parent as an ar...
1
11
1
I'm analyzing the AST generated by python code for "fun and profit", and I would like to have something more graphical than "ast.dump" to actually see the AST generated. In theory is already a tree, so it shouldn't be too hard to create a graph, but I don't understand how I could do it. ast.walk seems to walk with a BF...
Python ast to dot graph
1.2
0
0
3,299
8,341,797
2011-12-01T12:59:00.000
1
1
0
0
python,django,gunicorn
8,342,278
2
false
1
0
You can also use middleware and for example kill every session and show nothing if it not passes the requirements. For example, you can define middleware which checks if the request comes from the IP you use, if yes - do nothing, if no - stop. Maybe not the best, but solution :)
1
4
0
Is there a way to password protect an application which is hosted in gunicorn, I did this with .htaccess in apache, but can we do this in gurnicorn?
how to password protect a website hosted on gunicorn
0.099668
0
0
3,648
8,342,215
2011-12-01T13:35:00.000
1
0
0
0
python,pygtk,x11,osx-leopard
9,190,899
1
true
0
1
You need to install X11-2.6.*
1
0
0
I have a python program that implements pygtk for GUI. I have it running successfully on some MAC computers running os 10.6.*, after installing pygtk with macports. I have just installed pygtk on a mac 10.5.8 system. When I execute the program I get these errors: Xlib: extension "RANDR" missing on display "/tmp/la...
X11 errors with pygtk on Mac OS X 10.5.8
1.2
0
0
674
8,342,335
2011-12-01T13:45:00.000
1
0
0
0
python,dom,xpath,html-parsing,lxml
8,342,483
2
false
0
0
lxml was written on C. And if you use x86 it is best chose. If we speak about techniques there is no big difference between Xpath and DOM - it's very quickly methods. But if you will use find or findAll in BeautifulSoup it will be slow than other. BeautifulSoup was written on Python. This lib needs a lot of memory for ...
1
6
0
I know how to parse a page using Python. My question is which is the fastest method of all parsing techniques, how fast is it from others? The parsing techniques I know are Xpath, DOM, BeautifulSoup, and using the find method of Python.
Xpath vs DOM vs BeautifulSoup vs lxml vs other Which is the fastest approach to parse a webpage?
0.099668
0
1
4,678
8,344,648
2011-12-01T16:21:00.000
5
0
1
0
python
8,344,678
3
false
0
0
I think you want os.path.basename.
1
3
0
I have a string containing a filename and optionally can be a full path or a relative one. os.path module seems to miss such function. What is the easiest solution?
Getting the filename from a path in Python?
0.321513
0
0
216
8,344,728
2011-12-01T16:26:00.000
0
0
1
0
python,api,parallel-processing
8,345,037
1
false
0
0
Do you plan to call your python API from some other python code? If so then how is the parallelism achieved? Do you plan to spawn many threads, use your api in every thread? Anyway it's worthwhile to take a look at multiprocessing module that allows one to create separate python processes. There are lots of threading ...
1
0
0
I wrote an API which which does some database operations with values requested by the API caller. How does this whole API system work when more than on person calls a function at the same time? Do different instances of my API code start when a number of API calls are made? If I need to handle like 2500 parallel API c...
How to handle parallel calls to a Python API?
0
0
1
177
8,346,580
2011-12-01T18:44:00.000
0
1
1
0
python,unit-testing
8,346,679
3
false
0
0
The best practice is to have some related functionality bundled in a module. For that module, you create a separate file with unittests. The convention is to name it test_foo.py if your module is foo.py. Where it sits exactly is not well defined, although a separate directory named test or something similar is common. ...
2
2
0
So I'm creating unit tests for all of my scripts, many of which arent oo, and have main-loop code. I was wondering what the standard is for the location of creating unittest classes in relation to the affected script. Should the unit test be in a separate file which imports the script, and then function-alize the mainl...
Putting unittest classes in the related script itself vs making a separate file
0
0
0
105
8,346,580
2011-12-01T18:44:00.000
0
1
1
0
python,unit-testing
8,346,919
3
false
0
0
One additional reason for not putting the unit tests in source file is that during distribution/packaging of your python application you can exclude all the directories that contains the tests.
2
2
0
So I'm creating unit tests for all of my scripts, many of which arent oo, and have main-loop code. I was wondering what the standard is for the location of creating unittest classes in relation to the affected script. Should the unit test be in a separate file which imports the script, and then function-alize the mainl...
Putting unittest classes in the related script itself vs making a separate file
0
0
0
105
8,348,687
2011-12-01T21:41:00.000
0
0
0
1
python,twisted
8,348,956
2
false
1
0
I think either you create an selfCreatedObject or using a memcached once, it will be an instance of python objects, like list or dict or anything else so the two ways are to same destination. I prefer to use object so you can make a check the change of the object value or validate it if needed.
2
1
0
My app maintains the state of a bunch of objects with variables. I'm using Twisted to accept socket requests and return the properties of an object. I want to make sure the app can scale for a lot of requests so I'm wondering if I should deliver the object properties directly from the objects, or if I should store thos...
Architecture: I have to make available object properties that that is updated every couple seconds
0
0
0
62
8,348,687
2011-12-01T21:41:00.000
0
0
0
1
python,twisted
8,348,947
2
false
1
0
I don't think you have any performance penalty because of having many reading operations from the same object (only one thread is executed at a time after all).
2
1
0
My app maintains the state of a bunch of objects with variables. I'm using Twisted to accept socket requests and return the properties of an object. I want to make sure the app can scale for a lot of requests so I'm wondering if I should deliver the object properties directly from the objects, or if I should store thos...
Architecture: I have to make available object properties that that is updated every couple seconds
0
0
0
62
8,348,978
2011-12-01T22:07:00.000
0
0
1
0
python,multithreading
8,350,366
4
false
0
0
If you need this for some kind of stress/load testing maybe existing open-source solutions would be more appropriate, e.g. jMeter (java) or TheGrinder (Java with scripts in Jython).
1
2
0
I have a program which I need to call more than 100 times with different values. I want to do it simultaneously that is not wait for one call to complete and then to start again. How can I achieve it ? Is multithreading the solution to it. I am using python for it.
How can I run a program hundreds of times using Python?
0
0
0
167
8,350,067
2011-12-01T23:55:00.000
1
0
0
0
python,blender,render-to-texture
8,431,966
1
true
0
1
You will have to make a Python script for that - that would read your text file and use blender API internally to create the tiles and the scene. Blender can only render files if it does have programs (plug-ins) that do that. Actually most file-formats can be read by blender just due to plug-ins implemented in Python t...
1
4
0
I have written a program in Python that generates a 10,000 tile coordinate plane with each tile having characteristics such as texture, temperature, elevation etc. I am doing this for a project and thought a much better way to show this part of the project would be to show a 3d rendering of it and the best program i kn...
Can Blender generate a scene based off of a text file?
1.2
0
0
1,046
8,356,137
2011-12-02T12:10:00.000
0
0
0
1
python,windows
8,365,694
3
false
0
0
If you plan to execute this command in a remote machine, then you may consider using Paramiko. I have personally found it very useful and it lets you execute the command as root also.
3
3
0
I have used os.system(command) in a for loop. By using this, CMD opens, executes the command and close. For Second command, CMD opens again, executes tha command and close. Due to this, CMD pop-ups again and again. Meanwhile, I am not able to do another task on system. I want to do this in a CMD so that i can minimize ...
Can we execute mutiple commands in the same command prompt launched by python script?
0
0
0
95
8,356,137
2011-12-02T12:10:00.000
1
0
0
1
python,windows
8,359,438
3
false
0
0
Another approach is to write all of the command strings to a .bat or .cmd file, and then execute the resulting file with os.system. This is more useful if the number of commands per iteration is "large-ish" and less useful if there are only a few commands per iteration.
3
3
0
I have used os.system(command) in a for loop. By using this, CMD opens, executes the command and close. For Second command, CMD opens again, executes tha command and close. Due to this, CMD pop-ups again and again. Meanwhile, I am not able to do another task on system. I want to do this in a CMD so that i can minimize ...
Can we execute mutiple commands in the same command prompt launched by python script?
0.066568
0
0
95
8,356,137
2011-12-02T12:10:00.000
2
0
0
1
python,windows
8,356,168
3
false
0
0
You can just concatenate your commands, delimited by a semicolon (;) and only call os.system once.
3
3
0
I have used os.system(command) in a for loop. By using this, CMD opens, executes the command and close. For Second command, CMD opens again, executes tha command and close. Due to this, CMD pop-ups again and again. Meanwhile, I am not able to do another task on system. I want to do this in a CMD so that i can minimize ...
Can we execute mutiple commands in the same command prompt launched by python script?
0.132549
0
0
95
8,356,517
2011-12-02T12:45:00.000
18
0
1
0
python,urllib2,httplib
8,376,268
2
true
0
0
This was caused by a library's failure to close connections, leading to a large number of connections stuck in a CLOSE_WAIT state. Eventually this causes the 'Temporary failure in name resolution' error due to resource exhaustion.
1
21
0
After running for a number of hours on Linux, my Python 2.6 program that uses urllib2, httplib and threads, starts raising this error for every request: <class 'urllib2.URLError'> URLError(gaierror(-3, 'Temporary failure in name resolution'),) If I restart the program it starts working again. My guess is some kind of r...
Permanent 'Temporary failure in name resolution' after running for a number of hours
1.2
0
1
18,882
8,358,178
2011-12-02T14:56:00.000
0
0
0
0
python,aes,m2crypto,pkcs#5
8,369,592
1
true
0
0
After much thrashing through OpenSSL docs, it looks like PKCS #5 is the padding scheme it uses. Well, the OpenSSL docs aren't that great either so I'm still only 90% sure of this.
1
0
0
Is there any way to use PKCS #5 padding with AES CBC in m2crypto? Can't seem to find one too easily. Is there any python library that can do this? Or do I need to do it manually? If so, are there any resources on doing this?
PKCS #5 padding with m2crypto
1.2
0
0
1,123
8,358,258
2011-12-02T15:03:00.000
7
0
1
0
python,import,module
8,358,385
2
true
0
0
import loads the matching .py, .pyc or .pyo file, creates a module object, and stores it with its fully qualified ("dotted") name in the sys.modules dictionary. If a second import finds the module to import in this dictionary, it will return it without loading the file again. To answer your questions: When you import...
1
3
0
When you import a module, then reimport it again, will it get reimported/overwritten, or skipped? When you import module "a" and "b", but also have module "b" imported in module "a", what happens? Is it safe to do this? For example if that module "b" has a class instantiated in it, will you end up instantiating it twic...
How does Python's "import" work internally?
1.2
0
0
681
8,359,291
2011-12-02T16:17:00.000
1
1
0
1
python,eclipse,cpu,pydev
10,102,742
2
false
1
0
Disable 'Build Automatically' and 'Refresh Automatically' under Preferences->General->Workspace Disable 'Code Analysis' entirely, or configure it to only run on save under Preferences->PyDev->Editor->Code Analysis
1
0
0
I am currently switching from Eclipse Java Development more and more Python scripting using PyDev. Almost all the time there is a Eclipse backgropund thread called "reindexing PythonHome..." which loads my CPU for almost 100%. Unusable to coding in there anymore :/ Do you have any idea? Thanks a lot for your help! John
Eclipse & Python: 100% CPU load due to PythonHome reindexing
0.099668
0
0
706
8,359,317
2011-12-02T16:19:00.000
11
0
1
0
python,console
8,359,426
6
true
0
0
If you're running python in a standard unix console, the usual ctrl-s (pause output, continue with ctrl-q) and ctrl-z (suspend, continue with fg) commands work. If you're running in a windows command shell, use the Pause button (press any key to continue).
6
14
0
I am running some Python code in the console, inside a very long for loop. I would like to pause the execution of the script, and then be able to resume where I left. Is it possible to pause the Python console? Note: I don't want to use time.sleep; I want to be able to externally pause the console in the middle of a lo...
Pausing the Python console
1.2
0
0
13,143
8,359,317
2011-12-02T16:19:00.000
0
0
1
0
python,console
14,666,428
6
false
0
0
i think what your looking for is a command that will pause the code until you tell him to continue like hitting the Enter key try putting input() where you want to "pause" the code
6
14
0
I am running some Python code in the console, inside a very long for loop. I would like to pause the execution of the script, and then be able to resume where I left. Is it possible to pause the Python console? Note: I don't want to use time.sleep; I want to be able to externally pause the console in the middle of a lo...
Pausing the Python console
0
0
0
13,143
8,359,317
2011-12-02T16:19:00.000
3
0
1
0
python,console
8,359,490
6
false
0
0
If you are using Unix you can always Ctrl+Z, to go back to the command prompt and then 'fg' to get back to the python console. On Windows use the Pause button On Unix you can also do: To stop: kill -SIGSTOP pid To continue: kill -SIGCONT pid
6
14
0
I am running some Python code in the console, inside a very long for loop. I would like to pause the execution of the script, and then be able to resume where I left. Is it possible to pause the Python console? Note: I don't want to use time.sleep; I want to be able to externally pause the console in the middle of a lo...
Pausing the Python console
0.099668
0
0
13,143
8,359,317
2011-12-02T16:19:00.000
1
0
1
0
python,console
8,359,800
6
false
0
0
If you know before runtime exactly when you will need to pause, just take a look at the pdb module. If you do not know, I suggest you insert some code which checks for the existance of a certain file at every iteration and, if it exists, calls pdb. Performance, of course, will suffer. You can then create that file when...
6
14
0
I am running some Python code in the console, inside a very long for loop. I would like to pause the execution of the script, and then be able to resume where I left. Is it possible to pause the Python console? Note: I don't want to use time.sleep; I want to be able to externally pause the console in the middle of a lo...
Pausing the Python console
0.033321
0
0
13,143
8,359,317
2011-12-02T16:19:00.000
0
0
1
0
python,console
14,667,021
6
false
0
0
On my laptop running windows 7 < ctrl + s > pauses execution.
6
14
0
I am running some Python code in the console, inside a very long for loop. I would like to pause the execution of the script, and then be able to resume where I left. Is it possible to pause the Python console? Note: I don't want to use time.sleep; I want to be able to externally pause the console in the middle of a lo...
Pausing the Python console
0
0
0
13,143
8,359,317
2011-12-02T16:19:00.000
0
0
1
0
python,console
39,782,363
6
false
0
0
Win 10, python 3.5.1 shell: F10 toggles pause and run.
6
14
0
I am running some Python code in the console, inside a very long for loop. I would like to pause the execution of the script, and then be able to resume where I left. Is it possible to pause the Python console? Note: I don't want to use time.sleep; I want to be able to externally pause the console in the middle of a lo...
Pausing the Python console
0
0
0
13,143
8,360,725
2011-12-02T18:14:00.000
0
0
1
0
python,alias,shortcut
8,960,427
2
false
0
0
As far as I can tell it should be possible using PyObjC to get at the Mac's Foundation library. I think NSURLBookmarkResolutionWithoutUI is what you are looking for.
1
2
0
I would like to change the target of an alias using python. do I have to download some external library to do this. I played around with aliases a bit and can't figure out any way to edit them without user input. I'm using mac, python 2.6
change an alias target python
0
0
0
313
8,366,909
2011-12-03T09:59:00.000
-1
0
0
0
javascript,python,highlighting,glossary,glossaries
8,366,996
3
false
1
0
How about going through each term in the glossary and then, for each term, using regex to find all occurrences in the HTML? You could replace each of those occurrences with the term wrapped in a span with a class "highlighted" that will be styled to have a background color.
1
1
0
We have a glossary with up to 2000 terms (where each glossary term may consist of one, two or three words (either separated with whitespaces or a dash). Now we are looking for a solution for highlighting all terms inside a (longer) HTML document (up to 100 KB of HTML markup) in order to generate a static HTML page with...
Highlighting glossary terms inside a HTML document
-0.066568
0
1
689
8,367,381
2011-12-03T11:39:00.000
0
1
0
1
python,django,google-app-engine,gmail
8,373,562
2
true
1
0
What do you mean by "fully connected"? It's possible to set up a GMail filter to forward emails to a different address (say, the email address of your App Engine app). And an App Engine app an send emails (say, to a GMail address). The trick is to set up the GMail filter carefully to avoid loops.
2
3
0
I would like to build an application in Google App Engine (Python) that would be fully connected to a single GMail account and then filter e-mails from this account (e.g. filter messages for a certain string and show it on the string). In the future I am also going to implement the option to send messages. What is the ...
Filtering GMail messages in Google App Engine application
1.2
0
0
487
8,367,381
2011-12-03T11:39:00.000
0
1
0
1
python,django,google-app-engine,gmail
8,379,161
2
false
1
0
There is no Api for Gmail in App Engine. The only thing you can do is forwarding messages to App Engine. I have used fowarding for building auto responders. But there is an excellent GMail Api in Google Apps Script with lots of functions. Apps scrips uses javascript. And ofcourse your apps script can communicate with A...
2
3
0
I would like to build an application in Google App Engine (Python) that would be fully connected to a single GMail account and then filter e-mails from this account (e.g. filter messages for a certain string and show it on the string). In the future I am also going to implement the option to send messages. What is the ...
Filtering GMail messages in Google App Engine application
0
0
0
487
8,368,463
2011-12-03T14:51:00.000
0
0
1
1
python,windows,command-prompt
8,368,528
2
false
0
0
No. If you know how to open the command prompt, navigate to a directory ("cd") and list a directory ("dir" on windows and "ls" on linux), then you can probably jump right into those python tutorials.
1
0
0
I saw a couple of tutorials and they all make use of termial/command-prompt and I just dont know how they work. Is it necessary to know how they work before learning python or you can just earn it like you would learn some other language(lets say C) It'll be great if you could recommend something. NOTE: I am a windows...
Is it necessary to have the knowledge of using terminal/command-prompt for learning python
0
0
0
147
8,370,135
2011-12-03T18:59:00.000
-2
0
0
0
python,py2exe
23,424,057
3
false
0
1
import os Then in your code os.system("pause")
1
2
0
I am using py2exe to make executable. I want to know how to pause the program until a button is pressed.. just like we do in C using system("pause"); As the program terminates automatically in windows, I need this tool. Is there anything better than py2exe which does similar work ?
how to pause a program until a button is pressed
-0.132549
0
0
21,409
8,370,147
2011-12-03T19:00:00.000
0
0
1
0
python,regex
8,725,779
1
false
1
0
The regular expression '(P[\.\s]*O[\.\s]*Box)?\s*(\d+)\s*(P[\.\s]*O[\.\s]*Box)?' will match almost anything that looks like a PO Box (but will match a number only address too). The replacement '\2 PO Box' would normalize the data. So the code would be something like this import re rgx = re.compile(r'(P[\.\s]*O[\.\s]*B...
1
1
0
Authorize.net ( or the banks ) will not validate an address unless for a PO Box address, unless its in the form of 123 P.O. Box. Most people use P.O Box 123. There are loads of variations PO Box formats and I need an algorithm that puts the number in front of the PO Box Any suggests would be helpful.
python po box split for auth.net
0
0
0
422
8,370,487
2011-12-03T19:49:00.000
5
0
1
0
python,import,module,package
8,370,500
2
true
0
0
Should I just import all the required modules in each .py file I write Yes. With pygame especially this would be very confusing since I'd have to init pygame in each file just to use it's functions No, only init it once. There's only one copy of the module.
2
6
0
More specifically let's say I have a number of .py files, with main.py importing stuff like os, pygame, math and all my other .py files, mymodule01.py etc. My problem is that whenever main.py calls on one of my .py files and that file contains something like an os.listdir() I keep getting an error saying stuff like 'os...
Importing python modules for use in only one file
1.2
0
0
2,199
8,370,487
2011-12-03T19:49:00.000
5
0
1
0
python,import,module,package
8,370,616
2
false
0
0
I think you may be under the impression that "import" acts like "include" in other languages. It doesn't. Each module object is a singleton. There's no performance degradation or danger of initializing a module's code more than once. Furthermore, each file has its own scope, so in your example if you define foo = 1 in ...
2
6
0
More specifically let's say I have a number of .py files, with main.py importing stuff like os, pygame, math and all my other .py files, mymodule01.py etc. My problem is that whenever main.py calls on one of my .py files and that file contains something like an os.listdir() I keep getting an error saying stuff like 'os...
Importing python modules for use in only one file
0.462117
0
0
2,199
8,370,951
2011-12-03T20:57:00.000
0
0
0
0
python,3d
8,874,392
1
true
0
1
You can use pyopengl. i think you might have to install pygame...
1
0
0
Pygame and Pyglet are for 2D game development. Pysoy needs many requirements to be installed. I can't figure out how to install Pyogre. Panda3d is giving me this error and don't know how to fix it. importerror no module named direct.showbase.showbase Is there any other good 3D game development library that could be ...
What is the best Python library for 3D game development?
1.2
0
0
2,006
8,371,453
2011-12-03T22:13:00.000
1
0
0
0
python,c,gtk,pygtk
8,371,633
2
false
0
1
First thing to read up on in GUI programming is the Model View Controller pattern. You want to separate the data flow from the GUI as much as possible. The networking code updates the data model. When the data model has changed, it signals the front end so the GUI can redraw.
1
2
0
I intend to write a networking application with a GUI frontend, presumably using GTK. I'm completely new to GTK (and GUI programming in general). My current guess would be to use two threads, one that handles networking and the other one running the GTK frontend. Is this the common design pattern for this kind of probl...
GTK networking app: need design pattern
0.099668
0
0
762
8,379,513
2011-12-04T23:39:00.000
1
0
0
1
python,redis,celery
11,473,359
1
false
0
0
The problem with using pub/sub is that it's not persistant. If you're looking to do closer to real time communication celery might not be your best choice.
1
11
0
Is there an efficient way to start tasks via Redis Pub/Sub and return the value of the task back to a Pub/Sub channel to start another task based on the result? Does anybody have an idea on how to put this together? Maybe decorators are a good idea to handle and prepare the return value back to a Pub/Sub channel wi...
Start Python Celery task via Redis Pub/Sub
0.197375
0
0
2,033