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
Python: What OS am I running on?
48,244,490
2
838
422,064
0
python,cross-platform,platform-specific,platform-agnostic
If you are running macOS X and run platform.system() you get darwin because macOS X is built on Apple's Darwin OS. Darwin is the kernel of macOS X and is essentially macOS X without the GUI.
0
1
0
0
2008-08-05T03:23:00.000
26
0.015383
false
1,854
0
0
0
1
What do I need to look at to see whether I'm on Windows or Unix, etc?
Create a directly-executable cross-platform GUI app using Python
12,167
4
300
199,251
0
python,user-interface,deployment,tkinter,release-management
I'm not sure that this is the best way to do it, but when I'm deploying Ruby GUI apps (not Python, but has the same "problem" as far as .exe's are concerned) on Windows, I just write a short launcher in C# that calls on my main script. It compiles to an executable, and I then have an application executable.
0
1
0
0
2008-08-05T22:26:00.000
13
0.061461
false
2,933
0
0
0
2
Python works on multiple platforms and can be used for desktop and web applications, thus I conclude that there is some way to compile it into an executable for Mac, Windows and Linux. The problem being I have no idea where to start or how to write a GUI with it, can anybody shed some light on this and point me in the right direction please?
Create a directly-executable cross-platform GUI app using Python
2,980
6
300
199,251
0
python,user-interface,deployment,tkinter,release-management
Since python is installed on nearly every non-Windows OS by default now, the only thing you really need to make sure of is that all of the non-standard libraries you use are installed. Having said that, it is possible to build executables that include the python interpreter, and any libraries you use. This is likely to create a large executable, however. MacOS X even includes support in the Xcode IDE for creating full standalone GUI apps. These can be run by any user running OS X.
0
1
0
0
2008-08-05T22:26:00.000
13
1
false
2,933
0
0
0
2
Python works on multiple platforms and can be used for desktop and web applications, thus I conclude that there is some way to compile it into an executable for Mac, Windows and Linux. The problem being I have no idea where to start or how to write a GUI with it, can anybody shed some light on this and point me in the right direction please?
How do you set up Python scripts to work in Apache 2.0?
14,791,003
0
23
32,774
0
python,apache,apache2
The problem for me wasn't in Apache set up, but in understanding how mod_apache actually uses the .py files. Module-level statements (including those in a if __name__=='__main__' section) are not executed--I assumed that the stdout from running the script at the commandline would be what the server would output, but that's not how it works. Instead, I wrote a module-level function called index(), and had it return as a string the HTML of the page. It's also possible to have other module-level functions (e.g., otherFunction()) that can be accessed as further segments in the URI (e.g., testScript/otherFunction for the file testScript.py.) Obviously, this makes more sense than my original stdout conception. Better capability of actually using Python as a scripting language and not a humongous markup language.
0
1
0
1
2008-08-07T18:24:00.000
4
0
false
5,102
0
0
0
1
I tried to follow a couple of googled up tutorials on setting up mod_python, but failed every time. Do you have a good, step-by step, rock-solid howto? My dev box is OS X, production - Centos.
Find broken symlinks with Python
20,843
4
30
25,846
0
python,linux,symlink
Can I mention testing for hardlinks without python? /bin/test has the FILE1 -ef FILE2 condition that is true when files share an inode. Therefore, something like find . -type f -exec test \{} -ef /path/to/file \; -print works for hard link testing to a specific file. Which brings me to reading man test and the mentions of -L and -h which both work on one file and return true if that file is a symbolic link, however that doesn't tell you if the target is missing. I did find that head -0 FILE1 would return an exit code of 0 if the file can be opened and a 1 if it cannot, which in the case of a symbolic link to a regular file works as a test for whether it's target can be read.
0
1
0
0
2008-08-21T19:00:00.000
8
0.099668
false
20,794
0
0
0
1
If I call os.stat() on a broken symlink, python throws an OSError exception. This makes it useful for finding them. However, there are a few other reasons that os.stat() might throw a similar exception. Is there a more precise way of detecting broken symlinks with Python under Linux?
What's the best way to duplicate fork() in windows?
52,191
3
23
31,865
0
python,windows,process,subprocess,fork
The Threading example from Eli will run the thread, but not do any of the work after that line. I'm going to look into the processing module and the subprocess module. I think the com method I'm running needs to be in another process, not just in another thread.
0
1
0
0
2008-08-22T20:27:00.000
7
0.085505
false
23,397
0
0
0
1
How do I implement some logic that will allow me to reproduce on Windows the functionality that I have on Linux with the fork() system call, using Python? I'm specifically trying to execute a method on the SAPI Com component, while continuing the other logic in the main thread without blocking or waiting.
Install Python to match directory layout in OS X 10.5
31,384
1
4
653
0
python,macos,64-bit
Personally, I wouldn't worry about it until you see a problem. Messing with the default python install on a *Nix system can cause more trouble than it's worth. I can say from personal experience that you never truly understand what python has done for the nix world until you have a problem with it. You can also add a second python installation, but that also causes more problems than it's worth IMO. So I suppose the best question to start out with would be why exactly do you want to use the 64 bit version of python?
0
1
0
0
2008-08-27T10:22:00.000
5
1.2
true
29,856
0
0
1
4
The default Python install on OS X 10.5 is 2.5.1 with a FAT 32 bit (Intel and PPC) client. I want to setup apache and mysql to run django. In the past, I have run Apache and MySQL to match this install in 32 bit mode (even stripping out the 64 bit stuff from Apache to make it work). I want to upgrade Python to 64 bit. I am completely comfortable with compiling it from source with one caveat. How do I match the way that the default install is laid out? Especially, with regards to site-packages being in /Library/Python/2.5/ and not the one in buried at the top of the framework once I compile it.
Install Python to match directory layout in OS X 10.5
31,331
0
4
653
0
python,macos,64-bit
Essentially, yes. I was not sure you could do it like that (current version does not do it like that). When using the python install script, however, there is no option (that I can find) to specify where to put directories and files (eg --prefix). I was hoping to match the current layout of python related files so as to avoid 'polluting' my machine with redundant files.
0
1
0
0
2008-08-27T10:22:00.000
5
0
false
29,856
0
0
1
4
The default Python install on OS X 10.5 is 2.5.1 with a FAT 32 bit (Intel and PPC) client. I want to setup apache and mysql to run django. In the past, I have run Apache and MySQL to match this install in 32 bit mode (even stripping out the 64 bit stuff from Apache to make it work). I want to upgrade Python to 64 bit. I am completely comfortable with compiling it from source with one caveat. How do I match the way that the default install is laid out? Especially, with regards to site-packages being in /Library/Python/2.5/ and not the one in buried at the top of the framework once I compile it.
Install Python to match directory layout in OS X 10.5
30,591
1
4
653
0
python,macos,64-bit
Not sure I entirely understand your question, but can't you simply build and install a 64 bit version and then create symbolic links so that /Library/Python/2.5 and below point to your freshly built version of python?
0
1
0
0
2008-08-27T10:22:00.000
5
0.039979
false
29,856
0
0
1
4
The default Python install on OS X 10.5 is 2.5.1 with a FAT 32 bit (Intel and PPC) client. I want to setup apache and mysql to run django. In the past, I have run Apache and MySQL to match this install in 32 bit mode (even stripping out the 64 bit stuff from Apache to make it work). I want to upgrade Python to 64 bit. I am completely comfortable with compiling it from source with one caveat. How do I match the way that the default install is laid out? Especially, with regards to site-packages being in /Library/Python/2.5/ and not the one in buried at the top of the framework once I compile it.
Install Python to match directory layout in OS X 10.5
31,425
0
4
653
0
python,macos,64-bit
The short answer is because I can. The long answer, expanding on what the OP said, is to be more compatible with apache and mysql/postgresql. They are all 64bit (apache is a fat binary with ppc, ppc64 x86 and x86 and x86_64, the others just straight 64bit). Mysqldb and mod_python wont compile unless they are all running the same architecture. Yes I could run them all in 32bit (and have in the past) but this is much more work then compiling one program. EDIT: You pretty much convinced though to just let the installer do its thing and update the PATH to reflect this.
0
1
0
0
2008-08-27T10:22:00.000
5
0
false
29,856
0
0
1
4
The default Python install on OS X 10.5 is 2.5.1 with a FAT 32 bit (Intel and PPC) client. I want to setup apache and mysql to run django. In the past, I have run Apache and MySQL to match this install in 32 bit mode (even stripping out the 64 bit stuff from Apache to make it work). I want to upgrade Python to 64 bit. I am completely comfortable with compiling it from source with one caveat. How do I match the way that the default install is laid out? Especially, with regards to site-packages being in /Library/Python/2.5/ and not the one in buried at the top of the framework once I compile it.
Why is the subprocess.Popen class not named Subprocess?
38,222
8
4
691
0
python,subprocess
Now, I'm not saying that this is the greatest name in the world, but here was the idea as I understand it. Originally, the popen family was in the os module and was an implementation of the venerable posix popen. The movement to the subprocess module would have been an opportune time to rename them, but I guess that keeping Popen makes it easier to find in the docs for those who have a long history with python or even to the venerable posix functions. From its earliest posix incarnation, Popen has always been meant to open a Process and allow you to read and write from its stdio like a file. Thus the mnemonic for Popen is that it is short for ProcessOpen in an attempt to kind of, sorta, look like open.
0
1
0
0
2008-09-01T17:40:00.000
3
1.2
true
38,197
1
0
0
2
The primary class in the subprocess module is name Popen, and represents a subprocess. Popen sounds like someone was trying to force the name to follow some function naming format, rather than chosing a name that actually represents what the object is. Does anyone know why it was chosen over something simple like, say, Subprocess?
Why is the subprocess.Popen class not named Subprocess?
38,202
-1
4
691
0
python,subprocess
I suppose the name was chosen because the functionality subprocess is replacing was formerly in the os module as the os.popen function. There could be even ways to automate migration between the two.
0
1
0
0
2008-09-01T17:40:00.000
3
-0.066568
false
38,197
1
0
0
2
The primary class in the subprocess module is name Popen, and represents a subprocess. Popen sounds like someone was trying to force the name to follow some function naming format, rather than chosing a name that actually represents what the object is. Does anyone know why it was chosen over something simple like, say, Subprocess?
Using C in a shared multi-platform POSIX environment
39,865
0
2
293
0
python,c,cross-platform,posix,scripting
You know, you should look at static linking. These days, we all have HUGE hard drives, and a few extra megabytes (for carrying around libc and what not) is really not that big a deal anymore. You could also try running your applications in chroot() jails and distributing those.
0
1
0
0
2008-09-02T15:46:00.000
4
0
false
39,847
1
0
0
4
I write tools that are used in a shared workspace. Since there are multiple OS's working in this space, we generally use Python and standardize the version that is installed across machines. However, if I wanted to write some things in C, I was wondering if maybe I could have the application wrapped in a Python script, that detected the operating system and fired off the correct version of the C application. Each platform has GCC available and uses the same shell. One idea was to have the C compiled to the users local ~/bin, with timestamp comparison with C code so it is not compiled each run, but only when code is updated. Another was to just compile it for each platform, and have the wrapper script select the proper executable. Is there an accepted/stable process for this? Are there any catches? Are there alternatives (assuming the absolute need to use native C code)? Clarification: Multiple OS's are involved that do not share ABI. Eg. OS X, various Linuxes, BSD etc. I need to be able to update the code in place in shared folders and have the new code working more or less instantaneously. Distributing binary or source packages is less than ideal.
Using C in a shared multi-platform POSIX environment
39,878
1
2
293
0
python,c,cross-platform,posix,scripting
Also, you could use autoconf and distribute your application in source form only. :)
0
1
0
0
2008-09-02T15:46:00.000
4
0.049958
false
39,847
1
0
0
4
I write tools that are used in a shared workspace. Since there are multiple OS's working in this space, we generally use Python and standardize the version that is installed across machines. However, if I wanted to write some things in C, I was wondering if maybe I could have the application wrapped in a Python script, that detected the operating system and fired off the correct version of the C application. Each platform has GCC available and uses the same shell. One idea was to have the C compiled to the users local ~/bin, with timestamp comparison with C code so it is not compiled each run, but only when code is updated. Another was to just compile it for each platform, and have the wrapper script select the proper executable. Is there an accepted/stable process for this? Are there any catches? Are there alternatives (assuming the absolute need to use native C code)? Clarification: Multiple OS's are involved that do not share ABI. Eg. OS X, various Linuxes, BSD etc. I need to be able to update the code in place in shared folders and have the new code working more or less instantaneously. Distributing binary or source packages is less than ideal.
Using C in a shared multi-platform POSIX environment
40,367
2
2
293
0
python,c,cross-platform,posix,scripting
Launching a Python interpreter instance just to select the right binary to run would be much heavier than you need. I'd distribute a shell .rc file which provides aliases. In /shared/bin, you put the various binaries: /shared/bin/toolname-mac, /shared/bin/toolname-debian-x86, /shared/bin/toolname-netbsd-dreamcast, etc. Then, in the common shared shell .rc file, you put the logic to set the aliases according to platform, so that on OSX, it gets alias toolname=/shared/bin/toolname-mac, and so forth. This won't work as well if you're adding new tools all the time, because the users will need to reload the aliases. I wouldn't recommend distributing tools this way, though. Testing and qualifying new builds of the tools should be taking up enough time and effort that the extra time required to distribute the tools to the users is trivial. You seem to be optimizing to reduce the distribution time. Replacing tools that quickly in a live environment is all too likely to result in lengthy and confusing downtime if anything goes wrong in writing and building the tools--especially when subtle cross-platform issues creep in.
0
1
0
0
2008-09-02T15:46:00.000
4
0.099668
false
39,847
1
0
0
4
I write tools that are used in a shared workspace. Since there are multiple OS's working in this space, we generally use Python and standardize the version that is installed across machines. However, if I wanted to write some things in C, I was wondering if maybe I could have the application wrapped in a Python script, that detected the operating system and fired off the correct version of the C application. Each platform has GCC available and uses the same shell. One idea was to have the C compiled to the users local ~/bin, with timestamp comparison with C code so it is not compiled each run, but only when code is updated. Another was to just compile it for each platform, and have the wrapper script select the proper executable. Is there an accepted/stable process for this? Are there any catches? Are there alternatives (assuming the absolute need to use native C code)? Clarification: Multiple OS's are involved that do not share ABI. Eg. OS X, various Linuxes, BSD etc. I need to be able to update the code in place in shared folders and have the new code working more or less instantaneously. Distributing binary or source packages is less than ideal.
Using C in a shared multi-platform POSIX environment
39,871
0
2
293
0
python,c,cross-platform,posix,scripting
Depending on your mix os OSes, you might be better off creating packages for each class of system. Alternatively, if they all share the same ABI and hardware architecture, you could also compile static binaries.
0
1
0
0
2008-09-02T15:46:00.000
4
0
false
39,847
1
0
0
4
I write tools that are used in a shared workspace. Since there are multiple OS's working in this space, we generally use Python and standardize the version that is installed across machines. However, if I wanted to write some things in C, I was wondering if maybe I could have the application wrapped in a Python script, that detected the operating system and fired off the correct version of the C application. Each platform has GCC available and uses the same shell. One idea was to have the C compiled to the users local ~/bin, with timestamp comparison with C code so it is not compiled each run, but only when code is updated. Another was to just compile it for each platform, and have the wrapper script select the proper executable. Is there an accepted/stable process for this? Are there any catches? Are there alternatives (assuming the absolute need to use native C code)? Clarification: Multiple OS's are involved that do not share ABI. Eg. OS X, various Linuxes, BSD etc. I need to be able to update the code in place in shared folders and have the new code working more or less instantaneously. Distributing binary or source packages is less than ideal.
What are the advantages of packaging your python library/application as an .egg file?
138,090
1
27
10,471
0
python,zip,packaging,software-distribution,egg
For simple Python programs, you probably don't need to use eggs. Distributing the raw .py files should suffice; it's like distributing source files for GNU/Linux. You can also use the various OS "packagers" (like py2exe or py2app) to create .exe, .dmg, or other files for different operating systems. More complex programs, e.g. Django, pretty much require eggs due to the various modules and dependencies required.
0
1
0
1
2008-09-06T23:35:00.000
6
0.033321
false
47,953
1
0
0
3
I've read some about .egg files and I've noticed them in my lib directory but what are the advantages/disadvantages of using then as a developer?
What are the advantages of packaging your python library/application as an .egg file?
137,903
1
27
10,471
0
python,zip,packaging,software-distribution,egg
Whatever you do, do not stop distributing your application, also, as a tarball, as that is the easiest packagable format for operating systems with a package sysetem.
0
1
0
1
2008-09-06T23:35:00.000
6
0.033321
false
47,953
1
0
0
3
I've read some about .egg files and I've noticed them in my lib directory but what are the advantages/disadvantages of using then as a developer?
What are the advantages of packaging your python library/application as an .egg file?
47,958
4
27
10,471
0
python,zip,packaging,software-distribution,egg
Eggs are a pretty good way to distribute python apps. Think of it as a platform independent .deb file that will install all dependencies and whatnot. The advantage is that it's easy to use for the end user. The disadvantage are that it can be cumbersome to package your app up as a .egg file. You should also offer an alternative means of installation in addition to .eggs. There are some people who don't like using eggs because they don't like the idea of a software program installing whatever software it wants. These usually tend to be sysadmin types.
0
1
0
1
2008-09-06T23:35:00.000
6
0.132549
false
47,953
1
0
0
3
I've read some about .egg files and I've noticed them in my lib directory but what are the advantages/disadvantages of using then as a developer?
Calling python from a c++ program for distribution
69,672,216
0
65
100,997
0
c++,python,embedded-language
Using Inter Process Communication (IPC) over socket can be a possible solution. Use a local network socket to listen/trasfer commands between both.
0
1
0
1
2008-09-08T03:53:00.000
7
0
false
49,137
0
0
0
1
I would like to call python script files from my c++ program. I am not sure that the people I will distribute to will have python installed. Basically I'm looking for a .lib file that I can use that has an Apache like distribution license.
Any good AJAX framework for Google App Engine apps?
230,476
0
14
11,904
0
python,ajax,google-app-engine
I'm currently using JQuery for my GAE app and it works beautifully for me. I have a chart (google charts) that is dynamic and uses an Ajax call to grab a JSON string. It really seems to work fine for me.
0
1
0
0
2008-09-10T13:12:00.000
11
0
false
53,997
0
0
1
2
I am trying to implement AJAX in my Google App Engine application, and so I am looking for a good AJAX framework that will help me. Anyone has any idea? I am thinking about Google Web Toolkit, how good it is in terms of creating AJAX for Google App Engine?
Any good AJAX framework for Google App Engine apps?
54,015
3
14
11,904
0
python,ajax,google-app-engine
I'd recommend looking into a pure javascript framework (probably Jquery) for your client-side code, and write JSON services in python- that seems to be the easiest / bestest way to go. Google Web Toolkit lets you write the UI in Java and compile it to javascript. As Dave says, it may be a better choice where the backend is in Java, as it has nice RPC hooks for that case.
0
1
0
0
2008-09-10T13:12:00.000
11
0.054491
false
53,997
0
0
1
2
I am trying to implement AJAX in my Google App Engine application, and so I am looking for a good AJAX framework that will help me. Anyone has any idea? I am thinking about Google Web Toolkit, how good it is in terms of creating AJAX for Google App Engine?
Anyone used Dabo for a medium-big project?
103,212
2
21
4,033
0
python,erp,dabo
I have no Dabo experience at all but this question is on the top of the list fo such a long time that I decided to give it a shot: Framework selection Assumptions: medium-to-big project: we're talking about a team of more than 20 people working on something for about a year for the first phase. This is usually an expensive and very important effort for the client. this project will have significant amount of users (around a hundred) so performance is essential it's an ERP project so the application will work with large amounts of information you have no prior Dabo experience in your team Considerations: I could not open Dabo project site right now. There seems to be some server problem. That alone would make me think twice about using it for a big project. It's not a well-known framework. Typing Dabo in Google returns almost no useful results, it does not have a Wikipedia page, all-in-all it's quite obscure. It means that when you will have problems with it (and you will have problems with it) you will have almost no place to go. Your question was unanswered for 8 days on SO, this alone would make me re-consider. If you base your project on an obscure technology you have no previous experience with - it's a huge risk. You don't have people who know that framework in your team. It means that you have to learn it to get any results at all and to master it will require quite significant amount of time. You will have to factor that time into your project plan. Do you really need it? What does this framework give you that you cannot do yourself? Quite a lot of time my team tried to use some third-party component or tool only to find that building a custom one would be faster than dealing with third-party problems and limitations. There are brilliant tools available to people nowadays and we would be lost without them - but you have to carefully consider if this tool is one of them Dabo project version is 0.84. Do you know if they spend time optimising their code for performance at this stage? Did you run any tests to see it will sustain the load you have in your NFRs. Hope that helps :) Good luck with your project
0
1
0
0
2008-09-11T12:29:00.000
2
0.197375
false
56,417
0
0
1
1
We're at the beginning of a new ERP-ish client-server application, developed as a Python rich client. We're currently evaluating Dabo as our main framework and it looks quite nice and easy to use, but I was wondering, has anyone used it for medium-to-big sized projects? Thanks for your time!
How to prompt for user input and read command-line arguments
70,869
19
591
1,321,249
0
python,input,command-line-arguments
Careful not to use the input function, unless you know what you're doing. Unlike raw_input, input will accept any python expression, so it's kinda like eval
0
1
0
0
2008-09-16T09:44:00.000
12
1
false
70,797
1
0
0
1
How do I have a Python script that a) can accept user input and how do I make it b) read in arguments if run from the command line?
OCSP command-line test tool?
108,678
1
3
8,106
0
java,python,command-line,ocsp
bouncycastle has a Java crypto-provider and support for OCSP requests and responses. The differences between OCSPReq and OCSPRequest and OCSPResp and OCSPResponse class are a little confusing, though.
0
1
0
0
2008-09-16T11:44:00.000
5
0.039979
false
71,468
0
0
0
1
Does anybody know of a tool to test OCSP responses? Preferably, something that can be used from a Windows Command-line and/or can be included (easily) in a Java/python program
How to terminate a script?
70,824,754
0
1,288
1,876,007
0
python,termination
Just put at the end of your code quit() and that should close a python script.
0
1
0
1
2008-09-16T15:35:00.000
12
0
false
73,663
0
0
0
2
I am aware of the die() command in PHP which exits a script early. How can I do this in Python?
How to terminate a script?
76,374
75
1,288
1,876,007
0
python,termination
While you should generally prefer sys.exit because it is more "friendly" to other code, all it actually does is raise an exception. If you are sure that you need to exit a process immediately, and you might be inside of some exception handler which would catch SystemExit, there is another function - os._exit - which terminates immediately at the C level and does not perform any of the normal tear-down of the interpreter; for example, hooks registered with the "atexit" module are not executed.
0
1
0
1
2008-09-16T15:35:00.000
12
1
false
73,663
0
0
0
2
I am aware of the die() command in PHP which exits a script early. How can I do this in Python?
Search for host with MAC-address using Python
85,608
1
9
16,340
0
python,network-programming
I don't think there is a built in way to get it from Python itself. My question is, how are you getting the IP information from your network? To get it from your local machine you could parse ifconfig (unix) or ipconfig (windows) with little difficulty.
0
1
1
0
2008-09-17T17:23:00.000
8
0.024995
false
85,577
0
0
0
4
I'd like to search for a given MAC address on my network, all from within a Python script. I already have a map of all the active IP addresses in the network but I cannot figure out how to glean the MAC address. Any ideas?
Search for host with MAC-address using Python
85,641
0
9
16,340
0
python,network-programming
You would want to parse the output of 'arp', but the kernel ARP cache will only contain those IP address(es) if those hosts have communicated with the host where the Python script is running. ifconfig can be used to display the MAC addresses of local interfaces, but not those on the LAN.
0
1
1
0
2008-09-17T17:23:00.000
8
0
false
85,577
0
0
0
4
I'd like to search for a given MAC address on my network, all from within a Python script. I already have a map of all the active IP addresses in the network but I cannot figure out how to glean the MAC address. Any ideas?
Search for host with MAC-address using Python
85,634
1
9
16,340
0
python,network-programming
It seems that there is not a native way of doing this with Python. Your best bet would be to parse the output of "ipconfig /all" on Windows, or "ifconfig" on Linux. Consider using os.popen() with some regexps.
0
1
1
0
2008-09-17T17:23:00.000
8
0.024995
false
85,577
0
0
0
4
I'd like to search for a given MAC address on my network, all from within a Python script. I already have a map of all the active IP addresses in the network but I cannot figure out how to glean the MAC address. Any ideas?
Search for host with MAC-address using Python
85,620
0
9
16,340
0
python,network-programming
Depends on your platform. If you're using *nix, you can use the 'arp' command to look up the mac address for a given IP (assuming IPv4) address. If that doesn't work, you could ping the address and then look, or if you have access to the raw network (using BPF or some other mechanism), you could send your own ARP packets (but that is probably overkill).
0
1
1
0
2008-09-17T17:23:00.000
8
0
false
85,577
0
0
0
4
I'd like to search for a given MAC address on my network, all from within a Python script. I already have a map of all the active IP addresses in the network but I cannot figure out how to glean the MAC address. Any ideas?
How do I execute a program or call a system command?
10,988,365
26
5,689
4,032,334
0
python,shell,terminal,subprocess,command
os.system does not allow you to store results, so if you want to store results in some list or something, a subprocess.call works.
0
1
0
0
2008-09-18T01:35:00.000
64
1
false
89,228
0
0
0
3
How do I call an external command within Python as if I'd typed it in a shell or command prompt?
How do I execute a program or call a system command?
4,728,086
25
5,689
4,032,334
0
python,shell,terminal,subprocess,command
subprocess.check_call is convenient if you don't want to test return values. It throws an exception on any error.
0
1
0
0
2008-09-18T01:35:00.000
64
1
false
89,228
0
0
0
3
How do I call an external command within Python as if I'd typed it in a shell or command prompt?
How do I execute a program or call a system command?
2,030,768
26
5,689
4,032,334
0
python,shell,terminal,subprocess,command
There is another difference here which is not mentioned previously. subprocess.Popen executes the <command> as a subprocess. In my case, I need to execute file <a> which needs to communicate with another program, <b>. I tried subprocess, and execution was successful. However <b> could not communicate with <a>. Everything is normal when I run both from the terminal. One more: (NOTE: kwrite behaves different from other applications. If you try the below with Firefox, the results will not be the same.) If you try os.system("kwrite"), program flow freezes until the user closes kwrite. To overcome that I tried instead os.system(konsole -e kwrite). This time program continued to flow, but kwrite became the subprocess of the console. Anyone runs the kwrite not being a subprocess (i.e. in the system monitor it must appear at the leftmost edge of the tree).
0
1
0
0
2008-09-18T01:35:00.000
64
1
false
89,228
0
0
0
3
How do I call an external command within Python as if I'd typed it in a shell or command prompt?
How to bundle a Python application including dependencies?
106,731
1
61
58,009
0
python,tkinter,packaging
py2exe is the best way to do this. It's a bit of a PITA to use, but the end result works very well.
0
1
0
0
2008-09-20T01:39:00.000
7
0.028564
false
106,725
1
0
0
2
I need to package my Python application, its dependencies and Python into a single MSI installer. The end result should desirably be: Python is installed in the standard location the package and its dependencies are installed in a separate directory (possibly site-packages) the installation directory should contain the Python uncompressed and a standalone executable is not required
How to bundle a Python application including dependencies?
114,717
5
61
58,009
0
python,tkinter,packaging
My company uses the free InnoSetup tool. It is a moderately complex program that has tons of flexibility for building installers for windows. I believe that it creates .exe and not .msi files, however. InnoSetup is not python specific but we have created an installer for one of our products that installs python along with dependencies to locations specified by the user at install time.
0
1
0
0
2008-09-20T01:39:00.000
7
0.141893
false
106,725
1
0
0
2
I need to package my Python application, its dependencies and Python into a single MSI installer. The end result should desirably be: Python is installed in the standard location the package and its dependencies are installed in a separate directory (possibly site-packages) the installation directory should contain the Python uncompressed and a standalone executable is not required
Disable output buffering
107,720
68
621
341,073
0
python,stdout,buffered
Yes, it is. You can disable it on the commandline with the "-u" switch. Alternatively, you could call .flush() on sys.stdout on every write (or wrap it with an object that does this automatically)
0
1
0
0
2008-09-20T09:17:00.000
16
1
false
107,705
0
0
0
3
Is output buffering enabled by default in Python's interpreter for sys.stdout? If the answer is positive, what are all the ways to disable it? Suggestions so far: Use the -u command line switch Wrap sys.stdout in an object that flushes after every write Set PYTHONUNBUFFERED env var sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) Is there any other way to set some global flag in sys/sys.stdout programmatically during execution?
Disable output buffering
107,721
12
621
341,073
0
python,stdout,buffered
Yes, it is enabled by default. You can disable it by using the -u option on the command line when calling python.
0
1
0
0
2008-09-20T09:17:00.000
16
1
false
107,705
0
0
0
3
Is output buffering enabled by default in Python's interpreter for sys.stdout? If the answer is positive, what are all the ways to disable it? Suggestions so far: Use the -u command line switch Wrap sys.stdout in an object that flushes after every write Set PYTHONUNBUFFERED env var sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) Is there any other way to set some global flag in sys/sys.stdout programmatically during execution?
Disable output buffering
17,047,064
3
621
341,073
0
python,stdout,buffered
(I've posted a comment, but it got lost somehow. So, again:) As I noticed, CPython (at least on Linux) behaves differently depending on where the output goes. If it goes to a tty, then the output is flushed after each '\n' If it goes to a pipe/process, then it is buffered and you can use the flush() based solutions or the -u option recommended above. Slightly related to output buffering: If you iterate over the lines in the input with for line in sys.stdin: ... then the for implementation in CPython will collect the input for a while and then execute the loop body for a bunch of input lines. If your script is about to write output for each input line, this might look like output buffering but it's actually batching, and therefore, none of the flush(), etc. techniques will help that. Interestingly, you don't have this behaviour in pypy. To avoid this, you can use while True: line=sys.stdin.readline() ...
0
1
0
0
2008-09-20T09:17:00.000
16
0.037482
false
107,705
0
0
0
3
Is output buffering enabled by default in Python's interpreter for sys.stdout? If the answer is positive, what are all the ways to disable it? Suggestions so far: Use the -u command line switch Wrap sys.stdout in an object that flushes after every write Set PYTHONUNBUFFERED env var sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) Is there any other way to set some global flag in sys/sys.stdout programmatically during execution?
Delete all data for a kind in Google App Engine
8,444,988
1
45
29,003
0
python,google-app-engine
Yes you can: Go to Datastore Admin, and then select the Entitiy type you want to delete and click Delete. Mapreduce will take care of deleting!
0
1
0
0
2008-09-20T17:34:00.000
19
0.010526
false
108,822
0
0
1
3
I would like to wipe out all data for a specific kind in Google App Engine. What is the best way to do this? I wrote a delete script (hack), but since there is so much data is timeout's out after a few hundred records.
Delete all data for a kind in Google App Engine
2,245,189
0
45
29,003
0
python,google-app-engine
You can use the task queues to delete chunks of say 100 objects. Deleting objects in GAE shows how limited the Admin capabilities are in GAE. You have to work with batches on 1000 entities or less. You can use the bulkloader tool that works with csv's but the documentation does not cover java. I am using GAE Java and my strategy for deletions involves having 2 servlets, one for doing the actually delete and another to load the task queues. When i want to do a delete, I run the queue loading servlet, it loads the queues and then GAE goes to work executing all the tasks in the queue. How to do it: Create a servlet that deletes a small number of objects. Add the servlet to your task queues. Go home or work on something else ;) Check the datastore every so often ... I have a datastore with about 5000 objects that i purge every week and it takes about 6 hours to clean out, so i run the task on Friday night. I use the same technique to bulk load my data which happens to be about 5000 objects, with about a dozen properties.
0
1
0
0
2008-09-20T17:34:00.000
19
0
false
108,822
0
0
1
3
I would like to wipe out all data for a specific kind in Google App Engine. What is the best way to do this? I wrote a delete script (hack), but since there is so much data is timeout's out after a few hundred records.
Delete all data for a kind in Google App Engine
109,018
3
45
29,003
0
python,google-app-engine
Unfortunately, there's no way to easily do a bulk delete. Your best bet is to write a script that deletes a reasonable number of entries per invocation, and then call it repeatedly - for example, by having your delete script return a 302 redirect whenever there's more data to delete, then fetching it with "wget --max-redirect=10000" (or some other large number).
0
1
0
0
2008-09-20T17:34:00.000
19
0.031568
false
108,822
0
0
1
3
I would like to wipe out all data for a specific kind in Google App Engine. What is the best way to do this? I wrote a delete script (hack), but since there is so much data is timeout's out after a few hundred records.
Feedback on using Google App Engine?
2,462,266
6
126
10,614
0
python,django,google-app-engine
This question has been fully answered. Which is good. But one thing perhaps is worth mentioning. The google app engine has a plugin for the eclipse ide which is a joy to work with. If you already do your development with eclipse you are going to be so happy about that. To deploy on the google app engine's web site all I need to do is click one little button - with the airplane logo - super.
0
1
0
0
2008-09-21T03:41:00.000
11
1
false
110,186
0
0
1
4
Looking to do a very small, quick 'n dirty side project. I like the fact that the Google App Engine is running on Python with Django built right in - gives me an excuse to try that platform... but my question is this: Has anyone made use of the app engine for anything other than a toy problem? I see some good example apps out there, so I would assume this is good enough for the real deal, but wanted to get some feedback. Any other success/failure notes would be great.
Feedback on using Google App Engine?
566,481
36
126
10,614
0
python,django,google-app-engine
I am using GAE to host several high-traffic applications. Like on the order of 50-100 req/sec. It is great, I can't recommend it enough. My previous experience with web development was with Ruby (Rails/Merb). Learning Python was easy. I didn't mess with Django or Pylons or any other framework, just started from the GAE examples and built what I needed out of the basic webapp libraries that are provided. If you're used to the flexibility of SQL the datastore can take some getting used to. Nothing too traumatic! The biggest adjustment is moving away from JOINs. You have to shed the idea that normalizing is crucial. Ben
0
1
0
0
2008-09-21T03:41:00.000
11
1
false
110,186
0
0
1
4
Looking to do a very small, quick 'n dirty side project. I like the fact that the Google App Engine is running on Python with Django built right in - gives me an excuse to try that platform... but my question is this: Has anyone made use of the app engine for anything other than a toy problem? I see some good example apps out there, so I would assume this is good enough for the real deal, but wanted to get some feedback. Any other success/failure notes would be great.
Feedback on using Google App Engine?
110,299
23
126
10,614
0
python,django,google-app-engine
One of the compelling reasons I have come across for using Google App Engine is its integration with Google Apps for your domain. Essentially it allows you to create custom, managed web applications that are restricted to the (controlled) logins of your domain. Most of my experience with this code was building a simple time/task tracking application. The template engine was simple and yet made a multi-page application very approachable. The login/user awareness api is similarly useful. I was able to make a public page/private page paradigm without too much issue. (a user would log in to see the private pages. An anonymous user was only shown the public page.) I was just getting into the datastore portion of the project when I got pulled away for "real work". I was able to accomplish a lot (it still is not done yet) in a very little amount of time. Since I had never used Python before, this was particularly pleasant (both because it was a new language for me, and also because the development was still fast despite the new language). I ran into very little that led me to believe that I wouldn't be able to accomplish my task. Instead I have a fairly positive impression of the functionality and features. That is my experience with it. Perhaps it doesn't represent more than an unfinished toy project, but it does represent an informed trial of the platform, and I hope that helps.
0
1
0
0
2008-09-21T03:41:00.000
11
1
false
110,186
0
0
1
4
Looking to do a very small, quick 'n dirty side project. I like the fact that the Google App Engine is running on Python with Django built right in - gives me an excuse to try that platform... but my question is this: Has anyone made use of the app engine for anything other than a toy problem? I see some good example apps out there, so I would assume this is good enough for the real deal, but wanted to get some feedback. Any other success/failure notes would be great.
Feedback on using Google App Engine?
110,225
12
126
10,614
0
python,django,google-app-engine
The "App Engine running Django" idea is a bit misleading. App Engine replaces the entire Django model layer so be prepared to spend some time getting acclimated with App Engine's datastore which requires a different way of modeling and thinking about data.
0
1
0
0
2008-09-21T03:41:00.000
11
1
false
110,186
0
0
1
4
Looking to do a very small, quick 'n dirty side project. I like the fact that the Google App Engine is running on Python with Django built right in - gives me an excuse to try that platform... but my question is this: Has anyone made use of the app engine for anything other than a toy problem? I see some good example apps out there, so I would assume this is good enough for the real deal, but wanted to get some feedback. Any other success/failure notes would be great.
How do you create an osx application/dmg from a python package?
116,901
7
25
16,311
0
python,macos,packaging
I don't know the correct way to do it, but this manual method is the approach I've used for simple scripts which seems to have preformed suitably. I'll assume that whatever directory I'm in, the Python files for my program are in the relative src/ directory, and that the file I want to execute (which has the proper shebang and execute permissions) is named main.py. $ mkdir -p MyApplication.app/Contents/MacOS $ mv src/* MyApplication.app/Contents/MacOS $ cd MyApplication.app/Contents/MacOS $ mv main.py MyApplication At this point we have an application bundle which, as far as I know, should work on any Mac OS system with Python installed (which I think it has by default). It doesn't have an icon or anything, that requires adding some more metadata to the package which is unnecessary for my purposes and I'm not familiar with. To create the drag-and-drop installer is quite simple. Use Disk Utility to create a New Disk Image of approximately the size you require to store your application. Open it up, copy your application and an alias of /Applications to the drive, then use View Options to position them as you want. The drag-and-drop message is just a background of the disk image, which you can also specify in View Options. I haven't done it before, but I'd assume that after you whip up an image in your editor of choice you could copy it over, set it as the background and then use chflags hidden to prevent it from cluttering up your nice window. I know these aren't the clearest, simplest or most detailed instructions out there, but I hope somebody may find them useful.
0
1
0
0
2008-09-22T18:35:00.000
1
1
false
116,657
1
0
0
1
I want to create a mac osx application from python package and then put it in a disk image. Because I load some resources out of the package, the package should not reside in a zip file. The resulting disk image should display the background picture to "drag here -> applications" for installation.
How do I uninstall python from OSX Leopard so that I can use the MacPorts version?
2,621,262
3
19
22,721
0
python,macos,osx-leopard,macports
The current Macports installer does the .profile PATH modification automatically.
0
1
0
0
2008-09-23T02:38:00.000
7
0.085505
false
118,813
1
0
0
3
I want to use the macports version of python instead of the one that comes with Leopard.
How do I uninstall python from OSX Leopard so that I can use the MacPorts version?
118,824
29
19
22,721
0
python,macos,osx-leopard,macports
Don't. Apple ships various system utilities that rely on the system Python (and particularly the Python "framework" build); removing it will cause you problems. Instead, modify your PATH environ variable in your ~/.bash_profile to put /opt/local/bin first.
0
1
0
0
2008-09-23T02:38:00.000
7
1
false
118,813
1
0
0
3
I want to use the macports version of python instead of the one that comes with Leopard.
How do I uninstall python from OSX Leopard so that I can use the MacPorts version?
118,821
4
19
22,721
0
python,macos,osx-leopard,macports
Instead of uninstalling the built-in Python, install the MacPorts version and then modify your $PATH to have the MacPorts version first. For example, if MacPorts installs /usr/local/bin/python, then modify your .bashrc to include PATH=/usr/local/bin:$PATH at the end.
0
1
0
0
2008-09-23T02:38:00.000
7
0.113791
false
118,813
1
0
0
3
I want to use the macports version of python instead of the one that comes with Leopard.
Python subprocess issue with ampersands
120,992
1
5
5,909
0
python,windows,subprocess,command-line-arguments
"escaping the ampersand with ^" Are you sure ^ is an escape character to Windows? Shouldn't you use \?
0
1
0
0
2008-09-23T12:28:00.000
6
0.033321
false
120,657
0
0
0
3
I'm currently having a major issue with a python script. The script runs arbitrary commands through a handler to convert incorrect error reporting into correct error reporting. The issue I'm having is getting the script to work correctly on windows with a command that contains ampersands in it's path. I've attempted quoting the command, escaping the ampersand with ^ and neither works. I'm now out of ideas. Any suggestions? To clarify from current responses: I am using the subprocess module I am passing the command line + arguments in as a list The issue is with the path to the command itself, not any of the arguments I've tried quoting the command. It causes a [Error 123] The filename, directory name, or volume label syntax is incorrect error I'm using no shell argument (so shell=false) In case it matters, I'm grabbing a pipe to stderr for processing it, but ignoring stdout and stdin It is only for use on Windows currently, and works as expected in all other cases that I've tested so far. The command that is failing is: p = subprocess.Popen(prog, stderr = subprocess.PIPE, bufsize=-1) when the first element of the list 'prog' contains any ampersands. Quoting this first string does not work.
Python subprocess issue with ampersands
120,782
0
5
5,909
0
python,windows,subprocess,command-line-arguments
To answer my own question: Quoting the actual command when passing the parameters as a list doesn't work correctly (command is first item of list) so to solve the issue I turned the list into a space separated string and passed that into subprocess instead. Better solutions still welcomed.
0
1
0
0
2008-09-23T12:28:00.000
6
0
false
120,657
0
0
0
3
I'm currently having a major issue with a python script. The script runs arbitrary commands through a handler to convert incorrect error reporting into correct error reporting. The issue I'm having is getting the script to work correctly on windows with a command that contains ampersands in it's path. I've attempted quoting the command, escaping the ampersand with ^ and neither works. I'm now out of ideas. Any suggestions? To clarify from current responses: I am using the subprocess module I am passing the command line + arguments in as a list The issue is with the path to the command itself, not any of the arguments I've tried quoting the command. It causes a [Error 123] The filename, directory name, or volume label syntax is incorrect error I'm using no shell argument (so shell=false) In case it matters, I'm grabbing a pipe to stderr for processing it, but ignoring stdout and stdin It is only for use on Windows currently, and works as expected in all other cases that I've tested so far. The command that is failing is: p = subprocess.Popen(prog, stderr = subprocess.PIPE, bufsize=-1) when the first element of the list 'prog' contains any ampersands. Quoting this first string does not work.
Python subprocess issue with ampersands
120,705
1
5
5,909
0
python,windows,subprocess,command-line-arguments
A proper answer will need more information than that. What are you actually doing? How does it fail? Are you using the subprocess module? Are you passing a list of arguments and shell=False (or no shell argument) or are you actually invoking the shell?
0
1
0
0
2008-09-23T12:28:00.000
6
0.033321
false
120,657
0
0
0
3
I'm currently having a major issue with a python script. The script runs arbitrary commands through a handler to convert incorrect error reporting into correct error reporting. The issue I'm having is getting the script to work correctly on windows with a command that contains ampersands in it's path. I've attempted quoting the command, escaping the ampersand with ^ and neither works. I'm now out of ideas. Any suggestions? To clarify from current responses: I am using the subprocess module I am passing the command line + arguments in as a list The issue is with the path to the command itself, not any of the arguments I've tried quoting the command. It causes a [Error 123] The filename, directory name, or volume label syntax is incorrect error I'm using no shell argument (so shell=false) In case it matters, I'm grabbing a pipe to stderr for processing it, but ignoring stdout and stdin It is only for use on Windows currently, and works as expected in all other cases that I've tested so far. The command that is failing is: p = subprocess.Popen(prog, stderr = subprocess.PIPE, bufsize=-1) when the first element of the list 'prog' contains any ampersands. Quoting this first string does not work.
Request UAC elevation from within a Python script?
22,821,704
2
113
126,138
0
python,windows,windows-vista,uac
You can make a shortcut somewhere and as the target use: python yourscript.py then under properties and advanced select run as administrator. When the user executes the shortcut it will ask them to elevate the application.
0
1
0
0
2008-09-25T00:22:00.000
11
0.036348
false
130,763
0
0
0
1
I want my Python script to copy files on Vista. When I run it from a normal cmd.exe window, no errors are generated, yet the files are NOT copied. If I run cmd.exe "as administator" and then run my script, it works fine. This makes sense since User Account Control (UAC) normally prevents many file system actions. Is there a way I can, from within a Python script, invoke a UAC elevation request (those dialogs that say something like "such and such app needs admin access, is this OK?") If that's not possible, is there a way my script can at least detect that it is not elevated so it can fail gracefully?
Is Google App Engine a worthy platform for a Lifestreaming app?
139,634
1
7
1,087
0
python,django,google-app-engine,web-applications
If you're app solely relies on Django, then App Engine is a good bet. However, if you ever need to add C-enhanced libraries, you're up a creek. App Engine doesn't support things like PIL or ReportLab, which use C to speed up processing times. I'm only mentioning this because you may want to use C to speed up some of your routines in the long run. If you decide to use a co-loc, check out WebFaction.com. They have great Django/Python support and they have no issue with you using the aforementioned lirbaries.
0
1
0
0
2008-09-25T18:46:00.000
7
0.028564
false
135,169
0
0
1
4
I'm building a Lifestreaming app that will involve pulling down lots of feeds for lots of users, and performing data-mining, and machine learning algorithms on the results. GAE's load balanced and scalable hosting sounds like a good fit for a system that could eventually be moving around a LOT of data, but it's lack of cron jobs is a nuisance. Would I be better off using Django on a co-loc and dealing with my own DB scaling?
Is Google App Engine a worthy platform for a Lifestreaming app?
135,223
0
7
1,087
0
python,django,google-app-engine,web-applications
Pulling feeds or doing calculations won't be a problem. But you'll soon have to pay for your account. App engine includes Django, except you'll need to work with some adaptors for the model part. It will surely save you from maintenance headaches.
0
1
0
0
2008-09-25T18:46:00.000
7
0
false
135,169
0
0
1
4
I'm building a Lifestreaming app that will involve pulling down lots of feeds for lots of users, and performing data-mining, and machine learning algorithms on the results. GAE's load balanced and scalable hosting sounds like a good fit for a system that could eventually be moving around a LOT of data, but it's lack of cron jobs is a nuisance. Would I be better off using Django on a co-loc and dealing with my own DB scaling?
Is Google App Engine a worthy platform for a Lifestreaming app?
135,201
0
7
1,087
0
python,django,google-app-engine,web-applications
No. If you need to pull lots of things down, App Engine isn't going to work so well. You can use it as a front end by putting your data in their store after doing your offline preprocessing, but you can't do much in the ~1 second time you have per request without doing some really crazy things. Your app would likely be better off on your own hosting.
0
1
0
0
2008-09-25T18:46:00.000
7
0
false
135,169
0
0
1
4
I'm building a Lifestreaming app that will involve pulling down lots of feeds for lots of users, and performing data-mining, and machine learning algorithms on the results. GAE's load balanced and scalable hosting sounds like a good fit for a system that could eventually be moving around a LOT of data, but it's lack of cron jobs is a nuisance. Would I be better off using Django on a co-loc and dealing with my own DB scaling?
Is Google App Engine a worthy platform for a Lifestreaming app?
135,199
3
7
1,087
0
python,django,google-app-engine,web-applications
It might change when they offer paid plans, but as it stands, App Engine is not good for CPU intensive apps. It is designed to scale to handle a large number of requests, not necessarily a large amount of calculation per request. I am running into this issue with fairly minor calculations, and I fear I may have to start looking elsewhere as my data set grows.
0
1
0
0
2008-09-25T18:46:00.000
7
0.085505
false
135,169
0
0
1
4
I'm building a Lifestreaming app that will involve pulling down lots of feeds for lots of users, and performing data-mining, and machine learning algorithms on the results. GAE's load balanced and scalable hosting sounds like a good fit for a system that could eventually be moving around a LOT of data, but it's lack of cron jobs is a nuisance. Would I be better off using Django on a co-loc and dealing with my own DB scaling?
Drag and drop onto Python script in Windows Explorer
21,840,490
2
59
59,279
0
python,windows,drag-and-drop,windows-explorer
Create a shortcut of the file. In case you don't have python open .py files by default, go into the properties of the shortcut and edit the target of the shortcut to include the python version you're using. For example: Target: C:\Python26\python.exe < shortcut target path> I'm posting this because I didn't want to edit the Registry and the .bat workaround didn't work for me.
0
1
0
0
2008-09-27T03:02:00.000
8
0.049958
false
142,844
0
0
0
3
I would like to drag and drop my data file onto a Python script and have it process the file and generate output. The Python script accepts the name of the data file as a command-line parameter, but Windows Explorer doesn't allow the script to be a drop target. Is there some kind of configuration that needs to be done somewhere for this work?
Drag and drop onto Python script in Windows Explorer
53,586,688
2
59
59,279
0
python,windows,drag-and-drop,windows-explorer
1). create shortcut of .py 2). right click -> properties 3). prefix "Target:" with "python" so it runs the .py as an argument into the python command or 1). create a .bat 2). python some.py %* these shortcut versions are simplest for me to do what i'm doing otherwise i'd convert it to a .exe, but would rather just use java or c/c++
0
1
0
0
2008-09-27T03:02:00.000
8
0.049958
false
142,844
0
0
0
3
I would like to drag and drop my data file onto a Python script and have it process the file and generate output. The Python script accepts the name of the data file as a command-line parameter, but Windows Explorer doesn't allow the script to be a drop target. Is there some kind of configuration that needs to be done somewhere for this work?
Drag and drop onto Python script in Windows Explorer
4,486,506
6
59
59,279
0
python,windows,drag-and-drop,windows-explorer
Try using py2exe. Use py2exe to convert your python script into a windows executable. You should then be able to drag and drop input files to your script in Windows Explorer. You should also be able to create a shortcut on your desktop and drop input files onto it. And if your python script can take a file list you should be able to drag and drop multiple files on your script (or shortcut).
0
1
0
0
2008-09-27T03:02:00.000
8
1
false
142,844
0
0
0
3
I would like to drag and drop my data file onto a Python script and have it process the file and generate output. The Python script accepts the name of the data file as a command-line parameter, but Windows Explorer doesn't allow the script to be a drop target. Is there some kind of configuration that needs to be done somewhere for this work?
OCSP libraries for python / java / c?
143,996
1
3
2,998
0
java,python,c,ocsp
Have you check pyOpenSSL.. am sure openssl supports ocsp and python binding may support it
0
1
0
0
2008-09-27T12:12:00.000
3
1.2
true
143,515
0
0
1
1
Going back to my previous question on OCSP, does anybody know of "reliable" OCSP libraries for Python, Java and C? I need "client" OCSP functionality, as I'll be checking the status of Certs against an OCSP responder, so responder functionality is not that important. Thanks
how to set a menubar icon on mac osx using wx
25,845,284
1
6
4,972
0
macos,wxpython,wxwidgets
As of wxPython 2.9.2.0 wx.TaskBarIcon will create a menubar icon now instead on OSX, so long as you call SetIcon.
1
1
0
0
2008-09-28T14:02:00.000
4
0.049958
false
145,894
0
0
0
1
I could not find any pointers on how to create a menubar icon on OSX using wx. I originally thought that the wxTaskBarIcon class would do, but it actually creates an icon on the Dock. On Windows, wxTaskBarIcon creates a Systray icon and associated menu, and I would think that on mac osx it would create a menubar icon, I guess not.
Debug Pylons application through Eclipse
147,768
10
11
5,139
0
python,eclipse,pylons,pydev,pyramid
Create a new launch configuration (Python Run) Main tab Use paster-script.py as main module (you can find it in the Scripts sub-directory in your python installation directory) Don't forget to add the root folder of your application in the PYTHONPATH zone Arguments Set the base directory to the root folder also. As Program Arguments use "serve development.ini" (or whatever you use to debug your app") Common Tab Check allocate console and launch in background
0
1
0
1
2008-09-29T05:41:00.000
7
1.2
true
147,650
0
0
1
4
I have Eclipse setup with PyDev and love being able to debug my scripts/apps. I've just started playing around with Pylons and was wondering if there is a way to start up the paster server through Eclipse so I can debug my webapp?
Debug Pylons application through Eclipse
3,817,880
2
11
5,139
0
python,eclipse,pylons,pydev,pyramid
I was able to get --reload working by changing the 'Working directory' in the arguments tab to not use default (i.e. select 'Other'->File System->'Root of your Pylons' app where development.ini is stored.
0
1
0
1
2008-09-29T05:41:00.000
7
0.057081
false
147,650
0
0
1
4
I have Eclipse setup with PyDev and love being able to debug my scripts/apps. I've just started playing around with Pylons and was wondering if there is a way to start up the paster server through Eclipse so I can debug my webapp?
Debug Pylons application through Eclipse
2,958,194
1
11
5,139
0
python,eclipse,pylons,pydev,pyramid
On linux that will probably be /usr/bin/paster or /usr/local/bin/paster for paste script, and for arguments i have: serve ${workspace_loc}${project_path}/development.ini
0
1
0
1
2008-09-29T05:41:00.000
7
0.028564
false
147,650
0
0
1
4
I have Eclipse setup with PyDev and love being able to debug my scripts/apps. I've just started playing around with Pylons and was wondering if there is a way to start up the paster server through Eclipse so I can debug my webapp?
Debug Pylons application through Eclipse
1,306,122
2
11
5,139
0
python,eclipse,pylons,pydev,pyramid
yanjost has it right, just wanted to add that you need to make sure you do not use the --reload option, this will prevent the debugger from properly attaching itself and cause your breakpoints not to work. Just a little thing I ran in to.
0
1
0
1
2008-09-29T05:41:00.000
7
0.057081
false
147,650
0
0
1
4
I have Eclipse setup with PyDev and love being able to debug my scripts/apps. I've just started playing around with Pylons and was wondering if there is a way to start up the paster server through Eclipse so I can debug my webapp?
Are there any other good alternatives to zc.buildout and/or virtualenv for installing non-python dependencies?
4,060,962
3
7
2,576
0
python,deployment,build-process
I always create a develop.py file at the top level of the project, and have also a packages directory with all of the .tar.gz files from PyPI that I want to install, and also included an unpacked copy of virtualenv that is ready to run right from that file. All of this goes into version control. Every developer can simply check out the trunk, run develop.py, and a few moments later will have a virtual environment ready to use that includes all of our dependencies at exactly the versions the other developers are using. And it works even if PyPI is down, which is very helpful at this point in that service's history.
0
1
0
0
2008-10-02T03:55:00.000
6
0.099668
false
160,834
0
0
1
4
I am a member of a team that is about to launch a beta of a python (Django specifically) based web site and accompanying suite of backend tools. The team itself has doubled in size from 2 to 4 over the past few weeks and we expect continued growth for the next couple of months at least. One issue that has started to plague us is getting everyone up to speed in terms of getting their development environment configured and having all the right eggs installed, etc. I'm looking for ways to simplify this process and make it less error prone. Both zc.buildout and virtualenv look like they would be good tools for addressing this problem but both seem to concentrate primarily on the python-specific issues. We have a couple of small subprojects in other languages (Java and Ruby specifically) as well as numerous python extensions that have to be compiled natively (lxml, MySQL drivers, etc). In fact, one of the biggest thorns in our side has been getting some of these extensions compiled against appropriate versions of the shared libraries so as to avoid segfaults, malloc errors and all sorts of similar issues. It doesn't help that out of 4 people we have 4 different development environments -- 1 leopard on ppc, 1 leopard on intel, 1 ubuntu and 1 windows. Ultimately what would be ideal would be something that works roughly like this, from the dos/unix prompt: $ git clone [repository url] ... $ python setup-env.py ... that then does what zc.buildout/virtualenv does (copy/symlink the python interpreter, provide a clean space to install eggs) then installs all required eggs, including installing any native shared library dependencies, installs the ruby project, the java project, etc. Obviously this would be useful for both getting development environments up as well as deploying on staging/production servers. Ideally I would like for the tool that accomplishes this to be written in/extensible via python, since that is (and always will be) the lingua franca of our team, but I am open to solutions in other languages. So, my question then is: does anyone have any suggestions for better alternatives or any experiences they can share using one of these solutions to handle larger/broader install bases?
Are there any other good alternatives to zc.buildout and/or virtualenv for installing non-python dependencies?
185,505
4
7
2,576
0
python,deployment,build-process
Setuptools may be capable of more of what you're looking for than you realize -- if you need a custom version of lxml to work correctly on MacOS X, for instance, you can put a URL to an appropriate egg inside your setup.py and have setuptools download and install that inside your developers' environments as necessary; it also can be told to download and install a specific version of a dependency from revision control. That said, I'd lean towards using a scriptably generated virtual environment. It's pretty straightforward to build a kickstart file which installs whichever packages you depend on and then boot virtual machines (or production hardware!) against it, with puppet or similar software doing other administration (adding users, setting up services [where's your database come from?], etc). This comes in particularly handy when your production environment includes multiple machines -- just script the generation of multiple VMs within their handy little sandboxed subnet (I use libvirt+kvm for this; while kvm isn't available on all the platforms you have developers working on, qemu certainly is, or you can do as I do and have a small number of beefy VM hosts shared by multiple developers). This gets you out of the headaches of supporting N platforms -- you only have a single virtual platform to support -- and means that your deployment process, as defined by the kickstart file and puppet code used for setup, is source-controlled and run through your QA and review processes just like everything else.
0
1
0
0
2008-10-02T03:55:00.000
6
0.132549
false
160,834
0
0
1
4
I am a member of a team that is about to launch a beta of a python (Django specifically) based web site and accompanying suite of backend tools. The team itself has doubled in size from 2 to 4 over the past few weeks and we expect continued growth for the next couple of months at least. One issue that has started to plague us is getting everyone up to speed in terms of getting their development environment configured and having all the right eggs installed, etc. I'm looking for ways to simplify this process and make it less error prone. Both zc.buildout and virtualenv look like they would be good tools for addressing this problem but both seem to concentrate primarily on the python-specific issues. We have a couple of small subprojects in other languages (Java and Ruby specifically) as well as numerous python extensions that have to be compiled natively (lxml, MySQL drivers, etc). In fact, one of the biggest thorns in our side has been getting some of these extensions compiled against appropriate versions of the shared libraries so as to avoid segfaults, malloc errors and all sorts of similar issues. It doesn't help that out of 4 people we have 4 different development environments -- 1 leopard on ppc, 1 leopard on intel, 1 ubuntu and 1 windows. Ultimately what would be ideal would be something that works roughly like this, from the dos/unix prompt: $ git clone [repository url] ... $ python setup-env.py ... that then does what zc.buildout/virtualenv does (copy/symlink the python interpreter, provide a clean space to install eggs) then installs all required eggs, including installing any native shared library dependencies, installs the ruby project, the java project, etc. Obviously this would be useful for both getting development environments up as well as deploying on staging/production servers. Ideally I would like for the tool that accomplishes this to be written in/extensible via python, since that is (and always will be) the lingua franca of our team, but I am open to solutions in other languages. So, my question then is: does anyone have any suggestions for better alternatives or any experiences they can share using one of these solutions to handle larger/broader install bases?
Are there any other good alternatives to zc.buildout and/or virtualenv for installing non-python dependencies?
177,109
0
7
2,576
0
python,deployment,build-process
You might consider creating virtual machine appliances with whatever production OS you are running, and all of the software dependencies pre-built. Code can be edited either remotely, or with a shared folder. It worked pretty well for me in a past life that had a fairly complicated development environment.
0
1
0
0
2008-10-02T03:55:00.000
6
0
false
160,834
0
0
1
4
I am a member of a team that is about to launch a beta of a python (Django specifically) based web site and accompanying suite of backend tools. The team itself has doubled in size from 2 to 4 over the past few weeks and we expect continued growth for the next couple of months at least. One issue that has started to plague us is getting everyone up to speed in terms of getting their development environment configured and having all the right eggs installed, etc. I'm looking for ways to simplify this process and make it less error prone. Both zc.buildout and virtualenv look like they would be good tools for addressing this problem but both seem to concentrate primarily on the python-specific issues. We have a couple of small subprojects in other languages (Java and Ruby specifically) as well as numerous python extensions that have to be compiled natively (lxml, MySQL drivers, etc). In fact, one of the biggest thorns in our side has been getting some of these extensions compiled against appropriate versions of the shared libraries so as to avoid segfaults, malloc errors and all sorts of similar issues. It doesn't help that out of 4 people we have 4 different development environments -- 1 leopard on ppc, 1 leopard on intel, 1 ubuntu and 1 windows. Ultimately what would be ideal would be something that works roughly like this, from the dos/unix prompt: $ git clone [repository url] ... $ python setup-env.py ... that then does what zc.buildout/virtualenv does (copy/symlink the python interpreter, provide a clean space to install eggs) then installs all required eggs, including installing any native shared library dependencies, installs the ruby project, the java project, etc. Obviously this would be useful for both getting development environments up as well as deploying on staging/production servers. Ideally I would like for the tool that accomplishes this to be written in/extensible via python, since that is (and always will be) the lingua franca of our team, but I am open to solutions in other languages. So, my question then is: does anyone have any suggestions for better alternatives or any experiences they can share using one of these solutions to handle larger/broader install bases?
Are there any other good alternatives to zc.buildout and/or virtualenv for installing non-python dependencies?
160,872
0
7
2,576
0
python,deployment,build-process
Basically, you're looking for a cross-platform software/package installer (on the lines of apt-get/yum/etc.) I'm not sure something like that exists? An alternative might be specifying the list of packages that need to be installed via the OS-specific package management system such as Fink or DarwinPorts for Mac OS X and having a script that sets up the build environment for the in-house code?
0
1
0
0
2008-10-02T03:55:00.000
6
0
false
160,834
0
0
1
4
I am a member of a team that is about to launch a beta of a python (Django specifically) based web site and accompanying suite of backend tools. The team itself has doubled in size from 2 to 4 over the past few weeks and we expect continued growth for the next couple of months at least. One issue that has started to plague us is getting everyone up to speed in terms of getting their development environment configured and having all the right eggs installed, etc. I'm looking for ways to simplify this process and make it less error prone. Both zc.buildout and virtualenv look like they would be good tools for addressing this problem but both seem to concentrate primarily on the python-specific issues. We have a couple of small subprojects in other languages (Java and Ruby specifically) as well as numerous python extensions that have to be compiled natively (lxml, MySQL drivers, etc). In fact, one of the biggest thorns in our side has been getting some of these extensions compiled against appropriate versions of the shared libraries so as to avoid segfaults, malloc errors and all sorts of similar issues. It doesn't help that out of 4 people we have 4 different development environments -- 1 leopard on ppc, 1 leopard on intel, 1 ubuntu and 1 windows. Ultimately what would be ideal would be something that works roughly like this, from the dos/unix prompt: $ git clone [repository url] ... $ python setup-env.py ... that then does what zc.buildout/virtualenv does (copy/symlink the python interpreter, provide a clean space to install eggs) then installs all required eggs, including installing any native shared library dependencies, installs the ruby project, the java project, etc. Obviously this would be useful for both getting development environments up as well as deploying on staging/production servers. Ideally I would like for the tool that accomplishes this to be written in/extensible via python, since that is (and always will be) the lingua franca of our team, but I am open to solutions in other languages. So, my question then is: does anyone have any suggestions for better alternatives or any experiences they can share using one of these solutions to handle larger/broader install bases?
Calling Python in PHP
167,205
7
85
180,160
0
php,python
I do this kind of thing all the time for quick-and-dirty scripts. It's quite common to have a CGI or PHP script that just uses system/popen to call some external program. Just be extra careful if your web server is open to the internet at large. Be sure to sanitize your GET/POST input in this case so as to not allow attackers to run arbitrary commands on your machine.
0
1
0
1
2008-10-03T13:44:00.000
9
1
false
166,944
0
0
0
2
I have a Python script I recently wrote that I call using the command line with some options. I now want a very thin web interface to call this script locally on my Mac. I don't want to go through the minor trouble of installing mod_python or mod_wsgi on my Mac, so I was just going to do a system() or popen() from PHP to call the Python script. Any better ideas? Thanks in advance!
Calling Python in PHP
45,592,623
0
85
180,160
0
php,python
Note that if you are using a virtual environment (as in shared hosting) then you must adjust your path to python, e.g: /home/user/mypython/bin/python ./cgi-bin/test.py
0
1
0
1
2008-10-03T13:44:00.000
9
0
false
166,944
0
0
0
2
I have a Python script I recently wrote that I call using the command line with some options. I now want a very thin web interface to call this script locally on my Mac. I don't want to go through the minor trouble of installing mod_python or mod_wsgi on my Mac, so I was just going to do a system() or popen() from PHP to call the Python script. Any better ideas? Thanks in advance!
UNIX shell written in a reasonable language?
171,271
5
9
3,377
0
python,unix,shell
Well, there's emacs, which is arguably a shell written in lisp :) Seriously though, are you looking for a reimplementation of an existing shell design in a different language such as Python? Or are you looking for a new implementation of a shell language that looks similar to your language of choice?
0
1
0
1
2008-10-05T00:42:00.000
7
0.141893
false
171,267
0
0
0
3
Has anyone ever heard of a UNIX shell written in a reasonable language, like Python?
UNIX shell written in a reasonable language?
171,304
6
9
3,377
0
python,unix,shell
From all appearances, Python IS a shell. It runs with #! and it can run interactively. Between the os and shutil packages you have all of the features of standard Unix shells. Since you can do anything in Python with simple, powerful scripts, you don't really need to spend any time messing with the other shells.
0
1
0
1
2008-10-05T00:42:00.000
7
1
false
171,267
0
0
0
3
Has anyone ever heard of a UNIX shell written in a reasonable language, like Python?
UNIX shell written in a reasonable language?
171,290
3
9
3,377
0
python,unix,shell
Tclsh is pretty nice (assuming you like Tcl, of course).
0
1
0
1
2008-10-05T00:42:00.000
7
0.085505
false
171,267
0
0
0
3
Has anyone ever heard of a UNIX shell written in a reasonable language, like Python?
How do you organize Python modules?
172,007
5
14
6,801
0
python,module
In addition to PEP8 and easy_install, you should check out virtualenv. Virtualenv allows you to have multiple different python library trees. At work, we use virtualenv with a bootstrapping environment to quickly set up a development/production environment where we are all in sync w.r.t library versions etc. We generally coordinate library upgrades.
0
1
0
0
2008-10-05T10:09:00.000
8
0.124353
false
171,785
1
0
0
2
When it comes to organizing python modules, my Mac OS X system is a mess. I've packages lying around everywhere on my hdd and no particular system to organize them. How do you keep everything manageable?
How do you organize Python modules?
172,538
5
14
6,801
0
python,module
There are several families of Python componentry. The stuff that comes with Python. This takes care of itself. The stuff that you got with easy_install. This, also, takes care of itself. The packages that you had to get some other way, either as TARballs or SVN checkouts. Create a Components folder. Put the downloads or the SVN's in there first. Every Single Time. Do installs from there. The packages that you wrote that are reusable. I have a Projects folder with each project in that folder. If the project is a highly reusable thing, it has a setup.py and I actually run the install as if I downloaded it. I don't have many of these, but a few. Some of them might become open source projects. The final applications you write. I have a folder in Projects with each of these top-level applications. These are usually big, rambling things (like Django sites) and don't have setup.py. Why? They're often pretty complex with only a few server installations to manage, and each of those server installations is unique. These generally rely on PYTHONPATH to identify their parts. Notice the common theme. Either they're Components you downloaded or they're Projects you're working on. Also, I keep this separate (to an extent) from the client. I have a master directory of Client folders, each of which has Projects and each project has Sales and Delivery. Not all projects have both sales and delivery.
0
1
0
0
2008-10-05T10:09:00.000
8
0.124353
false
171,785
1
0
0
2
When it comes to organizing python modules, my Mac OS X system is a mess. I've packages lying around everywhere on my hdd and no particular system to organize them. How do you keep everything manageable?
What is the best way to run multiple subprocesses via fork()?
174,989
1
10
12,429
0
python,linux
The traditional, UNIX-y way to communicate with sub-processes is to open pipes to their standard input/output, and use the select() system call to multiplex the communications in the parent process (available in Python via... the select module). If you need to kill a slow-running child process, you can just save its process ID (returned by the os.fork() call) and then use os.kill() to kill it when not needed anymore. Of course, it would probably be cleaner to be able to communicate with the child process explicitly and tell it to shut itself down.
0
1
0
0
2008-10-06T15:47:00.000
5
0.039979
false
174,853
1
0
0
1
A python script need to spawn multiple sub-processes via fork(). All of those child processes should run simultaneously and the parent process should be waiting for all of them to finish. Having an ability to set some timeout on a "slow" child would be nice. The parent process goes on processing the rest of the script after all kids are collected. What is the best way to work it out? Thanks.
How do I watch a file for changes?
182,234
-4
383
376,572
0
python,windows,file,pywin32,watch
I don't know any Windows specific function. You could try getting the MD5 hash of the file every second/minute/hour (depends on how fast you need it) and compare it to the last hash. When it differs you know the file has been changed and you read out the newest lines.
0
1
0
0
2008-10-08T11:12:00.000
28
-1
false
182,197
0
0
0
1
I have a log file being written by another process which I want to watch for changes. Each time a change occurs I'd like to read the new data in to do some processing on it. What's the best way to do this? I was hoping there'd be some sort of hook from the PyWin32 library. I've found the win32file.FindNextChangeNotification function but have no idea how to ask it to watch a specific file. If anyone's done anything like this I'd be really grateful to hear how... [Edit] I should have mentioned that I was after a solution that doesn't require polling. [Edit] Curses! It seems this doesn't work over a mapped network drive. I'm guessing windows doesn't 'hear' any updates to the file the way it does on a local disk.
Framework/Language for new web 2.0 sites (2008 and 2009)
188,971
7
2
959
0
python,ruby-on-rails,django,merb
All of them will get the job done. Use the one that you and your team are most familiar with This will have a far greater impact on the delivery times and stability of your app than any of the other variables.
0
1
0
1
2008-10-08T18:07:00.000
13
1
false
184,049
0
0
1
9
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
Framework/Language for new web 2.0 sites (2008 and 2009)
184,278
9
2
959
0
python,ruby-on-rails,django,merb
Sorry, but your question is wrong. People are probably going to vote me down for this one but I want to say it anyway: I wouldn't expect to get an objective answer! Why? That's simple: All Ruby advocates will tell to use Ruby. All Python advocates will tell to use Python. All PHP advocates will tell to use PHP. Insert additional languages here. Got the idea? I recommend you to try each of the languages you mentioned for yourself. At least a few days each. Afterwards you should have a much better foundation to make your final decision. That said, I would choose Ruby (because I am a Ruby advocate).
0
1
0
1
2008-10-08T18:07:00.000
13
1
false
184,049
0
0
1
9
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
Framework/Language for new web 2.0 sites (2008 and 2009)
189,236
1
2
959
0
python,ruby-on-rails,django,merb
Don't get stuck in the mindset of server-side page layout. Consider technologies like SproutCore, GWT or ExtJS which put the layouting code fully on the client, making the server responsible only for data marshalling and processing (and easily replaced). And you really, really need to know which server platform you want. Don't pick one because it's the flavor of the month, pick one because you're comfortable with it. Flavors don't last, a solidly built codebase will.
0
1
0
1
2008-10-08T18:07:00.000
13
0.015383
false
184,049
0
0
1
9
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
Framework/Language for new web 2.0 sites (2008 and 2009)
184,376
5
2
959
0
python,ruby-on-rails,django,merb
it depends. php - symfony is a great framework. downsides: php, wordy and directory heavy. propel gets annoying to use. upsides: php is everywhere and labor is cheap. well done framework, and good support. lots of plugins to make your life easier python - django is also a great framework. downsides: python programmers can be harder to find, django even harder. changing your db schema can be somewhat difficult since there are no official migrations. doesn't quite do mvc like you'd expect. upsides: does everything you need and has the great python std library and community behind it. ruby - i've never used merb, so I'll address rails. upsides: there is a plugin, gem, or recipe for almost anything you could want to do. easy to use. downsides: those plugins, gems, and recipes sometimes fail to work in mysterious ways. monkey patching is often evil. the community is.. vocal. opinionated software, and sometimes those opinions are wrong (lack of foreign keys). rails itself seems like a tower of cards waiting to explode and take hours of your life away. with all of that said, I'm a freelance php/symfony and ruby/rails developer. I've worked on several projects in both languages and frameworks. My latest project is in Rails solely because of ActiveMerchant. I've been looking for a reason to develop a django app for a while. If there were an ActiveMerchant like library for django, I probably would have used it.
0
1
0
1
2008-10-08T18:07:00.000
13
1.2
true
184,049
0
0
1
9
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
Framework/Language for new web 2.0 sites (2008 and 2009)
186,765
0
2
959
0
python,ruby-on-rails,django,merb
My experience with various new technologies over the last ten years leads me to recommend that you make stability of the platform a serious criterion. It's all well and good developing with the latest and greatest framework, but when you find it's moved forward a point version and suddenly the way you have done everything is deprecated, that can turn out to result in extra unnecessary work. This was particularly my experience working with rails a little ahead of version 1. For that reason alone I would avoid any platform that wasn't at least at 1.0 when you start work on it. Ruby is great to work with and will keep your developer productivity high, but if Django is the more stable platform I would favour that for sure.
0
1
0
1
2008-10-08T18:07:00.000
13
0
false
184,049
0
0
1
9
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
Framework/Language for new web 2.0 sites (2008 and 2009)
189,012
1
2
959
0
python,ruby-on-rails,django,merb
I have to preface this with my agreeing with Orion Edwards, choose the one your team is most familiar with. However, I also have to note the curious lack of ASP.NET languages in your list. Not to provoke the great zealot army, but where's the beef? .NET is a stable, rapid development platform and the labor pool is growing daily. VB.NET and C# are transportable skill sets, and that can mean a lot when you're building a team of developers to work on a diverse set of tasks. .NET also allows you to separate your presentation layer from your backend code, like other languages, but also allows you to expose that backend code as web service for things like your iPhone and Facebook applications. Take every suggestion with a grain of salt, and pick what suits the application best. Do your research, and design for function and not the zealots. Disclaimer: Once a PHP, ColdFusion and Perl developer. Flex zealot, and Adobe lover. Now writing enterprise .NET applications. ;) Don't forget Mono, which will let you run .NET under *nix. Not that I'm saying it will be perfect, just playing devil's advocate.
0
1
0
1
2008-10-08T18:07:00.000
13
0.015383
false
184,049
0
0
1
9
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
Framework/Language for new web 2.0 sites (2008 and 2009)
208,938
1
2
959
0
python,ruby-on-rails,django,merb
Having built apps in Django, I can attest to its utility. If only all frameworks were as elegant (yes Spring, I'm looking at you). However in terms of betting the farm on Django, one thing you need to factor in is that Python 3 will be released shortly. Python 3 is not backwards compatible and there's a risk that it will fork the language and end up slowing momentum for all Python projects while they deal with the fallout. To be fair, Ruby 2.0 is due soon too, but I don't think it will be as disruptive.
0
1
0
1
2008-10-08T18:07:00.000
13
0.015383
false
184,049
0
0
1
9
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
Framework/Language for new web 2.0 sites (2008 and 2009)
184,107
4
2
959
0
python,ruby-on-rails,django,merb
I would go with Django, if you are comfortable with a Python solution. It's at version 1.0 now, and is maturing nicely, with a large user base and many contributors. Integrating jQuery is no problem, and I've done it without any issues. The only thing is, as far as I can tell, Ruby is much more popular for web development nowadays, so it's easier to find Ruby developers. I get this impression from browsing recent job advertisements - there aren't that many for Python or Django. I don't know much about Merb, so I can't give a fair comparison. I've done enough PHP to not recommend starting a new project with it.
0
1
0
1
2008-10-08T18:07:00.000
13
0.061461
false
184,049
0
0
1
9
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
Framework/Language for new web 2.0 sites (2008 and 2009)
184,157
2
2
959
0
python,ruby-on-rails,django,merb
Based in your reasons, I would go with Ruby. I see that you want some administration tools (scp, ftp client) and Ruby has it (net/sftp and net/ftp libraries). Also, there are great gems like God for monitoring your system, Vlad the Deployer for deploying, etc. And a lot of alternatives in Merb's field, just use whatever you find it's better for your needs (Thin, Mongrel, ebb, etc).
0
1
0
1
2008-10-08T18:07:00.000
13
0.03076
false
184,049
0
0
1
9
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta code and such but by January, I'd like a site that doesn't have 'strange' problems. With that said, if a language is simply 10% slower than another, I don't care about those things as long as the issue is linear. My main concern is developer productivity. I'll be using Linux, Apache, MySQL for the application. I want the power to do things like run scp and ftp client functions with stable libraries (I only picked those two because they're not web-related but at the same time represent pretty common network protocols that any larger app might use). Technologies like OpenID and Oauth will be used as well. Experienced web developers are readily available (i.e. I don't have to find people from financial companies and such). Whatever the choice is is common and will be around for a while. Here's a kicker. I'd like to be able to use advanced presentation layer tools/languages similar to HAML, SASS. I definitively want to use JQuery. I will be creating a Facebook app and at some point doing things like dealing with SMS messages, iPhone apps, etc... At this point, the choices for language are PHP (Cake,Symfony,Zend), Python (Django), Ruby (Merb). I'm really between Django and Merb at this point mostly because everybody else seems to be going that way. Please don't put any technologies in here that aren't made for mainstream. I know Merb is untested mostly, but their stated goal is a solid platform and it has alot of momentum behind it so I'm confident that it's workable. Please don't answer with how great Perl is or .Net. For Future References - these choices were already made: Debian (Lenny) - For converting CPU cycles into something useful. Trac 0.11 - For Project Management Gliffy - For wireframes and such Google Docs/Apps - For documentation, hosted email, etc... Amazon ec2/S3 - For hosting, storage. Cheers, Adam
Read colors of image with Python (GAE)
190,958
0
1
1,703
0
python,google-app-engine,image,analysis
If you are willing to put Flash or a Java applet on the page, you might be able to do it on the client. I'm not sure if anything like canvas or SVG supports pixel-level manipulation, but if they do, you might be able to get it to work in some browsers with JavaScript. The Flash or Java Applet, can be invisible and optional -- you can use JavaScript to detect if the user has the plugin and only support this feature when they do.
0
1
0
0
2008-10-10T09:56:00.000
3
0
false
190,675
1
0
0
1
How can I read the colors of an image with python using google app engine? Example: I like to build a function to determine the most striking colors of an image to set a harmonic background color for it.
Configuring python
191,790
2
2
1,627
0
python,memory
Are you sure that the machine does not have a 128M process limit? If you are running the python script as a CGI inside a web server, it is quite likely that there is a process limit set - you will need to look at the web server configuration.
0
1
0
0
2008-10-10T14:52:00.000
2
0.197375
false
191,700
1
0
0
2
I am new to python and struggling to find how to control the amount of memory a python process can take? I am running python on a Cento OS machine with more than 2 GB of main memory size. Python is taking up only 128mb of this and I want to allocate it more. I tried to search all over the internet on this for last half an hour and found absolutely nothing! Why is it so difficult to find information on python related stuff :( I would be happy if someone could throw some light on how to configure python for various things like allowed memory size, number of threads etc. A link to a site where most controllable parameters of python are described would be appreciated well.
Configuring python
191,744
11
2
1,627
0
python,memory
Forget all that, python just allocates more memory as needed, there is not a myriad of comandline arguments for the VM as in java, just let it run. For all comandline switches you can just run python -h or read man python.
0
1
0
0
2008-10-10T14:52:00.000
2
1.2
true
191,700
1
0
0
2
I am new to python and struggling to find how to control the amount of memory a python process can take? I am running python on a Cento OS machine with more than 2 GB of main memory size. Python is taking up only 128mb of this and I want to allocate it more. I tried to search all over the internet on this for last half an hour and found absolutely nothing! Why is it so difficult to find information on python related stuff :( I would be happy if someone could throw some light on how to configure python for various things like allowed memory size, number of threads etc. A link to a site where most controllable parameters of python are described would be appreciated well.
Standalone Python applications in Linux
193,963
23
33
28,132
0
python,linux
Create a deb (for everything Debian-derived) and an rpm (for Fedora/SuSE). Add the right dependencies to the packaging and you can be reasonably sure that it will work.
0
1
0
0
2008-10-10T21:26:00.000
8
1
false
193,077
0
0
0
3
How can I distribute a standalone Python application in Linux? I think I can take for granted the presence of a recent Python interpreter in any modern distribution. The problem is dealing with those libraries that do not belong to the standard library, i.e. wxPython, scipy, python cryptographic toolkit, reportlab, and so on. Is there a working Linux counterpart to, say, py2exe (which, by the way, I have never tried)? Is there a free, opensource one?
Standalone Python applications in Linux
193,083
-9
33
28,132
0
python,linux
Nope. Python is notoriously flaky with respect to different setups. The only sane way to deploy a python app is to ship the whole bundle of interpreter and libraries that you are relying on with your code. That will most likely work. Update 2019: I stand by this. Virtualenv is a way of packaging libraries and interpreters together. Tox is a testing tool to test that interpreter/dependency matrix. Docker is a widely used way of then deploying the bundle.
0
1
0
0
2008-10-10T21:26:00.000
8
-1
false
193,077
0
0
0
3
How can I distribute a standalone Python application in Linux? I think I can take for granted the presence of a recent Python interpreter in any modern distribution. The problem is dealing with those libraries that do not belong to the standard library, i.e. wxPython, scipy, python cryptographic toolkit, reportlab, and so on. Is there a working Linux counterpart to, say, py2exe (which, by the way, I have never tried)? Is there a free, opensource one?
Standalone Python applications in Linux
193,101
7
33
28,132
0
python,linux
You can't easily do it in a distribution-neutral format. The only reliable dependency tracking mechanisms are built into the package management systems on the distributions and will vary from distribution to distribution. You'll effectively have to do rpm for fedora, debs for ubuntu and debian etc. Py2exe works fine on Windows. It builds a distribution with all of the necessary DLL's and a wrapper for the python interpreter that starts your program. It's fairly straightforward to install - just drop it in a directory - so making a msi file for it is trivial.
0
1
0
0
2008-10-10T21:26:00.000
8
1
false
193,077
0
0
0
3
How can I distribute a standalone Python application in Linux? I think I can take for granted the presence of a recent Python interpreter in any modern distribution. The problem is dealing with those libraries that do not belong to the standard library, i.e. wxPython, scipy, python cryptographic toolkit, reportlab, and so on. Is there a working Linux counterpart to, say, py2exe (which, by the way, I have never tried)? Is there a free, opensource one?
What is the best project structure for a Python application?
193,280
18
880
551,755
0
python,directory-structure,organization,project-structure
In my experience, it's just a matter of iteration. Put your data and code wherever you think they go. Chances are, you'll be wrong anyway. But once you get a better idea of exactly how things are going to shape up, you're in a much better position to make these kinds of guesses. As far as extension sources, we have a Code directory under trunk that contains a directory for python and a directory for various other languages. Personally, I'm more inclined to try putting any extension code into its own repository next time around. With that said, I go back to my initial point: don't make too big a deal out of it. Put it somewhere that seems to work for you. If you find something that doesn't work, it can (and should) be changed.
0
1
0
0
2008-10-10T21:50:00.000
8
1
false
193,161
1
0
0
3
Imagine that you want to develop a non-trivial end-user desktop (not web) application in Python. What is the best way to structure the project's folder hierarchy? Desirable features are ease of maintenance, IDE-friendliness, suitability for source control branching/merging, and easy generation of install packages. In particular: Where do you put the source? Where do you put application startup scripts? Where do you put the IDE project cruft? Where do you put the unit/acceptance tests? Where do you put non-Python data such as config files? Where do you put non-Python sources such as C++ for pyd/so binary extension modules?
What is the best project structure for a Python application?
193,181
470
880
551,755
0
python,directory-structure,organization,project-structure
Doesn't too much matter. Whatever makes you happy will work. There aren't a lot of silly rules because Python projects can be simple. /scripts or /bin for that kind of command-line interface stuff /tests for your tests /lib for your C-language libraries /doc for most documentation /apidoc for the Epydoc-generated API docs. And the top-level directory can contain README's, Config's and whatnot. The hard choice is whether or not to use a /src tree. Python doesn't have a distinction between /src, /lib, and /bin like Java or C has. Since a top-level /src directory is seen by some as meaningless, your top-level directory can be the top-level architecture of your application. /foo /bar /baz I recommend putting all of this under the "name-of-my-product" directory. So, if you're writing an application named quux, the directory that contains all this stuff is named /quux. Another project's PYTHONPATH, then, can include /path/to/quux/foo to reuse the QUUX.foo module. In my case, since I use Komodo Edit, my IDE cuft is a single .KPF file. I actually put that in the top-level /quux directory, and omit adding it to SVN.
0
1
0
0
2008-10-10T21:50:00.000
8
1.2
true
193,161
1
0
0
3
Imagine that you want to develop a non-trivial end-user desktop (not web) application in Python. What is the best way to structure the project's folder hierarchy? Desirable features are ease of maintenance, IDE-friendliness, suitability for source control branching/merging, and easy generation of install packages. In particular: Where do you put the source? Where do you put application startup scripts? Where do you put the IDE project cruft? Where do you put the unit/acceptance tests? Where do you put non-Python data such as config files? Where do you put non-Python sources such as C++ for pyd/so binary extension modules?
What is the best project structure for a Python application?
193,256
13
880
551,755
0
python,directory-structure,organization,project-structure
Non-python data is best bundled inside your Python modules using the package_data support in setuptools. One thing I strongly recommend is using namespace packages to create shared namespaces which multiple projects can use -- much like the Java convention of putting packages in com.yourcompany.yourproject (and being able to have a shared com.yourcompany.utils namespace). Re branching and merging, if you use a good enough source control system it will handle merges even through renames; Bazaar is particularly good at this. Contrary to some other answers here, I'm +1 on having a src directory top-level (with doc and test directories alongside). Specific conventions for documentation directory trees will vary depending on what you're using; Sphinx, for instance, has its own conventions which its quickstart tool supports. Please, please leverage setuptools and pkg_resources; this makes it much easier for other projects to rely on specific versions of your code (and for multiple versions to be simultaneously installed with different non-code files, if you're using package_data).
0
1
0
0
2008-10-10T21:50:00.000
8
1
false
193,161
1
0
0
3
Imagine that you want to develop a non-trivial end-user desktop (not web) application in Python. What is the best way to structure the project's folder hierarchy? Desirable features are ease of maintenance, IDE-friendliness, suitability for source control branching/merging, and easy generation of install packages. In particular: Where do you put the source? Where do you put application startup scripts? Where do you put the IDE project cruft? Where do you put the unit/acceptance tests? Where do you put non-Python data such as config files? Where do you put non-Python sources such as C++ for pyd/so binary extension modules?
Ruby to Python bridge
4,859,776
1
8
2,499
0
python,ruby,interop
Expose your Ruby classes as web services using Sinatra, Rails, or, plain old Rack. Expose your Python classes as web services using web.py, flask, Django, or App Engine. Use HTTParty for Ruby to build an API into your Python classes. Use a Python REST library to build an API into your Ruby classes.
0
1
0
1
2008-10-15T22:49:00.000
5
0.039979
false
206,823
0
0
0
2
I am interested in getting some Python code talking to some Ruby code on Windows, Linux and possibly other platforms. Specificlly I would like to access classes in Ruby from Python and call their methods, access their data, create new instances and so on. An obvious way to do this is via something like XML-RPC or maybe CORBA but I would be interested in any other approaches. What have other people done to get code from Python and Ruby communicating with one another, either locally on the same system or remotely accross a network? Thanks in advance.
Ruby to Python bridge
206,839
3
8
2,499
0
python,ruby,interop
Please be advised that I don't speak from personal experience here, but I imagine JRuby and Jython (The ruby and python implementations in the JVM) would be able to to easily talk to each other, as well as Java code. You may want to look into that.
0
1
0
1
2008-10-15T22:49:00.000
5
0.119427
false
206,823
0
0
0
2
I am interested in getting some Python code talking to some Ruby code on Windows, Linux and possibly other platforms. Specificlly I would like to access classes in Ruby from Python and call their methods, access their data, create new instances and so on. An obvious way to do this is via something like XML-RPC or maybe CORBA but I would be interested in any other approaches. What have other people done to get code from Python and Ruby communicating with one another, either locally on the same system or remotely accross a network? Thanks in advance.