Available Count
int64
1
31
AnswerCount
int64
1
35
GUI and Desktop Applications
int64
0
1
Users Score
int64
-17
588
Q_Score
int64
0
6.79k
Python Basics and Environment
int64
0
1
Score
float64
-1
1.2
Networking and APIs
int64
0
1
Question
stringlengths
15
7.24k
Database and SQL
int64
0
1
Tags
stringlengths
6
76
CreationDate
stringlengths
23
23
System Administration and DevOps
int64
0
1
Q_Id
int64
469
38.2M
Answer
stringlengths
15
7k
Data Science and Machine Learning
int64
0
1
ViewCount
int64
13
1.88M
is_accepted
bool
2 classes
Web Development
int64
0
1
Other
int64
1
1
Title
stringlengths
15
142
A_Id
int64
518
72.2M
1
1
0
1
0
0
0.197375
0
I've written a python script which does some curses and pysqlite stuff, but I've noticed that in occasions where I've been running this script over ssh when that ssh session is killed for whatever reason the python script doesn't actually exit, instead it ends up as being a child of init and just stays there forever. I can't kill -9 them or anything. They also increase the reported system load by 1. Currently I have 8 of these mostly dead processes hanging around, and the server has a load average of 8.abit. I take it this is because there is some sort of resource that these scripts are waiting on, but lsof shows nothing actually open by them, all data files they were using are listed as deleted etc... and they are using no cpu time whatsoever. I'm doing some signal checking in the script, calling out to do some refresh routines on a HUP, but nothing else, not forking or anything and I'm at a loss as to why the scripts are not just shuffling off when I close my ssh session. Thanks Chris
0
python,ssh,exit,signals
2010-07-06T09:20:00.000
1
3,184,974
Well, the reason they're not shutting down when your ssh session terminates is because HUP is the signal used by a parent to inform its children that they should shut down. If you're overriding the behavior of this signal, then your processes will not automatically shut down when the SSH session is closed. As for why you cannot kill -9 them, however, I'm at a loss. The only thing I've seen that causes that behavior is processes blocked on misbehaving filesystems (nfs & unionfs being the two I've encountered the problem with).
0
281
false
0
1
Python scripts (curses + pysqlite) hanging after parent shell goes away
3,186,685
4
6
0
3
13
0
0.099668
1
Is it possible to write a firewall in python? Say it would block all traffic?
0
python,firewall
2010-07-06T18:34:00.000
0
3,189,138
I'm sure it's probably possible, but ill-advised. As mcandre mentions, most OSes couple the low level networking capabilities you need for a firewall tightly into the kernel and thus this task is usually done in C/C++ and integrates tightly with the kernel. The microkernel OSes (Mach et al) might be more amenable than linux. You may be able to mix some python and C, but I think the more interesting discussion here is going to be around "why should I"/"why shouldn't I" implement a firewall in python as opposed to just is it technically possible.
0
31,230
false
0
1
Is it possible to write a firewall in python?
3,189,187
4
6
0
2
13
0
0.066568
1
Is it possible to write a firewall in python? Say it would block all traffic?
0
python,firewall
2010-07-06T18:34:00.000
0
3,189,138
"Yes" - that's usually the answer to "is it possible...?" questions. How difficult and specific implementations are something else entirely. I suppose technically in a don't do this sort of way, if you were hell-bent on making a quick firewall in Python, you could use the socket libraries and open connections to and from yourself on every port. I have no clue how effective that would be, though it seems like it wouldn't be. Of course, if you're simply interested in rolling your own, and doing this as a learning experience, then cool, you have a long road ahead of you and plenty of education. OTOH, if you're actually worried about network security there are tons of other products out there that you can use, from iptables on *nix, to ZoneAlarm on windows. Plenty of them are both free and secure so there's really no reason to roll your own except on an "I want to learn" basis.
0
31,230
false
0
1
Is it possible to write a firewall in python?
3,189,232
4
6
0
4
13
0
0.132549
1
Is it possible to write a firewall in python? Say it would block all traffic?
0
python,firewall
2010-07-06T18:34:00.000
0
3,189,138
I'm sure in theory you could achieve what you want, but I believe in practice your idea is not doable (if you wonder why, it's because it's too hard to "interface" a high level language with the low level kernel). What you could do instead is some Python tool that controls the firewall of the operating system so you could add rules, delete , etc. (in a similar way to what iptables does in Linux).
0
31,230
false
0
1
Is it possible to write a firewall in python?
3,189,540
4
6
0
3
13
0
0.099668
1
Is it possible to write a firewall in python? Say it would block all traffic?
0
python,firewall
2010-07-06T18:34:00.000
0
3,189,138
Interesting thread. I stumbled on it looking for Python NFQUEUE examples. My take is you could create a great firewall in python and use the kernel. E.g. Add a linux fw rule through IP tables that forward sys packets (the first) to NFQUEUE for python FW to decide what to do. If you like it mark the tcp stream/flow with a FW mark using NFQUEUE and then have an iptables rule that just allows all traffic streams with the mark. This way you can have a powerful high-level python program deciding to allow or deny traffic, and the speed of the kernel to forward all other packets in the same flow.
0
31,230
false
0
1
Is it possible to write a firewall in python?
15,045,900
3
3
1
0
1
0
0
0
Are there any downsides in Python to using a library that is just a binding to a C library? Does that hurt the portability of your application? Anything else I should look out for?
0
python
2010-07-06T20:35:00.000
0
3,190,013
Portability is one thing. There are even differences between python 2.x and 3.x that can make things difficult with C extensions, if the writer didn't update them. Another thing is that pure python code gives you a bit more possibilities to read, understand and even modify (although it is usually a bad sign if you need to do that for other peoples modules)
0
146
false
0
1
What are the pros and cons in Python of using a c library vs a native python one
3,190,568
3
3
1
4
1
0
0.26052
0
Are there any downsides in Python to using a library that is just a binding to a C library? Does that hurt the portability of your application? Anything else I should look out for?
0
python
2010-07-06T20:35:00.000
0
3,190,013
C library is likely to have better performance, but needs to be recompiled for each platform. You can't use C libraries on Google App Engine
0
146
false
0
1
What are the pros and cons in Python of using a c library vs a native python one
3,190,053
3
3
1
4
1
0
1.2
0
Are there any downsides in Python to using a library that is just a binding to a C library? Does that hurt the portability of your application? Anything else I should look out for?
0
python
2010-07-06T20:35:00.000
0
3,190,013
Of course using a C library hurts portability. It also prohibites you (in general) to use Jython or IronPython. I would only use a C library if I had no other option. This could happen if direct access to hardware is necessary or if special efficiency requirements apply.
0
146
true
0
1
What are the pros and cons in Python of using a c library vs a native python one
3,190,035
3
7
0
13
7
1
1
0
I am looking for a good scripting language to link to my program. I am looking for 2 important attributes: Scripting language should be hard linked into the executable (not requiring 3rd party installations). This is important to me to simplify distribution. Scripting should allow some run-time debugging option (When running a script inside my program I would like to easily run it inside a debugger while it is running in the context of my program) Can python,lua or some other language supply me with this?
0
python,programming-languages,scripting,lua,dynamic-languages
2010-07-07T08:18:00.000
1
3,193,012
Both Lua and Python can provide the features you mention, so choosing one of them will depend on other criteria. Lua is a lighter weight solution, it will have a much smaller disk footprint and likely a smaller memory overhead than Python too. For some uses it may be faster. Python has a much richer standard library, more mature third party libraries and a more expressive language. Both have been embedded into major applications. Python can be found in Blender, OpenOffice and Civilization 4. Lua can be found in World of Warcraft and Adobe Lightroom. I'd recommend looking at a few tutorials for each and the facilities available to embed them in your application and just choose the one that fits your brain best.
0
932
false
0
1
Scripting Languages
3,193,910
3
7
0
0
7
1
0
0
I am looking for a good scripting language to link to my program. I am looking for 2 important attributes: Scripting language should be hard linked into the executable (not requiring 3rd party installations). This is important to me to simplify distribution. Scripting should allow some run-time debugging option (When running a script inside my program I would like to easily run it inside a debugger while it is running in the context of my program) Can python,lua or some other language supply me with this?
0
python,programming-languages,scripting,lua,dynamic-languages
2010-07-07T08:18:00.000
1
3,193,012
I'll add Tcl to the mix. It's designed to be easily embedded into other programs.
0
932
false
0
1
Scripting Languages
3,217,793
3
7
0
1
7
1
0.028564
0
I am looking for a good scripting language to link to my program. I am looking for 2 important attributes: Scripting language should be hard linked into the executable (not requiring 3rd party installations). This is important to me to simplify distribution. Scripting should allow some run-time debugging option (When running a script inside my program I would like to easily run it inside a debugger while it is running in the context of my program) Can python,lua or some other language supply me with this?
0
python,programming-languages,scripting,lua,dynamic-languages
2010-07-07T08:18:00.000
1
3,193,012
I really like Lua for embedding, but just as another alternative, JavaScript is easily embeddable in C, C++ (SpiderMonkey and V8) and Java (Rhino) programs.
0
932
false
0
1
Scripting Languages
3,195,618
2
3
0
2
0
0
1.2
0
I know Python apps are faster to write, but it seems Java is the 800 lb gorilla for mobile and GUI development. Are there any mobile platforms that run Python, or should I go the Java route?
0
java,python,user-interface,mobile
2010-07-07T20:45:00.000
0
3,198,646
Java is certainly available on more platforms. I would pick a target platform (or set of targets) and see what language(s) would require the least number of redundant implementations. Also, when you get to a certain level of complexity, the language often doesn't factor into speed. For initial prototypes, sure some languages are lightning fast to develop in, but by the time you've taken care of all the exception cases and tripled the entire schedule due to QA, you'll find that the prototype development speed wasn't all that big a deal. Of course, depending on the complexity of your app, this may prove to be untrue--a small simple app can be delivered in near "prototype time".
0
5,062
true
1
1
Python or Java? Whats better for mobile development, and GUI applications
3,198,745
2
3
0
0
0
0
0
0
I know Python apps are faster to write, but it seems Java is the 800 lb gorilla for mobile and GUI development. Are there any mobile platforms that run Python, or should I go the Java route?
0
java,python,user-interface,mobile
2010-07-07T20:45:00.000
0
3,198,646
The first question is whether you really need to develop an app, which requires per-platform work, vs a webapp. If you really need an app, then you might likely need a separate language for each platform! For Android you'd want to use Java, and for iPhone/iPad you'd want to use Objective-C. A good argument for really trying to go the webapp route.
0
5,062
false
1
1
Python or Java? Whats better for mobile development, and GUI applications
3,199,234
1
2
0
0
2
0
0
0
I am trying to create an automated program in Python that deals with Flash. Right now I am using Python Mechanize, which is great for filling forms, but when it comes to flash I don't know what to do. Does anyone know how I can interact with flash forms (set and get variables, click buttons, etc.) via Python mechanize or some other python library?
0
python,flash,forms,mechanize,code-injection
2010-07-09T17:26:00.000
0
3,215,062
Nice question but seems unfortunately mechanize can't be used for flash objects
0
1,702
false
1
1
Interact with Flash using Python Mechanize
3,849,851
4
7
0
0
5
1
0
0
Assuming that x is an integer, the construct if x: is functionally the same as if x != 0: in Python. Some languages' style guides explicitly forbid against the former -- for example, ActionScript/Flex's style guide states that you should never implicitly cast an int to bool for this sort of thing. Does Python have a preference? A link to a PEP or other authoritative source would be best.
0
python,coding-style,conditional
2010-07-09T21:28:00.000
0
3,216,681
Might I suggest that the amount of bickering over this question is enough to answer it? Some argue that it "if x" should only be used for Z, others for Y, others for X. If such a simple statement is able to create such a fuss, to me it is clear that the statement is not clear enough. Write what you mean. If you want to check that x is equal to 0, then write "if x == 0". If you want to check if x exists, write "if x is not None". Then there is no confusion, no arguing, no debate.
0
6,685
false
0
1
Which of `if x:` or `if x != 0:` is preferred in Python?
3,232,563
4
7
0
3
5
1
0.085505
0
Assuming that x is an integer, the construct if x: is functionally the same as if x != 0: in Python. Some languages' style guides explicitly forbid against the former -- for example, ActionScript/Flex's style guide states that you should never implicitly cast an int to bool for this sort of thing. Does Python have a preference? A link to a PEP or other authoritative source would be best.
0
python,coding-style,conditional
2010-07-09T21:28:00.000
0
3,216,681
There's no hard and fast rule here. Here are some examples where I would use each: Suppose that I'm interfacing to some function that returns -1 on error and 0 on success. Such functions are pretty common in C, and they crop up in Python frequently when using a library that wraps C functions. In that case, I'd use if x:. On the other hand, if I'm about to divide by x and I want to make sure that x isn't 0, then I'm going to be explicit and write if x != 0. As a rough rule of thumb, if I treat x as a bool throughout a function, then I'm likely to use if x: -- even if I can prove that x will be an int. If in the future I decide I want to pass a bool (or some other type!) to the function, I wouldn't need to modify it. On the other hand, if I'm genuinely using x like an int, then I'm likely to spell out the 0.
0
6,685
false
0
1
Which of `if x:` or `if x != 0:` is preferred in Python?
3,216,964
4
7
0
-2
5
1
-0.057081
0
Assuming that x is an integer, the construct if x: is functionally the same as if x != 0: in Python. Some languages' style guides explicitly forbid against the former -- for example, ActionScript/Flex's style guide states that you should never implicitly cast an int to bool for this sort of thing. Does Python have a preference? A link to a PEP or other authoritative source would be best.
0
python,coding-style,conditional
2010-07-09T21:28:00.000
0
3,216,681
Wouldn't if x is not 0: be the preferred method in Python, compared to if x != 0:? Yes, the former is a bit longer to write, but I was under the impression that is and is not are preferred over == and !=. This makes Python easier to read as a natural language than as a programming language.
0
6,685
false
0
1
Which of `if x:` or `if x != 0:` is preferred in Python?
3,216,911
4
7
0
2
5
1
0.057081
0
Assuming that x is an integer, the construct if x: is functionally the same as if x != 0: in Python. Some languages' style guides explicitly forbid against the former -- for example, ActionScript/Flex's style guide states that you should never implicitly cast an int to bool for this sort of thing. Does Python have a preference? A link to a PEP or other authoritative source would be best.
0
python,coding-style,conditional
2010-07-09T21:28:00.000
0
3,216,681
Typically, I read: if(x) to be a question about existence. if( x != 0) to be a question about a number.
0
6,685
false
0
1
Which of `if x:` or `if x != 0:` is preferred in Python?
3,216,691
1
8
0
2
43
1
0.049958
0
Well just getting into the flow of thing with Python. Reading a few books, finding it fairly easy as I already have some experience with C++/Java from school and Python is definetly my favorite thus far. Anyway, I am getting a whole bunch of information on python, but haven't been putting it to much use. Thus, what I was wondering was if there are any sort of practice problems online that I can use? If anyone could point me in any sort of direction, I'd greatly appreciate it.
0
python
2010-07-10T00:00:00.000
0
3,217,222
I found python in 1988 and fell in love with it. Our group at work had been dissolved and we were looking for other jobs on site, so I had a couple of months to play around doing whatever I wanted to. I spent the time profitably learning and using python. I suggest you spend time thinking up and writing utilities and various useful tools. I've got 200-300 in my python tools library now (can't even remember them all). I learned python from Guido's tutorial, which is a good place to start (a C programmer will feel right at home). python is also a great tool for making models -- physical, math, stochastic, etc. Use numpy and scipy. It also wouldn't hurt to learn some GUI stuff -- I picked up wxPython and learned it, as I had some experience using wxWidgets in C++. wxPython has some impressive demo stuff!
0
142,555
false
0
1
Beginner Python Practice?
3,217,317
1
1
0
1
0
1
1.2
0
Lets say I am designing a tool foobuzzle (foobuzzle's exact job is to set up SRPM files for cross-compiling a variety of codes into their own compartmentalized prefix directories, but this is not important). I would like foobuzzle to take in an input file (buzzle_input) specified by an (intelligent, code-savvy) client, who will tell foobuzzle how they would like it to perform these operations. I am writing foobuzzle in Python, and it seems to make sense for the user to provide buzzle_input configuration information in either Python or bash. Which would you choose? How would you implement it? I am expecting that Python will need some global environment variables that may need to be set up by executing some other scripts, probably from within the buzzle_input script. This is not production code, just an internal tool a small team of developers will be using to help manage a fairly large cross-compiled environment of C/C++/FORTRAN codes. My best guess is to use something to wrap the foobuzzle script so that the $PYTHONPATH variable picks up the current working directory, and to have the foobuzzle_input script imported and executed as set up. Is there a cleaner way to do this without wrapping foobuzzle? Any special considerations for executing the bash scripts (assume safety is not really a concern and that these scripts will not be run with system administrator privileges).
0
python,bash
2010-07-10T09:10:00.000
1
3,218,599
My interpretation of your context, is that you have a Python script that performs various make- or autoconf-like operations, and you want to allow clients to write their own Makefiles for Foobuzzle. The problem with directories I don't understand. import will always search the local directory? And you can os.chdir() when you hop around to change current working directory, like make does. Having it as a bash script has the pro that nobody needs to learn Python or, specifically, the Python-like Foobuzzle DSL. But it is a lot less powerful: you're basically limited to sending and receiving text only. You can't write support functions that the bash code can call (unless you generate that into bash as well), proper error handling might be tough, etc. Depending on how powerful the configuration needs to be, I would use Python. I'd probably load the file itself and use eval() on it, giving me full control over its namespace. I could pass various utility and helper functions, for example, or provide objects they can manipulate directly. If it's really simple though, specifying flags and names, that sort of thing, then you could just have it as .ini files and use ConfigParser() in the standard library.
0
276
true
0
1
How do I execute Python/bash code in the current directory as part of a code?
3,218,680
6
7
0
0
5
0
0
0
Friends, I've got some exp in c++ and now kind of starting my way to J2EE (to survive:))). Meanwhile, I've got a plan to venture in to a web portal my own. But with very little experience in web technology, I'd need to start from scratch. I'm little confused on which way to go and I'm here. PHP, Python or JSP, considering the fact that, anyway I've got to learn J2EE at my work. Would that be worth to learn PHP or Python to develop a portal which I expect to get 80-100K hits per day "IF" everything goes well OR jsp would be sufficient? Many thanks
0
php,python,jsp
2010-07-11T15:28:00.000
0
3,223,557
I expect this question to be closed as being subjective. But, I'll put in my 2 cents. JSP would likely dovetail well with J2EE. (I've heard that it can be a bit rigid, but I have no experience to provide any insight on the matter.) PHP is a good candidate, because it's popular. You can find a lot of info on the web. Python isn't as popular for webdev, so finding examples won't be as easy. I also second Dave Markle's opinion. If you want to learn webdev, HTML, CSS and JavaScript will be crucial as well. You may never want to be a front-end developer, but you can't get away from dealing with those technologies at some point.
0
1,073
false
1
1
Which web technology to learn for an experienced C++ developer?
3,223,599
6
7
0
1
5
0
0.028564
0
Friends, I've got some exp in c++ and now kind of starting my way to J2EE (to survive:))). Meanwhile, I've got a plan to venture in to a web portal my own. But with very little experience in web technology, I'd need to start from scratch. I'm little confused on which way to go and I'm here. PHP, Python or JSP, considering the fact that, anyway I've got to learn J2EE at my work. Would that be worth to learn PHP or Python to develop a portal which I expect to get 80-100K hits per day "IF" everything goes well OR jsp would be sufficient? Many thanks
0
php,python,jsp
2010-07-11T15:28:00.000
0
3,223,557
Hit's per day isn't a really useful metric for estimating performance. You really need to be concerned with the peak load and the acceptable response time. 80-100k hits per day is an average of about 1 hit per second. The hits are not going to be evenly spread out, so for normal traffic you might expect a peak load of 10 hits per second. If you are going to promote the site with newsletters or commercials, expect to peack at 100's of hits per second. If you selling $1 air tickets, expect to peak at 1000's of hits per second. Now the language you choose for the site isn't nearly as important as your choice of database (not necessarily relational) and the way you store the data in the database. Scaling up frontends is relatively easy, so having really fast efficient HTML generation shouldn't be a primary concern. Pick a platform that is going to be efficient for development time.
0
1,073
false
1
1
Which web technology to learn for an experienced C++ developer?
3,225,166
6
7
0
1
5
0
0.028564
0
Friends, I've got some exp in c++ and now kind of starting my way to J2EE (to survive:))). Meanwhile, I've got a plan to venture in to a web portal my own. But with very little experience in web technology, I'd need to start from scratch. I'm little confused on which way to go and I'm here. PHP, Python or JSP, considering the fact that, anyway I've got to learn J2EE at my work. Would that be worth to learn PHP or Python to develop a portal which I expect to get 80-100K hits per day "IF" everything goes well OR jsp would be sufficient? Many thanks
0
php,python,jsp
2010-07-11T15:28:00.000
0
3,223,557
Considering you're used to c++, should look at aspx and c# - probably closer to your current experience. That said, PHP is a doddle, so it shouldn't present any challenges. Bear in mind that if you want to get the most from the language, you absolutely have to learn a little bit about configuring apache, and frameworks (cake, codeigniter, zend etc).
0
1,073
false
1
1
Which web technology to learn for an experienced C++ developer?
3,223,588
6
7
0
13
5
0
1.2
0
Friends, I've got some exp in c++ and now kind of starting my way to J2EE (to survive:))). Meanwhile, I've got a plan to venture in to a web portal my own. But with very little experience in web technology, I'd need to start from scratch. I'm little confused on which way to go and I'm here. PHP, Python or JSP, considering the fact that, anyway I've got to learn J2EE at my work. Would that be worth to learn PHP or Python to develop a portal which I expect to get 80-100K hits per day "IF" everything goes well OR jsp would be sufficient? Many thanks
0
php,python,jsp
2010-07-11T15:28:00.000
0
3,223,557
Before learning either of these, spend some real time and learn HTML and CSS in depth. Also learn Javascript and JQuery (or your favorite client side library). The O'Reilly books on the topic are pretty much all good IMO. I say that because I think that you'll find that for most modern web sites, a lot of richness is moving to the client side, and away from the server side. Under this model, your code in PHP or JSP is probably going to look pretty similar (ie, fetch data from the database and serve it to your view or into JSON for the client to consume).
0
1,073
true
1
1
Which web technology to learn for an experienced C++ developer?
3,223,581
6
7
0
0
5
0
0
0
Friends, I've got some exp in c++ and now kind of starting my way to J2EE (to survive:))). Meanwhile, I've got a plan to venture in to a web portal my own. But with very little experience in web technology, I'd need to start from scratch. I'm little confused on which way to go and I'm here. PHP, Python or JSP, considering the fact that, anyway I've got to learn J2EE at my work. Would that be worth to learn PHP or Python to develop a portal which I expect to get 80-100K hits per day "IF" everything goes well OR jsp would be sufficient? Many thanks
0
php,python,jsp
2010-07-11T15:28:00.000
0
3,223,557
There are many options. Since you already know (and is learning about) Java, one option is to use GWT for both server and client. This can help you in that you do not need to learn another language (JS/HTML/Python/PHP etc). If your portal is going to be big, using Java can help you organise the application better - usually JS/HTML based applications are not very suitable for proper organisation, even if you use good JS Libraries like jQuery or YUI. Having a good organisation can help a lot - during updation and modification later. If your planned venture is a single/two person venture or if it is time bound - where time to market is everything - then I would not suggest the earlier approach - especially if your server side part is expected to be big. Java is a slow language to write code in. A project which you will take say 6 months to write in Python will take you close to 1 year + in Java. In such a scneario, I would prefer Python - it is a proper language - unlike PHP, and you create code with good organisation there too - albeit a little less organised than using Java. Please note that if your client side code is much more complex than your server side code, then going with GWT will do you no harm. But if your server side code is very complex compared to the client side, then I would suggest Python. Another point is to use existing Web Frameworks to ease your work. For Python, Django is an excellent choice. This itself will decrease your work time by 50% or more, while making your code much more secure and scalable.
0
1,073
false
1
1
Which web technology to learn for an experienced C++ developer?
3,223,646
6
7
0
0
5
0
0
0
Friends, I've got some exp in c++ and now kind of starting my way to J2EE (to survive:))). Meanwhile, I've got a plan to venture in to a web portal my own. But with very little experience in web technology, I'd need to start from scratch. I'm little confused on which way to go and I'm here. PHP, Python or JSP, considering the fact that, anyway I've got to learn J2EE at my work. Would that be worth to learn PHP or Python to develop a portal which I expect to get 80-100K hits per day "IF" everything goes well OR jsp would be sufficient? Many thanks
0
php,python,jsp
2010-07-11T15:28:00.000
0
3,223,557
It really isn't that similar to C++, but I would recommend PHP. You really can't expect a server-side scripting language to be similar to a compiled language like C++. Personally, I find PHP to be an ugly, messy looking language, but once you get into it, it's very rewarding. Other languages have too many drawbacks. ASP.Net is too Microsoft-centric, Python and Ruby on Rails are too obscure, and are also non-curly bracket languages, meaning it will require a lot of adjustment to change to them. Hope this helps.
0
1,073
false
1
1
Which web technology to learn for an experienced C++ developer?
3,224,044
1
3
0
4
12
0
0.26052
0
I'm using ftplib to transfer files. Everything is working great. Now I'm trying to get the size of the target file before downloading. First, I tried just getting size with ftp.size(filename). Server complained that I can't do that in ascii mode. Then I tried setting binary mode using ftp.sendcmd("binary") and ftp.sendcmd("bin"). In both cases the server complained "500 binary Not understood" Can ftplib get size of a file before downloading in this instance? I don't control the FTP server and can't change how it's behaving. Thanks
0
python,ftplib
2010-07-12T20:17:00.000
0
3,231,910
Ftplib can get the size of a file before downloading. As the documentation says: FTP.size(filename) Request the size of the file named filename on the server. On success, the size of the file is returned as an integer, otherwise None is returned. Note that the SIZE command is not standardized, but is upported by many common server implementations Apparently your server doesn't support this feature.
0
12,384
false
0
1
Python ftplib can't get size of file before download?
3,232,065
2
3
0
1
3
0
0.066568
0
is there any way to connect GIMP with python or PHP and use its libraries? It seems that all i can find on the web is pygimp which is not supported anymore. ps. i do my development on mac and i use linux as a production server
0
php,python,gimp
2010-07-13T12:43:00.000
0
3,237,252
One important thing regarding running gimp python plugin in batch mode. Option -i means no interface. But in gimp documentation there is another option with same explanation --no-interface. User could though that they have same effect. But when you try to run batch script on remote linux machine, with option -i you will get 'no display'. With option --no-interface, batch script will run without error. My colleague discovered that this is undocumented gimp 2.6.11 feature. Regards, Karlo.
0
3,456
false
0
1
Connect GIMP with PHP or Python
11,170,196
2
3
0
1
3
0
0.066568
0
is there any way to connect GIMP with python or PHP and use its libraries? It seems that all i can find on the web is pygimp which is not supported anymore. ps. i do my development on mac and i use linux as a production server
0
php,python,gimp
2010-07-13T12:43:00.000
0
3,237,252
Probably not directly, but I'll bet you can access some functions via 'exec()' on the command line. What are you trying to do? Can the GD or ImageMagic tools help?
0
3,456
false
0
1
Connect GIMP with PHP or Python
3,237,353
10
13
0
1
9
1
0.015383
0
Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences? I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python?
0
python,programming-languages,scripting
2010-07-14T05:13:00.000
0
3,243,529
I can't say that I agree with wiping Ruby off the map... Ruby fixed every problem that perl had as far as syntax goes... I loved Python first but let ruby get a little more mature and it will get in the the fray more and more... Why do I support Ruby strongly? just step away from python for a few months and then give Ruby a chance... I was a Ruby hater when I was a python guy. But I can't hardly stand to use python at this point. One day someone is gonna clean up the GC and toss in some native threads and everybody better watch out. off the rant, Python is a full featured, not just good, Great Language... Perl... what a mess... I don't know how Perl can look at itself in the mirror standing next to any other mainstream scripting language... PHP is much prettier... At least Perl is fast, right...(CPAN never hurt it either) if Speed is the real issue there are other interpreters that juice it up a bit... Jython, jRuby, PyPy... the list goes one, screw Bash...
0
3,435
false
0
1
Learn a scripting language besides Python
5,289,422
10
13
0
3
9
1
0.046121
0
Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences? I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python?
0
python,programming-languages,scripting
2010-07-14T05:13:00.000
0
3,243,529
I'll give an honest answer from my perspective. No. Having started scripting using batch, bash, and Perl, discovering Python was discovering precisely what I'd want from a scripting language (and more, but that's off topic). It integrates with familiar Unix interfaces, is modular, doesn't force any particular paradigm, cross platform and under active development. The same can be said of no other scripting language I know of. The only other scripting languages I'd consider using is Lua or Scheme, for their smaller footprints and suitability for embedding, Python can be a little hefty. However they're hardly suitable for the more general purpose shell and other forms of scripting. Update0 I just noticed mentions of Ruby and PHP in other answers, these both slipped my mind, because I'd never consider using them. Ruby is slower and not quite as popular, and PHP is more C/Perl like, with flatter interfaces, which comes with performance boons of its own. Using these alternatives to Python is a matter of taste.
0
3,435
false
0
1
Learn a scripting language besides Python
3,243,558
10
13
0
1
9
1
0.015383
0
Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences? I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python?
0
python,programming-languages,scripting
2010-07-14T05:13:00.000
0
3,243,529
If you are already familiar with Python, you are unlikely to find something compelling in the same niche, although Ruby does have a very strong and vocal following that seems to like it very much. Perhaps you should consider a scripting language that fills a different role, such as BASH shell script for quick, simple scripts that don't need the complexity of Python or JavaScript which runs in the browser.
0
3,435
false
0
1
Learn a scripting language besides Python
3,243,568
10
13
0
3
9
1
0.046121
0
Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences? I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python?
0
python,programming-languages,scripting
2010-07-14T05:13:00.000
0
3,243,529
To answer your first question: Do people learn one language and then ignore or dislike others? Well, if you know one language well, you will need to see great advantages to move to another. I started out using perl and eventually thought that there must be easier way to do some things. I picked up python and stopped using perl almost at once. A little while later I thought I'd try ruby and learned a bit about that. The advantages over using python weren't big enough to switch, so I decided to stick with python. If I had started out using ruby, I'd probably be using that still. If you are using python, I don't think you will easily find another scripting language that will win you over. On the other hand, if you learn functional programming, you will probably learn a few new things, some of them will even be useful in your python programming, since a few things in python seems to be inspired by functional programming and knowing how to use them will make you a better programmer in general and a better python programmer too.
0
3,435
false
0
1
Learn a scripting language besides Python
3,243,929
10
13
0
4
9
1
0.061461
0
Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences? I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python?
0
python,programming-languages,scripting
2010-07-14T05:13:00.000
0
3,243,529
The only relatively unbiased answer you can really look for is probably statistical, and you would still have to account for the natural tendency of people to follow the path of least resistance once one is found or carved. How many people learnt Python to a decent level, found the language resonates with the way they want to work, then move to something else because the language or the ecosystem, or both, don't support their needs? I'd say probably a single digit percentage of the educated userbase, wouldn't be surprised if it amounted to less than 5%. Unless you have work related prospects that involve a different language, or you need to move sideways for similar reasons, I'd say you're probably best off learning something complimentary to Python rather than similar or equivalent. C++ for low-level or computationally intensive tasks, CUDA if your field can take advantage of it (med-viz, CGI etc.), whatever flavour of shell/sysadmin oriented scripting and hacks float where you work (bash, tcl, awk or whatever else) and so on. Personally the reason I haven't bothered past a first glance with ruby, php, or a number of other languages is simply that it's better ROI to keep working on my python skills than picking up something that offers mostly the same qualities just in different forms. If you really want to learn something else for the sake of opening your mind up a bit, and want to stick to "scripting", then LUA was an interesting toy for me for a while, mostly for the ridiculous performance you can squeeze out of a relatively easy integration process, and because it is a rather different set of tracks compared to Python. That, and the fact WoW plugins had to be written in LUA ;)
0
3,435
false
0
1
Learn a scripting language besides Python
3,244,435
10
13
0
3
9
1
0.046121
0
Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences? I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python?
0
python,programming-languages,scripting
2010-07-14T05:13:00.000
0
3,243,529
I would learn a statically typed language with very powerful type expression capabilities and awesome concurrency. One of the following would be a good choice (in order of my preference): Scala F# Haskell Ocaml Erlang Typed languages like the above make you think different. Also these languages have REPLs so they can be used as a scripting language although truthfully I'm not really sure what the definition is of "scripting" language is. Python is missing good concurrency builtin to the language so knowing how to deal with concurrency for many python programmers is a challenge. I have found that strongly typed languages scale better for big projects for many reasons: Because types are so important they become an invaluable way to communicate the problem Refactoring in these languages is much much easier. Automatic Serialization is sometimes easier too (although for Haskell thats less true). A lot less time spent on writing assertions on type checking. Browsing the code is easier because most IDEs will allow you click on and go to different types
0
3,435
false
0
1
Learn a scripting language besides Python
5,289,622
10
13
0
1
9
1
0.015383
0
Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences? I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python?
0
python,programming-languages,scripting
2010-07-14T05:13:00.000
0
3,243,529
Ruby/Groovy/Perl if you'd like to stick to traditional scripting practices. Otherwise I'd heartily recommend you Clojure and Scala - two of the more innovative programing languages of the past few years.
0
3,435
false
0
1
Learn a scripting language besides Python
3,243,557
10
13
0
6
9
1
1
0
Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences? I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python?
0
python,programming-languages,scripting
2010-07-14T05:13:00.000
0
3,243,529
Ruby - what it enables and does with blocks is really interesting, and quite foreign to python based programming Erlang - the functional language has a lot of interesting examples and it will definitely make your head work differently afterwards (in a good way) Javascript - yes, I'm serious. ALthough there's a fair number of grips to be had with this prototype language, it does some really interesting things with that prototyping and just slightly differently than Ruby and/or Python. And a ton of folks are pouring big money into making Javascript a outstandingly fast scripting language.
0
3,435
false
0
1
Learn a scripting language besides Python
3,243,565
10
13
0
6
9
1
1
0
Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences? I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python?
0
python,programming-languages,scripting
2010-07-14T05:13:00.000
0
3,243,529
I would recommend learning Haskell and a dialect of Lisp such as Scheme or Common Lisp, if you master either of those you'll gain insight into how things are accomplished with the functional paradigm and it'll help out your Python as well. Here are some languages categorized by paradigms I'd learn: Imperative/Procedural languages: C Functional paradigm languages: Haskell Common Lisp/Scheme Similar object oriented languages: Ruby ECMAScript Other: Perl I would advise you to stay away from PHP unless you really need the work. You would probably want to run back to Python.
0
3,435
false
0
1
Learn a scripting language besides Python
3,243,541
10
13
0
3
9
1
0.046121
0
Someone told me once, that programmers tend to learn one scripting language properly and ignore or dislike other scripting languages. Do you have similar experiences? I'm using Python as my choice for scripting for few years, however, I'm sure that there are many existing and emerging languages that could impress the Pythonistas. Can you recommend scripting languages that would be interesting and useful to learn besides of Python?
0
python,programming-languages,scripting
2010-07-14T05:13:00.000
0
3,243,529
Learn a Lisp. Whether it's "scripting" or not, Eric Raymond had the right of it when he wrote: "Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot." The programming paradigm needed to be highly effective in Lisp is sufficiently unlike what you use with Python day-to-day that the perspective it gives is very, very much worth it. And within Lisps, my choice? Clojure; like other Lisps, its macro system gives you capabilities comparable (actually superior) to the excellent metaprogramming in Python, but Clojure in particular has a focus on batteries-included practicality (and an intelligent, opinionated design) which will be familiar to anyone fond of GvR's instincts. Moreover, Clojure's strengths are extremely disjoint from Python's -- in particular, it shines at highly-multithreaded, CPU-bound concurrent programming, which is one of Python's weaknesses -- so having both in your toolbox increases the chance you'll have the right tool when a tricky job comes along. (Is it scripting? In my view, that's pretty academic these days; if you have a REPL where you can type code and get an immediate response, modify the state of a running program, or experiment with an API, I see a language as "scripting" enough).
0
3,435
false
0
1
Learn a scripting language besides Python
3,540,040
1
1
0
0
0
0
0
0
is there any frame-work or tool to test java-applets in python
0
python
2010-07-14T13:22:00.000
0
3,246,506
I don't understand exactly what you mean or why you want to test Java in Python but Jython may be helpful.
0
312
false
1
1
java-applet gui testing with python
3,246,550
3
6
0
6
13
1
1
0
They seem to share a lot of the same characteristics but as far as I can tell, Python 2.5 is faster than 1.8.7 by a lot. Is there a deeper underlying reason behind this?
0
python,ruby,performance,programming-languages
2010-07-15T04:56:00.000
0
3,252,568
Because Ruby 1.8 was not really designed with performance in mind, while Python was more optimized. In particular, Ruby 1.8 did real interpretation rather than compiling for a virtual machine like most languages these days. Ruby 1.9 (with the YARV VM) is about as fast as Python 3 (maybe a little bit slower, but much closer), and other implementations are even faster.
0
9,141
false
0
1
Why is Python faster than Ruby?
3,252,589
3
6
0
0
13
1
0
0
They seem to share a lot of the same characteristics but as far as I can tell, Python 2.5 is faster than 1.8.7 by a lot. Is there a deeper underlying reason behind this?
0
python,ruby,performance,programming-languages
2010-07-15T04:56:00.000
0
3,252,568
More people have been working on Python development for more years, so more optimization has been done. The languages are similarly flexible and expressive, so their performance should converge as all the good optimization ideas get used in both. As noted above, Ruby 1.9 substantially narrows the performance gap with Python.
0
9,141
false
0
1
Why is Python faster than Ruby?
3,253,302
3
6
0
0
13
1
0
0
They seem to share a lot of the same characteristics but as far as I can tell, Python 2.5 is faster than 1.8.7 by a lot. Is there a deeper underlying reason behind this?
0
python,ruby,performance,programming-languages
2010-07-15T04:56:00.000
0
3,252,568
It depends on the implementation. Crystal is basically C compiled Ruby that can even call C libraries. Then you also have Elixir on the Beam side and let's not forget the Java and C# counterparts. But yes, Ruby, the defacto standard, is indeed slower than Python and is also aimed at web development.
0
9,141
false
0
1
Why is Python faster than Ruby?
67,204,842
2
5
0
0
2
1
0
0
Ok so I know the basics of programming languages, I've studied python and liked it a lot. I'm studying now the intermediate parts of python and I'm catching the concepts already. I'm working with a project and at the same time solving computer problems that practices algorithm use. I've learned that python has limitations and wants to compensate that limitations by learning another programming language. What programming language do you suggest that synergizes well with python? I want something who can give me their actual experience while working with python and the language that complements well with it. Answers like "try iron python or jython blah blah blah" won't help, if you can give me it's pros and cons, it's maturity it's problems then that's good enough for me... Thanks a lot EDIT - Sorry guys, I think I need to add some details in this. I'll be using python mainly for web programming or game development. So if you think this language A would help me in python for web programming then that's it.
0
python,paradigms
2010-07-15T13:28:00.000
0
3,255,925
Haskell or Ocaml, or maybe a Lisp dialect such as Common Lisp or Scheme.
0
874
false
0
1
What other Language synergizes well with Python? Need Advice
3,255,961
2
5
0
1
2
1
0.039979
0
Ok so I know the basics of programming languages, I've studied python and liked it a lot. I'm studying now the intermediate parts of python and I'm catching the concepts already. I'm working with a project and at the same time solving computer problems that practices algorithm use. I've learned that python has limitations and wants to compensate that limitations by learning another programming language. What programming language do you suggest that synergizes well with python? I want something who can give me their actual experience while working with python and the language that complements well with it. Answers like "try iron python or jython blah blah blah" won't help, if you can give me it's pros and cons, it's maturity it's problems then that's good enough for me... Thanks a lot EDIT - Sorry guys, I think I need to add some details in this. I'll be using python mainly for web programming or game development. So if you think this language A would help me in python for web programming then that's it.
0
python,paradigms
2010-07-15T13:28:00.000
0
3,255,925
What is wrong with IronPython or Jython? You can learn how to write libraries in Java or .Net to alleviate some of Python's speed problems. Learning to write your own Python libraries will certainly help you better understand and overcome the limitations you mentioned.
0
874
false
0
1
What other Language synergizes well with Python? Need Advice
3,255,977
5
16
0
9
86
1
1
0
I can find lots of stuff showing me what a lambda function is, and how the syntax works and what not. But other than the "coolness factor" (I can make a function in middle a call to another function, neat!) I haven't seen something that's overwelmingly compelling to say why I really need/want to use them. It seems to be more of a stylistic or structual choice in most examples I've seen. And kinda breaks the "Only one correct way to do something" in python rule. How does it make my programs, more correct, more reliable, faster, or easier to understand? (Most coding standards I've seen tend to tell you to avoid overly complex statements on a single line. If it makes it easier to read break it up.)
0
python,lambda
2010-07-15T19:41:00.000
0
3,259,322
Yes, you're right — it is a structural choice. It probably does not make your programs more correct by just using lambda expressions. Nor does it make them more reliable, and this has nothing to do with speed. It is only about flexibility and the power of expression. Like list comprehension. You can do most of that defining named functions (possibly polluting namespace, but that's again purely stylistic issue). It can aid to readability by the fact, that you do not have to define a separate named function, that someone else will have to find, read and understand that all it does is to call a method blah() on its argument. It may be much more interesting when you use it to write functions that create and return other functions, where what exactly those functions do, depends on their arguments. This may be a very concise and readable way of parameterizing your code behaviour. You can just express more interesting ideas. But that is still a structural choice. You can do that otherwise. But the same goes for object oriented programming ;)
0
54,149
false
0
1
Why use lambda functions?
3,259,428
5
16
0
14
86
1
1
0
I can find lots of stuff showing me what a lambda function is, and how the syntax works and what not. But other than the "coolness factor" (I can make a function in middle a call to another function, neat!) I haven't seen something that's overwelmingly compelling to say why I really need/want to use them. It seems to be more of a stylistic or structual choice in most examples I've seen. And kinda breaks the "Only one correct way to do something" in python rule. How does it make my programs, more correct, more reliable, faster, or easier to understand? (Most coding standards I've seen tend to tell you to avoid overly complex statements on a single line. If it makes it easier to read break it up.)
0
python,lambda
2010-07-15T19:41:00.000
0
3,259,322
For me it's a matter of the expressiveness of the code. When writing code that people will have to support, that code should tell a story in as concise and easy to understand manner as possible. Sometimes the lambda expression is more complicated, other times it more directly tells what that line or block of code is doing. Use judgment when writing. Think of it like structuring a sentence. What are the important parts (nouns and verbs vs. objects and methods, etc.) and how should they be ordered for that line or block of code to convey what it's doing intuitively.
0
54,149
false
0
1
Why use lambda functions?
3,259,370
5
16
0
6
86
1
1
0
I can find lots of stuff showing me what a lambda function is, and how the syntax works and what not. But other than the "coolness factor" (I can make a function in middle a call to another function, neat!) I haven't seen something that's overwelmingly compelling to say why I really need/want to use them. It seems to be more of a stylistic or structual choice in most examples I've seen. And kinda breaks the "Only one correct way to do something" in python rule. How does it make my programs, more correct, more reliable, faster, or easier to understand? (Most coding standards I've seen tend to tell you to avoid overly complex statements on a single line. If it makes it easier to read break it up.)
0
python,lambda
2010-07-15T19:41:00.000
0
3,259,322
Lambda, while useful in certain situations, has a large potential for abuse. lambda's almost always make code more difficult to read. And while it might feel satisfying to fit all your code onto a single line, it will suck for the next person who has to read your code. Direct from PEP8 "One of Guido's key insights is that code is read much more often than it is written."
0
54,149
false
0
1
Why use lambda functions?
3,734,989
5
16
0
3
86
1
0.037482
0
I can find lots of stuff showing me what a lambda function is, and how the syntax works and what not. But other than the "coolness factor" (I can make a function in middle a call to another function, neat!) I haven't seen something that's overwelmingly compelling to say why I really need/want to use them. It seems to be more of a stylistic or structual choice in most examples I've seen. And kinda breaks the "Only one correct way to do something" in python rule. How does it make my programs, more correct, more reliable, faster, or easier to understand? (Most coding standards I've seen tend to tell you to avoid overly complex statements on a single line. If it makes it easier to read break it up.)
0
python,lambda
2010-07-15T19:41:00.000
0
3,259,322
Lambdas are anonymous functions (function with no name) that can be assigned to a variable or that can be passed as an argument to another function. The usefulness of lambda will be realized when you need a small piece of function that will be run one in a while or just once. Instead of writing the function in global scope or including it as part of your main program you can toss around few lines of code when needed to a variable or another function. Also when you pass the function as an argument to another function during the function call you can change the argument (the anonymous function) making the function itself dynamic. Suppose if the anonymous function uses variables outside its scope it is called closure. This is useful in callback functions.
0
54,149
false
0
1
Why use lambda functions?
48,674,765
5
16
0
-1
86
1
-0.012499
0
I can find lots of stuff showing me what a lambda function is, and how the syntax works and what not. But other than the "coolness factor" (I can make a function in middle a call to another function, neat!) I haven't seen something that's overwelmingly compelling to say why I really need/want to use them. It seems to be more of a stylistic or structual choice in most examples I've seen. And kinda breaks the "Only one correct way to do something" in python rule. How does it make my programs, more correct, more reliable, faster, or easier to understand? (Most coding standards I've seen tend to tell you to avoid overly complex statements on a single line. If it makes it easier to read break it up.)
0
python,lambda
2010-07-15T19:41:00.000
0
3,259,322
Lambdas allow you to create functions on the fly. Most of the examples I've seen don't do much more than create a function with parameters passed at the time of creation rather than execution. Or they simplify the code by not requiring a formal declaration of the function ahead of use. A more interesting use would be to dynamically construct a python function to evaluate a mathematical expression that isn't known until run time (user input). Once created, that function can be called repeatedly with different arguments to evaluate the expression (say you wanted to plot it). That may even be a poor example given eval(). This type of use is where the "real" power is - in dynamically creating more complex code, rather than the simple examples you often see which are not much more than nice (source) code size reductions.
0
54,149
false
0
1
Why use lambda functions?
3,259,570
1
2
0
0
2
0
0
1
I'm running complex tests that create many cookies for different sections of my web site. Occasionally I have to restart the browser in the middle a long test and since the Selenium server doesn't modify the base Firefox profile, the cookies evaporate. Is there any way I can save all of the cookies to a Python variable before terminating the browser and restore them after starting a new browser instance?
0
python,cookies,selenium,selenium-rc
2010-07-16T13:02:00.000
0
3,265,062
Yes, sure. Look at getCookie, getCookieByName and createCookie methods.
0
1,991
false
0
1
How to save and restore all cookies with Selenium RC?
3,314,427
10
13
0
497
312
1
1.2
0
I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications. Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand that there are other kinds of interpreted and compiled languages. Aside from the fact that executable files can be distributed from programs written in compiled languages, are there any advantages/disadvantages to each type? Oftentimes, I hear people arguing that interpreted languages can be used interactively, but I believe that compiled languages can have interactive implementations as well, correct?
0
java,python,compiler-construction,programming-languages,interpreter
2010-07-16T13:35:00.000
0
3,265,357
A compiled language is one where the program, once compiled, is expressed in the instructions of the target machine. For example, an addition "+" operation in your source code could be translated directly to the "ADD" instruction in machine code. An interpreted language is one where the instructions are not directly executed by the target machine, but instead read and executed by some other program (which normally is written in the language of the native machine). For example, the same "+" operation would be recognised by the interpreter at run time, which would then call its own "add(a,b)" function with the appropriate arguments, which would then execute the machine code "ADD" instruction. You can do anything that you can do in an interpreted language in a compiled language and vice-versa - they are both Turing complete. Both however have advantages and disadvantages for implementation and use. I'm going to completely generalise (purists forgive me!) but, roughly, here are the advantages of compiled languages: Faster performance by directly using the native code of the target machine Opportunity to apply quite powerful optimisations during the compile stage And here are the advantages of interpreted languages: Easier to implement (writing good compilers is very hard!!) No need to run a compilation stage: can execute code directly "on the fly" Can be more convenient for dynamic languages Note that modern techniques such as bytecode compilation add some extra complexity - what happens here is that the compiler targets a "virtual machine" which is not the same as the underlying hardware. These virtual machine instructions can then be compiled again at a later stage to get native code (e.g. as done by the Java JVM JIT compiler).
0
246,100
true
0
1
Compiled vs. Interpreted Languages
3,265,602
10
13
0
2
312
1
0.03076
0
I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications. Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand that there are other kinds of interpreted and compiled languages. Aside from the fact that executable files can be distributed from programs written in compiled languages, are there any advantages/disadvantages to each type? Oftentimes, I hear people arguing that interpreted languages can be used interactively, but I believe that compiled languages can have interactive implementations as well, correct?
0
java,python,compiler-construction,programming-languages,interpreter
2010-07-16T13:35:00.000
0
3,265,357
It's rather difficult to give a practical answer because the difference is about the language definition itself. It's possible to build an interpreter for every compiled language, but it's not possible to build an compiler for every interpreted language. It's very much about the formal definition of a language. So that theoretical informatics stuff noboby likes at university.
0
246,100
false
0
1
Compiled vs. Interpreted Languages
3,265,475
10
13
0
11
312
1
1
0
I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications. Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand that there are other kinds of interpreted and compiled languages. Aside from the fact that executable files can be distributed from programs written in compiled languages, are there any advantages/disadvantages to each type? Oftentimes, I hear people arguing that interpreted languages can be used interactively, but I believe that compiled languages can have interactive implementations as well, correct?
0
java,python,compiler-construction,programming-languages,interpreter
2010-07-16T13:35:00.000
0
3,265,357
The biggest advantage of interpreted source code over compiled source code is PORTABILITY. If your source code is compiled, you need to compile a different executable for each type of processor and/or platform that you want your program to run on (e.g. one for Windows x86, one for Windows x64, one for Linux x64, and so on). Furthermore, unless your code is completely standards compliant and does not use any platform-specific functions/libraries, you will actually need to write and maintain multiple code bases! If your source code is interpreted, you only need to write it once and it can be interpreted and executed by an appropriate interpreter on any platform! It's portable! Note that an interpreter itself is an executable program that is written and compiled for a specific platform. An advantage of compiled code is that it hides the source code from the end user (which might be intellectual property) because instead of deploying the original human-readable source code, you deploy an obscure binary executable file.
0
246,100
false
0
1
Compiled vs. Interpreted Languages
23,750,310
10
13
0
5
312
1
0.076772
0
I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications. Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand that there are other kinds of interpreted and compiled languages. Aside from the fact that executable files can be distributed from programs written in compiled languages, are there any advantages/disadvantages to each type? Oftentimes, I hear people arguing that interpreted languages can be used interactively, but I believe that compiled languages can have interactive implementations as well, correct?
0
java,python,compiler-construction,programming-languages,interpreter
2010-07-16T13:35:00.000
0
3,265,357
First, a clarification, Java is not fully static-compiled and linked in the way C++. It is compiled into bytecode, which is then interpreted by a JVM. The JVM can go and do just-in-time compilation to the native machine language, but doesn't have to do it. More to the point: I think interactivity is the main practical difference. Since everything is interpreted, you can take a small excerpt of code, parse and run it against the current state of the environment. Thus, if you had already executed code that initialized a variable, you would have access to that variable, etc. It really lends itself way to things like the functional style. Interpretation, however, costs a lot, especially when you have a large system with a lot of references and context. By definition, it is wasteful because identical code may have to be interpreted and optimized twice (although most runtimes have some caching and optimizations for that). Still, you pay a runtime cost and often need a runtime environment. You are also less likely to see complex interprocedural optimizations because at present their performance is not sufficiently interactive. Therefore, for large systems that are not going to change much, and for certain languages, it makes more sense to precompile and prelink everything, do all the optimizations that you can do. This ends up with a very lean runtime that is already optimized for the target machine. As for generating executables, that has little to do with it, IMHO. You can often create an executable from a compiled language. But you can also create an executable from an interpreted language, except that the interpreter and runtime is already packaged in the exectuable and hidden from you. This means that you generally still pay the runtime costs (although I am sure that for some language there are ways to translate everything to a tree executable). I disagree that all languages could be made interactive. Certain languages, like C, are so tied to the machine and the entire link structure that I'm not sure you can build a meaningful fully-fledged interactive version
0
246,100
false
0
1
Compiled vs. Interpreted Languages
3,265,433
10
13
0
64
312
1
1
0
I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications. Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand that there are other kinds of interpreted and compiled languages. Aside from the fact that executable files can be distributed from programs written in compiled languages, are there any advantages/disadvantages to each type? Oftentimes, I hear people arguing that interpreted languages can be used interactively, but I believe that compiled languages can have interactive implementations as well, correct?
0
java,python,compiler-construction,programming-languages,interpreter
2010-07-16T13:35:00.000
0
3,265,357
Start thinking in terms of a: blast from the past Once upon a time, long long ago, there lived in the land of computing interpreters and compilers. All kinds of fuss ensued over the merits of one over the other. The general opinion at that time was something along the lines of: Interpreter: Fast to develop (edit and run). Slow to execute because each statement had to be interpreted into machine code every time it was executed (think of what this meant for a loop executed thousands of times). Compiler: Slow to develop (edit, compile, link and run. The compile/link steps could take serious time). Fast to execute. The whole program was already in native machine code. A one or two order of magnitude difference in the runtime performance existed between an interpreted program and a compiled program. Other distinguishing points, run-time mutability of the code for example, were also of some interest but the major distinction revolved around the run-time performance issues. Today the landscape has evolved to such an extent that the compiled/interpreted distinction is pretty much irrelevant. Many compiled languages call upon run-time services that are not completely machine code based. Also, most interpreted languages are "compiled" into byte-code before execution. Byte-code interpreters can be very efficient and rival some compiler generated code from an execution speed point of view. The classic difference is that compilers generated native machine code, interpreters read source code and generated machine code on the fly using some sort of run-time system. Today there are very few classic interpreters left - almost all of them compile into byte-code (or some other semi-compiled state) which then runs on a virtual "machine".
0
246,100
false
0
1
Compiled vs. Interpreted Languages
3,266,025
10
13
0
103
312
1
1
0
I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications. Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand that there are other kinds of interpreted and compiled languages. Aside from the fact that executable files can be distributed from programs written in compiled languages, are there any advantages/disadvantages to each type? Oftentimes, I hear people arguing that interpreted languages can be used interactively, but I believe that compiled languages can have interactive implementations as well, correct?
0
java,python,compiler-construction,programming-languages,interpreter
2010-07-16T13:35:00.000
0
3,265,357
A language itself is neither compiled nor interpreted, only a specific implementation of a language is. Java is a perfect example. There is a bytecode-based platform (the JVM), a native compiler (gcj) and an interpeter for a superset of Java (bsh). So what is Java now? Bytecode-compiled, native-compiled or interpreted? Other languages, which are compiled as well as interpreted, are Scala, Haskell or Ocaml. Each of these languages has an interactive interpreter, as well as a compiler to byte-code or native machine code. So generally categorizing languages by "compiled" and "interpreted" doesn't make much sense.
0
246,100
false
0
1
Compiled vs. Interpreted Languages
3,265,680
10
13
0
1
312
1
0.015383
0
I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications. Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand that there are other kinds of interpreted and compiled languages. Aside from the fact that executable files can be distributed from programs written in compiled languages, are there any advantages/disadvantages to each type? Oftentimes, I hear people arguing that interpreted languages can be used interactively, but I believe that compiled languages can have interactive implementations as well, correct?
0
java,python,compiler-construction,programming-languages,interpreter
2010-07-16T13:35:00.000
0
3,265,357
Compile is the process of creating an executable program from code written in a compiled programming language. Compiling allows the computer to run and understand the program without the need of the programming software used to create it. When a program is compiled it is often compiled for a specific platform (e.g. IBM platform) that works with IBM compatible computers, but not other platforms (e.g. Apple platform). The first compiler was developed by Grace Hopper while working on the Harvard Mark I computer. Today, most high-level languages will include their own compiler or have toolkits available that can be used to compile the program. A good example of a compiler used with Java is Eclipse and an example of a compiler used with C and C++ is the gcc command. Depending on how big the program is it should take a few seconds or minutes to compile and if no errors are encountered while being compiled an executable file is created.check this information
0
246,100
false
0
1
Compiled vs. Interpreted Languages
45,730,878
10
13
0
28
312
1
1
0
I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications. Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand that there are other kinds of interpreted and compiled languages. Aside from the fact that executable files can be distributed from programs written in compiled languages, are there any advantages/disadvantages to each type? Oftentimes, I hear people arguing that interpreted languages can be used interactively, but I believe that compiled languages can have interactive implementations as well, correct?
0
java,python,compiler-construction,programming-languages,interpreter
2010-07-16T13:35:00.000
0
3,265,357
The extreme and simple cases: A compiler will produce a binary executable in the target machine's native executable format. This binary file contains all required resources except for system libraries; it's ready to run with no further preparation and processing and it runs like lightning because the code is the native code for the CPU on the target machine. An interpreter will present the user with a prompt in a loop where he can enter statements or code, and upon hitting RUN or the equivalent the interpreter will examine, scan, parse and interpretatively execute each line until the program runs to a stopping point or an error. Because each line is treated on its own and the interpreter doesn't "learn" anything from having seen the line before, the effort of converting human-readable language to machine instructions is incurred every time for every line, so it's dog slow. On the bright side, the user can inspect and otherwise interact with his program in all kinds of ways: Changing variables, changing code, running in trace or debug modes... whatever. With those out of the way, let me explain that life ain't so simple any more. For instance, Many interpreters will pre-compile the code they're given so the translation step doesn't have to be repeated again and again. Some compilers compile not to CPU-specific machine instructions but to bytecode, a kind of artificial machine code for a ficticious machine. This makes the compiled program a bit more portable, but requires a bytecode interpreter on every target system. The bytecode interpreters (I'm looking at Java here) recently tend to re-compile the bytecode they get for the CPU of the target section just before execution (called JIT). To save time, this is often only done for code that runs often (hotspots). Some systems that look and act like interpreters (Clojure, for instance) compile any code they get, immediately, but allow interactive access to the program's environment. That's basically the convenience of interpreters with the speed of binary compilation. Some compilers don't really compile, they just pre-digest and compress code. I heard a while back that's how Perl works. So sometimes the compiler is just doing a bit of the work and most of it is still interpretation. In the end, these days, interpreting vs. compiling is a trade-off, with time spent (once) compiling often being rewarded by better runtime performance, but an interpretative environment giving more opportunities for interaction. Compiling vs. interpreting is mostly a matter of how the work of "understanding" the program is divided up between different processes, and the line is a bit blurry these days as languages and products try to offer the best of both worlds.
0
246,100
false
0
1
Compiled vs. Interpreted Languages
3,265,505
10
13
0
8
312
1
1
0
I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications. Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand that there are other kinds of interpreted and compiled languages. Aside from the fact that executable files can be distributed from programs written in compiled languages, are there any advantages/disadvantages to each type? Oftentimes, I hear people arguing that interpreted languages can be used interactively, but I believe that compiled languages can have interactive implementations as well, correct?
0
java,python,compiler-construction,programming-languages,interpreter
2010-07-16T13:35:00.000
0
3,265,357
A compiler and an interpreter do the same job: translating a programming language to another pgoramming language, usually closer to the hardware, often direct executable machine code. Traditionally, "compiled" means that this translation happens all in one go, is done by a developer, and the resulting executable is distributed to users. Pure example: C++. Compilation usually takes pretty long and tries to do lots of expensive optmization so that the resulting executable runs faster. End users don't have the tools and knowledge to compile stuff themselves, and the executable often has to run on a variety of hardware, so you can't do many hardware-specific optimizations. During development, the separate compilation step means a longer feedback cycle. Traditionally, "interpreted" means that the translation happens "on the fly", when the user wants to run the program. Pure example: vanilla PHP. A naive interpreter has to parse and translate every piece of code every time it runs, which makes it very slow. It can't do complex, costly optimizations because they'd take longer than the time saved in execution. But it can fully use the capabilities of the hardware it runs on. The lack of a separrate compilation step reduces feedback time during development. But nowadays "compiled vs. interpreted" is not a black-or-white issue, there are shades in between. Naive, simple interpreters are pretty much extinct. Many languages use a two-step process where the high-level code is translated to a platform-independant bytecode (which is much faster to interpret). Then you have "just in time compilers" which compile code at most once per program run, sometimes cache results, and even intelligently decide to interpret code that's run rarely, and do powerful optimizations for code that runs a lot. During development, debuggers are capable of switching code inside a running program even for traditionally compiled languages.
0
246,100
false
0
1
Compiled vs. Interpreted Languages
3,265,615
10
13
0
2
312
1
0.03076
0
I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications. Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand that there are other kinds of interpreted and compiled languages. Aside from the fact that executable files can be distributed from programs written in compiled languages, are there any advantages/disadvantages to each type? Oftentimes, I hear people arguing that interpreted languages can be used interactively, but I believe that compiled languages can have interactive implementations as well, correct?
0
java,python,compiler-construction,programming-languages,interpreter
2010-07-16T13:35:00.000
0
3,265,357
The Python Book © 2015 Imagine Publishing Ltd, simply distunguishes the difference by the following hint mentioned in page 10 as: An interpreted language such as Python is one where the source code is converted to machine code and then executed each time the program runs. This is different from a compiled language such as C, where the source code is only converted to machine code once – the resulting machine code is then executed each time the program runs.
0
246,100
false
0
1
Compiled vs. Interpreted Languages
39,558,017
9
12
0
3
25
1
0.049958
0
I recently learned JavaScript an all of the sudden I hear about Python... Should I go learn Python or just stick with my basic JavaScript knowledge? If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on... Thanks :)
0
javascript,python
2010-07-16T15:06:00.000
0
3,266,223
Python’s a good second language to learn after JavaScript, as they have a reasonable number of similarities, e.g. they’re both memory-managed they have similar data structures — JavaScript’s objects and arrays are much like Python’s dictionaries and arrays they’re both used quite a lot for web-related work — JavaScript in the browser and in server-side contexts like node.js, Python in web frameworks like Django. However, Python’s object-oriented... stuff is quite different to JavaScript’s protoype-based object-oriented stuff. If the only programming you do is manipulating web pages within the web browser, then Python won’t be of any direct use to you (only JavaScript runs in browsers at the moment). But learning another programming language generally gives you new ways to think about the languages you already know. Learning Python could help you write better JavaScript.
0
65,637
false
1
1
Python over JavaScript? (Facts, please)
3,266,895
9
12
0
-2
25
1
-0.033321
0
I recently learned JavaScript an all of the sudden I hear about Python... Should I go learn Python or just stick with my basic JavaScript knowledge? If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on... Thanks :)
0
javascript,python
2010-07-16T15:06:00.000
0
3,266,223
If you need to ask, then I would say no since you don't have a need in mind for its usage.
0
65,637
false
1
1
Python over JavaScript? (Facts, please)
3,266,975
9
12
0
0
25
1
0
0
I recently learned JavaScript an all of the sudden I hear about Python... Should I go learn Python or just stick with my basic JavaScript knowledge? If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on... Thanks :)
0
javascript,python
2010-07-16T15:06:00.000
0
3,266,223
Along with Python generally being server-side and JavaScript client-side, Python was designed to not only be easy to learn, but also easy to read, and to encourage a more productive environment.
0
65,637
false
1
1
Python over JavaScript? (Facts, please)
3,266,781
9
12
0
2
25
1
0.033321
0
I recently learned JavaScript an all of the sudden I hear about Python... Should I go learn Python or just stick with my basic JavaScript knowledge? If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on... Thanks :)
0
javascript,python
2010-07-16T15:06:00.000
0
3,266,223
JavaScript is usually used as a client-side scripting language - that is, it gets downloaded and executed by your browser. Python, however, is usually not coupled to the web. it can be used as a server-side scripting language, and for scripts and applications of any kind. But it is not a client-side language, and is therefore not directly comparable to Javascript, which has an entirely different audience. Looking at the language level, Javascript is terrible and dysfunctional (hard to debug, clumsy object-orientation) while Python is beautiful and expressive. This is, of course, subjective :-)
0
65,637
false
1
1
Python over JavaScript? (Facts, please)
3,266,281
9
12
0
0
25
1
0
0
I recently learned JavaScript an all of the sudden I hear about Python... Should I go learn Python or just stick with my basic JavaScript knowledge? If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on... Thanks :)
0
javascript,python
2010-07-16T15:06:00.000
0
3,266,223
It depends. Do you want to program in a language that specifically targets web browsers? Stick with Javascript Do you want to write... well anything besides for web browsers? Learn Python. Python is an excellent beginner language that's not just a beginner language. Google uses it, NASA uses it, and many, many other organizations use Python.
0
65,637
false
1
1
Python over JavaScript? (Facts, please)
3,266,294
9
12
0
1
25
1
0.016665
0
I recently learned JavaScript an all of the sudden I hear about Python... Should I go learn Python or just stick with my basic JavaScript knowledge? If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on... Thanks :)
0
javascript,python
2010-07-16T15:06:00.000
0
3,266,223
IMO Python may be easier to learn (having taught both to intro classes). Also, one major annoyance of JavaScript is that in runs in your browser. This inherently makes it much harder to debug problems. In terms of a production-level language, Python is more of a general purpose programming language, while JavaScript is targeted at building dynamic web applications. If you want to get into programming, you should definitely learn a more general purpose language such as Java or Python.
0
65,637
false
1
1
Python over JavaScript? (Facts, please)
3,266,271
9
12
0
15
25
1
1
0
I recently learned JavaScript an all of the sudden I hear about Python... Should I go learn Python or just stick with my basic JavaScript knowledge? If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on... Thanks :)
0
javascript,python
2010-07-16T15:06:00.000
0
3,266,223
The two are generally used quite differently. Javascript is primarily used as a client side scripting language vs python which is a server based language. So in a website you could use both. But not sure if this is what you were wondering.
0
65,637
false
1
1
Python over JavaScript? (Facts, please)
3,266,248
9
12
0
0
25
1
0
0
I recently learned JavaScript an all of the sudden I hear about Python... Should I go learn Python or just stick with my basic JavaScript knowledge? If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on... Thanks :)
0
javascript,python
2010-07-16T15:06:00.000
0
3,266,223
JavaScript and Python are both great languages that are geared toward different problems. JavaScript knowledge is invaluable when dealing with the web, writing web pages, and poking around in html DOM. Python is a scripting language that is great for a host of things on any machine.
0
65,637
false
1
1
Python over JavaScript? (Facts, please)
3,266,266
9
12
0
1
25
1
0.016665
0
I recently learned JavaScript an all of the sudden I hear about Python... Should I go learn Python or just stick with my basic JavaScript knowledge? If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on... Thanks :)
0
javascript,python
2010-07-16T15:06:00.000
0
3,266,223
For what purpose? Javascript is king in some circles (web development, for instance). Javascript and Python are not mutually exclusive. Why not learn both?
0
65,637
false
1
1
Python over JavaScript? (Facts, please)
3,266,275
1
1
0
1
0
0
1.2
0
Hi I want to load the groups of a svg-file into several gtk pixbuffs/subpixbufs therefore I need the coordinates and width and height of them I'm currently just using rsvg and gtk is it possible to get those information with that modules ? Or do I need another module to read out that data from the svg-file? thanks alot
0
python,gtk,svg,rsvg
2010-07-16T20:24:00.000
0
3,268,600
I found out to simply use RSVG::Handle::get_dimensions_sub(id)
0
387
true
0
1
Get the coords and height/width of a svg group into python
3,948,330
1
2
0
1
1
1
0.099668
0
What's the easiest Python library to use to extract properties from an AAC audio file (.m4a)? Specifically, I'd like to extract the following properties: Sample rate Channel count (mono or stereo) Length (in seconds)
0
python,aac
2010-07-16T22:10:00.000
0
3,269,200
Try using the command exiftool. Of course, if you're using linux. This command shows all the properties of audio files, video and pictures. Exiftool installed, simply use the command: exiftoll your_file_name.extension eg exiftoll music.mp3
0
1,597
false
0
1
Extract AAC audio properties using Python?
12,114,371
1
1
0
2
3
0
1.2
0
I have installed Iron Python on my Ubuntu 10.4 and Mono Develop, but there is no interaction between them. Is there any Iron Python plug-in for Monodevelop as in VS? If not, which is the best Iron-Python IDE for Ubuntu or Debian?
0
.net,ironpython,monodevelop,ubuntu-10.04
2010-07-16T22:44:00.000
0
3,269,339
I'm not aware of one. The is a Python addin for MD, but not an IronPython addin. It wouldn't be hard to write an addin for MD - if anyone's interested, ask on the MonoDevelop mailing list and I can give some pointers to get started.
0
1,522
true
0
1
Is there any Iron Python plug-in for Monodevelop?
3,284,054
4
8
0
2
2
0
0.049958
0
I am working on a project that requires reading text files, extracting data from them, and then generating reports (text files). Since there are a lot of string parsing, I decided to do it in Perl or Python or PHP (preference in that order). But I don't want to expose the source code to my client. Is there any good compiler for compiling perl/python/php scripts into linux executables? I am not looking for a 100% perfect one, but I am looking for an at least 90% perfect one. By perfect, I mean the compiler doesn't require to write scripts with a limited subset of language features.
0
php,python,perl,compiler-construction,scripting-language
2010-07-17T06:11:00.000
1
3,270,464
There are 3 options of encrypting Perl code: Use PAR to create executable file with PAR::Filter::Obfuscate or PAR::Filter::Crypto Use Filter::Crypto::CryptFile (will require some modules installed on target OS) Turn into module and encrypt into Module::Crypt. Also you can try B::C - it was removed from core Perl distribution and is now available on CPAN.
0
2,889
false
0
1
Good compilers for compiling perl/python/php scripts into linux executables?
3,270,788
4
8
0
0
2
0
0
0
I am working on a project that requires reading text files, extracting data from them, and then generating reports (text files). Since there are a lot of string parsing, I decided to do it in Perl or Python or PHP (preference in that order). But I don't want to expose the source code to my client. Is there any good compiler for compiling perl/python/php scripts into linux executables? I am not looking for a 100% perfect one, but I am looking for an at least 90% perfect one. By perfect, I mean the compiler doesn't require to write scripts with a limited subset of language features.
0
php,python,perl,compiler-construction,scripting-language
2010-07-17T06:11:00.000
1
3,270,464
For Python You can call your code and give the *.pyc file to the client.
0
2,889
false
0
1
Good compilers for compiling perl/python/php scripts into linux executables?
3,270,490
4
8
0
4
2
0
0.099668
0
I am working on a project that requires reading text files, extracting data from them, and then generating reports (text files). Since there are a lot of string parsing, I decided to do it in Perl or Python or PHP (preference in that order). But I don't want to expose the source code to my client. Is there any good compiler for compiling perl/python/php scripts into linux executables? I am not looking for a 100% perfect one, but I am looking for an at least 90% perfect one. By perfect, I mean the compiler doesn't require to write scripts with a limited subset of language features.
0
php,python,perl,compiler-construction,scripting-language
2010-07-17T06:11:00.000
1
3,270,464
I'm sorry, it's simply not worth spending your time on. For any language you choose (from among the ones you listed), for any compiler/obfuscator someone chooses to come up with, I promise you I can get readable source code out of it (within an hour if it's Perl; longer if it's Python or PHP simply because I'm less acquainted with the implementations of those languages, not because it's intrinsically harder with those languages). I think you should take a better look at what your goals are and why you want to work for a client that you're assuming a priori wants to rip you off. And if you still want to go ahead with such a scheme, write in C or Fortran -- certainly not anything starting with "P".
0
2,889
false
0
1
Good compilers for compiling perl/python/php scripts into linux executables?
3,270,852
4
8
0
0
2
0
0
0
I am working on a project that requires reading text files, extracting data from them, and then generating reports (text files). Since there are a lot of string parsing, I decided to do it in Perl or Python or PHP (preference in that order). But I don't want to expose the source code to my client. Is there any good compiler for compiling perl/python/php scripts into linux executables? I am not looking for a 100% perfect one, but I am looking for an at least 90% perfect one. By perfect, I mean the compiler doesn't require to write scripts with a limited subset of language features.
0
php,python,perl,compiler-construction,scripting-language
2010-07-17T06:11:00.000
1
3,270,464
For linux an executable is something which has +x set, so there's no need to compile scripts. To hide your sourcecode you could use an obfuscator. This makes your sourcecode unreadable.
0
2,889
false
0
1
Good compilers for compiling perl/python/php scripts into linux executables?
3,270,518
3
4
1
0
3
0
0
0
I'm working on a plugin for some software that I'm planning on selling someday. The software I'm making it for has both a C++ SDK and a Python SDK. The C++ SDK documentation appears incomplete in certain areas and isn't documented that well. The Python SDK docs appear more complete and in general are much easier to work with. So I'm trying to decide if I want to go through the potential trouble of building a C++ plugin instead of a Python plugin to sell. About the only thing that makes me want to do a C++ plugin is that in my mind, a "C++ plugin" might be an easier sell than a "Python plugin". A lot of programmers out there don't even considered writing Python to be real "programming". Do you think that potential customers might say "Why would I pay money for a measly little Python script?"? As opposed to "Oh it was written in C++ so the guy must be a decent programmer"? Writing the Python plugin would be faster. Both plugins would look and behave exactly the same. The C++ plugin might be faster in certain spots, but for the type of plugin this is, that's not a huge deal. So my question is, would a Python plugin be considered not as professional/sellable as a C++ plugin, even if it looks and acts EXACTLY the same as a C++ plugin?
0
c++,python
2010-07-18T21:42:00.000
0
3,277,376
Python will also have the advantage/disadvantage (depending on what you want) that the source code must be open. (I think delivering only the .pyc file is not really an option as the Python bytecode format is changing in every release.) Otherwise, let's say you are selling to people who don't really know what the difference is between Python/C++: The outcome is the important thing. If your Python plugin runs and feels stable and fast, it is fine. If they have heard about both languages, there really may be a difference. I must admit, if I had a choice between two plugins which do exactly the same and which are perfectly stable from all user reports, I probably would prefer the C++ plugin. It would be my intuition which would tell me that the C++ code is probably slightly more stable and faster. This is also for Unix tools and other stuff.
0
815
false
0
1
Is Python-based software considered less-professional than C++/compiled software?
3,277,408
3
4
1
6
3
0
1.2
0
I'm working on a plugin for some software that I'm planning on selling someday. The software I'm making it for has both a C++ SDK and a Python SDK. The C++ SDK documentation appears incomplete in certain areas and isn't documented that well. The Python SDK docs appear more complete and in general are much easier to work with. So I'm trying to decide if I want to go through the potential trouble of building a C++ plugin instead of a Python plugin to sell. About the only thing that makes me want to do a C++ plugin is that in my mind, a "C++ plugin" might be an easier sell than a "Python plugin". A lot of programmers out there don't even considered writing Python to be real "programming". Do you think that potential customers might say "Why would I pay money for a measly little Python script?"? As opposed to "Oh it was written in C++ so the guy must be a decent programmer"? Writing the Python plugin would be faster. Both plugins would look and behave exactly the same. The C++ plugin might be faster in certain spots, but for the type of plugin this is, that's not a huge deal. So my question is, would a Python plugin be considered not as professional/sellable as a C++ plugin, even if it looks and acts EXACTLY the same as a C++ plugin?
0
c++,python
2010-07-18T21:42:00.000
0
3,277,376
A lot of programmers out there don't even considered writing Python to be real "programming". A lot of "programmers" out there are incompetent, too. Do you think that potential customers might say "Why would I pay money for a measly little Python script?"? I'm sure it depends on the type of software, but I can tell you that my program's customers have little interest in what we use to develop our product, and I doubt most of them know that the software is written in C++. They just care that it works. So my question is, would a Python plugin be considered not as professional/sellable as a C++ plugin, even if it looks and acts EXACTLY the same as a C++ plugin? No.
0
815
true
0
1
Is Python-based software considered less-professional than C++/compiled software?
3,277,400
3
4
1
0
3
0
0
0
I'm working on a plugin for some software that I'm planning on selling someday. The software I'm making it for has both a C++ SDK and a Python SDK. The C++ SDK documentation appears incomplete in certain areas and isn't documented that well. The Python SDK docs appear more complete and in general are much easier to work with. So I'm trying to decide if I want to go through the potential trouble of building a C++ plugin instead of a Python plugin to sell. About the only thing that makes me want to do a C++ plugin is that in my mind, a "C++ plugin" might be an easier sell than a "Python plugin". A lot of programmers out there don't even considered writing Python to be real "programming". Do you think that potential customers might say "Why would I pay money for a measly little Python script?"? As opposed to "Oh it was written in C++ so the guy must be a decent programmer"? Writing the Python plugin would be faster. Both plugins would look and behave exactly the same. The C++ plugin might be faster in certain spots, but for the type of plugin this is, that's not a huge deal. So my question is, would a Python plugin be considered not as professional/sellable as a C++ plugin, even if it looks and acts EXACTLY the same as a C++ plugin?
0
c++,python
2010-07-18T21:42:00.000
0
3,277,376
I think it doesn't matter. It all come down to 'use the right tool for the right job'. Your primary goal should be to make the best plugin you can. So if you feel more at ease with Python use that. It will probably take you less time to write. The client probably doesn't mind it and just want the most stable, reliable, cheapest, easiest to use plugin. So concentrate on that not on the tool.
0
815
false
0
1
Is Python-based software considered less-professional than C++/compiled software?
3,277,403
5
5
0
2
2
1
0.07983
0
I was thinking of improving my python and just recently read an article about the python-fuse library. I'm always interested about filesystem stuff so I thought this would be a good library to hack on. What I can't come up with is an idea of what I should implement with this. Do you guys have any suggestions or ideas that you can share?
0
python,project,fuse
2010-07-19T05:05:00.000
0
3,278,567
What about a versioned file-system? It has always seemed like a cool idea since I read about the implementation in Plan 9. You wouldn't have to write the versioning part as you could use an off-the-shelf version control like git. The contents of the repository could be exposed as a file hierarchy, older versions could be read-only directories and write access to files in the repository could trigger a commit. The original versions of sshfs used a FUSE frontend that fired shell commands out the back to move around in the target file-system. You could implement something similar quite easily to output git commands and act on the repository.
0
461
false
0
1
interesting project that I can implement with fuse-python
3,396,712
5
5
0
0
2
1
0
0
I was thinking of improving my python and just recently read an article about the python-fuse library. I'm always interested about filesystem stuff so I thought this would be a good library to hack on. What I can't come up with is an idea of what I should implement with this. Do you guys have any suggestions or ideas that you can share?
0
python,project,fuse
2010-07-19T05:05:00.000
0
3,278,567
I do not know if python is appropriate, but maybe you can provide URL handlers for fuse in Firefox. for example: sshfs://host/path would allow to explore remote ssh host via Firefox browser.
0
461
false
0
1
interesting project that I can implement with fuse-python
3,278,603
5
5
0
0
2
1
0
0
I was thinking of improving my python and just recently read an article about the python-fuse library. I'm always interested about filesystem stuff so I thought this would be a good library to hack on. What I can't come up with is an idea of what I should implement with this. Do you guys have any suggestions or ideas that you can share?
0
python,project,fuse
2010-07-19T05:05:00.000
0
3,278,567
Maybe a filesystem where files behave like directories, so you can store files in files. Or a filesystem where you can store files with the same name in 1 directory.
0
461
false
0
1
interesting project that I can implement with fuse-python
3,278,606
5
5
0
1
2
1
0.039979
0
I was thinking of improving my python and just recently read an article about the python-fuse library. I'm always interested about filesystem stuff so I thought this would be a good library to hack on. What I can't come up with is an idea of what I should implement with this. Do you guys have any suggestions or ideas that you can share?
0
python,project,fuse
2010-07-19T05:05:00.000
0
3,278,567
Mounting an xml file as a filesystem, where elements are directories, and their contents is stored as a plain file. The attributes are stored in an "attributes" file as newline separated name: value pairs in each directory. This would allow XML to be modified using the common shell tools. (sed, grep, mkdir, rm, rmdir, cat, vim, etc...) An elegant solution would have to be found for multiple elements with the same name. So it's a bit far field. You never said that it had to be a good idea.
0
461
false
0
1
interesting project that I can implement with fuse-python
3,289,412
5
5
0
2
2
1
0.07983
0
I was thinking of improving my python and just recently read an article about the python-fuse library. I'm always interested about filesystem stuff so I thought this would be a good library to hack on. What I can't come up with is an idea of what I should implement with this. Do you guys have any suggestions or ideas that you can share?
0
python,project,fuse
2010-07-19T05:05:00.000
0
3,278,567
The typical 'cool' things with FUSE are exposing in a filesystem interface things that aren't files, and usually are stored somewhere else. Existing examples: Gmail filesystem, SSH filesystem. Non existing (that I know of) examples: a Twitter filesystem, that shows tweets as files. Or a Stack Overflow filesystem, questions and answers as files.
0
461
false
0
1
interesting project that I can implement with fuse-python
3,278,611
1
2
0
0
4
0
0
1
I want to make a python script that tests the bandwidth of a connection. I am thinking of downloading/uploading a file of a known size using urllib2, and measuring the time it takes to perform this task. I would also like to measure the delay to a given IP address, such as is given by pinging the IP. Is this possible using urllib2?
0
python,urllib2,bandwidth
2010-07-19T10:52:00.000
0
3,280,391
You could download an empty file to measure the delay. You measure more the only the network delay, but the difference should be too big I expect.
0
1,534
false
0
1
Bandwidth test, delay test using urllib2
3,280,448
3
4
0
1
3
0
0.049958
1
On a linux box I've got a python script that's always started from predefined user. It may take a while for it to finish so I want to allow other users to stop it from the web. Using kill fails with Operation not permitted. Can I somehow modify my long running python script so that it'll recive a signal from another user? Obviously, that another user is the one that starts a web server. May be there's entirely different way to approach this problem I can't think of right now.
0
python,linux,signals,kill
2010-07-19T12:46:00.000
0
3,281,107
If you do not want to execute the kill command with the correct permissions, you can send any other signal to the other script. It is then the other scripts' responsibility to terminate. You cannot force it, unless you have the permissions to do so. This can happen with a network connection, or a 'kill' file whose existence is checked by the other script, or anything else the script is able to listen to.
0
332
false
0
1
terminate script of another user
3,281,123
3
4
0
1
3
0
0.049958
1
On a linux box I've got a python script that's always started from predefined user. It may take a while for it to finish so I want to allow other users to stop it from the web. Using kill fails with Operation not permitted. Can I somehow modify my long running python script so that it'll recive a signal from another user? Obviously, that another user is the one that starts a web server. May be there's entirely different way to approach this problem I can't think of right now.
0
python,linux,signals,kill
2010-07-19T12:46:00.000
0
3,281,107
Off the top of my head, one solution would be threading the script and waiting for a kill signal via some form or another. Or rather than threading, you could have a file that the script checks every N times through a loop - then you just write a kill signal to that file (which of course has write permissions by the web user). I'm not terribly familiar with kill, other than killing my own scripts, so there may be a better solution.
0
332
false
0
1
terminate script of another user
3,281,132
3
4
0
0
3
0
0
1
On a linux box I've got a python script that's always started from predefined user. It may take a while for it to finish so I want to allow other users to stop it from the web. Using kill fails with Operation not permitted. Can I somehow modify my long running python script so that it'll recive a signal from another user? Obviously, that another user is the one that starts a web server. May be there's entirely different way to approach this problem I can't think of right now.
0
python,linux,signals,kill
2010-07-19T12:46:00.000
0
3,281,107
You could use sudo to perform the kill command as root, but that is horrible practice. How about having the long-running script check some condition every x seconds, for example the existence of a file like /tmp/stop-xyz.txt? If that file is found, the script terminates itself immediately. (Or any other means of inter-process communication - it doesn't matter.)
0
332
false
0
1
terminate script of another user
3,281,121
1
2
0
0
1
0
0
0
I have 5 python cgi pages. I can navigate from one page to another. All pages get their data from the same database table just that they use different queries. The problem is that the application as a whole is slow. Though they connect to the same database, each page creates a new handle every time I visit it and handles are not shared by the pages. I want to improve performance. Can I do that by setting up sessions for the user? Suggestions/Advices are welcome. Thanks
1
python,cgi
2010-07-20T11:15:00.000
0
3,289,330
Django and Pylons are both frameworks that solve this problem quite nicely, namely by abstracting the DB-frontend integration. They are worth considering.
0
179
false
1
1
Improving performance of cgi
3,289,546
3
5
0
4
10
1
0.158649
0
I realize that in most cases, it's preferred in Python to just access attributes directly, since there's no real concept of encapsulation like there is in Java and the like. However, I'm wondering if there aren't any exceptions, particularly with abstract classes that have disparate implementations. Let's say I'm writing a bunch of abstract classes (because I am) and that they represent things having to do with version control systems like repositories and revisions (because they do). Something like an SvnRevision and an HgRevision and a GitRevision are very closely semantically linked, and I want them to be able to do the same things (so that I can have code elsewhere that acts on any kind of Repository object, and is agnostic of the subclass), which is why I want them to inherit from an abstract class. However, their implementations vary considerably. So far, the subclasses that have been implemented share a lot of attribute names, and in a lot of code outside of the classes themselves, direct attribute access is used. For example, every subclass of Revision has an author attribute, and a date attribute, and so on. However, the attributes aren't described anywhere in the abstract class. This seems to me like a very fragile design. If someone wants to write another implementation of the Revision class, I feel like they should be able to do so just by looking at the abstract class. However, an implementation of the class that satisfies all of the abstract methods will almost certainly fail, because the author won't know that they need attributes called 'author' and 'date' and so on, so code that tries to access Revision.author will throw an exception. Probably not hard to find the source of the problem, but irritating nonetheless, and it just feels like an inelegant design. My solution was to write accessor methods for the abstract classes (get_id, get_author, etc.). I thought this was actually a pretty clean solution, since it eliminates arbitrary restrictions on how attributes are named and stored, and just makes clear what data the object needs to be able to access. Any class that implements all of the methods of the abstract class will work... that feels right. Anyways, the team I'm working with hates this solution (seemingly for the reason that accessors are unpythonic, which I can't really argue with). So... what's the alternative? Documentation? Or is the problem I'm imagining a non-issue? Note: I've considered properties, but I don't think they're a cleaner solution.
0
python,inheritance,interface,attributes,abstract-class
2010-07-20T17:26:00.000
0
3,292,631
You've missed the point. It isn't the lack of encapsulation that removes the need for accessors, it's the fact that, by changing from a direct attribute to a property, you can add an accessor at a later time without changing the published interface in any way. In many other languages, if you expose an attribute as public and then later want to wrap some code round it on access or mutation then you have to change the interface and anyone using the code has at the very least to recompile and possibly to edit their code also. Python isn't like that: you can flip flop between attribute or property just as much as you want and no code that uses the class will break.
0
5,980
false
0
1
Are accessors in Python ever justified?
3,292,765
3
5
0
0
10
1
0
0
I realize that in most cases, it's preferred in Python to just access attributes directly, since there's no real concept of encapsulation like there is in Java and the like. However, I'm wondering if there aren't any exceptions, particularly with abstract classes that have disparate implementations. Let's say I'm writing a bunch of abstract classes (because I am) and that they represent things having to do with version control systems like repositories and revisions (because they do). Something like an SvnRevision and an HgRevision and a GitRevision are very closely semantically linked, and I want them to be able to do the same things (so that I can have code elsewhere that acts on any kind of Repository object, and is agnostic of the subclass), which is why I want them to inherit from an abstract class. However, their implementations vary considerably. So far, the subclasses that have been implemented share a lot of attribute names, and in a lot of code outside of the classes themselves, direct attribute access is used. For example, every subclass of Revision has an author attribute, and a date attribute, and so on. However, the attributes aren't described anywhere in the abstract class. This seems to me like a very fragile design. If someone wants to write another implementation of the Revision class, I feel like they should be able to do so just by looking at the abstract class. However, an implementation of the class that satisfies all of the abstract methods will almost certainly fail, because the author won't know that they need attributes called 'author' and 'date' and so on, so code that tries to access Revision.author will throw an exception. Probably not hard to find the source of the problem, but irritating nonetheless, and it just feels like an inelegant design. My solution was to write accessor methods for the abstract classes (get_id, get_author, etc.). I thought this was actually a pretty clean solution, since it eliminates arbitrary restrictions on how attributes are named and stored, and just makes clear what data the object needs to be able to access. Any class that implements all of the methods of the abstract class will work... that feels right. Anyways, the team I'm working with hates this solution (seemingly for the reason that accessors are unpythonic, which I can't really argue with). So... what's the alternative? Documentation? Or is the problem I'm imagining a non-issue? Note: I've considered properties, but I don't think they're a cleaner solution.
0
python,inheritance,interface,attributes,abstract-class
2010-07-20T17:26:00.000
0
3,292,631
The discussion already ended a year ago, but this snippet seemed telltale, it's worth discussing: However, an implementation of the class that satisfies all of the abstract methods will almost certainly fail, because the author won't know that they need attributes called 'author' and 'date' and so on, so code that tries to access Revision.author will throw an exception. Uh, something is deeply wrong. (What S. Lott said, minus the personal comments). If these are required members, aren't they referenced (if not required) in the constructor, and defined by docstring? or at very least, as required args of methods, and again documented? How could users of the class not know what the required members are? To be the devil's advocate, what if your constructor(s) requires you to supply all the members that will/may be required, what issue does that cause? Also, are you checking the parameters when passed, and throwing informative exceptions? (The ideological argument of accessor-vs-property is a sidebar. Properties are preferable but I don't think that's the issue with your class design.)
0
5,980
false
0
1
Are accessors in Python ever justified?
6,562,247
3
5
0
1
10
1
0.039979
0
I realize that in most cases, it's preferred in Python to just access attributes directly, since there's no real concept of encapsulation like there is in Java and the like. However, I'm wondering if there aren't any exceptions, particularly with abstract classes that have disparate implementations. Let's say I'm writing a bunch of abstract classes (because I am) and that they represent things having to do with version control systems like repositories and revisions (because they do). Something like an SvnRevision and an HgRevision and a GitRevision are very closely semantically linked, and I want them to be able to do the same things (so that I can have code elsewhere that acts on any kind of Repository object, and is agnostic of the subclass), which is why I want them to inherit from an abstract class. However, their implementations vary considerably. So far, the subclasses that have been implemented share a lot of attribute names, and in a lot of code outside of the classes themselves, direct attribute access is used. For example, every subclass of Revision has an author attribute, and a date attribute, and so on. However, the attributes aren't described anywhere in the abstract class. This seems to me like a very fragile design. If someone wants to write another implementation of the Revision class, I feel like they should be able to do so just by looking at the abstract class. However, an implementation of the class that satisfies all of the abstract methods will almost certainly fail, because the author won't know that they need attributes called 'author' and 'date' and so on, so code that tries to access Revision.author will throw an exception. Probably not hard to find the source of the problem, but irritating nonetheless, and it just feels like an inelegant design. My solution was to write accessor methods for the abstract classes (get_id, get_author, etc.). I thought this was actually a pretty clean solution, since it eliminates arbitrary restrictions on how attributes are named and stored, and just makes clear what data the object needs to be able to access. Any class that implements all of the methods of the abstract class will work... that feels right. Anyways, the team I'm working with hates this solution (seemingly for the reason that accessors are unpythonic, which I can't really argue with). So... what's the alternative? Documentation? Or is the problem I'm imagining a non-issue? Note: I've considered properties, but I don't think they're a cleaner solution.
0
python,inheritance,interface,attributes,abstract-class
2010-07-20T17:26:00.000
0
3,292,631
"they should be able to do so just by looking at the abstract class" Don't know what this should be true. A "programmer's guide", a "how to extend" document, plus some training seems appropriate to me. "the author won't know that they need attributes called 'author' and 'date' and so on". In that case, the documentation isn't complete. Perhaps the abstract class needs a better docstring. Or a "programmer's guide", or a "how to extend" document. Also, it doesn't seem very difficult to (1) document these attributes in the docstring and (2) provide default values in the __init__ method. What's wrong with providing extra support for programmers? It sounds like you have a social problem, not a technical one. Writing code to solve a social problem seems like a waste of time and money.
0
5,980
false
0
1
Are accessors in Python ever justified?
3,292,748
4
4
0
5
3
1
1.2
0
If I'm writing a library in C that includes a Python interface, is it OK to just write unit tests for the functions, etc in the Python interface? Assuming the Python interface is complete, it should imply the C code works. Mostly I'm being lazy in that the Python unit test thing takes almost zero effort to use. thanks, -nick
0
python,c,unit-testing
2010-07-20T21:30:00.000
0
3,294,526
Tests through the Python interface will be valuable acceptance tests for your library. They will not however be unit tests. Unit tests are written by the same coders, in the same language, on the same platform as the unit which they test. These should be written too! You're right, though, unit testing in Python is far easier than C++ (or even C, which is what you said!).
0
217
true
0
1
trickle down unit tests
3,298,479
4
4
0
0
3
1
0
0
If I'm writing a library in C that includes a Python interface, is it OK to just write unit tests for the functions, etc in the Python interface? Assuming the Python interface is complete, it should imply the C code works. Mostly I'm being lazy in that the Python unit test thing takes almost zero effort to use. thanks, -nick
0
python,c,unit-testing
2010-07-20T21:30:00.000
0
3,294,526
Ideally, you'd write unit tests for each. Your Python library calls probably (hopefully?) don't have a one-to-one correspondence to your C library calls, because that wouldn't be a very Pythonic interface, so if you only unit test your Python interface, there would be variations and sequences of C library calls that weren't tested.
0
217
false
0
1
trickle down unit tests
3,294,592
4
4
0
1
3
1
0.049958
0
If I'm writing a library in C that includes a Python interface, is it OK to just write unit tests for the functions, etc in the Python interface? Assuming the Python interface is complete, it should imply the C code works. Mostly I'm being lazy in that the Python unit test thing takes almost zero effort to use. thanks, -nick
0
python,c,unit-testing
2010-07-20T21:30:00.000
0
3,294,526
If you only care if the Python library works, then test that. This will give you significant confirmation that the C library is robust, but the maxim "if you didn't test it, it doesn't work" still mostly applies and I wouldn't export the library without the test harness. You could, in theory, test that the processor microcode is doing its job properly but one usually doesn't.
0
217
false
0
1
trickle down unit tests
3,294,582
4
4
0
0
3
1
0
0
If I'm writing a library in C that includes a Python interface, is it OK to just write unit tests for the functions, etc in the Python interface? Assuming the Python interface is complete, it should imply the C code works. Mostly I'm being lazy in that the Python unit test thing takes almost zero effort to use. thanks, -nick
0
python,c,unit-testing
2010-07-20T21:30:00.000
0
3,294,526
I see two mains restrictions to unit testing thru the Python interface. Whether it is OK to testing with those restrictions or not depends on what the library does, how it is implemented, and on the alignment of the Python interface on the interface of the C library. the library can only be exercised the way the Python library is using it. This is not a problem as far as the Python interface is the only client of the C library. the Python unit tests do not have access to the internals of the C library as unit tests written in C would have: only what is exposed via the Python interface is reachable. Therefore if a problem arises after 10 calls to the Python interface, 10 calls will be needed to reproduce it, while a unit test written in C could create the fixture directly, without the 10 calls. This can make Python tests slower. the Python unit tests couldn't be as isolated as C unit tests could be as they may not been able to reset the internals of the library
0
217
false
0
1
trickle down unit tests
3,298,110
2
2
0
2
5
0
1.2
0
I've got 2 problems with Eric4 IDE. Can't find an option in preferences to autosave my changed files before running script. It's very annoying that I have to save my file and then run script. Second problem is running a script. I can't find any button to run a script/project instantly. 'Run Script' button always opens a setting window.
0
python,ide
2010-07-21T00:27:00.000
0
3,295,448
One way to get around this, as it seems there is no built in way is to bind a key to save the file (ctrl+s), then run the script (F2), and finally hit enter (to close the settings window and run the code).
0
2,425
true
0
1
Eric4 Python IDE - autosave and quick script/project start, run
3,296,442
2
2
0
2
5
0
0.197375
0
I've got 2 problems with Eric4 IDE. Can't find an option in preferences to autosave my changed files before running script. It's very annoying that I have to save my file and then run script. Second problem is running a script. I can't find any button to run a script/project instantly. 'Run Script' button always opens a setting window.
0
python,ide
2010-07-21T00:27:00.000
0
3,295,448
This bothered me a lot too, and I know this is 2 years late but it might help some else who comes here looking for this very solution, like I did. Here are the actual answers, ERIC v4.4: Press F4 instead of F2. The first time you have to use F2 to 'Start' the script, so dismiss the settings window. After that you can use F4 'Restart' and it will run with the settings you chose initially. The Autosave option is well hidden unfortunately: Settings-->Preferences-->Debugger-->General-->!Scroll down to!-->Start Debugging-->Autosave changed scripts And you were spot on - these two things do have a huge impact on productivity.
0
2,425
false
0
1
Eric4 Python IDE - autosave and quick script/project start, run
10,222,754
3
5
1
0
12
0
0
0
I'm confronted with the task of making a C++ app scriptable by users. The app has been in development for several years with no one wasting a thought on this before. It contains all sorts of niceties like multithreading, template wizardry and multiple inheritance. As the scripting language, Python is preferred, but Lua might be accepted if it is significantly easier to implement. Question 1 From what I have learned so far, there are broadly speaking two ways to integrate Python/Lua with C++ : "extending" and "embedding". In this case, it looks like I need both. The scripting language need access to objects, methods and data from the app but needs to be called by the app once the user has written the script - without restarting anything. How is this usually done in the real world? Question 2 There seems to be a bewildering array of of manual solutions and binding generators out there, all of them less than perfect. swig, pyste, Py++, ctypes, Boost.Python sip, PyCXX, pybindgen, robin, (Cython/Pyrex, Weave) CppLua, Diluculum, Luabind, Luabridge, LuaCpp, Luna/LunaWrapper, MLuaBind, MultiScript, OOLua, SLB, Sweet Lua, lux (this list from the lua wiki) CPB, tolua, tolua++, toLuaxx, luna and again swig Most commments on these found on the web are a little out of date. For example, swig is said to be difficult in non-trivial cases and to generate incomprehensible code. OTOH, it has recently gone to v2.0. Some of the above use pygccxml to let gcc analyze the C++ code and then genarate the binding. I find this idea appealing, as gcc probably understands the code better than i do :-). Does this work well? Testing them all might easily cost me half of the time allocated for the whole project. So, which ones do you recommend?
0
c++,python,binding,lua,scriptable
2010-07-21T12:18:00.000
0
3,299,067
My experience may not be much, but I figure it's at least worth what you paid for it ;) I've done some basic "hello world" python modules, and I couldn't really get into swig - it seemed like a lot of overhead for what I was doing. Of course it's also possible that it's just the right amount for your needs.
0
1,926
false
0
1
How do I make a nasty C++ program scriptable with Python and/or Lua?
3,299,189