Q_Id
int64
2.93k
49.7M
CreationDate
stringlengths
23
23
Users Score
int64
-10
437
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
DISCREPANCY
int64
0
1
Tags
stringlengths
6
90
ERRORS
int64
0
1
A_Id
int64
2.98k
72.5M
API_CHANGE
int64
0
1
AnswerCount
int64
1
42
REVIEW
int64
0
1
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
15
5.1k
Available Count
int64
1
17
Q_Score
int64
0
3.67k
Data Science and Machine Learning
int64
0
1
DOCUMENTATION
int64
0
1
Question
stringlengths
25
6.53k
Title
stringlengths
11
148
CONCEPTUAL
int64
0
1
Score
float64
-1
1.2
API_USAGE
int64
1
1
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
15
3.72M
5,350,599
2011-03-18T10:21:00.000
0
0
0
0
0
python,mongodb,pymongo
0
5,377,084
0
3
0
false
0
0
You can simply get config databasr and execute find() on shards collection just like normal collection.
1
0
0
0
I have a Webserver running in Python. He is getting some Data from some Apps and need to store these in MongoDB. My MongoDB is sharded. Now i want that my Webserver know how much Shards MongoDB has. At the moment he reads this from a cfg file. There is an Statement in MongoDb named printshardingstatus where u can see all shards. So i tried to call this statement from my Pythonserver. But it seems that it is not possible.I dont find such a function in the Pymongo API. So my question is, is there an chance to run an MongoDB Statement in Python, so that it is directly passed and executed in MongoDB ?
Execute MongoDb Statements in Python
1
0
1
1
0
1,576
5,351,250
2011-03-18T11:23:00.000
0
0
0
0
1
python,web-services,soap,soaplib
0
5,389,161
0
1
0
true
1
0
a bit ugly, but looks like it works: if '' != length: body = input.read(int(length)) elif req_env.get("HTTP_TRANSFER_ENCODING").lower() == 'chunked': chunk_size = int(input.readline(), 16) while chunk_size > 0: chunk_read_size = 0 tmp = input.read(chunk_size) chunk_read_size += len(tmp) body += tmp while chunk_read_size
1
0
0
0
I have soap webservice built with soaplib, but if client sent chunked request it fails on length = req_env.get("CONTENT_LENGTH") body = input.read(int(length)) because length is '' (empty string), any ideas how to fix soaplib?
fix soaplib to support chunked requests
0
1.2
1
0
1
279
5,360,050
2011-03-19T04:22:00.000
2
0
0
1
0
python,linux,asynchronous,multiprocessing,gevent
0
6,671,124
0
2
1
false
0
0
I'd consider custom socket IPC or using ZeroMQ.
1
2
0
0
Scenario I have a server process implemented in Python and gevent, which is connecting to a backend service over TCP/IP and serving many Web clients (~1000 per process) with fast changing dynamic content based on the changes delivered by the backend service. The service is running on Ubuntu 10.04 and won't run on Windows, so the target platform is fixed. We're using Python 2.6.6, currently. Problem Serving the changes to that many clients can cause a lag in processing the changes sent by the backend, so my plan is to split the server into multiple processes. A number of worker processes would serve the Web clients, while the main process would still be connected to the backend service. I'm already using a separate pool of greenlets to serve the Web clients, but they need to be put into worker processes. Question Could you please point me to a working process pool implementation for gevent or figure out how can I use Python's own multiprocessing module with gevent the right way? Restrictions I would like to avoid introducing Python threads into our processes, since that would give room for GIL contention, which would reduce performance by introducing latencies. So it would be a clean multiprocessing + gevent solution, if possible.
What is the best way to implement a pool of worker processes compatible with gevent?
0
0.197375
1
0
0
1,761
5,370,778
2011-03-20T19:12:00.000
0
0
0
0
1
python,tcp,network-programming
0
5,370,827
0
2
0
false
0
0
In a thread that "serves" client use some global count that is increased when client connects and decreased when disconnects. If you want to count from OS level then use nestat -an with proper grep filter and wc -l (on Windows uses ports of grep and wc)
1
4
0
0
I'm using Pythons SocketServer.ThreadingTCPServer. Now I want to know how many clients are connected at a certain moment. How to solve this?
How to count connected clients in TCPServer?
0
0
1
0
1
4,268
5,371,632
2011-03-20T21:27:00.000
1
1
1
0
0
python,encoding,wxpython
0
5,371,727
0
3
0
true
0
0
If you want a really simply version, use python's base64 module. The file won't be recognizable opening in notepad anymore, but it'll be easy to decode if you know what you are doing. If you actually want to prevent any other program from being able to encode it: don't. You can spend a lot of effort and the only thing you can really accomplish is annoying the person who wants the data.
1
0
0
0
This one is a little tricky to explain. I would like to create a file, lets say, a .test file. Now, this is ridiculously easy to create and write, but I would like to encode the information so I could only interpret the information with the Test Program. So, this Test Program would be able to create and read the .test files. And the point is that, only that program can read the file, you can't really interpret the information just by opening the file with Notepad as it wouldn't be read-able. I would just like some direction as to how I could accomplish this. If you really didn't understand what I just said, I would like to know how to create or how does it work something similar to Bencode used in BitTorrent.
Encoding a file
0
1.2
1
0
0
165
5,371,808
2011-03-20T21:59:00.000
0
0
0
0
0
python,windows,internet-explorer,automation,pamie
0
5,372,020
0
1
0
false
0
0
It is ie.listBoxSelect, using the source code as documentation.
1
0
0
0
How do I interact with a select box using PAMIE?
how to interact with a `select` input with PAMIE?
0
0
1
0
0
132
5,377,347
2011-03-21T12:07:00.000
0
0
0
0
0
python,stocks
0
5,377,789
0
2
0
false
0
0
You could think about using a method that calculates the concave hull of your data. There are probably existing python implementations you could find. This will give you the boundary that encloses your timeseries. If there are outliers in your dataset that you wish to exclude, you could apply some sort of filter or smoothing to your data before you calculate the concave hull. I'm not 100% sure what you mean by "limit the number of touch points" and "find the relevant interval", but hopefully this will get you started.
1
0
1
0
I have read the topic: How do I calculate a trendline for a graph? What I am looking for though is how to find the line that touches the outer extreme points of a graph. The intended use is calculation of support, resistance lines for stock charts. So it is not a merely simple regression but it should also limit the number of touch points and there should be a way to find the relevant interval.
how to calculate trendline for stock charts
0
0
1
0
0
2,927
5,381,208
2011-03-21T17:17:00.000
2
0
0
0
0
python,flask
0
5,381,900
0
5
0
false
1
0
I can't see how there could be any way of stopping this from working. Flask and Bottle, like Django, are just Python underneath, and Python allows you to break up files into modules. As long as you importing the relevant functions into the main script, they will just work exactly as if they were defined there.
2
11
0
0
I've been looking into microframeworks for Python, and have come across two interesting options, Flask and Bottle. each have some similar features. One thing I noticed is that all the example sites show all the application code located inside a single Python file. Obviously, for even moderately sized sites, this would become difficult to manage quite quickly. Do either (or both) of these frameworks support being broken up among different files, and if so how would that be accomplished? I'm familiar with Django, and like how its a little more structured, but i would rather use something more lightweight, but still powerful.
Flask/Bottle project organization
0
0.07983
1
0
0
7,590
5,381,208
2011-03-21T17:17:00.000
0
0
0
0
0
python,flask
0
26,026,153
0
5
0
false
1
0
It really depends what you are trying to achieve, for micro service/applications/websites bottle is very straight forward and light weight. If you plan your application to grow by the time then Flask might be good option for you coz it has lot of extensions. We have about 40 to 50 micro services written in bottle and never faced any issues.
2
11
0
0
I've been looking into microframeworks for Python, and have come across two interesting options, Flask and Bottle. each have some similar features. One thing I noticed is that all the example sites show all the application code located inside a single Python file. Obviously, for even moderately sized sites, this would become difficult to manage quite quickly. Do either (or both) of these frameworks support being broken up among different files, and if so how would that be accomplished? I'm familiar with Django, and like how its a little more structured, but i would rather use something more lightweight, but still powerful.
Flask/Bottle project organization
0
0
1
0
0
7,590
5,382,305
2011-03-21T19:00:00.000
0
1
0
0
0
python,gstreamer
0
8,164,493
0
1
0
false
0
0
If you're creating a source element, you probably want to subclass gst.BaseSrc. Then, IIRC, the main thing you need to do is implement the do_create() virtual method. Don't forget to gobject.type_register() your class; you may also need to set the time format using set_format(). I second the recommendation to look at the Pitivi source code; it contains several GStreamer elements implemented in Python.
1
0
0
0
i have quite a lot of experience with python and gst-python, but no experience with plain gstreamer. does anyone know (well, someone on earth probably does but...) how to create a custom element? i got as far as class MyElement(Element): by intuition, but i have no idea what next... simply what i was hoping for was a "replace this function with the thing you want to happen to every unit that this element is passed", but i am pretty certain that it will be FAR more complicated than that....
How to make a custom element im gst-python
0
0
1
0
1
1,272
5,387,895
2011-03-22T07:09:00.000
2
0
1
0
0
python,character-encoding
1
58,780,738
0
7
0
false
0
0
I had exactly this issue in a recent project which really is a pain in the rear. I finally found it's because the Python we used in Docker has encoding "ansi_x3.4-1968" instead of "utf-8". So if anyone out there using Docker and got this error, following these steps may thoroughly solve your problem. create a file and name it default_locale in the same directory of your Dockerfile, put this line in it, environment=LANG="es_ES.utf8", LC_ALL="es_ES.UTF-8", LC_LANG="es_ES.UTF-8" add these to your Dockerfile, RUN apt-get clean && apt-get update && apt-get install -y locales RUN locale-gen en_CA.UTF-8 COPY ./default_locale /etc/default/locale RUN chmod 0755 /etc/default/locale ENV LC_ALL=en_CA.UTF-8 ENV LANG=en_CA.UTF-8 ENV LANGUAGE=en_CA.UTF-8 This thoroughly solved my issue when I built and run my Docker again, hopefully this solve your issue also.
2
78
0
0
I am parsing an XSL file using xlrd. Most of the things are working fine. I have a dictionary where keys are strings and values are lists of strings. All the keys and values are Unicode. I can print most of the keys and values using str() method. But some values have the Unicode character \u2013 for which I get the above error. I suspect that this is happening because this is Unicode embedded in Unicode and the Python interpreter cannot decode it. So how can I get rid of this error?
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 3 2: ordinal not in range(128)
0
0.057081
1
0
0
137,788
5,387,895
2011-03-22T07:09:00.000
0
0
1
0
0
python,character-encoding
1
47,410,460
0
7
0
false
0
0
for me this works unicode(data).encode('utf-8')
2
78
0
0
I am parsing an XSL file using xlrd. Most of the things are working fine. I have a dictionary where keys are strings and values are lists of strings. All the keys and values are Unicode. I can print most of the keys and values using str() method. But some values have the Unicode character \u2013 for which I get the above error. I suspect that this is happening because this is Unicode embedded in Unicode and the Python interpreter cannot decode it. So how can I get rid of this error?
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 3 2: ordinal not in range(128)
0
0
1
0
0
137,788
5,393,185
2011-03-22T14:58:00.000
-1
0
0
0
0
python,window,pygtk,gtk
0
5,441,492
0
4
0
false
0
1
You can also use gtk.Dialog.run (if it's a Dialog) aditional to gtk.Window.present
1
3
0
0
I have a gtk.Window. How do I set it to be the active window? I can call is_active() to see whether it already is, but I don't see where to make it active. Bonus points: given a gtk.Widget, how do I make the window it is a part of the active window?
gtk: set active window
0
-0.049958
1
0
0
4,336
5,397,528
2011-03-22T20:37:00.000
0
0
0
0
0
python,django,mercurial,apache2,mod-python
0
5,397,870
0
1
0
true
1
0
I thought about this, good idea for development. Use mercurial in common way. And of course you need deploy mercurial server before. If you update your django project, it will be compiled on the fly. My workflow: Set up mercurial server or use bitbucket Init repo locally Push repo to central repo On server pull repo in some target dir Edit smth locally and push to central repo Pull repo on server and everything is fine
1
0
0
0
I'm creating a server with Apache2 + mod_python + Django for development and would like to know how to use Mercurial to manage application development. My idea is to make the folder where the Mercurial stores the project be the same folder to deploy Django. Thank you for your attention!
How to use Mercurial to deploy Django applications?
0
1.2
1
1
0
627
5,402,847
2011-03-23T09:02:00.000
0
0
0
0
0
python,django
0
5,403,151
0
2
0
true
1
0
Django doesn't really offer you place where things that are commonly used all over the project can live. I think the most common approach to solve this is to create a 'project'-app, which holds such project-relevant things like models, templatetags or widgets for example...
2
0
0
0
I'm trying to start with Django. I'm developing an App. This App is called "Directory" and will store info about websites. I must to create a database table called "Genders", but this is a generic database table and could be used in other App. My question... how to deal with this kind of situation in Django? And in wich model I shuld put this database table? Best Regards,
Where to put generic Database Tables on Django?
0
1.2
1
0
0
208
5,402,847
2011-03-23T09:02:00.000
1
0
0
0
0
python,django
0
5,403,490
0
2
0
false
1
0
In django, you don't (generally) create database tables. You create models, and let the django ORM create tables for you. To prevent having two tables in your database called gender, django will prefix the model name with the name of the app. Thus, if your app was called foo, your model class was Gender, you would have foo_gender. But, you don't need to know this. As for the specific case of Gender: I wouldn't bother storing this in the database in a special table. They don't make new genders anymore. If you need to store a field containing a gender, then just use django.db.models.CharField, with a choices=(('M',"Male"),('F',"Female")). Or if you do it lots, then create a new field. If it is something you do need to be able to add dynamically to the database, then either abstract it out into a reusable app, or as someone else mentioned, create a sundry/project/utils app.
2
0
0
0
I'm trying to start with Django. I'm developing an App. This App is called "Directory" and will store info about websites. I must to create a database table called "Genders", but this is a generic database table and could be used in other App. My question... how to deal with this kind of situation in Django? And in wich model I shuld put this database table? Best Regards,
Where to put generic Database Tables on Django?
0
0.099668
1
0
0
208
5,407,664
2011-03-23T15:30:00.000
0
0
1
0
0
python,netbeans,ide,tabstop
0
5,512,865
0
1
0
true
0
0
...Netbeans want to switch from spaces to tabs, not the other way around... ergh – Rafe Kettler Mar 23 at 15:36 I use netbeans meanwhile and like it. Yes I converted all spaces to tabs and retab it to 4 in php and python regards
1
0
0
0
For a python project I am trying an IDE, coming from vim but I have troube how my code is shown resp. indentation. Many lines should be indented because they are inside if-then-else statements. In SPE and netbeans there are many lines where the indention-space (four) are collapsed. But I checked the files with tabnanny and pylint and cant see indention problems. ANd the code has been running up to now. How can i check that? Where is the "show whitespace" toggle in netbeans?
Tab/spaces indention issues in IDE's vs vim
0
1.2
1
0
0
310
5,415,600
2011-03-24T06:37:00.000
7
0
0
0
0
python,django
0
29,631,137
0
3
0
false
1
0
Most the time, loading the page in a new tab can be a real pain in the ar** for the user. Nevertheless it can still be necessary sometimes. If you really need to render your POST results in a new tab, use the target="_blank" as an attribute of your <form>.
1
13
0
0
i have to open the result page using render_to_response on a new tab
how to open url in new tab from django?
0
1
1
0
0
28,137
5,427,875
2011-03-25T02:21:00.000
2
0
0
0
0
python,macos,tkinter,exit
0
5,427,950
0
1
0
false
0
1
I figured out how. I just put a simple exit() command after the main loop.
1
2
0
0
I need to know how to do this on a mac because whenever I try quitting it, I have to force quit it. Is there a proper way when the user clicks the exit button that Tkinter will exit normally?
Python: How can I make my tkinter app exit properly?
0
0.379949
1
0
0
888
5,436,185
2011-03-25T17:49:00.000
2
0
0
0
0
python,url,ipv6,libpcap,sniffing
0
5,446,765
0
1
0
true
0
0
Unfortunately, with IPv6 you are stuck doing your own TCP re-assembly. The good news that you are only concerned with URL data which should (generally) be in one or two packets. You should be able to get away with using pylibpcap to do this. You'll want to use setfilter on your pcap object to make sure you are only looking at TCP traffic. As you move forward in your pcap loop you'll apply some HTTP regular expressions to the payload. If you have what looks like HTTP traffic go ahead and try to parse the header to get at the URL data. Hopefully, you'll get full URL with a line break before the end of the packet. If not, you are going to have to do some lightweight TCP reassembly. Oh, and you'll want to use socket.inet_ntop and socket.getaddrinfo to print out info about the IPv6 host.
1
5
0
0
Does anyone know how to write a live data sniffer in Python which extracts the originating IP address and the full URL that was being accessed? I have looked at pulling data from urlsnarf however IPv6 is not supported (and the connections will be to IPv6 hosts). While I can pull data from tcpdump and greping for GET/POST that would leave me with simply the path on the webserver, and I would not obtain the associated FQDN. Unfortunately using SQUID w/ IPv6 TPROXY is not an option due to the configuration of the environment. Does anyone have any ideas on how to do this with Python bindings for libpcap? Your help would be most appreciated :) Thanks :)
URL Sniffing in Python
0
1.2
1
0
1
1,843
5,445,994
2011-03-26T23:07:00.000
6
0
0
0
0
python,regex,django
0
5,446,040
0
4
0
false
1
0
Don't ever send passwords in the URL. They belong in the POST body, which is not stored by browsers (you can repeat POSTs in browsers, but POST data is not stored in the history).
1
0
0
0
I want to match a url that: begins with /signup and ends with password=goodbye That's it. If something begins with that and ends with that, how do I match that in regex? I understand that I should do this in urls.py, but I have to because of certain reasons. Please answer how I would match it this way. I have to because a iPhone client (which cannot be changed) hardcoded it this way. I know it's not ideal, but I have to match it this way now.
How do I match this URL in Django's urls.py?
0
1
1
0
0
1,876
5,447,482
2011-03-27T05:42:00.000
0
1
1
0
0
php,python,debugging
0
5,447,505
0
5
0
false
0
0
Python has a debugger: pdb. If you use Werkzeug, then you can also access each frame of a stack trace and debug there on an error
3
0
0
0
I am quite new with development. In some programming language such as python and PHP there is not a good debugger. How is the development going on without a debugger? just put the logs in the source code? Especially for the framework developers, how do they test their codes? Thank you very much. -Stefan-
How a framework development works without a debugger?
0
0
1
0
0
94
5,447,482
2011-03-27T05:42:00.000
2
1
1
0
0
php,python,debugging
0
5,447,522
0
5
0
false
0
0
Your answer concerning the debugging in Python is truly nonsense. Python has a reasonable "pdb" debugger which is useful since years. Apart from that you can have a powerful IDE as WingIDE giving you all debugging and inspection power you need. Making such wild claims about Python is not appropriate. That's why this question deserves a clear downvote.
3
0
0
0
I am quite new with development. In some programming language such as python and PHP there is not a good debugger. How is the development going on without a debugger? just put the logs in the source code? Especially for the framework developers, how do they test their codes? Thank you very much. -Stefan-
How a framework development works without a debugger?
0
0.07983
1
0
0
94
5,447,482
2011-03-27T05:42:00.000
0
1
1
0
0
php,python,debugging
0
5,452,043
0
5
0
false
0
0
python -m pdb foo.py And even without using that, usually you get detailed tracebacks when an error happens so many people don't know about pdb because they can just read the error message containing everything they ever wanted to know. It's not like C where it just goes boom and says "Segmentation fault" and leaves you with nothing to work on.
3
0
0
0
I am quite new with development. In some programming language such as python and PHP there is not a good debugger. How is the development going on without a debugger? just put the logs in the source code? Especially for the framework developers, how do they test their codes? Thank you very much. -Stefan-
How a framework development works without a debugger?
0
0
1
0
0
94
5,448,698
2011-03-27T10:38:00.000
6
0
0
1
0
python,google-app-engine,sendmail
0
5,450,093
0
1
0
true
1
0
You can't. Sending email from someone without their knowledge isn't permitted by App Engine. You can send email from any administrator address; you could add a "[email protected]" type address as an administrator and send email from that address.
1
3
0
0
I'm using GAE send mail- but I dont want the sender of the mail to get a coppy of the mail. as for now, when a user is sending mail he gets a mail saying that he sent a mail to someone and the body of the sent mail, how do I disable that?
how to have google apps engine send mail- not send a copy of the mail to the sender
0
1.2
1
0
0
288
5,449,091
2011-03-27T12:05:00.000
0
1
0
0
0
python,twitter
0
16,450,651
0
4
0
false
0
0
The newest version of python-twitter allows you to retweet with the command api.PostRetweet(tweet_id) where api is a logged-in api and tweet_id is the id of the tweet you want to retweet.
1
4
0
0
I wanted to know if this was possible- I want to use Python to retweet every tweet a person sends out. If yes then how can I implement this?
Sending out twitter retweets with Python
1
0
1
0
1
4,449
5,453,256
2011-03-27T23:36:00.000
0
0
0
0
0
python,tkinter,pyusb
0
5,489,197
0
2
0
false
0
1
Might I suggest that instead of trying to constantly monitor the presence of a USB device you include a search or refresh button that will check just once.
1
2
0
0
I would like to monitor the presence of USB devices and have found modules such as PyUSB that serve this purpose. However, I don't know how to run USB detection services alongside the Tkinter main loop. Is this possible?
Tkinter and detection of USB devices
0
0
1
0
0
874
5,473,301
2011-03-29T13:29:00.000
0
0
1
0
0
python,format,xls
0
5,473,492
0
4
0
false
0
0
If the available tools like xlrd, xlwt, and xlutils don't work, you may have to fall back to programmatically editing the file with Excel via COM. Of course, you'll need a copy of Excel, have to work from Windows, and it will be slower than other approaches.
1
2
0
0
Is there a way to write something into an XLS file with python while keeping the initial format of this XLS file unchanged (such as font size, cell background color, etc)Thanks!
how to write into XLS with python with format unchanged?
0
0
1
0
0
763
5,473,340
2011-03-29T13:31:00.000
3
0
0
0
0
python,django,django-models,django-templates,captcha
0
5,473,845
0
4
0
false
1
0
Your question about which 3rd party solution is "better" is subjective, and stackoverflow doesn't generally like to answer subjective questions. Take some time and evaluate each in light of your needs. You often don't need a fancy image captcha. Even a simple question like "what color is an orange?" will stop most spam bots. I posed a simple question on my registration form, asking the user to type the domain name of the site. Simple but very effective. You can also include an input box on the form, and hide it with CSS (display: none). If this input comes back to you filled out, chances are good a bot is trying to register. It doesn't really matter that these 3rd party solutions are using Django forms, and you are using "simple HTML". In your registration view, you simply process request.POST. It doesn't matter how the form was generated.
1
0
0
0
I am a Django newbie. I created an app which has a user login/registration page. Now I want to include CAPTCHA also in the registration page. Can somebody guide me how to implement this in Django as i am quite new to it. On googling I found there are many modules which do the function out of the box. If this is the way to go, then which application is a better choice? Also I found most of them were explained on the basis of using Django Forms. But I used simple HTML forms instead of Django forms. Any help would be appreciated.
Including CAPTCHA on user registration page with Django
0
0.148885
1
0
0
2,880
5,479,387
2011-03-29T21:52:00.000
-1
0
0
1
1
python,perl,iis,iis-7,cgi
1
5,479,573
0
3
0
false
1
0
the windows TCP stack is limited to 4GB file uploads. Anymore than that is not possible.
2
1
0
0
We need to handle massive file uploads without spending resources on an IIS 7 server. To emphasize how light-weight this needs to be, let's say that we need to handle file uploads of sizes that are completely insane, like 100GB uploads, or something that can continue running for an extremely long time without consuming additional resources. Basically we need something that gives us control over the reception of the file from the moment it starts to the moment it ends. A bit of background: We're using ColdFusion as the server-side processor, but it has failed us when handling uploads beyond about 1GB and we've exhausted our configuration options. There's a long story behind that, but essentially, if a .cfm page (ColdFusion) is the destination of the file upload and it goes over about 1GB, it gives a 503 error... even if the target file doesn't exist. So clearly too much is going on merely by telling the server that we intend to process the file with a .cfm page. We suspect that this is due to Java limitations because the server (or really, the workstation in this case) does not show any signs of load on CPU or memory. Since we have limited memory and this website is intended for a lot of concurrent uploads, we can't trust simply raising the virtual machine memory usage, especially because that simply doesn't work currently, even for a single connection... let alone the hundreds of concurrent connections we expect when we go live. So we're down to writing a specialized solution using CGI that will handle file uploads only. Basically, we need control on the server-side that we don't get with ColdFusion or ASP.NET because those technologies do so many things on their own, behind the scenes, without giving us the control we need. They always end up spending up too many resources one way or the other for an arguably obvious reason; what we're trying to do is completely insane and not the intended function of those technologies. That's why we want a specialized uploader through CGI that bypasses all that ColdFusion/ASP.NET magic that keeps getting in the way, hoping it gives us the control we need. But before we spent countless hours on this, I figured I'd ask around and see if anyone knows of a proper solution to this problem that might be viable in our case. The only real restriction here is that it has to be CGI, and it has to run on IIS 7, therefore a Windows "Server" environment. We're fine with it being written in Python, Perl, name it... provided it can run as a CGI, but it has to run as a CGI... unless of course someone has better ideas on how to do this. So the magic question is; are there CGI solutions out there that already do this or are we stuck with writing it on our own, hoping that the reason no one else has done it already is some other than it being impossible? Thanks in advance.
Need CGI (or another solution compatible with IIS 7) to handle *massive* uploads
0
-0.066568
1
0
0
300
5,479,387
2011-03-29T21:52:00.000
3
0
0
1
1
python,perl,iis,iis-7,cgi
1
5,483,933
0
3
0
false
1
0
You want WebDAV, not CGI. It provides all the nice bits that make file transfers not suck, like resuming and pausing.
2
1
0
0
We need to handle massive file uploads without spending resources on an IIS 7 server. To emphasize how light-weight this needs to be, let's say that we need to handle file uploads of sizes that are completely insane, like 100GB uploads, or something that can continue running for an extremely long time without consuming additional resources. Basically we need something that gives us control over the reception of the file from the moment it starts to the moment it ends. A bit of background: We're using ColdFusion as the server-side processor, but it has failed us when handling uploads beyond about 1GB and we've exhausted our configuration options. There's a long story behind that, but essentially, if a .cfm page (ColdFusion) is the destination of the file upload and it goes over about 1GB, it gives a 503 error... even if the target file doesn't exist. So clearly too much is going on merely by telling the server that we intend to process the file with a .cfm page. We suspect that this is due to Java limitations because the server (or really, the workstation in this case) does not show any signs of load on CPU or memory. Since we have limited memory and this website is intended for a lot of concurrent uploads, we can't trust simply raising the virtual machine memory usage, especially because that simply doesn't work currently, even for a single connection... let alone the hundreds of concurrent connections we expect when we go live. So we're down to writing a specialized solution using CGI that will handle file uploads only. Basically, we need control on the server-side that we don't get with ColdFusion or ASP.NET because those technologies do so many things on their own, behind the scenes, without giving us the control we need. They always end up spending up too many resources one way or the other for an arguably obvious reason; what we're trying to do is completely insane and not the intended function of those technologies. That's why we want a specialized uploader through CGI that bypasses all that ColdFusion/ASP.NET magic that keeps getting in the way, hoping it gives us the control we need. But before we spent countless hours on this, I figured I'd ask around and see if anyone knows of a proper solution to this problem that might be viable in our case. The only real restriction here is that it has to be CGI, and it has to run on IIS 7, therefore a Windows "Server" environment. We're fine with it being written in Python, Perl, name it... provided it can run as a CGI, but it has to run as a CGI... unless of course someone has better ideas on how to do this. So the magic question is; are there CGI solutions out there that already do this or are we stuck with writing it on our own, hoping that the reason no one else has done it already is some other than it being impossible? Thanks in advance.
Need CGI (or another solution compatible with IIS 7) to handle *massive* uploads
0
0.197375
1
0
0
300
5,479,897
2011-03-29T22:56:00.000
1
0
1
0
0
python
0
5,479,995
0
3
0
false
0
0
You need to use the os.path library. If you start off with directory d then os.path.abspath(os.path.join(d, '..')) will return that directory's parent. You do this until you get to /mnt, for each directory running chown on it.
1
1
0
0
Folks, Might find this on searching, but need this rather quickly done: I have the path like this: /mnt/path1/path2/path3/ I need to chown all the directories such as /mnt, /mnt/path1, /mnt/path1/path2, /mnt/path1/path2/path3, how to get this done in python? I cannot do 'chown -R /mnt/' since it tries to chown all the files/directories that exist beneath path3, but I wish to chown only upto path3 here for example. Thank you for any suggestions!
Python: How to do this string manipulation
0
0.066568
1
0
0
292
5,484,900
2011-03-30T10:09:00.000
3
0
0
1
1
python,google-app-engine,local-storage
0
5,486,121
0
2
0
true
1
0
How the datastore reads and writes its underlying files varies - the standard datastore is read on startup, and written progressively, journal-style, as the app modifies data. The SQLite backend uses a SQLite database. You shouldn't have to care, though - neither backend is designed for robustness in the face of failure, as they're development backends. You shouldn't be modifying or deleting the underlying files, either.
1
0
0
0
I have just noticed that when I have a running instance of my GAE application, there nothing happens with the datastore file when I add or remove entries using Python code or in admin console. I can even remove the file and still have all data safe and sound in admin area and accessible from code. But when I restart my application, all data obviously goes away and I have a blank datastore. So, the question - does GAE reads all data from the file only when it starts and then deals with it in the memory, saving the data after I stop the application? Does it make any requests to the datastore file when the application is running? If it doesn't save anything to the file while it's running, then, possibly, data may be lost if the application unexpectedly stops? Please make it clear for me if you know how it works in this aspect.
Does local GAE read and write to a local datastore file on the hard drive while it's running?
0
1.2
1
0
0
196
5,491,851
2011-03-30T20:19:00.000
4
0
1
0
0
python,couchdb
0
5,498,961
0
1
0
true
0
0
I just added show/list support to couchdb-python. Any problems, please use the mailing list.
1
2
0
0
The python-couchdb package ( used as import couchdb ) provides a db.view() function to access a couchdb "_view", but how do you access a "_show" or "_list" function?
CouchDB and Python: how to use "_show" and "_list" functions?
0
1.2
1
0
0
429
5,498,704
2011-03-31T10:54:00.000
0
0
1
1
0
python,file-management
0
5,631,968
0
2
0
true
0
0
It is impossible, OS does not store such info about files. Answered by 'atzz' in comment
1
0
0
0
lets say that some files were renamed by Python script, is it possible to get this 'rename time' using Python (It can be seen in Far Manager)? (Windows) It seems it is not possible through STAT, etc Any ideas ?
python file was renamed, how to get 'rename time'
1
1.2
1
0
0
239
5,502,787
2011-03-31T16:01:00.000
2
0
1
0
0
c++,python,c,connection,io
0
5,502,815
0
3
0
true
0
0
Yes. Open the first file in Python, process it and save the results to a second file. Then open the second file in your C or C++ program and use the data.
1
3
0
0
What I am trying to do is that I want to read a file using python, and then with the data in the file, create a variable in c/c++(I don't want to read var from the file :) ). Is this possible? If this is possible, then how would you do it? Thank you guys!
connecting c/c++ and python
1
1.2
1
0
0
5,001
5,514,330
2011-04-01T13:51:00.000
2
0
1
0
0
python
0
5,514,359
0
4
0
false
0
0
Google for python decorator and you will find enough answers to your question.
1
1
0
0
Just a quick question, Could someone link me to the documentation for the use of @ in python? Due not being able to google @ and not knowing the use or name of it I'm not sure how to find it on my own :) Many thanks!!
Python documentation for @?
0
0.099668
1
0
0
366
5,529,075
2011-04-03T10:38:00.000
3
0
1
0
0
python,large-data,database
0
5,529,194
0
3
0
false
0
0
Go with a NoSQL database like MongoDB which is much easier to handle data in such a case than having to learn SQL.
1
4
0
0
I'm working on an academic project aimed at studying people behavior. The project will be divided in three parts: A program to read the data from some remote sources, and build a local data pool with it. A program to validate this data pool, and to keep it coherent A web interface to allow people to read/manipulate the data. The data consists of a list of people, all with an ID #, and with several characteristics: height, weight, age, ... I need to easily make groups out of this data (e.g.: all with a given age, or a range of heights) and the data is several TB big (but can reduced in smaller subsets of 2-3 gb). I have a strong background on the theoretical stuff behind the project, but I'm not a computer scientist. I know java, C and Matlab, and now I'm learning python. I would like to use python since it seems easy enough and greatly reduce the verbosity of Java. The problem is that I'm wondering how to handle the data pool. I'm no expert of databases but I guess I need one here. What tools do you think I should use? Remember that the aim is to implement very advanced mathematical functions on sets of data, thus we want to reduce complexity of source code. Speed is not an issue.
Handle large data pools in python
0
0.197375
1
0
0
1,451
5,538,280
2011-04-04T12:14:00.000
3
0
0
0
0
python,parsing,redirect
0
5,538,415
0
2
0
false
0
0
You can not get hold of the redirection URL through parsing the HTML source code. Redirections are triggered by the server and NOT by the client. You need to perform a HTTP request to the related URL and check the HTTP response of the server - in particular for the HTTP status code 304 (Redirection) and the new URL.
1
6
0
0
I made a little parser using HTMLparser and I would like to know where a link is redirected. I don't know how to explain this, so please look this example: On my page I have a link on the source: http://www.myweb.com?out=147, which redirects to http://www.mylink.com. I can parse http://www.myweb.com?out=147 without any problems, but I don't know how to get http://www.mylink.com.
Determining redirected URL in Python
0
0.291313
1
0
1
8,180
5,553,798
2011-04-05T14:46:00.000
3
0
1
0
0
c++,python,boost
0
5,951,300
0
2
0
false
0
0
bjam is used for compiling boost itself (although your can use it as configuration tool for your code aswell). Running the utility should compile the library and does not require any further work, afaik. The include and library paths you have listed in your second post are correct, as far as I can tell (assuming the path to the directories you listed is correct, e.g: C:\Python27\include). While I was playing around with boost.python, I found out I was not able to compile any C++/Python libraries with a 64 bit version of Python installed. I first had to remove the 64 bit version and install the 32 bit version. Also the compilation was only successful if I included #define BOOST_PYTHON_STATIC_LIB before the #include statements. I still have not figured out why. I hope my answer (my first one ever on this site, so don't be too harsh with me ;) ) was of any use.
2
4
0
0
I'm having a bit of trouble finding a guide that allows me to integrate the Boost.Python compilation into VS 8. It seems like it depends heavily on this bjam utility to build the source, but there isn't any mention of how this can integrate into VS 8 interface. I can see that the bjam program calls VS 8 to do much of the compilation.
Integrating Boost.Python with Visual Studio 8
0
0.291313
1
0
0
1,049
5,553,798
2011-04-05T14:46:00.000
0
0
1
0
0
c++,python,boost
0
5,556,549
0
2
0
false
0
0
I found the issue, thanks for the suggestion Phillip. It turns out I just needed to provide the correct header and library directories to VS 8 and compile as a DLL (not a console program). Include Directories: \boost-python\boost_1_46_1 \Python27\include` Library Directories: \Python27\libs \boost-python\boost_1_46_1\stage\lib` Can anyone confirm these are the right directories to be used for including and linking?
2
4
0
0
I'm having a bit of trouble finding a guide that allows me to integrate the Boost.Python compilation into VS 8. It seems like it depends heavily on this bjam utility to build the source, but there isn't any mention of how this can integrate into VS 8 interface. I can see that the bjam program calls VS 8 to do much of the compilation.
Integrating Boost.Python with Visual Studio 8
0
0
1
0
0
1,049
5,568,330
2011-04-06T14:48:00.000
5
0
1
1
0
python,macos
0
5,568,374
0
1
0
true
0
0
You can simply type python3.2 instead of just python to use python 3.2.
1
6
0
0
Python 2.5 came installed on my Mac. I downloaded Python 3.2 and have it running in my IDE. When I open the terminal in Mac and type in Python, it tells me I'm working with 2.5. 1) What do I enter in the command line to change from 2.5 to 3.2? 2) Once I get to 3.2 (using your answer), how do I get back to 2.5 if I want to? Thanks for your help.
Changing versions of Python in command line
0
1.2
1
0
0
3,806
5,572,489
2011-04-06T20:22:00.000
1
0
0
1
0
python,pdf,printing,pygtk
0
5,572,506
0
3
0
false
0
1
Have you considered generating HTML?
1
2
0
0
I am developing an application which has to be able to print a couple of pages with Python. Now I am searching for a method to create these pages and print them. It should work on Linux and Windows. The pages contain tables, images and text. I developed the GUI with PyGtk, but I think it's convenient to create an image or PDF and print it. I have no idea how to do this. Anyone knows a good way for this? Note: The problem isn't the generation. It is the printing of that file.
OS independent printing with Python
0
0.066568
1
0
0
2,696
5,581,005
2011-04-07T12:28:00.000
1
0
0
0
0
python,django
0
5,581,104
0
2
0
false
1
0
You can use Django Debug Toolbar and enable it only for choosen IPs
1
1
0
0
I'm supplying a Django project to a client, who has requested a 'debugging' page that will show useful information. [UPDATE for clarity: We'd like this page so we can use it for debugging in future: the clients are not very technical and I won't have direct access to their servers. In the event of future issues, it would be very useful if I could check out this page without asking them to edit the Debug setting or do any other server-side fiddling.] The project will be running in production, so I can't set DEBUG=True. What I would like is a page similar to the Django debugging page but without any sensitive information in. I guess I can simply write my own, but does anyone have any ideas? Anything standard in Django I could use? Thanks!
Add a debugging page to a Django project?
0
0.099668
1
0
0
94
5,581,466
2011-04-07T12:59:00.000
1
0
0
0
0
python,mysql,django,django-models,django-blob
0
5,581,586
0
3
0
true
1
0
Django's ORM has no field for binary large objects. Either use something like a FileField, or search for candidate field classes using a search engine.
1
2
0
0
I want to create a table like so - CREATE TABLE trial_xml ( id int(11) DEFAULT NULL, pid int(11) DEFAULT NULL, sid varchar(256) CHARACTER SET utf8 NOT NULL, data blob, PRIMARY KEY (soid), KEY suid_index (suid) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 my question is how do I set "data" field as "blob" in django's models.py ?? I mean what's the syntax? UPDATE: I dont want to set data field as longtext. I want only blob datafield.
Django models "blob" field
0
1.2
1
0
0
4,606
5,587,280
2011-04-07T20:34:00.000
1
0
1
0
0
python,substitution,encryption
0
5,587,409
0
3
0
false
0
0
I would first get a list of English words for reference. Next construct a list of possible 2 and 3 letter words. Then just start testing those small words in your cipher. Once you guess at a small word, check the larger words against your word list. If some of the words no longer have possible completions in the list, you're on the wrong track. If a word only has one possible completion, accept it as correct and continue. Eventually, you'll either reach a solution where all words are in your English word list, or you'll reach a point where there is no solution for a word.
1
1
0
0
I know similar questions have been asked, but this is kind of a trivial case. Given a text file endcoded with a substitution cipher, I need to decode it using python. I am not given any examples of correctly deciphered words. The relationship is 1-to-1 and case doesn't make a difference. Also, punctuation isn't changed and spaces are left where they are. I don't need help with the code as much as I need help with a general idea of how this could be done in code. My main approaches involve: Narrowing down the choices by first solving 1, 2 or 3 character words. I could use an list of English words of different sizes to compare. I could use frequency distributions of the letters. Does anyone have an idea of a general approach I could take to do this?
Solving a substitution cipher with python
0
0.066568
1
0
0
6,917
5,588,081
2011-04-07T21:50:00.000
0
0
0
0
0
python,django
0
5,588,180
0
1
0
true
1
0
If you are calling admin.autodiscover() in your urls.py Django's admin.site will be looking for admin.py files in all packages of your INSTALLED_APPS and import all found ModelAdmin classes and add them to the admin.site. You have three inputs for SearchKeyword appearing in the admin because the there are three InlineAdmin's added.
1
0
0
0
I am reading Chapter 3 of "Practical Django Projects", on how to make a CMS. I have improved the search function and everything works fine. However I am wondering why everythings works... On page 35, I have added an admin.py file in the cms/search/ directory. How does the compiler know that he needs to take this file into account ? On page 36-37, there is an improved version of the cms/search/models.py. It seems that the new file adds not just 1 keyword, but 3 ! How come ? Thanks a lot
"Practical Django Projects" - Search function
1
1.2
1
0
0
179
5,591,230
2011-04-08T06:20:00.000
-3
1
0
0
0
php,python
0
5,591,381
0
2
0
false
0
0
After some clarifications at last it came clear that your question was "how to connect PHP to HTTP server" So, actually you were interested in three letters: CGI. However I still doubt you will get any good from it.
1
1
0
0
How can I make a PHP 5.3 webserver using Python? I know how to make a simple HTTP server, but how can I include PHP? Thanks.
PHP Webserver in Python
0
-0.291313
1
0
1
1,908
5,602,488
2011-04-09T02:22:00.000
2
0
1
0
0
python,permutation,random-sample
0
5,602,512
0
6
0
false
0
0
I don't know how python implements its shuffle algorithm, but the following scales in linear time, so I don't see why a length of 10 is such a big deal (unless I misunderstand your question?): start with the list of items; go through each index in the list in turn, swapping the item at that index it for an item at a random index (including the item itself) in the remainder of the list. For a different permutation, just run the same algorithm again.
2
3
1
0
How to randomly pick all the results, one by one (no repeats) from itertools.permutations(k)? Or this: how to build a generator of randomized permutations? Something like shuffle(permutations(k)). I’m using Python 2.6. Yeah, shuffle(r) could be used if r = list(permutations(k)), but such a list will take up too much time and memory when len(k) raises above 10. Thanks.
Random picks from permutation generator?
0
0.066568
1
0
0
4,221
5,602,488
2011-04-09T02:22:00.000
2
0
1
0
0
python,permutation,random-sample
0
5,603,207
0
6
0
false
0
0
There's no way of doing what you have asked for without writing your own version of permutations. Consider this: We have a generator object containing the result of permutations. We have written our own function to tell us the length of the generator. We then pick an entries at random between the beginning of the list and the end. Since I have a generator if the random function picks an entry near the end of the list the only way to get to it will be to go through all the prior entries and either throw them away, which is bad, or store them in a list, which you have pointed out is problematic when you have a lot of options. Are you going to loop through every permutation or use just a few? If it's the latter it would make more sense to generate each new permutation at random and store then ones you've seen before in a set. If you don't use that many the overhead of having to create a new permutation each time you have a collision will be pretty low.
2
3
1
0
How to randomly pick all the results, one by one (no repeats) from itertools.permutations(k)? Or this: how to build a generator of randomized permutations? Something like shuffle(permutations(k)). I’m using Python 2.6. Yeah, shuffle(r) could be used if r = list(permutations(k)), but such a list will take up too much time and memory when len(k) raises above 10. Thanks.
Random picks from permutation generator?
0
0.066568
1
0
0
4,221
5,612,390
2011-04-10T14:24:00.000
0
0
0
1
1
python,django,google-app-engine
0
5,612,643
0
2
0
true
1
0
Thanks Abdul you made me realize what the problem is. I had changed a URL in my application to point to the application that I had deployed to Google-App Engine. It should have been pointing to my local application. I had myapp.appspot.com/move instead of localhost/move
1
1
0
0
I'm wondering if anyone has experienced problems with Google-App Engine's logging facility. Everything was working fine for me until this morning, I ran my local server and no logging messages were being displayed (well, none of my logging messages, the server GET messages etc.. are being displayed). Even errors are not being reported. I have no idea what is going on. If this has happened to anyone, can you please advise on how to fix it?
Google-App Engine logging problem
1
1.2
1
0
0
252
5,614,372
2011-04-10T20:07:00.000
3
1
1
0
0
python,c,encoding
0
5,614,405
0
2
0
true
0
0
C as a language does not facilitate string encoding. A C string is simply a null-terminated sequence of characters (8-bit signed integers, on most systems). A wide string (with characters of type wchar_t, typically 16-bit integers) can also be used to hold larger character values; however, again, C standard library functions and data types are in no way aware of any concept of string encoding. The answer to your question is to ensure that the strings you're passing into Python are encoded as UTF-8. In order to help you accomplish that in any detailed capacity, however, you will have to provide more information about how your strings are currently formed, what they contain, and how you're constructing your argument list for exec.
1
0
0
0
How can i change character encoding of a string to UTF-8? I am making some execv calls to a python program but python returns the strings with the some characters cut of. I don't know if this a python issue or c issue but i thought if i can change the strings encoding in c and then pass it to python, it should do the trick. So how can i do that? Thanks.
How to change a strings encoding as utf 8 in C
0
1.2
1
0
0
1,560
5,617,641
2011-04-11T06:40:00.000
2
0
1
0
0
python,fortran
1
5,618,401
0
2
0
false
0
0
Your basic problem is that you are storing large arrays of data on the stack. This is bad design and is probably due to the way the Fortran code is implemented. Large arrays need to be stored on the heap and dynamically allocated there. To solve this problem you will need to understand and modify your Fortran code accordingly. The ALLOCATE keyword is how you create heap allocated data in Fortran 90. However, many compilers have options that for arrays to be allocated on the heap and that may be the most expedient route for you right now.
1
0
0
0
I have a python code which imports dll's created by f2py (from fortran routines). Now the python program crashes if the arrays in fortran are too large. How do I manage with this? By increasing stack size? Or heap? I've tried to study the matter, but I still do not understand how I can increase the stack or should I use the heap instead and how I should do that..??? Python always crashes on the line where I try to import the dll, i.e., at line "import f90_routine". Someone also mentioned threads, but I do not know how to use them. Hope someone can help me!!
dll load error in python due to insufficient stack size?
0
0.197375
1
0
0
295
5,621,952
2011-04-11T13:20:00.000
0
0
1
1
0
macos,uninstallation,python-3.2
0
23,726,032
1
3
0
false
0
0
just uninstall 3x version of python if you have already installed it. Eclipse has that option when you click "see whats already installed". Install later 2.7 version. It works for me on my OS X 10.9.2 with Eclipse Juno.
2
10
0
0
According to the documentation from python.org, python 3.2 install on mac os requires an upgrade to tcl/tk 8.5.9 (for use of IDLE). In my haste, I have done both. Now my friend told me that python 3 is not recommended yet because only the built-ins and a few modules have been released for 3. The stable one so far is 2.7 (especially if one wants to make extensive use of a variety of modules). My machine has both 2.6.1 and 3.2 (because some OS services make use of 2.6.1 that comes as default with the OS). 1. How do i remove 3.2 completely to avoid any compatibility issues? tcl/tk 8.5.9 was also installed and this is not the default. There was no verbose mode during installation, so I don't know whether it replaced the default one. If it did how bad can it be for the OS? and hence 2. If the above is really bad, how do i downgrade to the old version of tcl/tk? In short, how do i bring my machine back to its original state? If anyone knows all the paths to the directories and files I can do it manually. Thanks
Uninstall python 3.2 on mac os x 10.6.7
0
0
1
0
0
19,603
5,621,952
2011-04-11T13:20:00.000
4
0
1
1
0
macos,uninstallation,python-3.2
0
5,627,279
1
3
0
false
0
0
I did the same (3.2 on a mac 10.6) and: -Moved both the Python 3.2 folder and the ActiveState ActiveTcl folder from the Applications Folder to the Trash. -Moved the Python.framework folder from the Library/Frameworks folder to the Trash. Running System profiler shows only the 2.6 version of Python. Marcos
2
10
0
0
According to the documentation from python.org, python 3.2 install on mac os requires an upgrade to tcl/tk 8.5.9 (for use of IDLE). In my haste, I have done both. Now my friend told me that python 3 is not recommended yet because only the built-ins and a few modules have been released for 3. The stable one so far is 2.7 (especially if one wants to make extensive use of a variety of modules). My machine has both 2.6.1 and 3.2 (because some OS services make use of 2.6.1 that comes as default with the OS). 1. How do i remove 3.2 completely to avoid any compatibility issues? tcl/tk 8.5.9 was also installed and this is not the default. There was no verbose mode during installation, so I don't know whether it replaced the default one. If it did how bad can it be for the OS? and hence 2. If the above is really bad, how do i downgrade to the old version of tcl/tk? In short, how do i bring my machine back to its original state? If anyone knows all the paths to the directories and files I can do it manually. Thanks
Uninstall python 3.2 on mac os x 10.6.7
0
0.26052
1
0
0
19,603
5,626,672
2011-04-11T19:46:00.000
0
0
0
0
1
python,django,testing,django-models,django-testing
0
5,626,840
0
1
0
true
1
0
You could try creating a whole new app that you only use on your development server. E.g., if your app is called myapp you would call your testing app myapp_test. Then in myapp_test's models.py you would from myapp import models and then subclass your models in there. Then in your settings.py you either just try and remember to comment out the myapp_test application from INSTALLED_APPS when deploying to your production server. Or you can use the local_settings.py methodology to only have the myapp_test included in INSTALLED_APPS on your test machine.
1
1
0
0
Is it possible to have a set of models just for testing purposes? The idea is that I've written an app that contains some helper abstract model HelperBase. Now I'd like to provide some models that would inherit from it in order to test it, say DerivedTest1, DerivedTest2. However I wouldn't really like those test models to appear in the production database in the end. I just want their tables to be constructed in the test database. Is it possible and if so - how to do it? I've already tried creating models in the tests.py file but this doesn't seem to work.
Test specific models in Django
1
1.2
1
0
0
292
5,627,868
2011-04-11T21:37:00.000
1
0
0
0
1
python,django,unicode,utf-8,scrapy
0
5,628,065
0
3
0
false
1
0
U+FFFD is the replacement character that you get when you do some_bytes.decode('some-encoding', 'replace') and some substring of some_bytes can't be decoded. You have TWO of them: u'H\ufffd\ufffdftsitz' ... this indicates that the u-umlaut was represented as TWO bytes each of which failed to decode. Most likely, the site is encoded in UTF-8 but the software is attempting to decode it as ASCII. Attempting to decode as ASCII usually happens when there is an unexpected conversion to Unicode, and ASCII is used as the default encoding. However in that case one would not expect the 'replace' arg to be used. More likely the code takes in an encoding and has been written by someone who thinks "doesn't raise an exception" means the same as "works". Edit your question to provide the URL, and show the minimum code that produces u'H\ufffd\ufffdftsitz'.
1
3
0
0
I'm using Scrapy and Python (as part of a Django project) to scrape a site with German content. I have libxml2 installed as the backend for Scrapy selectors. If I extract the word 'Hüftsitz' (this is how it is displayed on the site) through selectors, I get: u'H\ufffd\ufffdftsitz' (Scrapy XPath selectors return Unicode strings). If I encode this into UTF-8, I get: 'H\xef\xbf\xbd\xef\xbf\xbdftsitz'. And if I print that, I get 'H??ftsitz' which isn't correct. I am wondering why this may be happening. The character-set on the site is set to UTF-8. I am testing the above on a Python shell with sys.getdefaultencoding set to UTF-8. Using the Django application where the data from XPath selectors is written to a MySQL database with UTF-8 character set, I see the same behaviour. Am I overlooking something obvious here? Any clues or help will be greatly appreciated.
Unicode and UTF-8 encoding issue with Scrapy XPath selector text
1
0.066568
1
0
0
15,989
5,636,251
2011-04-12T13:47:00.000
0
1
0
0
0
python
0
5,639,270
0
1
0
false
0
0
The description for the Digi 3G states that it is capable of python scripting, using a custom development environment. To make this work, you would have to use the python source code from paramiko; the executable would not be installable directly on the router (since the executable is designed to be run on a computer, not a router). The source code would probably have to be modified, since the APIs for this sort of thing are most likely different than those in a computer, and the router would have to be capable of what you are asking of it.
1
0
0
0
I'm using a Digi 3G router that can be programmed with python, and I want it to make periodic SSH connections to another device. I've read everything about paramiko, but don't know how to install it in the router. I want to know if there is any other way of including paramiko into a device, apart from installing (i.e. including some library), or if it exist another possibility apart from paramiko for this particular case. Thanks in advance.
SSH connection with python from a device (not computer)
0
0
1
0
1
202
5,660,354
2011-04-14T08:14:00.000
0
0
1
0
0
python,gtk,wxpython
1
5,660,469
0
1
0
false
0
1
Add the directory containing the library given in the error to your ld search paths. See the ldconfig(8) man page for details.
1
0
0
0
I am a relative newbie with Python and was trying to install wxPython 2.9 using Python 2.6. I did a build from source and then installed the package both being done in a non-standard (local) path. When I try and import wx (having provided the path to the installation folder in my environment variable), I get the following error message: "ImportError: libwx_gtk2u_xrc-2.9.so.1: cannot open shared object file: No such file or directory". Can someone please tell me if I need to build gtk separately? And if yes, how do I go about doing it?
Error while installing wxPython package in a non-standard path
0
0
1
0
0
380
5,661,385
2011-04-14T09:49:00.000
3
0
1
1
0
python
0
5,733,166
0
9
0
false
0
0
This will vary depending on your target market. In specialized niche industries there is more variety in how stuff is distributed. In heavily commoditized areas I would expect native OS package (at least if I were a customer). I tend to take the quality of the deployment package as indicative of the quality of the software in general. I associate native OS packages as higher quality than other formats largely because the dependency information can be complete. This makes it easier to do some compliance testing and change management. Native OS Packages For Unices consider creating native OS packages. They provide better integration and visibility with processes like compliance, change management, dependency management, etc. For OSX others have already suggested py2app. You may also be able to leverage MacPorts package format or the Fink package format. For Windows others have already suggested py2exe. Relocation and Config Requirements Put your Python executable under .../libexec. This prevents it from accidentally being called. Change the name of the Python executable to prevent confusion. ie. /usr/local/libexec/<pkg>_python Distribute the .py for the bins to make them easily relocatable. You can change the Magic Cookie at install time to whatever the location your Python was installed in via an install script. The only code you need in the bin is a line that calls into your lib which is a pyc. Install your libs in the correct location under /usr/local/lib/app_python/site_package/... and you won't need to use PYTHONPATH. Shared Libraries If I remember correctly you'll want to make sure you strip any rpath entries from the libs as this can mess with their ability to be relocated. The native OS packaging should help with any dependencies the shared libs require.
2
37
0
0
I have the task of packaging and shipping a commercial application bundle, which will include: a python library (developed by us) some python programs depending on the library above additional libraries not developed by us, but which are dependencies of our library. a complete python installation (python 2.6) additional stuff, libs and programs in other languages. Not a concern here, as they are not hooked into the above machinery, and the current shipping process works already. The bundle is shipped to Linux, OSX and Windows. On Linux, it's distributed as a simple tar.gz. The user just unpacks the tar.gz and source a provided bash script in .bashrc, so that the environment is correctly set. On mac, it's a dmg. On windows, I have no idea. The windows guy is not here today, but what I see is that an exe is created somehow. I will now explain in more detail the above points. Our Python Library We don't want to give out sources, so we want to provide only compiled python files. A better strategy to make them even more tamper-proof is welcome, even if it involves some deep hacking (e.g. I once saw magic done importing stuff from a .zip which was "corrupted" ad-hoc). The library at the moment does not have C level code or similar platform dependent code, but this is going to change soon. We will therefore have to provide platform-specific compiled .so together with the pyc. Clearly, this library will be shipped in the package, together with the rest of our application. It will therefore be installed on the downloaded bundle. For this reason, it must be fully relocatable, and the user must in some way (either manually or via our env script) add the location of the untarred package to PYTHONPATH, so that the interpreter can find it. Our Python Programs We will ship applications in our bundle, and these applications will depend on our library. The code of these applications must be either visible by the user (so that he can learn how to use the library interface), or not visible (for those utilities we want to keep closed-source), so a double approach is called for. Additional Libraries Our library depends on 3rd party libraries we will have to ship, so that the user is up and running without any dependency hunting. Clearly, these libraries will be installed by us in the bundle, but we must hope these don't store the install path somewhere during the build, because that would make them non relocatable. Our python We will ship our version of python, which we assume the user will run in order to access our script. This is because we want to be sure of the python version running. Also, we may tinker a bit the executable or the standard library. We may have a concern about the interaction of this python with the standard python, and if the user wants a specific library on our python it will have to install it within our bundled package, and not on the standard place for libraries. Request I need to make my mind around this task. I've seen it done, but never done it personally, so I need your point of view. What I presented above is how I think things should work, according to how things are working right now, but it may be wrong. Any hint, quirk, suggestion, or strategy for a successful deployment is welcome. Given the complexity of the question, I already announce a high bounty on it, according to the best answer I can get.
Packaging and shipping a python library and scripts, the professional way
0
0.066568
1
0
0
8,155
5,661,385
2011-04-14T09:49:00.000
15
0
1
1
0
python
0
5,731,719
0
9
0
true
0
0
This is not a complete answer but just a bunch of ideas. I wrote an installer for a client that incorporated some ideas that might be useful to you. It was Linux only so I focussed on just that. We needed to ship specific custom versions of mySQL, lighttpd, python, memcached, a few 3rd party Python modules and some custom scripts. We needed to launch all these services without any problems and let the user control them using regular initscripts. It should work fine on a bunch of popular distros and therefore shouldn't rely on distro specific stuff. What I did was as follows. Created a 500MB (I'm don't recollect the size) file and formatted it as an ext3fs file system. Mounted it at a point using a loopback device. Ran deb-bootstrap on the mountpoint to create a custom Debian install. Chrooted inside the partition and then ran a bunch of scripts which did an apt-get install on all our dependencies, installed all the eggs and other packages which were necessary for the app, installed the app itself in /opt (inside the chroot), installed supervisord (to do process management) and set things up. Now, this partition was a completely self contained Linux filesystem that contained the application and everything needed to run it. You could dump it anywhere, chroot inside it and launch the app. The only dependency it had with the outside world were the ports it would use for its services and the supervisord control socket. This was the main point. We were able to include exactly what we needed (compiled files, .pycs only etc.) for a few of the applications and didn't have to bother with any limitations in standard installation tools. After this, we packaged a few extra scripts that would go into the external operating system. These were custom made for each distro that we would have to support. This part was distro specific. There were scripts that would go into /etc/init.d and some scripts that would setup the database and stuff at the beginning. We then created an archive of the entire filesystem using makeself. It would checksum stuff and all that and provide a self extracting archive which if run would untar the whole thing into /opt on the host machine, chroot inside the directory and run a setup script that would ask the user a few questions like db username/password etc. and set things up. After that, it would fetch the scripts I mentioned in step 5 and put them on the host OS. The initscripts would simply chroot into the partition and start supervisord. It would then take care of launching all the services we cared about. Shutting down the application was simply a matter of connecting to running supervisord and running a command. We wrapped this in the initscript so that the user experience was UNIX like. Now, we'd give clients the self extracting .run file. They'd run it, get asked a few questions and it would create a directory under /opt which contained our app and all it's dependencies. The init scripts would be modified to start our app on bootup and things would work as expected. I think step 4 gives you the freedom to install whatever you want, however you want so that things would work fine.
2
37
0
0
I have the task of packaging and shipping a commercial application bundle, which will include: a python library (developed by us) some python programs depending on the library above additional libraries not developed by us, but which are dependencies of our library. a complete python installation (python 2.6) additional stuff, libs and programs in other languages. Not a concern here, as they are not hooked into the above machinery, and the current shipping process works already. The bundle is shipped to Linux, OSX and Windows. On Linux, it's distributed as a simple tar.gz. The user just unpacks the tar.gz and source a provided bash script in .bashrc, so that the environment is correctly set. On mac, it's a dmg. On windows, I have no idea. The windows guy is not here today, but what I see is that an exe is created somehow. I will now explain in more detail the above points. Our Python Library We don't want to give out sources, so we want to provide only compiled python files. A better strategy to make them even more tamper-proof is welcome, even if it involves some deep hacking (e.g. I once saw magic done importing stuff from a .zip which was "corrupted" ad-hoc). The library at the moment does not have C level code or similar platform dependent code, but this is going to change soon. We will therefore have to provide platform-specific compiled .so together with the pyc. Clearly, this library will be shipped in the package, together with the rest of our application. It will therefore be installed on the downloaded bundle. For this reason, it must be fully relocatable, and the user must in some way (either manually or via our env script) add the location of the untarred package to PYTHONPATH, so that the interpreter can find it. Our Python Programs We will ship applications in our bundle, and these applications will depend on our library. The code of these applications must be either visible by the user (so that he can learn how to use the library interface), or not visible (for those utilities we want to keep closed-source), so a double approach is called for. Additional Libraries Our library depends on 3rd party libraries we will have to ship, so that the user is up and running without any dependency hunting. Clearly, these libraries will be installed by us in the bundle, but we must hope these don't store the install path somewhere during the build, because that would make them non relocatable. Our python We will ship our version of python, which we assume the user will run in order to access our script. This is because we want to be sure of the python version running. Also, we may tinker a bit the executable or the standard library. We may have a concern about the interaction of this python with the standard python, and if the user wants a specific library on our python it will have to install it within our bundled package, and not on the standard place for libraries. Request I need to make my mind around this task. I've seen it done, but never done it personally, so I need your point of view. What I presented above is how I think things should work, according to how things are working right now, but it may be wrong. Any hint, quirk, suggestion, or strategy for a successful deployment is welcome. Given the complexity of the question, I already announce a high bounty on it, according to the best answer I can get.
Packaging and shipping a python library and scripts, the professional way
0
1.2
1
0
0
8,155
5,677,809
2011-04-15T13:54:00.000
1
1
1
0
0
python,testing
0
5,677,921
0
3
0
false
0
0
Altering sys.path much in production environment may be unwise. Altering it for testing is usually OK. If you don't want to tinker with the variable from sys, use an environment variable named PYTHONPATH, it's a clean and documented way.
2
20
0
0
I'm in the process of redesigning/refactoring my Python quantum chemistry package (pyquante). One of the things I don't like about the existing release is that I have to install the package to run the test suite. That is, the test suite has statements like from PyQuante import SCF, and, of course, this PyQuante could refer to the installed version or a local version. I know about virtualenv, and realize this is an option for me. But I was wondering whether anything else might be appropriate. In the past I've hacked sys.path for things like this, and have been told by better Python programmers that I shouldn't ever to this. Does anyone have any suggestions for how I can do this? The point is that I want to test the current version of the code without installing it. Thanks in advance for anyone who can see through my babbling and offer suggestions!
How can I test my python module without installing it
0
0.066568
1
0
0
10,868
5,677,809
2011-04-15T13:54:00.000
6
1
1
0
0
python,testing
0
5,678,267
0
3
0
false
0
0
I would honestly insist on using virtualenv, its designed for this exact reason in mind. very small overhead, and if you ever mess up just delete directory. I am sure as you grow, things won't be as simple as they are now for your current situation. Take it as an opportunity to learn.
2
20
0
0
I'm in the process of redesigning/refactoring my Python quantum chemistry package (pyquante). One of the things I don't like about the existing release is that I have to install the package to run the test suite. That is, the test suite has statements like from PyQuante import SCF, and, of course, this PyQuante could refer to the installed version or a local version. I know about virtualenv, and realize this is an option for me. But I was wondering whether anything else might be appropriate. In the past I've hacked sys.path for things like this, and have been told by better Python programmers that I shouldn't ever to this. Does anyone have any suggestions for how I can do this? The point is that I want to test the current version of the code without installing it. Thanks in advance for anyone who can see through my babbling and offer suggestions!
How can I test my python module without installing it
0
1
1
0
0
10,868
5,679,203
2011-04-15T15:44:00.000
0
1
0
1
0
python,django,linux,fabric
0
5,680,308
0
2
0
false
0
0
You could also try any of the distributed computing packages. Pyro is one of them that might interest you.
1
1
0
0
We have around 250 identical linux server which runs a business critical web application for a bank. Basically we do a lot of scripting work but now i want to centralize that only in one location. That means run on one server and and deploy it in many. I know you guys must be thinking that this is an easy task and can be done with a shell script. But again we need to create many different different scripts to do our work I know python has a big library and this can be possible but i dont know how. To cut in short i need all scripts in one file and based on the argument it will execute it according. For example in a python program we have a function where we can mix them to perform different result. So you please let me know how to go about it
Python scripting in linux
1
0
1
0
0
304
5,680,487
2011-04-15T17:50:00.000
0
0
0
0
0
python,image,performance,wxpython
0
5,681,008
0
2
0
false
0
1
I would think a ListCtrl in ICON style would be the best way to do this. If you look at the wxPython Demos, the UltimateListCtrl sample in the wx.LC_ICON style is a good example of what you could create.
1
1
0
0
Which is the most efficient method to display a grid of about 1000 clickable images in wxPython ? Currently i am using a GridSizer filled with StaticBitmap objects. But its quite slow for 500+ images. One more thing is that, i have a listbox of categories on the left. That is to filter the images. Categories will be like "All", "Cat 1", "Cat 2" etc. When i click "All", all the image have to be displayed. How i am doing this currently : A VERTICAL BoxSizer will contain n GridSizer objects, one for each category. I add the StaticBitmap objects to multiple GridSizers depending on the categories it belongs to. Then i display only that GridSizer depending on which category is selected This method is also terribly slow for anything over 300 images. So, how do i achieve the same effect efficiently ? .
Efficient method for a grid of clickable images in wxPython?
0
0
1
0
0
796
5,681,407
2011-04-15T19:26:00.000
1
0
1
0
0
python
0
5,681,599
0
3
0
false
0
0
Basic idea Open the file Iterate over the lines For every line read, increment some counter, e.g. line_no += 1; Split the line by whitespace (you will get a list) Check if the list contains the word (use in), then use list.index(word) to get the index, store that index in some variable word_no = list.index(word) print line_no and word_no if the word was found There are a lot better solutions out there (and more pythonic ones) but this gives you an idea.
1
1
0
0
i wonder how to know , a position inside the .txt when I read. this is my txt cat dog monkey bird this my printing Word: cat Position: line 1 , word 1 (1,1) any idea?
How to know a position (.txt)
0
0.066568
1
0
0
262
5,688,053
2011-04-16T16:51:00.000
5
0
1
0
0
python,django,virtualenv
0
21,246,463
1
3
0
false
1
0
Since the question was about easy_install, it's useful to know that (with setuptools v2.1) you can specify version numbers with easy_install like you can with pip. Thus: $ easy_install django==1.3 will install django 1.3. This was important for my problem (which Google directed me here to solve), when I needed to install an old version of pip with easy install. Obviously "just install pip and do it there" doesn't work for that problem.
1
8
0
0
I just broke my environment because of django 1.3. None of my sites are able to run. So, i decided to use virtualenv to set virtual environment with different python version as well as django. But, seems like if i download the package and install using "sudo python setup.py install" this does not get added to my virtual environment, but my original environment. I tried "easy_install django" in virtual environment virtualenv_name/bin folder, and it worked, but the problem is django1.3 was chosen automatically and got added. I want to install django 1.2.5, is there a way that i can install easily to my virtual env?
how do you install django older version using easy_install?
1
0.321513
1
0
0
12,466
5,692,968
2011-04-17T10:22:00.000
1
0
0
0
0
python,qt,python-3.x,pyqt4
0
5,693,049
0
1
0
true
0
1
Didn't use this for some thime, but I think you had to change paletteForegroundColor and change segmentStyle to QLCDNumber::Filled or QLCDNumber::Flat
1
0
0
0
Using PyQt4 and Python 3 do you know how I can change the color of a QLcdNumber during the runtime ?
Change the color of the text of QLcdNumber
0
1.2
1
0
0
1,466
5,705,420
2011-04-18T15:41:00.000
1
0
0
0
0
python,twisted
0
5,707,345
0
1
0
false
0
0
You have code in the sample you pasted which takes an action when an XML-RPC call completes. printValue prints the result of a call and printError print an error which occurs during a call. If you want to make another call after one finishes, then maybe instead of just printing something in printValue, you could issue another Server.callRemote there.
1
1
0
0
I have a simple client code using xmlrpclib. try: Server.func1 Server.func2 ..... Server.funcN except: pass , where Server - ServerProxy from xmlrpclib. How to do this on twisted ? I see this example: from twisted.web.xmlrpc import Proxy from twisted.internet import reactor def printValue(value): print repr(value) reactor.stop() def printError(error): print 'error', error reactor.stop() Server = Proxy('http://advogato.org/XMLRPC') Server.callRemote('func1',).addCallbacks(printValue, printError) reactor.run() but how to add several nesting callRemote functions ?
using several xmlrpc commands on twisted
0
0.197375
1
0
1
305
5,732,384
2011-04-20T14:56:00.000
0
1
0
1
0
python,wordpress
0
5,732,608
0
2
0
false
1
0
Urllib is an option, but because your script is running on the local machine anyway, I would probably use os.system. That way you can execute the php script like from a shell. You have to look into the php file on how to pass the parameters.
2
3
0
0
I have a python program that sets up a wordpress site on my server. It downloads the zip and unzips it into a directory, sets up the database and user, configures the config file. Now I would like to call the the wp_install function in wp-admin/include/upgrade.php and pass it the parameters it needs $weblog_title, $user_name, $admin_email ... My question is how can I call this function from python? Can I do a urllib.urlopen and if so how do I call the wp_install function with the right parameters?
Automate WordPress Install from python
0
0
1
0
0
1,206
5,732,384
2011-04-20T14:56:00.000
1
1
0
1
0
python,wordpress
0
5,732,698
0
2
0
false
1
0
It looks like wp_install() gets called inside of /wp-admin/install.php during step 1, and after form data has been validated. If you submit ?step=1& ... (all of the other required form fields) it should result in calling wp_install. So yes, you should be able to use urllib(2) for this.
2
3
0
0
I have a python program that sets up a wordpress site on my server. It downloads the zip and unzips it into a directory, sets up the database and user, configures the config file. Now I would like to call the the wp_install function in wp-admin/include/upgrade.php and pass it the parameters it needs $weblog_title, $user_name, $admin_email ... My question is how can I call this function from python? Can I do a urllib.urlopen and if so how do I call the wp_install function with the right parameters?
Automate WordPress Install from python
0
0.099668
1
0
0
1,206
5,736,264
2011-04-20T20:31:00.000
6
0
1
0
0
python,singleton,static-methods
0
5,736,285
0
1
0
false
0
0
By definition, a static method does not have a self parameter. That's what makes it static. If it did have a self parameter, it would be a regular method and not a static method.
1
1
0
0
As in the title I want to know how to have a self instance in a staticmethod in python.
How to have a self instance in a staticmethod in Python
0
1
1
0
0
213
5,737,483
2011-04-20T22:42:00.000
6
0
0
0
0
python,django,svn
0
5,737,523
0
1
0
true
1
0
You can have a post-commit hook in the svn repo that uses, ideally, a restful interface to your Django app and adds the note. That way your app remains very simple.
1
1
0
0
I have a small bug tracker written in django. I'd like to integrate it with an svn repository so that when someone commits to svn it will automatically add a note to an issue in the bug tracker. Does anyone have any input on how to best approach this? Should I setup svn hooks? use a cron job and pull from the log?
SVN Integration with django
0
1.2
1
0
0
478
5,760,936
2011-04-22T23:18:00.000
0
0
1
0
0
python,string,unicode,character-encoding
0
27,403,026
0
5
1
false
0
0
Do not str() cast to string what you've got from model fields, as long as it is an unicode string already. (oops I have totally missed that it is not django-related)
1
19
0
0
I am dealing with unicode strings returned by the python-lastfm library. I assume somewhere on the way, the library gets the encoding wrong and returns a unicode string that may contain invalid characters. For example, the original string i am expecting in the variable a is "Glück" >>> a u'Gl\xfcck' >>> print a Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 2: ordinal not in range(128) \xfc is the escaped value 252, which corresponds to the latin1 encoding of "ü". Somehow this gets embedded in the unicode string in a way python can't handle on its own. How do i convert this back a normal or unicode string that contains the original "Glück"? I tried playing around with the decode/encode methods, but either got a UnicodeEncodeError, or a string containing the sequence \xfc.
Handle wrongly encoded character in Python unicode string
0
0
1
0
0
41,975
5,771,925
2011-04-24T17:03:00.000
1
0
0
0
0
python,mysql
0
5,771,943
0
5
0
false
0
0
Not possible with standard SQL functionality.
2
10
0
0
In Python, is there a way to get notified that a specific table in a MySQL database has changed?
python: how to get notifications for mysql database changes?
1
0.039979
1
1
0
30,571
5,771,925
2011-04-24T17:03:00.000
10
0
0
0
0
python,mysql
0
5,771,988
0
5
0
false
0
0
It's theoretically possible but I wouldn't recommend it: Essentially you have a trigger on the the table the calls a UDF which communicates with your Python app in some way. Pitfalls include what happens if there's an error? What if it blocks? Anything that happens inside a trigger should ideally be near-instant. What if it's inside a transaction that gets rolled back? I'm sure there are many other problems that I haven't thought of as well. A better way if possible is to have your data access layer notify the rest of your app. If you're looking for when a program outside your control modifies the database, then you may be out of luck. Another way that's less ideal but imo better than calling an another program from within a trigger is to set some kind of "LastModified" table that gets updated by triggers with triggers. Then in your app just check whether that datetime is greater than when you last checked.
2
10
0
0
In Python, is there a way to get notified that a specific table in a MySQL database has changed?
python: how to get notifications for mysql database changes?
1
1
1
1
0
30,571
5,780,397
2011-04-25T16:17:00.000
0
0
0
0
0
python,django,django-filer
0
13,129,716
0
2
0
false
1
0
Had a similar problem. I had missed that when easy_thumbnails is automatically pulled in by pip, you still have to explicitly add it to your INSTALLED_APPS in settings.py. I spotted this because when I was uploading images, they weren't appearing in the clipboard, and when inspecting the response from the upload, there was an internal server error complaining that an easy_thumbnails table wasn't available. tl;dr; check you added easy_thumbnails to your settings and did a migration / syncdb
1
3
0
0
Can someone point me in the right direction on how to use Django-filer? I have installed the necessary tools for the filer to work and I get the Filer tab in the admin interface, but when I upload an image to the app I am not able to get the preview thumbimage. The image is also uploaded to the Media_root path(Public files default path). What else have I missed?
How to use Django-filer(asset file manager)?
0
0
1
0
0
1,363
5,788,891
2011-04-26T10:18:00.000
1
0
1
1
0
python,shell
0
33,261,131
0
13
0
false
0
0
Besides subprocess.call, you can also use subprocess.Popen. Like the following subprocess.Popen(['./script', arg1, arg2])
1
74
0
0
I would like to run a command in Python Shell to execute a file with an argument. For example: execfile("abc.py") but how to add 2 arguments?
Execute a file with arguments in Python shell
0
0.015383
1
0
0
186,617
5,789,455
2011-04-26T11:12:00.000
0
0
0
1
0
python,windows,delphi,lua,desktop-application
0
5,789,728
0
2
0
false
0
0
Does anyone use anything else for shrink wrap apps on windows? e.g. Java, python etc. Yes. I assume you're not really asking about Java, since that is so wide-spread. I can count quite a few Java applications that I use, and I don't operate in the "Enterprise" environment. There are tools that allow you to ship Python code without shipping actual .py files and without needing the to actually have Python installed, so there are solutions for that as well. Since such tools exist I assume people do ship Python applications. If so how do you distribute your app and does using a scripting language cause any problems with the installation? What scripting language?
1
2
0
0
Does anyone use a scripting language only solution to produce a binary (.exe) to produce a commercial desktop application for windows or mac? e.g. Java, python etc. If so how do you distribute your app and does using a scripting language cause any problems with the installation? I'm asking about users that can download an application and install it, they don't know about setting path variables, or changing there JAVA_HOME. The assumption for the PC are users with a consumer PC with windows (XP/Vista/7), not power users. (Or alternatively a mac type solution would be interesting to hear about to)
desktop development language compiled binary or scripting language (windows)?
0
0
1
0
0
525
5,795,492
2011-04-26T19:35:00.000
7
0
0
0
0
python,sqlalchemy,eager-loading
0
5,819,858
0
2
1
true
0
0
To force loading lazy attributes just access them. This the simplest way and it works fine for relations, but is not as efficient for Columns (you will get separate SQL query for each column in the same table). You can get a list of all unloaded properties (both relations and columns) from sqlalchemy.orm.attributes.instance_state(obj).unloaded. You don't use deferred columns in your example, but I'll describe them here for completeness. The typical scenario for handling deferred columns is the following: Decorate selected columns with deferred(). Combine them into one or several groups by using group parameter to deferred(). Use undefer() and undefer_group() options in query when desired. Accessing deferred column put in group will load all columns in this group. Unfortunately this doesn't work reverse: you can combine columns into groups without deferring loading of them by default with column_property(Column(…), group=…), but defer() option won't affect them (it works for Columns only, not column properties, at least in 0.6.7). To force loading deferred column properties session.refresh(obj, attribute_names=…) suggested by Nathan Villaescusa is probably the best solution. The only disadvantage I see is that it expires attributes first so you have to insure there is not loaded attributes among passed as attribute_names argument (e.g. by using intersection with state.unloaded). Update 1) SQLAlchemy does track loaded objects. That's how ORM works: there must be the only object in the session for each identity. Its internal cache is weak by default (use weak_identity_map=False to change this), so the object is expunged from the cache as soon as there in no reference to it in your code. SQLAlchemy won't do SQL request for query.get(pk) when object is already in the session. But this works for get() method only, so query.filter_by(id=pk).first() will do SQL request and refresh object in the session with loaded data. 2) Eager loading of relations will lead to fewer requests, but it's not always faster. You have to check this for your database and data. 2.1) Refetching data from database won't unload objects bound via relations. 2.2) item.group is loaded using query.get() method, so there won't lead to SQL request if object is already in the session. 2.3) Yes, it depends on situation. For most cases it's the best is to hope SQLAlchemy will use the right strategy :). For already loaded relation you can check if related objects' relations are loaded via state.unloaded and so recursively to any depth. But when relation is not loaded yet you can't get know whether related objects and their relations are already loaded: even when relation is not yet loaded the related object[s] might be already in the session (just imagine you request first item, load its group and then request other item that has the same group). For your particular example I see no problem to just check state.unloaded recursively.
1
7
0
0
I have some database structure; as most of it is irrelevant for us, i'll describe just some relevant pieces. Let's lake Item object as example: items_table = Table("invtypes", gdata_meta, Column("typeID", Integer, primary_key = True), Column("typeName", String, index=True), Column("marketGroupID", Integer, ForeignKey("invmarketgroups.marketGroupID")), Column("groupID", Integer, ForeignKey("invgroups.groupID"), index=True)) mapper(Item, items_table, properties = {"group" : relation(Group, backref = "items"), "_Item__attributes" : relation(Attribute, collection_class = attribute_mapped_collection('name')), "effects" : relation(Effect, collection_class = attribute_mapped_collection('name')), "metaGroup" : relation(MetaType, primaryjoin = metatypes_table.c.typeID == items_table.c.typeID, uselist = False), "ID" : synonym("typeID"), "name" : synonym("typeName")}) I want to achieve some performance improvements in the sqlalchemy/database layer, and have couple of ideas: 1) Requesting the same item twice: item = session.query(Item).get(11184) item = None (reference to item is lost, object is garbage collected) item = session.query(Item).get(11184) Each request generates and issues SQL query. To avoid it, i use 2 custom maps for an item object: itemMapId = {} itemMapName = {} @cachedQuery(1, "lookfor") def getItem(lookfor, eager=None): if isinstance(lookfor, (int, float)): id = int(lookfor) if eager is None and id in itemMapId: item = itemMapId[id] else: item = session.query(Item).options(*processEager(eager)).get(id) itemMapId[item.ID] = item itemMapName[item.name] = item elif isinstance(lookfor, basestring): if eager is None and lookfor in itemMapName: item = itemMapName[lookfor] else: # Items have unique names, so we can fetch just first result w/o ensuring its uniqueness item = session.query(Item).options(*processEager(eager)).filter(Item.name == lookfor).first() itemMapId[item.ID] = item itemMapName[item.name] = item return item I believe sqlalchemy does similar object tracking, at least by primary key (item.ID). If it does, i can wipe both maps (although wiping name map will require minor modifications to application which uses these queries) to not duplicate functionality and use stock methods. Actual question is: if there's such functionality in sqlalchemy, how to access it? 2) Eager loading of relationships often helps to save alot of requests to database. Say, i'll definitely need following set of item=Item() properties: item.group (Group object, according to groupID of our item) item.group.items (fetch all items from items list of our group) item.group.items.metaGroup (metaGroup object/relation for every item in the list) If i have some item ID and no item is loaded yet, i can request it from the database, eagerly loading everything i need: sqlalchemy will join group, its items and corresponding metaGroups within single query. If i'd access them with default lazy loading, sqlalchemy would need to issue 1 query to grab an item + 1 to get group + 1*#items for all items in the list + 1*#items to get metaGroup of each item, which is wasteful. 2.1) But what if i already have Item object fetched, and some of the properties which i want to load are already loaded? As far as i understand, when i re-fetch some object from the database - its already loaded relations do not become unloaded, am i correct? 2.2) If i have Item object fetched, and want to access its group, i can just getGroup using item.groupID, applying any eager statements i'll need ("items" and "items.metaGroup"). It should properly load group and its requested relations w/o touching item stuff. Will sqlalchemy properly map this fetched group to item.group, so that when i access item.group it won't fetch anything from the underlying database? 2.3) If i have following things fetched from the database: original item, item.group and some portion of the items from the item.group.items list some of which may have metaGroup loaded, what would be best strategy for completing data structure to the same as eager list above: re-fetch group with ("items", "items.metaGroup") eager load, or check each item from items list individually, and if item or its metaGroup is not loaded - load them? It seems to depend on the situation, because if everything has already been loaded some time ago - issuing such heavy query is pointless. Does sqlalchemy provide a way to track if some object relation is loaded, with the ability to look deeper than just one level? As an illustration to 2.3 - i can fetch group with ID 83, eagerly fetching "items" and "items.metaGroup". Is there a way to determine from an item (which has groupID of an 83), does it have "group", "group.items" and "group.items.metaGroup" loaded or not, using sqlalchemy tools (in this case all of them should be loaded)?
Completing object with its relations and avoiding unnecessary queries in sqlalchemy
1
1.2
1
1
0
3,854
5,797,038
2011-04-26T22:06:00.000
0
0
0
0
0
python,django,settings
0
5,797,047
0
2
0
false
1
0
Either put them in the user profile model, or create another model with a one-to-one to User.
1
9
0
0
I would like have additional settings tied to each user in my application (beyond, is_staff, is_admin etc etc). Basically I'd like to have different settings to customize their user experience (ie: don't show tooltips, how many rows to display in results tables, other flags for turning things on or off). Are there best practices for adding these types of settings, or example model to do this without touching the django user object (in the past when i needed a quick user property, i just added it to my django source code, but obviously know that this is a horrible idea). So when someone sucessfully logs in, I would grab the settings for the user and add them to the session. I wasn't sure if there was a pretty way, or best practice for doing this.
modeling user settings in django
0
0
1
0
0
6,716
5,814,837
2011-04-28T06:59:00.000
2
0
0
0
0
python,api,hosting,dns,registration
0
5,814,951
0
3
0
false
1
0
There is no general API for this. You have to check back with your own domain registration organization. This is specific to the related domain provider.
1
6
0
0
I'm trying to make a website that allows you to setup a photo gallery with a custom domain name. Users of the site don't know how to register or configure domain names, so this has to be done for them. User enters desired domain name in a box (we check if it's available) and click 'register' button and our website registers the domain name for them and sets up the website automatically (when user goes to that domain name, the photo gallery just works, no technical skills needed).
What is the best API for registering and configuring domain names?
0
0.132549
1
0
1
4,713
5,819,205
2011-04-28T13:14:00.000
0
0
0
0
0
python,django
0
5,821,241
0
2
0
false
1
0
If you just want to append some links like in the Restaurant change view, you don't really need to use an inline as this provides a form for changing data. I would probably override change_view in RestaurantAdmin to get a list of the related menus and pass it as an extra_context. And then override the model specific change_form.html template to render the menu links.
1
0
0
0
Hi I have a list of restaurants (e.g. McDonalds, etc), with menus (e.g Lunch Menu, Dinner Menu), submenus (e.g. Appetizers, Sandwidches, etc.) and dishes (Angus Burger, Chicken Burger, etc.) They are all linked by foreign keys. Is there a way, so that in the Restaurant admin, I have Menu as a tabular inline, with a link to go edit that menu (in it's own admin page, not inline) so that there I can display the submenus inline with the menu admin. Each submenu has a link to edit that submenu item (in it's own admin page, not inline) so that there I can display the dishes inline. THanks.
In Django Admin, how do you have cascaded InlineModelAdmin
0
0
1
0
0
412
5,821,895
2011-04-28T16:27:00.000
0
0
0
0
0
python,graph,matplotlib,histogram
0
5,821,933
0
2
0
false
0
0
Just convert the values yourself before they are entered. In numpy, you can do just array/1000 instead of array.
1
3
1
0
I have a histogram I'm drawing in matplotlib with some 260,000 values or so. The problem is that the frequency axis (y axis) on the histogram reaches high numbers such as 100,000... What I'd really like is to have the y labels as thousands, so instead of, for instance: 100000 75000 50000 25000 0 To have this: 100 75 50 25 0 And then I can simply change the y axis to "Frequency (000s)" -- it makes it much easier to read that way. Anyone with any ideas how that can be achieved?
Matplotlib histogram, frequency as thousands
0
0
1
0
0
3,743
5,826,697
2011-04-29T00:48:00.000
1
0
1
0
1
python
0
5,826,729
0
6
0
false
0
0
The answer to both question is to use a loop. Print the "{" and then loop through all the elements printing them. But the input inside a loop and keep looping until you get what you want.
1
2
0
0
So i had to write a program that asks for a user input (which should be a 3 letter string) and it outputs the six permutations of the variations of the placements of the letters inside the string. However, my professor wants the output to be surrounded by curly brackets whereas mine is a list (so it is square brackets). How do i fix this? Also, how do I check if none of the letters in the input repeat so that the main program keeps asking the user to enter input and check it for error? Thank you
Advice on python program
0
0.033321
1
0
0
121
5,830,706
2011-04-29T10:09:00.000
0
0
0
0
0
java,python
0
5,835,814
0
2
0
false
1
0
You could always run the jar files in a subprocess and use PIPE for IO (or temp files). This works pretty well for us (we are generating PDF from our Django app with flying saucer and iText)
1
0
0
0
Hi I have few jar files which are few calculations compiled into jar files. I have a python web app which is supposed to interact with these jar files and get me the data. I have heard that it can be done using the java bridge. Can someone let me know how this could be done or at least point me to the right link.
Integrating python webapp with some jar files
0
0
1
0
0
124
5,832,787
2011-04-29T13:36:00.000
4
0
0
0
0
python,mysql
0
5,832,825
0
3
0
false
0
0
It is very simple - select data from one server, select data from another server and aggregate using Python. If you would like to have SQL query with JOIN - put result from both servers into separate tables in local SQLite database and write SELECT with JOIN.
2
29
0
0
In MySQL, I have two different databases -- let's call them A and B. Database A resides on server server1, while database B resides on server server2. Both servers {A, B} are physically close to each other, but are on different machines and have different connection parameters (different username, different password etc). In such a case, is it possible to perform a join between a table that is in database A, to a table that is in database B? If so, how do I go about it, programatically, in python? (I am using python's MySQLDB to separately interact with each one of the databases).
MySQL -- Joins Between Databases On Different Servers Using Python?
1
0.26052
1
1
0
32,061
5,832,787
2011-04-29T13:36:00.000
3
0
0
0
0
python,mysql
0
5,832,954
0
3
0
false
0
0
No. It is not possible to do the join as you would like. But you may be able to sort something out by replicating one of the servers to the other for the individual database. One data set is under the control of one copy of MySQL and the other dataset is under the control of the other copy of MySQL. The query can only be processed by one of the (MySQL) servers. If you create a copy of the second database on the first server or vice versa (the one that gets the fewest updates is best) you can set up replication to keep the copy up to date. You will then be able to run the query as you want.
2
29
0
0
In MySQL, I have two different databases -- let's call them A and B. Database A resides on server server1, while database B resides on server server2. Both servers {A, B} are physically close to each other, but are on different machines and have different connection parameters (different username, different password etc). In such a case, is it possible to perform a join between a table that is in database A, to a table that is in database B? If so, how do I go about it, programatically, in python? (I am using python's MySQLDB to separately interact with each one of the databases).
MySQL -- Joins Between Databases On Different Servers Using Python?
1
0.197375
1
1
0
32,061
5,843,508
2011-04-30T17:39:00.000
2
0
1
0
0
python,xcode,xcode4,pyobjc
0
7,815,044
0
3
0
false
0
1
I've successfully built a MacRuby GUI app in XCode 4.2 on Lion today following a MacRuby tutorial on Apple's site. MacRuby also includes a template in XCode 4.2. I'm a Python programmer and really hoped to use it, but at this point I've given up on PyObjC. I use Tk in Python for quick little apps and maybe switch to MacRuby, but will likely just switch to Objective-c. Ruby is a pretty nice language though. Maybe MacRuby will interest you.
1
13
0
0
Xcode 3 had templates for building Cocoa subclasses in Python. I've recently upgraded to Xcode 4 but I cannot find out how I can use other languages besides the C family (C, C++, Obj-C) in Xcode 4. Does anyone know?
PyObjC on Xcode 4
0
0.132549
1
0
0
7,826
5,844,869
2011-04-30T21:56:00.000
35
0
1
1
0
python,virtualenv
0
13,261,064
0
4
1
false
0
0
Virtualenv is a tool to create isolated Python environments. Let's say you're working in 2 different projects, A and B. Project A is a web project and the team is using the following packages: Python 2.8.x Django 1.6.x The project B is also a web project but your team is using: Python 2.7.x Django 1.4.x The machine that you're working doesn't have any version of django, what should you do? Install django 1.4? django 1.6? If you install django 1.4 globally would be easy to point to django 1.6 to work in project A? Virtualenv is your solution! You can create 2 different virtualenv's, one for project A and another for project B. Now, when you need to work in project A, just activate the virtualenv for project A, and vice-versa. A better tip when using virtualenv is to install virtualenvwrapper to manage all the virtualenv's that you have, easily. It's a wrapper for creating, working, removing virtualenv's.
1
358
0
1
I've been hearing the buzz about virtualenv lately, and I'm interested. But all I've heard is a smattering of praise, and don't have a clear understanding of what it is or how to use it. I'm looking for (ideally) a follow-along tutorial that can take me from Windows or Linux with no Python on it, and explain every step of (in no particular order): what I should do to be able to start using virtualenv specific reasons why using virtualenv is a good idea situations where I can/can't use virtualenv situations where I should/shouldn't use virtualenv And step through (comprehensively) a couple sample situations of the should+can variety. So what are some good tutorials to cover this stuff? Or if you have the time and interest, perhaps you can answer a few of those questions here. Either in your answer, or as a link to tutorials that answer it, these are the things I'd like to know.
Comprehensive beginner's virtualenv tutorial?
0
1
1
0
0
149,425
5,846,022
2011-05-01T02:33:00.000
0
0
0
1
0
python
0
5,846,054
0
2
0
false
0
0
Reinstalling would work. In the future, don't delete Frameworks you didn't install.
1
0
0
0
I download python 3.2 and my first thought was that I need to uninstall the python 2.6.1 pre-installed in my computer. But later I found in python.org "You should never modify or delete these, as they are Apple-controlled and are used by Apple- or third-party software". I used "sudo rm -rf /Library/Frameworks/Python.Framework" to delete python 2.6.1. Now I truly want to undo this command(I want python 2.6.1 back!). What should I do? (or the question can be expressed as follows: how can I re-install the pre-installed python 2.6.1 in my mac?)
how to recover python 2.6.1 that was pre-installed in my macbook pro?
0
0
1
0
0
1,053
5,848,496
2011-05-01T12:59:00.000
0
0
0
0
0
python,url,flask
0
5,848,509
0
2
0
false
1
0
By pointing all the subdomains of that domain to the same website via DNS, and then inspecting the HTTP 1.1 Host header to determine which user website is being viewed.
1
2
0
0
Suppose there is a web app name thesite.com. I need to give every user a url of his own. For eg- if alice signs up, she gets a space of her own at the url "alice.thesite.com".. How do I achieve this. Thanks Alice
how to map url with usernames prefixed?
0
0
1
0
1
164
5,858,446
2011-05-02T14:34:00.000
0
0
0
0
1
opencv,python-2.7,iplimage
1
5,859,924
0
3
0
false
0
1
This must be an issue with the default codecs. OpenCV uses brute force methods to open video files or capture from camera. It goes by trial and error through all sources/codecs/apis it can find in some reasonable order. (at least 1.1 did so). That means that on n different systems (or days) you may get n different ways of accessing the same video. The order of multiple webcams for instance, is also non-deterministic and may depend on plugging order or butterflies. Find out what your laptop uses, (re)install that on all the systems and retry. Also, in the c version, you can look at the capture's properties look for cvGetCaptureProperty and cvSetCaptureProperty where you might be able to hint to the format. [EDIT] Just looked i tup in the docs, these functions are also available in Python. Take a look, it should help.
1
1
1
0
I am running Python2.7.1 and OpenCV 2.2 without problems in my WinXP laptop and wrote a tracking program that is working without a glitch. But for some strange reason I cannot get the same program to run in any other computer where I tried to install OpenCV and Python (using the same binaries or appropriate 64 bit binaries). In those computers OpenCV seems to be correctly installed (although I have only tested and CaptureFromCamera() in the webcam of the laptop), but CaptureFromFile() return 'None' and give "error: Array should be CvMat or IplImage" after a QueryFrame, for example. This simple code: import cv / videofile = cv.CaptureFromFile('a.avi') / frame = cv.QueryFrame(videofile) / print type(videofile) / print type(frame) returns: type 'cv.Capture' / type 'NoneType' OpenCV and Python are in the windows PATH... I have moved the OpenCV site-packages content back and forth to the Pyhton27 Lib\Site-packages folder. I tried different avi files (just in case it was some CODEC problem). This AVI uses MJPEG encoding (and GSpot reports that ffdshow Video Decoder is used for reading). Images work fine (I think): the simple convert code: im = cv.LoadImageM("c:\tests\colormap3.tif") cv.SaveImage("c:\tests\colormap3-out.png", im) opens, converts and saves the new image... I have tested with AVI files in different folders, using "c:\", "c:/", "c:\" and "c://". I am lost here... Anyone has any idea of what stupid and noob mistake may be the cause of this? Thanks
IplImage 'None' error on CaptureFromFile() - Python 2.7.1 and OpenCV 2.2 WinXP
0
0
1
0
0
1,705
5,862,238
2011-05-02T20:41:00.000
6
0
0
1
0
python,email,tornado
0
7,483,440
0
2
0
false
1
0
I wonder why you would handle registration like that. The usual way to handle registration is: Write the user info to the database, but with an 'inactive' label attached to the user. Send an email to the user. If the user confirms the registration, then switch the user to 'active'. If you don't want to write to the database, you can write to a cache (like memcache, redis), then when the user confirms the registration, you can get the user info from the cache and write it to the database.
1
5
0
0
I'm working with Tornado and MongoDB and I would like to send a confirmation email to the user when he creates an account in my application. For the moment, I use a simple XHTML page with a form and I send information to my MongoDB database using Tornado. I would like to have an intermediate step which sends an email to the user before inserting the data into the database. I would like to know how could I send this email and insert the user account only after the user receives the email and confirms his registration.
How can I send a user registration confirmation email using Tornado and MongoDB?
0
1
1
1
0
3,734
5,880,867
2011-05-04T08:49:00.000
1
0
0
1
0
python,parallel-processing,celery
0
5,882,479
0
1
0
true
0
0
Giving an example is difficult as messaging is a bit complex, but what you can do basically is: rewrite your program to be a task or write a task that calls your program using subprocess configure celery to have 10 workers execute as many tasks as you need to get your job done, Celery will add them to its queue Celery will do the rest for you, once a task finished, another one is started till the queue is empty Alternatively, if your want to start a task manually after one finished, you can configure Celery to send a message after its finished (I didn't try it yet, but have a look at CELERY_RESULT_BACKEND) You can then consume these messages and start your task.
1
0
0
0
lets say i have a python programm whitch i want to run always max 10 times in parallel using celery / rabbigmq and if some of the process finish i want to know about it so i can start a new process. how can i do so? some examples would be nice
python create celery task job
0
1.2
1
0
0
485
5,889,111
2011-05-04T19:53:00.000
0
0
1
0
0
python,regex,perl
0
5,889,138
0
3
0
false
0
0
Replace using regular expression \,\s*FROM and replace with FROM.
1
2
0
0
I have a string "THIS IS, A STRING, FROM" How can I remove a comma before the FROM statement?
Regexp beginner: how to remove comma before a keyword?
0
0
1
0
0
411
5,895,707
2011-05-05T09:50:00.000
1
0
0
0
0
python,django,wordpress
0
5,914,160
0
4
0
false
1
0
If you can get away with running Django and Wordpress as separate apps, you can just use nginx to handle which requests go to which app. For example, if the CMS portion you'd like Wordpress for is only a blog, you could have nginx send example.com/blog/ to wordpress, and anything else to django.
1
1
0
0
now I have a site which based on django(the python framework) which can run stable. in this site we need to use wordpress as a cms. the server config on ubuntu and nginx, but i don't know how to combine the django and wordpress together.any tips is wonderful. thanks in advance!
how to combine django and wordpress based on ubuntu and nginx
0
0.049958
1
0
0
1,879
5,907,312
2011-05-06T05:51:00.000
1
0
0
0
0
django,apache,apache2,mod-python
0
5,907,442
0
1
0
true
1
0
If you only have user level access to the machine (ie: you don't have root), then you won't be able to control what web server runs and you can only control its settings to a limited regard. You will have to consider contacting your provider or looking for a different hosting package if the server doesn't meet you needs. Typically, if it is a hosting server, the administrators will already have web server software like Apache running. You simply just have to upload what you would like to have displayed (typically to a directory called "public_html" or something like that), and it will display when someone visits your site. Hopefully they support things like Django, otherwise you might need to look at other options. Your hosting provider is most likely to have specific and the most relevant instructions for how to upload your website.
1
1
0
1
I have developed a web application in Django and would like to go online i have an FTP access to the hosting server I am a beginner to "setting up a website" i would like to know how to install apache on that server and have my application working Kindly provide detailed info as i am newbie, any links or tutorials would help a lot Thanks in advance
How to set up Apache server via an FTP account
0
1.2
1
0
0
347
5,911,382
2011-05-06T12:25:00.000
1
0
1
0
1
python,exception,video-capture
1
24,388,352
0
2
0
false
0
0
I know this is a really old thread. I kept getting this error after instantiating the Device a second time. Moving the code to the main thread fixed the problem for me.
1
1
0
0
I use the Python (2.7) package VideoCapture. When I try to instantiate the Device, I get an Exception: Error: Capture Graph could not be created. I use cam = Device(), so nothing special there. I have one laptop where this works without a problem, and another where I get the Exception. They are different, but both have internal USB-Webcams. One week ago it worked, but now I only get the exception. Both use Windows 7. Does anybody have an idea how to resolve this, or how I could get more information what is wrong? Thanks.
VideoCapture: Capture Graph Error
0
0.099668
1
0
0
1,280
5,913,049
2011-05-06T14:44:00.000
1
0
1
0
0
python,timezone
0
5,913,087
0
5
0
false
0
0
call datetime.now() with the time zone (as a tzinfo object) as an argument.
1
0
0
0
I have countrynames and utcoffset of that country How to find out out local time in that country using utcoffset?
how to findout local time using utcoffset and countryname in python
0
0.039979
1
0
0
1,509