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
2,939,513
2010-05-30T16:54:00.000
0
0
1
0
python,list,set,intersection
2,939,529
4
false
0
0
I assume one dimension in your list is assumed e.g. [9,8,7,6,5] are heights at x1,x2,x3,x4,x5 right? in that case how your list will represent curves like y=0 ? In any case I don't think there can be any shortcut for calculating intersection of generic or random curves, best solution is to do a efficient search.
1
1
0
I have two lists in python and I want to know if they intersect at the same index. Is there a mathematical way of solving this? For example if I have [9,8,7,6,5] and [3,4,5,6,7] I'd like a simple and efficient formula/algorithm that finds that at index 3 they intersect. I know I could do a search just wondering if th...
set / line intersection solution
0
0
0
963
2,941,021
2010-05-31T01:51:00.000
2
0
0
0
python,google-app-engine,session,login
2,941,171
2
true
1
0
Under Application Settings in the App Engine dashboard, you can choose either 1 day, 1 week, or 2 week cookie expiration, assuming you're using the Users API. I don't believe the cookie should ever be set to expire when the browser is closed, unless the user's browser setting is causing this behavior. I can certainl...
1
0
0
...Like Django's session or cookies Does anyone have a simple way of allowing this?
How to Not Force Login After Users Close Their Browser on gae
1.2
0
0
174
2,942,375
2010-05-31T08:47:00.000
0
0
1
0
python,arrays,data-structures,dictionary
2,943,067
2
false
0
0
You might try using std::map. Boost.Python provides a Python wrapping for std::map out-of-the-box.
1
3
1
I bumped into a case where I need a big (=huge) python dictionary, which turned to be quite memory-consuming. However, since all of the values are of a single type (long) - as well as the keys, I figured I can use python (or numpy, doesn't really matter) array for the values ; and wrap the needed interface (in: x ; ou...
python dictionary with constant value-type
0
0
0
1,303
2,943,071
2010-05-31T11:03:00.000
0
1
1
1
python,windows-7,path
2,943,171
3
false
0
0
You can check the currently present enviroment variables with the "set" command on the command line. For python to work you need at least PYTHONPATH pointing to your python libs and the path to python.exe should be included in your PATH variable.
2
0
0
This is a weird bug. I know it's something funky going on with my PATH variable, but no idea how to fix it. If I have a script C:\Test\test.py and I execute it from within IDLE, it works fine. If I open up Command Prompt using Run>>cmd.exe and navigate manually it works fine. But if I use Windows 7's convenient Right C...
Python doesn't work properly when I execute a script after using Right Click >> Command Prompt Here
0
0
0
2,823
2,943,071
2010-05-31T11:03:00.000
1
1
1
1
python,windows-7,path
2,943,111
3
false
0
0
I don't use Windows much, but maybe when you open Right Click -> Command Prompt, the PATH is different from navigate manually. First try to print your PATH (oh I have no ideal how to do this) and see if it different in 2 situation.
2
0
0
This is a weird bug. I know it's something funky going on with my PATH variable, but no idea how to fix it. If I have a script C:\Test\test.py and I execute it from within IDLE, it works fine. If I open up Command Prompt using Run>>cmd.exe and navigate manually it works fine. But if I use Windows 7's convenient Right C...
Python doesn't work properly when I execute a script after using Right Click >> Command Prompt Here
0.066568
0
0
2,823
2,943,516
2010-05-31T12:30:00.000
5
0
0
0
python,quantlib
2,949,806
3
false
0
0
They're in the QuantLib-SWIG distribution (you probably got that from the QuantLib site already.) Once you unpack the tarball (or the zip archive) they're in the Python\examples folder.
1
13
0
Does anyone know of any good quantlib examples for Python? I cant seem to find any anywhere...
Python quantlib examples?
0.321513
0
0
6,665
2,943,862
2010-05-31T13:37:00.000
3
0
0
0
python,xml,tags,yaml
2,955,385
4
false
0
0
The difference between XML and YAML is significant enough to warrant a redesign of the schema you are using to store your data. You should write a script to parse your XML records and output YAML formatted data. There are some methods out there to convert any generic XML into YAML, but the results are far less usable t...
1
10
0
is there any library or way exist from which I can convert my xml records to yaml format ?
is there anything exist to convert xml -> yaml directly?
0.148885
0
1
6,025
2,945,074
2010-05-31T17:30:00.000
0
0
0
0
python,networking,communication
2,945,291
2
false
0
0
You could use wireshark from wireshark.org to sniff the network traffic (or any other packet sniffer).
1
2
0
lets say you run third party program on your computer whitch create a process named example.exe how do i determinate if this process is running and how many windows does he open? How do i intercept network communication between this windows and server? my goal is to create an app whitch will be monitoring network trafi...
python intercepting communication
0
0
1
620
2,945,615
2010-05-31T19:32:00.000
0
0
0
0
python,django,routes,pylons
2,945,937
1
true
1
0
Could you be more specific? If you want to adapt a django urlconf to routes at runtime it would be really tricky if not impossible and would require having a django settings.py present and an env variable pointing to it. Otherwise translating a django urlconf to routes manually is doable. Routes is as flexible as dja...
1
2
0
Can the Django urls.py system be turned into Pylon's Routes?
Can the Django urls.py system be turned into Pylon's Routes?
1.2
0
0
202
2,946,183
2010-05-31T22:06:00.000
2
0
0
1
python,google-app-engine,backup
15,256,477
4
false
1
0
There is now a backup option available in the dashboard. See "datastore admin".
1
14
0
So, you build a great shiny cloudy 2.0 website on top of AppEngine, with thousands upon thousands of images saved into the datastore and gigs of data at the blobstore. How do you backup them?
How to backup an AppEngine site?
0.099668
0
0
2,873
2,946,746
2010-06-01T01:00:00.000
1
0
1
0
python,windows,registry,privileges
2,946,772
4
false
0
0
Most straightforward way is try to change the key at the beginning, maybe to a stub value - if that fails, catch the error and tell the user.
1
4
0
I'm writing a little program as a self-learning project in Python 3.x. My idea is for the program to allow two fields of text entry to the user, and then plug the user's input into the value of two specific registry keys. Is there a simple way to make it check if the current user can access the registry? I'd rather it ...
Python - checking if a user has administrator privileges
0.049958
0
0
12,230
2,947,049
2010-06-01T02:54:00.000
6
0
0
0
python-imaging-library
7,326,477
1
false
0
0
PIL won't automatically do this, but you could easily do it yourself using the getsize method in the ImageFont module. That is, if the text is too big, just split it so that it's not, and put the rest on the next line. (You may want to do this recursively in case the text spans multiple lines.)
1
2
0
i have a word that will be putted on a image but the problem is that the word continues even though the word exceeds the width of the image is there anyway that the word shift's down if the word exceeds the width of the image or on a certain point the word shift's down if it exceeds the given point
python imaging library draw text new line how to?
1
0
0
1,435
2,947,172
2010-06-01T03:49:00.000
8
0
0
0
python,sql,orm,sqlalchemy
2,947,182
2
true
0
0
ORMs are very popular, for several reasons -- e.g.: some people would rather not learn SQL, ORMs can ease porting among different SQL dialects, they may fit in more smoothly with the mostly-OOP style of applications, indeed might even ease some porting to non-SQL implementations (e.g, moving a Django app to Google App ...
2
1
0
Should I invest a lot of time trying to figure out an ORM style implementation, or is it still common to just stick with standard SQL queries in python/pylons/sqlalchemy?
Transitioning from php to python/pylons/SQLAlchemy -- Are ORMs the standard now?
1.2
1
0
1,032
2,947,172
2010-06-01T03:49:00.000
1
0
0
0
python,sql,orm,sqlalchemy
2,947,191
2
false
0
0
If you have never use an ORM like SqlAlchemy before, I would suggest that you learn it - as long as you are learning the Python way. If nothing else, you will be better able to decide where/when to use it vs plain SQL. I don't think you should have to invest a lot of time on it. Documentation for SQLAlchemy is decent, ...
2
1
0
Should I invest a lot of time trying to figure out an ORM style implementation, or is it still common to just stick with standard SQL queries in python/pylons/sqlalchemy?
Transitioning from php to python/pylons/SQLAlchemy -- Are ORMs the standard now?
0.099668
1
0
1,032
2,947,211
2010-06-01T04:04:00.000
18
0
1
0
python,cuda,opencl
2,947,307
8
false
0
0
I believe that, with PyCUDA, your computational kernels will always have to be written as "CUDA C Code". PyCUDA takes charge of a lot of otherwise-tedious book-keeping, but does not build computational CUDA kernels from Python code.
1
36
0
I guess the question speaks for itself. I'm interested in doing some serious computations but am not a programmer by trade. I can string enough python together to get done what I want. But can I write a program in python and have the GPU execute it using CUDA? Or do I have to use some mix of python and C? The examples...
Can I program Nvidia's CUDA using only Python or do I have to learn C?
1
0
0
13,127
2,947,817
2010-06-01T06:58:00.000
2
0
0
0
python,function,button,ttk
11,642,028
2
false
0
1
Markus, yes, that's the right solution, but it is not because you can't use multi-argument commands in widget callouts. Consider, in your original code, ...command=loadModelTree(treeModel)... is an invocation of the method. Lambda allows you to abstract the command so you can have an arbitrary number of arguments witho...
2
1
0
I'm making a small script in python with ttk and I have a problem where a function runs where it shouldn't. The button code looks as follows: btReload = ttk.Button(treeBottomUI, text="Reload", width=17, command=loadModelTree(treeModel)) btReload.pack(side="left") and the function is as this: def loadModelTree(tree):...
Python ttk.Button -command, runs without button being pressed
0.197375
0
0
3,407
2,947,817
2010-06-01T06:58:00.000
1
0
0
0
python,function,button,ttk
2,947,926
2
false
0
1
Well, as I found the answer, I'll answer my own question. It appers that ttk.button commands does not support sending arguments to functions so the work around is to do as follows: btReload = ttk.Button(treeBottomUI, text="Reload", width=17, command=lambda i=treeModel: loadModelTree(i)) btReload.pack(side="left") Sim...
2
1
0
I'm making a small script in python with ttk and I have a problem where a function runs where it shouldn't. The button code looks as follows: btReload = ttk.Button(treeBottomUI, text="Reload", width=17, command=loadModelTree(treeModel)) btReload.pack(side="left") and the function is as this: def loadModelTree(tree):...
Python ttk.Button -command, runs without button being pressed
0.099668
0
0
3,407
2,948,455
2010-06-01T09:09:00.000
2
1
0
1
python
2,949,014
2
false
0
0
Just for your information: this is much self-descriptive to use multiplication when you set up timers, for example alarm(24 * 60 * 60) for 24 hours, instead of alarm(86400) for the same period. Hope this will help keep your code clean and easy-maintainable :)
1
1
0
Starting a Perl script with alarm(3600) will make the script abort if it is still running after one hour (3600 seconds). Assume I want to set an upper bound on the running time of a Python script, what is the easiest way to achieve that?
Equivalent of alarm(3600) in Python
0.197375
0
0
362
2,950,971
2010-06-01T15:18:00.000
2
0
1
1
python,linux,windows,py2exe
8,840,967
6
false
0
0
I have tested py2exe inside of wine, and it does function. You'll need to install python in wine for it to work, or if you only use the standard libarary, you can bundle py2exe with py2exe from the windows machine and then use it in wine. Just keep in mind you need the same version of the ms visual C libraries in win...
1
62
0
I have a Python script that I'd like to compile into a Windows executable. Now, py2exe works fine from Windows, but I'd like to be able to run this from Linux. I do have Windows on my development machine, but Linux is my primary dev platform and I'm getting kind of sick of rebooting into Windows just to create the .exe...
Packaging a Python script on Linux into a Windows executable
0.066568
0
0
79,618
2,951,530
2010-06-01T16:29:00.000
0
0
0
0
python,printing,tkinter
3,214,960
3
false
0
1
I think your butting up to the limits of Tkinter. If not for the widgets, another method is to draw the same image on a PIL image-draw object as the two have similar APIs. A hacky workaround would be to programatically take a screen grab of the window area you want using ImageGrab in PIL. wxPython is a decent alternati...
1
5
0
I am trying to print the contents of a python tkinter canvas. I have tried using the postscript method of canvas to create a postscript file, but I get a blank page. I know this is because I have embedded widgets, and these do not get rendered by the postscript method. Before I rewrite my program to create a more pri...
Printing python tkinter output
0
0
0
5,306
2,951,982
2010-06-01T17:43:00.000
3
0
1
0
python,python-3.x,python-2.x
2,952,037
3
true
0
1
Python 2 and 3 are not that different. If you have learned Python 2 well, it will be a matter of minutes to get acquainted with Python 3. The official recommendation says that you should use Python 2.6 (the current version) and try to be forward-compatible. Python 3 is currently not an option for large projects as virt...
2
5
0
I'm going to start on a long (~1-year) programming project in Python. I want to use wxPython for my GUI (supports 2.6), but I also want to use 3.1 for the rest of the project (to start using the 3.x syntax). Is there any way for me to design a project that mixes 2.x and 3.x modules? Or should I just bite the bullet and...
Can one Python project use both 2.x and 3.x code?
1.2
0
0
4,940
2,951,982
2010-06-01T17:43:00.000
2
0
1
0
python,python-3.x,python-2.x
3,026,057
3
false
0
1
mixing the ability to use wxPython (2.x) + with learning new syntax (3.x) Don't "mix". Write Python 2. Get it to work. Play with Python 3 separately. Don't "mix". When the various packages and modules are available in Python 3, use the 2to3 conversion to create Python 3. You'll find some small problems. Fix your ...
2
5
0
I'm going to start on a long (~1-year) programming project in Python. I want to use wxPython for my GUI (supports 2.6), but I also want to use 3.1 for the rest of the project (to start using the 3.x syntax). Is there any way for me to design a project that mixes 2.x and 3.x modules? Or should I just bite the bullet and...
Can one Python project use both 2.x and 3.x code?
0.132549
0
0
4,940
2,952,045
2010-06-01T17:56:00.000
12
0
1
0
python,import,module,standard-library,pythonpath
2,953,396
3
false
0
0
Don't. If you have accidentally chosen a standard library module name, change your module name to end the conflict.
1
16
0
I have a custom module in one of the directories in my PYTHONPATH with the same name as one of the standard library modules, so that when I import module_name, that module gets loaded. If I want to use the original standard library module, is there any way to force Python to import from the standard library rather than...
Force import module from Python standard library instead of PYTHONPATH default
1
0
0
7,037
2,952,443
2010-06-01T18:56:00.000
3
0
0
1
python,windows,process,kill,windows-error-reporting
2,952,969
2
true
0
0
Wouldn't it be easier to disable the error reporting feature?
2
3
0
I am looking for a means to kill a Windows exe program that, when being tested from a python script, crashes and presents a dialog to the user; as this program is invoked many times, and may crash repeatedly, this is not suitable. The problem dialog is the standard reporting of a Windows error: "Foo.exe has encountered...
Robustly killing Windows programs stuck reporting 'problems'
1.2
0
0
565
2,952,443
2010-06-01T18:56:00.000
0
0
0
1
python,windows,process,kill,windows-error-reporting
2,952,456
2
false
0
0
If you were to use CreateProcessEx or a WinAPI specific function, you might be able to call TerminateProcess or TerminateThread to forcibly end the process.
2
3
0
I am looking for a means to kill a Windows exe program that, when being tested from a python script, crashes and presents a dialog to the user; as this program is invoked many times, and may crash repeatedly, this is not suitable. The problem dialog is the standard reporting of a Windows error: "Foo.exe has encountered...
Robustly killing Windows programs stuck reporting 'problems'
0
0
0
565
2,952,957
2010-06-01T20:08:00.000
2
1
0
1
python,django,aptana
2,952,983
1
true
1
0
You should try adding --noreload to the runserver argument
1
2
0
I am developing a small testing website using Django 1.2 in Aptana Studio build 2.0.4.1268158907. I have a Django project that I test by running the command "runserver 8001" on my project. This command runs the project on a small server that comes with Django. However the problem arises that every time I run this com...
Aptana Studio is opening but not ever closing a python.exe process
1.2
0
0
509
2,953,357
2010-06-01T21:09:00.000
1
0
1
0
python,regex
2,953,374
2
false
0
0
The {} are odd here, they are not meta characters when used this way, what is there purpose because at the moment they are attempting to match a literal { and the match fails. Replace them with normal parenthesis and it will work
1
0
0
I'm trying to match rc-update -s output in python. m = re.match(r"^\s*(\w+)\s*\|{\s*(\w+)\s*}*$", " network | level1 level2 leveln ") but m is always None the hard part for me is getting the regex to match the n levels. I thought that using {}* would match the n levels, but as soon as I add the {} nothing matches. ...
regex help using repreated groups
0.099668
0
0
74
2,953,834
2010-06-01T22:29:00.000
-4
0
1
1
python,path,string-literals
60,505,487
6
false
0
0
Use PowerShell In Windows, you can use / in your path just like Linux or macOS in all places as long as you use PowerShell as your command-line interface. It comes pre-installed on Windows and it supports many Linux commands like ls command. If you use Windows Command Prompt (the one that appears when you type cmd in W...
1
230
0
What is the best way to represent a Windows directory, for example "C:\meshes\as"? I have been trying to modify a script but it never works because I can't seem to get the directory right, I assume because of the '\' acting as escape character?
Windows path in Python
-1
0
0
481,405
2,954,036
2010-06-01T23:25:00.000
6
0
0
0
php,python,django,drupal
2,956,035
7
true
1
0
I've built several sites on Drupal and Django, my conclusion is: if you need to create something similar to the standard drupal (or Ubercart) feature-set, you don't have much time for development, and you don't expect hight load pressure on a site - you should pick Drupal. But if you do need to create something more or...
5
5
0
I want to learn and use Drupal or Django for the following: dynamic web sites, medium database, multi-level users, paypal integration, content managment, speed (developing), security I like MVC, ORM and object-oriented prg. Which is better to jump into ? Which one is more mature, powerful, understandable, object-ori...
Django or Drupal, which one should I use that suits best my needs?
1.2
0
0
1,475
2,954,036
2010-06-01T23:25:00.000
2
0
0
0
php,python,django,drupal
2,954,057
7
false
1
0
Jump into what you like or what attracts you most after getting a little overview of the capabilities and constraints. I never worked with drupal, but I can recommend django.
5
5
0
I want to learn and use Drupal or Django for the following: dynamic web sites, medium database, multi-level users, paypal integration, content managment, speed (developing), security I like MVC, ORM and object-oriented prg. Which is better to jump into ? Which one is more mature, powerful, understandable, object-ori...
Django or Drupal, which one should I use that suits best my needs?
0.057081
0
0
1,475
2,954,036
2010-06-01T23:25:00.000
2
0
0
0
php,python,django,drupal
2,954,198
7
false
1
0
Consider your deployment. Pretty much every host will support Drupal. If you go with Django, you will need to select a host that supports fast_cgi or wsgi
5
5
0
I want to learn and use Drupal or Django for the following: dynamic web sites, medium database, multi-level users, paypal integration, content managment, speed (developing), security I like MVC, ORM and object-oriented prg. Which is better to jump into ? Which one is more mature, powerful, understandable, object-ori...
Django or Drupal, which one should I use that suits best my needs?
0.057081
0
0
1,475
2,954,036
2010-06-01T23:25:00.000
3
0
0
0
php,python,django,drupal
2,955,877
7
false
1
0
Drupal and Django doesn't make for a good comparison, as they are quite different. If all you need is a simple website with a CMS and Paypal, I would go for Drupal. Drupal's strength compared Django is it's many modules (modular system), which most of the time can get you where you want. Drupal is also extremely flexib...
5
5
0
I want to learn and use Drupal or Django for the following: dynamic web sites, medium database, multi-level users, paypal integration, content managment, speed (developing), security I like MVC, ORM and object-oriented prg. Which is better to jump into ? Which one is more mature, powerful, understandable, object-ori...
Django or Drupal, which one should I use that suits best my needs?
0.085505
0
0
1,475
2,954,036
2010-06-01T23:25:00.000
0
0
0
0
php,python,django,drupal
2,956,336
7
false
1
0
I've been developing with Django for more than 2 years and have built a couple of Drupal sites in the meantime (per client's specific request to use Drupal). My conclusions are the following: Even for a smaller site I would have done it quicker building it from scratch with django (or maybe even PHP) for a simple reaso...
5
5
0
I want to learn and use Drupal or Django for the following: dynamic web sites, medium database, multi-level users, paypal integration, content managment, speed (developing), security I like MVC, ORM and object-oriented prg. Which is better to jump into ? Which one is more mature, powerful, understandable, object-ori...
Django or Drupal, which one should I use that suits best my needs?
0
0
0
1,475
2,954,412
2010-06-02T01:16:00.000
1
0
0
0
python,c,gtk
2,954,934
2
false
0
1
I believe the "show" signal (inherited from Widget) will do this.
1
0
0
Is there a signal that is emitted when a window/dialog is presented in GTK+? Example: when issuing this command to the GTK widget dialog: dialog.present() is there a resulting signal? Or is there any signal that denotes the "showing" of a window/dialog?
gtk+ signal emitted when window/dialog is "presented"
0.099668
0
0
317
2,954,696
2010-06-02T02:50:00.000
4
1
0
0
python,compression
2,954,788
2
true
0
0
What about using ctypes to call directly into fastlz.so (or .dll as the case may be)? It seems to have only 3 entry points, so wrapping them in ctypes should not be hard. Yes, SWIG or a custom C API wrapper should be almost as trivial, but ctypes lets you start experimenting right now even if you don't have a compile...
1
1
0
Looking to use FastLZ in Python, or something similar. Tried Google and didn't find anything. Wondering if there is another algorithm with similar performance available in Python?
Is there a python wrapper for a FastLZ implementation
1.2
0
0
565
2,956,904
2010-06-02T10:45:00.000
1
0
1
0
python,dojo
2,959,051
1
true
1
0
My Python team has been using Dojo on the client-side for a few years now, and we settled on CherryPy as our server-side about a year ago, and are pretty pleased with it. It's fairly minimal as web servers go, and enables us to customize the server behavior as needed. Initially we looked at Django and Turbogears as wel...
1
0
0
I've coming to be more interested in Dojo Toolkit which I find great, but are many Dojo users also using Python also? And why is it like that? I heard of Cherry Py (and why not Django?).
Are many Dojo Toolkit users also using Python?
1.2
0
0
516
2,957,588
2010-06-02T12:21:00.000
1
1
1
1
python
2,957,649
3
true
0
0
Many ways - In the case of windows, even a simple looping batch file would probably do - just have it start the script in a loop (whenever it crashes it would return to the shell and be restarted).
1
1
0
I have a python script and am wondering is there any way that I can ensure that the script run's continuously on a remote computer? Like for example, if the script crashes for whatever reason, is there a way to start it up automatically instead of having to remote desktop. Are there any other factors I have to be aware...
running a python script on a remote computer
1.2
0
0
1,086
2,958,246
2010-06-02T13:42:00.000
0
0
1
1
python,batch-file
2,958,943
5
false
0
0
I'd simply create a lockfile in the local filesystem and exit if this exists already.
2
0
0
I am wondering, is there a way to change the name of a script so that it is not called "python.exe" in the tasklist. The reason I am asking is that I am trying to make a batch file that run's a python script. I want the batch file to check to see if the script is already running. if the script is already running then t...
Python script names in tasklist
0
0
0
872
2,958,246
2010-06-02T13:42:00.000
0
0
1
1
python,batch-file
2,958,673
5
false
0
0
This library does not work on Windows, and shouldn't be used in production code. Manipulation the argv array is a rather dirty hack. Generally I'd not try to identify processes by scanning the process table. This is not really reliable, as process names aren't guaranteed to be unique. Instead I'd spawn a simple serv...
2
0
0
I am wondering, is there a way to change the name of a script so that it is not called "python.exe" in the tasklist. The reason I am asking is that I am trying to make a batch file that run's a python script. I want the batch file to check to see if the script is already running. if the script is already running then t...
Python script names in tasklist
0
0
0
872
2,959,503
2010-06-02T16:13:00.000
5
0
0
0
python,django,persistence
2,959,612
3
false
1
0
Why not still keep it in a database? Your remote REST store is all well and funky, but if you've got local data, there's nothing (unless there's spec saying so) to stop you storing some stuff in a local db. Doesn't have to be anything v glamorous - could be sqlite, or you could have some fun with redis, etc.
1
0
0
I'm building a website that doesn't require a database because a REST API "is the database". (Except you don't want to be putting site-specific things in there, since the API is used by mostly mobile clients) However there's a few things that normally would be put in a database, for example the "jobs" page. You have ma...
Best practice: How to persist simple data without a database in django?
0.321513
0
0
1,910
2,960,339
2010-06-02T18:14:00.000
18
0
1
1
python,linux,centos,pyodbc
51,455,094
19
false
0
0
Struggled with the same issue After running: sudo apt-get install unixodbc-dev I was able to pip install pyodbc
2
110
0
I am running Linux (2.6.18-164.15.1.el5.centos.plus) and trying to install pyodbc. I am doing pip install pyodbc and get a very long list of errors, which end in error: command 'gcc' failed with exit status 1 I looked in /root/.pip/pip.log and saw the following: InstallationError: Command /usr/local/bin/python -c...
Unable to install pyodbc on Linux
1
0
0
144,475
2,960,339
2010-06-02T18:14:00.000
4
0
1
1
python,linux,centos,pyodbc
50,872,039
19
false
0
0
A easy way to install pyodbc is by using 'conda'. As conda automatically installs required dependencies including unixodbc. conda --ugrade all (optional) then conda install pyodbc it will install following packages: libgfortran-ng: 7.2.0-hdf63c60_3 defaults mkl: 2018.0.3-1 ...
2
110
0
I am running Linux (2.6.18-164.15.1.el5.centos.plus) and trying to install pyodbc. I am doing pip install pyodbc and get a very long list of errors, which end in error: command 'gcc' failed with exit status 1 I looked in /root/.pip/pip.log and saw the following: InstallationError: Command /usr/local/bin/python -c...
Unable to install pyodbc on Linux
0.04208
0
0
144,475
2,960,481
2010-06-02T18:35:00.000
0
0
0
0
python,mysql
2,960,589
2
true
0
0
Use a SELECT... WHERE date <= NOW() && date >= ( NOW() - 90000 ) (90,000 is 25 hours, giving you a little leeway with the insert time), and then take the difference between the rows in python.
1
0
0
I have a table formatted similar to this: Date | ID | Value | Difference I need to get the difference between a record's value column, and the previous record's value column based off of the date. I.E 2 days ago | cow | 1 | Null Yesterday | cow | 2 | Null Today | cow | 3 | Null Yesterdays difference would be 1, and tod...
Get the previous date in Mysql
1.2
1
0
530
2,960,847
2010-06-02T19:15:00.000
2
0
1
0
python
2,961,280
1
false
0
0
There's a PyUnicode_AS_UNICODE macro. BTW: PyString_AS_STRING only works for string objects, returning a C string.
1
5
0
In python 2.x versions there is a function named as PyString_AS_STRING to convert a pyobject pointer to a string or char pointer. How can we achieve the same functionality in python 3?
Replacement for PyString_AS_STRING in python 3.x
0.379949
0
0
1,590
2,960,855
2010-06-02T19:16:00.000
0
0
1
0
python
2,960,944
4
false
0
0
Add all keys and associated values from both sets of data to a single dictionary. Get the items of the dictionary ans sort them. print out the answer. k1=[7, 2, 3, 5] v1=[10,11,12,26] k2=[0, 4] v2=[20, 33] d=dict(zip(k1,v1)) d.update(zip(k2,v2)) answer=d.items() answer.sort() keys=[k for (k,v) in answer] values=[...
1
1
1
I have the following 4 arrays ( grouped in 2 groups ) that I would like to merge in ascending order by the keys array. I can use also dictionaries as structure if it is easier. Has python any command or something to make this quickly possible? Regards MN # group 1 [7, 2, 3, 5] #keys [10,11,12,26] #values [0, 4...
merging in python
0
0
0
125
2,960,864
2010-06-02T19:17:00.000
0
0
1
0
python,save
50,144,944
7
false
0
0
You can save it as a text file or a CVS file. People use Spyder for example to save variables but it has a known issue: for specific data types it fails to import down in the road.
1
115
0
I want to save all the variables in my current python environment. It seems one option is to use the 'pickle' module. However, I don't want to do this for 2 reasons: I have to call pickle.dump() for each variable When I want to retrieve the variables, I must remember the order in which I saved the variables, and then ...
How to save all the variables in the current python session?
0
0
0
115,543
2,961,317
2010-06-02T20:22:00.000
39
0
0
0
python,django,post
2,961,413
1
true
1
0
If your request is post: request.method == 'POST' but the requested url contains a query string. e.g: /your-url?param1=value-one you can still take POST parameters through: request.POST.get("my-field", None) and query string parameters through: request.GET.get("param1") althrough, you pick up all parameters at on...
1
14
0
Please post example code when request.POST contain query string in django, because i think my django version is bugged. EDIT: You simple can't, query string is always in GET, and this was my problem.
Example when request.POST contain query string in django
1.2
0
0
21,210
2,961,402
2010-06-02T20:36:00.000
1
0
0
0
php,python,django
2,961,525
4
false
1
0
No. You can only do a LOT better. Awesome, popular. Supported by best hosters like Mediatemple. No. You can just change 'mysql' to 'postgresql' or 'sqlite' in your settings.py. NO! Python would never give you the right to mix up everything in one file and make the shittest shit in the world. Templates, static server. ...
2
4
0
Here's my background: Decent experience with PHP/MySql. Beginner's experience with OOP Why I want to learn Python Django? I gave in, based on many searches on SO and reading over some of the answers, Python is a great, clean, and structured language to learn. And with the framework Django, it's easier to write codes ...
How to transition from PHP to Python Django?
0.049958
0
0
3,852
2,961,402
2010-06-02T20:36:00.000
6
0
0
0
php,python,django
2,961,490
4
true
1
0
Can i do everything in Django as in PHP? Always Is Django a "big" hit in web development as PHP? Only time will tell. With PHP, PHP and Mysql are VERY closely related, is there a close relation between Django and Mysql? Django supports several RDBMS interfaces. MySQL is popular, so is SQLite and Postgres. In PHP...
2
4
0
Here's my background: Decent experience with PHP/MySql. Beginner's experience with OOP Why I want to learn Python Django? I gave in, based on many searches on SO and reading over some of the answers, Python is a great, clean, and structured language to learn. And with the framework Django, it's easier to write codes ...
How to transition from PHP to Python Django?
1.2
0
0
3,852
2,961,983
2010-06-02T22:08:00.000
0
0
1
0
python
45,991,093
7
false
0
0
The + operator concatenates lists and the starting value is [] an empty list.
1
35
0
A multidimensional list like l=[[1,2],[3,4]] could be converted to a 1D one by doing sum(l,[]). Can anybody please explain how that happens? A responder said that this technique could only be used to "flatten" a 2D list -- that it wouldn't work for higher multidimensional lists. But it does, if repeated. For example i...
Convert multi-dimensional list to a 1D list in Python
0
0
0
82,942
2,962,194
2010-06-02T22:54:00.000
3
0
0
0
python,user-interface,wxpython,tkinter
2,962,443
5
false
0
1
The most beautiful one that I can suggest is PyQt (almost native), otherwise a good idea would be using directly IronPython that is native .net code. Anyway nothing beats tkinter for multi-platformness and packaging-friendliness.
4
3
0
I need to create a simple windows based GUI for a desktop application that will be downloaded by end users. The application is written in python and will be packaged as an installer or executable. The functionality I need is simple - selecting from various lists, showing progress bars, etc. No animations, sprites, or ...
Python: Attractive, clean, packagable windows GUI library
0.119427
0
0
4,853
2,962,194
2010-06-02T22:54:00.000
1
0
0
0
python,user-interface,wxpython,tkinter
2,962,216
5
false
0
1
From using both wxPython and TKinter, I'd say wxPython looks nicer and is easy to learn. Although you said you are planning on using the program for Windows, it's worth mentioning that I've had problems with TKinter on Mac not working correctly.
4
3
0
I need to create a simple windows based GUI for a desktop application that will be downloaded by end users. The application is written in python and will be packaged as an installer or executable. The functionality I need is simple - selecting from various lists, showing progress bars, etc. No animations, sprites, or ...
Python: Attractive, clean, packagable windows GUI library
0.039979
0
0
4,853
2,962,194
2010-06-02T22:54:00.000
1
0
0
0
python,user-interface,wxpython,tkinter
2,962,200
5
false
0
1
I've used wxPython in the past (For Mac/Windows deployments). It has worked good. And it looks nicer than Tk :)
4
3
0
I need to create a simple windows based GUI for a desktop application that will be downloaded by end users. The application is written in python and will be packaged as an installer or executable. The functionality I need is simple - selecting from various lists, showing progress bars, etc. No animations, sprites, or ...
Python: Attractive, clean, packagable windows GUI library
0.039979
0
0
4,853
2,962,194
2010-06-02T22:54:00.000
3
0
0
0
python,user-interface,wxpython,tkinter
2,962,228
5
true
0
1
tkinter's major advantage (IMHO!) is that it comes with Python (at least on Windows). It looks ugly, and there's no progress bar or something like that (at least not builtin). Being a thin wrapper around Tk, its API doesn't feel very elegant or intuitive. However, there are quite a few good Tkinter resources on the web...
4
3
0
I need to create a simple windows based GUI for a desktop application that will be downloaded by end users. The application is written in python and will be packaged as an installer or executable. The functionality I need is simple - selecting from various lists, showing progress bars, etc. No animations, sprites, or ...
Python: Attractive, clean, packagable windows GUI library
1.2
0
0
4,853
2,962,571
2010-06-03T00:28:00.000
13
0
1
0
python,graphics,pyopengl
2,962,599
2
true
0
1
With the caveat that I have done very little OpenGL programming myself, I believe that for the purposes of learning, PyOpenGL is a good choice. The main reason is that PyOpenGL, like most other OpenGL wrappers, is just that: a thin wrapper around the OpenGL API. One large benefit of PyOpenGL is that while in C you ha...
2
9
0
I want to start learning OpenGL but I don't really want to have to learn another language to do it. I already am pretty proficient in python and enjoy the language. I just want to know how close it is to the regular api? Will I be able to pretty easily follow tutorials and books without too much trouble? I know C++ giv...
Is PyOpenGL a good place to start learning opengl programming?
1.2
0
0
3,573
2,962,571
2010-06-03T00:28:00.000
0
0
1
0
python,graphics,pyopengl
2,963,034
2
false
0
1
PyOpenGL I don't think it is a good choice. In my opinon in C/C++ it is easier to play around around with your OpenGL code - start with simple app, then add shader, then add some geometry functions, make a texture/geometry generator, build scene via CSG, etc. You know - to have fun, play around with code, experiment a...
2
9
0
I want to start learning OpenGL but I don't really want to have to learn another language to do it. I already am pretty proficient in python and enjoy the language. I just want to know how close it is to the regular api? Will I be able to pretty easily follow tutorials and books without too much trouble? I know C++ giv...
Is PyOpenGL a good place to start learning opengl programming?
0
0
0
3,573
2,962,597
2010-06-03T00:33:00.000
1
0
0
1
python,windows,windows-services
2,962,625
1
true
0
0
Sorted, I had the service run a python script with win32api.GetUserName() as it's output.
1
1
0
Can python retrieve the name of the user that owns a windows service? I've had a fiddle with win32serviceutil but to no avail, nor can I find much documentation on it beyond starting and stopping services. Thanks!
Python retrieving windows service information
1.2
0
0
128
2,963,615
2010-06-03T05:59:00.000
9
0
1
0
java,python,ruby
2,965,919
3
true
1
0
This is not a question about Ruby, Python or Java, but more about a specific implementation of Ruby, Python or Java. There are Java implementations with extremely efficient threading implementations and there are Java implementations with extremely bad threading implementations. And the same is true for Ruby and Python...
2
2
0
i wonder if the multi threading in python/ruby is equivalent to the one in java? by that i mean, is it as efficient? cause if you want to create a chat application that use comet technology i know that you have to use multi threading. does this mean that i can use python or ruby for that or is it better with java? than...
multi threading python/ruby vs java?
1.2
0
0
5,035
2,963,615
2010-06-03T05:59:00.000
1
0
1
0
java,python,ruby
2,966,837
3
false
1
0
philosodad is not wrong to point out the constraint that the GIL presents. I won't speak for Ruby, but I am sure that it's safe to assume that when you refer to Python that you are in fact referring to the canonical cPython implementation. In the case of cPython, the GIL matters most if you want to parallelize compu...
2
2
0
i wonder if the multi threading in python/ruby is equivalent to the one in java? by that i mean, is it as efficient? cause if you want to create a chat application that use comet technology i know that you have to use multi threading. does this mean that i can use python or ruby for that or is it better with java? than...
multi threading python/ruby vs java?
0.066568
0
0
5,035
2,964,108
2010-06-03T07:47:00.000
0
0
0
0
python,button,wxpython,toolbar,position
3,172,009
1
true
0
1
If you add the quit button last, it will be on the right side.
1
0
0
I'm making a toolbar using wxpython and I want to put the Quit button on the right side of it, I don't want to put them sequencially. Is it possible to define this position? Thanks in advance!
Is it possible to put a toolbar button on the right side of it using wxpython?
1.2
0
0
292
2,964,910
2010-06-03T10:08:00.000
6
0
1
0
python,ironpython
2,964,931
3
true
0
0
Yes, Python and IronPython are completely different applications that happen to implement (almost) the same language.
3
4
0
I am a total newbie in the Python world. I want to start to experiment with Python and IronPython and compare the results. Is it possible to install Python and IronPython on the same machine with interfering each other or is it better to do this in the virtual machine. Thx in advance.
Python and IronPython on same machine?
1.2
0
0
562
2,964,910
2010-06-03T10:08:00.000
1
0
1
0
python,ironpython
2,964,929
3
false
0
0
Should be no problem, they have different executable filenames also.
3
4
0
I am a total newbie in the Python world. I want to start to experiment with Python and IronPython and compare the results. Is it possible to install Python and IronPython on the same machine with interfering each other or is it better to do this in the virtual machine. Thx in advance.
Python and IronPython on same machine?
0.066568
0
0
562
2,964,910
2010-06-03T10:08:00.000
0
0
1
0
python,ironpython
2,966,944
3
false
0
0
Sure, you could even install different versions of cPython interpreter (2.5, 2.6, 3.0, etc).
3
4
0
I am a total newbie in the Python world. I want to start to experiment with Python and IronPython and compare the results. Is it possible to install Python and IronPython on the same machine with interfering each other or is it better to do this in the virtual machine. Thx in advance.
Python and IronPython on same machine?
0
0
0
562
2,966,618
2010-06-03T13:57:00.000
1
1
0
1
c++,python,code-generation
2,966,999
8
false
0
0
A few years ago I worked on a project to simplify interprocess shared memory management for large scale simulation systems. We used a related approach where the layout of data in shared memory was defined in XML files and a code generator, written in python, read the XML and spit out a set of header files defining stru...
1
12
0
Can anyone point me to some documentation on how to write scripts in Python (or Perl or any other Linux friendly script language) that generate C++ code from XML or py files from the command line. I'd like to be able to write up some xml files and then run a shell command that reads these files and generates .h files ...
C++ code generation with Python
0.024995
0
0
23,299
2,967,194
2010-06-03T15:05:00.000
6
0
1
1
python,linux,file-io,file-permissions
17,250,611
17
false
0
0
I think it's r+, not rw. I'm just a starter, and that's what I've seen in the documentation.
4
841
0
What is the best way to open a file as read/write if it exists, or if it does not, then create it and open it as read/write? From what I read, file = open('myfile.dat', 'rw') should do this, right? It is not working for me (Python 2.6.2) and I'm wondering if it is a version problem, or not supposed to work like that or...
open() in Python does not create a file if it doesn't exist
1
0
0
1,119,129
2,967,194
2010-06-03T15:05:00.000
31
0
1
1
python,linux,file-io,file-permissions
2,967,244
17
false
0
0
Change "rw" to "w+" Or use 'a+' for appending (not erasing existing content)
4
841
0
What is the best way to open a file as read/write if it exists, or if it does not, then create it and open it as read/write? From what I read, file = open('myfile.dat', 'rw') should do this, right? It is not working for me (Python 2.6.2) and I'm wondering if it is a version problem, or not supposed to work like that or...
open() in Python does not create a file if it doesn't exist
1
0
0
1,119,129
2,967,194
2010-06-03T15:05:00.000
6
0
1
1
python,linux,file-io,file-permissions
2,967,395
17
false
0
0
What do you want to do with file? Only writing to it or both read and write? 'w', 'a' will allow write and will create the file if it doesn't exist. If you need to read from a file, the file has to be exist before open it. You can test its existence before opening it or use a try/except.
4
841
0
What is the best way to open a file as read/write if it exists, or if it does not, then create it and open it as read/write? From what I read, file = open('myfile.dat', 'rw') should do this, right? It is not working for me (Python 2.6.2) and I'm wondering if it is a version problem, or not supposed to work like that or...
open() in Python does not create a file if it doesn't exist
1
0
0
1,119,129
2,967,194
2010-06-03T15:05:00.000
4
0
1
1
python,linux,file-io,file-permissions
33,069,611
17
false
0
0
Put w+ for writing the file, truncating if it exist, r+ to read the file, creating one if it don't exist but not writing (and returning null) or a+ for creating a new file or appending to a existing one.
4
841
0
What is the best way to open a file as read/write if it exists, or if it does not, then create it and open it as read/write? From what I read, file = open('myfile.dat', 'rw') should do this, right? It is not working for me (Python 2.6.2) and I'm wondering if it is a version problem, or not supposed to work like that or...
open() in Python does not create a file if it doesn't exist
0.047024
0
0
1,119,129
2,968,127
2010-06-03T17:00:00.000
0
1
0
0
python,ldap
2,968,258
2
false
0
0
Your best bet would be to get authorization to access that field. You are circumventing the security of the database otherwise.
1
0
0
I'm interested in reproducing a particular python script. I have a friend who was accessing an ldap database, without authentication. There was a particular field of interest, we'll call it nin (an integer) for reference, and this field wasn't accessible without proper authentication. However, my friend managed to acce...
Binary search of unaccesible data field in ldap from python
0
0
0
231
2,968,172
2010-06-03T17:06:00.000
1
0
0
0
c++,python,serialization
2,968,306
7
false
0
0
I would propose simply to use c arrays(via ctypes on the python side) and simply pull/push the raw data through an socket
2
3
1
I two programs running, one in Python and one in C++, and I need to share a two-dimensional array (just of decimal numbers) between them. I am currently looking into serialization, but pickle is python-specific, unfortunately. What is the best way to do this? Thanks Edit: It is likely that the array will only have 50 e...
How to share an array in Python with a C++ Program?
0.028564
0
0
2,433
2,968,172
2010-06-03T17:06:00.000
1
0
0
0
c++,python,serialization
2,968,375
7
false
0
0
Serialization is one problem while IPC is another. Do you have the IPC portion figured out? (pipes, sockets, mmap, etc?) On to serialization - if you're concerned about performance more than robustness (being able to plug more modules into this architecture) and security, then you should take a look at the struct modu...
2
3
1
I two programs running, one in Python and one in C++, and I need to share a two-dimensional array (just of decimal numbers) between them. I am currently looking into serialization, but pickle is python-specific, unfortunately. What is the best way to do this? Thanks Edit: It is likely that the array will only have 50 e...
How to share an array in Python with a C++ Program?
0.028564
0
0
2,433
2,968,381
2010-06-03T17:35:00.000
1
1
0
0
java,php,python,jython
2,968,495
5
false
1
0
Well: Java Server Pages (JSP) are "equivalent" to PHP, but using java classes. It's "equivalent" in that it's HTML with embedded java code, but not at all compatible to PHP syntax.
2
4
0
i wonder if there is a php equivalent to jython so you can use java classes with php? thanks
php equivalent to jython?
0.039979
0
0
494
2,968,381
2010-06-03T17:35:00.000
1
1
0
0
java,php,python,jython
2,968,418
5
false
1
0
I just googled php jvm and got a bunch of hits. Never tried any of them.
2
4
0
i wonder if there is a php equivalent to jython so you can use java classes with php? thanks
php equivalent to jython?
0.039979
0
0
494
2,968,809
2010-06-03T18:40:00.000
0
1
1
0
python,distribution,egg
3,063,352
2
true
0
0
What I ended up doing was: Ran PYTHONPATH=fullPathOfMyEgg in command line Was then able to do import someModuleInMyEgg from my Python code I'm not sure if this is the most standard or accepted way to do it, but it worked. If anyone has any comments or other methods, please feel free to add...
1
6
0
I've finally figured out how to create a Python egg and gotten it to work. Now... what do I do with it? How do I use it? How do I ensure that everything was correctly included? (Simple steps please... not just redirection to another site. I've googled, but it's confusing me, and I was hoping someone could explain it in...
I created a Python egg; now what?
1.2
0
0
612
2,969,593
2010-06-03T20:40:00.000
5
0
0
0
python,random,n-dimensional
2,969,618
4
true
0
0
Numpy has multidimensional equivalents to the functions in the random module The function you're looking for is numpy.random.normal
2
2
1
I'm trying to generate random numbers from a gaussian distribution. Python has the very useful random.gauss() method, but this is only a one-dimensional random variable. How could I programmatically generate random numbers from this distribution in n-dimensions? For example, in two dimensions, the return value of this ...
Generate n-dimensional random numbers in Python
1.2
0
0
5,620
2,969,593
2010-06-03T20:40:00.000
1
0
0
0
python,random,n-dimensional
2,969,634
4
false
0
0
You need to properly decompose your multi-dimensional distribution into a composition of one-dimensional distributions. For example, if you want a point at a Gaussian-distributed distance from a given center and a uniformly-distributed angle around it, you'll get the polar coordinates for the delta with a Gaussian rho...
2
2
1
I'm trying to generate random numbers from a gaussian distribution. Python has the very useful random.gauss() method, but this is only a one-dimensional random variable. How could I programmatically generate random numbers from this distribution in n-dimensions? For example, in two dimensions, the return value of this ...
Generate n-dimensional random numbers in Python
0.049958
0
0
5,620
2,969,867
2010-06-03T21:19:00.000
117
0
0
0
python,matplotlib
29,524,883
5
false
0
0
If you don't want to change the spacing globally (by editing your rcParams), and want a cleaner approach, try this: ax.tick_params(axis='both', which='major', pad=15) or for just x axis ax.tick_params(axis='x', which='major', pad=15) or the y axis ax.tick_params(axis='y', which='major', pad=15)
1
86
1
I've increased the font of my ticklabels successfully, but now they're too close to the axis. I'd like to add a little breathing room between the ticklabels and the axis.
How do I add space between the ticklabels and the axes in matplotlib
1
0
0
89,545
2,970,207
2010-06-03T22:20:00.000
2
0
0
0
python,string,image,opencv,byte
2,980,849
2
false
0
1
I actually solved this problem and forgot to post the solution. Here's how I did it, though it may not be entirely robust: I analyzed the headers coming from the MJPEG of the network camera I was doing this to, then I just read from the stream 1 byte at a time, and, when I detected that the header of the next image was...
1
3
0
I am streaming some data down from a webcam. When I get all of the bytes for a full image (in a string called byteString) I want to display the image using OpenCV. Done fast enough, this will "stream" video from the webcam to an OpenCV window. Here's what I've done to set up the window: cvNamedWindow('name of window', ...
from string of bytes to OpenCV's IplImage in Python?
0.197375
0
0
1,712
2,971,094
2010-06-04T02:15:00.000
2
0
0
0
python,netbeans
2,971,227
4
false
0
1
I haven't seen a built-in GUI builder for CPython. You could use Jython + Matisse (the built-in Netbeans Java-based GUI builder).
1
5
0
Is NetBeans recommended for developing a GUI for a Python app? Does it have a form/screen builder for Python apps, like Dabo?
Using NetBeans for Python GUI development
0.099668
0
0
11,421
2,971,198
2010-06-04T02:49:00.000
7
0
0
0
python,mysql,database,django,date
3,027,410
5
true
1
0
First, thanks for all your answers. None of them, as is, was a good solution for my problem, but, for your defense, I should add that I didn't give all the requirements. But each one help me think about my problem and some of your ideas are part of my final solution. So my final solution, on the DB side, is to use a va...
1
8
0
In one of my Django projects that use MySQL as the database, I need to have a date fields that accept also "partial" dates like only year (YYYY) and year and month (YYYY-MM) plus normal date (YYYY-MM-DD). The date field in MySQL can deal with that by accepting 00 for the month and the day. So 2010-00-00 is valid in MyS...
How to deal with "partial" dates (2010-00-00) from MySQL in Django?
1.2
1
0
4,080
2,971,309
2010-06-04T03:25:00.000
0
0
0
0
python,django,netbeans,ide
2,971,775
3
false
1
0
Netbeans doesn't have a django plugin that I know of. Eclipse's pydev plugin is decent, I typically use any ol' editor and bpython. I've heard great things about wingware and intellij's new python ide is pretty good.
1
10
0
I use netbeans for all of my Linux development (C/C++, Php, Python, Symfony). I am now learning django, and wondered if I could use netbeans as the IDE. I cant seem to find a Django plugin for netbeans. Is there one?. If no when is one planned? Worst case scenario, I'll have to use another IDE (I really dont want to le...
django and netbeans?
0
0
0
19,247
2,971,381
2010-06-04T03:46:00.000
3
0
1
0
python
2,975,327
4
false
0
0
is there a better way of doing this? Yes I was thinking of launching multiple threads since the I/O bound operations Don't. At the OS level, all the threads in a process are sharing a limited set of I/O resources. If you want real speed, spawn as many heavyweight OS processes as your platform will tolerate. The O...
1
10
0
I have a situation where I'm downloading a lot of files. Right now everything runs on one main Python thread, and downloads as many as 3000 files every few minutes. The problem is that the time it takes to do this is too long. I realize Python has no true multi-threading, but is there a better way of doing this? I was ...
How to maximize performance in Python when doing many I/O bound operations?
0.148885
0
0
5,176
2,972,696
2010-06-04T08:58:00.000
0
0
1
0
python,eclipse,eclipse-plugin,pydev
3,211,758
2
true
0
1
I had no luck with this. Eventually I had to download it through Eclipse download manager and it worked. I guess they have some issues with the automatic plugin functionality.
1
2
0
I have downloaded the zip archive (my only option) and installed it as suggested by unzipping into the dropin folder. When I try to start a project the problem occurs: "Plug-in org.python.pydev was unable to load class org.python.pydev.ui.wizard.project.PythonProjectWizard" I've googled and the only suggestion is to re...
PyDev problem staring project
1.2
0
0
3,435
2,973,591
2010-06-04T11:21:00.000
0
0
0
0
python,ajax,django,comet,chat
2,973,756
2
false
1
0
ajax is the best here what you will need: 1) server view that will return recent messages 2) client-side caller by timer (I prefer jQuery and its timers plugin) and success handler, that will populate the chat window
1
2
0
I need to create a chat similar to facebook chat. I am thinking to create a simple application Chat and then using ajax polling ( to send request every 2-3 seconds ). Is this a good approach ?
Django chat with ajax polling
0
0
0
3,357
2,974,781
2010-06-04T13:59:00.000
4
0
1
0
python,sockets,twisted
2,974,890
4
false
0
0
Twisted is a concurrency framework. It allows you to juggle multiple tasks in one application without using threads/processes. It does this using an event driven asynchronous system and is especially good with networking applications. Asynchronous code generally tends to be a little 'different' from normal stuff since ...
1
7
0
I keep hearing all this hype about Twisted for python, but i just find it plain confusing. What do you think is more simple to use? Simple sockets or implementing twisted ?
Is twisted any good?
0.197375
0
0
5,395
2,975,473
2010-06-04T15:19:00.000
2
0
1
0
python,import,cross-platform
2,975,495
1
true
0
0
You use import to include the function in other programs. Just say import mymodule where the code is located in file mymodule.py. Then say mymodule.fib to use the function. To answer your second question: The syntax print "any string" is acceptable in Python 2, but is no longer allowed in Python 3.
1
0
0
i've a small user defined function in python, say fib(n), how do i use that in other programs or modules? def fib(n): should i use import or is there any other feature? Also i'm learning python in eclipse IDE, it wont support print "any string" but i'm forced to use like, print("string") in python manual online, it...
include udf in python?
1.2
0
0
136
2,975,624
2010-06-04T15:39:00.000
37
1
0
1
python,service,cron
2,975,852
12
false
0
0
If you've already started the process, and don't want to kill it and restart under nohup, you can send it to the background, then disown it. Ctrl+Z (suspend the process) bg (restart the process in the background disown %1 (assuming this is job #1, use jobs to determine)
2
145
0
I have Python script bgservice.py and I want it to run all the time, because it is part of the web service I build. How can I make it run continuously even after I logout SSH?
How to run a script in the background even after I logout SSH?
1
0
0
252,941
2,975,624
2010-06-04T15:39:00.000
7
1
0
1
python,service,cron
69,754,988
12
false
0
0
Alternate answer: tmux ssh into the remote machine type tmux into cmd start the process you want inside the tmux e.g. python3 main.py leaving the tmux session by Ctrl+b then d It is now safe to exit the remote machine. When you come back use tmux attach to re-enter tmux session. If you want to start multiple sessions...
2
145
0
I have Python script bgservice.py and I want it to run all the time, because it is part of the web service I build. How can I make it run continuously even after I logout SSH?
How to run a script in the background even after I logout SSH?
1
0
0
252,941
2,976,446
2010-06-04T17:36:00.000
6
0
0
0
python,logitech,g15
2,976,466
2
false
0
1
I believe the G15 comes with an SDK. You could use that along with the ctypes module to call into the supplied DLLs. Otherwise, I imagine you'd have to use something like Swig or Boost.Python to make a Python module for the G15 from the SDK.
1
3
0
I have a Logitech G15 keyboard. It has a screen. Can i program this? I googled it but the one site i found didn't work.. It seems like it is possible, but i cannot grasp how. Thanks! This site is truly great.
Is Python programming for Logitech G15 possible?
1
0
0
977
2,976,803
2010-06-04T18:37:00.000
2
0
0
0
.net,winforms,ironpython,ironpython-studio
2,978,656
1
true
0
1
There's no fix for this and there's likely not to be one because IronPython Studio isn't supported anymore. DataGridView.BeginInit is implemented explicitly and IronPython Studio is based upon IronPython 1.1. You might be able to work around with it by changing that to "ISupportInitialize.BeginInit(self._DataGridView...
1
1
0
By just adding a datagridview in IronPython Studio it triggers a "DataGridView' object has no attribute 'BeginInit'". Is there a fix for this? The errors are gone if the lines self._DataGridView1.BeginInit() and self._DataGridView1.EndInit() are deleted, but that's not what it should be done to fix that
Adding a DataGridView in IronPython Studio Winforms gets a "'DataGridView' object has no attribute 'BeginInit'"
1.2
0
0
773
2,977,779
2010-06-04T21:01:00.000
1
0
0
0
python,xml
2,977,799
2
false
0
0
The safest way to add nodes to an XML document is to load it into a DOM, add the nodes programmatically and write it out again. There are several Python XML libraries. I have used minidom, but I have no reason to recommend it specifically over the others.
1
4
0
I wonder if it is better add an element by opening file, search 'good place' and add string which contains xml code. Or use some library... i have no idea. I know how can i get nodes and properties from xml through for example lxml but what's the simpliest and the best way to add?
add xml node to xml file with python
0.099668
0
1
4,733
2,977,824
2010-06-04T21:11:00.000
2
0
0
0
python,django,user-profile
2,978,805
2
false
1
0
If you do not want to modify/inherit from the original User model I'd say it's totally ok if the method is added to your UserProfile!
1
1
0
I've implemented a UserProfile model (as the Django 1.2 docs say is the proper way to save additional data about a User) which has a 'remaining_vacation_hours' field. In our current system, when a user fills out a Time Off Request, the remaining hours available should be checked to see that they have enough vacation t...
Proper way to define "remaining time off" for a Django User
0.197375
0
0
218
2,978,801
2010-06-05T01:53:00.000
5
1
0
1
python,ruby
2,979,717
6
false
0
0
Personally, I find the documentation for Python is much better than that for Ruby. The Docs for Ruby are full of cryptic examples that are terse, short, and just not very helpful. On the other hand, docs for Python exist everywhere, but more importantly, in a useful, helpful form.
6
1
0
if i want to script a mini-application (in the Terminal) in mac and windows, which one is preferred: ruby or python? or is there no major difference just a matter of taste? cause i know python definetely is a good scripting language. thanks
ruby or python more suitable for scripting in all OSes?
0.16514
0
0
551
2,978,801
2010-06-05T01:53:00.000
2
1
0
1
python,ruby
2,978,961
6
false
0
0
I believe python and ruby (since at least OS X 10.4) came pre-installed on Mac, that is a convenience. There are easy installers for Windows. On Linux of course your mileage may vary. As much as i like python myself, don't think one is better than the other for your purpose.
6
1
0
if i want to script a mini-application (in the Terminal) in mac and windows, which one is preferred: ruby or python? or is there no major difference just a matter of taste? cause i know python definetely is a good scripting language. thanks
ruby or python more suitable for scripting in all OSes?
0.066568
0
0
551
2,978,801
2010-06-05T01:53:00.000
2
1
0
1
python,ruby
2,979,070
6
false
0
0
Python is perhaps a little more common, and arguably more mature, so on that basis alone, it may be worth choosing Python. That said, both are available by default on Mac OS X, and neither are available on Windows by default, so in this case it really does not matter.
6
1
0
if i want to script a mini-application (in the Terminal) in mac and windows, which one is preferred: ruby or python? or is there no major difference just a matter of taste? cause i know python definetely is a good scripting language. thanks
ruby or python more suitable for scripting in all OSes?
0.066568
0
0
551
2,978,801
2010-06-05T01:53:00.000
2
1
0
1
python,ruby
2,979,691
6
false
0
0
I would suggest to go for Python over Ruby on Windows unless you are willing to port some gems as a few (no I cannot say what percentage) of the gems use unix/mac specific stuff (example from ENV[OSTYPE] to wget to unix processes) that I have seen break on windows.
6
1
0
if i want to script a mini-application (in the Terminal) in mac and windows, which one is preferred: ruby or python? or is there no major difference just a matter of taste? cause i know python definetely is a good scripting language. thanks
ruby or python more suitable for scripting in all OSes?
0.066568
0
0
551
2,978,801
2010-06-05T01:53:00.000
0
1
0
1
python,ruby
3,028,950
6
false
0
0
Both are excelent options, you won't go wrong no matter which one you chose. You should check out the availability of libraries for the task at hand and also how helpful the community is. The Python community is humongous and seems friendlier to me. Rubists seem to have some anger management issues.
6
1
0
if i want to script a mini-application (in the Terminal) in mac and windows, which one is preferred: ruby or python? or is there no major difference just a matter of taste? cause i know python definetely is a good scripting language. thanks
ruby or python more suitable for scripting in all OSes?
0
0
0
551
2,978,801
2010-06-05T01:53:00.000
5
1
0
1
python,ruby
2,978,809
6
true
0
0
Matter of taste, really. They each have a pretty good set of libraries and are cross-platform, so it'll be a matter of which one you prefer to code in.
6
1
0
if i want to script a mini-application (in the Terminal) in mac and windows, which one is preferred: ruby or python? or is there no major difference just a matter of taste? cause i know python definetely is a good scripting language. thanks
ruby or python more suitable for scripting in all OSes?
1.2
0
0
551
2,979,402
2010-06-05T06:20:00.000
3
0
0
0
ironpython
3,000,668
3
false
1
0
I'm doing web development for a German firm using Django on the server side and Silverlight with IronPython on the client. We're an all Python development company so being able to do "full stack" development with Python is great (although it was originally the customer who specified Silverlight).
1
5
0
I've been toying with the idea of adding IronPython for extending a scientific application I support. Is this a good or horrible idea? Are there any good examples of IronPython being used in a production application. I've seen Resolver, which is kind of cute. Are there any other apps out there? What I don't get is ...
Anyone using IronPython in a production application?
0.197375
0
0
1,311
2,979,697
2010-06-05T08:31:00.000
0
0
0
0
python,geometry,tkinter
2,979,705
4
false
0
1
I'd start with identifying the concentrations of the spots in the plane. Find the centers of those agglomerations and assign them each unique color. Then for other spots you could simply calculate the color using the linear principle. For example, if one center is red and the other is yellow, a point somewhere in the m...
2
4
0
I have a dense set of points in the plane. I want them colored so that points that are close to each other have the same color, and a different color if they're far away. For simplicity assume that there are, say, 5 different colors to choose from. Turns out I've not the slightest idea how to do that .. I'm using Tkint...
Coloring close points
0
0
0
270