Title stringlengths 15 150 | A_Id int64 2.98k 72.4M | Users Score int64 -17 470 | Q_Score int64 0 5.69k | ViewCount int64 18 4.06M | Database and SQL int64 0 1 | Tags stringlengths 6 105 | Answer stringlengths 11 6.38k | GUI and Desktop Applications int64 0 1 | System Administration and DevOps int64 1 1 | Networking and APIs int64 0 1 | Other int64 0 1 | CreationDate stringlengths 23 23 | AnswerCount int64 1 64 | Score float64 -1 1.2 | is_accepted bool 2
classes | Q_Id int64 1.85k 44.1M | Python Basics and Environment int64 0 1 | Data Science and Machine Learning int64 0 1 | Web Development int64 0 1 | Available Count int64 1 17 | Question stringlengths 41 29k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Checking with Python3 if ZIP is installed on OS (Terminal) | 21,941,266 | 0 | 0 | 34 | 0 | python-3.x,operating-system,zip | You could check using the zipfile module.
It will check for everything that is needed to run. If the OS version of zip is missing the import of the module will either fail (because it's missing) or the module works without the OS version (which should be fine too).
I can't think of any other easy, portable approach. On... | 0 | 1 | 0 | 0 | 2014-02-21T08:40:00.000 | 1 | 0 | false | 21,929,329 | 0 | 0 | 0 | 1 | I try to work through Byte of Python3 and there is an example script for backing up folders and creating a zip file.
I would like the script to check if zip is available within the os (Windows, Linux, Mac). Is there a way you can do this?
Thanks,
Mark |
AppEngine real time querying - cost, performance, latency balancing act and quotas | 21,962,823 | 0 | 1 | 173 | 1 | python,google-app-engine,mapreduce,task-queue | First, writes to the datastore take milliseconds. By the time your user hits the refresh button (or whatever you offer), the data will be as "real-time" as it gets.
Typically, developers become concerned with real-time when there is a synchronization/congestion issue, i.e. each user can update something (e.g. bid on an... | 0 | 1 | 0 | 0 | 2014-02-21T17:23:00.000 | 2 | 0 | false | 21,941,030 | 0 | 0 | 1 | 1 | I am trying to design an app that uses Google AppEngine to store/process/query data that is then served up to mobile devices via Cloud Endpoints API in as real time as possible.
It is straight forward enough solution, however I am struggling to get the right balance between, performance, cost and latency on AppEngine.
... |
Not being able to run pylint using windows (7) command prompt | 21,945,800 | 1 | 3 | 4,751 | 0 | python,pylint | set PATH=%PATH%;C:\python27\scripts
is apparently what i needed to make it work... thanks for the path direction. | 0 | 1 | 0 | 0 | 2014-02-21T20:23:00.000 | 1 | 0.197375 | false | 21,944,428 | 1 | 0 | 0 | 1 | I've just installed all the dependencies (asteroid and logilab-commons) and pylint, ran the tests for pylint and they all passed, but i just cant get pylint to work... i keep getting
'pylint' is not recognized as an internal or external command, operable program or batch file.
while running in the command prompt.
i... |
How to install OpenERP on Mac OS X Mavericks? | 22,423,411 | 1 | 2 | 7,748 | 0 | python,macos,postgresql,openerp,openerp-7 | Install PostgreSQL
Create a user for OpenERP
Install all dependencies for Python, using brew or MacPorts
Download OpenERP and extract it
Run the following command: cd openerp; python openerp-server | 0 | 1 | 0 | 0 | 2014-02-22T05:32:00.000 | 2 | 1.2 | true | 21,950,193 | 0 | 0 | 0 | 1 | I want to install OpenERP v7 on Mac OS X. How can I install it?
I tried to install it brew install postgresql I succeed to install postgresql but when I create the user with following command createuser openerpI got the error like
createuser:command not found I also got an error when I type psql. |
Raspberry Pi (python) Run in background and reopen print output | 21,953,931 | 0 | 0 | 655 | 0 | python,printing,background,raspberry-pi | 1) You should never run a script with sudo. You could potentially destroy your system.
2) Once your SSH session is closed all processes go with it. That is unless you use nohup or screen as you have found. | 0 | 1 | 0 | 1 | 2014-02-22T09:56:00.000 | 1 | 0 | false | 21,952,650 | 0 | 0 | 0 | 1 | I have learned online that there are several ways of running a python program in the background:
sudo python scriptfile.py&
sudo python scriptfile.py, then Control+Z, then bg
Using nohup
Using screen
However, I would like to know if when doing any of the first two options, after I close and reopen SSH again, I can re... |
Error 404 when trying to access a Django app installed in a subdomain | 21,969,799 | 0 | 0 | 718 | 0 | python,django,.htaccess,subdomain,virtualenv | The issue was solved by contacting the support service and asking them to open the port 8000 for me. | 0 | 1 | 0 | 0 | 2014-02-23T00:15:00.000 | 2 | 1.2 | true | 21,962,475 | 0 | 0 | 1 | 1 | I just installed Django and create a project and an app following the basic tutorial part 1, I created a virtualenv since centOS default python version is 2.4.3, I also created a subdomain to work on this for the development phase. when I try to access like dev.domain.com/admin/ or dev.domain.com/ I get a 404 error, it... |
How to execute a python script and write output to txt file? | 49,316,597 | 0 | 13 | 92,210 | 0 | python,output | You could also do this by going to the path of the folder you have the python script saved at with cmd, then do the name.py > filename.txt
It worked for me on windows 10 | 0 | 1 | 0 | 1 | 2014-02-23T02:09:00.000 | 8 | 0 | false | 21,963,270 | 0 | 0 | 0 | 2 | I'm executing a .py file, which spits out a give string. This command works fine
execfile ('file.py')
But I want the output (in addition to it being shown in the shell) written into a text file.
I tried this, but it's not working :(
execfile ('file.py') > ('output.txt')
All I get is this:
tugsjs6555
False
I guess "Fals... |
How to execute a python script and write output to txt file? | 33,993,200 | 2 | 13 | 92,210 | 0 | python,output | The simplest way to run a script and get the output to a text file is by typing the below in the terminal:
PCname:~/Path/WorkFolderName$ python scriptname.py>output.txt
*Make sure you have created output.txt in the work folder before executing the command. | 0 | 1 | 0 | 1 | 2014-02-23T02:09:00.000 | 8 | 0.049958 | false | 21,963,270 | 0 | 0 | 0 | 2 | I'm executing a .py file, which spits out a give string. This command works fine
execfile ('file.py')
But I want the output (in addition to it being shown in the shell) written into a text file.
I tried this, but it's not working :(
execfile ('file.py') > ('output.txt')
All I get is this:
tugsjs6555
False
I guess "Fals... |
Python based asynchronous workflow modules : What is difference between celery workflow and luigi workflow? | 25,704,688 | 27 | 37 | 8,450 | 0 | python,celery,luigi | Update: As Erik pointed, Celery is better choice for this case.
Celery:
What is Celery?
Celery is a simple, flexible and reliable distributed system to process vast amounts of messages, while providing operations with the tools required to maintain such a system.
Why use Celery?
It is simple to use & has lots of featu... | 0 | 1 | 0 | 0 | 2014-02-23T11:08:00.000 | 2 | 1.2 | true | 21,967,398 | 0 | 0 | 1 | 2 | I am using django as a web framework. I need a workflow engine that can do synchronous as well as asynchronous(batch tasks) chain of tasks. I found celery and luigi as batch processing workflow. My first question is what is the difference between these two modules.
Luigi allows us to rerun failed chain of task and onl... |
Python based asynchronous workflow modules : What is difference between celery workflow and luigi workflow? | 34,112,320 | 45 | 37 | 8,450 | 0 | python,celery,luigi | (I'm the author of Luigi)
Luigi is not meant for synchronous low-latency framework. It's meant for large batch processes that run for hours or days. So I think for your use case, Celery might actually be slightly better | 0 | 1 | 0 | 0 | 2014-02-23T11:08:00.000 | 2 | 1 | false | 21,967,398 | 0 | 0 | 1 | 2 | I am using django as a web framework. I need a workflow engine that can do synchronous as well as asynchronous(batch tasks) chain of tasks. I found celery and luigi as batch processing workflow. My first question is what is the difference between these two modules.
Luigi allows us to rerun failed chain of task and onl... |
Running a Python Program Hiding the Source | 21,978,072 | 2 | 0 | 121 | 0 | python | There are plenty of ways someone can get your program, even if you remove the USB drive.
They can install a program that triggers when a USB stick is inserted, search the stick for .py files, and copies them to disk.
If the Python installation you're using is on the disk instead of the USB drive, they can replace the ... | 0 | 1 | 0 | 0 | 2014-02-24T02:41:00.000 | 2 | 1.2 | true | 21,977,987 | 1 | 0 | 0 | 2 | When I run a program from a USB memory, and remove the USB memory the program still goes on running (I mean with out really copying the program into the Windows PC).
However, does the program make its copy inside the Windows in any hidden location or temporary folder while running by the python IDLE. From where the pyt... |
Running a Python Program Hiding the Source | 21,978,357 | 0 | 0 | 121 | 0 | python | It sounds like you are doing something you probably shouldn't be doing. Depending on how much people want your code they could go as far as physically freezing the ram and doing a forensic IT analysis. In short, you can't prevent code cloning on a machine you don't administer. | 0 | 1 | 0 | 0 | 2014-02-24T02:41:00.000 | 2 | 0 | false | 21,977,987 | 1 | 0 | 0 | 2 | When I run a program from a USB memory, and remove the USB memory the program still goes on running (I mean with out really copying the program into the Windows PC).
However, does the program make its copy inside the Windows in any hidden location or temporary folder while running by the python IDLE. From where the pyt... |
Global leaderboard in Google App Engine | 21,979,231 | 0 | 3 | 930 | 0 | python,google-app-engine,cron,leaderboard | Whether this is simpler or not is debatable.
I have assumed that ranking is not just a matter of ordering an accumulation of points, in which case thats just a simple query. I ranking involves other factors rather than just current score.
I would consider writing out an Event record for each update of points for a ... | 0 | 1 | 0 | 0 | 2014-02-24T04:43:00.000 | 3 | 0 | false | 21,979,038 | 0 | 0 | 1 | 2 | I want to build a backend for a mobile game that includes a "real-time" global leaderboard for all players, for events that last a certain number of days, using Google App Engine (Python).
A typical usage would be as follows:
- User starts and finishes a combat, acquiring points (2-5 mins for a combat)
- Points are acc... |
Global leaderboard in Google App Engine | 21,980,623 | 2 | 3 | 930 | 0 | python,google-app-engine,cron,leaderboard | You don't need 50,000 reads or 50,000 writes. The solution is to set a sorting order on your points property. Every time you update it, the datastore will update its order automatically, which means that you don't need a rank property in addition to the points property. And you don't need a cron job, accordingly.
Then,... | 0 | 1 | 0 | 0 | 2014-02-24T04:43:00.000 | 3 | 1.2 | true | 21,979,038 | 0 | 0 | 1 | 2 | I want to build a backend for a mobile game that includes a "real-time" global leaderboard for all players, for events that last a certain number of days, using Google App Engine (Python).
A typical usage would be as follows:
- User starts and finishes a combat, acquiring points (2-5 mins for a combat)
- Points are acc... |
How to make a task start right after another one finish in google app engine? | 21,981,710 | 0 | 1 | 159 | 0 | python,google-app-engine,task | It seems impossible to guarantee that B will be next. | 0 | 1 | 0 | 0 | 2014-02-24T07:25:00.000 | 2 | 0 | false | 21,981,387 | 0 | 0 | 1 | 2 | On taskqueue in gae.
For example, I have task A, B.
How to ensure that task B starts right after task A finishes.
There could be other tasks, like C, to fix this problem.
Also, 'right after' could be loose to 'after'.
How about a dedicate queue with max_current_requests set to 1? |
How to make a task start right after another one finish in google app engine? | 21,982,975 | 2 | 1 | 159 | 0 | python,google-app-engine,task | If you only have two tasks, you can start task B at the end of task A. For example, a task that updates user scores can start a task to send emails after it finished updating scores.
In this case, you are guaranteed that task B is executed after task A, but there is no guarantee that there is no task C in between them ... | 0 | 1 | 0 | 0 | 2014-02-24T07:25:00.000 | 2 | 0.197375 | false | 21,981,387 | 0 | 0 | 1 | 2 | On taskqueue in gae.
For example, I have task A, B.
How to ensure that task B starts right after task A finishes.
There could be other tasks, like C, to fix this problem.
Also, 'right after' could be loose to 'after'.
How about a dedicate queue with max_current_requests set to 1? |
backing up data from app engine datastore as spreadsheet or csv | 22,031,727 | 0 | 0 | 163 | 0 | python,google-app-engine,google-cloud-datastore,app-engine-ndb | You need to take a look at the google spreadsheets api, google it, try it, come back when something specific doesnt work.
Also consider using google forms instead which already do what you want (save responses to a spreadsheet) | 0 | 1 | 0 | 0 | 2014-02-24T23:42:00.000 | 1 | 0 | false | 22,001,578 | 0 | 0 | 1 | 1 | I am making a survay website on google app engine using Python. For saving the survey form data i am using NDB Datastore. After the survey I have to import it as spreadsheet or CSV. How can i do that.
Thanks. |
notify when execution/command is completed | 22,021,547 | 0 | 21 | 8,943 | 0 | ipython,anaconda | Recent versions of iTerm send notifications to notification center when there is output in a non-visible tab. They fold into notification center by default, but you can change them to stay on the screen in the Notifications preferences in System Preferences. | 0 | 1 | 0 | 0 | 2014-02-25T04:09:00.000 | 5 | 0 | false | 22,004,386 | 1 | 0 | 0 | 1 | How do I get IPython to notify me when a command has been executed? Can I get it to use the bell/alert, or by pop-up? I'm running Anaconda on iTerm on OS X 10.8.5. |
Django - listening to rabbitmq, in a synchronized way. without celery. in the same process of the web bound django | 32,414,239 | 2 | 2 | 1,008 | 0 | python,django,rabbitmq | If anyone else bumps into this problem:
The solution is using a RabbitMQ consumer from a different process (But in the same Django codebase) then Django (Not the running through wsgi, etc. you have to start it by it self)
The consumer, connects to the appropriate rabbitmq queues and writes the data into the Django mode... | 0 | 1 | 0 | 0 | 2014-02-25T15:30:00.000 | 1 | 0.379949 | false | 22,018,798 | 0 | 0 | 1 | 1 | I need to implement a quite simple Django server that server some http requests and listens to a rabbitmq message queue that streams information into the Django app (that should be written to the db). the data must be written to the db in a synchronized order , So I can't use the obvious celery/rabbit configuration. I... |
How to make nbviewer display local files? | 22,020,213 | 4 | 5 | 4,226 | 0 | ipython-notebook | One minute later and it occurs to me that the front page might not support even though the server does. Sure enough, http://localhost:5000/localfile/PythonReference.ipynb?create=1 renders the local notebook. | 0 | 1 | 0 | 0 | 2014-02-25T16:24:00.000 | 2 | 1.2 | true | 22,020,129 | 1 | 0 | 0 | 1 | I've got nbviewer installed and working. I see it has a --localfiles option that takes a folder name. It says: "Serving local notebooks in /home/gb/S14/inclass, this can be a security risk"
But I can't figure out the URL format to get it to look for the file there. The code adds a handler for /localfile/(.*) but that d... |
Is it possible to use dnspython through proxy? | 22,074,588 | 0 | 0 | 1,227 | 0 | python,proxy,dns,dnspython | If Google blocked that number of requests from a given IP address, one has to assume that sending such a number of requests is against their usage policy (and no doubt a form of 'unfair usage'). So hiding your source IP behind proxies is hardly ethical.
You could adopt a more ethical approach by:
Distributing your req... | 0 | 1 | 1 | 0 | 2014-02-27T16:15:00.000 | 1 | 0 | false | 22,074,156 | 0 | 0 | 0 | 1 | I'm writing a program which gathers basic CNAME information for given domains.
I'm currently using Google's DNS server as the one I'm questioning, but afraid that if I'll send couple of millions DNS lookups this will get me blocked (Don't worry, it's by no means any type of DDOS or anything in that area).
I'm wondering... |
Explicitly make a string into raw string | 22,080,908 | 0 | 1 | 123 | 0 | python,python-3.x | Your REGISTRY_KEY.strip() call is not doing what you think it's doing. It doesn't remove the string HKEY_LOCAL_MACHINE\ from the beginning of the string. Instead, it removes the characters H, K, E, etc., in any order, from both ends of the string. This is why it works when you manually put in what you expect.
As for yo... | 0 | 1 | 0 | 0 | 2014-02-27T21:24:00.000 | 2 | 0 | false | 22,080,748 | 1 | 0 | 0 | 1 | I am reading reading path to the registry from a text file. The registry path is
HKEY_LOCAL_MACHINE\Software\MYAPP\6.3
I store this registry in a variable :
REGISTRY_KEY
Then I strip the HKEY_LOCAL_MACHINE part from the string and try to read the value at the key.
if REGISTRY_KEY.split('\\')[0] == "HKEY_LOCAL_MACH... |
Multiple storage engines for django media: prefer local, fallback to CDN | 22,083,369 | 1 | 3 | 675 | 0 | python,django,rackspace,mezzanine | The best way is to have this working, is to have a different web server serving all of your media (I used nginx). Then you setup a load balancer to detect failure and redirect all the requests to CDN in case of a failure.
One thing that you might have to figure out is the image path.(use HAProxy to rewrite the request... | 0 | 1 | 0 | 0 | 2014-02-27T22:31:00.000 | 2 | 0.099668 | false | 22,082,005 | 0 | 0 | 1 | 1 | I have a django/mezzanine/django-cumulus project that uses the rackspace cloudfiles CDN for media storage. I would like to automatically serve all static files from the local MEDIA_ROOT, if they exist, and only fallback to the CDN URL if they do not.
One possible approach is to manage the fallback at the template level... |
which is better way to run a file system monitoring service? | 22,106,444 | 0 | 1 | 154 | 0 | python,linux,filesystemwatcher,inotify | Create a script (you wouldn't need python for this task, just df and find). This is pretty lightweight, needs less code than a daemon (much less maintenance in the long run), and running scripts once a minute by cron is not unheard of. :-) | 0 | 1 | 0 | 1 | 2014-02-28T18:32:00.000 | 1 | 1.2 | true | 22,103,096 | 0 | 0 | 0 | 1 | I need to monitor NAS file system disk space, whenever file-system disk space goes above from a threshold value, I am I deleting oldest files from file system to bring back file system disk space below to threshold value.
I read several article which suggested me two alternatives:
by creating a daemon process which wi... |
In what order are PyDev project references, sourrce folders, and external libraries in the PYTHONPATH | 28,799,767 | 2 | 1 | 340 | 0 | python,eclipse,pydev | The PYTHONPATH in PyDev is computed in the following order:
Source folders of the project have highest priority (since this is the code you're expecting to be editing).
External source folders of the project being used for the launch.
Computed PYTHONPATH of the dependent projects (again, first source then external).
P... | 0 | 1 | 0 | 0 | 2014-03-01T11:45:00.000 | 1 | 0.379949 | false | 22,113,950 | 1 | 0 | 0 | 1 | Using Eclipse with the PyDev plugin, if you choose myProject>Properties>PyDev-PYTHONPATH, you then see two tabs: Source Folders and External Libraries. You can also choose myProject>Properties>Project References and see a widget with a checkable list of other parallel subprojects in your Eclipse/Pydev IDE workspace. ... |
Batch message from a rabbitMQ queue | 22,134,400 | 6 | 6 | 4,628 | 0 | python,rabbitmq | in general, the network aspect of "batching messages" is handled at the level of the basic.qos(prefetch-size, prefetch-count) parameters. In this scheme, the broker will send some number of bytes/messages(respectively) beyond the the unacknowledged messages for a consumer, but the client library doles out messages, in... | 0 | 1 | 0 | 1 | 2014-03-02T22:02:00.000 | 1 | 1.2 | true | 22,134,173 | 0 | 0 | 0 | 1 | I have a stream of requests in my RabbitMQ cluster, and multiple consumers handling them. The thing is - each consumer must handle requests in batches for performance reasons. Specifically there is a network IO operation that I can amortize by batching requests.
So, each consumer would like to maximize the number of r... |
How to use celery to get messages from a rabbit-mq server? | 56,632,082 | 1 | 5 | 1,369 | 0 | python,rabbitmq,celery | Celery can use several back-ends. If you are already using RabbitMQ, it makes that option attractive.
These are however different concerns. Use a generic RabbitMQ client library such as pika to implement a consumer for your messages, then, if needed, use Celery to schedule tasks. | 0 | 1 | 0 | 0 | 2014-03-03T12:34:00.000 | 3 | 0.066568 | false | 22,146,944 | 0 | 0 | 0 | 1 | The celery docs suggest that Rabbit-MQ must act like a middleman, where it is used as a messaging platform.
In my infrastructure, Rabbit-MQ is the primary server that serves me with some data every second. Now, whenever the data is served, I want Celery to do certain tasks.
Now, this throws out the whole publisher-wo... |
pyw file not working intermittently / Task Scheduler | 28,174,244 | 0 | 2 | 648 | 0 | python,windows-7,scheduled-tasks,pythonw | I encountered a similar problem. While my code worked as expected using python.exe, it failed to work with pythonw.exe.
After much debugging, I identified the source as a call to sys.stdout.write(). With pythonw.exe, sys.stdout is null, so the program crashes, but, silently. I wrapped that call in "if sys.stdout is not... | 0 | 1 | 0 | 0 | 2014-03-03T15:21:00.000 | 1 | 0 | false | 22,150,526 | 0 | 0 | 0 | 1 | I've got a python script set to log in to a mail server and transfer the files to a remote directory mapped on my machine. Since I don't want it popping up every 10 minutes, I saved it as a pyw file. It worked fine at first, but then it stopped working, showing 0x1 as the result of the last run in the Windows Task Sc... |
how to load shell environment variables when Emacs starts py-shell? | 22,208,324 | 0 | 1 | 392 | 0 | python,bash,shell,emacs,ipython | After running your /etc/university/env.sh, start Emacs from this shell.
Then the variables set before are known. | 0 | 1 | 0 | 1 | 2014-03-04T14:56:00.000 | 2 | 0 | false | 22,175,349 | 0 | 0 | 0 | 1 | I'm working for a university and they have their own libraries and paths for python libraries. Every time I start ipython, I need to run a shell script (e.g. /etc/university/env.sh)
The problem is that emacs doesn't recognize the env.sh file. When I do py-shell, emacs always envokes Python WITHOUT any pre-set environme... |
Is it possible to make ownership of /proc/pid/io follow changed process ownership? | 22,176,917 | 0 | 0 | 35 | 0 | python-2.7 | That is by design.
The process may still hold a capability (i.e. a handle to something external to the process) that would not be available to the process owner otherwise, so most debugging facilities are available to the root user only. | 0 | 1 | 0 | 1 | 2014-03-04T15:28:00.000 | 1 | 0 | false | 22,176,118 | 0 | 0 | 0 | 1 | One of my python scripts has to be started as root but after some initialization changes its process ownership to something else by calling setuid/setgid. Works like a champ except for one thing: most of the files under /prod/pid are still owned by root and most important /proc/pid/io is owned by root so I can't moni... |
pyinstaller - mkdir error | 22,179,885 | 0 | 0 | 417 | 0 | python,pyinstaller | if the problem is indeed os.makedir you will need to run the program as administrator, or pick a non-protected folder to mkdir in ...
Unfortunately is sounds like you are not sure this is the problem, if you build your executable with --console flag you will probably get output that tells you exactly what the problem i... | 0 | 1 | 0 | 0 | 2014-03-04T18:13:00.000 | 2 | 0 | false | 22,179,731 | 1 | 0 | 0 | 2 | I want to create executable with pyinstaller (in ubuntu). My program works, but when I create executable, program doesn't work. Problem is probably in command os.mkdir. How can I solve it? Thank you. |
pyinstaller - mkdir error | 22,179,931 | 0 | 0 | 417 | 0 | python,pyinstaller | Hmm... If you want to create a directory where you want to store some files, you can create it by using os.system("mkdir $nameOfDirectory$"). Hope this helps, os.system() executes in Terminal the command between the paranthesis. | 0 | 1 | 0 | 0 | 2014-03-04T18:13:00.000 | 2 | 0 | false | 22,179,731 | 1 | 0 | 0 | 2 | I want to create executable with pyinstaller (in ubuntu). My program works, but when I create executable, program doesn't work. Problem is probably in command os.mkdir. How can I solve it? Thank you. |
Installing Openpyxl for preinstalled python 2.7 mac lion | 22,196,176 | 3 | 1 | 9,105 | 0 | python-2.7,openpyxl | Install openpyxl using pip: sudo pip install openpyxl | 0 | 1 | 0 | 0 | 2014-03-04T18:40:00.000 | 2 | 0.291313 | false | 22,180,238 | 0 | 0 | 0 | 1 | I would like to install openpyxl-1.8.4 on Python 2.7 that comes with Mac Lion. My Python compiler is under system/library/Frameworks/Python.frameworks/Versions/2.7/bin.
I tried
python2.7 setup.py install
and also
sudo python2.7 setup.py install
and seems to me none of them works. Am I missing something? I really a... |
Using php inside python code ,google app engine | 22,183,262 | 2 | 1 | 361 | 0 | php,google-app-engine,python-2.7 | Those runtimes (Py, PHP, Java. etc.) are isolated from each other and are tightly sandboxed. So when you deploy a Python app, for example, it doesn't have access to the PHP or Java runtime. So, it's not possible to run PHP inside a python sandbox, at least not in the appengine platform. | 0 | 1 | 0 | 1 | 2014-03-04T20:05:00.000 | 2 | 0.197375 | false | 22,181,860 | 0 | 0 | 1 | 1 | I have a project that already written in php, and now i am using python in google app engine, actually i want to use the api that google support for python, for example : datastore, blobstore ... and also to save my time to re write the code again in python !
so, is it possible to run php script in python code ? |
Releasing pygtk application | 22,983,513 | 0 | 1 | 479 | 0 | python,linux,pygtk | Just adding the solution to my own question!
As suggested in the comments above installed packages by downloading the source and compiled them in a machine which had glibc2.5 then created binary executable of my pygtk app using pyinstaller
I had tried compiling packages earlier also, but weren't checking the ./configur... | 1 | 1 | 0 | 0 | 2014-03-05T07:34:00.000 | 1 | 1.2 | true | 22,191,409 | 0 | 0 | 0 | 1 | I have developed a pygtk application and i need to release it to customers.
I am using python 2.7, pygtk 2.2 in ubuntu.
My question is how can I bundle the required packages(python, pygtk, gobject) together with my application, so that even if these packages are not installed in client machine I can run my application.... |
Celery worker-offline event not generated | 22,226,475 | 0 | 1 | 150 | 0 | python,celery | After a bit of research, I ended up answering my own question: it was a bug which has been fixed in the later versions of celery. | 0 | 1 | 0 | 0 | 2014-03-05T22:55:00.000 | 1 | 0 | false | 22,211,193 | 0 | 0 | 1 | 1 | I am trying to capture the worker-related events, but there is something weird going on in my application: all the task events are being generated and captured and the worker events as well, except for worker-offline event. Is there any specific setting that I need to make for this event to be generated?
I am using Cel... |
Cassandra 2.0.3 cqlsh Fail to start | 22,231,783 | 0 | 0 | 784 | 0 | python-2.7,cassandra,cqlsh | ValueError: invalid literal for int() with base10:'Unknown'
It happens when you run Cassandra from sources, and version.properties file is missing. Just execute ant generate-eclipse-files in the cassandra folder, that will generate the file. | 0 | 1 | 0 | 0 | 2014-03-06T05:31:00.000 | 1 | 1.2 | true | 22,215,833 | 0 | 0 | 0 | 1 | I configured source code of Cassandra 2.0.3 in eclipse. JDK:jdk1.7.0_45 Win 7-32 bits, python 2.7.3 python but cqlsh just doesnt start. Please help me what can be the possible problem? |
How to explain coroutine in Tornado and Python? | 22,301,461 | 1 | 0 | 449 | 0 | python,tornado,coroutine | gen.py does call send(), but in Runner.run(), not in engine() or coroutine() as you might expect.
It seems that engine() and coroutine() basically evaluate the wrapped function to see whether it returns a generator. If it does, it calls Runner.run() on the result, which internally seems to loop over send(). It's not e... | 0 | 1 | 0 | 0 | 2014-03-06T09:47:00.000 | 2 | 1.2 | true | 22,220,635 | 1 | 0 | 0 | 1 | I know coroutine in Python use get = yield ret , callee.send() , callee.next().
But I havn't find above things such as call.send() in Tornado Source code gen.py.
How to explain coroutine in Tornado with an easy understand way? Without a Bigger picture, I just
can't understand what Tornado did. |
How to notify users in network | 27,495,023 | 0 | 0 | 129 | 0 | python,notify | Well ... I figured out that in my organization Microsoft Exchange will not allow email started from script except those originated from server.
I handled to start email from server and now I'm all set.
Thanks for suggestions.
Ticket could be closed. | 0 | 1 | 1 | 0 | 2014-03-07T00:41:00.000 | 1 | 1.2 | true | 22,239,230 | 0 | 0 | 0 | 1 | I have a task to monitor disk usage and notify a few users when it runs out of space. I wrote python script that checks disk usage. Unfortunately I can't use email notification from the script because company policy does not allow it.
My question: Are there any other options that would allow me to notify selected users... |
Django Deployment on Linux Ubuntu | 22,241,285 | 0 | 0 | 117 | 0 | python,linux,django,ubuntu,django-deployment | Here is my stack:
Nignx + gunicon, Supervisor
Deployment,
If you are planing frequent releases you should be looking at something like Fabric. Even of not frequent Fabric is a very good tool to be aware of.
People have preference in terms of stack, but this one has been working great for me. | 0 | 1 | 0 | 0 | 2014-03-07T03:46:00.000 | 1 | 1.2 | true | 22,241,028 | 0 | 0 | 1 | 1 | I am going to seploy my first Django application to a cloud server like Amazon EC2 and the system is Linux Ubuntu.
But I cannot find a very good step-by-step tutorial for the deployment.
Could you recommend one?
And I also have the following questions:
What is the most recommended environment? Gunicorn, Apache+mod_pyt... |
Homebrew brew doctor warning about /Library/Frameworks/Python.framework, even with brew's Python installed | 22,355,720 | 36 | 73 | 45,838 | 0 | python,macos,python-2.7,homebrew,brew-doctor | I also received this message.
Something, sometime installed
/Library/Frameworks/Python.framework
on my machine (the folder date was about 4 years old).
I've chosen to remove it.
Please note that the Apple provided framework lives in
/System/Library/Frameworks/Python.framework/ | 0 | 1 | 0 | 0 | 2014-03-07T16:33:00.000 | 6 | 1 | false | 22,255,579 | 1 | 0 | 0 | 1 | When I ran Homebrew's brew doctor (Mac OS X 10.9.2), I get the following warning message:
Warning: Python is installed at /Library/Frameworks/Python.framework
Homebrew only supports building against the System-provided Python or
a brewed Python. In particular, Pythons installed to /Library can
interfere with other... |
execute python script from linux desktop | 65,688,297 | 0 | 2 | 15,466 | 0 | python,ubuntu | In my case it works after includes at the first line:
#!/home/yourusername/anaconda3/bin/python
You can check the appropiate path running which python in your console.
It is also neccessary to change the file manager setting and configure it to run your scripts. | 0 | 1 | 0 | 1 | 2014-03-07T22:39:00.000 | 5 | 0 | false | 22,262,073 | 0 | 0 | 0 | 1 | I've created a simple python script and therefor have a .py file. I can run it from the terminal but if I double click it only opens up in gedit. I've read this question other places and tried the solutions, however none have worked. I'm running Ubuntu 13.04, I've selected the box to make the file executable. I've even... |
Duplicate App to an already existing ID on Google app engine | 22,264,642 | 0 | 0 | 104 | 0 | python,google-app-engine,blogs | You say you already used that id before.
If you havent deleted that app just use that one to load your new code there. You will need to delete existing datastore data etc. | 0 | 1 | 0 | 0 | 2014-03-07T23:04:00.000 | 2 | 0 | false | 22,262,420 | 0 | 0 | 1 | 1 | I made a blog in Python and I am running it off of Google App Engine. When I started, I put a random ID, just because I was experimenting. Lately, my blog got a bit popular and I wanted to change the ID. I wanted to duplicate my app, but the problem is that I already registered that ID a while ago with google. How can... |
check directory free space on windows using python | 22,263,086 | 0 | 0 | 102 | 0 | python,space | This question doesn't make a lot of sense. Directories don't have "free space". As long as there is free space on the drive, you can use as much of it in a directory as you want. | 0 | 1 | 0 | 0 | 2014-03-07T23:58:00.000 | 1 | 0 | false | 22,263,012 | 0 | 0 | 0 | 1 | I have a task to check free space on particular directory on Windows. I figured out how to check for space of the drive. I was using ctypes module .
Could you please help me to figure out which module or function should I use to get similar information for directory on Windows?
Thanks |
Space character in python that won't be interpreted by bash | 22,276,497 | 0 | 3 | 288 | 0 | python,bash,shell,ascii | Assuming that:
you have control over ./main and that it is a shell script
the entire output from the Python script is to be interpreted as a single parameter
simply use $* rather than $1 inside ./main | 0 | 1 | 0 | 0 | 2014-03-08T23:18:00.000 | 3 | 0 | false | 22,276,347 | 0 | 0 | 0 | 1 | I have a Python script script.py which I am using to generate the command line argument to another script exactly like so:
./main $(./script.py)
The output of script.py may contain spaces (e.g. foo bar) which are being unintentionally interpreted by the shell. I want the argument to ./main to be the single string "foo ... |
NDB validator argument vs extending base property classes | 22,288,117 | -1 | 0 | 138 | 0 | python,google-app-engine,python-2.7,app-engine-ndb | It depends. Are the restrictions one-off or is any particular restriction going to be reused in many different fields/models?
For one-off restrictions, the validator argument is simpler and involves less boilerplate.
For reuse, subclassing lets you avoid having to repeatedly specify the validator argument. | 0 | 1 | 0 | 0 | 2014-03-09T20:55:00.000 | 1 | 1.2 | true | 22,288,044 | 0 | 0 | 1 | 1 | I'm using AppEngine NDB properties and I wonder what would be the best approach to:
limit StringProperty to be not longer than 100 characters
apply regexp validation to StringProperty
prohibit IntegerProperty to be less than 0
Would it be best to use the validator argument or to subclass base ndb properties? |
How do I activate a virtualenv inside PyCharm's terminal? | 64,667,900 | 2 | 139 | 226,921 | 0 | python,django,shell,virtualenv,pycharm | I had the same problem with venv in PyCharm. But It is not big problem!
Just do:
enter in your terminal venv directory( cd venv/Scripts/ )
You will see activate.bat
Just enter activate.bat in your terminal after this you will see YOUR ( venv ) | 0 | 1 | 0 | 0 | 2014-03-09T21:43:00.000 | 29 | 0.013792 | false | 22,288,569 | 1 | 0 | 0 | 9 | I've set up PyCharm, created my virtualenv (either through the virtual env command, or directly in PyCharm) and activated that environment as my Interpreter. Everything is working just fine.
However, if I open a terminal using "Tools, Open Terminal", the shell prompt supplied is not using the virtual env; I still have ... |
How do I activate a virtualenv inside PyCharm's terminal? | 71,744,983 | 0 | 139 | 226,921 | 0 | python,django,shell,virtualenv,pycharm | Had the same issue, this is how I solved it:
All you gotta do is change the default terminal from Power shell to CMD.
Open pycharm --> Go to Settings --> Tools --> Terminal.
Change the Shell Path to C:\Windows\system32\cmd.exe from PS.
Check the Activate virtualenv checkbox.
Hit apply and open new terminal. | 0 | 1 | 0 | 0 | 2014-03-09T21:43:00.000 | 29 | 0 | false | 22,288,569 | 1 | 0 | 0 | 9 | I've set up PyCharm, created my virtualenv (either through the virtual env command, or directly in PyCharm) and activated that environment as my Interpreter. Everything is working just fine.
However, if I open a terminal using "Tools, Open Terminal", the shell prompt supplied is not using the virtual env; I still have ... |
How do I activate a virtualenv inside PyCharm's terminal? | 70,631,199 | 0 | 139 | 226,921 | 0 | python,django,shell,virtualenv,pycharm | Windows Simple and Easy Solution:
In Pycharm inside the Projects menu on the left there will be folders.
Find the Scripts folder
Inside there you'll find activate.bat
Right click on activate.bat
Copy/Path Reference
Select Absolute Path
Find the Terminal tab located in the middle at the bottom of Pycharm.
Paste it into... | 0 | 1 | 0 | 0 | 2014-03-09T21:43:00.000 | 29 | 0 | false | 22,288,569 | 1 | 0 | 0 | 9 | I've set up PyCharm, created my virtualenv (either through the virtual env command, or directly in PyCharm) and activated that environment as my Interpreter. Everything is working just fine.
However, if I open a terminal using "Tools, Open Terminal", the shell prompt supplied is not using the virtual env; I still have ... |
How do I activate a virtualenv inside PyCharm's terminal? | 52,873,952 | 3 | 139 | 226,921 | 0 | python,django,shell,virtualenv,pycharm | On Mac it's PyCharm => Preferences... => Tools => Terminal => Activate virtualenv, which should be enabled by default. | 0 | 1 | 0 | 0 | 2014-03-09T21:43:00.000 | 29 | 0.020687 | false | 22,288,569 | 1 | 0 | 0 | 9 | I've set up PyCharm, created my virtualenv (either through the virtual env command, or directly in PyCharm) and activated that environment as my Interpreter. Everything is working just fine.
However, if I open a terminal using "Tools, Open Terminal", the shell prompt supplied is not using the virtual env; I still have ... |
How do I activate a virtualenv inside PyCharm's terminal? | 37,982,649 | 1 | 139 | 226,921 | 0 | python,django,shell,virtualenv,pycharm | If your Pycharm 2016.1.4v and higher you should use
"default path" /K "<path-to-your-activate.bat>"
don't forget quotes | 0 | 1 | 0 | 0 | 2014-03-09T21:43:00.000 | 29 | 0.006896 | false | 22,288,569 | 1 | 0 | 0 | 9 | I've set up PyCharm, created my virtualenv (either through the virtual env command, or directly in PyCharm) and activated that environment as my Interpreter. Everything is working just fine.
However, if I open a terminal using "Tools, Open Terminal", the shell prompt supplied is not using the virtual env; I still have ... |
How do I activate a virtualenv inside PyCharm's terminal? | 27,075,910 | 1 | 139 | 226,921 | 0 | python,django,shell,virtualenv,pycharm | I have a solution that worked on my Windows 7 machine.
I believe PyCharm's terminal is a result of it running cmd.exe, which will load the Windows PATH variable, and use the version of Python that it finds first within that PATH. To edit this variable, right click My Computer --> Properties --> Advanced System Settings... | 0 | 1 | 0 | 0 | 2014-03-09T21:43:00.000 | 29 | 0.006896 | false | 22,288,569 | 1 | 0 | 0 | 9 | I've set up PyCharm, created my virtualenv (either through the virtual env command, or directly in PyCharm) and activated that environment as my Interpreter. Everything is working just fine.
However, if I open a terminal using "Tools, Open Terminal", the shell prompt supplied is not using the virtual env; I still have ... |
How do I activate a virtualenv inside PyCharm's terminal? | 69,456,332 | 1 | 139 | 226,921 | 0 | python,django,shell,virtualenv,pycharm | I had the similar problem of not having venv activated in pycharm terminal (Pycharm version 2021.2.2). Just simply follow the steps below.
Go to "settings -> tools -> terminal" then at the bottom of that window check if "Activate virtualenv" is having a tick or not, if not then make sure that box is ticked.
Then in the... | 0 | 1 | 0 | 0 | 2014-03-09T21:43:00.000 | 29 | 0.006896 | false | 22,288,569 | 1 | 0 | 0 | 9 | I've set up PyCharm, created my virtualenv (either through the virtual env command, or directly in PyCharm) and activated that environment as my Interpreter. Everything is working just fine.
However, if I open a terminal using "Tools, Open Terminal", the shell prompt supplied is not using the virtual env; I still have ... |
How do I activate a virtualenv inside PyCharm's terminal? | 69,724,636 | 11 | 139 | 226,921 | 0 | python,django,shell,virtualenv,pycharm | Somehow a small trick worked for me. All you gotta do is change the default terminal from Power shell to CMD.
Open pycharm --> Go to Settings --> Tools --> Terminal
Change the Shell Path to C:\Windows\system32\cmd.exe from PS
Check the Activate virtualenv checkbox
Hit apply and open new terminal
It's 2021 you don't n... | 0 | 1 | 0 | 0 | 2014-03-09T21:43:00.000 | 29 | 1 | false | 22,288,569 | 1 | 0 | 0 | 9 | I've set up PyCharm, created my virtualenv (either through the virtual env command, or directly in PyCharm) and activated that environment as my Interpreter. Everything is working just fine.
However, if I open a terminal using "Tools, Open Terminal", the shell prompt supplied is not using the virtual env; I still have ... |
How do I activate a virtualenv inside PyCharm's terminal? | 23,730,300 | 43 | 139 | 226,921 | 0 | python,django,shell,virtualenv,pycharm | For Windows users when using PyCharm and a virtual environment under Windows, you can use the /k parameter to cmd.exe to set the virtual environment automatically.
Go to Settings, Terminal, Default shell and add /K <path-to-your-activate.bat>.
I don't have the reputation to comment on the earlier response so posting th... | 0 | 1 | 0 | 0 | 2014-03-09T21:43:00.000 | 29 | 1 | false | 22,288,569 | 1 | 0 | 0 | 9 | I've set up PyCharm, created my virtualenv (either through the virtual env command, or directly in PyCharm) and activated that environment as my Interpreter. Everything is working just fine.
However, if I open a terminal using "Tools, Open Terminal", the shell prompt supplied is not using the virtual env; I still have ... |
Notify celery task to stop during worker shutdown | 29,481,481 | -2 | 4 | 1,753 | 0 | python,celery | Celery is not intended to run long tasks cause it blocks the worker for your task only. I recommend re-arranging your logic, making the task invoke itself instead of making the loop. Once shutdown is in progress, your current task will complete and will resume right at the same point where it stopped before celery shut... | 0 | 1 | 0 | 0 | 2014-03-10T13:16:00.000 | 2 | -0.197375 | false | 22,301,208 | 0 | 0 | 0 | 1 | I'm using celery 3.X and RabbitMQ backend. From time to time it needs to restart celery (to push a new source code update to the server). But there is a task with big loop and try/catch inside of the loop; it can takes a few hours to accomplish the task. Nothing critical will happen if I will stop it and will restart i... |
How can I upload a static HTML to templates folder of GAE app? | 22,304,153 | 0 | 0 | 60 | 0 | java,python,google-app-engine | No you cant if you want to store them in static storage.
You can store them somewhere non-static but you will lose the many advantages of having it as static content. | 0 | 1 | 0 | 0 | 2014-03-10T14:07:00.000 | 1 | 0 | false | 22,302,439 | 0 | 0 | 1 | 1 | Can I upload a static HTML file to templates folder without re-deploying the app?
Offline I create an HTML file which I want to upload to my Google app engine app,which displays the HTML as per URLs. But I don't want to deploy my site every time I am uploading a new file.
Any suggestion would be helpful. |
The use of app.py.disabled on openshift | 22,352,836 | 0 | 0 | 196 | 0 | python-2.7,openshift,paas | I created a new gear with each cartridge type [python-2.6, python-2.7, python-3.3] and when the code was cloned to my workstation, none of them contained an app.py.disabled file. Can you give more information about how you created the application? Did you use a specific quickstart or url? | 0 | 1 | 0 | 1 | 2014-03-11T07:43:00.000 | 2 | 0 | false | 22,319,312 | 0 | 0 | 0 | 1 | I recently created a python app on openshift. I found a file called app.py.disabled when I git cloned the repo. Can anyone explain what it does? |
How do I get a list of python libraries I've installed? | 22,321,316 | 2 | 0 | 345 | 0 | python,macos | Use pip list or install yolk with pip install yolk and then yolk -l. | 0 | 1 | 0 | 0 | 2014-03-11T09:18:00.000 | 2 | 0.197375 | false | 22,321,243 | 1 | 0 | 0 | 1 | I'm new to python, and I installed so many libraries, so I forgot what I installed and not.
I'd like to get a list of libraries I've installed. Any help would be grateful.
I'm using mac OS 10.9.2 |
Skipping stale data in a Twisted protocol handler | 22,333,848 | 1 | 0 | 71 | 0 | python,twisted | There aren't any peek-ahead APIs in Twisted that will let you know if there is data waiting in a buffer somewhere that's about to be delivered.
I think your second idea is just fine - as long as you notice that you can pick an arbitrarily small constant delay. For example, you could pick 0 seconds. In practice this i... | 0 | 1 | 1 | 0 | 2014-03-11T17:17:00.000 | 1 | 1.2 | true | 22,331,935 | 0 | 0 | 0 | 1 | I want to write a client for a protocol where the server sends length-prefixed data. The data requires nontrivial decoding and processing, and at any moment the client only needs the latest available data: if there is more data available, it's desirable to flush the old entries and use only the newest one. This is to a... |
Storing song, artist and album data on App Engine | 22,552,471 | 0 | 0 | 235 | 0 | python,json,google-app-engine,app-engine-ndb | I would process the data from json, and place it in Model. As far as schema goes, you really need not worry about having redundancies as you cannot really think of the ndb as a relational database. So do not bother yourself too much about normalising the schema.
But don't process on the client side, it is really not a ... | 0 | 1 | 0 | 0 | 2014-03-11T22:27:00.000 | 2 | 0 | false | 22,338,014 | 0 | 0 | 1 | 1 | I need to store information on artists, albums and songs in Google App Engine for a project I'm working on. The information is meta data taken from a directory of MP3s (using Python) that needs to be sent to App Engine for display to users. Along with the meta data, the song's path will need to be stored.
Currently whi... |
Share file stream between Python and C | 22,355,036 | 1 | 2 | 258 | 0 | python,c,file | It should be possible. In C, you can get the file descriptor with fileno(fh) and open it in Python with os.fdopen(fd). Make sure you remember to close it -- I doubt that the Python file object going out of scope would accomplish this. | 0 | 1 | 0 | 1 | 2014-03-12T14:39:00.000 | 1 | 0.197375 | false | 22,354,902 | 0 | 0 | 0 | 1 | I've been trying to integrate C code into Python under Linux and I came up with the following problem: ¿is it possible to share an already opened file between C and Python? I mean a C FILE and a Python file object.
The C function which I'm struggling with is called exhaustively, so I'd like to avoid opening/closing the... |
Developing Linux Kernel Modules in Python | 29,156,444 | 0 | 7 | 12,935 | 0 | python,linux,linux-kernel,driver | No; LKM on Linux have to be compiled down do a specific ELF object code format.
Of course you could make your own hack of Python that does compile down to kernel object code, but as far as I know, at this time there is no such Python publicly available. | 0 | 1 | 0 | 0 | 2014-03-12T14:52:00.000 | 3 | 0 | false | 22,355,264 | 1 | 0 | 0 | 1 | I have been wondering if developing Linux kernel modules (drivers) with Python is possible. Is it? |
Query machine for hostname | 22,358,568 | 3 | 1 | 218 | 0 | python,linux,bash | You can remotely execute the command hostname command on these machines to acquire the Hostname | 0 | 1 | 1 | 0 | 2014-03-12T16:54:00.000 | 1 | 0.53705 | false | 22,358,516 | 0 | 0 | 0 | 1 | I want to be able to scan a network of servers and match IP addresses to hostnames.
I saw a lot of questions about this (with a lot of down votes), but none are exactly what I'm looking for.
So I've tried python's socket library socket.gethostbyaddr(ip). But this only returns results if I have a DNS setup or the IP-to... |
How to set Python IDLE to use certain python version | 22,358,774 | 2 | 0 | 271 | 0 | python-3.x | Each installation of Python comes with its own respective version if IDLE. I suggest you explore your Python installation folder, and find the version of IDLE you're looking for and create a shortcut to it, or add it to your environment variable list, so you can invoke a specific version from the command line. | 0 | 1 | 0 | 0 | 2014-03-12T17:01:00.000 | 1 | 1.2 | true | 22,358,713 | 1 | 0 | 0 | 1 | I am using Windows 8.
Python version 2.7.3 have been installed on my computer together with another software.
Now I have installed python 3.3.5 and i want to use this version from now.
But everytime I run Python IDLE it runs version 2.7.3.
Even if I go to C:\Python33\Lib\idlelib\idle.pyw and run idle.pyw it runs with ... |
can i serve PHP and python on a single project in app engine? | 22,365,130 | 0 | 0 | 63 | 0 | php,python,google-app-engine | You can (and many do) use a front-end like nginx or Apache that handles and forwards different paths differently. I do not see why you would want your application engine to be "bilingual" though. | 0 | 1 | 0 | 1 | 2014-03-12T22:12:00.000 | 1 | 0 | false | 22,365,018 | 0 | 0 | 1 | 1 | Can I serve PHP and python on a single project in app engine?
for example
/php/* will run php code, but the root / will run python code. |
How to edit record in google datastore in AppEngine? | 22,370,376 | 1 | 0 | 255 | 0 | python,django,google-app-engine,gql | Fetch the record you want to edit (by key , id or any filter) , modify the field you want to edit and then put() it. | 0 | 1 | 0 | 0 | 2014-03-13T04:56:00.000 | 1 | 1.2 | true | 22,369,384 | 0 | 0 | 1 | 1 | I was create one app which have model and it was created but i facing problem how to edit data in google data store using python or Django. Please Help me. |
Running homebrew while in a virtualenv | 22,379,177 | 2 | 5 | 1,012 | 0 | python,macos,virtualenv,homebrew | I don't think if they are related. You have to use pip for python package management when you use virtualenv. this way you make sure that your new stuff is on the sandbox you created. AFAIK home-brew installs stuff globally. So better not use it to get the python modules. hope it helps. | 0 | 1 | 0 | 0 | 2014-03-13T12:45:00.000 | 2 | 1.2 | true | 22,379,103 | 1 | 0 | 0 | 1 | Simple question: is running homebrew while in a virtualenv a bad idea?
If so, is there any way that I can automatically deactivate the virtualenv each time I run a homebrew command? I don't trust myself to always remember to deactivate the virtualenv or open a new terminal window. |
pkg_resources.resource_filename is not extracting files | 22,385,552 | 3 | 4 | 5,826 | 0 | python-3.x,setuptools,egg,python-egg-cache | Found the cause of the issue. As @erykson noted I was using the wrong directory.
After replacing
html_path = resource_filename(__name__, "html")
with
html_path = resource_filename(Requirement.parse("myproj"), "html")
everything works fine. | 0 | 1 | 0 | 0 | 2014-03-13T14:07:00.000 | 1 | 1.2 | true | 22,381,146 | 0 | 0 | 0 | 1 | I want to package a project that contains (and uses) template html files and distribuite it as an egg. Since I’m using tornadoweb, which requires file paths to point to html files, I can’t access the resources via stream and I really need the html files to be extracted when my program is running.
I’m having a look at... |
deleting rows in linux | 22,392,153 | 0 | 0 | 115 | 0 | python,linux,bash,file-io | There are various command line applications that would be able to accomplish this when working together. For example, you could cat all the files one after another, grep -v the patterns you don't want, redirecting >> to a new file. In effect this is doing the same thing as your Python script would do, because every lin... | 0 | 1 | 0 | 0 | 2014-03-13T21:54:00.000 | 4 | 0 | false | 22,391,805 | 0 | 0 | 0 | 1 | I have a number of huge delimited text files containing information logged by date. Some of the files overlap slightly with each other by date (which I don't want since it leads to duplicates). I know what the overlapping dates are so I want to be able to go through some of the files and delete each of the rows that co... |
Running Python in PHP as a script in XAMPP (WINDOWS 8.1) | 22,395,764 | 2 | 2 | 3,357 | 0 | php,python-2.7,xampp,windows-8.1 | I have finally figured this out:
I will have to restart the server whenever I add a new cgi script in the server. This worked.
In this case BridgePHP.py | 0 | 1 | 0 | 1 | 2014-03-14T02:46:00.000 | 1 | 1.2 | true | 22,395,199 | 0 | 0 | 0 | 1 | These are the actions that I have taken and I still can't seem to run the script on PHP on my windows 8.1 platform.
Please do note that I have installed Python and have tested it. I am running python 2.7
(1) Step 1: Edited the Apache httpd.conf scripts to run cgi .py scripts
AddHandler cgi-script .cgi .pl .asp .py
(2... |
how to install PIL on Macosx 10.9? | 22,470,752 | 2 | 2 | 751 | 0 | python,macos,python-imaging-library | following line helped me.
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pillow | 0 | 1 | 0 | 0 | 2014-03-17T08:02:00.000 | 2 | 0.197375 | false | 22,449,304 | 0 | 0 | 0 | 1 | When I try to install PIL library on Macosx 10.9.2, it's giving following error, how to install it.
$: sudo pip install pillow
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prot... |
How can I directly open a custom file with python on a double click? | 22,455,449 | 2 | 6 | 541 | 0 | python,file,python-3.x,exe,cx-freeze | The only way Windows associates files with a particular program is by their extension, so this only works if your files have a unique extension (which it looks like maybe they do). So your user would need to setup the association on their machine, which varies depending on the version of Windows. For instance, in Windo... | 0 | 1 | 0 | 0 | 2014-03-17T13:16:00.000 | 2 | 0.197375 | false | 22,455,309 | 0 | 0 | 0 | 1 | I am programming on a windows machine and I have an app that reads file selected by the user. Is it possible to allow them to open the file directly when they double click. This needs to work when the program is "compiled" as an .exe with cxfreeze.
What I am really asking is this:
Is there a way to allow the user to do... |
Open python file with Task scheduler | 22,519,416 | 1 | 1 | 359 | 0 | python-2.7,batch-file,csv,task,scheduler | Assuming that you try this under the windows 7 Task-scheduler...
You may try the following:
In the security options of your Task (1st page) ensure that you have selected the SYSTEM account. Tick the high privileges check box near the bottom of the dialog (i guess you already did that)
check if the file can be accessed... | 0 | 1 | 0 | 0 | 2014-03-19T19:29:00.000 | 1 | 1.2 | true | 22,516,246 | 1 | 0 | 0 | 1 | I have a .py file that reads integers from a separate csv , i just cant launch it from windows task scheduler, after 2 days and much frustration im posting here. A lot of similar questions have been posted but none are answered adequately for my case.
I have no problems launching other python files or exe's, the probl... |
Celery Flower - how can i load previous catched tasks? | 22,554,555 | 2 | 1 | 1,345 | 0 | python,celery,celery-task,flower | I found i out.
It is the matter of setting the persistant flag in command running celery flower. | 0 | 1 | 0 | 0 | 2014-03-21T08:26:00.000 | 1 | 1.2 | true | 22,553,659 | 0 | 0 | 0 | 1 | I started to use celery flower for tasks monitoring and it is working like a charm. I have one concern though, how can i "reload" info about monitored tasks after flower restart ?
I use redis as a broker, and i need to have option to check on tasks even in case of unexpected restart of service (or server).
Thanks in ad... |
Python Anaconda - How to Safely Uninstall | 50,594,422 | 3 | 275 | 666,412 | 0 | python,anaconda | In case you have multiple version of anaconda,
rm -rf ~/anaconda2 [for version 2]
rm -rf ~/anaconda3 [for version 3]
Open .bashrc file in a text editor
vim .bashrc
remove anaconda directory from your PATH.
export PATH="/home/{username}/anaconda2/bin:$PATH" [for version 2]
export PATH="/home/{username}/anaconda3/bin:$PA... | 0 | 1 | 0 | 0 | 2014-03-22T23:51:00.000 | 19 | 0.031568 | false | 22,585,235 | 1 | 0 | 0 | 4 | I installed Python Anaconda on Mac (OS Mavericks). I wanted to revert to the default version of Python on my Mac. What's the best way to do this? Should I delete the ~/anaconda directory? Any other changes required?
Currently when I run which python I get this path:
/Users/username/anaconda/bin/python |
Python Anaconda - How to Safely Uninstall | 68,270,547 | 0 | 275 | 666,412 | 0 | python,anaconda | In macOs
rm -rf ~/opt/anaconda3 | 0 | 1 | 0 | 0 | 2014-03-22T23:51:00.000 | 19 | 0 | false | 22,585,235 | 1 | 0 | 0 | 4 | I installed Python Anaconda on Mac (OS Mavericks). I wanted to revert to the default version of Python on my Mac. What's the best way to do this? Should I delete the ~/anaconda directory? Any other changes required?
Currently when I run which python I get this path:
/Users/username/anaconda/bin/python |
Python Anaconda - How to Safely Uninstall | 50,807,405 | 1 | 275 | 666,412 | 0 | python,anaconda | To uninstall Anaconda Fully from your System :
Open Terminal
rm -rf ~/miniconda
rm -rf ~/.condarc ~/.conda ~/.continuum | 0 | 1 | 0 | 0 | 2014-03-22T23:51:00.000 | 19 | 0.010526 | false | 22,585,235 | 1 | 0 | 0 | 4 | I installed Python Anaconda on Mac (OS Mavericks). I wanted to revert to the default version of Python on my Mac. What's the best way to do this? Should I delete the ~/anaconda directory? Any other changes required?
Currently when I run which python I get this path:
/Users/username/anaconda/bin/python |
Python Anaconda - How to Safely Uninstall | 22,585,265 | 152 | 275 | 666,412 | 0 | python,anaconda | The anaconda installer adds a line in your ~/.bash_profile script that prepends the anaconda bin directory to your $PATH environment variable. Deleting the anaconda directory should be all you need to do, but it's good housekeeping to remove this line from your setup script too. | 0 | 1 | 0 | 0 | 2014-03-22T23:51:00.000 | 19 | 1 | false | 22,585,235 | 1 | 0 | 0 | 4 | I installed Python Anaconda on Mac (OS Mavericks). I wanted to revert to the default version of Python on my Mac. What's the best way to do this? Should I delete the ~/anaconda directory? Any other changes required?
Currently when I run which python I get this path:
/Users/username/anaconda/bin/python |
Error in Python IDLE and shell while Proxifier is on | 29,597,942 | 1 | 1 | 603 | 0 | python,shell | I encountered the same problem. After trying a lot of things I arrived at this solution. The trick is to make a new Proxification Rule in proxifier. Name it anything you prefer, say PythonIdle.
In application box add python.exe and pythonw.exe.
Set action to Direct.
Hope it will solves your problem! | 0 | 1 | 0 | 0 | 2014-03-23T11:50:00.000 | 1 | 1.2 | true | 22,590,490 | 0 | 0 | 0 | 1 | I have recently installed Python 2.7.6 in windows 7. When I tried to open the IDLE, it gave fatal errors.
There are two error message popping up subsequently showing error messages:
"IDLE Subprocess Error"
"Socket Error:No connection could be made because the target machine
actively refused it"
"Subprocess Startu... |
Thumbor installation not working | 23,401,532 | 1 | 0 | 3,567 | 0 | python,ubuntu-12.04,thumbnails,thumbor | You are missing a closing bracket in the filters option in your thumbor.conf.
Did you miss it posting here or actually in the thumbor.conf file? | 0 | 1 | 1 | 0 | 2014-03-24T12:43:00.000 | 1 | 0.197375 | false | 22,609,742 | 0 | 0 | 0 | 1 | I have followed the wiki and set up everything necessary, but all the images are broken right now. I used the aptitude package manager to install.
Here are my configuration files:
/etc/default/thumbor
# set this to 0 to disable thumbor, remove or set anything else to enable it
# you can temporarily override this with... |
Query network device to determine operating system, without installing a remote agent? | 22,610,165 | 0 | 0 | 83 | 0 | python | Look up phrases like "port scan" and "port mapping" for some ideas. You'll need to make use of whatever services are already running on the target machine, which could include Avahi/Bonjour/mDNS, HTTP, SSH, SMTP, etc. You'd try to figure out what ports might be open, try to connect there (or send UDP datagrams), and ... | 0 | 1 | 0 | 0 | 2014-03-24T12:50:00.000 | 1 | 1.2 | true | 22,609,931 | 0 | 0 | 0 | 1 | I would like to query a device (e.g. an Android phone on WiFi) to find out what Operating System it is running, without having to run anything on the device or install an additional agent?
Is this possible? |
When I try to run 'cfx run' or 'cfx test' using the Mozilla Add-On SDK, my application binaries are not found | 22,612,244 | 3 | 1 | 730 | 0 | python,macos,firefox,firefox-addon,firefox-addon-sdk | It's looking for the Firefox binary file, not your application's binaries. You have to install Firefox because cfx run will open a browser with your add-on installed so you can use it and test it live.
If firefox is already installed, then it is in a non-standar path, so you must tell cfx command where to find it, thi... | 0 | 1 | 0 | 0 | 2014-03-24T13:19:00.000 | 1 | 1.2 | true | 22,610,616 | 0 | 0 | 1 | 1 | I installed the the latest Add-On SDK by Mozilla (version 1.15). Installation was successful and when I execute cfx I get a list of all possible commands. I made a new separate empty folder, cd'd into it and ran cfx init. This was also successful and all necessary folders and files got created.
Now when I try to run t... |
Unzip all files in zip archive with inline command | 22,614,609 | 1 | 0 | 174 | 0 | python | I found the solution to be this:
python -c "import zipfile;file=zipfile.ZipFile('archive.zip');file.extractall('.')"
The contents of archive.zip will be placed into the directory this command is executed from. | 0 | 1 | 0 | 0 | 2014-03-24T16:06:00.000 | 1 | 1.2 | true | 22,614,608 | 1 | 0 | 0 | 1 | I have a zip file, but no unzipping tool installed. I do have python installed, but I can't easily create a python script file on this machine. How do I unzip the contents of the zip file using the python executable's -c argument? |
launch a python program with it's arguments on cmd and get the output messages python | 22,634,599 | 0 | 0 | 47 | 0 | python | You can run any python command from cmd using Python.exe -c //code
For example, Python.exe -c print(10*10) will print 100 to your console.
Does this help? Your question is a little unclear, sorry. | 0 | 1 | 0 | 0 | 2014-03-25T12:13:00.000 | 2 | 0 | false | 22,634,264 | 0 | 0 | 0 | 1 | I would like to launch a python program.exe to test it from another python code i,e launch it on the cmd (myprogram.exe -a arg1 -b arg2) and eventually get the error message it can print or any console output
does anyone have an idea how to do this?
thanks
EDIT
Actually I launch it with os.popen(command) but what I w... |
Loading python modules through a computing cluster | 22,640,013 | 0 | 1 | 109 | 0 | python,linux,bash | The submitted script is most likely using the system Python installation and not your own. Try submitting a shell script with only one command, which python, to confirm.
The fix is to prepend the path to your Python interpreter to your system path. On my machine, the right Python is installed at /Users/mbatchkarov/anac... | 0 | 1 | 0 | 1 | 2014-03-25T15:53:00.000 | 1 | 0 | false | 22,639,768 | 0 | 0 | 0 | 1 | I have an account to a computing cluster that uses Scientific Linux. Of course I only have user access. I'm working with python and I need to run python scripts, so I need to import some python modules. Since I don't have root access, I installed a local python copy on my $HOME with all the required modules. When I run... |
Are queries on the "__key__" property strongly consistent with GAE datastore? | 22,649,967 | 0 | 2 | 128 | 0 | java,php,python,google-app-engine,go | A query will be consistent only on ancestor queries. Otherwise is not consistent even if the index contains key entries.
This is because writes are applied in two phases, one to write your data and other to update indexes. Get by key neves uses an index so its always correct.
I assume that you are generating semi-secue... | 0 | 1 | 0 | 0 | 2014-03-25T22:16:00.000 | 1 | 1.2 | true | 22,647,454 | 0 | 0 | 0 | 1 | I know generally queries on the GAE datastore are eventually consistent. However I don't see why queries on __key__ should not be strongly consistent as I presume this is what the datastore Get function uses.
Can anyone confirm querying by __key__ is strongly consistent? |
Loading python modules through a computing cluster | 22,656,636 | 1 | 5 | 2,305 | 0 | linux,python,distributed-computing | You could simply call your python program from the bash script with something like: PYTHONPATH=$HOME/lib/python /path/to/my/python my_python_script
I don't know how SunGrid works, but if it uses a different user than yours, you'll need global read access to your $HOME. Or at least to the python libraries. | 0 | 1 | 0 | 1 | 2014-03-25T16:01:00.000 | 3 | 0.066568 | false | 22,652,367 | 0 | 0 | 0 | 1 | I have an account to a computing cluster that uses Scientific Linux. Of course I only have user access. I'm working with python and I need to run python scripts, so I need to import some python modules. Since I don't have root access, I installed a local python copy on my $HOME with all the required modules. When I run... |
how to invoke a terminal/powershell in a remote machine using python | 22,659,787 | 0 | 0 | 103 | 0 | python,django,terminal | The most secure way to execute functionality on a remote machine to use subprocess module to open a ssh session on the remote site, and remember to set up ssh on both machines, firewalls etc. When you start ssh you tell it what command to execute and the parameters for that command.
I wouldn't open a general terminal s... | 0 | 1 | 0 | 0 | 2014-03-26T06:38:00.000 | 1 | 0 | false | 22,653,330 | 0 | 0 | 0 | 1 | am doing a project in Django I want to invoke a terminal in another machine to execute the code and how can I pass the the arguments to that terminal using python |
High CPU usage for DJango 1.4 on Windows 2012 | 22,773,695 | 0 | 0 | 94 | 0 | performance,python-2.7,32-bit,windows-server-2012 | The issue was in 32-bit version of Python shipped with Zoo.
Installing a 64-bit version and modifying the Zoo engine to use it, has boosted things significantly. | 0 | 1 | 0 | 0 | 2014-03-27T06:26:00.000 | 1 | 1.2 | true | 22,679,857 | 0 | 0 | 1 | 1 | We migrated to Helicon Zoo on Windows 2012 (from ISAPI on 2008). Problem is that the users started complaining about random slowdowns and timeouts with the application.
The Python is 2.7 32-bit (due to Zoo requirements).
That said, the problem is not Zoo related, as the runserver seems to exhibit same issues.
The CPU s... |
are global variables visible to subprocess and changable by subprocess? | 22,690,448 | 3 | 1 | 3,561 | 0 | python,variables,subprocess,global | No, global variables are not visible to a sub-process. Variables are private to each process. If you want to share variables then you need to use some form of inter-process communication. | 0 | 1 | 0 | 0 | 2014-03-27T14:19:00.000 | 3 | 0.197375 | false | 22,690,404 | 1 | 0 | 0 | 3 | A quick question for Python 2.7
Are global variables visible to a subprocess?
Can a subprocess change the values of global variables?
Many thanks. |
are global variables visible to subprocess and changable by subprocess? | 22,690,516 | 2 | 1 | 3,561 | 0 | python,variables,subprocess,global | The processes doesn't share the variables in a general operating system terms. Use some communication mechanism like message passing, shared memory etc to achieve the inter process communication. | 0 | 1 | 0 | 0 | 2014-03-27T14:19:00.000 | 3 | 1.2 | true | 22,690,404 | 1 | 0 | 0 | 3 | A quick question for Python 2.7
Are global variables visible to a subprocess?
Can a subprocess change the values of global variables?
Many thanks. |
are global variables visible to subprocess and changable by subprocess? | 22,858,917 | 0 | 1 | 3,561 | 0 | python,variables,subprocess,global | Maybe the simplest way is write those into a file and read from the file in another process, although this might take extra time. | 0 | 1 | 0 | 0 | 2014-03-27T14:19:00.000 | 3 | 0 | false | 22,690,404 | 1 | 0 | 0 | 3 | A quick question for Python 2.7
Are global variables visible to a subprocess?
Can a subprocess change the values of global variables?
Many thanks. |
How to check if there are errors in python | 22,719,539 | 3 | 1 | 182 | 0 | python,google-app-engine | If you are using the App Engine Launcher then by clicking on the Logs you can see all the logs and errors.
An alternative way is to start the development server via the command line (as it's already mentioned) and you will see all the logs there, which makes it much easier to work with because the Logs windows is not t... | 0 | 1 | 0 | 0 | 2014-03-28T15:45:00.000 | 2 | 1.2 | true | 22,717,414 | 1 | 0 | 1 | 1 | While using Google App Engine if there is an error in python the result is a blank page. It is difficult to debug python since you don't get line number on which there is error. It is extremely frustrating when you get blank page because of indentation error. Is there any way to execute python google app engine script ... |
How to release python script as a product? | 22,725,485 | 1 | 1 | 622 | 0 | python,pyinstaller | If you want no additional installation under every circumstance, one way or another you need to ship it with a python interpreter. So, in fact you are making the user install the interpreter in an unofficial fashion.
Most linux distributions come with Python nowadays, and you would get problems originating of version c... | 0 | 1 | 0 | 0 | 2014-03-28T23:35:00.000 | 1 | 1.2 | true | 22,725,003 | 1 | 0 | 0 | 1 | I'd like to release one python script to other users for Linux OS.
I need to make sure the released script doesn't require other users to install the compatible version of python( maybe there is no python installed).
This released script could also be modified and ran by other users.
I tried pyinstaller. It gave me two... |
Where can i find the deploy log in python app deployed in Openshift | 22,736,609 | 1 | 0 | 127 | 0 | python,django,logging,openshift | The deploy output is logged to stdout if I recall correctly. If you git push from the command line you should see where things are failing. | 0 | 1 | 0 | 1 | 2014-03-28T23:40:00.000 | 1 | 1.2 | true | 22,725,031 | 0 | 0 | 0 | 1 | I wanna be able to find the output text of the "deploy" script, that openshift calls automatically.
Suppose I have the following line in that "deploy" script:
python "$OPENSHIFT_REPO_DIR"wsgi/openshift/manage.py syncdb --noinput
Then I wanna see the output text of that call...
I already looked at the openshifthome/pyth... |
Get celery task ids in advanced workflow | 22,898,676 | 0 | 1 | 998 | 0 | python,celery | Solved by flagging ATask related model with aborted status flag and adding check at start of BTask. | 0 | 1 | 0 | 0 | 2014-03-29T09:36:00.000 | 1 | 1.2 | true | 22,729,357 | 0 | 0 | 0 | 1 | I need to realise following scenario:
Execute task A
Execute multiple task B in parallel with different arguments
Wait for all tasks to finish
Execute multiple task B in parallel with different arguments
Wait for all tasks to finish
Execute task C
I have achieved this by implementing chain of chords, here is simpl... |
How to communicate between Django and Twisted when implementing a publish-subscribe pattern? | 22,750,492 | 1 | 3 | 578 | 0 | python,django,websocket,twisted,publish-subscribe | There are dozens or hundreds of ways to do inter-process communication. For example, you could use HTTP by running an HTTP server in one process and using an HTTP client in the other.
The specific choice of protocol probably doesn't matter a whole lot. The particular details of the kind of communication you need migh... | 0 | 1 | 0 | 0 | 2014-03-30T03:48:00.000 | 2 | 0.099668 | false | 22,740,033 | 0 | 0 | 1 | 1 | I'm implementing a WebSocket server using Python and Autobahn (something that builds off of Twisted). What's the best way to let my Autobahn/Twisted server know that something has happened from within my Django application?
More specifically, I'm implementing a notifications service and instant update service that auto... |
Use production App Engine datastore on development machine? | 22,772,893 | 2 | 0 | 334 | 0 | python,google-app-engine | TL;DR: We do not support having the dev_appserver use the real app-engine datastore. Even with the suggested use of "remote_api", AFAIK, the dev_appserver does not know how to use it.
If you really want to make this work, you could write your own low-level API and have your own datastore abstraction that uses your API... | 0 | 1 | 0 | 0 | 2014-03-31T15:22:00.000 | 2 | 1.2 | true | 22,765,563 | 0 | 0 | 1 | 1 | Is it possible to setup the App Engine SDK on my local machine to use the live datastore while developing? Sometimes it's just easier for my workflow to work live.
If not, is there an easy way to download or sync the live data to development machine?
Thanks! |
How can I specify a path on a Mac | 22,774,906 | 0 | 1 | 186 | 0 | python,macos,python-2.7,path | Another way is to set the PYTHONPATH environment variable to /User/username in your shell. Since you know about your shell, I expect that you already know how to edit your shell resource script. You could also add it to your .profile file in which case it should be available even if you change which shell you happen to... | 0 | 1 | 0 | 0 | 2014-03-31T15:43:00.000 | 3 | 0 | false | 22,766,066 | 1 | 0 | 0 | 1 | I'm using Python 2.7.2. and I want to open and use a dictionary I created in my shell. My problem is, when I try to import this dictionary into my shell it can't find the file because python is just looking into the 'my documents' folder.
My question is, how can I navigate to the correct folder (just one folder furthe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.