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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Google app engine parsing xml more then 1 mb | 3,334,425 | 2 | 1 | 485 | 0 | python,google-app-engine,parsing | The 1MB limit doesn't apply to parsing; however, you can't fetch more than 1MB from URLfetch; you'll only get the first 1MB from the API.
It's probably not going to be possible to get the XML into your application using the URLfetch API. If the data is smaller than 10MB, you can arrange for an external process to POST... | 0 | 1 | 1 | 0 | 2010-07-26T07:14:00.000 | 1 | 0.379949 | false | 3,332,897 | 0 | 0 | 1 | 1 | Hi i need to parse xml file which is more then 1 mb in size, i know GAE can handle request and response up to 10 MB but as we need to use SAX parser API and API GAE has limit of 1 MB so is there way we can parse file more then 1 mb any ways. |
Should I use Pylon's Paste to host my Pylons website? Or can I use Apache? | 3,358,288 | 0 | 5 | 511 | 0 | python,web-services,pylons | I'm using Nginx (with fastcgi) or Apache for hosting Pylons sites, mostly because lack of some "production" features in Paste, but for development Paste is very usefull and handy. | 0 | 1 | 0 | 1 | 2010-07-26T07:57:00.000 | 2 | 0 | false | 3,333,113 | 0 | 0 | 0 | 1 | I'm looking into Pylons and was wondering, should I use Paste as the webserver or can I use Apache?
Are there advantages to using Paste?
Would you recommend against using Apache?
How should I host the sites? |
Python - When Is It Ok to Use os.system() to issue common Linux commands | 3,338,914 | 5 | 12 | 3,734 | 0 | python,linux,centos | One of the problems with system() is that it implies knowledge of the shell's syntax and language for parsing and executing your command line. This creates potential for a bug where you didn't validate input properly, and the shell might interpet something like variable substitution or determining where an argument be... | 0 | 1 | 0 | 0 | 2010-07-26T20:13:00.000 | 7 | 0.141893 | false | 3,338,616 | 1 | 0 | 0 | 6 | Spinning off from another thread, when is it appropriate to use os.system() to issue commands like rm -rf, cd, make, xterm, ls ?
Considering there are analog versions of the above commands (except make and xterm), I'm assuming it's safer to use these built-in python commands instead of using os.system()
Any thoughts? I... |
Python - When Is It Ok to Use os.system() to issue common Linux commands | 3,338,752 | 3 | 12 | 3,734 | 0 | python,linux,centos | The only time that os.system might be appropriate is for a quick-and-dirty solution for a non-production script or some kind of testing. Otherwise, it is best to use built-in functions. | 0 | 1 | 0 | 0 | 2010-07-26T20:13:00.000 | 7 | 0.085505 | false | 3,338,616 | 1 | 0 | 0 | 6 | Spinning off from another thread, when is it appropriate to use os.system() to issue commands like rm -rf, cd, make, xterm, ls ?
Considering there are analog versions of the above commands (except make and xterm), I'm assuming it's safer to use these built-in python commands instead of using os.system()
Any thoughts? I... |
Python - When Is It Ok to Use os.system() to issue common Linux commands | 3,338,632 | 18 | 12 | 3,734 | 0 | python,linux,centos | Rule of thumb: if there's a built-in Python function to achieve this functionality use this function. Why? It makes your code portable across different systems, more secure and probably faster as there will be no need to spawn an additional process. | 0 | 1 | 0 | 0 | 2010-07-26T20:13:00.000 | 7 | 1.2 | true | 3,338,616 | 1 | 0 | 0 | 6 | Spinning off from another thread, when is it appropriate to use os.system() to issue commands like rm -rf, cd, make, xterm, ls ?
Considering there are analog versions of the above commands (except make and xterm), I'm assuming it's safer to use these built-in python commands instead of using os.system()
Any thoughts? I... |
Python - When Is It Ok to Use os.system() to issue common Linux commands | 3,338,678 | 4 | 12 | 3,734 | 0 | python,linux,centos | Darin's answer is a good start.
Beyond that, it's a matter of how portable you plan to be. If your program is only ever going to run on a reasonably "standard" and "modern" Linux then there's no reason for you to re-invent the wheel; if you tried to re-write make or xterm they'd be sending the men in the white coats fo... | 0 | 1 | 0 | 0 | 2010-07-26T20:13:00.000 | 7 | 0.113791 | false | 3,338,616 | 1 | 0 | 0 | 6 | Spinning off from another thread, when is it appropriate to use os.system() to issue commands like rm -rf, cd, make, xterm, ls ?
Considering there are analog versions of the above commands (except make and xterm), I'm assuming it's safer to use these built-in python commands instead of using os.system()
Any thoughts? I... |
Python - When Is It Ok to Use os.system() to issue common Linux commands | 3,339,586 | 3 | 12 | 3,734 | 0 | python,linux,centos | Your question seems to have two parts. You mention calling commands like "xterm", "rm -rf", and "cd".
Side Note: you cannot call 'cd' in a sub-shell. I bet that was a trick question ...
As far as other command-level things you might want to do, like "rm -rf SOMETHING", there is already a python equivalent. This answers... | 0 | 1 | 0 | 0 | 2010-07-26T20:13:00.000 | 7 | 0.085505 | false | 3,338,616 | 1 | 0 | 0 | 6 | Spinning off from another thread, when is it appropriate to use os.system() to issue commands like rm -rf, cd, make, xterm, ls ?
Considering there are analog versions of the above commands (except make and xterm), I'm assuming it's safer to use these built-in python commands instead of using os.system()
Any thoughts? I... |
Python - When Is It Ok to Use os.system() to issue common Linux commands | 3,338,709 | 2 | 12 | 3,734 | 0 | python,linux,centos | I would suggest that you only use use os.system for things that there are not already equivalents for within the os module. Why make your life harder? | 0 | 1 | 0 | 0 | 2010-07-26T20:13:00.000 | 7 | 0.057081 | false | 3,338,616 | 1 | 0 | 0 | 6 | Spinning off from another thread, when is it appropriate to use os.system() to issue commands like rm -rf, cd, make, xterm, ls ?
Considering there are analog versions of the above commands (except make and xterm), I'm assuming it's safer to use these built-in python commands instead of using os.system()
Any thoughts? I... |
python receiving from a socket | 8,259,497 | 0 | 0 | 2,058 | 0 | java,python,android,sockets | The Android code is reading lines, so you need probably to send a \n or possibly \r\n at the end of your Python send string. | 0 | 1 | 1 | 0 | 2010-07-27T00:39:00.000 | 4 | 0 | false | 3,339,971 | 0 | 0 | 0 | 1 | So I have a simple socket server on an android emulator. When I'm only sending data to it, it works just fine. But then if I want to echo that data back to the python script, it doesn't work at all. Here's the code that works:
android:
try {
serverSocket = new ServerSocket(port);
} catch ... |
Starting a GUI process from a Python Windows Service | 3,343,894 | 3 | 0 | 1,456 | 0 | python,user-interface,windows-services | If you give your Service the Allow service to interact with desktop permission it will be able to create windows without the need to launch a subprocess. | 0 | 1 | 0 | 0 | 2010-07-27T12:54:00.000 | 2 | 1.2 | true | 3,343,793 | 1 | 0 | 0 | 1 | I am creating Windows service class in Python that will eventually display a Window when certain conditions are met. Since (as I understand it) services cannot have GUIs, I'm trying to start up a GUI in a seperate process (using subprocess.Popen) when the conditions are right. This isn't working, presumably because the... |
On the google app engine, why do updates not reflect in a transaction? | 3,350,082 | 0 | 2 | 215 | 1 | python,google-app-engine | Looks like you are not doing a commit on the transaction before querying
start a db transaction
update entityX by setting entityX.flag = True
save entityX
COMMIT TRANSACTION
query for entity where flag == True. BUT, here is the problem. This query does NOT return any results. It should have returned entityX, but it d... | 0 | 1 | 0 | 0 | 2010-07-28T05:06:00.000 | 2 | 0 | false | 3,350,068 | 0 | 0 | 1 | 1 | I store groups of entities in the google app engine Data Store with the same ancestor/parent/entityGroup. This is so that the entities can be updated in one atomic datastore transaction.
The problem is as follows:
I start a db transaction
I update entityX by setting entityX.flag = True
I save entityX
I query for entit... |
Fastest way to produce UDP packets | 3,350,509 | 1 | 1 | 371 | 0 | python,twisted,stackless | Multiple NICs, the hardware or the kernel interface is the limit. I can only reach 69,000 packets per second with a Broadcom Corporation NetXtreme BCM5704S Gigabit Ethernet adapter. Try a quad Intel Gigabit Server Adapter with all four NICs on the same subnet. | 0 | 1 | 0 | 0 | 2010-07-28T06:02:00.000 | 2 | 0.099668 | false | 3,350,282 | 0 | 0 | 0 | 2 | We're building a test harness to push binary messages out on a UDP multicast.
The prototype is using the Twisted reactor loop to push out messages, which is achieving just about the level of traffic we require - about 120000 messages per second.
We have a 16 cores on our test machine, and obviously I'd like to spread t... |
Fastest way to produce UDP packets | 3,352,556 | 1 | 1 | 371 | 0 | python,twisted,stackless | The obvious answer when the question of exploiting multiple cores in a Python application comes up is to use multiple processes. With Twisted, you can use reactor.spawnProcess to launch a child process. You could also just start 16 instances of your application some other way (like a shell script). This requires tha... | 0 | 1 | 0 | 0 | 2010-07-28T06:02:00.000 | 2 | 0.099668 | false | 3,350,282 | 0 | 0 | 0 | 2 | We're building a test harness to push binary messages out on a UDP multicast.
The prototype is using the Twisted reactor loop to push out messages, which is achieving just about the level of traffic we require - about 120000 messages per second.
We have a 16 cores on our test machine, and obviously I'd like to spread t... |
How do I delay a task using Celery? | 3,358,271 | 1 | 7 | 4,358 | 0 | python,django,celery | You should store some 'pause' value outside of celery/task queue. I do this with a mailer using celery. I can pause parts of the system by setting values in either memcache or mysql. The tasks then make sure to query the outside resource before executing the task. If it's meant to be paused it sets it does a task.retry... | 0 | 1 | 0 | 0 | 2010-07-28T21:03:00.000 | 2 | 0.099668 | false | 3,357,472 | 0 | 0 | 0 | 1 | Not talking about the delay method.
I want to be able to get a task, given it's task_id and change it's ETA on the fly, before it is executed.
For now I have to cancel it, and re-schedule one. Troublesome if the scheduled process involve a lot of stuff. |
How do I choose a task_id using celery? | 3,379,809 | 4 | 4 | 604 | 0 | python,django,celery | You can certainly use "natural ids", but then to be really useful they would have to
be reverseable, which doesn't work if you add that timestamp. Also the ids are unique, so two tasks can't have the same id (the behavior then is undefined)
If you have a task to refresh the timeline of a twitter user, then you know tha... | 0 | 1 | 0 | 0 | 2010-07-28T21:06:00.000 | 1 | 1.2 | true | 3,357,489 | 0 | 0 | 1 | 1 | For now I get a task_id from the async_result and have to save it the get it back later.
Would be better if I knew what the task_id what made of so I can calculate it back instead of pulling from the DB. E.G: set a task with task_id=("%s-%s" % (user_id, datetime)). |
win32api vs Python | 3,358,136 | 4 | 1 | 390 | 0 | python,winapi,io | The most obvious thing seems to be losing cross-platform compatibilty. Python runs on a number of different platforms, none of which has a win32 API except MS Windows. | 0 | 1 | 0 | 1 | 2010-07-28T22:42:00.000 | 2 | 0.379949 | false | 3,358,126 | 0 | 0 | 0 | 2 | What are the Pro's and Con's of using win32api for I/O and other things instead of simply Python, if both have a specific function for it
I mean, using PyWin32 vs Win32Api |
win32api vs Python | 3,358,143 | 5 | 1 | 390 | 0 | python,winapi,io | con
(lack of) portability
harder/more error prone
pro
performance (potentially, it must be measured, as will depend on more than just the api calls) | 0 | 1 | 0 | 1 | 2010-07-28T22:42:00.000 | 2 | 1.2 | true | 3,358,126 | 0 | 0 | 0 | 2 | What are the Pro's and Con's of using win32api for I/O and other things instead of simply Python, if both have a specific function for it
I mean, using PyWin32 vs Win32Api |
communication between python programs | 3,363,869 | 1 | 5 | 4,184 | 0 | python,process | The daemon could have an open (network) socket, where it accepts commands.
It could monitor changes in a file.
Any other kind of signalling is possible, but these would probably be the most common. | 0 | 1 | 0 | 0 | 2010-07-29T14:55:00.000 | 4 | 0.049958 | false | 3,363,831 | 0 | 0 | 0 | 1 | I have a python program that is running as a daemon on Linux.
How to send this daemon a signal from another python program? |
How do I setup python to always include my directory of utility files | 3,368,490 | 0 | 1 | 147 | 0 | python | If it's not in site-packages then you can add a file with the extension .pth to your site-packages directory.
The file should have one path per line, that you want included in sys.path | 0 | 1 | 0 | 0 | 2010-07-30T03:02:00.000 | 3 | 0 | false | 3,368,459 | 1 | 0 | 0 | 1 | I have been programming in Python for a while now, and have created some utilities that I use a lot. Whenever I start a new project, I start writing, and as I need these utilities I copy them from where ever I think the latest version of the particular utility is. I have enough projects now that I am losing track of ... |
Running a .py file on LAMP (CentOS) server - from a PHP developer's perspective | 3,369,157 | 1 | 0 | 5,711 | 0 | python,centos | you can use cgi, but that will not have great performance as it starts a new process for each request.
More efficient alternatives are to use fastcgi or wsgi
A third option is to run a mini Python webserver and proxy the requests from apache using rewrite rules | 0 | 1 | 0 | 1 | 2010-07-30T06:17:00.000 | 3 | 0.066568 | false | 3,369,080 | 0 | 0 | 0 | 1 | I'm a LAMP developer trying out Python for the first time.. I'm okay with picking up the syntax, but I can't figure out how to run it on the server! I've tried the following
uploading filename.py to a regular web/public directory. chmod 777, 711, 733, 773... (variations of execute)
putting the filename.py in cgi-bin, ... |
Need to restart python in Terminal every time a change is made to script | 3,374,587 | 1 | 10 | 16,071 | 0 | python | Do you mean that you enter script directly into the interactive python shall, or are you executing your .py file from the terminal by running something like python myscript.py? | 0 | 1 | 0 | 0 | 2010-07-30T18:59:00.000 | 5 | 0.039979 | false | 3,374,542 | 1 | 0 | 0 | 1 | Every time I make a change to a python script I have to reload python and re-import the module. Please advise how I can modify my scripts and run then without having to relaunch python in the terminal.
Thanks. |
A scalable solution for server side push? | 3,378,244 | 2 | 3 | 651 | 0 | php,python,linux,server-push,publish-subscribe | If you know in advance you'll have a lot of subscribers (people/applications) that want notifications on a certain subject while on other hand you'll have few different subjects consider a pull technology anyway.
RSS, Atom are quite successful even though they use pull. The reason: no need to have an administration on ... | 0 | 1 | 0 | 0 | 2010-07-31T11:50:00.000 | 3 | 0.132549 | false | 3,377,951 | 0 | 0 | 1 | 1 | I would like to implement a mechanism which will provide a RESTful API that allows a client to register interest in a subject with a sever, and receive asynchronous notifications from the server after the interest is registered. In enterprise (messaging) architecture, this is known as publish/subscribe 'pattern'.
With ... |
Deploying python app to Mac and Windows users | 3,379,058 | 0 | 2 | 523 | 0 | python,deployment | How do people usually deploy such apps?
2 choices.
With instructions.
All bundled up.
You write simple instructions like this. Folks can follow these pretty reliably, unless they don't have enough privileges. Sometimes they need to sudo in linux environments.
Download easy_install (or pip)
easy_install this, easy... | 0 | 1 | 0 | 0 | 2010-07-31T17:03:00.000 | 2 | 0 | false | 3,379,032 | 0 | 0 | 0 | 1 | I've written an app in python that depends on wxPython and some other python libraries. I know about pyexe for making python scripts executable on Windows, but what would be the easiest way to share this with my Mac using friends who wouldn't know how to install the required dependencies? One option would be to bundle ... |
logout from command prompt to uploading application on google app | 3,388,313 | 3 | 1 | 556 | 0 | python,google-app-engine,command-prompt | You can run appcfg.py with --no_cookies to tell it not to store authentication cookies, or -e EMAIL to specify an email address that differs from the one in the current cookie. | 0 | 1 | 0 | 0 | 2010-08-02T12:15:00.000 | 1 | 0.53705 | false | 3,387,605 | 0 | 0 | 1 | 1 | I am uploading google app engine application with the help of appcfg.py command from command prompt in windows.
But after one login I want to upload another application from the same command prompt but i cannot because this second application has no rights with the current login so i want to logout from this session o... |
Installing setuptools in a private version of python | 13,340,272 | 0 | 7 | 12,097 | 0 | python | I had the same error due to the fact that Python2.7 was not on the path used by sudo.
I just added:
alias sudo='sudo env PATH=$PATH'
before running the installer. | 0 | 1 | 0 | 0 | 2010-08-02T18:15:00.000 | 5 | 0 | false | 3,390,558 | 1 | 0 | 0 | 1 | A newbie question but.....
I've installed python2.7 on a host where the system version is 2.3 (2.7 at ~/python2.7/bin/python). I'd like to add a few packages such as MySQLdb but need setuptools.
The directions say that you can use --prefix as an argument. However, if I do the following:
sh setuptools-0.6c11-py2.7.egg ... |
if I run a .py script, can I open a new terminal, modify the file and run it also? | 3,391,956 | 2 | 2 | 146 | 0 | python | Yes you can. Is this a hard thing to test yourself? | 0 | 1 | 0 | 0 | 2010-08-02T21:28:00.000 | 2 | 0.197375 | false | 3,391,920 | 1 | 0 | 0 | 1 | if I run a .py script, can I open a new terminal, modify the file and run it also?
i.e. does the file that I run get loaded in memory, such that I can modify the file and run it at the same time in a different terminal? |
Linux kernel that runs python file for init | 3,392,306 | 2 | 3 | 1,752 | 0 | linux,kernel,init,python | I don't think init needs to be a C binary; it can be a script with a #! at the beginning; if that is the case, then you can have it be a python program with little effort.
Having said that, it is pretty trivial to write an inittab where init just runs a single program once (Although it's usually more useful to do other... | 0 | 1 | 0 | 0 | 2010-08-02T22:10:00.000 | 2 | 0.197375 | false | 3,392,203 | 1 | 0 | 0 | 1 | Would it be possible and not incredibly difficult to build a linux kernel, with a python interpreter built in or accessible from the kernel, that could run a python file as it's init process? |
Disconnecting from host with Python Fabric when using the API | 5,531,404 | 4 | 6 | 4,881 | 0 | python,fabric | If you don't want to have to iterate through all open connections, fabric.network.disconnect_all() is what you're looking for. The docstring reads
"""
Disconnect from all currently connected servers.
Used at the end of fab's main loop, and also intended for use by library users.
""" | 0 | 1 | 0 | 0 | 2010-08-02T22:34:00.000 | 4 | 1.2 | true | 3,392,333 | 0 | 0 | 0 | 1 | The website says:
Closing connections: Fabric’s
connection cache never closes
connections itself – it leaves this up
to whatever is using it. The fab tool
does this bookkeeping for you: it
iterates over all open connections and
closes them just before it exits
(regardless of whether the tasks
failed or... |
Python Fuse calling 'readlink' 6 times in a row | 7,897,314 | 1 | 3 | 510 | 0 | python,linux,fuse | Did you set st_size properly in getattr? ls will first try with a buffer size of the returned st_size and double it until the the readlink buffer fits. | 0 | 1 | 0 | 0 | 2010-08-03T12:38:00.000 | 2 | 0.099668 | false | 3,396,503 | 0 | 0 | 0 | 1 | I am implementing a filesystem using Python Fuse. A directory contains only symlinks and as such I return S_IFLNK | 0777 on the getattr method.
Now, when I do an ls on the directory, I notice that Linux calls readlink method 6 times in a row for each entry in the directory.
Is it a bug on my side or a normal behavior? |
Calling a python script from command line without typing "python" first | 3,400,402 | 5 | 12 | 14,699 | 0 | python,linux,shell,command-line | You want a shebang. #!/path/to/python. Put that on the first line of your python script. The #! is actually a magic number that tells the operating system to interpret the file as a script for the program named. You can supply /usr/bin/python or, to be more portable, /usr/bin/env python which calls the /usr/bin/env pro... | 0 | 1 | 0 | 0 | 2010-08-03T20:08:00.000 | 6 | 0.16514 | false | 3,400,381 | 0 | 0 | 0 | 2 | Question: In command line, how do I call a python script without having to type python in front of the script's name? Is this even possible?
Info:
I wrote a handy script for accessing sqlite databases from command line, but I kind of don't like having to type "python SQLsap args" and would rather just type "SQLsap arg... |
Calling a python script from command line without typing "python" first | 3,400,404 | 4 | 12 | 14,699 | 0 | python,linux,shell,command-line | Assuming this is on a unix system, you can add a "shebang" on the top of the file like this:
#!/usr/bin/env python
And then set the executable flag like this:
chmod +x SQLsap | 0 | 1 | 0 | 0 | 2010-08-03T20:08:00.000 | 6 | 0.132549 | false | 3,400,381 | 0 | 0 | 0 | 2 | Question: In command line, how do I call a python script without having to type python in front of the script's name? Is this even possible?
Info:
I wrote a handy script for accessing sqlite databases from command line, but I kind of don't like having to type "python SQLsap args" and would rather just type "SQLsap arg... |
How do you get Intellisense for Python in Eclipse/Aptana/Pydev? | 3,409,335 | 2 | 0 | 3,548 | 0 | python,eclipse,intellisense,pydev | I'm using eclipse 3.6 and pydev with python 2.6 and it's the best one I've tested up to now. I didn't try 3.5 so not sure if it's the same as yours but I think it autocompletes well compared to others I tried but I didn't try any of the paid ones. | 0 | 1 | 0 | 1 | 2010-08-04T19:41:00.000 | 3 | 0.132549 | false | 3,409,226 | 0 | 0 | 0 | 3 | Does anyone know how to get an intellisense like functionality (better than default) in eclipse for python development? I am using Eclipse 3.5 with aptana and pydev and the interpreter is python 2.5.2 |
How do you get Intellisense for Python in Eclipse/Aptana/Pydev? | 3,409,439 | 3 | 0 | 3,548 | 0 | python,eclipse,intellisense,pydev | You are probably never going to get something as good as intellisense for python. Due to the dynamic nature of python, it is often impossible to be able to know the type of some variables.
And if you don't know their types, you can't do auto-complete on things like class members.
Personally, I think the auto-complete ... | 0 | 1 | 0 | 1 | 2010-08-04T19:41:00.000 | 3 | 0.197375 | false | 3,409,226 | 0 | 0 | 0 | 3 | Does anyone know how to get an intellisense like functionality (better than default) in eclipse for python development? I am using Eclipse 3.5 with aptana and pydev and the interpreter is python 2.5.2 |
How do you get Intellisense for Python in Eclipse/Aptana/Pydev? | 9,141,159 | 0 | 0 | 3,548 | 0 | python,eclipse,intellisense,pydev | In Aptana I added the reference to the .egg file to the system PYTHONPATH in Preferences menu. I am not sure if this works for every library out there.
Preferences --> PyDev --> Interpreter Python --> Libraries tab on the right. | 0 | 1 | 0 | 1 | 2010-08-04T19:41:00.000 | 3 | 0 | false | 3,409,226 | 0 | 0 | 0 | 3 | Does anyone know how to get an intellisense like functionality (better than default) in eclipse for python development? I am using Eclipse 3.5 with aptana and pydev and the interpreter is python 2.5.2 |
Appengine Blobstore - Video Streaming | 3,409,743 | 5 | 6 | 1,334 | 0 | python,google-app-engine | I would say the blobstore is suitable for this. While datastore entities are limited to 1MB and standard HTTP responses are limited to 10MB, with the blobstore you can upload, store, and serve files up to 2GB. The 30 second limit refers to how long your handler can execute; time spent downloading (or uploading) doesn't... | 0 | 1 | 0 | 0 | 2010-08-04T20:27:00.000 | 1 | 0.761594 | false | 3,409,549 | 0 | 0 | 1 | 1 | I'm trying to setup a video streaming app via the Google Appengine Blobstore. Just wanted to know if this was possible, as there isn't too much regarding this in the Appengine Documentation. Basically I want to serve these videos through a flash player.
Thanks |
py-appscript is starting a new Finder instance | 3,426,504 | 1 | 0 | 266 | 0 | python,applescript | Seeing as how py-appscript is a layer between python and the application you are scripting via Applescript, I would suggest porting the statement to pure Applescript and see if it works there. There are a lot of things that can go wrong with Applescript (and your statement alone) to begin with and it's not obvious what... | 0 | 1 | 0 | 0 | 2010-08-06T16:12:00.000 | 1 | 1.2 | true | 3,425,643 | 1 | 0 | 0 | 1 | i have a py2app application, which runs an appscript using py-appscript. the Applescript code is this one line:
app('Finder').update(<file alias of a certain file>)
What this normally does is update a file's preview in Finder. It works most of the time, except for Leopard. In Leopard, everytime that script is executed,... |
What language (Java or Python) + framework for mid sized web project? | 3,428,411 | 2 | 2 | 492 | 0 | java,python,google-app-engine,web-applications,stripes | As many things in life, this depends on what your goals are. If you intend to learn a web framework that is used in corporate environments, then choose a Java solution. If not, don't. Python is certainly more elegant and generally more fun in pretty much every way.
As to which framework to use, django has the most mind... | 0 | 1 | 0 | 0 | 2010-08-06T21:31:00.000 | 9 | 0.044415 | false | 3,427,946 | 0 | 0 | 1 | 5 | I plan to start a mid sized web project, what language + framework would you recommend?
I know Java and Python. I am looking for something simple.
Is App Engine a good option? I like the overall simplicity and free hosting, but I am worried about the datastore (how difficult is it to make it similarly fast as a standar... |
What language (Java or Python) + framework for mid sized web project? | 3,428,479 | 0 | 2 | 492 | 0 | java,python,google-app-engine,web-applications,stripes | It depends on your personality. There's no right answer to this question any more than there's a right answer to "what kind of car should I drive?"
If you're artistic and believe code should be beautiful, use Rails.
If you're a real hacker type, I think you'll find a full-stack framework such as Rails or Django to be u... | 0 | 1 | 0 | 0 | 2010-08-06T21:31:00.000 | 9 | 0 | false | 3,427,946 | 0 | 0 | 1 | 5 | I plan to start a mid sized web project, what language + framework would you recommend?
I know Java and Python. I am looking for something simple.
Is App Engine a good option? I like the overall simplicity and free hosting, but I am worried about the datastore (how difficult is it to make it similarly fast as a standar... |
What language (Java or Python) + framework for mid sized web project? | 3,428,497 | 0 | 2 | 492 | 0 | java,python,google-app-engine,web-applications,stripes | Google App Engine + GWT and you have a pretty powerful combination for developing web applications. The datastore is quite fast, and it has so far done the job quite nicely for me.
In my project I had to do a lot of redesigning of my database model, because it was made for a traditional relational database, and some t... | 0 | 1 | 0 | 0 | 2010-08-06T21:31:00.000 | 9 | 0 | false | 3,427,946 | 0 | 0 | 1 | 5 | I plan to start a mid sized web project, what language + framework would you recommend?
I know Java and Python. I am looking for something simple.
Is App Engine a good option? I like the overall simplicity and free hosting, but I am worried about the datastore (how difficult is it to make it similarly fast as a standar... |
What language (Java or Python) + framework for mid sized web project? | 3,428,141 | 0 | 2 | 492 | 0 | java,python,google-app-engine,web-applications,stripes | I don't think the datastore is a problem. Many people will reject it out of hand because they want a standard relational database; if you are willing to consider a datastore in general then I doubt you will have any problems with the GAE datastore. Personally, I quite like it.
The thing that might trip you up is the ... | 0 | 1 | 0 | 0 | 2010-08-06T21:31:00.000 | 9 | 0 | false | 3,427,946 | 0 | 0 | 1 | 5 | I plan to start a mid sized web project, what language + framework would you recommend?
I know Java and Python. I am looking for something simple.
Is App Engine a good option? I like the overall simplicity and free hosting, but I am worried about the datastore (how difficult is it to make it similarly fast as a standar... |
What language (Java or Python) + framework for mid sized web project? | 3,430,891 | 0 | 2 | 492 | 0 | java,python,google-app-engine,web-applications,stripes | I've built several apps on GAE (with Python) over the last year. It's hard to beat the ease with which you can get an app up and running quickly. Don't discount the value in that alone.
While you may not understand the datastore yet, it is extremely well documented and there are great resources - including this one - ... | 0 | 1 | 0 | 0 | 2010-08-06T21:31:00.000 | 9 | 0 | false | 3,427,946 | 0 | 0 | 1 | 5 | I plan to start a mid sized web project, what language + framework would you recommend?
I know Java and Python. I am looking for something simple.
Is App Engine a good option? I like the overall simplicity and free hosting, but I am worried about the datastore (how difficult is it to make it similarly fast as a standar... |
Get big TAR(gz)-file contents by dir levels | 3,431,918 | 1 | 0 | 247 | 0 | python,tar | You can't scan the contents of a tar without scanning the entire file; it has no central index. You need something like a ZIP. | 0 | 1 | 0 | 0 | 2010-08-07T19:55:00.000 | 1 | 1.2 | true | 3,431,844 | 1 | 0 | 0 | 1 | I use python tarfile module.
I have a system backup in tar.gz file.
I need to get first level dirs and files list without getting ALL the list of files in the archive because it's TOO LONG.
For example: I need to get ['bin/', 'etc/', ... 'var/'] and that's all.
How can I do it? May be not even with a tar-file? Then how... |
IPython workflow (edit, run) | 11,456,303 | 5 | 51 | 33,816 | 0 | python,user-interface,ipython,python-idle | Try Spyder, I have spent all day trying to find an IDE which has the functionality of ipython and Spyder just kicks it out of the park..
Autocomplete is top notch right from install, no config files and all that crap, and it has an Ipython terminal in the corner for you to instantly run your code.
big thumbs up | 0 | 1 | 0 | 0 | 2010-08-09T08:50:00.000 | 14 | 0.071307 | false | 3,438,531 | 1 | 0 | 0 | 1 | Is there a GUI for IPython that allows me to open/run/edit Python files? My way of working in IDLE is to have two windows open: the shell and a .py file. I edit the .py file, run it, and interact with the results in the shell.
Is it possible to use IPython like this? Or is there an alternative way of working? |
Tasks queue process in python | 3,439,041 | 1 | 0 | 883 | 0 | python,queue,task | This is a bit of a vague question. One thing you should remember is that it is very difficult to leak memory in Python, because of the automatic garbage collection. croning a Python script to handle the queue isn't very nice, although it would work fine.
I would use method 1; if you need more power you could make a sma... | 0 | 1 | 0 | 0 | 2010-08-09T10:14:00.000 | 3 | 0.066568 | false | 3,439,020 | 0 | 0 | 0 | 1 | Task is:
I have task queue stored in db. It grows. I need to solve tasks by python script when I have resources for it. I see two ways:
python script working all the time. But i don't like it (reason posible memory leak).
python script called by cron and do a little part of task. But i need to solve the problem of one... |
How to strip source from distutils binary distributions? | 39,629,278 | 0 | 8 | 2,952 | 0 | python,bytecode,distutils | "the standard commands don't have such an option"?
Do you have the latest version of setuptools installed? And did you write a setup.py file?
If so, this should work: python setup.py bdist_egg --exclude-source-files. | 0 | 1 | 0 | 0 | 2010-08-09T12:35:00.000 | 4 | 0 | false | 3,440,016 | 0 | 0 | 0 | 1 | I want to create a bytecode-only distribution from distutils (no really, I do; I know what I'm doing). Using setuptools and the bdist_egg command, you can simply provide the --exclude-source parameter. Unfortunately the standard commands don't have such an option.
Is there an easy way to strip the source files just be... |
Calling a Python module from Perl | 3,446,205 | 9 | 9 | 9,275 | 0 | python,perl,interop | In the short run the easiest solution is to use Inline::Python. Closely followed by calling a command-line script.
In the long run, using a server to provide RPC functionality or simply calling a command-line script will give you the most future proof solution.
Why?
Becuase that way you aren't tied to Perl or Python a... | 0 | 1 | 0 | 1 | 2010-08-09T15:50:00.000 | 3 | 1 | false | 3,441,766 | 0 | 0 | 0 | 2 | I created a module in Python which provides about a dozen functionalities. While it will be mostly used from within Python, there is a good fraction of legacy users which will be calling it from Perl.
What is the best way to make a plug in to this module? My thoughts are:
Provide the functionalities as command line ut... |
Calling a Python module from Perl | 3,441,920 | 3 | 9 | 9,275 | 0 | python,perl,interop | Provide the functionalities as command line utilities and make system calls
Works really nicely. This is the way programs like Python (and Perl) are meant to use used. | 0 | 1 | 0 | 1 | 2010-08-09T15:50:00.000 | 3 | 0.197375 | false | 3,441,766 | 0 | 0 | 0 | 2 | I created a module in Python which provides about a dozen functionalities. While it will be mostly used from within Python, there is a good fraction of legacy users which will be calling it from Perl.
What is the best way to make a plug in to this module? My thoughts are:
Provide the functionalities as command line ut... |
How can I tell where my python script is hanging? | 3,443,835 | 24 | 80 | 82,971 | 0 | python,debugging | Wow! 5 answers already and nobody has suggested the most obvious and simple:
Try to find a reproducible test case that causes the hanging behavior.
Add logging to your code. This can be as basic as print "**010", print "**020", etc. peppered through major areas.
Run code. See where it hangs. Can't understand why? ... | 0 | 1 | 0 | 0 | 2010-08-09T19:46:00.000 | 14 | 1 | false | 3,443,607 | 1 | 0 | 0 | 2 | So I'm debugging my python program and have encountered a bug that makes the program hang, as if in an infinite loop. Now, I had a problem with an infinite loop before, but when it hung up I could kill the program and python spat out a helpful exception that told me where the program terminated when I sent it the kill ... |
How can I tell where my python script is hanging? | 3,443,669 | 2 | 80 | 82,971 | 0 | python,debugging | It's easier to prevent these hang-ups than it is to debug them.
First: for loops are very, very hard to get stuck in a situation where the loop won't terminate. Very hard.
Second: while loops are relatively easy to get stuck in a loop.
The first pass is to check every while loop to see if it must be a while loop. O... | 0 | 1 | 0 | 0 | 2010-08-09T19:46:00.000 | 14 | 0.028564 | false | 3,443,607 | 1 | 0 | 0 | 2 | So I'm debugging my python program and have encountered a bug that makes the program hang, as if in an infinite loop. Now, I had a problem with an infinite loop before, but when it hung up I could kill the program and python spat out a helpful exception that told me where the program terminated when I sent it the kill ... |
As a software developer what is your SNMP suite that easy to integrate into your software | 3,447,496 | 0 | 3 | 597 | 0 | c++,python,c,linux,snmp | I am still searching for that easy to use suite of SNMP tools/API myself.
I build OA&M and I've tried NET-SNMP, Windows SNMP and lately agentpp (www.agentpp.com).
Personally, I preferred the agentpp.
Good luck to you. | 0 | 1 | 0 | 0 | 2010-08-10T04:41:00.000 | 4 | 0 | false | 3,446,087 | 0 | 0 | 0 | 2 | Well, altough the S of the SNMP stands for Simple, yet, so far I haven't experienced it that way. And now that I am about to deploy my software on around around 180 remote Linux servers and wants to monitor the servers and configure my daemons all from a centralized point.
I simply want you to recommend me the library ... |
As a software developer what is your SNMP suite that easy to integrate into your software | 3,918,718 | 0 | 3 | 597 | 0 | c++,python,c,linux,snmp | The "S" in SNMP is actually for "simple" not because using it is simple, but rather because the protocol (on the wire) is designed to be simple and easy to implement. And it is. Now... actually implementing it and then using it is where the S completely drops away. | 0 | 1 | 0 | 0 | 2010-08-10T04:41:00.000 | 4 | 0 | false | 3,446,087 | 0 | 0 | 0 | 2 | Well, altough the S of the SNMP stands for Simple, yet, so far I haven't experienced it that way. And now that I am about to deploy my software on around around 180 remote Linux servers and wants to monitor the servers and configure my daemons all from a centralized point.
I simply want you to recommend me the library ... |
Can Cherokee serve a fallback/default page when a reverse proxy is unavailable? | 3,452,793 | 0 | 0 | 218 | 0 | python,web-services,reverse-proxy,cherokee | You could set a custom 504 error page. | 0 | 1 | 0 | 0 | 2010-08-10T13:54:00.000 | 1 | 1.2 | true | 3,449,673 | 0 | 0 | 1 | 1 | I have a Cherokee installation that I'm using to serve a few web applications - one blog/calendar/etc. and two CPU-intensive web applications (1 stable version and 1 development version). All of them are Django or Pylons webservices served with CherryPy. I'm using the reverse-proxy handler in Cherokee to handle the ma... |
Viewing Contents Of a DLL File | 3,454,709 | 0 | 4 | 3,117 | 0 | c#,python,c,dll,import | I've done some work with ctypes, and loading dlls in windows, but I don't think DLL have any sort of introspection. This really isn't a big deal, because all of the function calls in DLLs are static. If your trying to use a undocumented DLL, you would not only need to know the names of the functions, but also the par... | 0 | 1 | 0 | 1 | 2010-08-11T01:17:00.000 | 4 | 0 | false | 3,454,647 | 0 | 0 | 0 | 1 | is this possible to view contents and Functions of a DLL file...
few times ago i was playing with OlyDBG then i found there is option for viewing contents of dll...
so suggest me any good tool or soft for this...
and suppose i have a DLL named "Python27.dll"...
now i need to view the content of this DLL so what do i... |
How to depends of a system command with python/distutils? | 3,466,094 | 4 | 3 | 629 | 0 | python,command,packaging,distutils | I wouldn't have any check at all. Document that your library requires this command, and if the user tries to use whatever part of your library needs it, an exception will be raised by whatever runs the command. It should still be possible to import your library and use it, even if only a subset of functionality is offe... | 0 | 1 | 0 | 1 | 2010-08-12T06:41:00.000 | 2 | 1.2 | true | 3,465,295 | 0 | 0 | 0 | 1 | I'm looking for the most elegant way to notify users of my library that they need a specific unix command to ensure that it will works...
When is the bet time for my lib to raise an error:
Installation ?
When my app call the command ?
At the import of my lib ?
both?
And also how should you detect that the command is ... |
What are the differences between the two Python 2.7 Mac OS X disk image installers? | 3,472,387 | 0 | 3 | 2,127 | 0 | python,installation,diskimage | Looks like all the other versions only have a 32 bit port? So a "new feature" of 2.7 is a 64 bit port. If you aren't running a 64 bit OS and don't need programs that can use > 4 GB of ram, you can stick with the 32 bit. | 0 | 1 | 0 | 0 | 2010-08-12T21:52:00.000 | 4 | 0 | false | 3,472,349 | 1 | 0 | 0 | 3 | Python 2.7 has two different disk image installers for Mac OS X. My questions are:
What are the differences between the two Python 2.7 disk image installers?
Python 2.7 32-bit Mac OS X Installer Disk Image for Mac OS X 10.3 through 10.6
Python 2.7 PPC/i386/x86-64 Mac OS X Installer Disk Image for Mac OS X 10.5 or la... |
What are the differences between the two Python 2.7 Mac OS X disk image installers? | 3,472,470 | 0 | 3 | 2,127 | 0 | python,installation,diskimage | 1) You almost certainly want "Python 2.7 PPC/i386/x86-64 Mac OS X Installer Disk Image". It's also a close analogue of the 2.6.x version that comes with 10.6 by default.
2) Unless you know you need 32-bit versions for some reason, default to 64-bit for everything on Snow Leopard. It's what will most closely match the r... | 0 | 1 | 0 | 0 | 2010-08-12T21:52:00.000 | 4 | 0 | false | 3,472,349 | 1 | 0 | 0 | 3 | Python 2.7 has two different disk image installers for Mac OS X. My questions are:
What are the differences between the two Python 2.7 disk image installers?
Python 2.7 32-bit Mac OS X Installer Disk Image for Mac OS X 10.3 through 10.6
Python 2.7 PPC/i386/x86-64 Mac OS X Installer Disk Image for Mac OS X 10.5 or la... |
What are the differences between the two Python 2.7 Mac OS X disk image installers? | 3,472,625 | 3 | 3 | 2,127 | 0 | python,installation,diskimage | As others have pointed out, the second (64-bit) installer variant is new on python.org starting with 2.7 and future releases of 2.7 and 3.2 will have both 32-bit-only and a 32-/64-bit variants. The newer variant is an attempt to add out-of-the-box support from python.org for Intel 64-bit (x86_64) processes which is th... | 0 | 1 | 0 | 0 | 2010-08-12T21:52:00.000 | 4 | 1.2 | true | 3,472,349 | 1 | 0 | 0 | 3 | Python 2.7 has two different disk image installers for Mac OS X. My questions are:
What are the differences between the two Python 2.7 disk image installers?
Python 2.7 32-bit Mac OS X Installer Disk Image for Mac OS X 10.3 through 10.6
Python 2.7 PPC/i386/x86-64 Mac OS X Installer Disk Image for Mac OS X 10.5 or la... |
Popen gives "File not found" Error (windows/python) | 3,472,949 | 4 | 2 | 4,657 | 0 | python,windows,popen | Instead ofD:\Program Files\Steam\steamapps\terabytest\sourcesdk\bin\orangebox\bin\vbsp.exe, useD:/Program Files/Steam/steamapps/terabytest/sourcesdk/bin/orangebox/bin/vbsp.exe
This eliminates any complications with backslashes inside quotes. | 0 | 1 | 0 | 0 | 2010-08-12T23:40:00.000 | 2 | 1.2 | true | 3,472,862 | 1 | 0 | 0 | 2 | I'm trying to run console commands via subprocess.Popen, and whenever I run it I get the windows "File not found" error, even when running the echo command.
I am also using Popen inside a thread made with the thread module. Is that the problem? |
Popen gives "File not found" Error (windows/python) | 3,472,903 | 3 | 2 | 4,657 | 0 | python,windows,popen | echo is not an executable, it's an internal command inside cmd.exe. If you want to use Popen with internal commands, add a keyword parameter shell=True | 0 | 1 | 0 | 0 | 2010-08-12T23:40:00.000 | 2 | 0.291313 | false | 3,472,862 | 1 | 0 | 0 | 2 | I'm trying to run console commands via subprocess.Popen, and whenever I run it I get the windows "File not found" error, even when running the echo command.
I am also using Popen inside a thread made with the thread module. Is that the problem? |
Is it good style to call bash commands within a Python script using os.system("bash code")? | 3,479,760 | 3 | 8 | 3,091 | 0 | python,security,bash,scripting,embedding | It always better and better style to use Python functions to do this kind of stuff. With Python it's not that hard to write a script in an OS-independent way instead of using bash. | 0 | 1 | 0 | 0 | 2010-08-13T18:35:00.000 | 7 | 0.085505 | false | 3,479,728 | 0 | 0 | 0 | 3 | I was wondering whether or not it is considered a good style to call bash commands within a Python script using os.system(). I was also wondering whether or not it is safe to do so as well.
I know how to implement some of the functionality I need in Bash and in Python, but it is much simpler and more intuitive to imple... |
Is it good style to call bash commands within a Python script using os.system("bash code")? | 3,479,763 | 1 | 8 | 3,091 | 0 | python,security,bash,scripting,embedding | It's not idea, since it makes your script a lot less portable. A native python script can run on any unix or windows machine that has the proper python libraries installed. When you add shell commands into the mix, you break that, and suddenly are locked down to a much narrower subset.
Sometimes you don't have a choi... | 0 | 1 | 0 | 0 | 2010-08-13T18:35:00.000 | 7 | 0.028564 | false | 3,479,728 | 0 | 0 | 0 | 3 | I was wondering whether or not it is considered a good style to call bash commands within a Python script using os.system(). I was also wondering whether or not it is safe to do so as well.
I know how to implement some of the functionality I need in Bash and in Python, but it is much simpler and more intuitive to imple... |
Is it good style to call bash commands within a Python script using os.system("bash code")? | 3,479,838 | 1 | 8 | 3,091 | 0 | python,security,bash,scripting,embedding | The quoting issues alone suggest that a pure Python solution is preferable. | 0 | 1 | 0 | 0 | 2010-08-13T18:35:00.000 | 7 | 0.028564 | false | 3,479,728 | 0 | 0 | 0 | 3 | I was wondering whether or not it is considered a good style to call bash commands within a Python script using os.system(). I was also wondering whether or not it is safe to do so as well.
I know how to implement some of the functionality I need in Bash and in Python, but it is much simpler and more intuitive to imple... |
Twisted vs Google App Engine in serving mobile clients | 3,480,585 | 6 | 1 | 617 | 0 | python,google-app-engine,twisted | Certainly. App Engine will scale your application up as the load increases automatically and will be spread over many machines. The web api they have is pretty nice too. You don't have to worry about deferreds either because it scales by bringing more instances up instead of making things asynchronous.
BTW: I have web ... | 0 | 1 | 0 | 0 | 2010-08-13T20:41:00.000 | 1 | 1.2 | true | 3,480,524 | 0 | 0 | 1 | 1 | So far I have been using Twisted to simultaneously serve a lot of mobile clients (Android, iPhone) with their HTTP requests exchanging JSON messages.
For my next project I'd like to try out Google App Engine, but I'm wondering if it is capable of doing the same or if I should rather go with a custom built solution agai... |
Google App Engine - Naked Domain Path Redirect in Python | 3,483,631 | 0 | 4 | 830 | 0 | python,google-app-engine,redirect | You need to use a third-party site to do the redirection to www.*; many registrars offer this service. Godaddy's service (which is even free with domain registration) forwards foo.com/bar to www.foo.com/bar; I can't speak to the capabilities of the others but it seems to me that any one that doesn't behave this way is... | 0 | 1 | 1 | 0 | 2010-08-14T05:27:00.000 | 2 | 0 | false | 3,482,152 | 0 | 0 | 1 | 1 | I'm working on a site, colorurl.com, and I need users to be able to type in colorurl.com/00ff00 (or some variation of that), and see the correct page. However, with the naked domain issue, users who type in colorurl.com/somepath will instead be redirected to www.colorurl.com/.
Is there a way to detect this in python, a... |
Autocompletion in dynamic language IDEs, specifically Python in PyDev | 9,430,038 | 5 | 5 | 3,018 | 0 | python,ide,autocomplete,duck-typing,built-in | Just to keep it up to date so that new readers are not confused about the current state of Pydev - the example you gave now works in Pydev. (btw, one should avoid operating on paths manualy - use os.path.join instead) | 0 | 1 | 0 | 1 | 2010-08-14T08:38:00.000 | 7 | 0.141893 | false | 3,482,622 | 0 | 0 | 0 | 1 | I'm new to Python, with a background in statically typed languages including lots and lots of Java.
I decided on PyDev in eclipse as an IDE after checking features/popularity etc.
I was stunned that auto-complete doesn't seem to work properly for builtins. For example if I try automcomplete on datafile after:
datafile ... |
wxPython -- Bash shell | 3,506,700 | 0 | 0 | 330 | 0 | bash,shell,wxpython | Maybe pyCrust plus the Python debugger? | 0 | 1 | 0 | 0 | 2010-08-15T08:28:00.000 | 2 | 0 | false | 3,486,708 | 0 | 0 | 0 | 1 | Hey I want to create a bash-shell in wxPython, the only thing it should be able to do is run a python file and be able to offer user_input on the fly.
(I know there is a Python Shell, but that is something different)
Can someone help me with this? thanks in advance |
App Engine - Output Response Time | 3,490,013 | 3 | 4 | 165 | 0 | python,performance,google-app-engine | Call start = time.time() as the very first operation in your handling scripts, and, when you're just about done with everything, as the very last thing you output use (a properly formatted version of) time.time() - start.
If you're using templates for your output (e.g., the Django templates that come with app engine --... | 0 | 1 | 0 | 0 | 2010-08-16T01:02:00.000 | 1 | 1.2 | true | 3,489,968 | 0 | 0 | 1 | 1 | Say I wanted to print the response time on my pages like Google do.
How would I go about doing this? |
Remembering to run tests before commit | 3,494,671 | 4 | 6 | 2,165 | 0 | python,unit-testing,build-automation,teamcity | I think it is more of a social problem rather than a deficiency of the automated systems.
Yes, you can improve the systems in place, but they will be no match for someone thinking of the implications of their commit, and testing it before they hit commit. | 0 | 1 | 0 | 1 | 2010-08-16T15:22:00.000 | 5 | 0.158649 | false | 3,494,585 | 0 | 0 | 0 | 2 | We have a decent set of unit tests on our code and those unit tests run in under 2 minutes. We also use TeamCity to do a build and to run tests after each check in. However, we still get issues where a developer "forgets" to run all the tests before a commit resulting in TeamCity failure which if this check in was don... |
Remembering to run tests before commit | 3,494,863 | 7 | 6 | 2,165 | 0 | python,unit-testing,build-automation,teamcity | In one of the teams I was working before we had an agreement that anyone who breaks the tests buys bacon sandwiches for the whole team the next morning. Its extreme, but it works perfectly! | 0 | 1 | 0 | 1 | 2010-08-16T15:22:00.000 | 5 | 1 | false | 3,494,585 | 0 | 0 | 0 | 2 | We have a decent set of unit tests on our code and those unit tests run in under 2 minutes. We also use TeamCity to do a build and to run tests after each check in. However, we still get issues where a developer "forgets" to run all the tests before a commit resulting in TeamCity failure which if this check in was don... |
How do you find the filename that you pass to open()? | 3,498,742 | 2 | 2 | 965 | 0 | python,file | You can specify the path to the file in either a complete way (e.g. 'c:/wher/ever/the.txt'), also known as "absolute" because it's taken exactly as you specify it, or a partial one (e.g., just "the.txt", or "ever/the.txt", or "../ever/the.txt", and so on), also known as "relative" because it's taken relatively to the c... | 0 | 1 | 0 | 0 | 2010-08-17T01:00:00.000 | 2 | 1.2 | true | 3,498,587 | 1 | 0 | 0 | 1 | I'm trying to open a file with Python, but I'm unsure how to find the correct filename to use. |
How can I know if the user is connected to the local machine via ssh in my python script? | 3,508,010 | 0 | 1 | 416 | 0 | python,ssh | Am I correct in assuming you're running your script on some sort of UNIX/Linux system? If so, you can just type "users" on the command-line, and it will show you the currently logged in users.
Also, if you call the "lastlog" command, that will show you all the users on the system and the last time they all logged in t... | 0 | 1 | 0 | 1 | 2010-08-18T00:13:00.000 | 3 | 0 | false | 3,507,980 | 0 | 0 | 0 | 2 | How can I know if the user is connected to the local machine via ssh in my python script? |
How can I know if the user is connected to the local machine via ssh in my python script? | 3,508,136 | 0 | 1 | 416 | 0 | python,ssh | Check any of the SSH variables SSH_CONNECTION, SSH_CLIENT, or SSH_TTY. However, these can be unset by the user.
Check the output of who am i. It will end with the remote system identification in brackets if you are connected remotely. Make sure to handle x-term sessions which will have a colon (:) in the remote sy... | 0 | 1 | 0 | 1 | 2010-08-18T00:13:00.000 | 3 | 0 | false | 3,507,980 | 0 | 0 | 0 | 2 | How can I know if the user is connected to the local machine via ssh in my python script? |
How to completely remove Python from a Windows machine? | 60,318,668 | 26 | 123 | 600,614 | 0 | python,installation,uninstallation | you can delete it manually.
open Command Prompt
cd C:\Users\<you name>\AppData\Local\Microsoft\WindowsApps
del python.exe
del python3.exe
Now the command prompt won't be showing it anymore
where python --> yields nothing, and you are free to install another version from source / anaconda and (after adding its address... | 0 | 1 | 0 | 0 | 2010-08-18T18:59:00.000 | 14 | 1 | false | 3,515,673 | 1 | 0 | 0 | 12 | I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena...
I would like to completely remove Python from my system.
I tried running the 2... |
How to completely remove Python from a Windows machine? | 38,920,189 | 8 | 123 | 600,614 | 0 | python,installation,uninstallation | I had window 7 (64 bit) and Python 2.7.12,
I uninstalled it by clicking the python installer from the "download" directory then I selected remove python then I clicked “ finish”.
I also removed the remaining python associated directory & files from the c: drive and also from “my documents” folder, since I created som... | 0 | 1 | 0 | 0 | 2010-08-18T18:59:00.000 | 14 | 1 | false | 3,515,673 | 1 | 0 | 0 | 12 | I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena...
I would like to completely remove Python from my system.
I tried running the 2... |
How to completely remove Python from a Windows machine? | 18,430,403 | 56 | 123 | 600,614 | 0 | python,installation,uninstallation | Here's the steps (my non-computer-savvy girlfriend had to figure this one out for me, but unlike all the far more complicated processes one can find online, this one works)
Open Control Panel
Click "Uninstall a Program"
Scroll down to Python and click uninstall for each version you don't want anymore.
This works on W... | 0 | 1 | 0 | 0 | 2010-08-18T18:59:00.000 | 14 | 1 | false | 3,515,673 | 1 | 0 | 0 | 12 | I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena...
I would like to completely remove Python from my system.
I tried running the 2... |
How to completely remove Python from a Windows machine? | 68,139,862 | 3 | 123 | 600,614 | 0 | python,installation,uninstallation | Open CMD
To show all packages installed - pip list
To copy the packages name to a file - pip freeze > requirements.txt
To delete all packages - pip uninstall -r requirements.txt -y
Check all packages are removed - pip list
Uninstall pip and other remaining packages
Control panel > Uninstall > Python uninstall (fr... | 0 | 1 | 0 | 0 | 2010-08-18T18:59:00.000 | 14 | 0.042831 | false | 3,515,673 | 1 | 0 | 0 | 12 | I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena...
I would like to completely remove Python from my system.
I tried running the 2... |
How to completely remove Python from a Windows machine? | 53,206,032 | 3 | 123 | 600,614 | 0 | python,installation,uninstallation | It's actually quite simple.
When you installed it, you must have done it using some .exe file (I am assuming). Just run that .exe again, and then there will be options to modify Python. Just select the "Complete Uninstall" option, and the EXE will completely wipe out python for you.
Also, you might have to checkbox the... | 0 | 1 | 0 | 0 | 2010-08-18T18:59:00.000 | 14 | 0.042831 | false | 3,515,673 | 1 | 0 | 0 | 12 | I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena...
I would like to completely remove Python from my system.
I tried running the 2... |
How to completely remove Python from a Windows machine? | 71,832,157 | 3 | 123 | 600,614 | 0 | python,installation,uninstallation | First, uninstall Python, then remove the pip packages you installed.
Uninstall Python: "Add or Remove Programs", search for Python and uninstall it.
Remove Pip packages: type in File Explorer %LOCALAPPDATA%\Programs\Python, and remove the folders you want.
This will clean up any pip package you installed. Otherwise, ... | 0 | 1 | 0 | 0 | 2010-08-18T18:59:00.000 | 14 | 0.042831 | false | 3,515,673 | 1 | 0 | 0 | 12 | I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena...
I would like to completely remove Python from my system.
I tried running the 2... |
How to completely remove Python from a Windows machine? | 69,742,157 | 3 | 123 | 600,614 | 0 | python,installation,uninstallation | If you still have the python installer on your PC, you can double-click on it (run it, it will open the installer window), and select the "Uninstall" option. It will uninstall that python version (if the installer is for Python3.9, then Python3.9 will be uninstalled, if it is for Python3.10, then that version...) | 0 | 1 | 0 | 0 | 2010-08-18T18:59:00.000 | 14 | 0.042831 | false | 3,515,673 | 1 | 0 | 0 | 12 | I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena...
I would like to completely remove Python from my system.
I tried running the 2... |
How to completely remove Python from a Windows machine? | 51,663,703 | 2 | 123 | 600,614 | 0 | python,installation,uninstallation | Uninstall the python program using the windows GUI.
Delete the containing folder e.g if it was stored in C:\python36\ make sure to delete that folder | 0 | 1 | 0 | 0 | 2010-08-18T18:59:00.000 | 14 | 0.028564 | false | 3,515,673 | 1 | 0 | 0 | 12 | I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena...
I would like to completely remove Python from my system.
I tried running the 2... |
How to completely remove Python from a Windows machine? | 36,202,297 | 1 | 123 | 600,614 | 0 | python,installation,uninstallation | I know it is an old question, but I ran into this problem with 2.7 and 3.5. Though 2.7 would not show up in my default windows uninstall list, it showed up fine in the ccleaner tools tab under uninstall. Uninstalled and reinstalled afterwards and it has been smooth coding ever since. | 0 | 1 | 0 | 0 | 2010-08-18T18:59:00.000 | 14 | 0.014285 | false | 3,515,673 | 1 | 0 | 0 | 12 | I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena...
I would like to completely remove Python from my system.
I tried running the 2... |
How to completely remove Python from a Windows machine? | 35,889,457 | 0 | 123 | 600,614 | 0 | python,installation,uninstallation | Windows 7 64-bit, with both Python3.4 and Python2.7 installed at some point :)
I'm using Py.exe to route to Py2 or Py3 depending on the script's needs - but I previously improperly uninstalled Python27 before.
Py27 was removed manually from C:\python\Python27 (the folder Python27 was deleted by me previously)
Upon re-i... | 0 | 1 | 0 | 0 | 2010-08-18T18:59:00.000 | 14 | 0 | false | 3,515,673 | 1 | 0 | 0 | 12 | I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena...
I would like to completely remove Python from my system.
I tried running the 2... |
How to completely remove Python from a Windows machine? | 3,515,850 | 1 | 123 | 600,614 | 0 | python,installation,uninstallation | Almost all of the python files should live in their respective folders (C:\Python26 and C:\Python27). Some installers (ActiveState) will also associate .py* files and add the python path to %PATH% with an install if you tick the "use this as the default installation" box. | 0 | 1 | 0 | 0 | 2010-08-18T18:59:00.000 | 14 | 0.014285 | false | 3,515,673 | 1 | 0 | 0 | 12 | I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena...
I would like to completely remove Python from my system.
I tried running the 2... |
How to completely remove Python from a Windows machine? | 66,791,174 | -1 | 123 | 600,614 | 0 | python,installation,uninstallation | Windows Start Menu > Settings > Apps > Apps & features > Select the app and click the Uninstall button | 0 | 1 | 0 | 0 | 2010-08-18T18:59:00.000 | 14 | -0.014285 | false | 3,515,673 | 1 | 0 | 0 | 12 | I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena...
I would like to completely remove Python from my system.
I tried running the 2... |
Extending python with C module | 3,517,141 | 1 | 1 | 471 | 0 | python,c,python-module,i2c | Don't use the Python C API, there are much easier alternatives, most notably cython.
cython is a Python-like language, which compiles into C code for the Python c library. Basically it's C with Python syntax and features (e.g. nice for loops, exceptions, etc.). cython is clearly the most recommendable way to write ... | 0 | 1 | 0 | 1 | 2010-08-18T21:49:00.000 | 5 | 0.039979 | false | 3,517,011 | 0 | 0 | 0 | 3 | So I have a C program to interface with an i2c device. I need to interface to that device from python. I'm just wondering if it's worth porting the program into a python module or if the amount of effort involved in porting won't outweigh just executing the program using subprocess. I know I'm sure it's different for e... |
Extending python with C module | 3,517,152 | 0 | 1 | 471 | 0 | python,c,python-module,i2c | I've had good luck using ctypes. Whatever you choose, though, you may not gain any time this time but the next time around your effort will be much faster than doing the whole thing in C. | 0 | 1 | 0 | 1 | 2010-08-18T21:49:00.000 | 5 | 0 | false | 3,517,011 | 0 | 0 | 0 | 3 | So I have a C program to interface with an i2c device. I need to interface to that device from python. I'm just wondering if it's worth porting the program into a python module or if the amount of effort involved in porting won't outweigh just executing the program using subprocess. I know I'm sure it's different for e... |
Extending python with C module | 3,517,190 | 2 | 1 | 471 | 0 | python,c,python-module,i2c | One of the first Python programs I wrote was a script that called functions from a C library, which sounds close to what you're doing. I used ctypes, and I was impressed as to how easy it was: I could access each library function from python by writing just a few lines of python (no C at all!). I'd tried the Python C A... | 0 | 1 | 0 | 1 | 2010-08-18T21:49:00.000 | 5 | 0.07983 | false | 3,517,011 | 0 | 0 | 0 | 3 | So I have a C program to interface with an i2c device. I need to interface to that device from python. I'm just wondering if it's worth porting the program into a python module or if the amount of effort involved in porting won't outweigh just executing the program using subprocess. I know I'm sure it's different for e... |
Why do some Django ORM queries end abruptly with the message "Killed"? | 3,529,637 | 6 | 7 | 1,944 | 1 | python,django,postgresql | Only one thing I could think of that will kill automatically a process on Linux - the OOM killer. What's in the system logs? | 0 | 1 | 0 | 0 | 2010-08-19T22:19:00.000 | 2 | 1.2 | true | 3,526,748 | 0 | 0 | 1 | 1 | Sometimes, when fetching data from the database either through the python shell or through a python script, the python process dies, and one single word is printed to the terminal: Killed
That's literally all it says. It only happens with certain scripts, but it always happens for those scripts. It consistently happens... |
Store python classes as pickles in GAE? | 5,152,644 | 0 | 2 | 366 | 0 | python,google-app-engine,pickle | The key advantages of using Django are its ORM and template system. The ORM is not very useful with datastore because of its non-relational nature and the template system is available as part of the app engine to be used with webapp.
I have had good success with using webapp and django templates for our project. | 0 | 1 | 0 | 0 | 2010-08-20T15:34:00.000 | 2 | 0 | false | 3,532,417 | 0 | 0 | 1 | 2 | I am porting a Python investing application to Google App Engine. Every market that you can trade in is a plugin: for example the stocks trading and FOREX trading are all plugins.
The application stores the portfolio (which is a Portfolio class instance containing the active investments (class instances) and history) a... |
Store python classes as pickles in GAE? | 3,532,598 | 1 | 2 | 366 | 0 | python,google-app-engine,pickle | The best solution would be to use the Datastore data models, but you'll have to rewrite parts of your app. Using Pickle for data persistance, especially involving much data, is not a good pratice. | 0 | 1 | 0 | 0 | 2010-08-20T15:34:00.000 | 2 | 0.099668 | false | 3,532,417 | 0 | 0 | 1 | 2 | I am porting a Python investing application to Google App Engine. Every market that you can trade in is a plugin: for example the stocks trading and FOREX trading are all plugins.
The application stores the portfolio (which is a Portfolio class instance containing the active investments (class instances) and history) a... |
Do you use data mappers with MongoDB? | 3,553,262 | 1 | 2 | 366 | 1 | python,orm,mongodb,mongoengine,mongokit | We are running a production site using Mongodb for the backend (no direct queries to Mongo, we have a search layer in between). We wrote our own business / object layer, i suppose it just seemed natural enough for the programmers to write in the custom logic. We did separate the database and business layers, but they... | 0 | 1 | 0 | 0 | 2010-08-20T16:54:00.000 | 1 | 1.2 | true | 3,533,064 | 0 | 0 | 0 | 1 | I've been diving into MongoDB with kind help of MongoKit and MongoEngine, but then I started thinking whether the data mappers are necessary here. Both mappers I mentioned enable one to do simple things without any effort. But is any effort required to do simple CRUD? It appears to me that in case of NoSQL the mappers ... |
Performance differences between Python and C | 3,533,838 | 7 | 13 | 14,463 | 0 | python,c,performance | Is there really a noticeable difference between sorting a textfile using the same algorithm in C versus Python, for example?
Yes.
The noticeable differences are these
There's much less Python code.
The Python code is much easier to read.
Python supports really nice unit testing, so the Python code tends to be highe... | 0 | 1 | 0 | 1 | 2010-08-20T18:27:00.000 | 14 | 1 | false | 3,533,759 | 1 | 0 | 0 | 11 | Working on different projects I have the choice of selecting different programming languages, as long as the task is done.
I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C.
The tasks to be done are pretty varied, e.g. sorting textfiles, disk... |
Performance differences between Python and C | 15,903,255 | 0 | 13 | 14,463 | 0 | python,c,performance | C is definitely faster than Python because Python is written in C.
C is middle level language and hence faster but there not much a great difference between C & Python regarding executable time it takes.
but it is really very easy to write code in Python than C and it take much shorter time to write code and learn Pyth... | 0 | 1 | 0 | 1 | 2010-08-20T18:27:00.000 | 14 | 0 | false | 3,533,759 | 1 | 0 | 0 | 11 | Working on different projects I have the choice of selecting different programming languages, as long as the task is done.
I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C.
The tasks to be done are pretty varied, e.g. sorting textfiles, disk... |
Performance differences between Python and C | 3,539,538 | -1 | 13 | 14,463 | 0 | python,c,performance | The excess time to write the code in C compared to Python will be exponentially greater than the difference between C and Python execution speed. | 0 | 1 | 0 | 1 | 2010-08-20T18:27:00.000 | 14 | -0.014285 | false | 3,533,759 | 1 | 0 | 0 | 11 | Working on different projects I have the choice of selecting different programming languages, as long as the task is done.
I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C.
The tasks to be done are pretty varied, e.g. sorting textfiles, disk... |
Performance differences between Python and C | 3,536,830 | -1 | 13 | 14,463 | 0 | python,c,performance | You will find C is much slower. Your developers will have to keep track of memory allocation, and use libraries (such as glib) to handle simple things such as dictionaries, or lists, which python has built-in.
Moreover, when an error occurs, your C program will typically just crash, which means you'll need to get the e... | 0 | 1 | 0 | 1 | 2010-08-20T18:27:00.000 | 14 | -0.014285 | false | 3,533,759 | 1 | 0 | 0 | 11 | Working on different projects I have the choice of selecting different programming languages, as long as the task is done.
I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C.
The tasks to be done are pretty varied, e.g. sorting textfiles, disk... |
Performance differences between Python and C | 3,534,845 | 0 | 13 | 14,463 | 0 | python,c,performance | Across all programs, it isn't really possible to say whether things will be quicker or slower on average in Python or C.
For the programs that I've implemented in both languages, using similar algorithms, I've seen no improvement (and sometimes a performance degradation) for string- and IO-heavy code, when reimplementi... | 0 | 1 | 0 | 1 | 2010-08-20T18:27:00.000 | 14 | 0 | false | 3,533,759 | 1 | 0 | 0 | 11 | Working on different projects I have the choice of selecting different programming languages, as long as the task is done.
I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C.
The tasks to be done are pretty varied, e.g. sorting textfiles, disk... |
Performance differences between Python and C | 3,534,210 | 1 | 13 | 14,463 | 0 | python,c,performance | It really depends a lot on what your doing and if the algorithm in question is available in Python via a natively compiled library. If it is, then I believe you'll be looking at performance numbers close enough that Python is most likely your answer -- assuming it's your preferred language. If you must implement the al... | 0 | 1 | 0 | 1 | 2010-08-20T18:27:00.000 | 14 | 0.014285 | false | 3,533,759 | 1 | 0 | 0 | 11 | Working on different projects I have the choice of selecting different programming languages, as long as the task is done.
I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C.
The tasks to be done are pretty varied, e.g. sorting textfiles, disk... |
Performance differences between Python and C | 3,534,052 | 4 | 13 | 14,463 | 0 | python,c,performance | If your text files that you are sorting and parsing are large, use C. If they aren't, it doesn't matter. You can write poor code in any language though. I have seen simple code in C for calculating areas of triangles run 10x slower than other C code, because of poor memory management, use of structures, pointers, etc. ... | 0 | 1 | 0 | 1 | 2010-08-20T18:27:00.000 | 14 | 0.057081 | false | 3,533,759 | 1 | 0 | 0 | 11 | Working on different projects I have the choice of selecting different programming languages, as long as the task is done.
I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C.
The tasks to be done are pretty varied, e.g. sorting textfiles, disk... |
Performance differences between Python and C | 3,533,974 | 4 | 13 | 14,463 | 0 | python,c,performance | The first rule of computer performance questions: Your mileage will vary. If small performance differences are important to you, the only way you will get valid information is to test with your configuration, your data, and your benchmark. "Small" here is, say, a factor of two or so.
The second rule of computer perfo... | 0 | 1 | 0 | 1 | 2010-08-20T18:27:00.000 | 14 | 0.057081 | false | 3,533,759 | 1 | 0 | 0 | 11 | Working on different projects I have the choice of selecting different programming languages, as long as the task is done.
I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C.
The tasks to be done are pretty varied, e.g. sorting textfiles, disk... |
Performance differences between Python and C | 3,533,800 | 10 | 13 | 14,463 | 0 | python,c,performance | In general IO bound work will depend more on the algorithm then the language. In this case I would go with Python because it will have first class strings and lots of easy to use libraries for manipulating files, etc. | 0 | 1 | 0 | 1 | 2010-08-20T18:27:00.000 | 14 | 1 | false | 3,533,759 | 1 | 0 | 0 | 11 | Working on different projects I have the choice of selecting different programming languages, as long as the task is done.
I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C.
The tasks to be done are pretty varied, e.g. sorting textfiles, disk... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.