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
7,462,054
2011-09-18T14:20:00.000
4
0
0
0
python,qt,pyqt,qtreeview,qabstractitemmodel
7,463,100
3
true
0
1
You can get/set the active row with the currentIndex() and setCurrentIndex() functions that you can find in both QTreeView and QItemSelectionModel (the latter is returned by QTreeView.selectionModel()). And despite its name, the QItemSelectionModel handles the view current item, and the view selection independently.
1
5
0
Is there a way to get and change the active row in a QTreeView (not QTreeWidget)? By active, I mean the row with the focus highlight, not the selected row. In the paint event, I can use QStyle.State_HasFocus to get the active row, but this doesn't seem to work elsewhere.
Get and set the active row in QTreeview programmatically (PyQt)
1.2
0
0
9,304
7,464,000
2011-09-18T19:46:00.000
1
0
1
0
python,queue
7,464,188
3
false
0
0
If you talk about the classes in the Queue module: following the API there is no way to detect if a queue contains a given object.
2
3
0
A producer thread queries a data store and puts objects into a queue. Each consumer thread(s) will then pull an object off of the shared queue and do a very long call to an external service. When the call returns, the consumer marks the object as having been completed. My problem is that I basically have to wait unti...
How to prevent duplicate values in a shared queue
0.066568
0
0
3,702
7,464,000
2011-09-18T19:46:00.000
0
0
1
0
python,queue
7,464,178
3
false
0
0
What do you mean by mark the object as having been completed? Do you leave the object in the queue and change a flag? Or do you mean you mark the object as having been completed in the data store. If the former, how does the queue ever become empty? If the latter, why not remove the object from the queue before you sta...
2
3
0
A producer thread queries a data store and puts objects into a queue. Each consumer thread(s) will then pull an object off of the shared queue and do a very long call to an external service. When the call returns, the consumer marks the object as having been completed. My problem is that I basically have to wait unti...
How to prevent duplicate values in a shared queue
0
0
0
3,702
7,464,941
2011-09-18T22:40:00.000
6
0
0
0
python,django,settings
7,465,009
1
true
0
0
Move all the keys, passwords, etc. to a file secrets.py, then add import secrets to settings.py.
1
3
0
I would like to extract any sensitive information from my settings.py file, for example, db name/password, amazon key/password, api keys/passwords. What is the suggested way to go about doing this.
Extract passwords from settings.py file
1.2
0
0
237
7,466,375
2011-09-19T04:12:00.000
6
0
0
1
python,python-3.x,cx-freeze
7,474,129
1
true
0
0
Short answer: no I've been doing something similiar recently (using cx_Freeze with Python 3). If you set up Python inside Wine, you can generate a Windows build, but I had to copy some DLLs in before it worked properly (cx_Freeze calls a Windows API function that's not implemented in Wine). I've not run into any way of...
1
7
0
I'm setting up a scripted build of a cross-platform python app (Python 3) and I'd like to create all the distributables from linux. Is that possible?
Distributing python on Mac, Linux, and Windows using cx_freeze: can I generate all apps from one platform?
1.2
0
0
993
7,468,544
2011-09-19T09:01:00.000
1
0
0
0
python,hosting,python-3.x,web-hosting,cherrypy
7,469,888
2
true
1
0
Apache/mod_wsgi can do what is required. Each mounted web application under mod_wsgi will run in a distinct sub interpreter in the same process so can be using different code bases. Better still, you use daemon mode of mod_wsgi and delegate each web application to distinct process so not risk of them interfering with e...
1
0
0
I am stuck and desperate. Is it possible to serve multiple python web applications on multiple different domains using virtualhost on cherrypy? Hmm wait... I will answer myself: Yes, it is possible. With virtual host dispatcher it is possible, until i require this: I need to use more instances of same application but ...
Multiple python web applications running on multiple domains (virtualhost)?
1.2
0
0
459
7,470,045
2011-09-19T11:13:00.000
0
1
0
1
python,shell,unix,cpu
7,470,125
3
false
0
0
well, you can try to use the top command with "-b -n 1" and grab it's contents and than you can use cut or other tools to get what you need NOTE: you can add the -p option to limit to a particular process id
1
1
0
I'm trying to calculate the percentage of CPU% used for a particular process using Python/Shell, but so far nothing. I have looked at a lot of questions here, but none could help me. Any suggestions?
CPU Utilization on UNIX
0
0
0
541
7,472,301
2011-09-19T14:11:00.000
0
0
1
0
python,macos,32-bit,py2app
7,472,418
5
false
0
0
You need to force python to run in 32-bit mode.
1
4
0
I am trying to build an app bundle with py2app on Mac OS X 10.6. The app uses some libraries which are only compiled for 32-bit, so when the app is run there is an ImportError "no appropriate 64-bit architecture". How can I tell py2app to force the app to run in 32-bit mode?
How to force py2app to run app in 32-bit mode
0
0
0
2,253
7,472,348
2011-09-19T14:15:00.000
1
0
0
0
python,sql,django
7,473,401
1
false
1
0
No, both your main saves and the status bar updates will be conducted using the same database connection so they will be part of the same transaction. I can see two options to avoid this. You can either create your own, separate database connection and save the status bar updates using that. Don't save the status bar...
1
3
0
I have a function where I save a large number of models, (thousands at a time), this takes several minutes so I have written a progress bar to display progress to the user. The progress bar works by polling a URL (from Javascript) and looking a request.session value to see the state of the first call (the one that is s...
Force commit of nested save() within a transaction
0.197375
1
0
839
7,473,609
2011-09-19T15:45:00.000
2
1
0
1
python,linux,command-line,argparse
10,015,728
5
false
0
0
If you're on CentOS and don't have an easy RPM to get to Python 2.7, JF's suggestion of pip install argparse is the way to go. Calling out this solution in a new answer. Thanks, JF.
2
12
0
I am trying to run a python script from the Linux SSH Secure Shell command line environment, and I am trying to import the argparse library, but it gives the error: "ImportError: No module named argparse". I think that this is because the Python environment that the Linux shell is using does not have the argparse libra...
argparse Python modules in cli
0.07983
0
0
15,510
7,473,609
2011-09-19T15:45:00.000
0
1
0
1
python,linux,command-line,argparse
7,474,038
5
false
0
0
You're probably using an older version of Python. The argparse module has been added pretty recently, in Python 2.7.
2
12
0
I am trying to run a python script from the Linux SSH Secure Shell command line environment, and I am trying to import the argparse library, but it gives the error: "ImportError: No module named argparse". I think that this is because the Python environment that the Linux shell is using does not have the argparse libra...
argparse Python modules in cli
0
0
0
15,510
7,474,745
2011-09-19T17:18:00.000
12
0
0
0
python,django,django-south
7,474,845
2
false
1
0
South migrates apps in the order they appear in the INSTALLED_APPS tuple in settings.py. So just make sure App-B comes before App-A in your settings.py, and it should work :)
1
8
0
I've recently begun using South for migrations in my Django project. All was going well until recently when I ran into a peculiar issue. I have two apps in my project, say, App-A and App-B. A model in App-A has a foreign key to a model in App-B. When I've been trying to build my system, I ran syndb which created all th...
What migration order does South follow across different apps?
1
0
0
1,935
7,474,887
2011-09-19T17:31:00.000
1
0
0
1
python,macos,netbeans
8,114,362
6
false
1
0
I was having a problem with Netbeans 7 not starting. Netbeans had first errored out with no error message. Then it wouldn't start or give me an error. I looked in the .netbeans directory in my user directory, and found and attempted to delete the 'lock' file in that directory. When I first tried to delete it, it said i...
5
1
0
I went to tools, plugins. Then chose to install the three python items that show up. After installation. I choose the restart netbeans option. But instead of restarting, netbeans just closed. And now it is not opening. Any ideas how to fix this? I normally develop Java on my netbeans 7 install. I am using a mac osx I s...
Netbeans 7 not starting up after python plugin installation
0.033321
0
0
2,129
7,474,887
2011-09-19T17:31:00.000
0
0
0
1
python,macos,netbeans
19,486,580
6
false
1
0
I have the same problem afther installing the python plguin. To solve this problem i deleted the file: org-openide-awt.jar from C:\Users\MYUSERNAME.netbeans\7.0\modules Regards! Martín. PD: I'm using Netbeans 7.0.1 anda Windows 7 64bit.
5
1
0
I went to tools, plugins. Then chose to install the three python items that show up. After installation. I choose the restart netbeans option. But instead of restarting, netbeans just closed. And now it is not opening. Any ideas how to fix this? I normally develop Java on my netbeans 7 install. I am using a mac osx I s...
Netbeans 7 not starting up after python plugin installation
0
0
0
2,129
7,474,887
2011-09-19T17:31:00.000
1
0
0
1
python,macos,netbeans
7,478,399
6
false
1
0
I had the same issue. Netbeans would die before opening at all. I could not fix it, and had to revert back to 6.9.1.
5
1
0
I went to tools, plugins. Then chose to install the three python items that show up. After installation. I choose the restart netbeans option. But instead of restarting, netbeans just closed. And now it is not opening. Any ideas how to fix this? I normally develop Java on my netbeans 7 install. I am using a mac osx I s...
Netbeans 7 not starting up after python plugin installation
0.033321
0
0
2,129
7,474,887
2011-09-19T17:31:00.000
1
0
0
1
python,macos,netbeans
8,088,729
6
false
1
0
I had the same problem, but with Windows 7. I deleted the .netbeans directory located in my home folder. That fixed my problem, hope it fixes yours.
5
1
0
I went to tools, plugins. Then chose to install the three python items that show up. After installation. I choose the restart netbeans option. But instead of restarting, netbeans just closed. And now it is not opening. Any ideas how to fix this? I normally develop Java on my netbeans 7 install. I am using a mac osx I s...
Netbeans 7 not starting up after python plugin installation
0.033321
0
0
2,129
7,474,887
2011-09-19T17:31:00.000
-1
0
0
1
python,macos,netbeans
7,475,990
6
false
1
0
I know I'm not answering your question directly, but I too was considering installing the Python plugin in Netbeans 7 but saw that it was still in Beta. I use WingIDE from wingware for Python development. I'm a Python newbie but I'm told by the pros that Wing is the best IDE for Python. The "101" version is free an...
5
1
0
I went to tools, plugins. Then chose to install the three python items that show up. After installation. I choose the restart netbeans option. But instead of restarting, netbeans just closed. And now it is not opening. Any ideas how to fix this? I normally develop Java on my netbeans 7 install. I am using a mac osx I s...
Netbeans 7 not starting up after python plugin installation
-0.033321
0
0
2,129
7,474,916
2011-09-19T17:34:00.000
0
0
0
0
macos,wxpython
7,521,698
1
false
0
1
I don't know if there's a way to do that or not. It may be a limitation of wx.aui. You should ask on the wxPython mailing list. Or you could try the mostly drop-in replacement: wx.agw.aui (http://xoomer.virgilio.it/infinity77/AGW_Docs/aui_module.html#aui). It fixes a bunch of bugs in the default wx.aui and is written i...
1
2
0
I'm having some undesired behavior with movable panels in wxpython. I'm using the wxpython Cocoa build 2.9.2.3 for Python 2.7 on Mac OS X 10.6.7. I'm importing wx.aui and trying to create dockable panels. I have a panel that I've created a wx.aui.AuiManager on and have added two panels, one on top and one on below. Fo...
wxpython AUI panels dockable but not floatable
0
0
0
456
7,476,072
2011-09-19T19:15:00.000
1
0
1
0
python,multithreading,sockets,tcp
7,496,206
4
false
0
0
You don't need threads for either client or server; you can instead select() to multiplex all the I/O inside a single thread.
1
2
0
I'm trying to figure out how to make a server that can accept multiple clients at one time. While doing so, I need the client able to send and receive data from the server at the same time. Would i have to make a threaded server? And have a thread for listening for data. And then another thread for sending out informat...
simultaneously sending/receiving info from a server, in python?
0.049958
0
1
4,923
7,477,211
2011-09-19T20:57:00.000
0
1
0
0
python,django,performance
7,482,454
3
false
1
0
I had a similar problem with an app using memcached. The solution was running mod_wsgi in daemon mode instead of embeded mode, and Apache in mpm_worker mode. After that, application is working much faster.
3
1
0
Is anyone aware of any issues with Django's caching framework when deployed to Apache/Mod_WSGI? When testing with the caching framework locally with the dev server, using the profiling middleware and either the FileBasedCache or LocMemCache, Django's very fast. My request time goes from ~0.125 sec to ~0.001 sec. Fantas...
Using Django Caching with Mod_WSGI
0
0
0
707
7,477,211
2011-09-19T20:57:00.000
0
1
0
0
python,django,performance
18,531,552
3
false
1
0
Same thing happened to me and was wondering what is that is taking so much time. each cache get was taking around 100 millisecond. So I debugged the code django locmem code and found out that pickle was taking a lot of time (I was caching a whole table in locmemcache). I wrapped the locmem as I didn't wanted anything ...
3
1
0
Is anyone aware of any issues with Django's caching framework when deployed to Apache/Mod_WSGI? When testing with the caching framework locally with the dev server, using the profiling middleware and either the FileBasedCache or LocMemCache, Django's very fast. My request time goes from ~0.125 sec to ~0.001 sec. Fantas...
Using Django Caching with Mod_WSGI
0
0
0
707
7,477,211
2011-09-19T20:57:00.000
0
1
0
0
python,django,performance
7,477,678
3
true
1
0
Indeed django is slow. But I must say most of the slowness goes from app itself.. django just forces you (bu providing bad examples in docs) to do lazy thing that are slow in production. First of: try nginx + uwsgi. it is just the best. To optimize you app: you need to find you what is causing slowness, it can be: slo...
3
1
0
Is anyone aware of any issues with Django's caching framework when deployed to Apache/Mod_WSGI? When testing with the caching framework locally with the dev server, using the profiling middleware and either the FileBasedCache or LocMemCache, Django's very fast. My request time goes from ~0.125 sec to ~0.001 sec. Fantas...
Using Django Caching with Mod_WSGI
1.2
0
0
707
7,477,954
2011-09-19T22:16:00.000
0
0
1
1
python,linux,process,linux-kernel
7,478,053
1
true
0
0
By default, any file descriptors that a process has open when it forks/execs (which happens during a popen()) are inherited by the child process. If this isn't what you want to happen, you will need to either manually close the file descriptors after forking, or set the fds as close-on-exec using fcntl(fd, F_SETFD, FD_...
1
0
0
i think i have a problem with a ttyUSB device that caused from having 2 open ttyUSB fd's at the same time from different processes. it goes like this: i have a main python process, which opens several ttyUSB fd's, read, write, close, and open processes (with popen) to handle each ttyUSB (of course after the fd was clos...
fd duplicate from python to child process
1.2
0
0
280
7,478,366
2011-09-19T23:11:00.000
0
0
0
0
python,flask
67,442,944
5
false
1
0
You need to add function means that the page you want to render that function whould be added inside the url_for(function name). It will redirect to that function and the page will render accordingly.
1
241
0
Half of my Flask routes requires a variable say, /<variable>/add or /<variable>/remove. How do I create links to those locations? url_for() takes one argument for the function to route to but I can't add arguments?
Create dynamic URLs in Flask with url_for()
0
0
0
402,348
7,478,590
2011-09-19T23:46:00.000
1
0
0
0
javascript,android,python,django
7,478,626
2
false
1
0
What you're looking for isn't possible and should not be possible for security concerns. Do you want someone knowing what devices you have connected to your computer? You're essentially wanting a device sniffer but a website would not be capable of accessing the client's machine in this manner to access the desired i...
2
0
0
I know the title is a bit off, but what I'm asking is if it is possible to have a python script on my website that can detect if my Android phone is connected to the computer Im using to view the page. I don't know if this is possible since I think python is server-side, but maybe this is possible to do with JavaScript...
Python on website to connect to phone connected to computer
0.099668
0
1
271
7,478,590
2011-09-19T23:46:00.000
1
0
0
0
javascript,android,python,django
7,479,646
2
true
1
0
What you're looking for is not TOTALLY ABSOLUTELY impossible, but you may need some help from the computer you connect the device to, from the browser you're visiting your site with or from the device itself. Some possible options: have a program running on your computer which checks if the device is connected and pin...
2
0
0
I know the title is a bit off, but what I'm asking is if it is possible to have a python script on my website that can detect if my Android phone is connected to the computer Im using to view the page. I don't know if this is possible since I think python is server-side, but maybe this is possible to do with JavaScript...
Python on website to connect to phone connected to computer
1.2
0
1
271
7,478,803
2011-09-20T00:21:00.000
1
1
0
1
python,multithreading,amazon-ec2,cloud,parallel-processing
7,478,918
1
true
1
0
Your requirements are too vague for a specific response. It is unlikely you are going to be able to elaborate them sufficiently for anybody to provide an authoritative answer. Fortunately for you, many Infrastructure as a Service platforms like AWS and Rackspace let you test things out extremely inexpensively (literal...
1
0
0
I'm working on running a Memory/CPU intensive project on a cloud service, from my Googling and research it looks like I should use Amazon EC2 as there are guides it using MPI - however, reading up on stackoverflow about people's comparison of EC2 with rackspace, joyent, etc, I was wondering if this is really the best c...
Python Parallel Processing Amazon EC2 or Alternatives?
1.2
0
0
384
7,479,493
2011-09-20T02:41:00.000
5
0
0
0
python,django,python-idle
15,087,670
4
false
1
0
Don't run django-admin.py for anything other than the initial project creation. For everything after that, use manage.py, which takes care of the finding the settings.
2
5
0
when i input from django.db import models into IDLE,the result throw a exception named Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined. why does this exception occur and how i can fix it
DJANGO_SETTINGS_MODULE is undefined
0.244919
0
0
30,612
7,479,493
2011-09-20T02:41:00.000
8
0
0
0
python,django,python-idle
14,872,658
4
false
1
0
You can use python manage.py shell instead of using IDLE. manage.py reads and uses django settings including DJANGO_SETTINGS_MODULE.
2
5
0
when i input from django.db import models into IDLE,the result throw a exception named Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined. why does this exception occur and how i can fix it
DJANGO_SETTINGS_MODULE is undefined
1
0
0
30,612
7,479,686
2011-09-20T03:13:00.000
15
1
0
0
python,r,awk,sed,data-cleaning
7,479,812
6
false
0
0
Not to spoil your adventure, but I'd say no and here is why: R is vectorised where sed/awk are not R already has both Perl regular expression and extended regular expressions R can more easily make recourse to statistical routines (say, imputation) if you need it R can visualize, summarize, ... and most importantly: ...
5
26
0
I use R for data analysis and am very happy with it. Cleaning data could be a bit easier, however. I am thinking about learning another language suited to this task. Specifically, I am looking for a tool to use to take raw data, remove unnecessary variables or observations, and format it for easy loading in R. Contents...
Python or awk/sed for cleaning data
1
0
0
4,795
7,479,686
2011-09-20T03:13:00.000
6
1
0
0
python,r,awk,sed,data-cleaning
7,488,114
6
false
0
0
I would recommend sed/awk along with the wealth of other command line tools available on UNIX-alike platforms: comm, tr, sort, cut, join, grep, and built in shell capabilities like looping and whatnot. You really don't need to learn another programming language as R can handle data manipulation as well as if not better...
5
26
0
I use R for data analysis and am very happy with it. Cleaning data could be a bit easier, however. I am thinking about learning another language suited to this task. Specifically, I am looking for a tool to use to take raw data, remove unnecessary variables or observations, and format it for easy loading in R. Contents...
Python or awk/sed for cleaning data
1
0
0
4,795
7,479,686
2011-09-20T03:13:00.000
1
1
0
0
python,r,awk,sed,data-cleaning
7,479,937
6
false
0
0
I would recommend 'awk' for this type of processing. Presumably you are just searching/rejecting invalid observations in simple text files. awk is lightning fast at this task and is very simple to program. If you need to do anything more complex then you can. Python is also a possibility if you don't mind the performa...
5
26
0
I use R for data analysis and am very happy with it. Cleaning data could be a bit easier, however. I am thinking about learning another language suited to this task. Specifically, I am looking for a tool to use to take raw data, remove unnecessary variables or observations, and format it for easy loading in R. Contents...
Python or awk/sed for cleaning data
0.033321
0
0
4,795
7,479,686
2011-09-20T03:13:00.000
1
1
0
0
python,r,awk,sed,data-cleaning
7,484,242
6
false
0
0
I agree with Dirk. I thought about the same thing and used other languages a bit, too. But in the end I was surprised again again what more experienced users do with R. Packages like ddply or plyrmight be very interesting to you. That being said SQL helped me with data juggling often
5
26
0
I use R for data analysis and am very happy with it. Cleaning data could be a bit easier, however. I am thinking about learning another language suited to this task. Specifically, I am looking for a tool to use to take raw data, remove unnecessary variables or observations, and format it for easy loading in R. Contents...
Python or awk/sed for cleaning data
0.033321
0
0
4,795
7,479,686
2011-09-20T03:13:00.000
3
1
0
0
python,r,awk,sed,data-cleaning
7,479,874
6
false
0
0
I would recommend investing for the long term with a proper language for processing data files, like python or perl or ruby, vs the short term sed/awk solution. I think that all data analysts need at least three languages; I use C for hefty computations, perl for processing data files, and R for interactive analysis a...
5
26
0
I use R for data analysis and am very happy with it. Cleaning data could be a bit easier, however. I am thinking about learning another language suited to this task. Specifically, I am looking for a tool to use to take raw data, remove unnecessary variables or observations, and format it for easy loading in R. Contents...
Python or awk/sed for cleaning data
0.099668
0
0
4,795
7,479,757
2011-09-20T03:24:00.000
0
1
0
0
python,git,build,jenkins
7,481,245
3
false
0
0
I am using the Copy Data To Workspace Plugin for this, Copy to Slave plugin should also work, but I found Copy Data To Workspace Plugin to be easier to work with for this use-case.
2
1
0
I've just started using Jenkins today, so it's entirely possible that I've missed something in the docs. I currently have Jenkins set up to run unit tests from a local Git repo (via plugin). I have set up the environment correctly (at least, in a seemingly working condition), but have run into a small snag. I have a si...
Using un-managed file in Jenkins build step
0
0
0
350
7,479,757
2011-09-20T03:24:00.000
0
1
0
0
python,git,build,jenkins
7,489,440
3
false
0
0
Why just not use "echo my-secret-keys > settings.txt" in jenkins and adjust your script to read this file so you can add it to report?
2
1
0
I've just started using Jenkins today, so it's entirely possible that I've missed something in the docs. I currently have Jenkins set up to run unit tests from a local Git repo (via plugin). I have set up the environment correctly (at least, in a seemingly working condition), but have run into a small snag. I have a si...
Using un-managed file in Jenkins build step
0
0
0
350
7,479,777
2011-09-20T03:26:00.000
128
0
1
0
python,datetime,time
7,479,986
5
true
0
0
The time module is principally for working with Unix time stamps; expressed as a floating point number taken to be seconds since the Unix epoch. the datetime module can support many of the same operations, but provides a more object oriented set of types, and also has some limited support for time zones.
3
174
0
I am trying to figure out the differences between the datetime and time modules, and what each should be used for. I know that datetime provides both dates and time. What is the use of the time module? Examples would be appreciated and differences concerning timezones would especially be of interest.
Difference between Python datetime vs time modules
1.2
0
0
72,058
7,479,777
2011-09-20T03:26:00.000
5
0
1
0
python,datetime,time
7,479,951
5
false
0
0
The time module can be used when you just need the time of a particular record - like lets say you have a seperate table/file for the transactions for each day, then you would just need the time. However the time datatype is usually used to store the time difference between 2 points of time. This can also be done usin...
3
174
0
I am trying to figure out the differences between the datetime and time modules, and what each should be used for. I know that datetime provides both dates and time. What is the use of the time module? Examples would be appreciated and differences concerning timezones would especially be of interest.
Difference between Python datetime vs time modules
0.197375
0
0
72,058
7,479,777
2011-09-20T03:26:00.000
3
0
1
0
python,datetime,time
7,480,235
5
false
0
0
If you are interested in timezones, you should consider the use of pytz.
3
174
0
I am trying to figure out the differences between the datetime and time modules, and what each should be used for. I know that datetime provides both dates and time. What is the use of the time module? Examples would be appreciated and differences concerning timezones would especially be of interest.
Difference between Python datetime vs time modules
0.119427
0
0
72,058
7,479,907
2011-09-20T03:48:00.000
1
0
1
0
python,mongodb,pymongo
18,267,147
2
false
0
0
Driver can't remove dropped socket from connection from pool until your code try use it.
1
3
0
i use pymongo to test the performance of the mongodb. i use 100 threads, every thread excecute 5000 insert, and everything work ok. but when i excecute 10000 insert in every thead, i meet some error: "AutoReconnect: Connection reset by peer"
Mongodb : AutoReconnect, Connection reset by peer
0.099668
1
0
1,676
7,481,375
2011-09-20T07:10:00.000
0
0
0
0
python,physics,simulation
7,481,708
3
false
0
0
In a normal approach what we can do is... every time on every movement in any ball, check if any ball is colliding with any other ball. Then we can put some optimization in this approach by keeping safe distance variable between every pair of balls. Safe distance means the distance between two balls, which is availabl...
1
2
0
I am trying to simulate the following: 10 balls that are moving in an area of fixed dimensions Whenever two or more balls come into a proximity range of say 40m, I want an event to be triggered My idea is to utilize a movement trace with different properties to guide the movement of the balls and study how each of t...
What is a good way to simulate particle movement?
0
0
0
2,584
7,481,974
2011-09-20T08:08:00.000
0
1
0
0
python
7,482,087
7
false
0
0
Your program should send a get request to the website, receive the html (verify you get "200 OK"), and compare the beginning of the string to what you know it should be (compare everything until the first thing that depends on content). If the comparison fails, then you should suspect that your site may be down, and ch...
1
1
0
I have a WordPress self hosted blog which was down until last week. After updating WordPress, now the site is working fine. But I would like to check it frequently for next couple of days. Is it possible to write a program to do this so that I can schedule it? Please give some suggestions. I am thinking of Python as t...
Programmatically checking whether a website is working or not?
0
0
0
3,127
7,482,493
2011-09-20T08:53:00.000
1
0
1
0
python,scripting
7,483,796
3
false
0
0
Assuming CPython, yes you have 'n' different interpreters running but (at least on operating systems like Windows, UNIX, and Linux) the interpreter code itself is shared. The data areas (which includes your Python code, depending on the implementation) will be unique to each process. Any modules written in C that pro...
3
1
0
I'm wondering how many python interpreter would be executed for distinct python apps? Say I have 6 different python apps up and running, so does that mean there are 6 different python interpreters are running for each of them?
Python Apps and Python Interpreter?
0.066568
0
0
117
7,482,493
2011-09-20T08:53:00.000
1
0
1
0
python,scripting
7,482,628
3
false
0
0
Yes, each python script is launched by a separate python interpreter process. (unless your applications are in fact a single application multi threaded of course ;) )
3
1
0
I'm wondering how many python interpreter would be executed for distinct python apps? Say I have 6 different python apps up and running, so does that mean there are 6 different python interpreters are running for each of them?
Python Apps and Python Interpreter?
0.066568
0
0
117
7,482,493
2011-09-20T08:53:00.000
5
0
1
0
python,scripting
7,482,633
3
true
0
0
when executing a python script, you have 1 interpreter running per process executing. if your application executes in a single process, you have 1 interpreter executing for each instance of your application. if your application launches multiple processes, then you get additional interpreters for each process launche...
3
1
0
I'm wondering how many python interpreter would be executed for distinct python apps? Say I have 6 different python apps up and running, so does that mean there are 6 different python interpreters are running for each of them?
Python Apps and Python Interpreter?
1.2
0
0
117
7,483,328
2011-09-20T09:57:00.000
5
0
1
0
python,inheritance,metaclass
7,483,538
1
true
0
0
When you "inherent from an instance", what you're really doing is a strange way of using a metaclass. Normally, class objects are instances of type. In the case of class B above, it inherits from an instance of Foo. This is exactly what would happen if you defined a class with Foo as its metaclass, and then inherited f...
1
4
0
I've been messing around with the dark arts of Python and there's something I'd like help understanding. Given a class Foo, here's some ways I attempted to inherit from it: class A(Foo) — Works, unsurprizingly class B(Foo()) — works provided Foo has an appropriate __new__ method (which I provided) class C(Foo(), Foo) ...
Metaclass conflict, multiple inheritance, and instance as parent
1.2
0
0
2,719
7,483,947
2011-09-20T10:49:00.000
5
0
1
0
python,class,object
7,483,982
5
false
0
0
An object is an instantiation of a class. Think of a class like the blueprint of a car. Ford make cars (objects) based on the rules and information enclosed in the blueprint.
4
9
0
I am a self-taught python user (kind of.). I read much to deepen my knowledge about python. Today I encountered a text saying: ... classes and objects .... So I was wondering what is the difference between objects and classes in python. I taught all classes are objects, but in that case, author wouldn't have used p...
What is the difference between objects and classes in Python
0.197375
0
0
19,406
7,483,947
2011-09-20T10:49:00.000
2
0
1
0
python,class,object
7,484,141
5
false
0
0
A class is an idea. An object is the fruition of that idea.
4
9
0
I am a self-taught python user (kind of.). I read much to deepen my knowledge about python. Today I encountered a text saying: ... classes and objects .... So I was wondering what is the difference between objects and classes in python. I taught all classes are objects, but in that case, author wouldn't have used p...
What is the difference between objects and classes in Python
0.07983
0
0
19,406
7,483,947
2011-09-20T10:49:00.000
3
0
1
0
python,class,object
33,067,181
5
false
0
0
A class describes what that object will be, but it isn't the object itself.
4
9
0
I am a self-taught python user (kind of.). I read much to deepen my knowledge about python. Today I encountered a text saying: ... classes and objects .... So I was wondering what is the difference between objects and classes in python. I taught all classes are objects, but in that case, author wouldn't have used p...
What is the difference between objects and classes in Python
0.119427
0
0
19,406
7,483,947
2011-09-20T10:49:00.000
12
0
1
0
python,class,object
7,483,986
5
true
0
0
These are two closely related terms in object oriented programming. The standard meaning is that an object is an instance of a class.
4
9
0
I am a self-taught python user (kind of.). I read much to deepen my knowledge about python. Today I encountered a text saying: ... classes and objects .... So I was wondering what is the difference between objects and classes in python. I taught all classes are objects, but in that case, author wouldn't have used p...
What is the difference between objects and classes in Python
1.2
0
0
19,406
7,484,924
2011-09-20T12:11:00.000
3
0
0
0
python,pyglet
7,485,069
3
true
0
1
I didn't use Pyglet yet, but is not a GUI library, it doesn't have to have widgets like buttons, or containers etc. It's a multimedia library like Pygame, it draws stuff on screen, plays sounds, and has some helper functions. If you want to draw a button on screen, you should first draw a rectangle, print some text in ...
1
3
0
i'm checking out pyglet, but, funny enough, i can't find how to do a simple button! so what is the standard way to create a standard button? is there a standard way to create a Message-Box? open/save dialogs? or am i missing the point of pyglet? isn't it yet-another gui toolkit for creating (also) forms, windows, but...
where is the button widget in pyglet ?
1.2
0
0
6,713
7,485,830
2011-09-20T13:20:00.000
1
1
0
0
python,posix,message-queue
7,500,416
1
true
0
0
Use the Python struct module. struct::unpack() will translate the hex string from MessageQueue::receive() into a tuple of strings
1
1
0
I'm using Philip Semanchunk's posix_ipc python module to read from a posix message queue. A C++ program I've written populates the queue with a struct containing the data. My python program successfully reads the message off the queue but I'm not sure what to do with the resulting message. doing a print msg just prin...
How do I interpret the return from posix_ipc::MessageQueue::receive()?
1.2
0
0
817
7,488,266
2011-09-20T16:07:00.000
0
0
0
1
python,twisted
7,488,756
3
false
0
0
If by "immediately" you mean "when the client connects", try calling sendLine in your LineReceiver subclass's connectionMade.
2
3
0
I have a server in twisted, implementing a LineReceiver protocol. When I call sendLine in response to a client message, it writes the line to the client immediately, as one would expect. But say the client asks the server to do a lengthy calculation. I want the server to periodically send a progress message to the clie...
Make a twister server take initiative
0
0
0
252
7,488,266
2011-09-20T16:07:00.000
1
0
0
1
python,twisted
7,523,779
3
false
0
0
You can send a line using sendLine whenever you want and it should arrive immediately, but you may have a problem related to your server blocking. A call to sendLine is deferred, so if you make a call in the middle of a bunch of processing, it's possible that it's not being actioned for a while, and then when a message...
2
3
0
I have a server in twisted, implementing a LineReceiver protocol. When I call sendLine in response to a client message, it writes the line to the client immediately, as one would expect. But say the client asks the server to do a lengthy calculation. I want the server to periodically send a progress message to the clie...
Make a twister server take initiative
0.066568
0
0
252
7,488,720
2011-09-20T16:46:00.000
2
0
0
1
python,dns,twisted
7,488,979
1
true
0
0
I think Twisted simply uses the OS' resolver, so the answer to both questions is "as much as your OS does".
1
2
0
If I use the Twisted Endpoint API to make a series of connections to the same host, will Twisted cache the DNS lookup between requests? If it does, will it honour the DNS record's TTL? My implementation is fairly vanilla. I instantiate a SSL4ClientEndpoint with host, port etc, and through the life of the program I use ...
Does Twisted cache DNS lookups? Does it honour TTL?
1.2
0
0
556
7,489,546
2011-09-20T17:55:00.000
2
0
1
0
python,local,pip,egg
27,866,963
2
false
0
0
I just came across this page and since I had the same exact problem, I thought to post the solution that worked for me. This is an issue with the older versions of pip. My version of pip was 1.5.4. I was not able to find the first version of pip that was able to do it but the current version 6.0.6 does the job. To up...
1
16
0
I am working on Windows 7.I have created a python egg using distutils. Now I try to install this egg in a virtual environment using pip 1.0.2 using the following command: Then I create a virtual environment myVirtualEnv I activate it using activate.bat then execute the following command: pip install path_to_my_local_fo...
Why does pip fail when installing local egg repository?
0.197375
0
0
22,665
7,491,507
2011-09-20T20:41:00.000
1
0
0
0
python,django
7,498,096
4
false
1
0
i'd also add that there is a set of default templates somewhere that make the usage of registration vastly easier. think they were on ubernostrums google code last time i needed them.
2
3
0
I have a directory for a django project on my localhost /MyDjangoList/ In this folder I have a django application called PK I downloaded django-registration and unzipped the folder into the /MyDjangoList/ I went into terminal and went to the django-registration folder and ran python setup.py install. It did a bunch of ...
How do I properly install django registration on localhost?
0.049958
0
0
1,876
7,491,507
2011-09-20T20:41:00.000
1
0
0
0
python,django
7,491,553
4
false
1
0
Do you need more permission? As in you need to do: sudo python setup.py install
2
3
0
I have a directory for a django project on my localhost /MyDjangoList/ In this folder I have a django application called PK I downloaded django-registration and unzipped the folder into the /MyDjangoList/ I went into terminal and went to the django-registration folder and ran python setup.py install. It did a bunch of ...
How do I properly install django registration on localhost?
0.049958
0
0
1,876
7,491,614
2011-09-20T20:51:00.000
0
0
0
1
python,amazon-web-services
9,764,576
1
true
0
0
wberry was correct in his comment, I was running into a max descriptors per process issue. This seems highly dependent on operating system. Reducing the size of the batches I was having each processor handle to below the file descriptor limit of the process solved the problem.
1
0
0
I have a large project that runs on an application server. It does pipelined processing of large batches of data and works fine on one Linux system (the old production environment) and one windows system (my dev environment). However, we're upgrading our infrastructure and moving to a new linux system for production, b...
Odd message and processing hangs
1.2
0
0
85
7,491,777
2011-09-20T21:06:00.000
3
0
0
0
python,tkinter
7,491,885
1
true
0
1
You'll have to use separate threads or processes. Tkinter uses a single thread to process display updates, and the same thread is used to do event callbacks. If your event handler blocks then no Tkinter code will execute until it completes. If you have the Tkinter thread (the one that calls Tk.mainloop) and another t...
1
1
0
I am making some programs which includes while loops(to illustrate some number calculatings) and when I use Tkinter for GUI, the program windows is freezing until the loop finished. I want to add a stop button and I want the windows not to freeze. How can I do these two things? Thank you
Tkinter is freezing while the loop is processing, how can i prevent it?
1.2
0
0
1,117
7,492,855
2011-09-20T23:07:00.000
2
0
1
1
python,virtualenv
9,071,047
6
false
0
0
Seems to be not an answer, but still might be useful in other contexts. Have you tried running bin/activate_this.py from your Python virtualenv? The comment in this file of my virtualenv reads: By using execfile(this_file, dict(__file__=this_file)) you will activate this virtualenv environment. This can be used whe...
2
15
0
I make heavy use of virtualenv to isolate my development environments from the system-wide Python installation. Typical work-flow for using a virtualenv involves running source /path/to/virtualenv/bin/activate to set the environment variables that Python requires to execute an isolated runtime. Making sure my Python ex...
Getting an embedded Python runtime to use the current active virtualenv
0.066568
0
0
4,477
7,492,855
2011-09-20T23:07:00.000
0
0
1
1
python,virtualenv
31,758,278
6
false
0
0
You can the check the environment variable VIRTUAL_ENV to get the current envs location.
2
15
0
I make heavy use of virtualenv to isolate my development environments from the system-wide Python installation. Typical work-flow for using a virtualenv involves running source /path/to/virtualenv/bin/activate to set the environment variables that Python requires to execute an isolated runtime. Making sure my Python ex...
Getting an embedded Python runtime to use the current active virtualenv
0
0
0
4,477
7,496,687
2011-09-21T08:23:00.000
1
0
1
0
python
7,497,009
5
false
0
0
You need a dictionary mapping the contents of the files to the filename. So you have to read each file, sort the entries, build a tuple from them and use this as a key. If you can have duplicate entries in a file: read the contents into a set first.
1
1
0
I am trying to parse a large amount of configuration files and group the results into separate groups based by content - I just do not know how to approach this. For example, say I have the following data in 3 files: config1.txt ntp 1.1.1.1 ntp 2.2.2.2 config2.txt ntp 1.1.1.1 config3.txt ntp 2.2.2.2 ntp 1.1.1.1 co...
Grouping items by match set
0.039979
0
0
131
7,497,199
2011-09-21T09:02:00.000
10
1
0
0
java,android,python
7,497,322
2
false
1
1
Google, as a company, uses Java a lot. The search features are written in Java. As far as I can tell from the outside, Google likes Java. For most tasks, Java is faster than Python. I would rather work in Python, and I know how to write reasonably efficient Python, and yes PyPy is really shaking things up, but Googl...
1
19
0
Full question Why did Google choose Java for the Android Operating System and not the X language? Where X would be one of the below: Python version 2.7 or version 3 which is equally as powerful as Java has a lot of useful third party libraries is faster to develop in thanks to it's dynamic nature C/C++ or ObjC wh...
Why did Google choose Java for the Android Operating System?
1
0
0
9,975
7,498,416
2011-09-21T10:43:00.000
0
0
1
0
python,alias,argparse
7,498,712
2
false
0
0
It seems to me that you want to define help as another subparser. I would naively say that you could then link it to a print_help() function that would copy the output of your standard --help, but I wonder if there is a way to call the native help() function.
1
4
0
I want the help option act the same as --help. sidenote: I have created a program with the same command line behavior as svn or hg. I managed to do this with subparsers. However I want to make things consistent. That's why I want help to work.
How to make `help` act the same as `--help` in argparse
0
0
0
486
7,500,004
2011-09-21T12:48:00.000
0
0
0
0
python
7,500,125
2
true
0
0
If you check those files, store the size of the files somewhere. When you are in the next round and the filesize is still the same, you can pretty much consider them as finished (depending on how much time is between first and second check). The time interval could e.g. be set to the timeout-interval of your uploading ...
2
4
0
I have a folder called raw_files. Very large files (~100GB files) from several sources will be uploaded to this folder. I need to get file information from videos that have finished uploading to the folder. What is the best way to determine if a file is currently being downloaded to the folder (pass) or if the video h...
How to determing if a file has finished downloading in python
1.2
0
1
2,501
7,500,004
2011-09-21T12:48:00.000
2
0
0
0
python
7,500,205
2
false
0
0
The most reliable way is to modify the uploading software if you can. A typical scheme would be to first upload each file into a temporary directory on the same filesystem, and move to the final location when the upload is finished. Such a "move" operation is cheap and atomic. A variation on this theme is to upload eac...
2
4
0
I have a folder called raw_files. Very large files (~100GB files) from several sources will be uploaded to this folder. I need to get file information from videos that have finished uploading to the folder. What is the best way to determine if a file is currently being downloaded to the folder (pass) or if the video h...
How to determing if a file has finished downloading in python
0.197375
0
1
2,501
7,501,785
2011-09-21T14:44:00.000
3
1
0
0
python,scipy
7,501,841
1
false
0
0
from scipy import optimize, special on the shell prompt starts the from command, which is an email program. from scipy import optimize, special in Python will put the modules optimize and special in your namespace, but not scipy. Either use them unqualified or do import scipy instead.
1
1
0
I am a newbie and I need your help!! I have installed scipy on my Ubuntu. When I ran the code from scipy import optimize, special I get the following in terminal: can't read /var/mail/scipy.optimize and if I type python, and get >>> then type in from scipy import optimize then I ran code including scipy, optimize, I g...
Question with scipy.optimize
0.53705
0
0
4,965
7,503,149
2011-09-21T16:18:00.000
1
0
0
0
python
7,503,299
1
true
1
0
class Check_jira ends on line 25 and has only one method. Then you have an if block, and CheckForJiraIssueRecord is just a function defined in this block (that is, the function is defined if __name__ == '__main__'. Just put the if block outside after the whole class definition.
1
0
0
Here is the code: 1 #!/usr/bin/env python 2 3 import re, os, sys, jira, subprocess 4 5 class Check_jira: 6 7 def verify_commit_text(self, tags): 8 for line in tags: 9 if re.match('^NO-TIK',line): 10 return True 11 elif re.match('^NO-REVIEW', lin...
Getting error: AttributeError: class has no attribute ''
1.2
0
0
1,839
7,504,221
2011-09-21T17:45:00.000
0
0
0
0
python,pdf,chm
7,552,195
1
false
0
0
If you want to write CHM, then afaik only Free Pascal (and therefore Delphi with minimal effort) has a free CHM generator library. All other tools use the Microsoft commandline tool behind the scenes. For reading there is chmlib, I assume there is some python wrapper for it somewhere.
1
1
0
I've tried to find a software for pdf to chm conversion to convert my pdf e-books to chm, but I ended up disappointed. So, as a pythonian, I decided to create my own program to convert pdf files to chm, however, all pdf/chm libraries I found are python2 libraries. Are there python 3 libraries to handle pdf/chm files?
pdf to chm handling libraries for python3
0
0
0
318
7,505,410
2011-09-21T19:20:00.000
0
1
0
0
python,email,mime
7,517,921
1
false
0
0
OK so I finally found the problem and it was not related to the python mail class at all. I was reading from a named pipe using the .read() function and it was not reading the entire email from the pipe. I had to pass the read function a size argument and then it was able to read the entire email. So ultimately the rea...
1
0
0
Hello I have python script that takes apart an email from a string. I am using the get_payload(decode=True) function from the email class and it works great for pdf's and jpg's but it does not decode bmp files. The file is still encoded base64 when I write it to disk. Has anyone come across this issue themselves?
How to decode bitmap images using python's email class
0
0
0
310
7,506,854
2011-09-21T21:24:00.000
2
0
0
1
python,django,google-app-engine,command-line,google-cloud-datastore
7,507,801
1
true
1
0
If you're using Django 0.96 templates within a 'normal' App Engine app, then manage.py isn't involved at all. /path/to/dev_appserver.py --clear_datastore . is what you want, assuming you're CD'd to the root of your app.
1
1
0
I am developing an App Engine project on Windows using Eclipse and Python 2.5 and Django 0.96. Everything in my app, including Django, is working nicely. My problems arise when I try to use command line. For example, I'm told that if I want to clear the local datastore I can enter "python manage.py reset" but when I do...
App Engine problems using the command line
1.2
0
0
219
7,508,016
2011-09-21T23:50:00.000
-1
0
0
0
python,graceful-degradation,noscript,browserid
7,508,068
3
false
1
0
One solution, use OpenID or hand-rolled email verification, but then I have 2 problems. :(
1
3
0
BrowserID currently uses a Javascript shim, while browsers are still (hopefully) developing support for it. Is it possible to use BrowserID for clients that don't run javascript? I could read the 600 line JS shim, and figure out what navigator.id.getVerifiedEmail is meant to do, then replicate it on a server, but I was...
BrowserID without Javascript (preferably in Python) - is it possible?
-0.066568
0
1
490
7,508,686
2011-09-22T01:51:00.000
0
0
0
0
python,http,cookies,urllib2,mechanize
7,681,165
4
true
1
0
Well, it looks like I know why the problem was happening, but I'm not 100% the reason for it. I simply had to make the server wait (time.sleep()) after it sent the 2nd request (Move to another page) before doing the 3rd request (Perform a POST by filling in a form). I don't know is it because of a condition with the ...
2
5
0
I have some test code (as a part of a webapp) that uses urllib2 to perform an operation I would usually perform via a browser: Log in to a remote website Move to another page Perform a POST by filling in a form I've created 4 separate, clean virtualenvs (with --no-site-packages) on 3 different machines, all with dif...
Inexplicable Urllib2 problem between virtualenv's.
1.2
0
1
397
7,508,686
2011-09-22T01:51:00.000
1
0
0
0
python,http,cookies,urllib2,mechanize
7,550,771
4
false
1
0
This is a total shot in the dark, but are your VPSs 64-bit and your home computer 32-bit, or vice versa? Maybe a difference in default sizes or accuracies of something could be freaking out the server. Barring that, can you try to find out any information on the software stack the web server is using?
2
5
0
I have some test code (as a part of a webapp) that uses urllib2 to perform an operation I would usually perform via a browser: Log in to a remote website Move to another page Perform a POST by filling in a form I've created 4 separate, clean virtualenvs (with --no-site-packages) on 3 different machines, all with dif...
Inexplicable Urllib2 problem between virtualenv's.
0.049958
0
1
397
7,511,965
2011-09-22T08:40:00.000
0
0
0
0
python,sql,database,sqlite
7,512,015
2
false
0
0
You should check the user privileges, the user on linux may not have enough privileges.
1
0
0
I am currently writing a Python script to interact with an SQLite database but it kept returning that the database was "Encrypted or Corrupted". The database is definitely not encrypted and so I tried to open it using the sqlite3 library at the command line (returned the same error) and with SQLite Manager add-on for F...
SQLite3 Database file - Corrupted/Encrypted only on Linux
0
1
0
1,207
7,512,180
2011-09-22T08:59:00.000
1
1
1
0
python,runtime,exitstatus
8,352,031
1
false
0
0
I got the same error. As I see it's not python output but just an answer from spotify bot that your program threw an exception in some tests. Maybe the real output isn't shown to prevent debugging using the bot. When you print dummy data fist test fails and you get 'Wrong Answer'. When you print real output first test ...
1
0
0
I have python 2.7 installed on my windows computer. I'm trying to email a puzzle answer to Spotify, which is running Python 2.6.6. When I submit my *.py source code, I'm getting the following error: Run Time Error Exited, exit status: 1 I only have "import sys". I've run tons of stress tests - possible inputs are 1 ...
Run Time Error (exit status 1) when submitting puzzle in Python
0.197375
0
0
1,602
7,513,067
2011-09-22T10:08:00.000
-5
0
0
0
python,regression
7,513,167
5
false
0
0
Do you know Numpy? If no, take a look also to Scipy and matplotlib.
1
16
1
I'm looking for a good implementation for logistic regression (not regularized) in Python. I'm looking for a package that can also get weights for each vector. Can anyone suggest a good implementation / package? Thanks!
Weighted logistic regression in Python
-1
0
0
23,971
7,518,255
2011-09-22T16:31:00.000
2
0
1
0
python
7,518,296
4
false
0
0
Here is what I would do if I had to write this: I'd have a function that, given a word, would check whether it satisfies the criteria and would return a boolean flag. Then I'd have some code that would iterate over all words in the file, present each of them to the function, and print out those for which the function h...
1
3
0
I wonder, if you open a text file in Python. And then you'd like to search of words containing a number of letters. Say you type in 6 different letters (a,b,c,d,e,f) you want to search. You'd like to find words matching at least 3 letters. Each letter can only appear once in a word. And the letter 'a' always has to be...
Python text search question
0.099668
0
0
570
7,519,152
2011-09-22T17:47:00.000
2
0
1
0
python,dll,ctypes
7,519,238
1
true
0
0
No. Not directly anyway. CTypes uses the dynamic linker (LoadLibrary, GetProcAddress) to work. You could wrap the LIB file in your own DLL possibly, but you won't be able to use Ctypes directly with the lib file.
1
2
0
I need to control a device in python using Ctypes. However, the libraries that come with the device are compiled .LIB files, not .DLLs. Is it still possible to use Ctypes?
Using Ctypes to wrap .LIB files
1.2
0
0
845
7,521,729
2011-09-22T21:27:00.000
2
0
0
0
python,browser
7,521,789
4
false
0
0
I have a feeling it's not Python's fault. Firefox and Chrome (and probably IE) all intercept calls to open new windows and changes them to new tabs. Check the settings in your browser for interpreting those calls.
1
8
0
I have been looking for a way to open a new default browser window from inside Python code. According to the documentation webbrowser.open_new(url) Should do that. Unfortunately in case Chrome is the default browser it only opens a new tab. Is there any way to open the default browser (without knowing what that browse...
How to open a new default browser window in Python when the default is Chrome
0.099668
0
1
5,789
7,525,761
2011-09-23T07:40:00.000
0
1
0
0
python,apache,wsgi,web2py,web2py-modules
7,525,938
3
false
1
0
Add testapp to your PYTHONPATH.
2
2
0
local_import function randomly does not import my modules from modules directory. The Error is: ImportError: No module named testapp.modules.mymodule I have this problem when i use web2py with apache (with wsgi). I have no problem when i run locally with "python web2py.py" command. Any suggestion?
local_import function does not work
0
0
0
642
7,525,761
2011-09-23T07:40:00.000
1
1
0
0
python,apache,wsgi,web2py,web2py-modules
7,582,872
3
false
1
0
I will answer my own question :) I started using mod_proxy and everything is ok.
2
2
0
local_import function randomly does not import my modules from modules directory. The Error is: ImportError: No module named testapp.modules.mymodule I have this problem when i use web2py with apache (with wsgi). I have no problem when i run locally with "python web2py.py" command. Any suggestion?
local_import function does not work
0.066568
0
0
642
7,526,746
2011-09-23T09:15:00.000
6
0
0
1
python,google-app-engine
7,526,870
2
true
1
0
Python has it's own garbage collection so there's no need to release memory manually.
1
2
0
Is there a way to free memory in google's app engine? Is there a garbage collector in python?
Is it necessary to explicitly free memory in Google App Engine's Python environment?
1.2
0
0
617
7,527,055
2011-09-23T09:42:00.000
12
1
1
0
python,optimization,runtime,assert,conditional-compilation
7,527,449
2
true
0
0
-O is a compiler flag, you can't set it at runtime because the script already has been compiled by then. Python has nothing comparable to compiler macros like #if. Simply write a start_my_project.sh script that sets these flags.
1
11
0
I'd like to set the optimize flag (python -O myscript.py) at runtime within a python script based on a command line argument to the script like myscript.py --optimize or myscript --no-debug. I'd like to skip assert statements without iffing all of them away. Or is there a better way to efficiently ignore sections of py...
Is it possible to set the python -O (optimize) flag within a script?
1.2
0
0
2,416
7,528,360
2011-09-23T11:36:00.000
3
1
0
0
php,python,dsl,plpgsql
7,660,613
6
false
0
0
How about doing the scripting on the client. That will ensure maximum security and also save server resources. In other words Javascript would be your scripting platform. What you do is expose the functionality of your backend as javascript functions. Depending on how your app is currently written that might require ba...
2
11
0
I'm developing an web based application written in PHP5, which basically is an UI on top of a database. To give users a more flexible tool I want to embed a scripting language, so they can do more complex things like fire SQL queries, do loops and store data in variables and so on. In my business domain Python is widel...
Embed python/dsl for scripting in an PHP web application
0.099668
1
0
570
7,528,360
2011-09-23T11:36:00.000
0
1
0
0
php,python,dsl,plpgsql
7,605,372
6
false
0
0
You could do it without Python, by ie. parsing the user input for pre-defined "tags" and returning the result.
2
11
0
I'm developing an web based application written in PHP5, which basically is an UI on top of a database. To give users a more flexible tool I want to embed a scripting language, so they can do more complex things like fire SQL queries, do loops and store data in variables and so on. In my business domain Python is widel...
Embed python/dsl for scripting in an PHP web application
0
1
0
570
7,530,645
2011-09-23T14:33:00.000
2
0
1
0
python,linux,packaging
7,532,916
2
false
0
0
Does anyone know how to solve this problem. You can't, really. If it's not the OpenSSL library that's a problem, it could be the C library itself, or some other critical component. Your best solutions are either: (A) Build a version of Python for each operating system you wish to support, or (B) Rework your code to ...
1
0
0
I have the following problem. I need to distribute our own version of python with some magic in it. In order to do this, the process is the following: I build the python interpreter (on a redhat linux) install it somewhere tar.gz the whole thing when it's time to make the user-package, unpack the tar.gz into the direc...
distributing own python, cross-linux
0.197375
0
0
119
7,532,339
2011-09-23T16:50:00.000
1
0
1
0
python
7,533,969
2
false
0
0
I had this same question and am always wondering why choose one over the other. Here's my approach. I learned python3 because it seems to have more 'stuff' in it than python2, but because most of the things can be done in either version, I usually code in python2. The reason, like Clark mentioned, is most of the mod...
2
0
0
I wanted to learn the python programming but I don't know which one to learn, I mean I think there are some difference between the two languages and I wanted to know which one is going to be used in the future. It does make sense if I learn Python 2.x and it is stopped being used by anyone. Any info please?
Which one to learn Python 3.x or Python 2.x?
0.099668
0
0
419
7,532,339
2011-09-23T16:50:00.000
1
0
1
0
python
7,532,717
2
false
0
0
Most useful modules still aren't ported to Python3. So if you need to call such things you are better off learning Python 2.x until they are ported. Even today the standard version of Python that OSes call is 2.x. (For instance OSX Lion has 2.7.1) Unless there's a compelling reason to use 3.x (such as just learning...
2
0
0
I wanted to learn the python programming but I don't know which one to learn, I mean I think there are some difference between the two languages and I wanted to know which one is going to be used in the future. It does make sense if I learn Python 2.x and it is stopped being used by anyone. Any info please?
Which one to learn Python 3.x or Python 2.x?
0.099668
0
0
419
7,532,972
2011-09-23T17:52:00.000
5
0
0
0
python,django,encryption
7,533,960
1
true
1
0
SSL is a de facto solution, but if for some reason you can't have it, then you'll find shelter in some javascript libraries that encrypt post data. And there are plenty of them if you search.. But I don't believe that any of them can achieve maximum security.
1
6
0
aside from using SSL, is there any way to encrypt a password in the Django framework on the first POST to the server? For example, if I have a form that accepts a username and password, then send it to another view, aren't the passwords sent to the backend unencrypted? If so, is there a way to encrypt the passwords bef...
Encrypting passwords on POST Django
1.2
0
0
2,645
7,533,050
2011-09-23T18:02:00.000
3
0
1
0
python,coding-style,import,comments
7,533,082
5
false
0
0
It's not bad practice at all. It's better to have more comments than less comments. By documenting the reasons you are using certain imports, it will explain to to the reader of your code the reason you have them, and maybe the reader might see why you did something and be able to come up with a better way to do it. ...
4
3
0
I'll try to make this as closed-ended of a question as possible: I often find that I have a group of imports that go together, like a bunch of mathy imports; but later on I might delete or move the section of code which uses those imported items to another file. The problem is that I often forget why I was using a part...
Python style: should I avoid commenting my import statements?
0.119427
0
0
1,256
7,533,050
2011-09-23T18:02:00.000
11
0
1
0
python,coding-style,import,comments
7,533,090
5
true
0
0
Well, the beautiful thing about python is that it is (or should be) explicit. In this case, so long as you're not doing * imports, (which is considered bad practice), you'll KNOW whether an import is referenced simply by doing a grep for the namespace. And then you'll know whether you can delete it. Allow me to also ad...
4
3
0
I'll try to make this as closed-ended of a question as possible: I often find that I have a group of imports that go together, like a bunch of mathy imports; but later on I might delete or move the section of code which uses those imported items to another file. The problem is that I often forget why I was using a part...
Python style: should I avoid commenting my import statements?
1.2
0
0
1,256
7,533,050
2011-09-23T18:02:00.000
1
0
1
0
python,coding-style,import,comments
7,533,088
5
false
0
0
I wouldn't call it a bad practice. Comments are to provide clarity, and that is what you're trying to do. However, if you're getting confused on what imports are being used for, I would recommend determining if perhaps your modules are getting too big anyway.
4
3
0
I'll try to make this as closed-ended of a question as possible: I often find that I have a group of imports that go together, like a bunch of mathy imports; but later on I might delete or move the section of code which uses those imported items to another file. The problem is that I often forget why I was using a part...
Python style: should I avoid commenting my import statements?
0.039979
0
0
1,256
7,533,050
2011-09-23T18:02:00.000
1
0
1
0
python,coding-style,import,comments
7,533,086
5
false
0
0
I'm pretty sure if you're adding meaningful comments anywhere in the code, it can only be a plus. I will sometimes add comments to strange/confusing imports, so I'd say go for it.
4
3
0
I'll try to make this as closed-ended of a question as possible: I often find that I have a group of imports that go together, like a bunch of mathy imports; but later on I might delete or move the section of code which uses those imported items to another file. The problem is that I often forget why I was using a part...
Python style: should I avoid commenting my import statements?
0.039979
0
0
1,256
7,534,244
2011-09-23T20:07:00.000
0
1
0
0
python,webserver
7,534,361
4
false
1
0
WSGI setups are fairly easy to get started, but in no anyway turn key. django MVC has a simple built in development server if you plan on using a more comprehensive framework.
4
0
0
For very simple, internal web-apps using ASP I was able to just switch IIS 'on' and then write some ASP scripts in the www directory that would start working immediately. Is there an equivalent webserver app for Python scripts that I can run that will automatically start serving dynamic pages (python scripts) in a cert...
What is a pythonic webserver equivalent to IIS and ASP?
0
0
0
394
7,534,244
2011-09-23T20:07:00.000
4
1
0
0
python,webserver
7,534,379
4
false
1
0
There's always CGI. Add a script mapping of .py to "C:\Python27\python.exe" -u "%s" then drop .py files in a folder and IIS will execute them. I'd not generally recommend it for real work—in the longer term you would definitely want to write apps to WSGI, and then deploy them through any number of interfaces including ...
4
0
0
For very simple, internal web-apps using ASP I was able to just switch IIS 'on' and then write some ASP scripts in the www directory that would start working immediately. Is there an equivalent webserver app for Python scripts that I can run that will automatically start serving dynamic pages (python scripts) in a cert...
What is a pythonic webserver equivalent to IIS and ASP?
0.197375
0
0
394
7,534,244
2011-09-23T20:07:00.000
0
1
0
0
python,webserver
7,534,417
4
false
1
0
My limited experience with Python web frameworks has taught me that most go to one extreme or the other: Django on one end is a full-stack MVC framework, that will do pretty much everything for you. On the other end, there are Flask, web.py, CherryPy, etc., which do much less, but stay out of your way. CherryPy, for ex...
4
0
0
For very simple, internal web-apps using ASP I was able to just switch IIS 'on' and then write some ASP scripts in the www directory that would start working immediately. Is there an equivalent webserver app for Python scripts that I can run that will automatically start serving dynamic pages (python scripts) in a cert...
What is a pythonic webserver equivalent to IIS and ASP?
0
0
0
394
7,534,244
2011-09-23T20:07:00.000
1
1
0
0
python,webserver
7,534,970
4
false
1
0
For development or just to play around, here's an example using the standard Python library that I have used to help friend who wanted to get a basic CGI server up and running. It will serve python scripts from cgi-bin and files from the root folder. I'm not near a Windows computer at the moment to make sure that this ...
4
0
0
For very simple, internal web-apps using ASP I was able to just switch IIS 'on' and then write some ASP scripts in the www directory that would start working immediately. Is there an equivalent webserver app for Python scripts that I can run that will automatically start serving dynamic pages (python scripts) in a cert...
What is a pythonic webserver equivalent to IIS and ASP?
0.049958
0
0
394
7,535,544
2011-09-23T22:41:00.000
1
1
0
0
php,python,google-app-engine
8,426,091
1
false
1
0
If you are using Google App Engine with Python you could use "Cron" to schedule a task to automatically run each day. GAE also allows you to send emails, just a little tip: make sure that you 'invite' the email address used to send mail to the application as an administrator so that you can programatically send emails ...
1
0
0
What is the best way to set up a system that checks for events daily and sends messages via email, Twitter, SMS, and possibly Facebook? Keep in mind, that I do not have access to a web server with root access (Using Rackspace Cloud). Would PHP have a solution for this? Would there be any drawbacks to using Google App E...
Check for Event Daily, and Send Notification Messages
0.197375
0
1
150