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
12,635,762
2012-09-28T07:45:00.000
1
0
1
0
python,multithreading,gil
12,636,228
3
false
0
1
The Python interpreter is not aware of C launched threads in any way, so they can happily churn their own CPU time. However I doubt this is a correct solution for your performance problems. First try using multiple processes with multiprocess module. If interprocess IO is too much after that you can result trickery lik...
3
7
0
I have heard of Python's GIL problem, which states that there can only be one Python thread executing the Python bytecode at one time in a multicore machine. So a multithreaded Python program is not a good idea. I am wondering if I can write a C extension that uses pthread to potentially boost the performance of my pro...
Could a C extension for multithreaded Python boost performance?
0.066568
0
0
1,191
12,635,762
2012-09-28T07:45:00.000
2
0
1
0
python,multithreading,gil
12,636,279
3
true
0
1
To answer your original question: Yes, C extensions can be immune from the GIL, provided they do not call any Python API functions without the GIL held. So, if you need to communicate with the Python app, you'd need to acquire the GIL to do so. If you don't want to get your hands too dirty with the C API, you can use c...
3
7
0
I have heard of Python's GIL problem, which states that there can only be one Python thread executing the Python bytecode at one time in a multicore machine. So a multithreaded Python program is not a good idea. I am wondering if I can write a C extension that uses pthread to potentially boost the performance of my pro...
Could a C extension for multithreaded Python boost performance?
1.2
0
0
1,191
12,635,762
2012-09-28T07:45:00.000
0
0
1
0
python,multithreading,gil
12,636,431
3
false
0
1
Provided one thread runs CPU bound while the other runs IO bound, I don't see a problem. The IO bound thread will call IO routines which usually release the GIL while doing their stuff, effectively allowing the other thread to run. So give the "simple" solution a try and switch only if it really doesn't work the way yo...
3
7
0
I have heard of Python's GIL problem, which states that there can only be one Python thread executing the Python bytecode at one time in a multicore machine. So a multithreaded Python program is not a good idea. I am wondering if I can write a C extension that uses pthread to potentially boost the performance of my pro...
Could a C extension for multithreaded Python boost performance?
0
0
0
1,191
12,636,812
2012-09-28T09:00:00.000
0
0
0
0
python,django,dynatree
12,659,689
3
false
1
0
There is a difference between 'selected' and 'active'. Selection is typically done using checkboxes, while only one node can be activated (typically by a mouse click). A 2nd click on an active node will not fire an 'onActivate' event, but you can implement the 'onClick' handler to catch this and call node.deactivate()
3
1
0
I'm currently working on a django project and i'm using dynatree to build treeview. I have two trees, first tree has items that user can select and the selected items will be moved to second tree. Is there a way that I can do so in dynatree?And there's an option for user to "unselect" the item so the selected item wil...
Moving nodes from one tree to another with Dynatree
0
0
0
908
12,636,812
2012-09-28T09:00:00.000
1
0
0
0
python,django,dynatree
19,162,943
3
false
1
0
I have a dynamTree on a DIV dvAllLetterTemplates (which contains a master List) and a DIV dvUserLetterTemplates to which items are to be copied. //Select the Parent Node of the Destination Tree var catNode = $("#dvUserLetterTemplates").dynatree("getTree").selectKey(catKey, false); if (catNode != null) { //Select the s...
3
1
0
I'm currently working on a django project and i'm using dynatree to build treeview. I have two trees, first tree has items that user can select and the selected items will be moved to second tree. Is there a way that I can do so in dynatree?And there's an option for user to "unselect" the item so the selected item wil...
Moving nodes from one tree to another with Dynatree
0.066568
0
0
908
12,636,812
2012-09-28T09:00:00.000
2
0
0
0
python,django,dynatree
15,516,606
3
true
1
0
I've solved my problem using the copy/paste concept of context menu. And for the second problem, I used global variable to store the original parent node so when user unselect the item, it will move back to its original parent.
3
1
0
I'm currently working on a django project and i'm using dynatree to build treeview. I have two trees, first tree has items that user can select and the selected items will be moved to second tree. Is there a way that I can do so in dynatree?And there's an option for user to "unselect" the item so the selected item wil...
Moving nodes from one tree to another with Dynatree
1.2
0
0
908
12,637,248
2012-09-28T09:26:00.000
1
0
1
0
python,indentation
12,637,266
2
false
0
0
Notepad++ (Windows), Sublime Text, vim (Unix/Linux) etc. There are a lot of them
2
0
0
Another identation-question but i didn't find this particular one anywhere so here goes. Is there some simple way, or some good editor, that lets me use tab to create a 4*whitespace identation instead of the hardtab jump? I really want to be able to use tab while coding, but i want it to conform to the 4 whitespace st...
Python indentation; Tab = 4*whitespace?
0.099668
0
0
104
12,637,248
2012-09-28T09:26:00.000
1
0
1
0
python,indentation
12,637,281
2
true
0
0
You are looking for a feature called "soft tabs", many editors offer it. Go for google ;)
2
0
0
Another identation-question but i didn't find this particular one anywhere so here goes. Is there some simple way, or some good editor, that lets me use tab to create a 4*whitespace identation instead of the hardtab jump? I really want to be able to use tab while coding, but i want it to conform to the 4 whitespace st...
Python indentation; Tab = 4*whitespace?
1.2
0
0
104
12,639,930
2012-09-28T12:21:00.000
0
1
0
1
python,cgi,iis-7.5
21,917,122
1
false
0
0
I've solved the _urandom() error by changing IIS 7.5 settings to Impersonate User = yes. I'm not a Windows admin so I cannot elaborate. Afterwards import cgi inside python script worked just fine.
1
5
0
I’m having a very strange issue with running a python CGI script in IIS. The script is running in a custom application pool which uses a user account from the domain for identity. Impersonation is disabled for the site and Kerberos is used for authentication. When the account is member of the “Domain Admins” group, ev...
Python CGI in IIS: issue with urandom function
0
0
0
928
12,640,409
2012-09-28T12:52:00.000
1
0
0
1
python,google-app-engine,google-docs-api,blobstore,google-cloud-storage
12,648,928
3
false
1
0
If you're already using the Files API to read and write the files, I'd recommend you use Google Cloud Storage rather than the Blobstore. GCS offers a richer RESTful API (makes it easier to do things like access control), does a number of things to accelerate serving static data, etc.
2
2
0
I have a Google App Engine app where I need to store text files that are larger than 1 MB (the maximum entity size. I'm currently storing them in the Blobstore and I make use of the Files API for reading and writing them. Current operations including uploading them from a user, reading them to process and update, an...
Storing text files > 1MB in GAE/P
0.066568
0
0
223
12,640,409
2012-09-28T12:52:00.000
0
0
0
1
python,google-app-engine,google-docs-api,blobstore,google-cloud-storage
12,641,339
3
false
1
0
Sharing data is more easy in Google Docs (now Google Drive) and Google Cloud Storage. Using Google drive u can also use the power of Google Apps scripts.
2
2
0
I have a Google App Engine app where I need to store text files that are larger than 1 MB (the maximum entity size. I'm currently storing them in the Blobstore and I make use of the Files API for reading and writing them. Current operations including uploading them from a user, reading them to process and update, an...
Storing text files > 1MB in GAE/P
0
0
0
223
12,640,557
2012-09-28T13:01:00.000
2
0
1
0
python,windows,distutils
12,640,847
3
true
0
0
If you are using pip, you can do pip install package --upgrade, but you'll see that essentially it's the same as uninstall followed by a fresh install.
2
4
0
I'm running Python on Windows and usually install packages using pre-built binaries. When I upgrade packages (ex. from matplotlib-1.0.0 to matplotlib-1.1.1) do I need to uninstall the earlier version first? I did a test upgrading matplotlib without uninstalling the previous version and everything seems to be okay. ma...
Do I need to uninstall Python package before upgrading to newer version?
1.2
0
0
1,640
12,640,557
2012-09-28T13:01:00.000
-1
0
1
0
python,windows,distutils
24,775,650
3
false
0
0
Yes, you need a clean install. I've shot my leg when upgrading from matplotlib 1.2.1 to 1.3.1 w/o removing first the old package.
2
4
0
I'm running Python on Windows and usually install packages using pre-built binaries. When I upgrade packages (ex. from matplotlib-1.0.0 to matplotlib-1.1.1) do I need to uninstall the earlier version first? I did a test upgrading matplotlib without uninstalling the previous version and everything seems to be okay. ma...
Do I need to uninstall Python package before upgrading to newer version?
-0.066568
0
0
1,640
12,642,624
2012-09-28T15:07:00.000
2
0
1
0
python
12,642,663
4
false
0
0
Globals are not really taboo, it's just you have to remember to declare them as global in your function before you use them. In my opinion this actually makes them more clear because the user sees that you are explicitly using a global. I would be more afraid of the non-pythonistas not understanding python globals, mod...
2
9
0
Stack Overflow has a lot of questions regarding global variables in python, and it seems to generate some amount of confusion for people coming from other languages. Scoping rules don't exactly work the way a lot of people from other backgrounds expect them to. At the same time, code is meant to be organized not so mu...
Frequency of global variables in python?
0.099668
0
0
1,129
12,642,624
2012-09-28T15:07:00.000
3
0
1
0
python
12,642,790
4
false
0
0
In short, yes, you should be avoiding using the global keyword. It might be in the language for a reason but I generally consider it to be a code smell -- if you have some state you want to keep up, encapsulate it in a class. That's far less fragile than using global.
2
9
0
Stack Overflow has a lot of questions regarding global variables in python, and it seems to generate some amount of confusion for people coming from other languages. Scoping rules don't exactly work the way a lot of people from other backgrounds expect them to. At the same time, code is meant to be organized not so mu...
Frequency of global variables in python?
0.148885
0
0
1,129
12,643,662
2012-09-28T16:15:00.000
2
0
0
0
python,neo4j,py2neo
31,026,259
5
false
0
0
Well, I myself had need for massive performance from neo4j. I end up doing following things to improve graph performance. Ditched py2neo, since there were lot of issues with it. Besides it is very convenient to use REST endpoint provided by neo4j, just make sure to use request sessions. Use raw cypher queries for bulk...
1
18
0
I am finding Neo4j slow to add nodes and relationships/arcs/edges when using the REST API via py2neo for Python. I understand that this is due to each REST API call executing as a single self-contained transaction. Specifically, adding a few hundred pairs of nodes with relationships between them takes a number of secon...
Fastest way to perform bulk add/insert in Neo4j with Python?
0.07983
1
1
12,651
12,646,305
2012-09-28T19:38:00.000
0
0
0
0
python,csv,import,postgresql-9.1
12,646,923
3
false
0
0
Nice chunk of data you have there. I'm not 100% sure about Postgre, but at least MySQL provides some SQL commands, to feed a csv directly into a table. This bypasses any insert checks and so on and is thatswhy more than a order of magnitude faster than any ordinary insert operations. So the probably fastest way to go i...
1
9
0
I see plenty of examples of importing a CSV into a PostgreSQL db, but what I need is an efficient way to import 500,000 CSV's into a single PostgreSQL db. Each CSV is a bit over 500KB (so grand total of approx 272GB of data). The CSV's are identically formatted and there are no duplicate records (the data was generated...
Efficient way to import a lot of csv files into PostgreSQL db
0
1
0
10,104
12,652,336
2012-09-29T11:32:00.000
3
0
0
1
python,tornado,vert.x,sockjs
13,562,205
2
false
0
0
Vertx has build-in clustering support. I haven't tried it with many nodes, but it seemed to work well with a few. Internally it uses hazelcast to organise the nodes. Vertx also runs on a JVM, which has already many monitoring/admin tools which might be useful. So Vertx seems to me like the "batteries included" solution...
1
2
0
I've been inspecting two similar solutions for supporting web sockets via sockJS using an independent Python server, and so far I found two solutions. I need to write a complex, scalable web socket based web application, and I'm afraid it will be hard to scale Tornado, and it seems Vertx is better with horizontal scali...
Vertx SockJS server vs sockjs-tornado
0.291313
0
1
1,306
12,652,475
2012-09-29T11:52:00.000
0
1
1
0
python-2.7,runtime
12,654,018
1
false
0
0
The import statement is like any other executable statement, and can be executed at any point during execution.
1
0
0
What is the best way to load a python module/file after the whole python program is up and running. My current idea is to save the new python file to disk and call import on it. I am working with python 2.7. Each new python file will have pre-known functions, that will be called by the already running application.
loading python after the application is up and running
0
0
0
23
12,653,026
2012-09-29T13:20:00.000
-2
1
0
0
python,embedded
12,653,117
2
false
0
0
OOP is generally not suitable for embedded development. This is because embedded hardware is limited on memory and OOP is unpredictable with memory usage. It is possible, but you are forced into static objects an methods to have any kind of reliability.
2
0
0
Hi all~ I just be interested in embedded development, and as known to all, C is the most popular programming language in embedded development. But I prefer to use Python, does Python be adapted to do any tasks about embedded development or automatic control? And are there some books about this be worth recommended? Tha...
Python on automatic control and embedded development
-0.197375
0
0
664
12,653,026
2012-09-29T13:20:00.000
5
1
0
0
python,embedded
12,654,265
2
false
0
0
The reason C (and C++) are prevalent in embedded systems is that they are systems-level languages with minimal run-time environment requirements and can run stand-alone (bare metal), with an simple RTOS kernel, or within a complete OS environment. Both are also almost ubiquitous being available for most 8, 16, 32 and ...
2
0
0
Hi all~ I just be interested in embedded development, and as known to all, C is the most popular programming language in embedded development. But I prefer to use Python, does Python be adapted to do any tasks about embedded development or automatic control? And are there some books about this be worth recommended? Tha...
Python on automatic control and embedded development
0.462117
0
0
664
12,654,391
2012-09-29T16:30:00.000
3
0
1
0
python,binary
12,654,491
3
true
0
0
You didn't specify how your float columns are represented in Python. The cPickle module is a fast general solution, with the drawback that it creates files readable only from Python, and that it should never be allowed to read untrusted data (received from the network). It is likely to just work with all regular dataty...
1
1
0
I am working with information from big models, which means I have a lot of big ascii files with two float columns (lets say X and Y). However, whenever I have to read these files it takes a long time, so I thought maybe converthing them to binary files will make the reading process much faster. I converted my asciifile...
how to read a binary file into variables in python
1.2
0
0
1,455
12,654,772
2012-09-29T17:22:00.000
61
0
0
1
python
31,773,158
2
false
0
0
Of course there IS a way to create files without opening. It's as easy as calling os.mknod("newfile.txt"). The only drawback is that this call requires root privileges on OSX.
1
311
0
I'd like to create a file with path x using python. I've been using os.system(y) where y = 'touch %s' % (x). I've looked for a non-directory version of os.mkdir, but I haven't been able to find anything. Is there a tool like this to create a file without opening it, or using system or popen/subprocess?
Create empty file using python
1
0
0
452,830
12,656,098
2012-09-29T20:11:00.000
5
1
0
0
c++,python,performance,cpu-speed
12,656,127
2
true
0
0
With that many connections, your server will be I/O bound. The frequently cited speed differences between languages like C and C++ and languages like Python and (say) Ruby lie in the interpreter and boxing overhead which slow down computation, not in the realm of I/O. Not only can use make good and reasonably use of co...
2
3
0
I've to develop a server that has to make a lot of connections to receive and send small files. The question is if the increment of performance with C++ worth the time to spend on develop the code or if is better to use Python and debug the code time to time to speed it up. Maybe is a little abstract question without g...
C++ vs Python server side performance
1.2
0
0
3,596
12,656,098
2012-09-29T20:11:00.000
2
1
0
0
c++,python,performance,cpu-speed
12,656,117
2
false
0
0
I'd expect that the server time would be dominated by I/O- network, disk, etc. You'd want to prove that the CPU consumption of the Python program is problematic and that you've grasped all the low-hanging CPU fruit before considering a change.
2
3
0
I've to develop a server that has to make a lot of connections to receive and send small files. The question is if the increment of performance with C++ worth the time to spend on develop the code or if is better to use Python and debug the code time to time to speed it up. Maybe is a little abstract question without g...
C++ vs Python server side performance
0.197375
0
0
3,596
12,658,427
2012-09-30T03:39:00.000
3
0
0
0
python,django,installation
12,659,723
5
false
1
0
I am not familiar with GoDaddy's setup specifically, but in general, you cannot install Django on shared hosting unless it is supported specifically (a la Dreamhost). So unless GoDaddy specifically mentions Django (or possibly mod_wsgi or something) in their documentation, which is unlikely, you can assume it is not s...
1
32
0
I have never deployed a Django site before. I am currently looking to set it up in my deluxe GoDaddy account. Does anyone have any documentation on how to go about installing python and django on GoDaddy?
Installing a django site on GoDaddy
0.119427
0
0
61,875
12,659,719
2012-09-30T08:08:00.000
4
0
0
0
python,windows,winapi,python-2.7,pywin32
12,659,846
1
true
0
1
When someone presses the Ctrl+C key in Explorer, Explorer calls OleSetClipboard() with an IDataObject containing various formats, which may include CF_FILES, CFSTR_FILECONTENTS and CFSTR_SHELLIDLIST.
1
1
0
I am designing a Copy/Paste Application for Windows os using Python.Now I want to a Register my application with hotkey for "Ctrl+V" So that when any one press "Ctrl+V" Paste is done through my application and not through windows default Copy/Paste application.But I don't know how to get the list of files path which ar...
Windows:What actually happens when Ctrl+C is pressed in windows explorer
1.2
0
0
339
12,660,516
2012-09-30T10:24:00.000
2
0
0
0
pyramid,pickle,python-3.2
12,673,353
1
true
1
0
Pyramid's debug toolbar keeps objects alive. Deactivating it fixes most memory leak problems. The leak that was the cause of my searching for errors in Pyramid doesn't seem to be a problem with Pyramid at all
1
3
0
I've got a Pyramid view that's misbehaving in an interesting way. What the view does is grab a pretty complex object hierarchy from a file (using pickle), does a little processing, then renders an html form. Nice and simple. Setup: I'm running Ubuntu 12.04 64bit, Python3.2, Pyramid 1.3.3, SQLAlchemy 0.7.8 and using the...
Pyramid app not releasing memory between views
1.2
0
0
223
12,663,774
2012-09-30T18:20:00.000
0
1
0
1
python,centos
12,663,789
3
false
0
0
Add #!/usr/bin/env python at the head of your script file. It tell your system to search for the python interpreter and execute your script with it.
1
0
0
python blabla.py will execute. But ./blabla.py gives me an error of "no such file or directory" on CentOS6.3. /usr/bin/env python does open up python properly. I am new to linux and really would like to get this working. Could someone help? Thanks in advance! Note: thanks to all the fast replies! I did have the #!/usr...
/usr/bin/env python opens up python, but ./blabla.py does not execute
0
0
0
2,334
12,664,713
2012-09-30T20:11:00.000
0
0
0
0
python,django,heroku,celery
12,664,898
1
false
1
0
Based on you use case description you do not need a Scheduler, so APScheduler will not match your requirements well. Do you have a web dyno besides your worker dyno? The usual design pattern for this type of processing is to set up a control thread or control process (your web dyno) that accepts requests. These request...
1
0
0
I am working on a project, to be deployed on Heroku in Django, which has around 12 update functions. They take around 15 minutes to run each. Let's call them update1(), update2()...update10(). I am deploying with one worker dyno on Heroku, and I would like to run up to n or more of these at once (They are not really co...
Scheduling update functions in Django and Heroku?
0
0
0
164
12,666,278
2012-10-01T00:22:00.000
8
0
0
0
python,user-interface,wxpython,pyqt,tkinter
12,667,986
3
true
0
1
If you're running Ubuntu, PyQt will be installed by default. Most linux distros will have one of PyGtk or PyQt installed by default. WxPython was most likely installed in your Ubuntu box as a dependency for some other package in your system. If your target market is Linux, you can just create a deb or rpm package and...
2
8
0
My question is about the easiness of distributing the GUI app across the platforms (Mac/Linux/Windows), and I want to know the one that makes the user's job easiest. My current understanding is that Tkinter app is the easiest for the users (to install) because as long as the user has installed a Python in her box, my a...
Python GUI App Distribution: written in wxPython, TKinter or QT
1.2
0
0
4,379
12,666,278
2012-10-01T00:22:00.000
4
0
0
0
python,user-interface,wxpython,pyqt,tkinter
12,666,368
3
false
0
1
Tkinter is the only one that's included with Python. wxPython and pyQT need both the wxWindows or QT libraries and the wxPython or pyQT libraries to be installed on the system. However, Tk does not look very nice. If you're already making the user install Python, you could just as well have them install the libraries t...
2
8
0
My question is about the easiness of distributing the GUI app across the platforms (Mac/Linux/Windows), and I want to know the one that makes the user's job easiest. My current understanding is that Tkinter app is the easiest for the users (to install) because as long as the user has installed a Python in her box, my a...
Python GUI App Distribution: written in wxPython, TKinter or QT
0.26052
0
0
4,379
12,666,421
2012-10-01T00:55:00.000
7
0
1
0
python
12,666,425
2
false
0
0
Why not [mystring]? It uses the list literal to create a list with just the value of mystring inside.
1
3
0
Let's say I have a string like 'banana' and I'd to convert it into a list ['banana'], in python. I tried ''.join(list('banana')) and other tricks, and I'm still back to square one! Thanks
convert string object to list object in python
1
0
0
6,460
12,668,710
2012-10-01T06:54:00.000
5
0
0
0
python,plone
12,671,365
1
true
1
0
In the example above, sample.pdf is presumably a File created in Plone. In this case, the URL without /view will render the file for download, and the URL with /view will render a Plone page with a link to download it. This is standard behaviour. It isn't really possible to stop people from downloading the PDF. You can...
1
0
0
After using atreal.richfile.preview in plone, we get the preview of a pdf file with the url like : http://localhost:8090/plone/sample.pdf/view. If we delete part of the url i.e "/view", and enter the url: http://localhost:8090/plone/sample.pdf in the browser, it still can be viewed and the pdf becomes printable or can ...
How to modify the url in plone so that we don't get the same page if it is modified?
1.2
0
0
298
12,669,115
2012-10-01T07:33:00.000
1
0
0
0
python,django,web-services,web-applications,flask
12,674,458
1
false
1
0
I tend to use Django for "big" projects and Flask for projects requiring less than a ~300 lines file. The challenges in moving to Flask are in my sense to go look for the extensions for forms, mails, databases... When you need them, and referring to different documentations. But it is naturally the price of flexibility...
1
0
0
Question is for programmers who have used Django and Flask for real projects. What challenges do you face going to the Flask? Interested in the situation when there may be unexpected difficulties (after using django). Specific examples are welcome.
What are the non-obvious problems you encounter, moving from Django to Flask?
0.197375
0
0
170
12,669,938
2012-10-01T08:39:00.000
0
0
1
1
python,cx-freeze
36,247,376
1
false
0
0
I think if you don't have a certificate that's impossible.
1
9
0
I wrote lets scripts for customer. In order not to install python and dependent packages, I packed all to 3 exe-file using cx-freeze. First - winservice, who does most of the work. Second - settings wizard. Third - client for work with winservice. Faced to the task, need after installing the package (made using bdist_...
cx_Freeze. How install service and execute script after install
0
0
0
690
12,670,874
2012-10-01T09:45:00.000
9
0
0
0
python,pyqt,double-click,qtreeview,qfilesystemmodel
15,352,784
2
false
0
1
I don't know if you have this in python versions, but in C++ Qt you just set the edit triggers in the QAbstractItemView: void setEditTriggers ( EditTriggers triggers )
1
4
0
Simple question. I'd like to use F2 or Enter for rename, and double click to open a file. Using self.treeView.doubleClicked.connect(self.doubleclick) I can do things in my self.doubleClick method, but the renaming is still triggered. The model is not read-only (model.setReadOnly(False)).
How to disable the double click file renaming behavior on QTreeView and QFileSystemModel in PyQt?
1
0
0
3,516
12,673,450
2012-10-01T12:39:00.000
2
0
0
0
python,win32com
12,674,538
1
false
0
0
So here is the simple solution. I checked the defaults params for the trigger and than I saw, that Flags is set to 4, which means DISABLED. It seems, that's the default setting for a new trigger for a task.
1
0
0
here is my problem. When I create a new scheduled task using win32com in python there is no next run time for the task. It says 'never' in task scheduler gui. My workflow of creating tasks: try to make new task, if failed, get existing one for update, create daily triggers for the task, save it all. Any advice?
Scheduled task - no next run time
0.379949
0
0
265
12,675,471
2012-10-01T14:41:00.000
2
1
0
0
python,pdf,encoding
13,703,110
2
true
0
0
Yes. This will happen when custom font encodings have been used e.g. identity-H,identity-V, etc. but fonts have not been embedded properly. pdfminer gives garbage output in such cases because encoding is required to interpret the text
1
2
0
I am using python2.7 and PDFminer for extracting text from pdf. I noticed that sometimes PDFminer gives me words with strange letters, but pdf viewers don't. Also for some pdf docs result returned by PDFminer and other pdf viewers are same (strange), but there are docs where pdf viewers can recognize text (copy-paste)....
PDFminer gives strange letters
1.2
0
0
1,267
12,676,194
2012-10-01T15:21:00.000
1
1
0
0
python,file,byte,python-2.2
12,677,772
1
false
0
0
Your best option is to manipulate the file directly; this will work regarding of Python version, i.e., 1.x, 2.x, 3.x. Here is some rough outline to get you started... if you do the actual pseudocode, it'll probably be pretty close if not exactly the correct Python: open the file for 'r+b' (read/write; for POSIX system...
1
1
0
I need to write program that will change bytes in file in specific addreses. I can use only python 2.2 it's game's module so... I read once about mmap but i can't find it in python 2.2
How to change byte on specific addres
0.197375
0
0
191
12,683,630
2012-10-02T02:08:00.000
1
1
0
0
python,django,api,rest,tastypie
12,686,954
2
true
1
0
You can add a new field to the resource and dehydrate it with dehydrate_field_name().
1
0
0
How can I add custom fields (in this case, meta codes) to a dispatch_list in Tastypie?
Tastypie: Add meta codes to dispatch_list
1.2
0
0
883
12,688,766
2012-10-02T10:36:00.000
1
0
0
0
python,eclipse,syntax-highlighting
12,962,250
1
true
0
0
Unfortunately the keywords are not currently customizable. (it's hard-coded at org.python.pydev.editor.PyCodeScanner) You can grab the code and modify yourself... I don't know of any attempt to integrate an eclipse editor with pygments, but I guess it could be possible.
1
2
0
Can you think of some way to realize custom source code highlighting in Eclipse/Pydev? I'd like to highlight some tokens that are usually not distinguished. Is there a way to do change the highlighting in Eclipse and/or Pydev? I mean not just change colors, but really introduce new elements. Or can I incorporate pygmen...
Custom highlighting with Eclipse/Python?
1.2
0
0
256
12,691,551
2012-10-02T13:48:00.000
1
0
1
0
python,datetime
12,691,704
13
false
0
0
This will take some work since there isn't any defined construct for holidays in any library (by my knowledge at least). You will need to create your own enumeration of those. Checking for weekend days is done easily by calling .weekday() < 6 on your datetime object.
1
30
0
I'm trying to add n (integer) working days to a given date, the date addition has to avoid the holidays and weekends (it's not included in the working days)
Add n business days to a given date ignoring holidays and weekends in python
0.015383
0
0
42,545
12,693,054
2012-10-02T15:08:00.000
1
0
0
0
c++,python,ruby-on-rails,web-applications,web-crawler
12,697,280
3
false
1
0
Adding to mechanize: if your page has a javascript component that mechanize cant handle, selenium drives an actual web browser. If you're hellbent on using ruby, you can also use WATIR, but selenium has both ruby and python bindings.
2
3
0
I currently have been assigned to create a web crawler to automate some reporting tasks I do. This web crawler would have to login with my credentials, search specific things in different fields (some in respect to the the current date), download CSVs that contain the data if there is any data available, parse the CSVs...
Easiest way to tackle this web crawling task?
0.066568
0
1
321
12,693,054
2012-10-02T15:08:00.000
0
0
0
0
c++,python,ruby-on-rails,web-applications,web-crawler
12,693,218
3
false
1
0
While this is not a great Stackoverflow question, since you are a student and it's for an internship, it seems like it would be in poor form to flag it, or down-vote it. :) Basically, you can pretty much accomplish this task with any of the languages you listed. If you want learning Ruby as a part of your experience f...
2
3
0
I currently have been assigned to create a web crawler to automate some reporting tasks I do. This web crawler would have to login with my credentials, search specific things in different fields (some in respect to the the current date), download CSVs that contain the data if there is any data available, parse the CSVs...
Easiest way to tackle this web crawling task?
0
0
1
321
12,696,151
2012-10-02T18:34:00.000
0
0
1
1
python
15,816,458
2
false
0
0
I also had this problem. Like mottyg1 said, it happens when the python script is run from a directory containing non-english characters. I can't change the directory name though, and my python script needed to be in the directory in order to perform manipulations on the filenames. So my workaround was simply to move...
1
12
0
When running any Python script (by double clicking a .py file on Windows 7) I'm getting a Python: failed to set __main__.__loader__ error message. What to do? More details: The scripts work on other machines. The only version of Python installed on the machine on which the scripts don't work is 3.2. I get the same er...
failed to set __main__.__loader__ in Python
0
0
0
5,239
12,697,595
2012-10-02T20:16:00.000
1
0
0
0
python,django,migration,django-south
12,697,732
1
true
1
0
--initial is not about detecting changes, you shouldn't expect it to. It takes the current state of the tables and exports them as create table statements to get your first migration off the ground such that on a new install, you simply run "python manage.py migrate" to build your tables from start to finish. No matter...
1
0
0
I'm trying to run migration by south, But when I run : manage.py schemamigration <my_app> --initial it makes wrong modifications, creating "Added model treinoclub_app.Endereco Added model treinoclub_app.Academia". But I didn't make any changes for this table.
south migration making incorrect initial schemamigration
1.2
0
0
91
12,698,212
2012-10-02T20:57:00.000
1
0
0
1
python,eclipse,celery
19,998,790
5
false
1
0
I create a management command to test task.. find it easier than running it from shell..
1
29
0
I need to debug Celery task from the Eclipse debugger. I'm using Eclipse, PyDev and Django. First, I open my project in Eclipse and put a breakpoint at the beginning of the task function. Then, I'm starting the Celery workers from Eclipse by Right Clicking on manage.py from the PyDev Package Explorer and choosing "De...
How to debug Celery/Django tasks running locally in Eclipse
0.039979
0
0
23,443
12,698,862
2012-10-02T21:47:00.000
3
0
0
0
c++,python,sockets,networking,network-programming
12,698,891
2
false
0
0
No; you cannot connect to an IPv6 server without some form of IPv6 transit. Depending on your network, you may be able to set up a 6to4 gateway. This is a server configuration change, though, and is outside the scope of Stack Overflow.
1
2
0
my network does not support the ipv6 hence i have no access to ipv6 servers, is there any solution to connect to them using sockets that uses 'AF_INET' domain? or any kind of other solutions? is there any server on the Internet that does such a convert for free? i can reed python and c++.
can i connect to a ipv6 address via a AF_INET domain socket?
0.291313
0
1
557
12,699,132
2012-10-02T22:11:00.000
1
0
1
0
python
12,699,266
5
false
0
0
There are a lot of permutations. It usually isn't a good idea to generate them all just to count them. You should look for a mathematical formula to solve this, or perhaps use dynamic programming to compute the result.
1
1
0
How do you find all the combinations of a 40 letter string? I have to find how many combinations 20 D and 20 R can make. as in one combination could be... DDDDDDDDDDDDDDDDDDDDRRRRRRRRRRRRRRRRRRRR thats 1 combination, now how do I figure out the rest?
Finding the different combinations
0.039979
0
0
217
12,699,376
2012-10-02T22:30:00.000
2
0
0
0
python,opengl
12,699,435
1
true
0
0
Is PyOpenGL the answer? No. At least not in the way you expect it. If your GPU does support OpenGL-4.3 you could use Compute Shaders in OpenGL, but those are not written in Python but simply run a "vanilla" python script ported to the GPU. That's not how GPU computing works. You have to write the shaders of computat...
1
1
1
I want to write an algorithm that would benefit from the GPU's superior hashing capability over the CPU. Is PyOpenGL the answer? I don't want to use drawing tools, but simply run a "vanilla" python script ported to the GPU. I have an ATI/AMD GPU if that means anything.
Can normal algos run on PyOpenGL?
1.2
0
0
389
12,699,827
2012-10-02T23:19:00.000
0
0
1
0
python,character-encoding,ascii,block,non-ascii-characters
12,699,924
2
false
0
0
Your python shell is probably using either ISO-8859-1 or Unicode, not he same character set as Character Map. chr(219) is also U+00DB, which is probably the Unicode character Û. I don't know what character set you are using, but there aren't any symbol characters that early in the Unicode character set.
1
7
0
In IDLE, print(chr(219)) (219's the block character) outputs "Û". Is there any way to get it to output the block character instead? This might actually be some sort of computer-wide problem, as I cannot seem to get the block character to print from anywhere, copying it out of charmap and into any textbox just results...
Python: block character will not print
0
0
0
5,367
12,700,350
2012-10-03T00:27:00.000
0
0
0
0
python-2.7,django-views,django-1.3
12,865,154
2
false
1
0
As zzzirk says: Django really isn't about flat pages, so the most Djangonic solution is to put flat pages beside the django app, not within it.
2
0
0
Building a "history" system that serves static pages based on the date the user asks for. Not all dates have associated pages, and it isn't possible to know, based on what's in the database which do, which don't. I haven't been able to find a way to redirect to a static page because there doesn't seem to be any way to ...
Django: using {{STATIC_URL}} from python side
0
0
0
148
12,700,350
2012-10-03T00:27:00.000
0
0
0
0
python-2.7,django-views,django-1.3
12,739,819
2
false
1
0
I'm not certain from your question if you understand the intention of the {{ STATIC_URL }} tag. It is a URL prefix for static content files such as css, javascript, or image files. It is not intended as a path for your own static HTML files. In the end I'm not sure you are asking the right question for what you are ...
2
0
0
Building a "history" system that serves static pages based on the date the user asks for. Not all dates have associated pages, and it isn't possible to know, based on what's in the database which do, which don't. I haven't been able to find a way to redirect to a static page because there doesn't seem to be any way to ...
Django: using {{STATIC_URL}} from python side
0
0
0
148
12,700,574
2012-10-03T00:58:00.000
4
0
1
0
python
12,700,668
2
false
0
0
In addition to what @nneonneo said, you should periodically scan through your list of cursor weak references and cull out the Nones otherwise you will end up with an ever growing list of Nones
1
2
0
I have a text editing program that hands out cursors to other parts of the program that require it. The cursor consists of a two part list, [start, end], which needs to be updated every time text is inserted/removed (the start/end index gets moved forward or backwards). When the cursor is no longer used, I want to stop...
Python: How do I keep track of whether an object is still in 'use'?
0.379949
0
0
101
12,702,146
2012-10-03T04:57:00.000
10
0
0
0
python,mysql,python-2.7,mysql-connector-python
13,899,478
8
false
0
0
I met the similar problem under Windows 7 when installing mysql-connector-python-1.0.7-py2.7.msi and mysql-connector-python-1.0.7-py3.2.msi. After changing from "Install only for yourself" to "Install for all users" when installing Python for windows, the "python 3.2 not found" problem disappear and mysql-connector-pyt...
2
12
0
I have downloaded mysql-connector-python-1.0.7-py2.7.msi from MySQL site and try to install but it gives error that Python v2.7 not found. We only support Microsoft Windows Installer(MSI) from python.org. I am using Official Python v 2.7.3 on windows XP SP3 with MySQL esssential5.1.66 Need Help ???
mysql for python 2. 7 says Python v2.7 not found
1
1
0
19,218
12,702,146
2012-10-03T04:57:00.000
0
0
0
0
python,mysql,python-2.7,mysql-connector-python
19,051,115
8
false
0
0
I solved this problem by using 32bit python
2
12
0
I have downloaded mysql-connector-python-1.0.7-py2.7.msi from MySQL site and try to install but it gives error that Python v2.7 not found. We only support Microsoft Windows Installer(MSI) from python.org. I am using Official Python v 2.7.3 on windows XP SP3 with MySQL esssential5.1.66 Need Help ???
mysql for python 2. 7 says Python v2.7 not found
0
1
0
19,218
12,703,241
2012-10-03T06:48:00.000
1
0
1
0
python,file
12,703,403
3
false
0
0
i don't know if i understood you well, but using open() you create object representing file stream. until you keep reference to this object, the file stream is opened. but if you call open() again for the same file, you'll make another object representing file stream. target of stream will be the sames but object's wil...
1
1
0
I'm learning how to use open(file, 'r') and was wondering: If I say open(file1, 'r')and then later try to access that same file using open() again, will it work? Because I never did close() on it. And does it close immediately after opening, because it's not assigned to any variable?
Open(file) - Does it stay open?
0.066568
0
0
472
12,704,933
2012-10-03T08:50:00.000
0
0
1
0
python,refactoring
12,705,192
2
false
0
0
Eclipse+pydev has a refactoring tool. But a simple ctrl+F should suffice to know where you have used the variable
1
1
0
Which tool people normally use when they do the refactoring for Python!? For me, to get rid of a variable, I need to trace through the program to make sure that I completely delete it!?
How to do refactoring for Python?
0
0
0
385
12,707,239
2012-10-03T11:08:00.000
2
1
0
0
python,protocols,irc
12,721,513
1
true
0
0
Are you looking for /notice ? (see irchelp.org/irchelp/misc/ccosmos.html#Heading227)
1
0
0
I'm writing up an IRC bot from scratch in Python and it's coming along fine. One thing I can't seem to track down is how to get the bot to send a message to a user that is private (only viewable to them) but within a channel and not a separate PM/conversation. I know that it must be there somewhere but I can't find it ...
IRC msg to send to server to send a "whisper" message to a user in channel
1.2
0
1
2,449
12,708,573
2012-10-03T12:34:00.000
0
1
0
0
python,twitter,urlencode
12,708,663
1
true
0
0
Try without spaces (ie. the %20). Doh!
1
0
0
I'm trying to track several keywords at once, with the following url: https://stream.twitter.com/1.1/statuses/filter.json?track=twitter%2C%20whatever%2C%20streamingd%2C%20 But the stream only returns results for the first keyword?! What am I doing wrong?
Twitter Public Stream URL when several track keywords?
1.2
0
1
163
12,709,062
2012-10-03T13:00:00.000
5
0
1
0
python,lambda,inline-if
12,709,132
4
false
0
0
What's wrong with lambda x: x if x < 3 else None?
1
51
0
I was writing some lambda functions and couldn't figure this out. Is there a way to have something like lambda x: x if (x<3) in python? As lambda a,b: a if (a > b) else b works ok. So far lambda x: x < 3 and x or None seems to be the closest i have found.
Python lambda with if but without else
0.244919
0
0
100,862
12,711,511
2012-10-03T15:14:00.000
1
0
0
1
python,embed
12,862,310
1
true
0
0
Well, the only way I could come up with is to run the Python engine on a separate thread. Then the main thread is blocked when the python thread is running. When I need to suspend, I block the Python thread, and let the main thread run. When necessary, the OnIdle of the main thread, i block it and let the python contin...
1
1
0
I have an app that embeds python scripting. I'm adding calls to python from C, and my problem is that i need to suspend the script execution let the app run, and restore the execution from where it was suspended. The idea is that python would call, say "WaitForData" function, so at that point the script must suspend (p...
suspend embedded python script execution
1.2
0
0
164
12,711,743
2012-10-03T15:27:00.000
1
0
1
0
python,list
12,711,895
3
false
0
0
I assume that the data are noisy, in the sense that it could just be anything at all, written in. The main difficulty here is going to be how to define the mapping between your input data, and categories, and that is going to involve, in the first place, looking through the data. I suggest that you look at what you hav...
1
3
1
Currently I have a list of 110,000 donors in Excel. One of the pieces of information they give to us is their occupation. I would like to condense this list down to say 10 or 20 categories that I define. Normally I would just chug through this, going line by line, but since I have to do this for a years worth of data...
categorizing items in a list with python
0.066568
0
0
1,266
12,713,797
2012-10-03T17:32:00.000
0
0
0
0
python,numpy,recommendation-engine,topic-modeling,gensim
15,066,821
3
false
0
0
My tricks are using a search engine such as ElasticSearch, and it works very well, and in this way we unified the api of all our recommend systems. Detail is listed as below: Training the topic model by your corpus, each topic is an array of words and each of the word is with a probability, and we take the first 6 mos...
1
3
1
I am looking to compute similarities between users and text documents using their topic representations. I.e. each document and user is represented by a vector of topics (e.g. Neuroscience, Technology, etc) and how relevant that topic is to the user/document. My goal is then to compute the similarity between these vect...
Topic-based text and user similarity
0
0
0
1,318
12,714,434
2012-10-03T18:17:00.000
1
0
0
1
python,telnet,ubuntu-12.04
12,788,388
1
true
0
0
If you really want to use system's su program, you will need to create a terminal pair, see man 7 pty, in python that's pty.openpty call that returns you a pair of file descriptors, one for you and one for su. Then you have to fork, in the child process change stdin/out/err to slave fd and exec su. In the parent proces...
1
4
0
I am trying to create a Telnet Server using Python on Ubuntu 12.04. In order to be able to execute commands as a different user, I need to use the su command, which then prompts for the password. Now, I know that the prompt is sent to the STDERR stream, but I have no idea which stream I am supposed to send the password...
Telnet Server ubuntu - password stream
1.2
0
0
690
12,714,965
2012-10-03T18:54:00.000
3
0
0
1
python,stream,twisted,boto
12,716,129
2
true
1
0
boto is a Python library with a blocking API. This means you'll have to use threads to use it while maintaining the concurrence operation that Twisted provides you with (just as you would have to use threads to have any concurrency when using boto ''without'' Twisted; ie, Twisted does not help make boto non-blocking o...
1
4
0
I have a server which files get uploaded to, I want to be able to forward these on to s3 using boto, I have to do some processing on the data basically as it gets uploaded to s3. The problem I have is the way they get uploaded I need to provide a writable stream that incoming data gets written to and to upload to boto ...
Boto reverse the stream
1.2
1
1
636
12,716,608
2012-10-03T20:44:00.000
7
0
1
0
python,mongodb,pymongo
12,716,831
3
true
0
0
Calling mycollection.options() returns a dict with 'capped': True if it's a capped collection.
1
3
0
I'm writing functionality in Python to ensure the existence, type, and size of mongodb collections. Most of these collections are capped. I know that the mongo shell includes mycollection.iscapped(), but pymongo does not seem to support this functionality. Within the context of pymongo, what is the best way to tell i...
Can pymongo detect if a collection is capped?
1.2
0
0
1,088
12,718,216
2012-10-03T23:16:00.000
1
0
1
0
python
12,727,999
1
true
0
1
Try importing pdb and just manually setting breakpoints in the code with pdb.set_trace(). This won't work in all multi-threaded cases, but I find that it works in many of them and is a big improvement over the native Eclipse/PyDev debugger.
1
1
0
Ok, I am new to python and my code calls some library (which is wrapping some C++ code) and I pass it a callback function on my side (as library needs to). The strange thing is that if I insert a breakpoint in my other part of the code, it will hit and deugger stops in eclipse but none of my breakpoints in the callbac...
In Pydev setting a breakpoint, but breakpoint not hit on callbacks only
1.2
0
0
736
12,721,616
2012-10-04T06:38:00.000
6
0
1
0
python,windows-7,cygwin,64-bit
12,722,722
1
false
0
0
To uninstall the Python interpreter (or any other package) from Cygwin: Run the setup.exe file (the one you downloaded for installing Cygwin) Make sure the installation folder matches your Cygwin location On the package selection screen, find the package you want to uninstall (here python) Change its state from keep t...
1
6
0
I am trying to run a Python script on a Windows 7-64 bit machine using Cygwin. I can't get the newest version of Python installed in this environment. Question: How do I uninstall Python 2.6 Which Python package should I use for Cygwin?
Cygwin Newbie: How do I uninstall Python 2.6.x from Cygwin and install Python 2.7.x?
1
0
0
7,488
12,721,998
2012-10-04T07:09:00.000
0
0
1
0
c#,security,ironpython
12,730,482
1
false
0
1
The trick is to run IronPython in its own AppDomain and only provide the assemblies you want the user to be able to call to that AppDomain, and then set the security policy to prevent them from referencing more.
1
0
0
I want to use ironpython inside my C# App, but I am afraid that it will cause a security issue, I don't want the end user to use all the available DLLs of my App, instead I want to provide custom classes that user can use in python. My question is how to secure my dlls from being used in ironpython. the end user may ad...
Secure and protect classes or DLLs in .NET from being used in IronPython
0
0
0
97
12,723,009
2012-10-04T08:13:00.000
1
1
0
0
python,pyramid
26,917,124
2
false
1
0
Simply add this following code where your Pyramid web app gets initialized. import mimetypes mimetypes.add_type('application/x-font-woff', '.woff') For instance, I have added it in my webapp.py file, which gets called the first time the server gets hit with a request.
1
4
0
I am using pyramid web framework to build a website. I keep getting this warning in chrome console: Resource interpreted as Font but transferred with MIME type application/octet-stream: "http:static/images/fonts/font.woff". How do I get rid of this warning message? I have configured static files to be served using ad...
How to set the content type header in response for a particular file type in Pyramid web framework
0.099668
0
0
1,474
12,723,746
2012-10-04T08:59:00.000
4
0
1
0
python,datetime
12,723,975
2
true
0
0
The parse() method of dateutil is very flexible and will parse almost anything you throw at it. However, because of that flexibility, if your input is limited to a certain number of patterns, custom code that checks for those patterns then uses datetime.datetime.strptime() could easily beat it. Since this depends entir...
1
2
0
I'm building a generic custom strToDatetime(string) function. The date string may be in some different formats. The 2 most popular alternatives seem datetime.strptime(string, format) and dateutil.parser(string). It seems datetime.strptime() requires a format and dateutil.parser() does not, so the possible solutions see...
Converting date string in unknown format to datetime
1.2
0
0
2,330
12,728,547
2012-10-04T13:39:00.000
1
0
0
0
python,django
12,728,830
3
true
1
0
I would separate out the common models, ect... into it's own python package. Then each project will have this package installed, or just install the package at the system level and they both can use it. If you handle this properly you shouldn't have to change much of your imports and you can easily update the package b...
1
1
0
I have two Django Projects where I use a lot of common models. Custom user classes, Algorithm classes, Product classes. The two projects are related to e-commerce, both run on different machines and serve completely different purposes. However, considering that they have these models in "common", I was wondering if it ...
Including common Django Project in multiple projects
1.2
0
0
1,451
12,729,549
2012-10-04T14:29:00.000
1
0
1
0
python,git,oop,virtualenv,pypi
12,729,643
2
false
0
0
Option 1, will cause you pain in the long term. Any non trivial library is going to have to break backward compatibility at some stage, and you don't want to have to update apps A,B and C because app D needs some new functionality from the library
2
0
0
I have few projects and they use some common code. I refactored this code into common library but then a problem arose. How to manage this common code. I've considered some options which are: libraries as soft links in filesystem. libraries as git submodules. dependencies managed with pip/requirements.txt. What are p...
Common libraries in many projects
0.099668
0
0
193
12,729,549
2012-10-04T14:29:00.000
1
0
1
0
python,git,oop,virtualenv,pypi
12,729,931
2
true
0
0
The third option with virtualenv is really convenient. Just make a requirements file in your project, install the dependencies into your virtualenv, and run the env. Each project can have their own dependencies and virtualenv, and nothing overlaps. You also don't have to worry about installing conflicting modules in yo...
2
0
0
I have few projects and they use some common code. I refactored this code into common library but then a problem arose. How to manage this common code. I've considered some options which are: libraries as soft links in filesystem. libraries as git submodules. dependencies managed with pip/requirements.txt. What are p...
Common libraries in many projects
1.2
0
0
193
12,729,828
2012-10-04T14:41:00.000
3
1
1
0
java,c++,python,ruby,compiler-construction
12,730,127
1
true
0
0
You are correct in that runtime dynamic binding is entirely different conceptually from class inheritance. But as I re-read your question, I don't think I would agree that "Java and C++, runtime dynamic binding is implemented as class inheritance." Class inheritance is simply the definition of broader behavior that inc...
1
6
0
I am trying to clarify the concept of runtime dynamic binding and class inheritance in dynamic languages (Python, ruby) and static type languages (java, C++). I am not sure I am right or not. In dynamic languages like Python and Ruby, runtime dynamic binding is implemented as duck typing. When the interpreter checks th...
Difference between runtime dynamic binding and class inheritance
1.2
0
0
1,662
12,730,293
2012-10-04T15:06:00.000
23
0
0
0
python,sockets,network-programming,telnet
12,730,703
3
true
0
0
Telnet is a way of passing control information about the communication channel. It defines line-buffering, character echo, etc, and is done through a series of will/wont/do/dont messages when the connection starts (and, on rare occasions, during the session). That's probably not what your server documentation means. ...
1
22
0
I am trying to send commands to a server via a python script. I can see the socket connection being established on the server. But the commands I am sending across , do not seem to make it through(server does a read on the socket). The server currently supports a telnet command interpreter. ie: you telnet to the comman...
How does telnet differ from a raw tcp connection
1.2
0
1
30,360
12,730,426
2012-10-04T15:14:00.000
0
0
0
0
python,web-scraping,translation
16,074,293
3
false
1
0
Or go to MicrosoftTranslator.com, and paste your text in one box, have it translate and cut and paste the result? Failing that, the MS Translator API can be used for up to 2 million characters a month for free...so maybe use that?
1
0
0
I would like to translate a few hundred words for an application I'm writing. This is a simple, one-off project, so I'm not willing to pay for the the google translate API. Is there another web service which will do this? Another idea is to just send a search to Google, and scrape the result from the first result. For ...
Automate translation for personal use
0
0
1
184
12,736,172
2012-10-04T21:21:00.000
3
0
1
0
python,exception-handling,gevent,greenlets
12,774,007
1
true
0
0
If you link() the child greenlet to the parent greenlet, then LinkedExited will be raised in the parent when the child exits. At that point you can check the exception property of the child greenlet. It will contain the exception instance raised in the child (if the child finished with an error). Now that you have the ...
1
4
0
In using gevent, whenever a child greenlet throws an exception, I would like it to bubble up to the parent (and ideally have the parent throw the exception). In the documentation for greenlets, it says this is automatically done, but this doesn't appear to be the case in gevent. How do I bubble up exceptions in gevent...
Gevent greenlet bubbling up exceptions to the parent
1.2
0
0
775
12,737,366
2012-10-04T23:17:00.000
0
0
0
0
python-3.x,pygame,pyopengl
12,755,970
2
false
0
1
PyGame's only relation to PyOpenGL is that PyGame can provide a window for PyOpenGL to render on. Your question now is whether PyGame's windowing environment is faster than another. In my experience, GLUT can be very slightly faster than PyGame for windowing (by comparing GLUT and SDL). wxWidgets I think is a bit slow...
1
3
0
I see that all tutorials about the pyopengl implements pygame, is posible use PyOpengl without pygame?. and if is so, then, is most faster without pygame or not?
PyOpengl without PyGame
0
0
0
1,388
12,737,993
2012-10-05T00:39:00.000
0
0
1
0
python,image-processing
57,430,322
3
false
0
0
I would suggest the following procedure: 1) Convert your image to a binary image (nxn numpy array): 1(object pixels) and 0 (background pixels) 3) Since you want to follow a contour, you can see this problem as: finding the all the object pixels belonging to the same object. This can be solved by the Connected Component...
1
3
0
I am new to Python and would be grateful if anyone can point me the right direction or better still some examples. I am trying to write a program to convert image (jpeg or any image file) into gcode or x/y coordinate. Instead of scanning x and y direction, I need to follow the contour of objects in the image. For exam...
Follow image contour using marching square in Python
0
0
0
3,955
12,738,827
2012-10-05T02:50:00.000
1
0
0
0
java,python,jython,scikit-learn
50,292,755
6
false
0
0
I found myself in a similar situation. I'll recommend carving out a classifier microservice. You could have a classifier microservice which runs in python and then expose calls to that service over some RESTFul API yielding JSON/XML data-interchange format. I think this is a cleaner approach.
1
35
1
I have a classifier that I trained using Python's scikit-learn. How can I use the classifier from a Java program? Can I use Jython? Is there some way to save the classifier in Python and load it in Java? Is there some other way to use it?
How can I call scikit-learn classifiers from Java?
0.033321
0
0
42,287
12,740,424
2012-10-05T06:05:00.000
1
0
0
0
python,sql,django,django-queryset
12,740,533
2
false
1
0
Try this. https://docs.djangoproject.com/en/dev/topics/db/sql/
1
0
0
I want to select data from multiple tables, so i just want to know that can i used simple SQL queries for that, If yes then please give me an example(means where to use these queries and how). Thanks.
Can I used simple sql commands in django
0.099668
1
0
77
12,743,436
2012-10-05T09:32:00.000
2
0
0
0
python,mysql
12,743,439
1
true
0
0
There is a property of the connection object called thread_id, which returns an id to be passed to KILL. MySQL has a thread for each connection, not for each cursor, so you are not killing queries, but are instead killing connection. To kill an individual query you must run each query in it's own connection, and then k...
1
0
0
Background: I'm working on dataview, and many of the reports are generated by very long running queries. I've written a small query caching daemon in python that accepts a query, spawns a thread to run it, and stores the result when done as a pickled string. The results are generally various aggregations broken down by...
Get process id (of query/thread) of most recently run query in mysql using python mysqldb
1.2
1
0
1,016
12,749,702
2012-10-05T15:45:00.000
2
0
0
0
python,django
12,750,335
2
true
1
0
Converting this to a model objects doesn't require storing it in database. Also if you are sure you don't want to store it maybe placing it in models.py and making it Django models is wrong idea. Probably it should be just normal Python classes e.g. in resources.py or something like that, not to mistake it with models....
1
0
0
Question In Django, when using data from an API (that doesn't need to be saved to the database) in a view, is there reason to prefer one of the following: Convert API data (json) to a json dictionary and pass to the template Convert API data (json) to the appropriate model object from models.py and then pass that to t...
Passing JSON (dict) vs. Model Object to Templates in Django
1.2
0
0
662
12,750,731
2012-10-05T16:53:00.000
0
0
0
0
android,python,django,dojo
12,750,812
1
true
1
1
I suggest to take a look at PhoneGap. I use it to embed JQuery mobile inside a Android application. PhoneGap makes it easy to embed javascript inside an Android application. Just try the PhoneGap tutorial. Edit: PhoneGap let u use the GPS sensor through javascript
1
1
0
I am trying to make a android apps using Dojo toolkit and GeoDjango. Its a project based on GPS work. Can anyone help in this issue? I want to have the staring steps? I have some source code and SDK installed in my computer. But still confused about the staring. can Anyone help? How I will make it possible to create th...
Android apps with Dojo and geodjango
1.2
0
0
197
12,750,787
2012-10-05T16:58:00.000
3
0
0
1
python,parallel-processing,cluster-computing
12,785,406
1
true
0
0
Author of jug here. Jug does handle the dependencies very well. If you change any of the inputs or intermediate steps, running jug status will tell you the state of the computation. There is currently no way to specify that some tasks (what jug calls jobs) should have multiple processes allocated to them. In the past, ...
1
3
0
I have the usual large set of dependent jobs and want to run them effectively in a PBS cluster environment. I have been using Ruffus and am pretty happy with it, but I also want to experiment a bit with other approaches. One that looks interesting in python is jug. However, it appears that jug assumes that the jobs...
Python jug (or other) for embarrassingly parallel jobs in cluster environment with heterogenous tasks
1.2
0
0
522
12,751,787
2012-10-05T18:11:00.000
4
0
1
0
python,map,filter,lambda
12,751,822
5
false
0
0
Because filter in python takes only one argument. So you need to define a lambda/function that takes only one argument if you want to use it in filter.
2
9
0
This is my code: filter(lambda n,r: not n%r,range(10,20)) I get the error: TypeError: <lambda>() takes exactly 2 arguments (1 given) So then I tried: foo=lambda n,r:not n%r Which worked fine. So I thought this will work: bar=filter(foo,range(10,20)) but again: TypeError: <lambda>() takes exactly 2 arguments (1 given) S...
Why is lambda asking for 2 arguments despite being given 2 arguments?
0.158649
0
0
15,792
12,751,787
2012-10-05T18:11:00.000
0
0
1
0
python,map,filter,lambda
12,751,828
5
false
0
0
Your lambda function takes two arguments n and r. filter must be called with a function that takes one argument and returns True when the item should be kept. Maybe you meant to define r or n outside your lambda function and then capture it in the closure.
2
9
0
This is my code: filter(lambda n,r: not n%r,range(10,20)) I get the error: TypeError: <lambda>() takes exactly 2 arguments (1 given) So then I tried: foo=lambda n,r:not n%r Which worked fine. So I thought this will work: bar=filter(foo,range(10,20)) but again: TypeError: <lambda>() takes exactly 2 arguments (1 given) S...
Why is lambda asking for 2 arguments despite being given 2 arguments?
0
0
0
15,792
12,753,527
2012-10-05T20:22:00.000
0
1
0
0
php,python,apache,url,timeout
12,941,867
5
true
0
0
While there have been some good answers here, I found that a simple php sleep() call with an override to Apache's timeout was all I needed. I know that unit tests should be in isolation, but the server this endpoint is hosted on is no going anywhere.
2
3
0
I'm unit testing a URL fetcher, and I need a test url which always causes urllib2.urlopen() (Python) to time out. I've tried making a php page with just sleep(10000) in it, but that causes 500 internal server error. How would I make a resource that causes a connection timeout in the client whenever it is requested?
How should I create a test resource which always times out
1.2
0
1
615
12,753,527
2012-10-05T20:22:00.000
1
1
0
0
php,python,apache,url,timeout
12,753,554
5
false
0
0
Connection timeout? Use, for example, netcat. Listen on some port (nc -l), and then try to download data from that port.. http://localhost:port/. It will open connection, which will never reply.
2
3
0
I'm unit testing a URL fetcher, and I need a test url which always causes urllib2.urlopen() (Python) to time out. I've tried making a php page with just sleep(10000) in it, but that causes 500 internal server error. How would I make a resource that causes a connection timeout in the client whenever it is requested?
How should I create a test resource which always times out
0.039979
0
1
615
12,753,896
2012-10-05T20:54:00.000
2
0
1
1
python,dll,tcl
12,754,599
2
true
0
0
The easiest way would be by using the Tkinter package and its built in Tcl interpreter inside your Python Process. If it is a Tcl extension dll, it makes no real sense to call it from Python without much setup first.
2
1
0
I have a script written in tcl, that load a dll file. I want to load this file in python. I am not sure if the dll file is written in tcl, but because the tcl file imports it I think it is written in tcl. I have tried to use WinDLL("path_to_dll") but I get that there is no module with the provided name.
how to load from Python a dll file written in tcl
1.2
0
0
221
12,753,896
2012-10-05T20:54:00.000
1
0
1
1
python,dll,tcl
12,757,979
2
false
0
0
Python and Tcl have substantially different C APIs; there's no reason at all to expect that a binary library written for one would work with the other. It might be possible to write a library that would use the API of whichever library it is loaded into — from the Tcl perspective, this would involve linking against the...
2
1
0
I have a script written in tcl, that load a dll file. I want to load this file in python. I am not sure if the dll file is written in tcl, but because the tcl file imports it I think it is written in tcl. I have tried to use WinDLL("path_to_dll") but I get that there is no module with the provided name.
how to load from Python a dll file written in tcl
0.099668
0
0
221
12,755,611
2012-10-06T00:21:00.000
5
0
0
0
twitter,python-2.7
12,755,702
1
true
0
0
Found the answer.... loc = [tweepy.api.get_user(friend).followers_count for friend in lof]
1
2
0
I have a list for followers: lof = [31536003, 15066760, 75862029] I can get the follower count for each follower in the list: user = tweepy.api.get_user(31536003) print user.followers_count However, I am trying to write a list comprehension that can return a list in python. The list should be a list of the follower co...
Find the number of follower using tweepy
1.2
0
1
1,505
12,755,804
2012-10-06T01:00:00.000
0
0
1
1
python,macos,import,pyopengl
12,791,804
2
false
0
0
Thanks guys! I figured it out.It was infact a separate module which I needed to copy over to the "site-packages" location and it worked fine.So in summary no issues with the path just that the appropriate module was not there.
1
0
0
I am trying to run a python script on my mac .I am getting the error :- ImportError: No module named opengl.opengl I googled a bit and found that I was missing pyopengl .I installed pip.I go to the directory pip-1.0 and then say sudo pip install pyopengl and it installs correctly I believe because I got this Suc...
No module named opengl.opengl
0
0
0
2,646
12,756,976
2012-10-06T05:18:00.000
26
1
0
0
python,pyramid,alembic
12,757,266
2
true
0
0
Just specify alembic -c /some/path/to/another.ini when running alembic commands. You could even put the [alembic] section in your development.ini and production.ini files and just alembic -c production.ini upgrade head.
1
13
0
I'm attempting to configure SQLAlchemy Alembic for my Pyramid project and I want to use my developement.ini (or production.ini) for the configuration settings for Alembic. Is it possible to specify the .ini file I wish to use anywhere within Alembic?
Use different .ini file for alembic.ini
1.2
0
0
5,384
12,760,257
2012-10-06T13:36:00.000
0
0
1
0
python,django
12,883,745
2
true
0
0
Used Redis. It's thread safe.
2
0
0
Uploading files (images) via ajax multi-uploader (http://github.com/valums/file-uploader). Each uploaded file is saved in temp file. Put temp file name in dict with key of original name. Later every image will be resized in several sizes and saved to s3 storage. The problem is that there're at least 2 instances of the ...
Storing data from multiple threads
1.2
0
0
105
12,760,257
2012-10-06T13:36:00.000
0
0
1
0
python,django
12,760,393
2
false
0
0
More info about how uploading files via multi-uploader works in terms of its architecture would be very helpful in your question. However IMO one should always shy away from global data structures when doing web applications with Python/Django. Why? Django fcgi and similar set ups are meant to run with multiple process...
2
0
0
Uploading files (images) via ajax multi-uploader (http://github.com/valums/file-uploader). Each uploaded file is saved in temp file. Put temp file name in dict with key of original name. Later every image will be resized in several sizes and saved to s3 storage. The problem is that there're at least 2 instances of the ...
Storing data from multiple threads
0
0
0
105
12,760,904
2012-10-06T15:02:00.000
2
0
1
0
python,variables,types
12,760,943
3
true
0
0
While you can start your code with something like t = str.isdigit and then check t(n) (you can't make it an attribute of strings because you can't intercept attribute lookup from the outside), this is actually a pretty bad idea. While it's quicker to type, it is significantly harder to read. This will bite you (or anyo...
1
1
0
I'm new to python but I caught on to the basics pretty quick and decided to start trying to make a program while I'm still learning, since I learn best by actually doing things. So I'm making a program in python that will add polynomials and I need to see if a character from the parser is numeric im using the isdigit(...
How can i set isdigit() command as a variable?
1.2
0
0
314