CreationDate
stringlengths
23
23
Data Science and Machine Learning
int64
0
1
Q_Id
int64
469
38.2M
Q_Score
int64
0
6.79k
Python Basics and Environment
int64
0
1
is_accepted
bool
2 classes
Question
stringlengths
15
7.24k
Networking and APIs
int64
0
1
Score
float64
-1
1.2
A_Id
int64
518
72.2M
Web Development
int64
0
1
AnswerCount
int64
1
35
Answer
stringlengths
15
7k
Title
stringlengths
15
142
Tags
stringlengths
6
76
GUI and Desktop Applications
int64
0
1
ViewCount
int64
13
1.88M
Other
int64
1
1
Available Count
int64
1
31
Users Score
int64
-17
588
Database and SQL
int64
0
1
System Administration and DevOps
int64
0
1
2008-08-02T15:11:00.000
0
469
47
0
false
I am using the Photoshop's javascript API to find the fonts in a given PSD. Given a font name returned by the API, I want to find the actual physical font file that font name corresponds to on the disc. This is all happening in a python program running on OSX so I guess I'm looking for one of: Some Photoshop javascript A Python function An OSX API that I can call from python
0
1
518
1
4
I haven't been able to find anything that does this directly. I think you'll have to iterate through the various font folders on the system: /System/Library/Fonts, /Library/Fonts, and there can probably be a user-level directory as well ~/Library/Fonts.
How can I find the full path to a font from its display name on a Mac?
python,macos,fonts,photoshop
0
4,225
1
2
6
0
0
2008-08-02T15:11:00.000
0
469
47
0
true
I am using the Photoshop's javascript API to find the fonts in a given PSD. Given a font name returned by the API, I want to find the actual physical font file that font name corresponds to on the disc. This is all happening in a python program running on OSX so I guess I'm looking for one of: Some Photoshop javascript A Python function An OSX API that I can call from python
0
1.2
3,040
1
4
Unfortunately the only API that isn't deprecated is located in the ApplicationServices framework, which doesn't have a bridge support file, and thus isn't available in the bridge. If you're wanting to use ctypes, you can use ATSFontGetFileReference after looking up the ATSFontRef. Cocoa doesn't have any native support, at least as of 10.5, for getting the location of a font.
How can I find the full path to a font from its display name on a Mac?
python,macos,fonts,photoshop
0
4,225
1
2
21
0
0
2008-08-07T16:43:00.000
0
4,942
14
0
false
When asked to create system XYZ and you ask to do it in Python over PHP or Ruby, what are the main features you can mention when they require you to explain it?
0
0.07486
4,958
0
8
Focus on the shorter time needed for development/prototype and possibly easier maintenance (none of this may apply against Ruby).
How to sell Python to a client/boss/person
php,python,ruby-on-rails,ruby
0
1,421
1
6
3
0
0
2008-08-07T16:43:00.000
0
4,942
14
0
false
When asked to create system XYZ and you ask to do it in Python over PHP or Ruby, what are the main features you can mention when they require you to explain it?
0
0.07486
5,014
0
8
I would consider that using python on a new project is completely dependent on what problem you are trying to solve with python. If you want someone to agree with you that you should use python, then show them how python's features apply specifically to that problem. In the case of web development with python, talk about WSGI and other web libraries and frameworks you could use that would make your life easier. One note for python is that most of the frameworks for python web development can be plugged right into any current project. With ruby on rails, you're practically working in a DSL that anyone who uses your project will have to learn. If they know python, then they can figure out what you are doing with django, etc in a day. I'm only talking about web development because it appears that's what you are going to be working on seeing ruby, python and PHP in the same list. The real message that's important is applying to whatever it is you like about python directly to some problem you are trying to solve.
How to sell Python to a client/boss/person
php,python,ruby-on-rails,ruby
0
1,421
1
6
3
0
0
2008-08-07T16:43:00.000
0
4,942
14
0
true
When asked to create system XYZ and you ask to do it in Python over PHP or Ruby, what are the main features you can mention when they require you to explain it?
0
1.2
4,978
0
8
This is one of those cases that really boil down to personal preference or situational details. If you're more comfortable and experienced with Python, then say so. Are they asking you to justify it because they're more comfortable with one of the other environments? After you're done, will the system be passed off to someone else for long-term maintenance? If they ask you to use a technology or language that you're not as familiar with, then make sure they know up-front that it's going to take you longer.
How to sell Python to a client/boss/person
php,python,ruby-on-rails,ruby
0
1,421
1
6
13
0
0
2008-08-07T16:43:00.000
0
4,942
14
0
false
When asked to create system XYZ and you ask to do it in Python over PHP or Ruby, what are the main features you can mention when they require you to explain it?
0
0.124353
15,296
0
8
It's one of the preferred languages over at Google - It's several years ahead of Ruby in terms of "maturity" (what ever that really means - but managers like that). Since it's prefered by Google you can also run it on the Google App Engine. Mircosoft is also embracing Python, and will have a v2.0 of IronPython coming out shortly. They are working on a Ruby implementation as well, but the Python version is way ahead, and is actually "ready for primetime". That give you the possibility for easy integration with .NET code, as well as being able to write client side RIAs in Python when Silverlight 2 ships.
How to sell Python to a client/boss/person
php,python,ruby-on-rails,ruby
0
1,421
1
6
5
0
0
2008-08-07T16:43:00.000
0
4,942
14
0
false
When asked to create system XYZ and you ask to do it in Python over PHP or Ruby, what are the main features you can mention when they require you to explain it?
0
0.024995
9,420,311
0
8
Give them a snippet of code in each (no more than a page) that performs some cool function that they will like. (e.g show outliers in a data set). Show them each page. One in PHP, Ruby and Python. Ask them which they find easiest to understand/read. Tell them thats why you want to use Python. It's easier to read if you've not written it, more manageable, less buggy and quicker to build features because it is the most elegant (pythonic)
How to sell Python to a client/boss/person
php,python,ruby-on-rails,ruby
0
1,421
1
6
1
0
0
2008-08-07T16:43:00.000
0
4,942
14
0
false
When asked to create system XYZ and you ask to do it in Python over PHP or Ruby, what are the main features you can mention when they require you to explain it?
0
0
15,291
0
8
I agree with mreggen. Tell them by working in Python you can get things done faster. Getting things done faster possibly means money saved by the client. In the least it means that you are working with a language you a more comfortable in, meaning faster development, debugging, and refactoring time. There will be less time spent looking up documentation on what function to use to find the length of a string, etc.
How to sell Python to a client/boss/person
php,python,ruby-on-rails,ruby
0
1,421
1
6
0
0
0
2008-08-07T18:24:00.000
0
5,102
23
0
false
I tried to follow a couple of googled up tutorials on setting up mod_python, but failed every time. Do you have a good, step-by step, rock-solid howto? My dev box is OS X, production - Centos.
0
0
14,791,003
0
4
The problem for me wasn't in Apache set up, but in understanding how mod_apache actually uses the .py files. Module-level statements (including those in a if __name__=='__main__' section) are not executed--I assumed that the stdout from running the script at the commandline would be what the server would output, but that's not how it works. Instead, I wrote a module-level function called index(), and had it return as a string the HTML of the page. It's also possible to have other module-level functions (e.g., otherFunction()) that can be accessed as further segments in the URI (e.g., testScript/otherFunction for the file testScript.py.) Obviously, this makes more sense than my original stdout conception. Better capability of actually using Python as a scripting language and not a humongous markup language.
How do you set up Python scripts to work in Apache 2.0?
python,apache,apache2
0
32,774
1
1
0
0
1
2008-08-12T15:16:00.000
0
8,948
142
0
false
Is there a maintained package I can use to retrieve and set MP3 ID3 metadata using Python?
0
0.012499
31,373,513
0
16
After some initial research I thought songdetails might fit my use case, but it doesn't handle .m4b files. Mutagen does. Note that while some have (reasonably) taken issue with Mutagen's surfacing of format-native keys, that vary from format to format (TIT2 for mp3, title for ogg, \xa9nam for mp4, Title for WMA etc.), mutagen.File() has a (new?) easy=True parameter that provides EasyMP3/EasyID3 tags, which have a consistent, albeit limited, set of keys. I've only done limited testing so far, but the common keys, like album, artist, albumartist, genre, tracknumber, discnumber, etc. are all present and identical for .mb4 and .mp3 files when using easy=True, making it very convenient for my purposes.
Accessing MP3 metadata with Python
python,mp3,metadata
0
140,384
1
1
1
0
0
2008-08-14T13:59:00.000
0
11,060
29
0
false
This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions. I have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed this code I did it using TDD, but I've found my tests to be brittle as hell. Because each test essentially wanted to verify that for a given bit of input code (which happens to be a C++ header) I'd get a given bit of outputted code I wrote a small engine that reads test definitions from XML input files and generates test cases from these expectations. The problem is I dread going in to modify the code at all. That and the fact that the unit tests themselves are a: complex, and b: brittle. So I'm trying to think of alternative approaches to this problem, and it strikes me I'm perhaps tackling it the wrong way. Maybe I need to focus more on the outcome, IE: does the code I generate actually run and do what I want it to, rather than, does the code look the way I want it to. Has anyone got any experiences of something similar to this they would care to share?
0
0
3,331,503
0
8
My recommendation would be to figure out a set of known input-output results, such as some simpler cases that you already have in place, and unit test the code that is produced. It's entirely possible that as you change the generator that the exact string that is produced may be slightly different... but what you really care is whether it is interpreted in the same way. Thus, if you test the results as you would test that code if it were your feature, you will find out if it succeeds in the ways you want. Basically, what you really want to know is whether your generator will produce what you expect without physically testing every possible combination (also: impossible). By ensuring that your generator is consistent in the ways you expect, you can feel better that the generator will succeed in ever-more-complex situations. In this way, you can also build up a suite of regression tests (unit tests that need to keep working correctly). This will help you make sure that changes to your generator aren't breaking other forms of code. When you encounter a bug that your unit tests didn't catch, you may want to include it to prevent similar breakage.
How should I unit test a code-generator?
c++,python,unit-testing,code-generation,swig
1
7,527
1
5
0
0
0
2008-08-14T13:59:00.000
0
11,060
29
0
false
This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions. I have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed this code I did it using TDD, but I've found my tests to be brittle as hell. Because each test essentially wanted to verify that for a given bit of input code (which happens to be a C++ header) I'd get a given bit of outputted code I wrote a small engine that reads test definitions from XML input files and generates test cases from these expectations. The problem is I dread going in to modify the code at all. That and the fact that the unit tests themselves are a: complex, and b: brittle. So I'm trying to think of alternative approaches to this problem, and it strikes me I'm perhaps tackling it the wrong way. Maybe I need to focus more on the outcome, IE: does the code I generate actually run and do what I want it to, rather than, does the code look the way I want it to. Has anyone got any experiences of something similar to this they would care to share?
0
0.124353
11,443
0
8
Recall that "unit testing" is only one kind of testing. You should be able to unit test the internal pieces of your code generator. What you're really looking at here is system level testing (a.k.a. regression testing). It's not just semantics... there are different mindsets, approaches, expectations, etc. It's certainly more work, but you probably need to bite the bullet and set up an end-to-end regression test suite: fixed C++ files -> SWIG interfaces -> python modules -> known output. You really want to check the known input (fixed C++ code) against expected output (what comes out of the final Python program). Checking the code generator results directly would be like diffing object files...
How should I unit test a code-generator?
c++,python,unit-testing,code-generation,swig
1
7,527
1
5
5
0
0
2008-08-14T13:59:00.000
0
11,060
29
0
false
This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions. I have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed this code I did it using TDD, but I've found my tests to be brittle as hell. Because each test essentially wanted to verify that for a given bit of input code (which happens to be a C++ header) I'd get a given bit of outputted code I wrote a small engine that reads test definitions from XML input files and generates test cases from these expectations. The problem is I dread going in to modify the code at all. That and the fact that the unit tests themselves are a: complex, and b: brittle. So I'm trying to think of alternative approaches to this problem, and it strikes me I'm perhaps tackling it the wrong way. Maybe I need to focus more on the outcome, IE: does the code I generate actually run and do what I want it to, rather than, does the code look the way I want it to. Has anyone got any experiences of something similar to this they would care to share?
0
0
11,128
0
8
Yes, results are the ONLY thing that matters. The real chore is writing a framework that allows your generated code to run independently... spend your time there.
How should I unit test a code-generator?
c++,python,unit-testing,code-generation,swig
1
7,527
1
5
0
0
0
2008-08-14T13:59:00.000
0
11,060
29
0
true
This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions. I have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed this code I did it using TDD, but I've found my tests to be brittle as hell. Because each test essentially wanted to verify that for a given bit of input code (which happens to be a C++ header) I'd get a given bit of outputted code I wrote a small engine that reads test definitions from XML input files and generates test cases from these expectations. The problem is I dread going in to modify the code at all. That and the fact that the unit tests themselves are a: complex, and b: brittle. So I'm trying to think of alternative approaches to this problem, and it strikes me I'm perhaps tackling it the wrong way. Maybe I need to focus more on the outcome, IE: does the code I generate actually run and do what I want it to, rather than, does the code look the way I want it to. Has anyone got any experiences of something similar to this they would care to share?
0
1.2
11,074
0
8
I started writing up a summary of my experience with my own code generator, then went back and re-read your question and found you had already touched upon the same issues yourself, focus on the execution results instead of the code layout/look. Problem is, this is hard to test, the generated code might not be suited to actually run in the environment of the unit test system, and how do you encode the expected results? I've found that you need to break down the code generator into smaller pieces and unit test those. Unit testing a full code generator is more like integration testing than unit testing if you ask me.
How should I unit test a code-generator?
c++,python,unit-testing,code-generation,swig
1
7,527
1
5
14
0
0
2008-08-14T13:59:00.000
0
11,060
29
0
false
This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions. I have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed this code I did it using TDD, but I've found my tests to be brittle as hell. Because each test essentially wanted to verify that for a given bit of input code (which happens to be a C++ header) I'd get a given bit of outputted code I wrote a small engine that reads test definitions from XML input files and generates test cases from these expectations. The problem is I dread going in to modify the code at all. That and the fact that the unit tests themselves are a: complex, and b: brittle. So I'm trying to think of alternative approaches to this problem, and it strikes me I'm perhaps tackling it the wrong way. Maybe I need to focus more on the outcome, IE: does the code I generate actually run and do what I want it to, rather than, does the code look the way I want it to. Has anyone got any experiences of something similar to this they would care to share?
0
0
11,235
0
8
If you are running on *nux you might consider dumping the unittest framework in favor of a bash script or makefile. on windows you might consider building a shell app/function that runs the generator and then uses the code (as another process) and unittest that. A third option would be to generate the code and then build an app from it that includes nothing but a unittest. Again you would need a shell script or whatnot to run this for each input. As to how to encode the expected behavior, it occurs to me that it could be done in much the same way as you would for the C++ code just using the generated interface rather than the C++ one.
How should I unit test a code-generator?
c++,python,unit-testing,code-generation,swig
1
7,527
1
5
0
0
0
2008-08-26T08:40:00.000
0
27,567
11
0
false
I've been having a hard time trying to understand PyPy's translation. It looks like something absolutely revolutionary from simply reading the description, however I'm hard-pressed to find good documentation on actually translating a real world piece of code to something such as LLVM. Does such a thing exist? The official PyPy documentation on it just skims over the functionality, rather than providing anything I can try out myself.
0
0.119427
1,041,655
0
5
PyPy translator is in general, not intended for more public use. We use it for translating our own python interpreter (including JIT and GCs, both written in RPython, this restricted subset of Python). The idea is that with good JIT and GC, you'll be able to speedups even without knowing or using PyPy's translation toolchain (and more importantly, without restricting yourself to RPython). Cheers, fijal
Where can I learn more about PyPy's translation function?
python,translation,pypy
0
1,284
1
2
3
0
0
2008-08-26T08:40:00.000
0
27,567
11
0
false
I've been having a hard time trying to understand PyPy's translation. It looks like something absolutely revolutionary from simply reading the description, however I'm hard-pressed to find good documentation on actually translating a real world piece of code to something such as LLVM. Does such a thing exist? The official PyPy documentation on it just skims over the functionality, rather than providing anything I can try out myself.
0
0.039979
1,041,857
0
5
It looks like something absolutely revolutionary from simply reading the description, As far as I know, PyPy is novel in the sense that it is the first system expressly designed for implementing languages. Other tools exist to help with much of the very front end, such as parser generators, or for the very back end, such as code generation, but not much existed for connecting the two.
Where can I learn more about PyPy's translation function?
python,translation,pypy
0
1,284
1
2
1
0
0
2008-08-26T19:49:00.000
0
28,961
8
0
false
I have a medium sized application that runs as a .net web-service which I do not control, and I want to create a loose pythonic API above it to enable easy scripting. I wanted to know what is the best/most practical solution for using web-services in python. Edit: I need to consume a complex soap WS and I have no control over it.
0
0.197375
31,926
0
3
If I have to expose APIs, I prefer doing it as JSON. Python has excellent support for JSON objects (JSON Objects are infact python dictionaries)
What's the best way to use web services in python?
python,web-services,soap
0
1,090
1
1
3
0
0
2008-08-28T14:23:00.000
0
32,385
9
0
false
This is something that I think would be very useful. Basically, I'd like there to be a way to edit Python source programmatically without requiring human intervention. There are a couple of things I would like to do with this: Edit the configuration of Python apps that use source modules for configuration. Set up a "template" so that I can customize a Python source file on the fly. This way, I can set up a "project" system on an open source app I'm working on and allow certain files to be customized. I could probably write something that can do this myself, but I can see that opening up a lot of "devil's in the details" type issues. Are there any ways to do this currently, or am I just going to have to bite the bullet and implement it myself?
0
0
33,325
0
3
I had the same issue and I simply opened the file and did some replace: then reload the file in the Python interpreter. This works fine and is easy to do. Otherwise AFAIK you have to use some conf objects.
Programmatically editing Python source
python,file-io
0
1,904
1
1
0
0
0
2008-08-29T09:24:00.000
0
34,243
10
1
true
Is there something like the Python descriptor protocol implemented in other languages? It seems like a nice way to increase modularity/encapsulation without bloating your containing class' implementation, but I've never heard of a similar thing in any other languages. Is it likely absent from other languages because of the lookup overhead?
0
1.2
34,266
0
2
I've not heard of a direct equivalent either. You could probably achieve the same effect with macros, especially in a language like Lisp which has extremely powerful macros. I wouldn't be at all surprised if other languages start to incorporate something similar because it is so powerful.
Python descriptor protocol analog in other languages?
python,language-features,encapsulation
0
888
1
1
4
0
0
2008-08-29T15:05:00.000
0
34,439
592
1
false
Given a Python object of any kind, is there an easy way to get the list of all methods that this object has? Or, if this is not possible, is there at least an easy way to check if it has a particular method other than simply checking if an error occurs when the method is called?
0
1
20,100,900
0
22
The simplest method is to use dir(objectname). It will display all the methods available for that object.
Finding what methods a Python object has
python,introspection
0
564,030
1
1
132
0
0
2008-08-30T07:08:00.000
0
35,753
29
1
false
Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity). Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it is proper for production use in the development of stand-alone complex applications (think for example to a word processor or a graphic tool)? What IDE would you suggest? The IDLE provided with Python is not enough even for small projects in my opinion.
0
1
35,777
0
13
You'll find mostly two answers to that – the religous one (Yes! Of course! It's the best language ever!) and the other religious one (you gotta be kidding me! Python? No... it's not mature enough). I will maybe skip the last religion (Python?! Use Ruby!). The truth, as always, is far from obvious. Pros: it's easy, readable, batteries included, has lots of good libraries for pretty much everything. It's expressive and dynamic typing makes it more concise in many cases. Cons: as a dynamic language, has way worse IDE support (proper syntax completion requires static typing, whether explicit in Java or inferred in SML), its object system is far from perfect (interfaces, anyone?) and it is easy to end up with messy code that has methods returning either int or boolean or object or some sort under unknown circumstances. My take – I love Python for scripting, automation, tiny webapps and other simple well defined tasks. In my opinion it is by far the best dynamic language on the planet. That said, I would never use it any dynamically typed language to develop an application of substantial size. Say – it would be fine to use it for Stack Overflow, which has three developers and I guess no more than 30k lines of code. For bigger things – first your development would be super fast, and then once team and codebase grow things are slowing down more than they would with Java or C#. You need to offset lack of compilation time checks by writing more unittests, refactorings get harder cause you never know what your refacoring broke until you run all tests or even the whole big app, etc. Now – decide on how big your team is going to be and how big the app is supposed to be once it is done. If you have 5 or less people and the target size is roughly Stack Overflow, go ahead, write in Python. You will finish in no time and be happy with good codebase. But if you want to write second Google or Yahoo, you will be much better with C# or Java. Side-note on C/C++ you have mentioned: if you are not writing performance critical software (say massive parallel raytracer that will run for three months rendering a film) or a very mission critical system (say Mars lander that will fly three years straight and has only one chance to land right or you lose $400mln) do not use it. For web apps, most desktop apps, most apps in general it is not a good choice. You will die debugging pointers and memory allocation in complex business logic.
Is Python good for big software projects (not web based)?
python,ide
0
29,152
1
8
23
0
0
2008-08-30T07:08:00.000
0
35,753
29
1
false
Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity). Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it is proper for production use in the development of stand-alone complex applications (think for example to a word processor or a graphic tool)? What IDE would you suggest? The IDLE provided with Python is not enough even for small projects in my opinion.
0
0
277,490
0
13
I had only one python experience, my trash-cli project. I know that probably some or all problems depends of my inexperience with python. I found frustrating these things: the difficult of finding a good IDE for free the limited support to automatic refactoring Moreover: the need of introduce two level of grouping packages and modules confuses me. it seems to me that there is not a widely adopted code naming convention it seems to me that there are some standard library APIs docs that are incomplete the fact that some standard libraries are not fully object oriented annoys me Although some python coders tell me that they does not have these problems, or they say these are not problems.
Is Python good for big software projects (not web based)?
python,ide
0
29,152
1
8
0
0
0
2008-08-30T07:08:00.000
0
35,753
29
1
false
Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity). Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it is proper for production use in the development of stand-alone complex applications (think for example to a word processor or a graphic tool)? What IDE would you suggest? The IDLE provided with Python is not enough even for small projects in my opinion.
0
1
35,759
0
13
I really like python, it's usually my language of choice these days for small (non-gui) stuff that I do on my own. However, for some larger Python projects I've tackled, I'm finding that it's not quite the same as programming in say, C++. I was working on a language parser, and needed to represent an AST in Python. This is certainly within the scope of what Python can do, but I had a bit of trouble with some refactoring. I was changing the representation of my AST and changing methods and classes around a lot, and I found I missed the strong typing that would be available to me in a C++ solution. Python's duck typing was almost too flexible and I found myself adding a lot of assert code to try to check my types as the program ran. And then I couldn't really be sure that everything was properly typed unless I had 100% code coverage testing (which I didn't at the time). Actually, that's another thing that I miss sometimes. It's possible to write syntactically correct code in Python that simply won't run. The compiler is incapable of telling you about it until it actually executes the code, so in infrequently-used code paths such as error handlers you can easily have unseen bugs lurking around. Even code that's as simple as printing an error message with a % format string can fail at runtime because of mismatched types. I haven't used Python for any GUI stuff so I can't comment on that aspect.
Is Python good for big software projects (not web based)?
python,ide
0
29,152
1
8
13
0
0
2008-08-30T07:08:00.000
0
35,753
29
1
false
Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity). Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it is proper for production use in the development of stand-alone complex applications (think for example to a word processor or a graphic tool)? What IDE would you suggest? The IDLE provided with Python is not enough even for small projects in my opinion.
0
0
35,838
0
13
I know I'm probably stating the obvious, but don't forget that the quality of the development team and their familiarity with the technology will have a major impact on your ability to deliver. If you have a strong team, then it's probably not an issue if they're familiar. But if you have people who are more 9 to 5'rs who aren't familiar with the technology, they will need more support and you'd need to make a call if the productivity gains are worth whatever the cost of that support is.
Is Python good for big software projects (not web based)?
python,ide
0
29,152
1
8
0
0
0
2008-08-30T07:08:00.000
0
35,753
29
1
false
Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity). Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it is proper for production use in the development of stand-alone complex applications (think for example to a word processor or a graphic tool)? What IDE would you suggest? The IDLE provided with Python is not enough even for small projects in my opinion.
0
0.015383
286,449
0
13
And as far as I know they use a lot of python inside google too. Well i'd hope so, the maker of python still works at google if i'm not mistaken? As for the use of Python, i think it's a great language for stand-alone apps. It's heavily used in a lot of Linux programs, and there are a few nice widget sets out there to aid in the development of GUI's.
Is Python good for big software projects (not web based)?
python,ide
0
29,152
1
8
1
0
0
2008-08-30T07:08:00.000
0
35,753
29
1
false
Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity). Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it is proper for production use in the development of stand-alone complex applications (think for example to a word processor or a graphic tool)? What IDE would you suggest? The IDLE provided with Python is not enough even for small projects in my opinion.
0
0.015383
286,491
0
13
Python is a delight to use. I use it routinely and also write a lot of code for work in C#. There are two drawbacks to writing UI code in Python. one is that there is not a single ui framework that is accepted by the majority of the community. when you write in c# the .NET runtime and class libraries are all meant to work together. With Python every UI library has at's own semantics which are often at odds with the pythonic mindset in which you are trying to write your program. I am not blaming the library writers. I've tried several libraries (wxwidgets, PythonWin[Wrapper around MFC], Tkinter), When doing so I often felt that I was writing code in a language other than Python (despite the fact that it was python) because the libraries aren't exactly pythonic they are a port from another language be it c, c++, tk. So for me I will write UI code in .NET (for me C#) because of the IDE & the consistency of the libraries. But when I can I will write business logic in python because it is more clear and more fun.
Is Python good for big software projects (not web based)?
python,ide
0
29,152
1
8
1
0
0
2008-08-30T07:08:00.000
0
35,753
29
1
false
Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity). Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it is proper for production use in the development of stand-alone complex applications (think for example to a word processor or a graphic tool)? What IDE would you suggest? The IDLE provided with Python is not enough even for small projects in my opinion.
0
0
3,445,481
0
13
Try Django or Pylons, write a simple app with both of them and then decide which one suits you best. There are others (like Turbogears or Werkzeug) but those are the most used.
Is Python good for big software projects (not web based)?
python,ide
0
29,152
1
8
0
0
0
2008-08-30T07:08:00.000
0
35,753
29
1
false
Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity). Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it is proper for production use in the development of stand-alone complex applications (think for example to a word processor or a graphic tool)? What IDE would you suggest? The IDLE provided with Python is not enough even for small projects in my opinion.
0
0.046121
35,841
0
13
Refactoring is inevitable on larger codebases and the lack of static typing makes this much harder in python than in statically typed languages.
Is Python good for big software projects (not web based)?
python,ide
0
29,152
1
8
3
0
0
2008-08-31T05:07:00.000
0
36,647
20
0
false
Does Python have a unit testing framework compatible with the standard xUnit style of test framework? If so, what is it, where is it, and is it any good?
0
0.022219
1,310,119
0
9
I recommend Nose. After the reasonable simple installation, you just have to run "nosetests" in your project folder and Nose will find all your tests and run them. I also like the collection of plugins (coverage, GAE, etc.) and the abilty to call Nose directly from within my Python scripts.
Unit tests in Python
python,unit-testing
0
8,490
1
3
1
0
0
2008-08-31T05:07:00.000
0
36,647
20
0
false
Does Python have a unit testing framework compatible with the standard xUnit style of test framework? If so, what is it, where is it, and is it any good?
0
0
2,194,729
0
9
nose seems to be the best combination of flexibility and convenience. It runs unittests, doctests, coverage (with an extension) and py.test-like tests from one framework and does so admirably. It has enough popularity that it has had some IDE integration done as well for Komodo Edit and I wouldn't be surprised to see it elsewhere as well. I like it for one strong reason: I almost always doctest before writing more extensive tests in another framework. This is because, for basic tests, doctests kill two birds with one stone. You get executable tests (although they are a bit clumsy to write well sometimes) as well as API documentation and interactive documentation at the same time. nose will run these with the bundled doctest extension when you use a command-line option (--with-doctest). I say this having come from py.test as my former favorite. While it is great, nose tests are similar enough to me that I don't miss it, and I like the integration of the various test methodologies under one roof, so to speak. YMMV, but I recommend taking a good look at nose before choosing another. If you aren't familiar with py.test tests, you should look at them as well. I find them terrific because they are usually written in such a way that they can be easily debugged without the testing framework, which makes one less tricky system involved in the debugging session. I find that alone invaluable, while they are also easier to write than unittest tests in my opinion.
Unit tests in Python
python,unit-testing
0
8,490
1
3
0
0
0
2008-08-31T05:07:00.000
0
36,647
20
0
false
Does Python have a unit testing framework compatible with the standard xUnit style of test framework? If so, what is it, where is it, and is it any good?
0
0.044415
36,654
0
9
@Greg: PyUnit is included in the standard library as unittest
Unit tests in Python
python,unit-testing
0
8,490
1
3
2
0
0
2008-09-03T21:52:00.000
0
42,690
5
1
false
I'd like to take some time to learn more about dynamic languages built on top of the DLR and I'm not sure which language would be better to learn. Having limited time, I really only have time to look learn one of them. Any opinions on which of the two (Iron Ruby or Iron Python) would be more useful in the long run?
0
0.16514
42,702
0
6
Without getting into the relative merits of the languages (which would be an entire pissing contest in itself), IronPython (stable 1.1.1, beta 2.0) is further along in development than IronRuby (alpha)
Which Dynamic .NET language makes more sense to learn, Iron Ruby or Iron Python?
.net,ironpython,ironruby,dynamic-language-runtime,dynamic-languages
0
1,222
1
3
5
0
0
2008-09-03T21:52:00.000
0
42,690
5
1
false
I'd like to take some time to learn more about dynamic languages built on top of the DLR and I'm not sure which language would be better to learn. Having limited time, I really only have time to look learn one of them. Any opinions on which of the two (Iron Ruby or Iron Python) would be more useful in the long run?
0
0.033321
467,185
0
6
I just want to mention that there is also a DLR version of Javascript(JScript), which is my personal fav. If you are looking for a new language to learn for dlr use, I'd suggest ironpython as mentioned, it is farther along in terms of the dlr. Python is also fairly popular outside the dlr for gui programming, and offers Django for mvc web apps. This is purely subjective, but I think that ruby popularity is waning a bit. In the long run I feel it will be like perl, used and respected, but a drop in the bucket compared to other options. I happen to really like ruby (and perl), but wouldn't suggest it as a new path for your intended purpose.
Which Dynamic .NET language makes more sense to learn, Iron Ruby or Iron Python?
.net,ironpython,ironruby,dynamic-language-runtime,dynamic-languages
0
1,222
1
3
1
0
0
2008-09-03T21:52:00.000
0
42,690
5
1
true
I'd like to take some time to learn more about dynamic languages built on top of the DLR and I'm not sure which language would be better to learn. Having limited time, I really only have time to look learn one of them. Any opinions on which of the two (Iron Ruby or Iron Python) would be more useful in the long run?
0
1.2
61,734
0
6
If this is 'Which language runs better on the CLR,' then right now, IronPython wins hands down. For the long term though, 'which language will teach me more, and serve me better in my career as a programmer', I would definitely say IronRuby (this would be true of CPython vs CRuby also) Ruby will expose you to more 'concepts' than python does, due to it being more liberal in how it handles things like lambda functions, code blocks, eval, and so on. Anyway, this is probably going to descend into a flame-war. Sorry
Which Dynamic .NET language makes more sense to learn, Iron Ruby or Iron Python?
.net,ironpython,ironruby,dynamic-language-runtime,dynamic-languages
0
1,222
1
3
4
0
0
2008-09-04T12:07:00.000
0
43,580
242
0
false
Let's say you want to save a bunch of files somewhere, for instance in BLOBs. Let's say you want to dish these files out via a web page and have the client automatically open the correct application/viewer. Assumption: The browser figures out which application/viewer to use by the mime-type (content-type?) header in the HTTP response. Based on that assumption, in addition to the bytes of the file, you also want to save the MIME type. How would you find the MIME type of a file? I'm currently on a Mac, but this should also work on Windows. Does the browser add this information when posting the file to the web page? Is there a neat python library for finding this information? A WebService or (even better) a downloadable database?
0
0.011111
11,101,343
0
18
The mimetypes module just recognise an file type based on file extension. If you will try to recover a file type of a file without extension, the mimetypes will not works.
How to find the mime type of a file in python?
python,mime
0
233,034
1
3
1
0
0
2008-09-04T12:07:00.000
0
43,580
242
0
false
Let's say you want to save a bunch of files somewhere, for instance in BLOBs. Let's say you want to dish these files out via a web page and have the client automatically open the correct application/viewer. Assumption: The browser figures out which application/viewer to use by the mime-type (content-type?) header in the HTTP response. Based on that assumption, in addition to the bytes of the file, you also want to save the MIME type. How would you find the MIME type of a file? I'm currently on a Mac, but this should also work on Windows. Does the browser add this information when posting the file to the web page? Is there a neat python library for finding this information? A WebService or (even better) a downloadable database?
0
0
51,510,950
0
18
For byte Array type data you can use magic.from_buffer(_byte_array,mime=True)
How to find the mime type of a file in python?
python,mime
0
233,034
1
3
0
0
0
2008-09-04T12:07:00.000
0
43,580
242
0
false
Let's say you want to save a bunch of files somewhere, for instance in BLOBs. Let's say you want to dish these files out via a web page and have the client automatically open the correct application/viewer. Assumption: The browser figures out which application/viewer to use by the mime-type (content-type?) header in the HTTP response. Based on that assumption, in addition to the bytes of the file, you also want to save the MIME type. How would you find the MIME type of a file? I'm currently on a Mac, but this should also work on Windows. Does the browser add this information when posting the file to the web page? Is there a neat python library for finding this information? A WebService or (even better) a downloadable database?
0
1
12,297,929
0
18
There are 3 different libraries that wraps libmagic. 2 of them are available on pypi (so pip install will work): filemagic python-magic And another, similar to python-magic is available directly in the latest libmagic sources, and it is the one you probably have in your linux distribution. In Debian the package python-magic is about this one and it is used as toivotuo said and it is not obsoleted as Simon Zimmermann said (IMHO). It seems to me another take (by the original author of libmagic). Too bad is not available directly on pypi.
How to find the mime type of a file in python?
python,mime
0
233,034
1
3
11
0
0
2008-09-05T10:26:00.000
0
45,507
32
1
false
I'm looking to create favicon.ico files programatically from Python, but PIL only has support for reading ico files.
0
0.028564
45,520
0
7
I don't know if this applies for all cases, but on WinXP an .ico can be a bmp of size 16x16, 32x32 or 64x64. Just change the extension to ico from bmp and you're ready to go.
Is there a Python library for generating .ico files?
python,favicon
0
25,030
1
1
1
0
0
2008-09-06T02:22:00.000
0
47,198
15
1
false
If I was going to start an open source project using Python what version should I use to ensure that the vast majority of users can use it on their system? I'm the kind of person who quickly jumps to the next version (which I'll do when Python 3 comes out) but many people may be more conservative if their current version seems to be working fine. What version would hit the sweet spot but still allow me to enjoy the newest and coolest language enhancements?
0
0
2,036,609
0
6
If the project is going to be mainstream and will be run on Linux the only sensible choise is 2.4 - just because it is a pain to get anything else installed as default on Enterprise Linuxes. In any case, any modern OS will/can have 2.4 or newer.
Which Version of Python to Use for Maximum Compatibility
python,compatibility
0
3,460
1
2
0
0
0
2008-09-06T02:22:00.000
0
47,198
15
1
false
If I was going to start an open source project using Python what version should I use to ensure that the vast majority of users can use it on their system? I'm the kind of person who quickly jumps to the next version (which I'll do when Python 3 comes out) but many people may be more conservative if their current version seems to be working fine. What version would hit the sweet spot but still allow me to enjoy the newest and coolest language enhancements?
0
0.033321
47,264
0
6
You can use different versions of python on each machine. Coding something new, I would not use anything less than python2.5. You can do apt-get install python2.5 on stock debian stable. For windows, don't really worry about it. It's very easy to install the python2.5 msi. If the users can't be bothered to do that, you can deploy an executable with py2exe (so simple) and build an installer with inno setup (again simple) then it will behave like a standard windows application and will use its own python dlls, so no need to have python installed. Like Peter said: keep in mind the transition to 3.0 but don't build on it yet.
Which Version of Python to Use for Maximum Compatibility
python,compatibility
0
3,460
1
2
1
0
0
2008-09-06T23:35:00.000
0
47,953
27
1
false
I've read some about .egg files and I've noticed them in my lib directory but what are the advantages/disadvantages of using then as a developer?
0
0.033321
138,090
0
6
For simple Python programs, you probably don't need to use eggs. Distributing the raw .py files should suffice; it's like distributing source files for GNU/Linux. You can also use the various OS "packagers" (like py2exe or py2app) to create .exe, .dmg, or other files for different operating systems. More complex programs, e.g. Django, pretty much require eggs due to the various modules and dependencies required.
What are the advantages of packaging your python library/application as an .egg file?
python,zip,packaging,software-distribution,egg
0
10,471
1
3
1
0
1
2008-09-06T23:35:00.000
0
47,953
27
1
false
I've read some about .egg files and I've noticed them in my lib directory but what are the advantages/disadvantages of using then as a developer?
0
0.033321
137,903
0
6
Whatever you do, do not stop distributing your application, also, as a tarball, as that is the easiest packagable format for operating systems with a package sysetem.
What are the advantages of packaging your python library/application as an .egg file?
python,zip,packaging,software-distribution,egg
0
10,471
1
3
1
0
1
2008-09-06T23:35:00.000
0
47,953
27
1
false
I've read some about .egg files and I've noticed them in my lib directory but what are the advantages/disadvantages of using then as a developer?
0
0.132549
47,958
0
6
Eggs are a pretty good way to distribute python apps. Think of it as a platform independent .deb file that will install all dependencies and whatnot. The advantage is that it's easy to use for the end user. The disadvantage are that it can be cumbersome to package your app up as a .egg file. You should also offer an alternative means of installation in addition to .eggs. There are some people who don't like using eggs because they don't like the idea of a software program installing whatever software it wants. These usually tend to be sysadmin types.
What are the advantages of packaging your python library/application as an .egg file?
python,zip,packaging,software-distribution,egg
0
10,471
1
3
4
0
1
2008-09-08T03:53:00.000
0
49,137
65
0
false
I would like to call python script files from my c++ program. I am not sure that the people I will distribute to will have python installed. Basically I'm looking for a .lib file that I can use that has an Apache like distribution license.
0
0
69,672,216
0
7
Using Inter Process Communication (IPC) over socket can be a possible solution. Use a local network socket to listen/trasfer commands between both.
Calling python from a c++ program for distribution
c++,python,embedded-language
0
100,997
1
1
0
0
1
2008-09-08T05:23:00.000
0
49,195
4
0
false
The first language I learnt was PHP, but I have more recently picked up Python. As these are all 'high-level' languages, I have found them a bit difficult to pick up. I also tried to learn Objective-C but I gave up. So, what language should I learn to bridge between Python to C
0
0.014285
49,246
0
14
C is a bridge onto itself. K&R is the only programming language book you can read in one sitting and almost never pick it up again ...
What language should I learn as a bridge to C (and derivatives)
python,c
0
871
1
12
1
0
0
2008-09-08T05:23:00.000
0
49,195
4
0
false
The first language I learnt was PHP, but I have more recently picked up Python. As these are all 'high-level' languages, I have found them a bit difficult to pick up. I also tried to learn Objective-C but I gave up. So, what language should I learn to bridge between Python to C
0
0.071307
49,285
0
14
I generally agree with most of the others - There's not really a good stepping stone language. It is, however, useful to understand what is difficult about learning C, which might help you understand what's making it difficult for you. I'd say the things that would prove difficult in C for someone coming from PHP would be : Pointers and memory management This is pretty much the reason you're learning C I imagine, so there's not really any getting around it. Learning lower level assembly type languages might make this easier, but C is probably a bridge to do that, not the other way around. Lack of built in data structures PHP and co all have native String types, and useful things like hash tables built in, which is not the case in C. In C, a String is just an array of characters, which means you'll need to do a lot more work, or look seriously at libraries which add the features you're used to. Lack of built in libraries Languages like PHP nowadays almost always come with stacks of libraries for things like database connections, image manipulation and stacks of other things. In C, this is not the case other than a very thin standard library which revolves mostly around file reading, writing and basic string manipulation. There are almost always good choices available to fill these needs, but you need to include them yourself. Suitability for high level tasks If you try to implement the same type of application in C as you might in PHP, you'll find it very slow going. Generating a web page, for example, isn't really something plain C is suited for, so if you're trying to do that, you'll find it very slow going. Preprocessor and compilation Most languages these days don't have a preprocessor, and if you're coming from PHP, the compilation cycle will seem painful. Both of these are performance trade offs in a way - Scripting languages make the trade off in terms of developer efficiency, where as C prefers performance. I'm sure there are more that aren't springing to mind for me right now. The moral of the story is that trying to understand what you're finding difficult in C may help you proceed. If you're trying to generate web pages with it, try doing something lower level. If you're missing hash tables, try writing your own, or find a library. If you're struggling with pointers, stick with it :)
What language should I learn as a bridge to C (and derivatives)
python,c
0
871
1
12
5
0
0
2008-09-08T05:23:00.000
0
49,195
4
0
false
The first language I learnt was PHP, but I have more recently picked up Python. As these are all 'high-level' languages, I have found them a bit difficult to pick up. I also tried to learn Objective-C but I gave up. So, what language should I learn to bridge between Python to C
0
0
49,237
0
14
Java might actually be a good option here, believe it or not. It is strongly based on C/C++, so if you can get the syntax and the strong typing, picking up C might be easier. The benefit is you can learn the lower level syntax without having to learn pointers (since memory is managed for you just like in Python and PHP). You will, however, learn a similar concept... references (or objects in general). Also, it is strongly Object Oriented, so it may be difficult to pick up on that if you haven't dealt with OOP yet.... you might be better off just digging in with C like others suggested, but it is an option.
What language should I learn as a bridge to C (and derivatives)
python,c
0
871
1
12
0
0
0
2008-09-08T05:23:00.000
0
49,195
4
0
false
The first language I learnt was PHP, but I have more recently picked up Python. As these are all 'high-level' languages, I have found them a bit difficult to pick up. I also tried to learn Objective-C but I gave up. So, what language should I learn to bridge between Python to C
0
0
49,248
0
14
I think C++ is a good "bridge" to C. I learned C++ first at University, and since it's based on C you'll learn a lot of the same concepts - perhaps most notably pointers - but also Object Oriented Design. OO can be applied to all kinds of modern languages, so it's worth learning. After learning C++, I found it wasn't too hard to pick up the differences between C++ and C as required (for example, when working on devices that didn't support C++).
What language should I learn as a bridge to C (and derivatives)
python,c
0
871
1
12
0
0
0
2008-09-08T05:23:00.000
0
49,195
4
0
false
The first language I learnt was PHP, but I have more recently picked up Python. As these are all 'high-level' languages, I have found them a bit difficult to pick up. I also tried to learn Objective-C but I gave up. So, what language should I learn to bridge between Python to C
0
0.014285
49,245
0
14
Forget Java - it is not going to bring you anywhere closer to C (you have allready proved that you don't have a problem learning new syntax). Either read K&R or go one lower: Learn about the machine itself. The only tricky part in C is pointers and memory management (which is closely related to pointers, but also has a bit to do with how functions are called). Learning a (simple, maybe even "fake" assembly) language should help you out here. Then, start reading up on the standard library provided by C. It will be your daily bread and butter. Oh: another tip! If you really do want to bridge, try FORTH. It helped me get into pointers. Also, using the win32 api from Visual Basic 6.0 can teach you some stuff about pointers ;)
What language should I learn as a bridge to C (and derivatives)
python,c
0
871
1
12
1
0
0
2008-09-08T05:23:00.000
0
49,195
4
0
false
The first language I learnt was PHP, but I have more recently picked up Python. As these are all 'high-level' languages, I have found them a bit difficult to pick up. I also tried to learn Objective-C but I gave up. So, what language should I learn to bridge between Python to C
0
0
49,502
0
14
Languages are easy to learn (especially one like C)... the hard part is learning the libraries and/or coding style of the language. For instance, I know C++ fairly well, but most C/C++ code I see confuses me because the naming conventions are so different from what I work with on a daily basis. Anyway, I guess what I'm trying to say is don't worry too much about the syntax, focus on said language's library. This isn't specific to C, you can say the same about c#, vb.net, java and just about every other language out there.
What language should I learn as a bridge to C (and derivatives)
python,c
0
871
1
12
0
0
0
2008-09-08T05:23:00.000
0
49,195
4
0
false
The first language I learnt was PHP, but I have more recently picked up Python. As these are all 'high-level' languages, I have found them a bit difficult to pick up. I also tried to learn Objective-C but I gave up. So, what language should I learn to bridge between Python to C
0
0
49,217
0
14
I'm feeling your pain, I also learned PHP first and I'm trying to learn C++, it's not easy, and I am really struggling, It's been 2 years since I started on c++ and Still the extent of what I can do is cout, cin, and math. If anyone reads this and wonders where to start, START LOWER.
What language should I learn as a bridge to C (and derivatives)
python,c
0
871
1
12
0
0
0
2008-09-08T05:23:00.000
0
49,195
4
0
false
The first language I learnt was PHP, but I have more recently picked up Python. As these are all 'high-level' languages, I have found them a bit difficult to pick up. I also tried to learn Objective-C but I gave up. So, what language should I learn to bridge between Python to C
0
0
50,673
0
14
Pascal! Close enough syntax, still requires you to do some memory management, but not as rough for beginners.
What language should I learn as a bridge to C (and derivatives)
python,c
0
871
1
12
0
0
0
2008-09-08T05:23:00.000
0
49,195
4
0
false
The first language I learnt was PHP, but I have more recently picked up Python. As these are all 'high-level' languages, I have found them a bit difficult to pick up. I also tried to learn Objective-C but I gave up. So, what language should I learn to bridge between Python to C
0
0
49,295
0
14
try to learn a language which you are comfortable with, try different approach and the basics.
What language should I learn as a bridge to C (and derivatives)
python,c
0
871
1
12
0
0
0
2008-09-08T05:23:00.000
0
49,195
4
0
false
The first language I learnt was PHP, but I have more recently picked up Python. As these are all 'high-level' languages, I have found them a bit difficult to pick up. I also tried to learn Objective-C but I gave up. So, what language should I learn to bridge between Python to C
0
0.014285
49,234
0
14
Learning any language takes time, I always ensure I have a measurable goal; I set myself an objective, then start learning the language to achieve this objective, as opposed to trying to learn every nook and cranny of the language and syntax. C is not easy, pointers can be hard to comprehend if you’re not coming assembler roots. I first learned C++, then retro fit C to my repertoire but I started with x86 and 68000 assembler.
What language should I learn as a bridge to C (and derivatives)
python,c
0
871
1
12
1
0
0
2008-09-08T05:23:00.000
0
49,195
4
0
true
The first language I learnt was PHP, but I have more recently picked up Python. As these are all 'high-level' languages, I have found them a bit difficult to pick up. I also tried to learn Objective-C but I gave up. So, what language should I learn to bridge between Python to C
0
1.2
49,202
0
14
It's not clear why you need a bridge language. Why don't you start working with C directly? C is a very simple language itself. I think that hardest part for C learner is pointers and everything else related to memory management. Also C lang is oriented on structured programming, so you will need to learn how to implement data structures and algorithms without OOP goodness. Actually, your question is pretty hard, usually people go from low level langs to high level and I can understand frustration of those who goes in other direction.
What language should I learn as a bridge to C (and derivatives)
python,c
0
871
1
12
15
0
0
2008-09-08T05:23:00.000
0
49,195
4
0
false
The first language I learnt was PHP, but I have more recently picked up Python. As these are all 'high-level' languages, I have found them a bit difficult to pick up. I also tried to learn Objective-C but I gave up. So, what language should I learn to bridge between Python to C
0
1
49,227
0
14
The best place to start learning C is the book "The C Programming Language" by Kernighan and Ritchie. You will recognise a lot of things from PHP, and you will be surprised how much PHP (and Perl, Python etc) do for you. Oh and you also will need a C compiler, but i guess you knew that.
What language should I learn as a bridge to C (and derivatives)
python,c
0
871
1
12
7
0
0
2008-09-08T14:36:00.000
0
49,824
29
1
true
Besides the dynamic nature of Python (and the syntax), what are some of the major features of the Python language that Java doesn't have, and vice versa?
0
1.2
49,953
0
5
List comprehensions. I often find myself filtering/mapping lists, and being able to say [line.replace("spam","eggs") for line in open("somefile.txt") if line.startswith("nee")] is really nice. Functions are first class objects. They can be passed as parameters to other functions, defined inside other function, and have lexical scope. This makes it really easy to say things like people.sort(key=lambda p: p.age) and thus sort a bunch of people on their age without having to define a custom comparator class or something equally verbose. Everything is an object. Java has basic types which aren't objects, which is why many classes in the standard library define 9 different versions of functions (for boolean, byte, char, double, float, int, long, Object, short). Array.sort is a good example. Autoboxing helps, although it makes things awkward when something turns out to be null. Properties. Python lets you create classes with read-only fields, lazily-generated fields, as well as fields which are checked upon assignment to make sure they're never 0 or null or whatever you want to guard against, etc.' Default and keyword arguments. In Java if you want a constructor that can take up to 5 optional arguments, you must define 6 different versions of that constructor. And there's no way at all to say Student(name="Eli", age=25) Functions can only return 1 thing. In Python you have tuple assignment, so you can say spam, eggs = nee() but in Java you'd need to either resort to mutable out parameters or have a custom class with 2 fields and then have two additional lines of code to extract those fields. Built-in syntax for lists and dictionaries. Operator Overloading. Generally better designed libraries. For example, to parse an XML document in Java, you say Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse("test.xml"); and in Python you say doc = parse("test.xml") Anyway, I could go on and on with further examples, but Python is just overall a much more flexible and expressive language. It's also dynamically typed, which I really like, but which comes with some disadvantages. Java has much better performance than Python and has way better tool support. Sometimes those things matter a lot and Java is the better language than Python for a task; I continue to use Java for some new projects despite liking Python a lot more. But as a language I think Python is superior for most things I find myself needing to accomplish.
Java -> Python?
java,python
0
11,654
1
2
47
0
0
2008-09-08T14:36:00.000
0
49,824
29
1
false
Besides the dynamic nature of Python (and the syntax), what are some of the major features of the Python language that Java doesn't have, and vice versa?
0
0.07983
51,512
0
5
Apart from what Eli Courtwright said: I find iterators in Python more concise. You can use for i in something, and it works with pretty much everything. Yeah, Java has gotten better since 1.5, but for example you can iterate through a string in python with this same construct. Introspection: In python you can get at runtime information about an object or a module about its symbols, methods, or even its docstrings. You can also instantiate them dynamically. Java has some of this, but usually in Java it takes half a page of code to get an instance of a class, whereas in Python it is about 3 lines. And as far as I know the docstrings thing is not available in Java
Java -> Python?
java,python
0
11,654
1
2
2
0
0
2008-09-12T23:28:00.000
0
60,152
12
0
false
Been scouring the net for something like firewatir but for python. I'm trying to automate firefox on linux. Any suggestions?
1
0
60,218
0
8
The languages of choice of Firefox is Javascript. Unless you have a specific requirement that requires Python, I would advice you to use that.
Automate firefox with python?
python,linux,firefox,ubuntu,automation
0
21,896
1
2
0
0
0
2008-09-12T23:28:00.000
0
60,152
12
0
false
Been scouring the net for something like firewatir but for python. I'm trying to automate firefox on linux. Any suggestions?
1
0.024995
7,610,441
0
8
I would suggest you to use Selenium instead of Mechanize/Twill because Mechanize would fail while handling Javascript.
Automate firefox with python?
python,linux,firefox,ubuntu,automation
0
21,896
1
2
1
0
0
2008-09-14T05:41:00.000
0
61,151
545
1
false
If you're writing a library, or an app, where do the unit test files go? It's nice to separate the test files from the main app code, but it's awkward to put them into a "tests" subdirectory inside of the app root directory, because it makes it harder to import the modules that you'll be testing. Is there a best practice here?
0
0.011111
61,820
0
18
In C#, I've generally separated the tests into a separate assembly. In Python -- so far -- I've tended to either write doctests, where the test is in the docstring of a function, or put them in the if __name__ == "__main__" block at the bottom of the module.
Where do the Python unit tests go?
python,unit-testing,code-organization
0
112,049
1
4
1
0
0
2008-09-14T05:41:00.000
0
61,151
545
1
false
If you're writing a library, or an app, where do the unit test files go? It's nice to separate the test files from the main app code, but it's awkward to put them into a "tests" subdirectory inside of the app root directory, because it makes it harder to import the modules that you'll be testing. Is there a best practice here?
0
0
63,645
0
18
When writing a package called "foo", I will put unit tests into a separate package "foo_test". Modules and subpackages will then have the same name as the SUT package module. E.g. tests for a module foo.x.y are found in foo_test.x.y. The __init__.py files of each testing package then contain an AllTests suite that includes all test suites of the package. setuptools provides a convenient way to specify the main testing package, so that after "python setup.py develop" you can just use "python setup.py test" or "python setup.py test -s foo_test.x.SomeTestSuite" to the just a specific suite.
Where do the Python unit tests go?
python,unit-testing,code-organization
0
112,049
1
4
0
0
0
2008-09-14T05:41:00.000
0
61,151
545
1
false
If you're writing a library, or an app, where do the unit test files go? It's nice to separate the test files from the main app code, but it's awkward to put them into a "tests" subdirectory inside of the app root directory, because it makes it harder to import the modules that you'll be testing. Is there a best practice here?
0
-0.022219
61,518
0
18
I've recently started to program in Python, so I've not really had chance to find out best practice yet. But, I've written a module that goes and finds all the tests and runs them. So, I have: app/ appfile.py test/ appfileTest.py I'll have to see how it goes as I progress to larger projects.
Where do the Python unit tests go?
python,unit-testing,code-organization
0
112,049
1
4
-2
0
0
2008-09-14T05:41:00.000
0
61,151
545
1
false
If you're writing a library, or an app, where do the unit test files go? It's nice to separate the test files from the main app code, but it's awkward to put them into a "tests" subdirectory inside of the app root directory, because it makes it harder to import the modules that you'll be testing. Is there a best practice here?
0
1
61,168
0
18
I don't believe there is an established "best practice". I put my tests in another directory outside of the app code. I then add the main app directory to sys.path (allowing you to import the modules from anywhere) in my test runner script (which does some other stuff as well) before running all the tests. This way I never have to remove the tests directory from the main code when I release it, saving me time and effort, if an ever so tiny amount.
Where do the Python unit tests go?
python,unit-testing,code-organization
0
112,049
1
4
13
0
0
2008-09-14T18:58:00.000
0
61,556
0
1
false
What is the best available method for developing a spell check engine (for example, with aspell_python), that works with apache mod_python? apache 2.0.59+RHEL4+mod_python+aspell_python seems to crash. Is there any alternative to using aspell_python?
0
0.197375
61,570
0
1
Looks like RHEL4 is the culprit. Works well on Fedore 7 (the version of apache is newer and there is no crash)
Spell Checking Service with python using mod_python
spell-checking,mod-python,aspell
0
238
1
1
1
0
0
2008-09-15T21:11:00.000
0
67,015
3
0
false
My development shop has put together a fairly useful Python-based test suite, and we'd like to test some Linux-based C++ code with it. We've gotten the test project they ship with Boost to compile (type 'bjam' in the directory and it works), but we're having issues with our actual project. Building the boost libraries and bjam from source (v1.35.0), when I run bjam I get a .so in the bin/gcc-4.1.2/debug directory. I run python and "import " and I get: ImportError: libboost_python-gcc41-d-1_35.so.1.35.0: cannot open shared object file: No such file or directory Looking in the library directory, I have the following: libboost_python-gcc41-mt-1_35.so libboost_python-gcc41-mt-1_35.so.1.35.0 libboost_python-gcc41-mt.so Obviously I need the -d instead of the -mt libraries, or to point at the -mt libraries instead of -d, but I can't figure out how to make my Jamroot file do that. When I install Debian Etch's versions of the libraries, I get "No Jamfile in /usr/include" - and there's a debian bug that says they left out the system-level jamfile. I'm more hopeful about getting it working from source, so if anyone has any suggestions to resolve the library issues, I'd like to hear them. Response to answer 1: Thanks for the tip. So, do you know how I'd go about getting it to use the MT libraries instead? It appears to be more of a problem with bjam or the Jamfile I am using thinking I am in debug mode, even though I can't find any flags for that. While I know how to include specific libraries in a call to GCC, I don't see a way to configure that from the Boost end.
0
0.132549
93,027
0
3
Found the solution! Boost builds a debug build by default. Typing "bjam release" builds the release configuration. (This isn't listed in any documentation anywhere, as far as I can tell.) Note that this is not the same as changing your build-type to release, as that doesn't build a release configuration. Doing a 'complete' build as Torsten suggests also does not stop it from building only a debug version. It's also worth noting that the -d libraries were in <boost-version>/bin.v2/libs/python/build/<gcc version>/debug/ and the release libraries were in <gcc-version>/release, and not installed into the top-level 'libs' directory. Thanks for the other suggestions!
Using boost-python with C++ in Linux
c++,boost-python
0
3,149
1
2
2
0
0
2008-09-15T21:11:00.000
0
67,015
3
0
false
My development shop has put together a fairly useful Python-based test suite, and we'd like to test some Linux-based C++ code with it. We've gotten the test project they ship with Boost to compile (type 'bjam' in the directory and it works), but we're having issues with our actual project. Building the boost libraries and bjam from source (v1.35.0), when I run bjam I get a .so in the bin/gcc-4.1.2/debug directory. I run python and "import " and I get: ImportError: libboost_python-gcc41-d-1_35.so.1.35.0: cannot open shared object file: No such file or directory Looking in the library directory, I have the following: libboost_python-gcc41-mt-1_35.so libboost_python-gcc41-mt-1_35.so.1.35.0 libboost_python-gcc41-mt.so Obviously I need the -d instead of the -mt libraries, or to point at the -mt libraries instead of -d, but I can't figure out how to make my Jamroot file do that. When I install Debian Etch's versions of the libraries, I get "No Jamfile in /usr/include" - and there's a debian bug that says they left out the system-level jamfile. I'm more hopeful about getting it working from source, so if anyone has any suggestions to resolve the library issues, I'd like to hear them. Response to answer 1: Thanks for the tip. So, do you know how I'd go about getting it to use the MT libraries instead? It appears to be more of a problem with bjam or the Jamfile I am using thinking I am in debug mode, even though I can't find any flags for that. While I know how to include specific libraries in a call to GCC, I don't see a way to configure that from the Boost end.
0
0.132549
67,282
0
3
If you want to build the debug variants of the boost libraries as well, you have to invoke bjam with the option --build-type=complete. On Debian, you get the debug Python interpreter in the python2.x-dbg packages. Debug builds of the Boost libraries are in libboost1.xy-dbg, if you want to use the system Boost.
Using boost-python with C++ in Linux
c++,boost-python
0
3,149
1
2
2
0
0
2008-09-16T07:07:00.000
0
69,979
1
0
false
My university doesn't support the POST cgi method (I know, it's crazy), and I was hoping to be able to have a system where a user can have a username and password and log in securely. Is this even possible? If it's not, how would you do it with POST? Just out of curiosity. Cheers!
1
0
70,003
0
6
With a bit of JavaScript, you could have the client hash the entered password and a server-generated nonce, and use that in an HTTP GET.
Can I implement a web user authentication system in python without POST?
python,authentication,cgi
0
2,893
1
3
0
0
0
2008-09-16T07:07:00.000
0
69,979
1
0
true
My university doesn't support the POST cgi method (I know, it's crazy), and I was hoping to be able to have a system where a user can have a username and password and log in securely. Is this even possible? If it's not, how would you do it with POST? Just out of curiosity. Cheers!
1
1.2
69,995
0
6
You can actually do it all with GET methods. However, you'll want to use a full challenge response protocol for the logins. (You can hash on the client side using javascript. You just need to send out a unique challenge each time.) You'll also want to use SSL to ensure that no one can see the strings as they go across. In some senses there's no real security difference between GET and POST requests as they both go across in plaintext, in other senses and in practice... GET is are a hell of a lot easier to intercept and is all over most people's logs and your web browser's history. :) (Or as suggested by the other posters, use a different method entirely like HTTP auth, digest auth or some higher level authentication scheme like AD, LDAP, kerberos or shib. However I kinda assumed that if you didn't have POST you wouldn't have these either.)
Can I implement a web user authentication system in python without POST?
python,authentication,cgi
0
2,893
1
3
5
0
0
2008-09-16T07:07:00.000
0
69,979
1
0
false
My university doesn't support the POST cgi method (I know, it's crazy), and I was hoping to be able to have a system where a user can have a username and password and log in securely. Is this even possible? If it's not, how would you do it with POST? Just out of curiosity. Cheers!
1
0.033321
69,989
0
6
You could use HTTP Authentication, if supported. You'd have to add SSL, as all methods, POST, GET and HTTP Auth (well, except Digest HHTP authentication) send plaintext. GET is basically just like POST, it just has a limit on the amount of data you can send which is usually a lot smaller than POST and a semantic difference which makes GET not a good candidate from that point of view, even if technically they both can do it. As for examples, what are you using? There are many choices in Python, like the cgi module or some framework like Django, CherryPy, and so on
Can I implement a web user authentication system in python without POST?
python,authentication,cgi
0
2,893
1
3
1
0
0
2008-09-16T15:35:00.000
0
73,663
1,288
0
false
I am aware of the die() command in PHP which exits a script early. How can I do this in Python?
0
0
70,824,754
0
12
Just put at the end of your code quit() and that should close a python script.
How to terminate a script?
python,termination
0
1,876,007
1
2
0
0
1
2008-09-16T15:35:00.000
0
73,663
1,288
0
false
I am aware of the die() command in PHP which exits a script early. How can I do this in Python?
0
1
76,374
0
12
While you should generally prefer sys.exit because it is more "friendly" to other code, all it actually does is raise an exception. If you are sure that you need to exit a process immediately, and you might be inside of some exception handler which would catch SystemExit, there is another function - os._exit - which terminates immediately at the C level and does not perform any of the normal tear-down of the interpreter; for example, hooks registered with the "atexit" module are not executed.
How to terminate a script?
python,termination
0
1,876,007
1
2
75
0
1
2008-09-16T16:44:00.000
0
74,386
5
0
false
Is it possible to call managed code, specifically IronRuby or IronPython from unamanaged code such as C++ or Delphi? For example, we have an application written in Delphi that is being moved to C#.NET We'd like to provide Ruby or Python scripting in our new application to replace VBSCRIPT. However, we would need to provide Ruby/Python scripting in the old Delphi application. Is it possible to use the managed dlls provided by IronRuby/IronPython from Delphi code?
0
0.099668
934,717
0
6
Why not embed CPython instead, which has an API intended to be used directly from C/C++. You lose the multiple language advantage but probably gain simplicity.
Using DLR from Unmanaged Code
.net,delphi,ironpython,unmanaged,ironruby
1
877
1
1
3
0
0
2008-09-16T20:11:00.000
0
76,408
6
0
false
First of all, I want to avoid a flame-war on languages. The languages to choose from are Perl, Python and Ruby . I want to mention that I'm comfortable with all of them, but the problem is that I can't focus just on one. If, for example, I see a cool Perl module, I have to try it out. If I see a nice Python app, I have to know how it's made. If I see a Ruby DSL or some Ruby voodoo, I'm hooked on Ruby for a while. Right now I'm working as a Java developer, but plan on taking CEH in the near future. My question is: for tool writing and exploit development, which language do you find to be the most appropriate? Again, I don't want to cause a flame-war or any trouble, I just want honest opinions from scripters that know what they're doing. One more thing: maybe some of you will ask "Why settle on one language?". To answer this: I would like to choose only one language, in order to try to master it.
0
0.049958
76,441
0
12
That depends on the implementation, if it will be distributed I would go with Java, seeing as you know that, because of its portability. If it is just for internal use, or will be used in semi-controlled environments, then go with whatever you are the most comfortable maintaining, and whichever has the best long-term outlook. Now to just answer the question, I would go with Perl, but I'm a linux guy so I may be a bit biased in this.
Which of these scripting languages is more appropriate for pen-testing?
python,ruby,perl,security,penetration-testing
0
6,338
1
7
3
0
0
2008-09-16T20:11:00.000
0
76,408
6
0
false
First of all, I want to avoid a flame-war on languages. The languages to choose from are Perl, Python and Ruby . I want to mention that I'm comfortable with all of them, but the problem is that I can't focus just on one. If, for example, I see a cool Perl module, I have to try it out. If I see a nice Python app, I have to know how it's made. If I see a Ruby DSL or some Ruby voodoo, I'm hooked on Ruby for a while. Right now I'm working as a Java developer, but plan on taking CEH in the near future. My question is: for tool writing and exploit development, which language do you find to be the most appropriate? Again, I don't want to cause a flame-war or any trouble, I just want honest opinions from scripters that know what they're doing. One more thing: maybe some of you will ask "Why settle on one language?". To answer this: I would like to choose only one language, in order to try to master it.
0
0
76,470
0
12
Well, what kind of exploits are you thinking about? If you want to write something that needs low level stuff (ptrace, raw sockets, etc.) then you'll need to learn C. But both Perl and Python can be used. The real question is which one suits your style more? As for toolmaking, Perl has good string-processing abilities, is closer to the system, has good support, but IMHO it's very confusing. I prefer Python: it's a clean, easy to use, easy to learn language with good support (complete language/lib reference, 3rd party libs, etc.). And it's (strictly IMHO) cool.
Which of these scripting languages is more appropriate for pen-testing?
python,ruby,perl,security,penetration-testing
0
6,338
1
7
0
0
0
2008-09-16T20:11:00.000
0
76,408
6
0
false
First of all, I want to avoid a flame-war on languages. The languages to choose from are Perl, Python and Ruby . I want to mention that I'm comfortable with all of them, but the problem is that I can't focus just on one. If, for example, I see a cool Perl module, I have to try it out. If I see a nice Python app, I have to know how it's made. If I see a Ruby DSL or some Ruby voodoo, I'm hooked on Ruby for a while. Right now I'm working as a Java developer, but plan on taking CEH in the near future. My question is: for tool writing and exploit development, which language do you find to be the most appropriate? Again, I don't want to cause a flame-war or any trouble, I just want honest opinions from scripters that know what they're doing. One more thing: maybe some of you will ask "Why settle on one language?". To answer this: I would like to choose only one language, in order to try to master it.
0
0.016665
76,495
0
12
All of them should be sufficient for that. Unless you need some library that is only available in one language, I'd let personal preference guide me.
Which of these scripting languages is more appropriate for pen-testing?
python,ruby,perl,security,penetration-testing
0
6,338
1
7
1
0
0
2008-09-16T20:11:00.000
0
76,408
6
0
false
First of all, I want to avoid a flame-war on languages. The languages to choose from are Perl, Python and Ruby . I want to mention that I'm comfortable with all of them, but the problem is that I can't focus just on one. If, for example, I see a cool Perl module, I have to try it out. If I see a nice Python app, I have to know how it's made. If I see a Ruby DSL or some Ruby voodoo, I'm hooked on Ruby for a while. Right now I'm working as a Java developer, but plan on taking CEH in the near future. My question is: for tool writing and exploit development, which language do you find to be the most appropriate? Again, I don't want to cause a flame-war or any trouble, I just want honest opinions from scripters that know what they're doing. One more thing: maybe some of you will ask "Why settle on one language?". To answer this: I would like to choose only one language, in order to try to master it.
0
0.016665
76,508
0
12
If you're looking for a scripting language that will play well with Java, you might want to look at Groovy. It has the flexibility and power of Perl (closures, built in regexes, associative arrays on every corner) but you can access Java code from it thus you have access to a huge number of libraries, and in particular the rest of the system you're developing.
Which of these scripting languages is more appropriate for pen-testing?
python,ruby,perl,security,penetration-testing
0
6,338
1
7
1
0
0
2008-09-16T20:11:00.000
0
76,408
6
0
false
First of all, I want to avoid a flame-war on languages. The languages to choose from are Perl, Python and Ruby . I want to mention that I'm comfortable with all of them, but the problem is that I can't focus just on one. If, for example, I see a cool Perl module, I have to try it out. If I see a nice Python app, I have to know how it's made. If I see a Ruby DSL or some Ruby voodoo, I'm hooked on Ruby for a while. Right now I'm working as a Java developer, but plan on taking CEH in the near future. My question is: for tool writing and exploit development, which language do you find to be the most appropriate? Again, I don't want to cause a flame-war or any trouble, I just want honest opinions from scripters that know what they're doing. One more thing: maybe some of you will ask "Why settle on one language?". To answer this: I would like to choose only one language, in order to try to master it.
0
0.049958
78,106
0
12
If you plan on using Metasploit for pen-testing and exploit development I would recommend ruby as mentioned previously Metasploit is written in ruby and any exploit/module development you may wish to do will require ruby. If you will be using Immunity CANVAS for pen testing then for the same reasons I would recommend Python as CANVAS is written in python. Also allot of fuzzing frameworks like Peach and Sulley are written in Python. I would not recommend Perl as you will find very little tools/scripts/frameworks related to pen testing/fuzzing/exploits/... in Perl. As your question is "tool writing and exploit development" I would recommend Ruby if you choose Metasploit or python if you choose CANVAS. hope that helps :)
Which of these scripting languages is more appropriate for pen-testing?
python,ruby,perl,security,penetration-testing
0
6,338
1
7
3
0
0
2008-09-16T20:11:00.000
0
76,408
6
0
false
First of all, I want to avoid a flame-war on languages. The languages to choose from are Perl, Python and Ruby . I want to mention that I'm comfortable with all of them, but the problem is that I can't focus just on one. If, for example, I see a cool Perl module, I have to try it out. If I see a nice Python app, I have to know how it's made. If I see a Ruby DSL or some Ruby voodoo, I'm hooked on Ruby for a while. Right now I'm working as a Java developer, but plan on taking CEH in the near future. My question is: for tool writing and exploit development, which language do you find to be the most appropriate? Again, I don't want to cause a flame-war or any trouble, I just want honest opinions from scripters that know what they're doing. One more thing: maybe some of you will ask "Why settle on one language?". To answer this: I would like to choose only one language, in order to try to master it.
0
0
4,927,367
0
12
I'm with tqbf. I've worked with Python and Ruby. Currently I'm working with JRuby. It has all the power of Ruby with access to the Java libraries so if there is something you absolutely need a low-level language to solve you can do so with a high-level language. So far I haven't needed to really use much Java as Ruby has had the ability to do everything I've needed as an API tester.
Which of these scripting languages is more appropriate for pen-testing?
python,ruby,perl,security,penetration-testing
0
6,338
1
7
0
0
0
2008-09-16T20:11:00.000
0
76,408
6
0
false
First of all, I want to avoid a flame-war on languages. The languages to choose from are Perl, Python and Ruby . I want to mention that I'm comfortable with all of them, but the problem is that I can't focus just on one. If, for example, I see a cool Perl module, I have to try it out. If I see a nice Python app, I have to know how it's made. If I see a Ruby DSL or some Ruby voodoo, I'm hooked on Ruby for a while. Right now I'm working as a Java developer, but plan on taking CEH in the near future. My question is: for tool writing and exploit development, which language do you find to be the most appropriate? Again, I don't want to cause a flame-war or any trouble, I just want honest opinions from scripters that know what they're doing. One more thing: maybe some of you will ask "Why settle on one language?". To answer this: I would like to choose only one language, in order to try to master it.
0
1
77,717
0
12
[Disclaimer: I am primarily a Perl programmer, which may be colouring my judgement. However, I am not a particularly tribal one, and I think on this particular question my argument is reasonably objective.] Perl was designed to blend seamlessly into the Unix landscape, and that is why it feels so alien to people with a mainly-OO background (particularly the Java school of OOP). For that reason, though, it’s incredibly widely installed on machines with any kind of Unixoid OS, and many vendor system utilities are written in it. Also for the same reason, servers that have neither Python nor Ruby installed are still likely to have Perl on them, again making it important to have some familiarity with. So if your CEH activity includes extensive activity on Unix, you will have to have some amount of familiarity with Perl anyway, and you might as well focus on it. That said, it is largely a matter of preference. There is not much to differentiate the languages; their expressive power is virtually identical. Some things are a little easier in one of the languages, some a little easier in another. In terms of libraries I do not know how Ruby and Python compare against each other – I do know that Perl has them beat by a margin. Then again, sometimes (particularly when you’re looking for libraries for common needs) the only effect of that is that you get deluged with choices. And if you are only looking to do things in some particular area which is well covered by libraries for Python or Ruby, the mass of other stuff on CPAN isn’t necessarily an advantage. In niche areas, however, it matters, and you never know what unforeseen need you will eventually have (err, by definition). For one-liner use on the command line, Python is kind of a non-starter. In terms of interactive interpreter environment, Perl… uhm… well, you can use the debugger, which is not that great, or you can install one from CPAN, but Perl doesn’t ship a good one itself. So I think Perl does have a very slight edge for your needs in particular, but only just. If you pick Ruby you’ll probably not be much worse off at all. Python might inconvenience you a little more noticeably, but it too is hardly a bad choice.
Which of these scripting languages is more appropriate for pen-testing?
python,ruby,perl,security,penetration-testing
0
6,338
1
7
8
0
0
2008-09-16T21:05:00.000
0
77,086
41
0
false
Which is faster, python webpages or php webpages? Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php? I know that serving a python base webpage via cgi is slower than php because of its long start up every time. I enjoy using pylons and I would still use it if it was slower than php. But if pylons was faster than php, I could maybe, hopefully, eventually convince my employer to allow me to convert the site over to pylons.
0
1
33,627,050
0
10
I would assume that PHP (>5.5) is faster and more reliable for complex web applications because it is optimized for website scripting. Many of the benchmarks you will find at the net are only made to prove that the favoured language is better. But you can not compare 2 languages with a mathematical task running X-times. For a real benchmark you need two comparable frameworks with hundreds of classes/files an a web application running 100 clients at once.
Which is faster, python webpages or php webpages?
php,python,performance,pylons
0
58,657
1
9
7
0
0
2008-09-16T21:05:00.000
0
77,086
41
0
false
Which is faster, python webpages or php webpages? Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php? I know that serving a python base webpage via cgi is slower than php because of its long start up every time. I enjoy using pylons and I would still use it if it was slower than php. But if pylons was faster than php, I could maybe, hopefully, eventually convince my employer to allow me to convert the site over to pylons.
0
0.019997
77,093
0
10
If it ain't broke don't fix it. Just write a quick test, but bear in mind that each language will be faster with certain functions then the other.
Which is faster, python webpages or php webpages?
php,python,performance,pylons
0
58,657
1
9
1
0
0
2008-09-16T21:05:00.000
0
77,086
41
0
false
Which is faster, python webpages or php webpages? Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php? I know that serving a python base webpage via cgi is slower than php because of its long start up every time. I enjoy using pylons and I would still use it if it was slower than php. But if pylons was faster than php, I could maybe, hopefully, eventually convince my employer to allow me to convert the site over to pylons.
0
0.019997
77,166
0
10
You need to be able to make a business case for switching, not just that "it's faster". If a site built on technology B costs 20% more in developer time for maintenance over a set period (say, 3 years), it would likely be cheaper to add another webserver to the system running technology A to bridge the performance gap. Just saying "we should switch to technology B because technology B is faster!" doesn't really work. Since Python is far less ubiquitous than PHP, I wouldn't be surprised if hosting, developer, and other maintenance costs for it (long term) would have it fit this scenario.
Which is faster, python webpages or php webpages?
php,python,performance,pylons
0
58,657
1
9
1
0
0
2008-09-16T21:05:00.000
0
77,086
41
0
false
Which is faster, python webpages or php webpages? Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php? I know that serving a python base webpage via cgi is slower than php because of its long start up every time. I enjoy using pylons and I would still use it if it was slower than php. But if pylons was faster than php, I could maybe, hopefully, eventually convince my employer to allow me to convert the site over to pylons.
0
1
77,297
0
10
There's no point in attempting to convince your employer to port from PHP to Python, especially not for an existing system, which is what I think you implied in your question. The reason for this is that you already have a (presumably) working system, with an existing investment of time and effort (and experience). To discard this in favour of a trivial performance gain (not that I'm claiming there would be one) would be foolish, and no manager worth his salt ought to endorse it. It may also create a problem with maintainability, depending on who else has to work with the system, and their experience with Python.
Which is faster, python webpages or php webpages?
php,python,performance,pylons
0
58,657
1
9
30
0
0
2008-09-16T21:05:00.000
0
77,086
41
0
false
Which is faster, python webpages or php webpages? Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php? I know that serving a python base webpage via cgi is slower than php because of its long start up every time. I enjoy using pylons and I would still use it if it was slower than php. But if pylons was faster than php, I could maybe, hopefully, eventually convince my employer to allow me to convert the site over to pylons.
0
0
77,112
0
10
The only right answer is "It depends". There's a lot of variables that can affect the performance, and you can optimize many things in either situation.
Which is faster, python webpages or php webpages?
php,python,performance,pylons
0
58,657
1
9
0
0
0
2008-09-16T21:05:00.000
0
77,086
41
0
false
Which is faster, python webpages or php webpages? Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php? I know that serving a python base webpage via cgi is slower than php because of its long start up every time. I enjoy using pylons and I would still use it if it was slower than php. But if pylons was faster than php, I could maybe, hopefully, eventually convince my employer to allow me to convert the site over to pylons.
0
0.039979
77,220
0
10
PHP and Python are similiar enough to not warrent any kind of switching. Any performance improvement you might get from switching from one language to another would be vastly outgunned by simply not spending the money on converting the code (you don't code for free right?) and just buy more hardware.
Which is faster, python webpages or php webpages?
php,python,performance,pylons
0
58,657
1
9
2
0
0
2008-09-16T21:05:00.000
0
77,086
41
0
false
Which is faster, python webpages or php webpages? Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php? I know that serving a python base webpage via cgi is slower than php because of its long start up every time. I enjoy using pylons and I would still use it if it was slower than php. But if pylons was faster than php, I could maybe, hopefully, eventually convince my employer to allow me to convert the site over to pylons.
0
0.019997
510,276
0
10
an IS organization would not ponder this unless availability was becoming an issue. if so the case, look into replication, load balancing and lots of ram.
Which is faster, python webpages or php webpages?
php,python,performance,pylons
0
58,657
1
9
1
0
0
2008-09-16T21:05:00.000
0
77,086
41
0
false
Which is faster, python webpages or php webpages? Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php? I know that serving a python base webpage via cgi is slower than php because of its long start up every time. I enjoy using pylons and I would still use it if it was slower than php. But if pylons was faster than php, I could maybe, hopefully, eventually convince my employer to allow me to convert the site over to pylons.
0
-0.019997
2,412,215
0
10
I had to come back to web development at my new job, and, if not Pylons/Python, maybe I would have chosen to live in jungle instead :) In my subjective opinion, PHP is for kindergarten, I did it in my 3rd year of uni and, I believe, many self-respecting (or over-estimating) software engineers will not want to be bothered with PHP code. Why my employers agreed? We (the team) just switched to Python, and they did not have much to say. The website still is and will be PHP, but we are developing other applications, including web, in Python. Advantages of Pylons? You can integrate your python libraries into the web app, and that is, imho, a huge advantage. As for performance, we are still having troubles.
Which is faster, python webpages or php webpages?
php,python,performance,pylons
0
58,657
1
9
-1
0
0
2008-09-16T21:05:00.000
0
77,086
41
0
false
Which is faster, python webpages or php webpages? Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php? I know that serving a python base webpage via cgi is slower than php because of its long start up every time. I enjoy using pylons and I would still use it if it was slower than php. But if pylons was faster than php, I could maybe, hopefully, eventually convince my employer to allow me to convert the site over to pylons.
0
0.039979
77,174
0
10
It's about the same. The difference shouldn't be large enough to be the reason to pick one or the other. Don't try to compare them by writing your own tiny benchmarks ("hello world") because you will probably not have results that are representative of a real web site generating a more complex page.
Which is faster, python webpages or php webpages?
php,python,performance,pylons
0
58,657
1
9
2
0
0
2008-09-17T05:15:00.000
0
80,215
1
0
false
Is there any library available to query Btrieve databases without buying something from Pervasive? I'm looking to code in C# or Python.
0
0
718,654
0
3
This depends a lot on the version of Btrieve. I've been working with btrieve for a long time and have found that the best API for the old 6.15 version was in pascal. That having been said there was definately a C api around as well. Pervasive have recently released a 6.15 ultimate patch. Using this and the C api should allow you to work effectively with older btrieve databases. It is possible for instance to build new modules for python using C.
Btrieve without Pervasive?
c#,python,btrieve
0
2,923
1
3
0
0
0
2008-09-17T05:15:00.000
0
80,215
1
0
false
Is there any library available to query Btrieve databases without buying something from Pervasive? I'm looking to code in C# or Python.
0
0.132549
275,524
0
3
If you download one of the trial versions, you can get/install the odbc client and connect that way. In our version of pervasive (older version) on the server where the database is installed, you can also find this client install.
Btrieve without Pervasive?
c#,python,btrieve
0
2,923
1
3
2
0
0
2008-09-17T05:15:00.000
0
80,215
1
0
true
Is there any library available to query Btrieve databases without buying something from Pervasive? I'm looking to code in C# or Python.
0
1.2
80,596
0
3
As far as I know that is not possible. It is not an open source database, so writing drivers for it is really hard.
Btrieve without Pervasive?
c#,python,btrieve
0
2,923
1
3
1
0
0
2008-09-17T15:16:00.000
0
84,340
66
0
false
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
0.011428
87,121
0
35
Towards answering the updated question, its a chicken/egg problem. The best way to justify an expense is to show how it reduces a cost somewhere else, so you may need to spend some extra/personal time to learn something first to build some kind of functional prototype. Show your boss a demo like "hey, i did this thing, and it saves me this much time [or better yet, this much $$], imagine if everyone could use this how much money we would save" and then after they agree, explain how it is some other technology and that it is worth the expense to get more training, and training for others on how to do it better.
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
c#,java,python,ruby,perl
1
32,287
1
31
2
0
0
2008-09-17T15:16:00.000
0
84,340
66
0
false
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
0.005714
84,456
0
35
Personally I work on a Java app, but I couldn't get by without perl for some supporting scripts. I've got scripts to quickly flip what db I'm pointing at, scripts to run build scripts, scripts to scrape data & compare stuff. Sure I could do all that with java, or maybe shell scripts (I've got some of those too), but who wants to compile a class (making sure the classpath is set right etc) when you just need something quick and dirty. Knowing a scripting language can remove 90% of those boring/repetitive manual tasks.
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
c#,java,python,ruby,perl
1
32,287
1
31
1
0
0
2008-09-17T15:16:00.000
0
84,340
66
0
false
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
0.005714
84,443
0
35
They're useful for the "Quick Hack" that is for plugging a gap in your main language for a quick (and potentially dirty) fix faster than it would take to develop the same in your main language. An example: a simple script in perl to go through a large text file and replace all instances of an email address with another is trivial with an amount of time taken in the 10 minute range. Hacking a console app together to do the same in your main language would take multiples of that. You also have the benefit that exposing yourself to additional languages broadens your abilities and learning to attack problems from a different languages perspective can be as valuable as the language itself. Finally, scripting languages are very useful in the realm of extension. Take LUA as an example. You can bolt a lua interpreter into your app with very little overhead and you now have a way to create rich scripting functionality that can be exposed to end users or altered and distributed quickly without requiring a rebuild of the entire app. This is used to great effect in many games most notably World of Warcraft.
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
c#,java,python,ruby,perl
1
32,287
1
31
1
0
0
2008-09-17T15:16:00.000
0
84,340
66
0
false
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
0.005714
84,423
0
35
Im not sure if this is what you are looking for, but we write our main application with Java at the small company I work for, but have used python to write smaller scripts quickly. Backup software, temporary scripts to manipulate data and push out results. It just seems easier sometimes to sit down with python and write a quick script than mess with classes and stuff in java. Temp scripts that aren't going to stick around don't need a lot of design time wasted on them. And I am lazy, but it is good to just learn as much as you can of course and see what features exist in other languages. Knowing more never hurts you in future career changes :)
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
c#,java,python,ruby,perl
1
32,287
1
31
1
0
0
2008-09-17T15:16:00.000
0
84,340
66
0
false
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
0
84,584
0
35
You should also consider learning a functional programming language like Scala. It has many of the advantages of Ruby, including a concise syntax, and powerful features like closures. But it compiles to Java class files and and integrate seamlessly into a Java stack, which may make it much easier for your employer to swallow. Scala isn't dynamically typed, but its "implicit conversion" feature gives many, perhaps even all of the benefits of dynamic typing, while retaining many of the advantages of static typing.
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
c#,java,python,ruby,perl
1
32,287
1
31
0
0
0
2008-09-17T15:16:00.000
0
84,340
66
0
false
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
0.005714
85,167
0
35
Learning something with a flexible OOP system, like Lisp or Perl (see Moose), will allow you to better expand and understand your thoughts on software engineering. Ideally, every language has some unique facet (whether it be CLOS or some other technique) that enhances, extends and grows your abilities as a programmer.
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
c#,java,python,ruby,perl
1
32,287
1
31
1
0
0
2008-09-17T15:16:00.000
0
84,340
66
0
false
I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with the static language that you have been using for several years? Update After seeing the first few responses it is clear that there are two issues. My main interest would be something that is justifiable to the employer as an expense. That is, I am looking for justifications for the employer to finance the learning of a dynamic language. Aside from the obvious that the employee will have broader view, the employers are usually looking for some "real" benefit.
0
0.005714
85,733
0
35
If all you have is a hammer, every problem begins to look like a nail. There are times when having a screwdriver or pair of pliers makes a complicated problem trivial. Nobody asks contractors, carpenters, etc, "Why learn to use a screwdriver if i already have a hammer?". Really good contractors/carpenters have tons of tools and know how to use them well. All programmers should be doing the same thing, learning to use new tools and use them well. But before we use any power tools, lets take a moment to talk about shop safety. Be sure to read, understand, and follow all the safety rules that come with your power tools. Doing so will greatly reduce the risk of personal injury. And remember this: there is no more important rule than to wear these: safety glasses -- Norm
Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?
c#,java,python,ruby,perl
1
32,287
1
31
1
0
0

No dataset card yet

New: Create and edit this dataset card directly on the website!

Contribute a Dataset Card
Downloads last month
0
Add dataset card