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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1,145,932 | 2009-07-17T22:18:00.000 | 5 | 0 | 1 | 0 | c++,python,api | 1,146,654 | 4 | true | 0 | 0 | You could set Py_NoSiteFlag = 1, call PyInitialize and import site.py yourself as needed. | 2 | 5 | 0 | I'm trying to embed the Python interpreter and need to customize the way the Python standard library is loaded. Our library will be loaded from the same directory as the executable, not from prefix/lib/.
We have been successful in making this work by manually modifying sys.path after calling Py_Initialize(), however, t... | How to override Py_GetPrefix(), Py_GetPath()? | 1.2 | 0 | 0 | 1,585 |
1,145,932 | 2009-07-17T22:18:00.000 | 4 | 0 | 1 | 0 | c++,python,api | 1,146,134 | 4 | false | 0 | 0 | Have you considered using putenv to adjust PYTHONPATH before calling Py_Initialize? | 2 | 5 | 0 | I'm trying to embed the Python interpreter and need to customize the way the Python standard library is loaded. Our library will be loaded from the same directory as the executable, not from prefix/lib/.
We have been successful in making this work by manually modifying sys.path after calling Py_Initialize(), however, t... | How to override Py_GetPrefix(), Py_GetPath()? | 0.197375 | 0 | 0 | 1,585 |
1,147,090 | 2009-07-18T09:24:00.000 | 0 | 0 | 0 | 0 | python,xml,dom,expat-parser | 1,149,208 | 4 | false | 0 | 0 | If jython is acceptable to you, tagsoup is very good at parsing junk - if it is, I found the jdom libraries far easier to use than other xml alternatives.
This is a snippet from a demo mockup to do with screen scraping from tfl's journey planner:
private Document getRoutePage(HashMap params) throws Exception {
... | 1 | 0 | 0 | I'm trying to extract some data from various HTML pages using a python program. Unfortunately, some of these pages contain user-entered data which occasionally has "slight" errors - namely tag mismatching.
Is there a good way to have python's xml.dom try to correct errors or something of the sort? Alternatively, is the... | Python xml.dom and bad XML | 0 | 0 | 1 | 778 |
1,147,713 | 2009-07-18T14:45:00.000 | 2 | 0 | 1 | 1 | python | 1,148,018 | 5 | false | 0 | 0 | Extract the archive to a temporary directory, and type "python setup.py install". | 1 | 1 | 0 | I do not know Python, I have installed it only and downloaded the libgmail package. So, please give me verbatim steps in installing the libgmail library. My python directory is c:\python26, so please do not skip any steps in the answer.
Thanks! | How to install Python 3rd party libgmail-0.1.11.tar.tar into Python in Windows XP home? | 0.07983 | 0 | 0 | 3,071 |
1,148,165 | 2009-07-18T18:08:00.000 | 0 | 0 | 0 | 0 | java,python,google-app-engine,gdata-api | 1,149,886 | 3 | true | 1 | 0 | I'm having a look into the google data api protocol which seems to solve the problem. | 1 | 0 | 0 | I have a dilemma where I want to create an application that manipulates google contacts information. The problem comes down to the fact that Python only supports version 1.0 of the api whilst Java supports 3.0.
I also want it to be web-based so I'm having a look at google app engine, but it seems that only the python v... | Possible to access gdata api when using Java App Engine? | 1.2 | 0 | 1 | 802 |
1,148,709 | 2009-07-18T22:04:00.000 | 2 | 0 | 0 | 1 | python,google-app-engine,feed | 1,148,720 | 3 | false | 1 | 0 | 2 fetches per task? 3? | 2 | 0 | 0 | Say I had over 10,000 feeds that I wanted to periodically fetch/parse.
If the period were say 1h that would be 24x10000 = 240,000 fetches.
The current 10k limit of the labs Task Queue API would preclude one from
setting up one task per fetch. How then would one do this?
Update: RE: Fetching nurls per task - Given the 3... | Using Task Queues to schedule the fetching/parsing of a number of feeds in App Engine (Python) | 0.132549 | 0 | 0 | 365 |
1,148,709 | 2009-07-18T22:04:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine,feed | 1,148,729 | 3 | false | 1 | 0 | Group up the fetches, so instead of queuing 1 fetch you queue up, say, a work unit that does 10 fetches. | 2 | 0 | 0 | Say I had over 10,000 feeds that I wanted to periodically fetch/parse.
If the period were say 1h that would be 24x10000 = 240,000 fetches.
The current 10k limit of the labs Task Queue API would preclude one from
setting up one task per fetch. How then would one do this?
Update: RE: Fetching nurls per task - Given the 3... | Using Task Queues to schedule the fetching/parsing of a number of feeds in App Engine (Python) | 0 | 0 | 0 | 365 |
1,148,854 | 2009-07-18T23:18:00.000 | 0 | 0 | 0 | 0 | python,django,session,templates | 1,148,886 | 3 | false | 1 | 0 | Are you trying to make certain areas of your site only accessible when logged on? Or certain areas of a particular page?
If you want to block off access to a whole URL you can use the @login_required decorator in your functions in your view to block certain access. Also, you can use includes to keep the common parts of... | 1 | 0 | 0 | I'd like to output some information that depends on session data in Django. Let's take a "Login" / "Logged in as | Logout" fragment for example. It depends on my request.session['user'].
Of course I can put a user object in the context every time I render a page and then switch on {% if user %}, but that seems to brea... | Rendering common session information in every view | 0 | 0 | 0 | 157 |
1,149,581 | 2009-07-19T09:56:00.000 | 1 | 1 | 1 | 0 | python,ruby | 1,149,723 | 5 | false | 0 | 0 | To avoid the holy war and maybe give another perspective I say (without requesting more information of what fun part of programming the question-ere thinks is cool to do):
Learn python first!
If you haven't done any scripting language yet I would recommend python.
The core of python is somewhat cleaner than the core o... | 2 | 8 | 0 | I'm thinking about learning ruby and python a little bit, and it occurred to me, for what ruby/python is good for? When to use ruby and when python, or for what ruby/python is not for? :)
What should I do in these languages?
thanks | python and ruby - for what to use it? | 0.039979 | 0 | 0 | 15,641 |
1,149,581 | 2009-07-19T09:56:00.000 | 11 | 1 | 1 | 0 | python,ruby | 1,149,595 | 5 | true | 0 | 0 | They are good for mostly for rapid prototyping, quick development, dynamic programs, web applications and scripts. They're general purpose languages, so you can use them for pretty much everything you want. You'll have smaller development times (compared to, say, Java or C++), but worse performance and less static erro... | 2 | 8 | 0 | I'm thinking about learning ruby and python a little bit, and it occurred to me, for what ruby/python is good for? When to use ruby and when python, or for what ruby/python is not for? :)
What should I do in these languages?
thanks | python and ruby - for what to use it? | 1.2 | 0 | 0 | 15,641 |
1,149,692 | 2009-07-19T11:21:00.000 | 4 | 0 | 0 | 0 | python,ironpython,cpython | 1,149,740 | 4 | false | 0 | 1 | if you like/need to use .net framework, use ironpython, else CPython it's your choice
(or you can try PyPy :)) | 4 | 7 | 0 | What would you use for a brand new cross platform GUI app, CPython or IronPython ?
What about
- license / freedom
- development
- - doc
- - editors
- - tools
- libraries
- performances
- portability
What can you do best with one or the other ?
- networking
- database
- GUI
- system
- multi threa... | CPython or IronPython? | 0.197375 | 0 | 0 | 5,086 |
1,149,692 | 2009-07-19T11:21:00.000 | 4 | 0 | 0 | 0 | python,ironpython,cpython | 1,149,762 | 4 | true | 0 | 1 | Use CPython, with IronPython you are bound to .Net platform which do not have much cross platform support, mono is there on linux but still for a cross platform app, I wouldn't recommend .Net.
So my suggestion is use CPython, for GUI use a framework like wxPython/PyQT and you would be happy. | 4 | 7 | 0 | What would you use for a brand new cross platform GUI app, CPython or IronPython ?
What about
- license / freedom
- development
- - doc
- - editors
- - tools
- libraries
- performances
- portability
What can you do best with one or the other ?
- networking
- database
- GUI
- system
- multi threa... | CPython or IronPython? | 1.2 | 0 | 0 | 5,086 |
1,149,692 | 2009-07-19T11:21:00.000 | 2 | 0 | 0 | 0 | python,ironpython,cpython | 11,117,032 | 4 | false | 0 | 1 | cpython is native runtime based python,,,it has a thin runtime level to the hosting os,
ironpy is soft vm based python,,,it has a heavy soft interpter embeded in the dotnet vm,,which is called clr
overall,,,cpython is made to be a scripting language natively,,it focus on the language,while ironpy is made to accomplishe... | 4 | 7 | 0 | What would you use for a brand new cross platform GUI app, CPython or IronPython ?
What about
- license / freedom
- development
- - doc
- - editors
- - tools
- libraries
- performances
- portability
What can you do best with one or the other ?
- networking
- database
- GUI
- system
- multi threa... | CPython or IronPython? | 0.099668 | 0 | 0 | 5,086 |
1,149,692 | 2009-07-19T11:21:00.000 | 2 | 0 | 0 | 0 | python,ironpython,cpython | 1,150,371 | 4 | false | 0 | 1 | I can only think of about one "cross platform" GUI app that's remotely tolerable (firefox), and people are complaining wildly about it everywhere I look.
If you want to do cross platform, build a nice, solid model that can do the work you need done and build platform-specific GUIs that use it.
I don't know how tolerabl... | 4 | 7 | 0 | What would you use for a brand new cross platform GUI app, CPython or IronPython ?
What about
- license / freedom
- development
- - doc
- - editors
- - tools
- libraries
- performances
- portability
What can you do best with one or the other ?
- networking
- database
- GUI
- system
- multi threa... | CPython or IronPython? | 0.099668 | 0 | 0 | 5,086 |
1,150,093 | 2009-07-19T15:10:00.000 | 2 | 0 | 1 | 0 | python,module,d | 1,315,336 | 2 | false | 0 | 0 | Sounds easy and people here who say it's just up to the C API don't know how difficult it is to integrate the Boehm GC used by D within Python. PyD looks like a typical concept proof where people haven't realized the real world problems. | 1 | 16 | 0 | I hear D is link-compatible with C. I'd like to use D to create an extension module for Python. Am I overlooking some reason why it's never going to work? | Can I create a Python extension module in D (instead of C) | 0.197375 | 0 | 0 | 763 |
1,150,373 | 2009-07-19T17:23:00.000 | 6 | 0 | 1 | 0 | c++,python,c,compilation | 1,150,451 | 4 | false | 0 | 0 | Using freeze doesn't prevent doing it all in one run (no matter what approach you use, you will need multiple build steps - e.g. many compiler invocations). First, you edit Modules/Setup to include all extension modules that you want. Next, you build Python, getting libpythonxy.a. Then, you run freeze, getting a number... | 1 | 47 | 0 | I'm building a special-purpose embedded Python interpreter and want to avoid having dependencies on dynamic libraries so I want to compile the interpreter with static libraries instead (e.g. libc.a not libc.so).
I would also like to statically link all dynamic libraries that are part of the Python standard library. I k... | Compile the Python interpreter statically? | 1 | 0 | 0 | 30,373 |
1,151,770 | 2009-07-20T05:00:00.000 | 0 | 0 | 0 | 0 | python,tkmessagebox | 1,151,900 | 1 | true | 0 | 1 | By 'activate', do you mean make it so the user can close the message box by clicking the close ('X') button?
I do not think it is possible using tkMessageBox. I guess your best bet is to implement a dialog box with this functionality yourself.
BTW: What should askquestion() return when the user closes the dialog box? | 1 | 1 | 0 | Can anybody help me out in how to activate 'close' button of askquestion() of tkMessageBox?? | tkMessageBox | 1.2 | 0 | 0 | 1,575 |
1,151,771 | 2009-07-20T05:01:00.000 | 0 | 1 | 0 | 1 | python,ping,traceroute | 2,974,474 | 7 | false | 0 | 0 | ICMP Ping is standard as part of the ICMP protocol.
Traceroute uses features of ICMP and IP to determine a path via Time To Live values. Using TTL values, you can do traceroutes in a variety of protocols as long as IP/ICMP work because it is the ICMP TTL EXceeded messages that tell you about the hop in the path.
If y... | 1 | 10 | 0 | I would like to be able to perform a ping and traceroute from within Python without having to execute the corresponding shell commands so I'd prefer a native python solution. | How can I perform a ping or traceroute using native python? | 0 | 0 | 0 | 34,815 |
1,153,577 | 2009-07-20T13:28:00.000 | 3 | 1 | 1 | 0 | c++,python,integration | 46,593,807 | 12 | false | 0 | 0 | I'd recommend looking at how PyTorch does their integration. | 1 | 74 | 0 | I'm learning C++ because it's a very flexible language. But for internet things like Twitter, Facebook, Delicious and others, Python seems a much better solution.
Is it possible to integrate C++ and Python in the same project? | Integrate Python And C++ | 0.049958 | 0 | 0 | 112,300 |
1,153,714 | 2009-07-20T13:53:00.000 | 8 | 0 | 0 | 0 | c++,python,qt,qt4,pyqt4 | 1,166,388 | 5 | false | 0 | 1 | I'm answering in C++ here, since that's what I'm most familiar with, and your problem isn't specific to PyQt.
Normally, you just need to call QWidget::updateGeometry() when the sizeHint() may have changed, just like you need to call QWidget::update() when the contents may have changed.
Your problem, however, is that th... | 2 | 12 | 0 | I am having some issues with the size of qt4 widgets when their content changes.
I will illustrate my problems with two simple scenarios:
Scenario 1:
I have a QLineEdit widget. Sometimes, when I'm changing its content using QLineEdit.setText(), the one-line string doesn't fit into the widget at its current size anymore... | PyQt: how to handle auto-resize of widgets when their content changes | 1 | 0 | 0 | 12,735 |
1,153,714 | 2009-07-20T13:53:00.000 | 0 | 0 | 0 | 0 | c++,python,qt,qt4,pyqt4 | 1,813,475 | 5 | false | 0 | 1 | Ok implement sizeHint() method. And every time your content change size call updateGeometry()
When content change without changing size use update(). (updateGeometry() automatically call update()). | 2 | 12 | 0 | I am having some issues with the size of qt4 widgets when their content changes.
I will illustrate my problems with two simple scenarios:
Scenario 1:
I have a QLineEdit widget. Sometimes, when I'm changing its content using QLineEdit.setText(), the one-line string doesn't fit into the widget at its current size anymore... | PyQt: how to handle auto-resize of widgets when their content changes | 0 | 0 | 0 | 12,735 |
1,154,331 | 2009-07-20T15:44:00.000 | 4 | 0 | 0 | 0 | python,database,django,sqlalchemy | 1,308,718 | 5 | false | 1 | 0 | Jacob Kaplan-Moss admitted to typing "import sqlalchemy" from time to time. I may write a queryset adapter for sqlalchemy results in the not too distant future. | 3 | 23 | 0 | Has anyone used SQLAlchemy in addition to Django's ORM?
I'd like to use Django's ORM for object manipulation and SQLalchemy for complex queries (like those that require left outer joins).
Is it possible?
Note: I'm aware about django-sqlalchemy but the project doesn't seem to be production ready. | SQLAlchemy and django, is it production ready? | 0.158649 | 1 | 0 | 12,511 |
1,154,331 | 2009-07-20T15:44:00.000 | 19 | 0 | 0 | 0 | python,database,django,sqlalchemy | 1,155,407 | 5 | true | 1 | 0 | What I would do,
Define the schema in Django orm, let it write the db via syncdb. You get the admin interface.
In view1 you need a complex join
def view1(request):
import sqlalchemy
data = sqlalchemy.complex_join_magic(...)
...
payload = {'data': data, ...}
return render_to_re... | 3 | 23 | 0 | Has anyone used SQLAlchemy in addition to Django's ORM?
I'd like to use Django's ORM for object manipulation and SQLalchemy for complex queries (like those that require left outer joins).
Is it possible?
Note: I'm aware about django-sqlalchemy but the project doesn't seem to be production ready. | SQLAlchemy and django, is it production ready? | 1.2 | 1 | 0 | 12,511 |
1,154,331 | 2009-07-20T15:44:00.000 | 7 | 0 | 0 | 0 | python,database,django,sqlalchemy | 3,555,602 | 5 | false | 1 | 0 | I've done it before and it's fine. Use the SQLAlchemy feature where it can read in the schema so you don't need to declare your fields twice.
You can grab the connection settings from the settings, the only problem is stuff like the different flavours of postgres driver (e.g. with psyco and without).
It's worth it as ... | 3 | 23 | 0 | Has anyone used SQLAlchemy in addition to Django's ORM?
I'd like to use Django's ORM for object manipulation and SQLalchemy for complex queries (like those that require left outer joins).
Is it possible?
Note: I'm aware about django-sqlalchemy but the project doesn't seem to be production ready. | SQLAlchemy and django, is it production ready? | 1 | 1 | 0 | 12,511 |
1,155,404 | 2009-07-20T19:20:00.000 | 0 | 0 | 0 | 0 | python,user-interface,multithreading,download,tkinter | 1,155,479 | 3 | false | 0 | 1 | You can try using processes instead of threads. Python has GIL which might cause some delays in your situation. | 2 | 0 | 0 | I have a tkinter GUI that downloads data from multiple websites at once. I run a seperate thread for each download (about 28). Is that too much threads for one GUI process? because it's really slow, each individual page should take about 1 to 2 seconds but when all are run at once it takes over 40 seconds. Is there any... | Python accessing multiple webpages at once | 0 | 0 | 0 | 373 |
1,155,404 | 2009-07-20T19:20:00.000 | 1 | 0 | 0 | 0 | python,user-interface,multithreading,download,tkinter | 1,155,498 | 3 | false | 0 | 1 | A process can have hundreds of threads on any modern OS without any problem.
If you're bandwidth-limited, 1 to 2 seconds times 28 means 40 seconds is about right. If you're latency limited, it should be faster, but with no information, all I can suggest is:
add logging to your code to make sure it's actually running ... | 2 | 0 | 0 | I have a tkinter GUI that downloads data from multiple websites at once. I run a seperate thread for each download (about 28). Is that too much threads for one GUI process? because it's really slow, each individual page should take about 1 to 2 seconds but when all are run at once it takes over 40 seconds. Is there any... | Python accessing multiple webpages at once | 0.066568 | 0 | 0 | 373 |
1,155,513 | 2009-07-20T19:38:00.000 | -1 | 0 | 0 | 0 | python,database,django,locking,atomic | 1,155,531 | 3 | false | 1 | 0 | Wrap the DB queries that read and the ones that update in a transaction. The syntax depends on what ORM you are using. | 1 | 1 | 0 | I have a simple django app to simulate a stock market, users come in and buy/sell. When they choose to trade,
the market price is read, and
based on the buy/sell order the market price is increased/decreased.
I'm not sure how this works in django, but is there a way to make the view atomic? i.e. I'm concerned that u... | Django, how to make a view atomic? | -0.066568 | 0 | 0 | 2,233 |
1,156,511 | 2009-07-20T23:26:00.000 | 3 | 0 | 0 | 0 | python,django,random,django-views | 1,156,541 | 3 | true | 1 | 0 | Call random.seed() rarely if at all.
To be random, you must allow the random number generator to run without touching the seed. The sequence of numbers is what's random. If you change the seed, you start a new sequence. The seed values may not be very random, leading to problems.
Depending on how many numbers you ... | 3 | 4 | 0 | In a view in django I use random.random(). How often do I have to call random.seed()?
One time for every request?
One time for every season?
One time while the webserver is running? | Seeding random in django | 1.2 | 0 | 0 | 2,315 |
1,156,511 | 2009-07-20T23:26:00.000 | 0 | 0 | 0 | 0 | python,django,random,django-views | 1,156,536 | 3 | false | 1 | 0 | It really depends on what you need the random number for. Use some experimentation to find out if it makes any difference. You should also consider that there is actually a pattern to pseudo-random numbers. Does it make a difference to you if someone can possible guess the next random number? If not, seed it once a... | 3 | 4 | 0 | In a view in django I use random.random(). How often do I have to call random.seed()?
One time for every request?
One time for every season?
One time while the webserver is running? | Seeding random in django | 0 | 0 | 0 | 2,315 |
1,156,511 | 2009-07-20T23:26:00.000 | 4 | 0 | 0 | 0 | python,django,random,django-views | 1,157,735 | 3 | false | 1 | 0 | Don't set the seed.
The only time you want to set the seed is if you want to make sure that the same events keep happening. For example, if you don't want to let players cheat in your game you can save the seed, and then set it when they load their game. Then no matter how many times they save + reload, it still gives ... | 3 | 4 | 0 | In a view in django I use random.random(). How often do I have to call random.seed()?
One time for every request?
One time for every season?
One time while the webserver is running? | Seeding random in django | 0.26052 | 0 | 0 | 2,315 |
1,158,108 | 2009-07-21T09:15:00.000 | 11 | 0 | 1 | 0 | python,testing,import | 1,158,116 | 2 | true | 0 | 0 | Python will import it twice.
A link is a file system concept. To the Python interpreter, x.py and y.py are two different modules.
$ echo print \"importing \" + __file__ > x.py
$ ln -s x.py y.py
$ python -c "import x; import y"
importing x.py
importing y.py
$ python -c "import x; import y"
importing x.pyc
importing y.p... | 2 | 10 | 0 | If I have files x.py and y.py . And y.py is the link(symbolic or hard) of x.py .
If I import both the modules in my script. Will it import it once or it assumes both are different files and import it twice.
What it does exactly? | python - Importing a file that is a symbolic link | 1.2 | 0 | 0 | 6,563 |
1,158,108 | 2009-07-21T09:15:00.000 | 13 | 0 | 1 | 0 | python,testing,import | 1,948,735 | 2 | false | 0 | 0 | You only have to be careful in the case where your script itself is a symbolic link, in which case the first entry of sys.path will be the directory containing the target of the link. | 2 | 10 | 0 | If I have files x.py and y.py . And y.py is the link(symbolic or hard) of x.py .
If I import both the modules in my script. Will it import it once or it assumes both are different files and import it twice.
What it does exactly? | python - Importing a file that is a symbolic link | 1 | 0 | 0 | 6,563 |
1,159,690 | 2009-07-21T14:52:00.000 | 4 | 0 | 1 | 0 | python,regex,fraud-prevention | 1,159,915 | 11 | false | 0 | 0 | Maybe you could check for an abundance of consonants. So for example, in your example lakdsjflkaj there are 2 vowels ( a ) and 9 consonants. Usually the probability of hitting a vowel when randomly pressing keys is much lower than the one of hitting a consonant. | 7 | 6 | 0 | When signing up for new accounts, web apps often ask for the answer to a 'security question', i.e. Dog's name, etc.
I'd like to go through our database and look for instances where users just mashed the keyboard instead of providing a legitimate answer - this is a high indicator of an abusive/fraudulent account.
"Mothe... | Regex for keyboard mashing | 0.072599 | 0 | 0 | 1,905 |
1,159,690 | 2009-07-21T14:52:00.000 | 2 | 0 | 1 | 0 | python,regex,fraud-prevention | 1,159,757 | 11 | false | 0 | 0 | If your question is ever something related to a real, human name, this is impossible. Consider Asian names typed with roman characters; they may very well trip whatever filter you come up with, but are still perfectly legitimate. | 7 | 6 | 0 | When signing up for new accounts, web apps often ask for the answer to a 'security question', i.e. Dog's name, etc.
I'd like to go through our database and look for instances where users just mashed the keyboard instead of providing a legitimate answer - this is a high indicator of an abusive/fraudulent account.
"Mothe... | Regex for keyboard mashing | 0.036348 | 0 | 0 | 1,905 |
1,159,690 | 2009-07-21T14:52:00.000 | 4 | 0 | 1 | 0 | python,regex,fraud-prevention | 1,159,726 | 11 | false | 0 | 0 | If you can find a list of letter-pair probabilities in English, you could construct an approximate probability for the word not being a "real" English word, using the least possible pairs and pairs that are not in the list. Unfortunately, if you have names or other "non-words" then you can't force them to be English w... | 7 | 6 | 0 | When signing up for new accounts, web apps often ask for the answer to a 'security question', i.e. Dog's name, etc.
I'd like to go through our database and look for instances where users just mashed the keyboard instead of providing a legitimate answer - this is a high indicator of an abusive/fraudulent account.
"Mothe... | Regex for keyboard mashing | 0.072599 | 0 | 0 | 1,905 |
1,159,690 | 2009-07-21T14:52:00.000 | 0 | 0 | 1 | 0 | python,regex,fraud-prevention | 1,160,107 | 11 | false | 0 | 0 | Instead of regular expressions, why not just compare with a list of known good values? For example, compare Mother's maiden name with census data, or pet name with any of the pet name lists you can find online. For a much simpler version of this, just do a Google search for whatever is entered. Legitimate names shou... | 7 | 6 | 0 | When signing up for new accounts, web apps often ask for the answer to a 'security question', i.e. Dog's name, etc.
I'd like to go through our database and look for instances where users just mashed the keyboard instead of providing a legitimate answer - this is a high indicator of an abusive/fraudulent account.
"Mothe... | Regex for keyboard mashing | 0 | 0 | 0 | 1,905 |
1,159,690 | 2009-07-21T14:52:00.000 | 13 | 0 | 1 | 0 | python,regex,fraud-prevention | 1,159,866 | 11 | false | 0 | 0 | The whole approach of security questions is quite flawed.
I have always found people put security answers weaker than the passwords they use.
Security questions are just one more link in a security chain -- the weaker link!
IMO, a better way to go would be to allow the user to request a new-password sent to their reg... | 7 | 6 | 0 | When signing up for new accounts, web apps often ask for the answer to a 'security question', i.e. Dog's name, etc.
I'd like to go through our database and look for instances where users just mashed the keyboard instead of providing a legitimate answer - this is a high indicator of an abusive/fraudulent account.
"Mothe... | Regex for keyboard mashing | 1 | 0 | 0 | 1,905 |
1,159,690 | 2009-07-21T14:52:00.000 | 6 | 0 | 1 | 0 | python,regex,fraud-prevention | 1,159,716 | 11 | false | 0 | 0 | There's no way to do this with a regex. Actually, I can't think of a reasonable way to do this at all -- where would you draw the line between suspicious and unsuspicious? I, for once, often answer the security questions with an obfuscated answer. After all, my mother's maiden name isn't the hardest thing to find out. | 7 | 6 | 0 | When signing up for new accounts, web apps often ask for the answer to a 'security question', i.e. Dog's name, etc.
I'd like to go through our database and look for instances where users just mashed the keyboard instead of providing a legitimate answer - this is a high indicator of an abusive/fraudulent account.
"Mothe... | Regex for keyboard mashing | 1 | 0 | 0 | 1,905 |
1,159,690 | 2009-07-21T14:52:00.000 | 0 | 0 | 1 | 0 | python,regex,fraud-prevention | 1,159,720 | 11 | false | 0 | 0 | You could look for patterns that don't make sense phonetically. Such as:
'q' not followed by a 'u'.
asdf
qwer
zxcv
asdlasd
Basically, try mashing on your own keyboard, see what you get, and plug that in your filter. Also plug in various grammatical rules. However, since it's names you're dealing with, you'll always get... | 7 | 6 | 0 | When signing up for new accounts, web apps often ask for the answer to a 'security question', i.e. Dog's name, etc.
I'd like to go through our database and look for instances where users just mashed the keyboard instead of providing a legitimate answer - this is a high indicator of an abusive/fraudulent account.
"Mothe... | Regex for keyboard mashing | 0 | 0 | 0 | 1,905 |
1,160,061 | 2009-07-21T15:46:00.000 | 2 | 0 | 1 | 0 | python | 1,162,934 | 2 | false | 0 | 0 | Python uses the C library it is linked against. On Windows, there is no 'platform C library'.. and indeed there are multiple versions of MicrosoftCRunTimeLibrarys (MSCRTs) around on any version. | 1 | 3 | 0 | Does the built-in Python math library basically use C's math library or does Python have a C-independent math library? Also, is the Python math library platform independent? | Python Math Library Independent of C Math Library and Platform Independent? | 0.197375 | 0 | 0 | 940 |
1,160,579 | 2009-07-21T17:27:00.000 | 64 | 0 | 0 | 0 | python,django,django-models,models | 1,160,607 | 3 | true | 1 | 0 | Django is designed to let you build many small applications instead of one big application.
Inside every large application are many small applications struggling to be free.
If your models.py feels big, you're doing too much. Stop. Relax. Decompose.
Find smaller, potentially reusable small application components, or... | 1 | 94 | 0 | Directions from my supervisor:
"I want to avoid putting any logic in the models.py. From here on out, let's use that as only classes for accessing the database, and keep all logic in external classes that use the models classes, or wrap them."
I feel like this is the wrong way to go. I feel that keeping logic out of t... | models.py getting huge, what is the best way to break it up? | 1.2 | 0 | 0 | 18,179 |
1,161,339 | 2009-07-21T19:43:00.000 | 1 | 0 | 1 | 0 | python,open-source | 1,161,372 | 10 | false | 0 | 0 | Pylons.
Even it is 0.9.8, it is quite mature | 1 | 13 | 0 | I would like to see how a large (>40 developers) project done with Python looks like:
how the code looks like
what folder structure they use
what tools they use
how they set up the collaboration environment
what kind of documentation they provide
It doesn't matter what type of software it is (server, client, applica... | Can you point me to a large Python open-source project? | 0.019997 | 0 | 0 | 3,537 |
1,161,580 | 2009-07-21T20:28:00.000 | 2 | 0 | 1 | 1 | python,linux | 1,161,599 | 2 | false | 0 | 0 | You should loop using read() against a set number of characters. | 1 | 1 | 0 | I'm using python's subprocess module to interact with a program via the stdin and stdout pipes. If I call the subprocesses readline() on stdout, it hangs because it is waiting for a newline.
How can I do a read of all the characters in the stdout pipe of a subprocess instance? If it matters, I'm running in Linux. | how do I read everything currently in a subprocess.stdout pipe and then return? | 0.197375 | 0 | 0 | 818 |
1,162,877 | 2009-07-22T03:05:00.000 | 0 | 0 | 0 | 0 | python,database,django,database-design | 1,162,884 | 3 | false | 1 | 0 | I agree with your conclusion. I would store the physician type in the many-to-many linking table. | 1 | 2 | 0 | I'm modeling a database relationship in django, and I'd like to have other opinions. The relationship is kind of a two-to-many relationship. For example, a patient can have two physicians: an attending and a primary. A physician obviously has many patients.
The application does need to know which one is which; further,... | How would you model this database relationship? | 0 | 1 | 0 | 358 |
1,163,012 | 2009-07-22T04:07:00.000 | 4 | 1 | 0 | 0 | php,python,ruby-on-rails,scaling | 1,163,341 | 3 | false | 1 | 0 | IMHO I don't think the cost of scaling is going to be any different between those three because none of them have "scalability batteries" included. I just don't see any huge architectural differences between those three choices that would cause a significant difference in scaling.
In other words, your application arch... | 2 | 7 | 0 | I guess this question has been asked a lot around. I know Rails can scale because I have worked on it and it's awesome. And there is not much doubt about that as far as PHP frameworks are concerned.
I don't want to know which frameworks are better.
How much is difference in cost of scaling Rails vs other frameworks (P... | Cost of scaling Rails vs cost of scaling PHP vs Python frameworks | 0.26052 | 0 | 0 | 2,847 |
1,163,012 | 2009-07-22T04:07:00.000 | 5 | 1 | 0 | 0 | php,python,ruby-on-rails,scaling | 1,163,208 | 3 | true | 1 | 0 | One major factor in this is that isn't affected by choice of framework is database access. No matter what approach you take, you likely put data in a relational database. Then the question is how efficiently you can get the data out of the database. This primarily depends on the RDBMS (Oracle vs. Postgres vs. MySQL), a... | 2 | 7 | 0 | I guess this question has been asked a lot around. I know Rails can scale because I have worked on it and it's awesome. And there is not much doubt about that as far as PHP frameworks are concerned.
I don't want to know which frameworks are better.
How much is difference in cost of scaling Rails vs other frameworks (P... | Cost of scaling Rails vs cost of scaling PHP vs Python frameworks | 1.2 | 0 | 0 | 2,847 |
1,163,531 | 2009-07-22T07:04:00.000 | 0 | 0 | 1 | 0 | python,netbeans,netbeans6.7,netbeans-plugins | 1,776,811 | 1 | true | 0 | 0 | find one Netbeans that downloaded python plug-in and go to Netbeans folder and copy python folder. In computer that need to install python plug-in copy that folder in Netbeans root folder and go to Tools/Plugin and activate python . | 1 | 1 | 0 | Can install python plugin in netbeans 6.7 manually (without Tools/Plugin) ?
if yes (with .nbi package ) which url can use ? | Python plugin in netbeans manually | 1.2 | 0 | 0 | 1,979 |
1,165,631 | 2009-07-22T14:22:00.000 | 0 | 0 | 0 | 0 | python,django | 1,165,715 | 5 | false | 1 | 0 | As with the trunk of any software project, it's only as stable as the people commiting things test for. Typically this is probably pretty stable, but you need to be aware that if you get caught with a 'bad' version (which can happen), your site/s just might come down over it temporarily. | 2 | 2 | 0 | I'm currently using Django 1.1 beta for some personal projects, and plan to start messing arround with the trunk to see the new stuff under the hood. But I might start using it on a professional basis, and I'd need to know if trunk is stable enough for using in production, or I should stick to 1.0 for mission critical ... | Is it safe to track trunk in Django? | 0 | 0 | 0 | 263 |
1,165,631 | 2009-07-22T14:22:00.000 | 2 | 0 | 0 | 0 | python,django | 1,165,718 | 5 | false | 1 | 0 | You probably shouldn't pull Django trunk every day, sometimes there are big commits that might break some things on your site. Also it depends what features you use, the new ones will of cause be a bit more buggy than older features. But all in all there shouldn't be a problem using trunk for production. You just need ... | 2 | 2 | 0 | I'm currently using Django 1.1 beta for some personal projects, and plan to start messing arround with the trunk to see the new stuff under the hood. But I might start using it on a professional basis, and I'd need to know if trunk is stable enough for using in production, or I should stick to 1.0 for mission critical ... | Is it safe to track trunk in Django? | 0.07983 | 0 | 0 | 263 |
1,167,617 | 2009-07-22T19:26:00.000 | 4 | 0 | 1 | 0 | python,inheritance,overriding,self-documenting-code | 1,167,664 | 12 | false | 0 | 0 | Python ain't Java. There's of course no such thing really as compile-time checking.
I think a comment in the docstring is plenty. This allows any user of your method to type help(obj.method) and see that the method is an override.
You can also explicitly extend an interface with class Foo(Interface), which will all... | 1 | 221 | 0 | In Java, for example, the @Override annotation not only provides compile-time checking of an override but makes for excellent self-documenting code.
I'm just looking for documentation (although if it's an indicator to some checker like pylint, that's a bonus). I can add a comment or docstring somewhere, but what is th... | In Python, how do I indicate I'm overriding a method? | 0.066568 | 0 | 0 | 117,488 |
1,168,565 | 2009-07-22T22:05:00.000 | 1 | 0 | 1 | 0 | python,module,package | 1,168,597 | 6 | false | 0 | 0 | IMHO this should probably one of the things you do earlier in the development process. I have never worked on a large-scale project, but it would make sense that you make a roadmap of what's going to be done and where. (Not trying to rib you for asking about it like you made a mistake :D )
Modules are generally grouped... | 4 | 7 | 0 | There comes a point where, in a relatively large sized project, one need to think about splitting the functionality into various functions, and then various modules, and then various packages. Sometimes across different source distributions (eg: extracting a common utility, such as optparser, into a separate project).
... | Recommended ways to split some functionality into functions, modules and packages? | 0.033321 | 0 | 0 | 2,402 |
1,168,565 | 2009-07-22T22:05:00.000 | 1 | 0 | 1 | 0 | python,module,package | 2,360,690 | 6 | false | 0 | 0 | I sympathize with you. You are suffering from self-doubt. Don't worry. If you can speak any language, including your mother tongue, you are qualified to do modularization on your own. For evidence, you may read "The Language Instinct," or "The Math Instinct."
Look around, but not too much. You can learn a lot from them... | 4 | 7 | 0 | There comes a point where, in a relatively large sized project, one need to think about splitting the functionality into various functions, and then various modules, and then various packages. Sometimes across different source distributions (eg: extracting a common utility, such as optparser, into a separate project).
... | Recommended ways to split some functionality into functions, modules and packages? | 0.033321 | 0 | 0 | 2,402 |
1,168,565 | 2009-07-22T22:05:00.000 | 4 | 0 | 1 | 0 | python,module,package | 1,168,598 | 6 | false | 0 | 0 | Take out a pen and piece of paper. Try to draw how your software interacts on a high level. Draw the different layers of the software etc. Group items by functionality and purpose, maybe even by what sort of technology they use. If your software has multiple abstraction layers, I would say to group them by that. O... | 4 | 7 | 0 | There comes a point where, in a relatively large sized project, one need to think about splitting the functionality into various functions, and then various modules, and then various packages. Sometimes across different source distributions (eg: extracting a common utility, such as optparser, into a separate project).
... | Recommended ways to split some functionality into functions, modules and packages? | 0.132549 | 0 | 0 | 2,402 |
1,168,565 | 2009-07-22T22:05:00.000 | 0 | 0 | 1 | 0 | python,module,package | 1,168,613 | 6 | false | 0 | 0 | Actually it varies for each project you create but here is an example:
core package contains modules that are your project cant live without. this may contain the main functionality of your application.
ui package contains modules that deals with the user interface. that is if you split the UI from your console.
This... | 4 | 7 | 0 | There comes a point where, in a relatively large sized project, one need to think about splitting the functionality into various functions, and then various modules, and then various packages. Sometimes across different source distributions (eg: extracting a common utility, such as optparser, into a separate project).
... | Recommended ways to split some functionality into functions, modules and packages? | 0 | 0 | 0 | 2,402 |
1,169,357 | 2009-07-23T02:55:00.000 | 1 | 0 | 0 | 0 | python,documentation,wiki,pydoc | 1,169,664 | 2 | true | 0 | 0 | Take a look at pydoc.TextDoc. If this contains too little markup, you can inherit from it and make it generate markup according to your wiki's syntax. | 1 | 3 | 0 | Looking for something like PyDoc that can generate a set of Wiki style pages vs the current HTML ones that export out of PyDoc. I would like to be able to export these in Google Code's Wiki as an extension to the current docs up there now. | Python Wiki Style Doc Generator | 1.2 | 0 | 0 | 700 |
1,169,668 | 2009-07-23T04:52:00.000 | 0 | 0 | 0 | 0 | .net,ado.net,ironpython,connection-string | 1,169,704 | 2 | false | 1 | 0 | Data Source=xx.xx.xx.xx;Initial Catalog=;Integrated Security="SSPI"
How are you connecting to SQL. Do you use sql server authentication or windows authentication? Once you know that, then if you use a DNS name or IP that will go to the server correctly, you have the instance name correct AND you have permissions on t... | 2 | 0 | 0 | I have to get the data from a User site. If I would work on their site, I would VPN and then remote into their server using username and password.
I thought getting data into my local machine than getting into their server where my work is not secured.
So, I thought of using Ironpython to get data from the remote serve... | need help on ADO.net connection string | 0 | 1 | 0 | 1,035 |
1,169,668 | 2009-07-23T04:52:00.000 | 0 | 0 | 0 | 0 | .net,ado.net,ironpython,connection-string | 1,169,755 | 2 | false | 1 | 0 | Is that user granted login abilities in SQL?
If using SQL 2005, you go to Security->Logins
Double click the user, and click Status.
------Edit ----
Create a file on your desktop called TEST.UDL. Double click it.
setup your connection until it works.
View the UDL in notepad, there's your connection string. Though I t... | 2 | 0 | 0 | I have to get the data from a User site. If I would work on their site, I would VPN and then remote into their server using username and password.
I thought getting data into my local machine than getting into their server where my work is not secured.
So, I thought of using Ironpython to get data from the remote serve... | need help on ADO.net connection string | 0 | 1 | 0 | 1,035 |
1,170,744 | 2009-07-23T09:56:00.000 | 2 | 0 | 0 | 0 | python,http,logging,urllib2 | 1,844,608 | 2 | false | 0 | 0 | This looks pretty tricky to do. There are no hooks in urllib2, urllib, or httplib (which this builds on) for intercepting either input or output data.
The only thing that occurs to me, other than switching tactics to use an external tool (of which there are many, and most people use such things), would be to write a s... | 1 | 19 | 0 | I'm writing a web-app that uses several 3rd party web APIs, and I want to keep track of the low level request and responses for ad-hock analysis. So I'm looking for a recipe that will get Python's urllib2 to log all bytes transferred via HTTP. Maybe a sub-classed Handler? | How do I get urllib2 to log ALL transferred bytes | 0.197375 | 0 | 1 | 3,899 |
1,171,680 | 2009-07-23T13:22:00.000 | 2 | 0 | 0 | 0 | python,django,image-processing | 1,232,375 | 2 | false | 1 | 0 | I'm one of the sorl-thumbnail developers.
Firstly, you don't need to {% load thumbnail %} unless you're just using the thumbnail tag rather than a thumbnail field.
Currently, a thumbnail is only ever created the first time it is used - even if you use the field [I'll get around to changing that one day if no-one else d... | 2 | 6 | 0 | I have been playing around with sorl-thumbnail for Django. And trying to understand how it works better.
I've read the guide for it, installed it in my site-packages, made sure PIL is installed correctly, put sorl.thumbnail in the INSTALLED APPS in my settings.py, put from sorl.thumbnail.fields import ImageWithThumbna... | Trying to understand Django's sorl-thumbnail | 0.197375 | 0 | 0 | 2,437 |
1,171,680 | 2009-07-23T13:22:00.000 | 0 | 0 | 0 | 0 | python,django,image-processing | 2,178,420 | 2 | false | 1 | 0 | how about adding some jCrop in the admin to specify area of thumbnail ? Woul be pretty cool :) | 2 | 6 | 0 | I have been playing around with sorl-thumbnail for Django. And trying to understand how it works better.
I've read the guide for it, installed it in my site-packages, made sure PIL is installed correctly, put sorl.thumbnail in the INSTALLED APPS in my settings.py, put from sorl.thumbnail.fields import ImageWithThumbna... | Trying to understand Django's sorl-thumbnail | 0 | 0 | 0 | 2,437 |
1,173,025 | 2009-07-23T16:44:00.000 | 0 | 0 | 0 | 0 | python,licensing,mp3,gpl,id3 | 1,173,138 | 3 | false | 0 | 0 | You could use GStreamer (LGPL), but that might be a bit overkill if you only want the metadata and no playback. | 1 | 3 | 0 | I have found many GPL licensed libraries for reading information from mp3s in Python. Are there any non GPL libraries? | Is there a non-GPL Python Library for reading ID3 information from an mp3? | 0 | 0 | 0 | 367 |
1,173,767 | 2009-07-23T18:52:00.000 | 1 | 1 | 1 | 0 | python,unit-testing,networking,python-unittest | 1,174,498 | 4 | true | 0 | 0 | I would try to introduce a factory into your existing code that purports to create socket objects. Then in a test pass in a mock factory which creates mock sockets which just pretend they've connected to a server (or not for error cases, which you also want to test, don't you?) and log the message traffic to prove tha... | 1 | 2 | 0 | I am tasked with writing unit tests for a suite of networked software written in python. Writing units for message builders and other static methods is very simple, but I've hit a wall when it comes to writing a tests for network looped threads.
For example: The server it connects to could be on any port, and I want to... | using pyunit on a network thread | 1.2 | 0 | 0 | 655 |
1,177,230 | 2009-07-24T12:02:00.000 | 7 | 0 | 1 | 0 | python | 1,177,261 | 1 | false | 0 | 0 | Python's StringIO does not use OS file handles, so it won't be limited in the same way. StringIO will be limited by available virtual memory, but you've probably got heaps of available memory.
Normally the OS allows a single process to open thousands of files before running into the limit, so if your program is running... | 1 | 4 | 0 | HI i wrote a program by python , and when i open too many tempfile, i will got an exception: Too many open files ...
Then i figure out that windows OS or C runtime has the file-handle limits, so, i alter my program using StringIO(), but still don`t know whether StringIO also is limited?? | Python- about file-handle limits on OS | 1 | 0 | 0 | 1,277 |
1,177,513 | 2009-07-24T13:06:00.000 | 6 | 1 | 0 | 0 | python,import,module-search-path | 1,177,526 | 1 | true | 0 | 0 | So that everyone doesn't need to have exactly the same file structure on their hard drive? import C:\Python\lib\module\ probably wouldn't work too well on my Mac...
Edit: Also, what the heck are you talking about with the working directory? You can certainly use modules outside the working directory, as long as they'... | 1 | 2 | 0 | Is there an advantage? What is it? | Why is there module search path instead of typing the directory name + typing the file name? | 1.2 | 0 | 0 | 104 |
1,178,094 | 2009-07-24T14:33:00.000 | 0 | 0 | 1 | 1 | python,shared-libraries,environment-variables | 1,178,878 | 4 | false | 0 | 0 | In my experience trying to change the way the loader works for a running Python is very tricky; probably OS/version dependent; may not work. One work-around that might help in some circumstances is to launch a sub-process that changes the environment parameter using a shell script and then launch a new Python using th... | 1 | 26 | 0 | Is it possible to change environment variables of current process?
More specifically in a python script I want to change LD_LIBRARY_PATH so that on import of a module 'x' which depends on some xyz.so, xyz.so is taken from my given path in LD_LIBRARY_PATH
is there any other way to dynamically change path from where li... | Change current process environment's LD_LIBRARY_PATH | 0 | 0 | 0 | 27,232 |
1,180,590 | 2009-07-24T23:01:00.000 | 6 | 0 | 1 | 1 | python,windows,locale | 1,180,593 | 2 | true | 0 | 0 | Windows locale support doesn't rely on LANG variable (or, indeed, any other environmental variable). It is whatever the user set it to in Control Panel. | 1 | 4 | 0 | I'm making an application that supports multi language. And I am using gettext and locale to solve this issue.
How to set LANG variable in Windows? In Linux and Unix-like systems it's just as simple as
$ LANG=en_US python appname.py
And it will automatically set the locale to that particular language. But in Windows,... | How to set LANG variable in Windows? | 1.2 | 0 | 0 | 16,763 |
1,180,878 | 2009-07-25T01:11:00.000 | 7 | 0 | 0 | 0 | python,http,networking,sockets,urllib2 | 1,180,897 | 5 | false | 0 | 0 | Quick note, as I just learned this yesterday:
I think you've implied you know this already, but any responses to an HTTP request go to the IP address that shows up in the header. So if you are wanting to see those responses, you need to have control of the router and have it set up so that the spoofed IPs are all route... | 2 | 27 | 0 | This only needs to work on a single subnet and is not for malicious use.
I have a load testing tool written in Python that basically blasts HTTP requests at a URL. I need to run performance tests against an IP-based load balancer, so the requests must come from a range of IP's. Most commercial performance tools pro... | Spoofing the origination IP address of an HTTP request | 1 | 0 | 1 | 37,293 |
1,180,878 | 2009-07-25T01:11:00.000 | 1 | 0 | 0 | 0 | python,http,networking,sockets,urllib2 | 1,186,102 | 5 | false | 0 | 0 | I suggest seeing if you can configure your load balancer to make it's decision based on the X-Forwarded-For header, rather than the source IP of the packet containing the HTTP request. I know that most of the significant commercial load balancers have this capability.
If you can't do that, then I suggest that you prob... | 2 | 27 | 0 | This only needs to work on a single subnet and is not for malicious use.
I have a load testing tool written in Python that basically blasts HTTP requests at a URL. I need to run performance tests against an IP-based load balancer, so the requests must come from a range of IP's. Most commercial performance tools pro... | Spoofing the origination IP address of an HTTP request | 0.039979 | 0 | 1 | 37,293 |
1,181,027 | 2009-07-25T02:38:00.000 | 4 | 0 | 0 | 0 | python,tkinter,keylistener | 1,181,037 | 1 | true | 0 | 1 | I think you need to keep track of events about keys getting pressed and released (maintaining your own set of "currently pressed" keys) -- I believe Tk doesn't keep track of that for you (and Tkinter really adds little on top of Tk, it's mostly a direct interface to it). | 1 | 2 | 0 | Is there any way to detect which keys are currently pressed using Tkinter? I don't want to have to use extra libraries if possible. I can already detect when keys are pressed, but I want to be able to check at any time what keys are pressed down at the moment. | How can you check if a key is currently pressed using Tkinter in Python? | 1.2 | 0 | 0 | 2,295 |
1,181,462 | 2009-07-25T07:14:00.000 | 3 | 1 | 0 | 0 | c++,python | 1,181,468 | 7 | false | 0 | 1 | Here's two possibilities:
Perhaps the C++ code is already written & available for use.
It's likely the C++ code is faster/smaller than equivalent Python | 6 | 4 | 0 | I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python?
I'd appreciate a simple example - Boost::Python will do | Practical point of view: Why would I want to use Python with C++? | 0.085505 | 0 | 0 | 522 |
1,181,462 | 2009-07-25T07:14:00.000 | 2 | 1 | 0 | 0 | c++,python | 1,182,301 | 7 | false | 0 | 1 | Here's a real-life example: I've written a DLL in C to interface with some custom hardware for work. Then for the very first stage of testing, I was writing short programs in C to verify that the different commands were working properly. The process of write, compile, run took probably 3-5 times as long as when I fi... | 6 | 4 | 0 | I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python?
I'd appreciate a simple example - Boost::Python will do | Practical point of view: Why would I want to use Python with C++? | 0.057081 | 0 | 0 | 522 |
1,181,462 | 2009-07-25T07:14:00.000 | 0 | 1 | 0 | 0 | c++,python | 1,182,051 | 7 | false | 0 | 1 | One nice thing about using a scripting language is that you can reload new code into the application without quitting the app, then making changes, recompile, and then relaunching the app. When people talk about quicker development times, some of that refers to this capability.
A downside of using a scripting language... | 6 | 4 | 0 | I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python?
I'd appreciate a simple example - Boost::Python will do | Practical point of view: Why would I want to use Python with C++? | 0 | 0 | 0 | 522 |
1,181,462 | 2009-07-25T07:14:00.000 | 3 | 1 | 0 | 0 | c++,python | 1,181,481 | 7 | false | 0 | 1 | Because C++ provides a direct way of calling OS services, and (if used in a careful way) can produce code that is more efficient in memory and time, whereas Python is a high-level language, and is less painful to use in those situations where utter efficiency isn't a concern and where you already have libraries giving ... | 6 | 4 | 0 | I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python?
I'd appreciate a simple example - Boost::Python will do | Practical point of view: Why would I want to use Python with C++? | 0.085505 | 0 | 0 | 522 |
1,181,462 | 2009-07-25T07:14:00.000 | 5 | 1 | 0 | 0 | c++,python | 1,181,476 | 7 | false | 0 | 1 | Generally, you'd call C++ from python in order to use an existing library or other functionality. Often someone else has written a set of functions that make your life easier, and calling compiled C code is easier than re-writing the library in python.
The other reason is for performance purposes. Often, specific funct... | 6 | 4 | 0 | I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python?
I'd appreciate a simple example - Boost::Python will do | Practical point of view: Why would I want to use Python with C++? | 0.141893 | 0 | 0 | 522 |
1,181,462 | 2009-07-25T07:14:00.000 | 0 | 1 | 0 | 0 | c++,python | 1,181,567 | 7 | false | 0 | 1 | Performance :
From my limited experience, Python is about 10 times slower than using C.
Using Psyco will dramatically improve it, but still about 5 times slower than C.
BUT, calling c module from python is only a little faster than Psyco.
When you have some libraries in C.
For example, I am working heavily on SIP. I... | 6 | 4 | 0 | I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python?
I'd appreciate a simple example - Boost::Python will do | Practical point of view: Why would I want to use Python with C++? | 0 | 0 | 0 | 522 |
1,181,919 | 2009-07-25T11:32:00.000 | 6 | 0 | 1 | 0 | python | 55,882,807 | 9 | false | 0 | 0 | I benchmarked the example encoders provided in answers to this question. On my Ubuntu 18.10 laptop, Python 3.7, Jupyter, the %%timeit magic command, and the integer 4242424242424242 as the input, I got these results:
Wikipedia's sample code: 4.87 µs ± 300 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
@mi... | 1 | 49 | 0 | How can I encode an integer with base 36 in Python and then decode it again? | Python base 36 encoding | 1 | 0 | 0 | 41,800 |
1,182,587 | 2009-07-25T17:36:00.000 | 1 | 0 | 0 | 1 | python,background,pylons | 1,182,609 | 2 | false | 1 | 0 | I think this has little to do with pylons. I would do it (in whatever framework) in these steps:
generate some ID for the new job, and add a record in the database.
create a new process, e.g. through the subprocess module, and pass the ID on the command line (*).
have the process write its output to /tmp/project/ID
in... | 1 | 3 | 0 | I am trying to write an application that will allow a user to launch a fairly long-running process (5-30 seconds). It should then allow the user to check the output of the process as it is generated. The output will only be needed for the user's current session so nothing needs to be stored long-term. I have two questi... | How can I launch a background process in Pylons? | 0.099668 | 0 | 0 | 1,069 |
1,184,018 | 2009-07-26T08:06:00.000 | 1 | 1 | 1 | 0 | c++,python,artificial-intelligence,system,distributed | 1,184,303 | 7 | false | 0 | 0 | I need some kind of tool which observes the behaviour of a automation system (for instance a process control system), and is able to figure out on which inputs which actions follow, and then derives some kind of model from it which would then be usable as a simulation of the real system. It's not exactly distributed, b... | 3 | 0 | 0 | I require to do a project as a part of my final year of engineering graduation studies.Can you suggest some projects pertaining to distributed systems and artificial intelligence together and which require python,c or c++ for programming?
Note:-Please suggest a project that is attainable for a group of 2 students. | Graduation Project | 0.028564 | 0 | 0 | 1,483 |
1,184,018 | 2009-07-26T08:06:00.000 | 0 | 1 | 1 | 0 | c++,python,artificial-intelligence,system,distributed | 1,184,275 | 7 | false | 0 | 0 | How about hacking a P2P protocol and implementing something useful? I worked on a proxy cache implementation for P2P traffic. Basically, design and implement a proxy cache for P2P traffic. It will be different from web documents/objects in that:
1- P2P objects are immutable. You might request a web-page more than once,... | 3 | 0 | 0 | I require to do a project as a part of my final year of engineering graduation studies.Can you suggest some projects pertaining to distributed systems and artificial intelligence together and which require python,c or c++ for programming?
Note:-Please suggest a project that is attainable for a group of 2 students. | Graduation Project | 0 | 0 | 0 | 1,483 |
1,184,018 | 2009-07-26T08:06:00.000 | 1 | 1 | 1 | 0 | c++,python,artificial-intelligence,system,distributed | 1,184,030 | 7 | false | 0 | 0 | How about a decision process that uses mapreduce, and gets more efficient at choosing the answer each time? | 3 | 0 | 0 | I require to do a project as a part of my final year of engineering graduation studies.Can you suggest some projects pertaining to distributed systems and artificial intelligence together and which require python,c or c++ for programming?
Note:-Please suggest a project that is attainable for a group of 2 students. | Graduation Project | 0.028564 | 0 | 0 | 1,483 |
1,184,116 | 2009-07-26T09:23:00.000 | 0 | 1 | 1 | 0 | python,web-applications | 1,184,170 | 3 | false | 1 | 0 | Plain files are definitely more effective. Save your database for more complex queries.
If you need some formatting to be done on files, such as highlighting the code properly, it is better to do it before you save the file with that code. That way you don't need to apply formatting every time the file is shown.
You de... | 1 | 0 | 0 | I'm basically trying to setup my own private pastebin where I can save html files on my private server to test and fool around - have some sort of textarea for the initial input, save the file, and after saving I'd like to be able to view all the files I saved.
I'm trying to write this in python, just wondering what th... | Storing files for testbin/pastebin in Python | 0 | 0 | 0 | 578 |
1,185,634 | 2009-07-26T21:43:00.000 | 0 | 0 | 0 | 0 | python,algorithm | 9,515,347 | 9 | false | 0 | 0 | To work out the "worst" case, instead of using entropic I am looking to the partition that has the maximum number of elements, then select the try that is a minimum for this maximum => This will give me the minimum number of remaining possibility when I am not lucky (which happens in the worst case).
This always solve ... | 1 | 38 | 1 | How would you create an algorithm to solve the following puzzle, "Mastermind"?
Your opponent has chosen four different colours from a set of six (yellow, blue, green, red, orange, purple). You must guess which they have chosen, and in what order. After each guess, your opponent tells you how many (but not which) of the... | How to solve the "Mastermind" guessing game? | 0 | 0 | 0 | 37,167 |
1,185,817 | 2009-07-26T23:01:00.000 | 3 | 0 | 1 | 1 | python,macos | 1,185,893 | 4 | false | 0 | 0 | The file associations are done with the "Get Info". You select your .PY file, select the File menu; Get Info menu item.
Mid-way down the Get Info page is "Open With".
You can pick the Python Launcher. There's a Change All.. button that changes the association for all .py files. | 3 | 5 | 0 | Does anyone know how to associate the py extension with the python interpreter on Mac OS X 10.5.7? I have gotten as far as selecting the application with which to associate it (/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python), but the python executable appears as a non-selectable grayed-out item. An... | How to associate py extension with python launcher on Mac OS X? | 0.148885 | 0 | 0 | 14,435 |
1,185,817 | 2009-07-26T23:01:00.000 | 0 | 0 | 1 | 1 | python,macos | 28,869,258 | 4 | false | 0 | 0 | The default python installation (atleast on 10.6.8) includes the Python Launcher.app in /System/Library/Frameworks/Python.framework/Resources/, which is aliased to the latest/current version of Python installed on the system. This application launches terminal and sets the right environment to run the script. | 3 | 5 | 0 | Does anyone know how to associate the py extension with the python interpreter on Mac OS X 10.5.7? I have gotten as far as selecting the application with which to associate it (/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python), but the python executable appears as a non-selectable grayed-out item. An... | How to associate py extension with python launcher on Mac OS X? | 0 | 0 | 0 | 14,435 |
1,185,817 | 2009-07-26T23:01:00.000 | 6 | 0 | 1 | 1 | python,macos | 1,185,899 | 4 | false | 0 | 0 | The python.org OS X Python installers include an application called "Python Launcher.app" which does exactly what you want. It gets installed into /Applications /Python n.n/ for n.n > 2.6 or /Applications/MacPython n.n/ for 2.5 and earlier. In its preference panel, you can specify which Python executable to launch; i... | 3 | 5 | 0 | Does anyone know how to associate the py extension with the python interpreter on Mac OS X 10.5.7? I have gotten as far as selecting the application with which to associate it (/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python), but the python executable appears as a non-selectable grayed-out item. An... | How to associate py extension with python launcher on Mac OS X? | 1 | 0 | 0 | 14,435 |
1,185,855 | 2009-07-26T23:19:00.000 | 1 | 1 | 0 | 1 | python,ssh,parallel-processing | 1,185,871 | 6 | false | 0 | 0 | You can simply use subprocess.Popen for that purpose, without any problems.
However, you might want to simply install cronjobs on the remote machines. :-) | 4 | 3 | 0 | I wonder what is the best way to handle parallel SSH connections in python.
I need to open several SSH connections to keep in background and to feed commands in interactive or timed batch way.
Is this possible to do it with the paramiko libraries? It would be nice not to spawn a different SSH process for each connectio... | Parallel SSH in Python | 0.033321 | 0 | 1 | 7,048 |
1,185,855 | 2009-07-26T23:19:00.000 | 1 | 1 | 0 | 1 | python,ssh,parallel-processing | 1,185,880 | 6 | false | 0 | 0 | Reading the paramiko API docs, it looks like it is possible to open one ssh connection, and multiplex as many ssh tunnels on top of that as are wished. Common ssh clients (openssh) often do things like this automatically behind the scene if there is already a connection open. | 4 | 3 | 0 | I wonder what is the best way to handle parallel SSH connections in python.
I need to open several SSH connections to keep in background and to feed commands in interactive or timed batch way.
Is this possible to do it with the paramiko libraries? It would be nice not to spawn a different SSH process for each connectio... | Parallel SSH in Python | 0.033321 | 0 | 1 | 7,048 |
1,185,855 | 2009-07-26T23:19:00.000 | 3 | 1 | 0 | 1 | python,ssh,parallel-processing | 1,188,586 | 6 | false | 0 | 0 | Yes, you can do this with paramiko.
If you're connecting to one server, you can run multiple channels through a single connection. If you're connecting to multiple servers, you can start multiple connections in separate threads. No need to manage multiple processes, although you could substitute the multiprocessing mod... | 4 | 3 | 0 | I wonder what is the best way to handle parallel SSH connections in python.
I need to open several SSH connections to keep in background and to feed commands in interactive or timed batch way.
Is this possible to do it with the paramiko libraries? It would be nice not to spawn a different SSH process for each connectio... | Parallel SSH in Python | 0.099668 | 0 | 1 | 7,048 |
1,185,855 | 2009-07-26T23:19:00.000 | -1 | 1 | 0 | 1 | python,ssh,parallel-processing | 1,516,547 | 6 | false | 0 | 0 | This might not be relevant to your question. But there are tools like pssh, clusterssh etc. that can parallely spawn connections. You can couple Expect with pssh to control them too. | 4 | 3 | 0 | I wonder what is the best way to handle parallel SSH connections in python.
I need to open several SSH connections to keep in background and to feed commands in interactive or timed batch way.
Is this possible to do it with the paramiko libraries? It would be nice not to spawn a different SSH process for each connectio... | Parallel SSH in Python | -0.033321 | 0 | 1 | 7,048 |
1,185,867 | 2009-07-26T23:24:00.000 | 0 | 1 | 0 | 0 | php,python,mercurial,cgi | 1,185,909 | 3 | false | 0 | 0 | As far as you question, no, you're not likely to get php to execute a modified script without writing it somewhere, whether that's a file on the disk, a virtual file mapped to ram, or something similar.
It sounds like you might be trying to pound a railroad spike with a twig. If you're to the point where you're filteri... | 1 | 0 | 0 | I'm trying to make a web app that will manage my Mercurial repositories for me.
I want it so that when I tell it to load repository X:
Connect to a MySQL server and make sure X exists.
Check if the user is allowed to access the repository.
If above is true, get the location of X from a mysql server.
Run a hgweb cgi sc... | How can I execute CGI files from PHP? | 0 | 1 | 0 | 940 |
1,185,878 | 2009-07-26T23:30:00.000 | 3 | 1 | 1 | 0 | c++,python,c,python-c-api,python-c-extension | 1,185,954 | 4 | false | 0 | 1 | The boost folks have a nice automated way to do the wrapping of C++ code for use by python.
It is called: Boost.Python
It deals with some of the constructs of C++ better than SWIG, particularly template metaprogramming. | 2 | 6 | 0 | The Python manual says that you can create modules for Python in both C and C++. Can you take advantage of things like classes and templates when using C++? Wouldn't it create incompatibilities with the rest of the libraries and with the interpreter? | Can I use C++ features while extending Python? | 0.148885 | 0 | 0 | 567 |
1,185,878 | 2009-07-26T23:30:00.000 | 9 | 1 | 1 | 0 | c++,python,c,python-c-api,python-c-extension | 1,185,907 | 4 | true | 0 | 1 | It doesn't matter whether your implementation of the hook functions is implemented in C or in C++. In fact, I've already seen some Python extensions which make active use of C++ templates and even the Boost library. No problem. :-) | 2 | 6 | 0 | The Python manual says that you can create modules for Python in both C and C++. Can you take advantage of things like classes and templates when using C++? Wouldn't it create incompatibilities with the rest of the libraries and with the interpreter? | Can I use C++ features while extending Python? | 1.2 | 0 | 0 | 567 |
1,185,959 | 2009-07-27T00:25:00.000 | 6 | 1 | 1 | 0 | python,linux,stream,rar | 1,186,041 | 7 | true | 0 | 0 | The real answer is that there isn't a library, and you can't make one. You can use rarfile, or you can use 7zip unRAR (which is less free than 7zip, but still free as in beer), but both approaches require an external executable. The license for RAR basically requires this, as while you can get source code for unRAR, ... | 2 | 7 | 0 | I'm looking for a way to read specific files from a rar archive into memory. Specifically they are a collection of numbered image files (I'm writing a comic reader). While I can simply unrar these files and load them as needed (deleting them when done), I'd prefer to avoid that if possible.
That all said, I'd prefer ... | Read content of RAR file into memory in Python | 1.2 | 0 | 0 | 8,947 |
1,185,959 | 2009-07-27T00:25:00.000 | 2 | 1 | 1 | 0 | python,linux,stream,rar | 4,436,131 | 7 | false | 0 | 0 | It seems like the limitation that rarsoft imposes on derivative works is that you may not use the unrar source code to create a variation of the RAR COMPRESSION algorithm. From the context, it would appear that it's specifically allowing folks to use his code (modified or not) to decompress files, but you cannot use t... | 2 | 7 | 0 | I'm looking for a way to read specific files from a rar archive into memory. Specifically they are a collection of numbered image files (I'm writing a comic reader). While I can simply unrar these files and load them as needed (deleting them when done), I'd prefer to avoid that if possible.
That all said, I'd prefer ... | Read content of RAR file into memory in Python | 0.057081 | 0 | 0 | 8,947 |
1,186,155 | 2009-07-27T02:16:00.000 | 0 | 0 | 0 | 1 | java,python,google-app-engine,gwt | 1,391,971 | 4 | false | 1 | 0 | I agree with your evaluation of Python's text processing and GWT's quality. Have you considered using Jython? Googling "pyparsing jython" gives some mixed reviews, but it seems there has been some success with recent versions of Jython. | 1 | 3 | 0 | I realize this is a dated question since appengine now comes in java, but I have a python appengine app that I want to access via GWT. Python is just better for server-side text processing (using pyparsing of course!). I have tried to interpret GWT's client-side RPC and that is convoluted since there is no python cou... | Appengine and GWT - feeding the python some java | 0 | 0 | 0 | 3,162 |
1,186,839 | 2009-07-27T07:11:00.000 | 1 | 1 | 0 | 0 | php,python,xml,rest,soap | 1,186,876 | 3 | false | 0 | 0 | I like the examples in the Richardson & Ruby book, "RESTful Web Services" from O'Reilly. | 1 | 0 | 0 | I've only used XML RPC and I haven't really delved into SOAP but I'm trying to find a good comprehensive guide, with real world examples or even a walkthrough of some minimal REST application.
I'm most comfortable with Python/PHP. | Real world guide on using and/or setting up REST web services? | 0.066568 | 0 | 1 | 499 |
1,187,653 | 2009-07-27T11:29:00.000 | 0 | 0 | 1 | 0 | python,irc | 1,187,671 | 3 | false | 0 | 0 | The easiest way is to catch errors, and close the old and open a new instance of the program when you do catch em.
Note that it will not always work (in cases it stops working without throwing an error). | 1 | 1 | 0 | I'm writing an IRC bot in Python, due to the alpha nature of it, it will likely get unexpected errors and exit.
What's the techniques that I can use to make the program run again? | How to make the program run again after unexpected exit in Python? | 0 | 0 | 0 | 1,280 |
1,187,970 | 2009-07-27T12:44:00.000 | 9 | 0 | 1 | 0 | python,exit,traceback | 1,187,976 | 10 | false | 0 | 0 | something like import sys; sys.exit(0) ? | 2 | 300 | 0 | I would like to know how to I exit from Python without having an traceback dump on the output.
I still want want to be able to return an error code but I do not want to display the traceback log.
I want to be able to exit using exit(number) without trace but in case of an Exception (not an exit) I want the trace. | How to exit from Python without traceback? | 1 | 0 | 0 | 641,675 |
1,187,970 | 2009-07-27T12:44:00.000 | 3 | 0 | 1 | 0 | python,exit,traceback | 41,650,459 | 10 | false | 0 | 0 | Use the built-in python function quit() and that's it.
No need to import any library.
I'm using python 3.4 | 2 | 300 | 0 | I would like to know how to I exit from Python without having an traceback dump on the output.
I still want want to be able to return an error code but I do not want to display the traceback log.
I want to be able to exit using exit(number) without trace but in case of an Exception (not an exit) I want the trace. | How to exit from Python without traceback? | 0.059928 | 0 | 0 | 641,675 |
1,188,585 | 2009-07-27T14:45:00.000 | 1 | 0 | 0 | 0 | python,database,data-structures,persistence | 1,188,711 | 7 | false | 0 | 0 | The potential advantages of a custom format over a pickle are:
you can selectively get individual objects, rather than having to incarnate the full set of objects
you can query subsets of objects by properties, and only load those objects that match your criteria
Whether these advantages materialize depends on how yo... | 4 | 5 | 0 | I'm considering the idea of creating a persistent storage like a dbms engine, what would be the benefits to create a custom binary format over directly cPickling the object and/or using the shelve module? | What are the benefits of not using cPickle to create a persistent storage for data? | 0.028564 | 1 | 0 | 1,116 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.