Available Count
int64
1
31
AnswerCount
int64
1
35
GUI and Desktop Applications
int64
0
1
Users Score
int64
-17
588
Q_Score
int64
0
6.79k
Python Basics and Environment
int64
0
1
Score
float64
-1
1.2
Networking and APIs
int64
0
1
Question
stringlengths
15
7.24k
Database and SQL
int64
0
1
Tags
stringlengths
6
76
CreationDate
stringlengths
23
23
System Administration and DevOps
int64
0
1
Q_Id
int64
469
38.2M
Answer
stringlengths
15
7k
Data Science and Machine Learning
int64
0
1
ViewCount
int64
13
1.88M
is_accepted
bool
2 classes
Web Development
int64
0
1
Other
int64
1
1
Title
stringlengths
15
142
A_Id
int64
518
72.2M
1
2
0
3
3
0
1.2
0
I want to Search for an Object name. If i have this Structure: /de/myspace/media/justAnotherPdf.pdf Then i want to Search for the name "justAnotherPdf" to find it or something like "justAnot" I have Indexed the pdf files. But i cant search it with TextIndexNG2 or PathIndex.
0
python,dhtml,zope
2011-08-02T12:42:00.000
0
6,912,241
Currently this is not supported out-of-the-box. Object identifiers (getId) are only indexed as field values and thus can only be looked up as whole strings. You'd need to add separate index to the catalog to support your use-case. You could add a new TextIndexNG2 index with a new name indexing just the getId method. In the ZMI, find the portal_catalog, then it's 'Indexes' tab, then on the right-hand-side you'll find a drop-down menu for adding a new index. Pick a memorable name ('fullTextId' for example) and use getId as the indexed attribute. You'll need to do a reindex, but only for that index. Once added, select it in on the Indexes tab (tick the check-box) and select 'Reindex' at the bottom of that page. Now you can use this index in your custom searches with a wildcard search.
0
171
true
0
1
How to search for ZCatalog object names
6,913,162
2
7
1
1
43
0
0.028564
0
I have a C++ process running in the background that will be generating 'events' infrequently that a Python process running on the same box will need to pick up. The code on the C side needs to be as lightweight as possible. The Python side is read-only. The implementation must be cross-platform. The data being sent is very simple. What are my options? Thanks
0
c++,python,cross-platform,ipc
2011-08-02T16:17:00.000
0
6,915,191
How complex is your data? If it is simple I would serialize it as a string. If it was moderately complex I would use JSON. TCP is a good cross-platform IPC transport. Since you say that this IPC is rare the performance isn't very important, and TCP+JSON will be fine.
0
40,430
false
0
1
Simple IPC between C++ and Python (cross platform)
6,915,320
2
7
1
-3
43
0
-0.085505
0
I have a C++ process running in the background that will be generating 'events' infrequently that a Python process running on the same box will need to pick up. The code on the C side needs to be as lightweight as possible. The Python side is read-only. The implementation must be cross-platform. The data being sent is very simple. What are my options? Thanks
0
c++,python,cross-platform,ipc
2011-08-02T16:17:00.000
0
6,915,191
I will say you create a DLL that will manage the communication between the two. The python will load DLL and call method like getData() and the DLL will in turn communicate with process and get the data. That should not be hard. Also you can use XML file or SQLite database or any database to query data. The daemon will update DB and Python will keep querying. There might be a filed for indicating if the data in DB is already updated by daemon and then Python will query. Of course it depends on performance and accuracy factors!
0
40,430
false
0
1
Simple IPC between C++ and Python (cross platform)
6,915,884
1
4
0
2
6
1
0.099668
0
Does anyone know, what is the actual reason behind "dollar variable notation" in some of the scripting languages, i.e. PHP or Perl? Python creators did not find $variable useful, neither do I. Why does PHP and Perl force me to press shift-4 so often? (OK, in Perl you can somehow explain it with distinguishing $scalar, @array and %hash but still it could be successfully avoided there, type does not need to be explicit)
0
php,javascript,python,perl
2011-08-03T05:55:00.000
0
6,922,245
They use it when parsing so that variables can easily be distinguished from other stuffs.
0
656
false
0
1
Dollar notation in script languages - why?
6,922,286
1
2
0
3
0
0
0.291313
0
I want get the mount node of an usb mass-storage device, like /media/its-uuid in pyudev, class Device has some general attributes, but not uuid or mount node. how to do it thanks help
0
python,udev
2011-08-03T14:59:00.000
1
6,928,566
With pyudev, each device object provides a dictionary-like interface for its attributes. You can list them all with device.keys(), e.g. UUID is for block devices is dev['ID_FS_UUID'].
0
2,348
false
0
1
how to get uuid of a device using udev
6,930,448
2
2
0
0
2
1
0
0
I'd like some advice on how to check for the correctness of the parameters I receive. The checking is going to be done in C++, so if there's a good solution using Boost.Python (preferably) or the C API, please tell me about that. Otherwise, tell me what attributes the object should have to ensure that it meets the criteria. So... How do you check that an object is a function? How do you check that an object is a bound method? How do you check that an object is a class object? How do you check that a class object is a child of another class?
0
c++,python,boost,boost-python
2011-08-03T20:44:00.000
0
6,933,058
I have two unconventional recommendations for you: 1) Don't check. The Python culture is to simply use objects as you need to, and if it doesn't work, then an exception will occur. Checking ahead of time adds overhead, and potentially limits how people can use your code because you're checking more strictly than you need to. 2) Don't check in C++. When combining Python and C (or C++), I recommend only doing things in C++ that need to be done there. Everything else should be done in Python. So check your parameters in a Python wrapper function, and then call an unchecked C++ entry point.
0
400
false
0
1
Python: How to check that...?
6,933,233
2
2
0
3
2
1
1.2
0
I'd like some advice on how to check for the correctness of the parameters I receive. The checking is going to be done in C++, so if there's a good solution using Boost.Python (preferably) or the C API, please tell me about that. Otherwise, tell me what attributes the object should have to ensure that it meets the criteria. So... How do you check that an object is a function? How do you check that an object is a bound method? How do you check that an object is a class object? How do you check that a class object is a child of another class?
0
c++,python,boost,boost-python
2011-08-03T20:44:00.000
0
6,933,058
When in doubt just work out how you would get the required effect by calling the usual Python builtins and translate it to C/C++. I'll just answer for Python, for C you would look up the global such as 'callable' and then call it like any other Python function. Why would you care about it being a function rather than any other sort of callable? If you want you can find out if it is callable by using the builtin callable(f) but of course that won't tell you which arguments you need to pass when calling it. The best thing here is usually just to call it and see what happens. isinstance(f, types.MethodType) but that won't help if it's a method of a builtin. Since there's no difference in how you call a function or a bound method you probably just want to check if it is callable as above. isinstance(someclass, type) Note that this will include builtin types. issubclass(someclass, baseclass)
0
400
true
0
1
Python: How to check that...?
6,933,216
3
5
0
0
4
0
0
0
I'm deciding on a web framework for an upcoming project, and I'd appreciate any advice. We've decided to use jQuery for the JavaScript, and are heavily leaning toward Python or PHP (more Python) for our server-side logic. I'm especially interested in web2py because of its jQuery integration. About our project Our project is to develop a security console for a complex cybersecurity system operating within an organization's internal network. This console will be largely server-driven, as messages come in from the network and must be pushed by the server to the user. The user will also be able to initiate security actions, the implementation for which will likely be in C++. The interface we've planned will be relatively rich, and I want to leverage jQuery's power as much as possible. We have some control over the browser environment we'll be running in (e.g., we don't have to worry about clients with JavaScript disabled). Our site is likely to have only a few, long-lived client connections. We are looking for software components with permissive licenses, though we're using some copyleft components (I see that web2py is LGPL while Django is BSD, so +1 to Django) We have about a month to create a functional demo of our system, of which this interface is a small (but visible) part. About us We are two developers with about 5 years of programming experience, but little web development experience. I have several years of Python experience and a summers' worth of experience messing around with PHP. My coworker has some Python experience and has never touched PHP. I used Django once back in 2008, and was frustrated by the file and code structure, which I found highly unintuitive. Perhaps this structure is inherent to the MVC model (I've had similar experiences with Django and CakePHP since), and I just need to bite the bullet and memorize it. My Question Given the information above, what are the relative advantages of the various Python/PHP web frameworks for our project? As mentioned above, I'm especially interested in web2py because of its jQuery integration, though Django's dominance is (once again) hard to ignore. Thank you very much for your time!
0
php,python,django,web-frameworks,web2py
2011-08-04T01:05:00.000
0
6,935,094
I've been using Django as part of my work for a couple years now and truly enjoy it when I can make it work. Unfortunately, and maybe it's just me, but I end up spending hours working on configuration every time I start a new server, or try to make it work in a development IDE. It's relatively simple to start a new project and start coding. But there are all sorts of little catches that keep things from working if you deviate from the norm. Things like if you want your django project to serve from a subdirectory like example.com/django. The information is out there to make it work. But it's hard to find. I can't tell you if web2py has those same problems or not. I only just learned about it from your question. It does look slick and simple though. I can tell you that after the hassles of getting the applications to serve properly from whatever server configuration I'm using, django is way more fun to program with than plain php. PHP frameworks may differ.
0
1,845
false
1
1
What are the relative advantages of various Python/PHP web frameworks (particularly for my project)?
6,935,676
3
5
0
1
4
0
0.039979
0
I'm deciding on a web framework for an upcoming project, and I'd appreciate any advice. We've decided to use jQuery for the JavaScript, and are heavily leaning toward Python or PHP (more Python) for our server-side logic. I'm especially interested in web2py because of its jQuery integration. About our project Our project is to develop a security console for a complex cybersecurity system operating within an organization's internal network. This console will be largely server-driven, as messages come in from the network and must be pushed by the server to the user. The user will also be able to initiate security actions, the implementation for which will likely be in C++. The interface we've planned will be relatively rich, and I want to leverage jQuery's power as much as possible. We have some control over the browser environment we'll be running in (e.g., we don't have to worry about clients with JavaScript disabled). Our site is likely to have only a few, long-lived client connections. We are looking for software components with permissive licenses, though we're using some copyleft components (I see that web2py is LGPL while Django is BSD, so +1 to Django) We have about a month to create a functional demo of our system, of which this interface is a small (but visible) part. About us We are two developers with about 5 years of programming experience, but little web development experience. I have several years of Python experience and a summers' worth of experience messing around with PHP. My coworker has some Python experience and has never touched PHP. I used Django once back in 2008, and was frustrated by the file and code structure, which I found highly unintuitive. Perhaps this structure is inherent to the MVC model (I've had similar experiences with Django and CakePHP since), and I just need to bite the bullet and memorize it. My Question Given the information above, what are the relative advantages of the various Python/PHP web frameworks for our project? As mentioned above, I'm especially interested in web2py because of its jQuery integration, though Django's dominance is (once again) hard to ignore. Thank you very much for your time!
0
php,python,django,web-frameworks,web2py
2011-08-04T01:05:00.000
0
6,935,094
Python vs PHP: Python With python, you can always write wrappers for C code so you won't have to mess with starting other processes and passing args to them. That might be useful for your security functions. Web2py will allow you to easily write a webservice for this too, to more easily integrate the C portions with the web-site infrastructure. If you already prefer python, I would go with that. If you need to bring on web-developers later that are trained in PHP, teach them Python. It won't take long, and I'm sure they'll appreciate it in the long run. Plus, moving from a PHP MVC framework to web2py or even django would make things easier. I've used CodeIgniter for PHP and find that web2py was so much simpler and easy to understand. Also as for the directory structure, django is not actually true MVC -- it's MTV (model, template, view). I find web2py's organization a little more straight-forward. But yes, either way it can seem strange at first. I would say YES, you should bite the bullet and use MVC. In web2py, the "view" is html markup with the ability to write raw python code. The controller extracts data from the model (database), attaches any needed files (css/js etc) and the model of course simply defines the structure of the data and allows you to access it in an OO way. Lastly, I wouldn't tip my hat in favor of web2py just because of jQuery integration. It does use it, and a some of the built-in framework stuff (like response.flash/session.flash, the LOAD function that loads a page or data from another controller) rely on jQuery, but using it in another framework only means you have to write an include statement (e.g. ). But, the way it allows/forces you to focus on development is what takes the cake for me.
0
1,845
false
1
1
What are the relative advantages of various Python/PHP web frameworks (particularly for my project)?
6,961,688
3
5
0
2
4
0
1.2
0
I'm deciding on a web framework for an upcoming project, and I'd appreciate any advice. We've decided to use jQuery for the JavaScript, and are heavily leaning toward Python or PHP (more Python) for our server-side logic. I'm especially interested in web2py because of its jQuery integration. About our project Our project is to develop a security console for a complex cybersecurity system operating within an organization's internal network. This console will be largely server-driven, as messages come in from the network and must be pushed by the server to the user. The user will also be able to initiate security actions, the implementation for which will likely be in C++. The interface we've planned will be relatively rich, and I want to leverage jQuery's power as much as possible. We have some control over the browser environment we'll be running in (e.g., we don't have to worry about clients with JavaScript disabled). Our site is likely to have only a few, long-lived client connections. We are looking for software components with permissive licenses, though we're using some copyleft components (I see that web2py is LGPL while Django is BSD, so +1 to Django) We have about a month to create a functional demo of our system, of which this interface is a small (but visible) part. About us We are two developers with about 5 years of programming experience, but little web development experience. I have several years of Python experience and a summers' worth of experience messing around with PHP. My coworker has some Python experience and has never touched PHP. I used Django once back in 2008, and was frustrated by the file and code structure, which I found highly unintuitive. Perhaps this structure is inherent to the MVC model (I've had similar experiences with Django and CakePHP since), and I just need to bite the bullet and memorize it. My Question Given the information above, what are the relative advantages of the various Python/PHP web frameworks for our project? As mentioned above, I'm especially interested in web2py because of its jQuery integration, though Django's dominance is (once again) hard to ignore. Thank you very much for your time!
0
php,python,django,web-frameworks,web2py
2011-08-04T01:05:00.000
0
6,935,094
Before deciding on a framework, you should first decide if you want to commit to a language you are unfamiliar with. You said you've both got minimal PHP experience, so you have to weigh up the advantages here; Will the pros for going PHP (if any) out weigh the amount of time the developers will need to spend to retrain? (Although depending on your background experience, PHP should be very easy to pick up.) If you frame it like that, PHP would have to have a pretty convincing offering to give you. From what I'm seeing, specifically Django vs web2py, they both seem very close in functionality - which is good, but doesn't provide the "you must use x!" scenario you may be after. However, If you will be bringing more people in later and feel finding people to work with web2py will be difficult, it may tip it to PHP. You said your self, Django's popularity (and BSD license) is hard to ignore, and it should make it easier to find people for later expansion. If it were me, in your shoes, I would go with web2py. Assuming the development team will continue to be Python focused for the foreseeable future.
0
1,845
true
1
1
What are the relative advantages of various Python/PHP web frameworks (particularly for my project)?
6,935,412
2
3
0
1
1
0
0.066568
0
I have a simple mail sending application which runs in python using Django. After sending an email is there a way to see if the recipient has opened it or is it still un-opened? if so how can i do it?
0
python,django,email
2011-08-04T04:37:00.000
0
6,936,252
You have no other way than generate confirm url in your message like most sites registrations do. If person would be glad to register on your website, he will certainly click confirm at his email client of any sort. Otherwise it's a spam/scam email. There is no way you can do it and know it's a live e-mail for sure... Besides there are 2 other ways mentioned by my colleagues... But they are based on "unsecure" settings in old email clients rather than sure way... IMHO.
0
2,684
false
1
1
Checking the status of a sent email in django
6,937,662
2
3
0
3
1
0
0.197375
0
I have a simple mail sending application which runs in python using Django. After sending an email is there a way to see if the recipient has opened it or is it still un-opened? if so how can i do it?
0
python,django,email
2011-08-04T04:37:00.000
0
6,936,252
You can try setting require return receipt flag on the email you are sending. But, a lot of people (I know I do) ignore that return receipt so you will never find out in those cases. If you are asking for a 100% certain method of finding out if the recipient read his/her email, then the straight answer is: NO, you can't do that.
0
2,684
false
1
1
Checking the status of a sent email in django
6,936,289
1
1
0
5
1
1
1.2
0
I'm currently researching deployment techniques for our Python products. We manage our code with multiple git repositories already but want to improve the process of setting up and updating our servers. It seems that easy_install, .egg files and virtualenv are the best tools for doing this nowadays. Here's the catch: We don't really do versioning; all our products have a master branch which is supposed to provide stable code all the time. If we want to update, we have to git pull the master branch on every server, for each product and all its dependencies. This solution is very time-consuming and we want to improve it. My idea was to create a virtualenv instance on all servers/installations and use easy_install to install and update our own packages, but I couldn't find a way to specify a git repository as a source for the source code. Is there a way to achieve that? Did I miss something? Am I going in the wrong direction and this is a bad idea overall? Thanks in advance, Fabian
0
python,virtualenv,setuptools
2011-08-04T09:54:00.000
0
6,939,351
You can use pip instead of easy_install, it supports a number of possible ways to specify where to get the package from, one being git, you could then install your package like this: pip install git://my.git-repo.com/my_project.git
0
1,234
true
0
1
Create Python .egg that installs from git repository
6,939,437
1
2
0
1
1
1
0.099668
0
I have several scripts written in perl, python, and java (wrapped under java GUI with system calls to perl & python). And I have many not-tech-savy users that need to use this in their windows machines (xp & 7). To avoid users from installing perl,python,and java and to avoid potential incompatibility between various versions of these interpreters, I'd like to make a local copy of these interpreters in a folder and then calling them. I'd zip the whole folder (which would also contain my code) and send it away. I'd have to worry about environment variables and make calls to the correct interpreter (especially when other versions of python,java,perl may exists in their current system), but not sure what other problems I may face. Any better ideas? I never used jython and do not know the overhead of moving to it. I also suspect a complex python system, with many files and 3rd party modules will have problems. Same with perl scripts and I don't know a robust perl interpreter callable from java. Thank you, in advance.
0
java,python,windows,perl,installation
2011-08-04T23:44:00.000
1
6,949,915
Why don't you try migrating your perl/python code into java and then packagin everything into a nice webstart application? What do perl/python offer that java doesn't support? For perl you can use something like perl2exe and for python py2exe so you can have 2 exes (which would include all the necessary interpreter bits) and invoke them as resources from within java? Or unzip them inside user's home directory and call them again as normal external programs (ProcessBuilder ?) ?
0
168
false
0
1
Package them all! Perl, python, java for naive users (in windows)
6,950,147
1
3
0
3
2
1
0.197375
0
I'm trying to get certain strings in a .py file translated, using the i18n machinery. Translating .pt files is not a problem, but whenever I try to translate using _('Something') in Python code on the filesystem, it always gives English text (which is the default) instead of the Norwegian text that should be there. So I can see output from python code in English, while other Page Templates bits are correctly translated. Is there a how-to or something similar for this?
0
python,internationalization,plone,zope
2011-08-05T08:18:00.000
0
6,953,370
be aware that _() does not translate the text at call, but returns a Message object which will be translated when rendered in a template. That means: do not concat Message objects. "text %s" % _('translation') will not work, as well as "text" + _('translation') if you do not send the text to the browser through a template, it may not be translated. for example if you generate a email you need to translate the Message object manually
0
190
false
0
1
Translating content in filesystem for a Plone product
6,956,931
1
1
0
2
0
1
1.2
0
I'm newbie to python and it's philosophy. I'm trying to develop a module on github. Is there any Ruby's gem generator like tool for developing module? How to develop a module? Thank you for any advise.
0
python,python-module
2011-08-05T16:10:00.000
0
6,959,310
You don't need a tool to create a python module, any filename ending in .py is sufficient. A package, which is a collection of modules, is similarly created by the presence of a file named __init__.py in the same folder as other modules (and possibly other packages). The __init__.py file can be empty or not, your choice. Best practices dictate that importing a module should have no side effects; It should define classes and functions, but take no action. python modules should start with a docstring explaining the purpose of the module and how it should be used.
0
445
true
0
1
Python module generator for github
6,959,402
2
3
0
91
62
1
1.2
0
Ok, as Google search isn't helping me in a while (even when using the correct keywords). I have a class extending from TestCase in which I want to have some auxiliary methods that are not going to be executed as part of the test, they'll be used to generate some mocked objects, etc, auxiliary things for almost any test. I know I could use the @skip decorator so unittest doesn't run a particular test method, but I think that's an ugly hack to use for my purpose, any tips? Thanks in advance, community :D
0
python,unit-testing
2011-08-05T18:39:00.000
0
6,961,099
I believe that you don't have to do anything. Your helper methods should just not start with test_.
0
18,227
true
0
1
Non-test methods in a Python TestCase
6,961,157
2
3
0
3
62
1
0.197375
0
Ok, as Google search isn't helping me in a while (even when using the correct keywords). I have a class extending from TestCase in which I want to have some auxiliary methods that are not going to be executed as part of the test, they'll be used to generate some mocked objects, etc, auxiliary things for almost any test. I know I could use the @skip decorator so unittest doesn't run a particular test method, but I think that's an ugly hack to use for my purpose, any tips? Thanks in advance, community :D
0
python,unit-testing
2011-08-05T18:39:00.000
0
6,961,099
The test runner will only directly execute methods beginning with test, so just make sure your helper methods' names don't begin with test.
0
18,227
false
0
1
Non-test methods in a Python TestCase
6,961,191
1
4
0
3
1
1
0.148885
0
Well, this query struck my mind when someone pointed out to me that importing a package using import package gives more code readability. Is this actually true? I mean when using this statement as compared to from package import x, y, z, isn't there any overhead of importing the entire package?
0
python,import
2011-08-06T13:37:00.000
0
6,967,166
The performance will be same either way. The entire module is compiled, if needed, and the code executed, the first time you import a module, no matter how you import it.
0
557
false
0
1
Python "import" performance query
6,967,383
2
2
0
0
0
1
0
0
I am having a python .so file which works fine with python v2.4.3 , but I dont have the source code of that library file. Now It fails to work in python 2.6.5. Is it possible to open the .so file and recompile it in python 2.6.5 ?? I dont know whether it is possible, I am just curious . Thanks ! The error I get Traceback (most recent call last): File "run.py", line 1, in import MarkovPrediction File "/home/ssubbiah/markov_prediction/vmresource/MarkovPrediction.py", line 7, in import libmarkov ImportError: /home/ssubbiah/markov_prediction/vmresource/libmarkov.so: undefined symbol: _ZN5boost6python9converter8registry6insertEPFPvP7_objectEPFvS5_PNS1_30rvalue_from_python_stage1_dataEENS0_9type_infoE Sethu
0
python,linux
2011-08-07T00:39:00.000
0
6,969,951
A .so file (.pyd on Windows) is a module which was written in C. It's compiled for, and tied to, a specific version of Python, in this case Python 2.4.x. If you want it to work with a different version of Python, you'll need to re-compile the original source code for that version.
0
152
false
0
1
Finding out what is inside a python library file
6,969,990
2
2
0
0
0
1
1.2
0
I am having a python .so file which works fine with python v2.4.3 , but I dont have the source code of that library file. Now It fails to work in python 2.6.5. Is it possible to open the .so file and recompile it in python 2.6.5 ?? I dont know whether it is possible, I am just curious . Thanks ! The error I get Traceback (most recent call last): File "run.py", line 1, in import MarkovPrediction File "/home/ssubbiah/markov_prediction/vmresource/MarkovPrediction.py", line 7, in import libmarkov ImportError: /home/ssubbiah/markov_prediction/vmresource/libmarkov.so: undefined symbol: _ZN5boost6python9converter8registry6insertEPFPvP7_objectEPFvS5_PNS1_30rvalue_from_python_stage1_dataEENS0_9type_infoE Sethu
0
python,linux
2011-08-07T00:39:00.000
0
6,969,951
Extension modules need to be compiled for a specific version of Python. Without the source code, no, you can't use it for a different version.
0
152
true
0
1
Finding out what is inside a python library file
6,969,991
1
5
0
5
7
1
0.197375
0
I am about to get involved in a NLP-related project and I need to use various libraries. Some are in java, others in C/C++ (for tasks that require more speed) and finally some are in Python. I was thinking of using Python as the "glue" and create wrapper-classes for every task that I want to do that relies on a different language. In order to do that, the wrapper class, for example, would execute the java program and communicate with it using pipes. My questions are: Do you think that would work for cpu-demanding and highly repetitive tasks? Or would the overhead added by the pipe-communication be too heavy? Is there any other (preferably simple) architecture that you would suggest?
0
java,c++,python,nlp,wrapper
2011-08-07T02:35:00.000
0
6,970,359
I would simply advise not doing this. Don't implement stuff in C/C++ "for speed". The performance benefit is not likely to be as great as you expect; e.g. compared with implementing in Java using "best practice" design and performance techniques. Don't try and glue lots of languages together. You are setting yourself up for lots of portability issues, difficulties in debugging, and reliability issues; e.g. due to C / C++ bugs crashing the JVM. In addition, there are performance overheads in bridging between languages, and there can be unexpected bottlenecks. (For instance, you may find that your C/C++ has to be run single-threaded due to threading issues, and that you therefore can't get the benefit of Java multi-threading on a typically multi-core system.) Instead, I advise you to look for libraries that allow you to implement the entire application in one language. If that is not possible, design it so that the different language components are different executables / processes, communicating via some kind of RPC, messaging, or whatever.
0
360
false
0
1
Find an efficient way to integrate different language libraries into one project using Python as the "glue"
6,970,615
1
1
0
4
2
0
0.664037
0
This is simply a personal exercise/project, I don't intend to inflict this on the world. My goal is to further my understanding of both languages, and it would be a nice having a nice Python code base in the end. But basically there is a program I like with a large (about 100ksloc) C++ code base, what I'd like to do is gradually rewrite modules in Python while having the existing C++ code use the new Python. The reason I'd like to do it this way instead of starting from scratch is because the application would/should be fully functional from the beginning. Prime question is: Is this realistic? I'm pretty sure it'd work in theory, but in practice is it just not worth the effort? Has anyone done it before?
0
c++,python,translation,boost-python
2011-08-07T03:33:00.000
0
6,970,557
having the existing C++ code use the new Python I think you'll find that python makes a better glue language for C++ than C++ does for python. So you probably will have an easier time converting the main function to python first (in fact, the first step could be just renaming the main function, compiling the C++ app as a python library, and having one line of python which calls the renamed main). Then start moving functionality from C++ to python one line at a time. As @freedompeace suggested, you may want to leave significant chunks in C++, with python providing the glue. Depends on whether portability or speed/memory efficiency is more important to you.
0
215
false
0
1
Is gradually translating a program written in C++ to Python feasible?
6,970,611
1
1
0
3
3
1
1.2
0
I usually unit test per class and this is no problem. However after messing around with python I have hit a problem that I have not encountered before in other languages, meta classes and inner classes. Say I have a class that contains an inner class and also has a meta class, what is the best way to structure unit tests for this situation? One way could be to test all three in a single test module as they are so tightly coupled anyway. But this seems wrong to me. But how would I unit test the meta class on it's own, create a dummy class within the test that uses said meta class?? Your thoughts please stackoverflow!
0
python,unit-testing,inner-classes,metaclass,python-unittest
2011-08-07T07:19:00.000
0
6,971,335
You test a class by instantiating it. The "dummy class" you mentioned would be an instance of the metaclass, so that's exactly how you should test it. When it comes to testing the inner class / outer class -- yes, I would include testing the inner class in the test for the outer class. If it makes sense to test the inner class independently from the outer class, why is it an inner class at all? Any inner class should only make sense in the scope of the outer class. If you are going to test it independently, you'll have to imitate the environment of the outer class anyway.
0
1,309
true
0
1
Unit testing metaclasses and inner classes in python
6,971,546
1
2
0
-1
5
0
-0.099668
0
I'm in the process of setting up a webserver from scratch, mainly for writing webapps with Python. On looking at alternatives to Apache+mod_wsgi, it appears that pypy plays very nicely indeed with pretty much everything I intend to use for my own apps. Not really having had a chance to play with PyPy properly, I feel this is a great opportunity to get to use it, since I don't need the server to be bulletproof. However, there are some PHP apps that I would like to run on the webserver for administrative purposes (PHPPgAdmin, for example). Is there an elegant solution that allows me to use PyPy within a PHP-compatible webserver like Apache? Or am I going to have to run CherryPy/Paste or one of the other WSGI servers, with Apache and mod_wsgi on a separate port to provide administrative services?
1
php,python,apache,wsgi,pypy
2011-08-07T23:41:00.000
0
6,976,578
I know that mod_wsgi doesn't work with mod_php I heavily advise you, running PHP and Python applications on CGI level. PHP 5.x runs on CGI, for python there exists flup, that makes it possible to run WSGI Applications on CGI. Tamer
0
815
false
1
1
PyPy + PHP on a single webserver
8,920,308
1
1
0
2
2
0
0.379949
0
I'd like to disable the option to move FeinCMS contenttypes whithin a region. Does anyone have any suggestions how to accomplish this?
0
python,django,content-management-system,contenttype,feincms
2011-08-08T08:38:00.000
0
6,979,529
No, that's not possible currently. What's the reasoning behind this feature request?
0
108
false
0
1
Disable option to move FeinCMS contenttypes within a region
6,979,669
1
2
0
1
0
0
0.099668
1
I'd like to: Send request from the browser to a python CGI script This request will start some very long operation The browser should check progress of that operation every 3 seconds How can I do that?
0
python,ajax,cgi
2011-08-08T14:25:00.000
0
6,983,622
You could do this - Use Javascript to check progress every 3 seconds. Your Python script hit at anytime should give the progress at that instance. It should essentially act as state-machine. You need a server here or maybe the progress is stored on some file. But having a server is the way to go... Maybe the long running process stores the progress in a MySQL table. Hope this helps...
0
345
false
1
1
Python with CGI - handle ajax
6,983,929
2
3
0
5
4
1
0.321513
0
I have a local git repository which has some Python modules and I would like to create a new project which includes these files (I installed egit egit). My repository does not include a .project file.
0
python,eclipse,git,pydev,egit
2011-08-09T12:26:00.000
0
6,996,167
It happened to me not so long ago. I could not find a nice way to solve it, but found a simple way though :). What I did was simple : Create a brand new project, and let it empty. Get the .project file wihch was created together with the project and add it in the git repository. Now you can directly import your repo as a project. Quite straightforward and simple.
0
6,040
false
0
1
How to add an existing git repository (without an eclipse project) into eclipse?
9,559,566
2
3
0
1
4
1
0.066568
0
I have a local git repository which has some Python modules and I would like to create a new project which includes these files (I installed egit egit). My repository does not include a .project file.
0
python,eclipse,git,pydev,egit
2011-08-09T12:26:00.000
0
6,996,167
File > New PyDev Project Unclick "Use default" and browse to your git repo. Enter project name. Name must be the same as the git repo. You'll get a "Source Folder Not Found" error if it's not. Click Finish.
0
6,040
false
0
1
How to add an existing git repository (without an eclipse project) into eclipse?
34,880,409
1
1
0
1
1
0
0.197375
1
I have written an application which using twitter authentication. Authentication process: Get the request token Authorize the token Get the access key Now I have access key, I can use the twitter API. I stored the access_key pair in the database for further use. But when next time user logged in via twitter, since already i have access_key pair I dont want to authorize. How can I do that?
0
python,api,twitter
2011-08-09T14:44:00.000
0
6,998,046
You mean you're using the "log in via twitter" hack? Well, if you want a "remember me" option you can build one just like normal (store some session info in a cookie... all security caveats apply). If the actually are logged out and there's no cookie then you have to go through the whole process again anyway. The authorize step will just redirect them right back, likely, since they have already authorized your app.
0
151
false
0
1
twitter authentication issue using oauth?
6,998,115
1
2
0
0
3
1
1.2
0
I've noticed how easy it is to debug a Python script from Eclipse. Simply set breakpoints and run a Python script from the debug menu. But is it possible to start a Python Interactive Interpreter instead of running a particular Python script, whilst still having Eclipse breaking on breakpoints? This would make it so much easier to test functions. Thanks for any help Still looking for a simple/ish way to start the debugger in Eclipse->PyDev that lets me use the interactive debugger. None of the answers as of yet is acceptable
0
python,eclipse,debugging,aptana
2011-08-09T17:17:00.000
0
7,000,138
what about this, in the script, you can write a function, say onlyForTest, then each time you write a new function and want to test it, you can just put it in the onlyForTest function, then specify some arguments required by the new function you just write, then open the interactive python shell, import the script, call the onlyForTest function, check out the result.
0
1,331
true
0
1
How can I debug Python code without running a script (using Eclipse)?
7,008,430
1
3
0
0
1
0
0
1
I'm primarily using Drupal and am considering moving away from CMS. If I were to build my own platform could I integrate modules like commenting systems, user login, etc. through a PHP/Python API? What would be the proper steps/good places to look/good tutorial on this? Would I have to build all of my own tables manually to suit the needs of such custom modules? I'm wondering if this would even be possible with out having to hard code all of this by hand? Thank you.
0
php,python
2011-08-10T04:46:00.000
0
7,006,013
First of all if you are considering moving away from CMS than you should consider using some sort of framework but with time you will come to idea that you need your own shit in order to be satisfied. Second, subject you are trying to decipher is a little bit more complex than just writing it down here. I would suggest you to first think what do you need. What is your main goal with it or what are you trying to accomplish? For example in meaning of commenting, if you want the truth nor PHP nor Python are masterpieces. Why not to consider Node.JS for that? I mean, web is becoming real-time more and more. Now days we have scripts or to be more precise, pieces of art such as Socket.IO who can with help of Node.JS handle large amount of traffic without any problem. Something nor Python nor PHP can do. Some stuff you will need to code by yourself but most of the time you just need to code "architecture link" between one versus many features. Eg. take some code and adjust it to be able use it from your own framework or whatever. As far I see it. I like to do all crucial parts by myself but for example there is Zend Framework and you can use ACL + Auth library and start from there. Hope this makes some sense. Cheers!
0
152
false
0
1
Are there comment system/user loggin type modules through PHP API/Python API outside of CMS?
7,006,100
1
1
1
2
1
0
0.379949
0
I'm unit-testing a python c module in Eclipse using PyDev unit-testing. The development steps are: I first write the python tests in Eclipse and then the c code that passes the tests for the module in Codeblocks. Here is where a script is called to create a dll and ctypes bindings for it. After that the “dll” and the “py” code is copied to a directory where the module can be easily imported. But sometimes I get the error: IOError: [Errno 13] Permission denied: 'C:\...\pyCModule.dll' I’ve haven’t found the reason for that (deactivating code analysis and code completion haven’t helped). I’ve checked with the Process Explorer (from sysinternals) and it shows that the eclipse process has python.exe as child (I suppose that’s from PyDev) and that one is using my pyCModule.dll (and not always releasing it). Does someone have and idea of want could be done here? or what is wrong? Thanks in advance ! Francis
0
python,unit-testing,dll,pydev
2011-08-10T08:05:00.000
0
7,007,635
This happens because PyDev launches a shell that imports that dll (to do code-completion). You can do Ctrl+2 kill (with focus in a PyDev editor), to kill all the shells that PyDev may have spawned (that way you can update it). Cheers, Fabio
0
260
false
0
1
Dll from python module is not released in Eclipse / PyDev
7,011,545
2
4
0
0
1
1
0
0
When I put in Python interpreter a ** b % c with large a (20 figures) b (4 figures) c (20 figures) I saw that Python calculates it pretty fast, almost like pow (a,b,c). I expect another behavior that Python first calculate a ** b then get the modulo (%) of result and such calculation will take significantly more time. Where is the magic behind the scene?
0
python,math,modulo
2011-08-10T16:40:00.000
0
7,014,512
Today's computers are amazingly fast, very complicated calculations can occur in what seems like no time at all. You need to repeat such calculations very many times to see the delay; I'd start with a million.
0
2,476
false
0
1
Behavior of Python ** and % operators with big numbers
7,014,615
2
4
0
2
1
1
0.099668
0
When I put in Python interpreter a ** b % c with large a (20 figures) b (4 figures) c (20 figures) I saw that Python calculates it pretty fast, almost like pow (a,b,c). I expect another behavior that Python first calculate a ** b then get the modulo (%) of result and such calculation will take significantly more time. Where is the magic behind the scene?
0
python,math,modulo
2011-08-10T16:40:00.000
0
7,014,512
There is no magic behind the scenes, other than Python supports arbitrary-precision integers, and is well-implemented. It really did calculate a**b, then %c.
0
2,476
false
0
1
Behavior of Python ** and % operators with big numbers
7,014,538
2
2
0
1
2
1
0.099668
0
I'm developing an application in Python which needs to send a one-way message to all threads (threading module in Python2) in an array, except the current thread. I have tried variables, but that would result in all threads responding to it instead of all but the sender. What is the best way to send messages that way?
0
python,multithreading
2011-08-10T17:31:00.000
0
7,015,171
This is what Queue's are for. Give each thread a Queue, and write into all but your own.
0
263
false
0
1
Sending a one-way message with Python on all threads except the sender
7,015,281
2
2
0
2
2
1
0.197375
0
I'm developing an application in Python which needs to send a one-way message to all threads (threading module in Python2) in an array, except the current thread. I have tried variables, but that would result in all threads responding to it instead of all but the sender. What is the best way to send messages that way?
0
python,multithreading
2011-08-10T17:31:00.000
0
7,015,171
Why not make the "message" be a tuple of (thread_id, 'message'), and then send it to all threads - the thread that sent it can just ignore messages with its own thread_id.
0
263
false
0
1
Sending a one-way message with Python on all threads except the sender
7,015,194
1
2
0
2
3
0
1.2
0
I'm running a new mac with osx lion and it came with the latest Python 2.7. My /Library/Frameworks/Python.framework/Versions directory has 2.3, 2.5, 2.6, 2.7, and Current. Now 2.5 and 2.6 have Python.h and many other header files in /include. My problem is I can't find any header files except pyconfig.h in the 2.7/include or Current/include directories. Can anyone shed light on this? EDIT: as Foo Bah pointed out, I should be looking for my header files in /usr/include. So in /usr/include I do not even have a folder python2.7. I have folders for previous version, python2.5 and python2.6. Is there a reason that python2.7 include folder is not there even though the mac came with 2.7?
0
python
2011-08-10T18:32:00.000
1
7,015,910
OK found the answer. You need to install a newer version of Xcode. I had installed an older Xcode 3.2 on Lion. After upgrading, my /usr/include/python2.7 directory was populated with the header files.
0
1,543
true
0
1
why is Python.h in my /usr/local/python2.6 folder when my Mac is using python 2.7?
7,016,498
1
4
0
24
17
0
1.2
0
I'm automating a configuration process for an embedded board. To enter the setup screen I need to send "Ctrl-C" command. This is NOT to interrupt a process I'm running locally, KeyboardInterrupt will not work. I need to send a value that will be interpreted by the bootloader as Ctrl-C. What is the value I need to send? Thank you
0
python,serial-port,copy-paste,pyserial
2011-08-10T21:34:00.000
1
7,018,139
IIRC, Ctrl-C is etx. Thus send \x03.
0
44,697
true
0
1
PySerial: How to send Ctrl-C command on the serial line
7,018,187
3
5
0
0
6
0
0
0
I'm having a lot of trouble getting Eclipse to recognise PyDev when using the PyDev zip file. (I need to use the zip file as the Dev machine does not have internet access). I have Eclipse installed and have downloaded the PyDev zip. I've Googled a fair bit and tried the following based on suggestions I found:- Unzipped the .zip into ECLIPSE/helios/dropins and restarted eclipse. Unzipped the .zip into ECLIPSE/helios/plugins and restarted eclipse. Neither makes Python appear as a selection in the Eclipse, Window, Preferences. Helios contains the executable eclipse file I use to load eclipse. I'm using eclipse in Redhat linux. One suggestion was to extract the zip over the eclipse plugins and features folders, but I don't see how that would work as the zip just produces a heap of files and no folders. Any help to get this working would be great.
0
python,eclipse,pydev
2011-08-11T01:42:00.000
1
7,019,933
For whatever it's worth, I was having the same problem running eclipse 3.6 on RHEL 6. When I ran eclipse as myself, I didn't get any PyDev options; however, when I ran eclipse as root, everything showed up. So permissions could be an issue fyi.
0
11,417
false
0
1
Adding PyDev to Eclipse using the PyDev zip
18,454,032
3
5
0
1
6
0
0.039979
0
I'm having a lot of trouble getting Eclipse to recognise PyDev when using the PyDev zip file. (I need to use the zip file as the Dev machine does not have internet access). I have Eclipse installed and have downloaded the PyDev zip. I've Googled a fair bit and tried the following based on suggestions I found:- Unzipped the .zip into ECLIPSE/helios/dropins and restarted eclipse. Unzipped the .zip into ECLIPSE/helios/plugins and restarted eclipse. Neither makes Python appear as a selection in the Eclipse, Window, Preferences. Helios contains the executable eclipse file I use to load eclipse. I'm using eclipse in Redhat linux. One suggestion was to extract the zip over the eclipse plugins and features folders, but I don't see how that would work as the zip just produces a heap of files and no folders. Any help to get this working would be great.
0
python,eclipse,pydev
2011-08-11T01:42:00.000
1
7,019,933
I just did this today and a far easier way to do it is to use the built-in installer. Go to Help -> Install New Software and then type pydev in the software filter. Since you already have the zip, if you extract it in the dropins folder, you'll skip the download portion and go straight to installing it. I have been able to use the zip to install it manually before. I would extract its contents in the eclipse folder overwriting the features and plugins folder. I suggested this to a coworker earlier today and it didn't work for her. She had to download the newest version of eclipse for this method to work. She downloaded the classic version.
0
11,417
false
0
1
Adding PyDev to Eclipse using the PyDev zip
7,020,096
3
5
0
1
6
0
0.039979
0
I'm having a lot of trouble getting Eclipse to recognise PyDev when using the PyDev zip file. (I need to use the zip file as the Dev machine does not have internet access). I have Eclipse installed and have downloaded the PyDev zip. I've Googled a fair bit and tried the following based on suggestions I found:- Unzipped the .zip into ECLIPSE/helios/dropins and restarted eclipse. Unzipped the .zip into ECLIPSE/helios/plugins and restarted eclipse. Neither makes Python appear as a selection in the Eclipse, Window, Preferences. Helios contains the executable eclipse file I use to load eclipse. I'm using eclipse in Redhat linux. One suggestion was to extract the zip over the eclipse plugins and features folders, but I don't see how that would work as the zip just produces a heap of files and no folders. Any help to get this working would be great.
0
python,eclipse,pydev
2011-08-11T01:42:00.000
1
7,019,933
I've been playing with PyDev and Eclipse. Reinstalled Eclipse on a fresh machine and unzipped the standard PyDev over it (not the source version) and it worked fine. Did the same thing on the same machine having the problems but in a different location (/home) also worked fine. So it looks like a configuration problem on the machine not a PyDev/Eclipse issue. Sorry for the run around and thanks for the help. Dog.
0
11,417
false
0
1
Adding PyDev to Eclipse using the PyDev zip
7,033,285
1
1
0
2
4
0
0.379949
0
When trying to to import and execute a function within a Python module from a C++ executable, how can I pass in the directory where the module is located as a command line argument?
0
c++,python
2011-08-11T18:38:00.000
1
7,031,077
Python honors PYTHONPATH environmental variable. It is a PATH like environmental variable specifying paths where Python loads modules. Inside .py script PYTHONPATH can be accessed and updated through the sys.path variable. If you can show more source code how you create Python interpreter more helpful answer can be given.
0
52
false
0
1
specifiying directory of Python module when calling it from C++
7,031,182
1
2
1
0
2
0
0
0
I'm implementing a profiler in an application and I'm a little flummoxed about how to implement Python profiling such that the results can be displayed in my existing tool. The application allows for Python scripting via communication with the python interpreter. I was wondering if anyone has ideas on how to profile Python functions from C++ Thank you for your suggestions :)
0
c++,python,profiling
2011-08-11T22:19:00.000
0
7,033,612
The usual technique for profiling already-existing functions that we use in Lua a lot is to overwrite the function with your own version that will start timing, call the original function, and stop timing, returning the value that the original function returned.
0
447
false
0
1
How can I "hook into" Python from C++ when it executes a function? My goal is to profile
7,033,696
3
3
0
0
1
0
0
0
I am trying to import the OpenGL.GL module. Given the py file with that line, I can perform "python file.py" just fine, but I cannot run that same file when used in Aptana or Eclipse. Both IDEs have PyDev installed. I do have PyOpenGL installed. I wish to point out that I can still import other modules (PIL, numpy), which were installed the same way as the PyOpenGL. I am confident that there is only 1 python running on my MacOS.
0
python,eclipse,opengl,aptana,pydev
2011-08-12T06:54:00.000
1
7,036,584
Are you sure you don't have multiple versions of python? Seems to me like the interpreter that aptana uses is not the same as the one used from command line. You can look in: Run -> Run configurations -> Python run -- then you have Interpreter tab There you can click : See resulting command line. Than will get you the python that is used as well as the python path
0
1,045
false
0
1
Python OpenGL in Eclipse/Aptana
7,036,672
3
3
0
1
1
0
0.066568
0
I am trying to import the OpenGL.GL module. Given the py file with that line, I can perform "python file.py" just fine, but I cannot run that same file when used in Aptana or Eclipse. Both IDEs have PyDev installed. I do have PyOpenGL installed. I wish to point out that I can still import other modules (PIL, numpy), which were installed the same way as the PyOpenGL. I am confident that there is only 1 python running on my MacOS.
0
python,eclipse,opengl,aptana,pydev
2011-08-12T06:54:00.000
1
7,036,584
Maybe you need to reconfigure your interpreter. If you installed PyOpenGL as an egg after pydev was set up your PYTHONPATH might be out of date. Check out Preferences->PyDev->Interpreter - Python
0
1,045
false
0
1
Python OpenGL in Eclipse/Aptana
7,041,218
3
3
0
2
1
0
0.132549
0
I am trying to import the OpenGL.GL module. Given the py file with that line, I can perform "python file.py" just fine, but I cannot run that same file when used in Aptana or Eclipse. Both IDEs have PyDev installed. I do have PyOpenGL installed. I wish to point out that I can still import other modules (PIL, numpy), which were installed the same way as the PyOpenGL. I am confident that there is only 1 python running on my MacOS.
0
python,eclipse,opengl,aptana,pydev
2011-08-12T06:54:00.000
1
7,036,584
I had the same problem after installing a different version of PyOpen and my Eclipse PyDev path is messed up. What I did was remove the interpreter link and re-added the old one which made PyDev to re-scan my libs. This seems to fix the problem. Don't forget for all your projects, you need to go to the property (Right click project->properties) and re-select the interpreter.
0
1,045
false
0
1
Python OpenGL in Eclipse/Aptana
10,692,265
1
1
0
2
3
0
0.379949
1
Is it possible to retrieve messages from an SQS queue during their visibility timeout if you don't have the message id? I.e. something along the lines of "get invisible messages" or "get messages currently being processed". I'm working with large timeouts and sometimes I'd like to be able to inspect the queue to see what's left. I'd rather not have to wait for a 5 hour timeout to expire. I'm working with boto in python. Thanks.
0
python,amazon-web-services,parallel-processing,boto,amazon-sqs
2011-08-12T17:58:00.000
0
7,044,319
As far as I know there is no way of doing this. Seeing as your processing code should only take what it needs off the queue and nothing more it doesn't seem like you would ever need to do this. Do your jobs actually take 5hrs to complete? I assume based on "I'm working with large timeouts" they do but if not you can set the expiration to make it a shorter period.
0
1,141
false
0
1
Is it possible to retrieve messages from SQS while they're invisible?
7,045,553
1
1
0
3
4
0
1.2
0
First, props to whoever did node.js. I've been using it for less than a day and I'm already thinking about using it for stuff I use Python for now. In fact, whoever did node.js should think about using it for stuff they use Python for now. There is apparently a tool called node-waf that is in Python and is necessary for npm to work and npm of course is necessary for anything else useful. I think that my original install went bad because node-waf (which is in /mnt/michael/bin/node-waf) couldn't find Scripting.py (which is in /mnt/michael/node/tools/wafadmin/; it was looking in non-existent /mnt/michael/node/tools/../lib/node/wafadmin/). So I hacked node-waf to point to the right director and kept going and found a much more serious problem. Turns out node-waf isn't written in "Python", but in Python2.6, which is a perfectly good language, it's the language I use myself, but it isn't the language that the default on the system I use. The system is CentOS, which requires Python2.4 be the Python that the command "python" invokes. Yes, that's foolish on the part of the CentOS people but less foolish than the same mistake on the part of the node-waf people, since they are necessarily subject to the rules of the OS. So, please tell me there's some switch I haven't found yet that say "Use Python2.6". Also, any hints about a proper install would be appreciated.
0
python,node.js,npm,waf
2011-08-13T15:12:00.000
1
7,051,276
To solve the path problem, I backed up and re-installed Node. To solve the version problem, at the suggestion of some bright soul on the #nodejs channel, I created a symbolic link at ~/bin/python that pointed to the right version (that solved a lot of my own problems too, starting up the wrong version from the command line...) An obvious hack, but when you're frustrated, you overlook the obvious.
0
5,062
true
1
1
How do I get node-waf to install?
7,057,283
2
5
0
0
6
0
0
0
I used to use netbeans for a while and really liked it. But now, I wan't to expand my toolbox with Python, and Netbeans dropped support for Django, also Python support seems to suck in NB 7.0. So I am looking for recommendations on IDE or Text Editor for Windows with support: Python (possibly with Django) PHP HTML, CSS, JavaScript FTP GIT & SVN I know Aptana 3 can do this, is there anything else? I don't know Vim a lot, but would that be an option?
0
php,python,ide
2011-08-13T12:46:00.000
0
7,051,282
Eclipse and Visual Studio have plugins for just about everything. Eclipse is free, I think for Visual Studio though you'd have to get the professional version to run plugins...
0
3,567
false
1
1
IDE for PHP and Python Windows
7,051,285
2
5
0
0
6
0
0
0
I used to use netbeans for a while and really liked it. But now, I wan't to expand my toolbox with Python, and Netbeans dropped support for Django, also Python support seems to suck in NB 7.0. So I am looking for recommendations on IDE or Text Editor for Windows with support: Python (possibly with Django) PHP HTML, CSS, JavaScript FTP GIT & SVN I know Aptana 3 can do this, is there anything else? I don't know Vim a lot, but would that be an option?
0
php,python,ide
2011-08-13T12:46:00.000
0
7,051,282
Well Aptana is built upon eclipse, so you could just use the basic eclipse with all your necessary add ons. Obviously you'll need Pydev for the python stuff and that has Django integration. For some reason though I actually prefer netbeans for my php ide. Tbh just try out a few and see which one you like best.
0
3,567
false
1
1
IDE for PHP and Python Windows
7,051,283
1
2
0
2
2
0
0.197375
1
I want to be able to identify an audio sample (that is provided by the user) in a audio file I've got (mp3). The mp3 file is a radio stream that I've kept for testing purposes, and I have the Pre-roll of the show. I want to identify it in the file and get the timestamp where it's playing in the file. Note: The solution can be in any of the following programming languages: Java, Python or C++. I don't know how to analyze the video file and any reference about this subject will help.
0
java,c++,python,audio,signal-processing
2011-08-13T17:37:00.000
0
7,052,169
I'd start by computing the FFT spectrogram of both the haystack and needle files (so to speak). Then you could try and (fuzzily) match the spectrograms - if you format them as images, you could even use off-the-shelf algorithms for that. Not sure if that's the canonical or optimal way, but I feel like it should work.
0
573
false
1
1
Identify audio sample in a file
7,052,252
1
2
0
2
5
1
1.2
0
In matlab, it is possible to execute a script (ie an m-file) and then manipulate the variables created by the script on the command line. Is it possible to run a .py file on PyDev and consequently, manipulate its variables inside eclipse as is possible in the case of matlab?
0
python,eclipse,pydev
2011-08-15T15:55:00.000
1
7,067,279
Yes, check the run configurations. You can add the script as a "Python Run".
0
7,173
true
0
1
Running python command line interpreter inside PyDev
7,067,352
1
1
0
0
0
0
1.2
0
I am looking for feasible solutions for my Application to be backed with MongoDB. I am looking to host the MongoDB on the cloud with a python based server to interact with the DB and my app (either mobile/web). I am trying to understand how the architecture should look like. Either i can host a mongoDB on the AWS cloud and have the server running there only. I also tried using MongoLab and seemed to be simple accessing it using HTTP requests. but i am not sure if it exposes all the essential features of MongoDB (what ever i can do using a pymongo driver)? Also, should i go for accessing the MongoLab service directly from my application or still i should build a server in-between? I would prefer to building an server in either case as i want to do some processing before sending the data back to application. but i am not sure in that case how my DB-server-app interaction design should be Any suggestions?
0
python,mongodb,amazon-web-services,cloud-hosting,mlab
2011-08-15T16:47:00.000
0
7,067,909
One thing to consider is that you don't need to use MongoLab's REST API. You can connect directly via a driver as well. So, if you need to implement business logic (which it sounds like you do), it makes sense to have a three tier architecture with an app server connecting to your MongoLab database via one of the drivers. In your case it sounds like this would be pymongo. -will
0
501
true
1
1
Using MongoLab Database service vs Custom web service with MongoDB running on AWS
7,068,152
2
2
0
3
0
0
0.291313
0
I have a php video hosting site, not a typical video hosting site, but i think you put it in that category. I'm almost done with it, I'll launch it maybe next week, i created it in php because my partner wanted to get it done so fast, and the fastest way for me to do it was php, because i know it could be done with php mysql, ffmpeg and ffmpeg-php and some other multimedia packages. I don't know what it takes to do it in other languages. now I want to launch the site, and re-write another better version, because i don't like the current version, my partner likes it but he's on the business side and I'm on the development side lol, so i decide :D I don't know much about the php frameworks, I've seen them all, but I don't think they are that good for such websites I was thinking maybe Django, but Django is created mainly for CMS websites, I don't know if i can use it for my site I've never used plone but i think it's good for my site, I don't have experience with it so I would like to know what you think Ruby on rails seems to be another option but I've never seen any video hosting site using ROR So what is the best language to re-write my site? or should i stick with php? edit i already know python, so it's not hard for me to switch to python framwork if it's better for such project...I have some ROR knowledge...and I'm gonna use php for now as you said guys but I'm talking about the future I don't want to make this question an argumentative question, because it will be closed, so let ask another question, can i do such website with django because i know django, but i have never used it for such thing, i used it for cms, i don't know if it supports ffmpeg, multimedia and such things sorry for posting an argumentative topic, i hope my question is now better :D
0
php,python,ruby-on-rails,django,plone
2011-08-15T20:02:00.000
0
7,070,097
It does not really matter in which language you would make it. If you are good programmer, the application will work fine in any of those environment. If you are not good programmer, it will sux always :) you can do it for example in Ruby on Rails, but what is the purpose if you will not be able to follow MVC structure? it's a little bit risky to use technology that you do not know. There are many issues you can run into. Just for example N+1 queries. I wouldn't recommend you switching the language, unless you really would like to learn other technology - but be aware that your application most probably will not be "pretty" :)
0
588
false
1
1
which is better for my project: Django, Plone, php, or ruby on rails
7,070,188
2
2
0
2
0
0
1.2
0
I have a php video hosting site, not a typical video hosting site, but i think you put it in that category. I'm almost done with it, I'll launch it maybe next week, i created it in php because my partner wanted to get it done so fast, and the fastest way for me to do it was php, because i know it could be done with php mysql, ffmpeg and ffmpeg-php and some other multimedia packages. I don't know what it takes to do it in other languages. now I want to launch the site, and re-write another better version, because i don't like the current version, my partner likes it but he's on the business side and I'm on the development side lol, so i decide :D I don't know much about the php frameworks, I've seen them all, but I don't think they are that good for such websites I was thinking maybe Django, but Django is created mainly for CMS websites, I don't know if i can use it for my site I've never used plone but i think it's good for my site, I don't have experience with it so I would like to know what you think Ruby on rails seems to be another option but I've never seen any video hosting site using ROR So what is the best language to re-write my site? or should i stick with php? edit i already know python, so it's not hard for me to switch to python framwork if it's better for such project...I have some ROR knowledge...and I'm gonna use php for now as you said guys but I'm talking about the future I don't want to make this question an argumentative question, because it will be closed, so let ask another question, can i do such website with django because i know django, but i have never used it for such thing, i used it for cms, i don't know if it supports ffmpeg, multimedia and such things sorry for posting an argumentative topic, i hope my question is now better :D
0
php,python,ruby-on-rails,django,plone
2011-08-15T20:02:00.000
0
7,070,097
I think you should stick with PHP : you already know the language you already have the tools for development you already have a code base I think you should see how your site behaves in production and see what are the most wanted user needs before spending time rewriting everything, and during this time not beeing able to answer correctly to their needs. And while your site sends its first bits, it will give you a lot more info on what to expect from the version 2, from a technical point of view. Edit : I am not pro-php, I just think you should stick whit the language you already know, until your business gives you time to learn something else.
0
588
true
1
1
which is better for my project: Django, Plone, php, or ruby on rails
7,070,199
1
1
0
1
1
0
0.197375
0
I was wondering if there are any settings I need to do to enable Satchmo sending me an email (to the store config email address) each time an order is placed? I have set up the template: templates/shop/email/order_placed_notice.html and enabled Send HTML Email in the settings. The site is sending the order placed and order shipped emails to the customer no problems, but is not sending an email to the store email. I have searched through the Satchmo docs around the settings and couldn't find anything. Should I be changing something to the signals? I have gone through the signals.py, listeners.py and mail.py files and done reading on Django & Satchmo Signals but was reluctant to play around as my programming knowledge isn't too great. Any help is appreciated. Thanks!
0
python,django,satchmo
2011-08-15T23:06:00.000
0
7,071,829
I managed to find the solution for this. It was a setting under the Satchmo /settings/ page, under the Payment section: Email Owner? Needs to be ticked. Feel like a bit of an idiot for missing this, but the reason I skipped over the payment section is that I'm using a custom payment module so didn't think it would apply. I am now using this setting alongside my custom payment module and all is working fine.
0
283
false
1
1
Not receiving order placed notice in Satchmo
7,085,400
1
2
0
0
0
0
1.2
0
I am writing a game engine and I'd like it to have Python scripting as well as support for mods using PhysFS. My game data is stored something like this: / native scripts sprites ... mods mymodname scripts What I want is for the mod scripts to be able to 'import' the native scripts as if they were in the same directory. Is something like that possible using PhysFS?
0
c++,python,physfs
2011-08-17T05:05:00.000
0
7,088,196
[I am the same person who asked the question.] The solution I used eventually was to modify Python's sys.path when my program starts. This does not pollute the game's data directories with symbolic links and is overall much cleaner.
0
298
true
0
1
PhysFS and Python embedding
7,299,183
1
2
0
1
0
0
0.099668
0
I have a launchd entry that worked with OSX 10.6 but that fails with 10.7. It uses python, and it produces an error whilst trying to import serial. I don't quite understand this, because I've re-downloaded pyserial-2.5 and re-installed it with sudo. (In desperation, I re-installed it for each of the many flavours of python on my machine.) As a test, I can enter python and do import serial without difficulties. Maybe there is a system path that is set up well for an interactive user, that is not set up for launched?? Can anyone suggest how I might diagnose the problem?
0
python,macos,osx-lion,launchd,pyserial
2011-08-17T13:30:00.000
1
7,093,689
The path you are appending: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages is the site-packages directory for a third-party, non-system Python, possibly installed using a python.org installer, and not that of the Apple-supplied system Python 2.7, which would be: /Library/Python/2.7/site-packages So most likely you are using the python.org Python to install pyserial but are launching the system Python under launchd. Check your shell PATH (echo $PATH), it probably has: /Library/Frameworks/Python.framework/Versions/2.7/bin in it. And try which python. If you want to use the python.org Python with your launchd plist, modify it to use an absolute path to the right Python, for instance: /Library/Frameworks/Python.framework/Versions/2.7/bin/python If you want to install pyserial with the system supplied Python, you can use an absolute path to it when doing the install: /usr/bin/python2.7
0
1,631
false
0
1
python/serial broken in OSX lion / launchd
7,096,933
1
3
0
12
7
0
1.2
0
Is there an equivalent of Python properties in C++? Or would it just be better to do this using getters and setters?
0
c++,python,properties
2011-08-18T09:27:00.000
0
7,105,202
Yes, explicit getter and setters would be the closest construct in C++.
0
2,093
true
0
1
C++ equivalent of Python properties
7,105,239
1
2
1
1
2
0
0.099668
0
I am working with a pressure-sensing mattress having a USB interface. The maker provides USB device drivers for Windows, and an API written in C++ which has functions to request data and set some parameters. Currently, I cannot use this sensor for testing some Python data-visualization scripts directly, having had to ask my coworkers to write a text-logger for me, and then I read this information offline with Python. Also, I cannot use Linux at all with the sensor, because there are not drivers for Linux, and I do not know where to start to "hack" the sensor, and that is why I am asking: "If I were to try to read data from this sensor directly with Python and perhaps in Linux, what should I do first, or read first?" EDIT: the device has an FTDI driver (FTD2XX.dll) if it helps. Any help would be very welcome
0
c++,python,usb,sensors,hardware-interface
2011-08-18T18:12:00.000
0
7,112,063
The FTDI chips have a linux driver. Just go to the FTDI website and download it. The driver creates a virtual serial port. You can use PySerial to interface with it. Too bad I didn't see the post sooner!
0
1,493
false
0
1
Access USB hardware (pressure sensor matrix with native C++ API) using Python
16,451,772
1
3
0
0
5
0
0
0
I'm in the process of writing an application with an Urwid front-end and a MongoDB back-end in python. The ultimate goal is to be able to be able to serve the application over SSH. The application has its own authentication/identity system. I'm not concerned about the overhead of launching a new process for each user, the expected number of concurrent users is low. Since the client does not recall any state information and instead it is all stored in the DB I'm not concerned about sessions as such except for authentication purposes. I was wondering if there are any methods to serving the application as is without having to roll my own socket-server code or re-code the app using Twisted. I honestly don't know how Urwid and Twisted play together. I see that Urwid has a TwistedEventLoop method which purports to use the twisted reactor but I cannot find any example code running an Urwid application over a twisted connection. Examples would be appreciated, even simple ones. I've also looked at ZeroMQ but that seems even more inscrutable than Twisted. In short I explored a number of different libraries which purport to serve applications over tcp, most of them by telnet. And nearly all of them focusing on http. Worst case scenario I expect that I may create an extremely locked down user as a global login and use chrooted SSH sessions. that way each user gets their own chroot/process/client. Yes, I know that's probably a "Very Bad Idea(tm)". But I had to throw it out there as a possibility. I appreciate any constructive feedback. Insults, chides, and arrogance will be scowled at, printed out and spat upon. -CH
0
python,ssh,twisted
2011-08-19T03:12:00.000
1
7,116,553
A cheap and posibly very dangerous hack is to put your app as the default shell for a particular user. you need to be very careful though (suggestion chroot it to hell and back) as it might be possible to break out of the app and into the server.
0
643
false
0
1
Howto Serve Python CLI Application Over SSH
8,927,201
2
3
0
0
0
0
0
0
I wanna build a simple social network use python. Just like twitter but smaller than twitter.I just wanna make a few features like follow,BE followed,view others profile,etc. My question is that i should use web.py or Tornado? BTW, is there any tutorial about Tornado? I feel it hard to understand when i read the documenations on the offical. (Oops,my english is week. :P )
0
python,tornado
2011-08-20T07:00:00.000
0
7,130,303
You might consider using Pinax. When I used it, it had the self-concept of 'django with an opinion.' I'm not sure where it's at now, but my experience was that it was best suited for exactly what you want to do. One of the base projects is actually a fully functional social network site. You could then customize from there.
0
2,321
false
0
1
Choose web.py or Tornado
7,131,286
2
3
0
3
0
0
1.2
0
I wanna build a simple social network use python. Just like twitter but smaller than twitter.I just wanna make a few features like follow,BE followed,view others profile,etc. My question is that i should use web.py or Tornado? BTW, is there any tutorial about Tornado? I feel it hard to understand when i read the documenations on the offical. (Oops,my english is week. :P )
0
python,tornado
2011-08-20T07:00:00.000
0
7,130,303
these two are different things. Tornado is web server while web.py is a framework. therefore you can use both of them.
0
2,321
true
0
1
Choose web.py or Tornado
7,130,351
2
2
0
0
1
0
0
0
I have a concept I'd like to work on that requires the use of low-level sockets (i.e.: no frameworks or wrappers, just the standard send/recv pattern included in most standard libraries. I'm familiar with both Ruby and Python, and from my (limited) experience they seem to have similar socket libraries. What I'd like to know is if either language has any advantage, whether it be with performance, stability, ease-of-use or otherwise. Thanks.
0
python,ruby,sockets,tcp,udp
2011-08-23T05:56:00.000
0
7,156,837
What a language you know better, that'll fit your needs.
0
903
false
0
1
Ruby Vs Python - Socket Libraries
7,157,569
2
2
0
0
1
0
0
0
I have a concept I'd like to work on that requires the use of low-level sockets (i.e.: no frameworks or wrappers, just the standard send/recv pattern included in most standard libraries. I'm familiar with both Ruby and Python, and from my (limited) experience they seem to have similar socket libraries. What I'd like to know is if either language has any advantage, whether it be with performance, stability, ease-of-use or otherwise. Thanks.
0
python,ruby,sockets,tcp,udp
2011-08-23T05:56:00.000
0
7,156,837
Both language offer a very thin wrapper above the underlying OS socket library. You won't get much difference.
0
903
false
0
1
Ruby Vs Python - Socket Libraries
7,158,166
1
3
0
0
1
0
0
0
I'd like to test the speed of a bash script and a Python script. How would I get the time it took to run them?
0
python,performance,bash,testing
2011-08-23T14:39:00.000
1
7,162,812
At the beginning of each script output the start time and at the end of each script output the end time. Subtract the times and compare. Or use the time command if it is available as others have answered.
0
327
false
0
1
Test speed of two scripts
7,162,876
4
5
0
0
2
0
0
0
I'm trying to create a python shell script to create a number of directories in Ubuntu Linux. The main directory I'm trying to create directories in is protected from write access. Is there a way to allow the Python script to be allowed to create directories in there as if it's the root user but not have to run the script through su, since other users might need to run the script but should not have su access?
0
python,linux,shell,filesystems
2011-08-23T19:34:00.000
1
7,166,528
You could create a separate command that creates the directory and make it setuid root (or, more safely, setuid or setgid to the owner of the parent directory). Make sure the command can't do anything other than what you want to allow it to do (e.g., don't let it pass its argument to system()). Then invoke that command from your Python script. Of course this will also enable any other process with execute permission on the new command to create subdirectories.
0
2,415
false
0
1
How do you allow a Python script access to mkdir in a protected directory without su access in Linux?
7,166,842
4
5
0
6
2
0
1.2
0
I'm trying to create a python shell script to create a number of directories in Ubuntu Linux. The main directory I'm trying to create directories in is protected from write access. Is there a way to allow the Python script to be allowed to create directories in there as if it's the root user but not have to run the script through su, since other users might need to run the script but should not have su access?
0
python,linux,shell,filesystems
2011-08-23T19:34:00.000
1
7,166,528
This question is not really related to Python. The Python script is just a process like any other process and needs to have to right permissions to do things. The usual method is to create a group, and make the parent directory g+ws for that group. Then add the appropriate users to that group as a supplemental group.
0
2,415
true
0
1
How do you allow a Python script access to mkdir in a protected directory without su access in Linux?
7,166,747
4
5
0
2
2
0
0.07983
0
I'm trying to create a python shell script to create a number of directories in Ubuntu Linux. The main directory I'm trying to create directories in is protected from write access. Is there a way to allow the Python script to be allowed to create directories in there as if it's the root user but not have to run the script through su, since other users might need to run the script but should not have su access?
0
python,linux,shell,filesystems
2011-08-23T19:34:00.000
1
7,166,528
Unfortunately no. A process's permissions in a *nix environment are always less than or equal to the permissions of the person who fires it. This actually makes sense though -- it is a huge security risk to allow processes exceed the user's own abilities. This will require someone who has access to that directory -- either through one of their groups or through sudo. Either way, it will require human interaction on every machine that the script is run on. As far as what is easiest, well, you'll need someone who has that authority to grant it to another user, or simply use sudo directly.
0
2,415
false
0
1
How do you allow a Python script access to mkdir in a protected directory without su access in Linux?
7,166,771
4
5
0
0
2
0
0
0
I'm trying to create a python shell script to create a number of directories in Ubuntu Linux. The main directory I'm trying to create directories in is protected from write access. Is there a way to allow the Python script to be allowed to create directories in there as if it's the root user but not have to run the script through su, since other users might need to run the script but should not have su access?
0
python,linux,shell,filesystems
2011-08-23T19:34:00.000
1
7,166,528
You could add a user just for this task, then give the said user permissions for the directory you want the subdirectories created in and execute the script as the said user. There might be easier solutions but that's what comes to my mind at first glance.
0
2,415
false
0
1
How do you allow a Python script access to mkdir in a protected directory without su access in Linux?
7,166,564
2
2
0
2
13
0
0.197375
0
Quickie here that needs more domain expertise on pymongo than I have right now: Are the "right" parts of the pymongo driver written in python for me to call gevent monkey_patch() and successfully alter pymongo's blocking behavior on r/w within gevent "asynchronous" greenlets? If this will require a little more leg work on gevent and pymongo -- but it is feasible -- I would be more than willing to put in the time as long as i can get a little guidance over irc. Thanks! Note: At small scale mongo writes are not a big problem because we are just queuing a write "request" before unblocking. BUT talking to fiorix about his twisted async mongo driver (https://github.com/fiorix/mongo-async-python-driver), even mongo's quick write (requests) can cause problems in asyncronous applications at scale. (And of course, non-blocking reads could cause problems from the start!)
0
python,mongodb,pymongo,monkeypatching,gevent
2011-08-23T20:15:00.000
1
7,166,998
On initial inspection it doesn't appear to do any socket operations in the c code so it should be fine (blocking ops should just block the green thread).
0
4,465
false
0
1
pymongo + gevent: throw me a banana and just monkey_patch?
7,168,735
2
2
0
19
13
0
1.2
0
Quickie here that needs more domain expertise on pymongo than I have right now: Are the "right" parts of the pymongo driver written in python for me to call gevent monkey_patch() and successfully alter pymongo's blocking behavior on r/w within gevent "asynchronous" greenlets? If this will require a little more leg work on gevent and pymongo -- but it is feasible -- I would be more than willing to put in the time as long as i can get a little guidance over irc. Thanks! Note: At small scale mongo writes are not a big problem because we are just queuing a write "request" before unblocking. BUT talking to fiorix about his twisted async mongo driver (https://github.com/fiorix/mongo-async-python-driver), even mongo's quick write (requests) can cause problems in asyncronous applications at scale. (And of course, non-blocking reads could cause problems from the start!)
0
python,mongodb,pymongo,monkeypatching,gevent
2011-08-23T20:15:00.000
1
7,166,998
I have used PyMongo with Gevent and here are a few things you need to watch out for: Instantiate only one pymongo.Connection object, preferrably as a global or module-level variable. This is important because Connection has within itself a pool! Monkey patch everything, or at least BOTH socket and threading. Due to the use of thread locals in Connection, patching socket alone is not enough. Remember to call end_request to return the connection to the pool. The answer to your question is go ahead, PyMongo works just fine with Gevent.
0
4,465
true
0
1
pymongo + gevent: throw me a banana and just monkey_patch?
7,169,174
1
3
0
0
2
1
0
0
I need to know, When i run My python over terminal by default how many module are loaded with it which i do not have to import to use, which modules i can directly use ?? My System Env is Ubuntu 11.04 Regards
0
python,linux,module
2011-08-24T13:06:00.000
1
7,175,909
Any modules you wish to use from the standard library must be imported before you can use them.
0
237
false
0
1
Python - How many Default Modules loaded
7,176,030
1
1
0
0
0
0
0
0
installing python2.6 after running ./configure it runs with no errors but after running gmake i get this error * WARNING: renaming "_curses" since importing it failed: ld.so.1: python: fatal: relocation error: file build/lib.solaris-2.10-i86pc-2.6/_curses.so: symbol newscr: referenced symbol not found building '_curses_panel' extension gcc -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -I/export/home/joseph/Python-2.6.6/./Include -I. -IInclude -I./Include -I/usr/local/include -I/export/home/joseph/Python-2.6.6/Include -I/export/home/joseph/Python-2.6.6 -c /export/home/joseph/Python-2.6.6/Modules/_curses_panel.c -o build/temp.solaris-2.10-i86pc-2.6/export/home/joseph/Python-2.6.6/Modules/_curses_panel.o gcc -shared build/temp.solaris-2.10-i86pc-2.6/export/home/joseph/Python-2.6.6/Modules/_curses_panel.o -L/usr/local/lib -lpanel -lcurses -ltermcap -o build/lib.solaris-2.10-i86pc-2.6/_curses_panel.so * WARNING: renaming "_curses_panel" since importing it failed: No module named _curses Failed to find the necessary bits to build these modules: _bsddb _sqlite3 _tkinter bsddb185 gdbm linuxaudiodev ossaudiodev readline To find the necessary bits, look in setup.py in detect_modules() for the module's name. Failed to build these modules: _curses _curses_panel and when i try installing a python module reportlab with python2.6 setup.py install returns an error copying src/reportlab/lib/hyphen.mashed -> build/lib.solaris-2.10-i86pc-2.6/reportlab/lib running build_ext building '_renderPM' extension gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DRENDERPM_FT -DLIBART_COMPILATION -DLIBART_VERSION="2.3.12" -I/export/home/joseph/reportlab-2.5/src/rl_addons/renderPM -I/export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/libart_lgpl -I/export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/gt1 -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/python2.6 -c /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c -o build/temp.solaris-2.10-i86pc-2.6/export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.o /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c: In function 'parse_utf8': /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c:81:9: error: expected identifier or '*' before numeric constant /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c:96:9: error: expected identifier or '*' before numeric constant /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c:100:1: warning: statement with no effect /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c:100:4: error: expected ';' before ':' token /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c:101:5: error: 'else' without a previous 'if' /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c: In function '_get_ft_face': /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c:162:2: warning: pointer targets in passing argument 2 of 'FT_New_Memory_Face' differ in signedness /usr/local/include/freetype2/freetype/freetype.h:1904:3: note: expected 'const FT_Byte *' but argument is of type 'char *' /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c: In function '_get_gstatePath': /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c:936:3: warning: enumeration value 'ART_END' not handled in switch /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c: In function '_get_gstateVPath': /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c:968:3: warning: enumeration value 'ART_CURVETO' not handled in switch /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c:968:3: warning: enumeration value 'ART_END' not handled in switch /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c: In function 'gstate_setFont': /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c:1108:5: warning: suggest explicit braces to avoid ambiguous 'else' /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c: In function 'gstateFree': /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c:1492:4: warning: suggest explicit braces to avoid ambiguous 'else' /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c: At top level: /export/home/joseph/reportlab-2.5/src/rl_addons/renderPM/_renderPM.c:332:12: warning: 'notdefPathLen' defined but not used error: command 'gcc' failed with exit status 1
0
python,unix
2011-08-24T13:28:00.000
0
7,176,218
First and foremost, make sure you have the newest version of gmake/make. I had a nasty problem using an older version. It was similar to this, which is why I am suggesting it. If you don't have it, install gmake and redo the python installation (./configure, make, make install). Hope that helps!
0
715
false
0
1
python2.6.6 installation problem
7,176,623
1
3
0
8
28
1
1.2
0
I wonder if is there any reliable and consistant way to get a Python package's "import name" / namespace. For example; Package; django-haystack Import name; haystack or Package; ipython Import name; IPython So far I know, PyPi doesn't store that information that I've checked with PyPiXmlRpc. I also tried to automate to download the package, extract it and dig the .egg-info but some packages doesn't have that folder at all. Any help will be appreciated and will be used for a good-manner gadget :)
0
python,namespaces,pypi,cheeseshop
2011-08-25T02:10:00.000
0
7,184,375
Note that what you call a package here is not a package but a distribution. A distribution can contain zero or more modules or packages. That means there is no one-to-one mapping of distributions to packages. I'm not sure there is a way to detect what modules and packages will be installed by a distribution, other than actually installing it and introspect filesystem changes for newly added packages, modules and pth files.
0
8,641
true
0
1
How to find "import name" of any package in Python?
7,461,581
1
1
0
0
0
1
0
0
I use mono develop 2.4 in ubuntu 10.10, with monodevelop-python and ironpython When I created a empty python project mono develop don't show the reference node. how I can add a new reference file ?
0
ironpython,monodevelop
2011-08-25T15:07:00.000
0
7,192,763
The Python addin is for cpython, not IronPython, so it doesn't support assembly references.
0
124
false
0
1
mono develop don´t show reference node
7,242,146
1
1
0
4
3
1
1.2
0
I assume it is because of the interpreter's implementation. Can anyone give me a more in-depth answer please? Thanks. Also, I wonder if bash has a garbage collector?
0
python,ruby,bash,interpreter
2011-08-26T06:16:00.000
1
7,200,700
bash loads a large number of commands from disk. Most other scripting languages have many more instructions that they run internally. For example, to do a simple computation in bash, you'd use a=`expr 1 + 2` and bash will first load /usr/bin/expr, run that command which writes the result in the output, bash collects the output (the ` quotes) and saves the result in the variable 'a'. That's definitively slow. The advantage of bash is the incredible flexibility though. Each person may have a different set of powerful "instructions". For example, I have a small tool called hex to print out numbers in octal, hexadecimal and decimal all at once. Other languages would not integrate in the way bash does...
0
635
true
0
1
Why is bash language often slower than python or ruby?
7,200,742
1
1
0
0
1
0
0
0
My webhost where our website is runs Python 2.4 & the website uses the SQLite3 python module (which is only part of Python 2.5 & up). This means that I cant use the module SQLite3 because its not part of Python 2.4. Is there a way for me to upload the python SQLite3 module myself & just import/refernce that in my script? Do you know how I would do this? Usually I would just install Python25 on my webhost home directory, but this webhost wont allow me to do this. Is there any way I can just upload & import a specific module - coming from c++ it seems this must be possible right? Because in C++ I spend my whole life writting libraries & just importing specific parts of them & importing specific classes of a namespace & etc.
0
python,mysql,sqlite,web-hosting
2011-08-26T06:22:00.000
0
7,200,745
This very much depends about how much control your webhost gives you about the Python environment. For normal shared hosting, the runtime Python environment is fixed.
0
52
false
0
1
Importing a specific module thats not part of my current Python 2.X version
7,200,805
2
2
0
3
6
0
0.291313
1
I'm using Fabric for my build script. I just cloned one of my VMs and created a new server. The Fabric script (which uses paramiko underneath) works fine one server but not the other. Since it's a clone I don't know what could be different but everytime I run my Fabric script I get the error Error reading SSH protocol banner. This script is connecting with the same user on both servers. The script works fine on all other servers except this new one that I just clones. The only thing that is radically different is the IP address which is totally different range. Any ideas on what could be causing this?
0
python,linux,ssh,fabric,paramiko
2011-08-26T14:33:00.000
0
7,206,272
Try changing the banner timeout from 15 seconds to 30 secs in the transport.py file. Also, it could be that the sshd daemon on the server is hung. Can you SSH into it manually?
0
29,345
false
0
1
Paramiko Error: Error reading SSH protocol banner
7,207,845
2
2
0
8
6
0
1.2
1
I'm using Fabric for my build script. I just cloned one of my VMs and created a new server. The Fabric script (which uses paramiko underneath) works fine one server but not the other. Since it's a clone I don't know what could be different but everytime I run my Fabric script I get the error Error reading SSH protocol banner. This script is connecting with the same user on both servers. The script works fine on all other servers except this new one that I just clones. The only thing that is radically different is the IP address which is totally different range. Any ideas on what could be causing this?
0
python,linux,ssh,fabric,paramiko
2011-08-26T14:33:00.000
0
7,206,272
This issue didn't lie with Paramiko, Fabric or the SSH daemon. It was simply a firewall configuration in ISPs internal network. For some reason, they don't allow communication between different subnets of theirs. We couldn't really fix the firewall configuration so instead we switched all our IPs to be on the same subnet.
0
29,345
true
0
1
Paramiko Error: Error reading SSH protocol banner
7,252,752
1
1
0
0
0
1
0
0
I'm trying to build an exception class that I can use both in a C extension and the Python modules that import the extension. I'm using the PyErr_NewException to create the class as a superclass of the Exception class, but I can't figure out how to create an __init__ constructor for the class. I assume that is the best way to populate the class with the attributes I need.
0
python
2011-08-27T19:40:00.000
0
7,216,925
You should pass a dict as the third argument to PyErr_NewException. The dict should have an __init__ key bound to your initializer function.
0
242
false
0
1
Trying to build a Python class in a C extension that can be instantiated from a Python module
7,217,257
1
1
0
0
0
0
0
0
I'm on Ubuntu. I'd like to be able to retrieve images saved in my temp folder, and clear it, at will (or does mechanize not actually read images but rather just html?).
0
python,mechanize
2011-08-29T12:52:00.000
1
7,230,327
Mechanize doesn't retrieve images unless you specifically tell it to (on a one by one basis).
0
341
false
0
1
Where is the python mechanize cache/temp folder? How can I clear it? How can I retrieve files from it?
7,236,208
1
1
0
0
2
1
1.2
0
We're running a pylons app with multiple ini files (production, staging, development, etc). When a new setting is added that can be the same in all environments, it would be great to be able to set it once in some sort of master configuration that gets included with all .ini files. Or included via some other way to load centralized config as well as deploy-specific config. It doesn't look like there's an "import" syntax for pylons ini files. What's the best way to achieve this type of config compositing for pylons, if any?
0
python,configuration,pylons,ini,paster
2011-08-29T17:26:00.000
0
7,233,546
You can use the ConfigParser module.
0
539
true
0
1
any way to composite configuration/.ini files in pylons?
7,233,653
1
2
0
3
2
0
0.291313
0
How do you redirect the stdin of a csh script to the stdin of a python script? I have a cgi script I'm writing in csh that runs on a Solaris machine. This csh script is a wrapper to a python script that reads from the stdin (I know, scripting in csh is bad but I'm forced to in this case). Thanks for help! (And sorry for the n00b question!)
0
python,stdin,csh
2011-08-29T19:07:00.000
0
7,234,640
You don't need to do anything. Commands (such that a Python script) that you start from a shell (such as csh) will inherit the shell's stdin (and stdout, stderr) by default unless you actively do something to prevent it.
0
299
false
0
1
csh stdin to Python stdin?
7,234,676
1
4
0
2
11
0
0.099668
1
I want to rename all files in a folder and add a .xml extension. I am using Unix. How can I do that?
0
php,python,linux,shell,unix
2011-08-31T06:11:00.000
1
7,253,198
In Python: Use os.listdir to find names of all files in a directory. If you need to recursively find all files in sub-directories as well, use os.walk instead. Its API is more complex than os.listdir but it provides powerful ways to recursively walk directories. Then use os.rename to rename the files.
0
13,442
false
0
1
How to add .xml extension to all files in a folder in Unix/Linux
7,253,246
2
2
0
3
1
0
0.291313
0
I'm on Mac OS X 10.7.1 (Lion). I just downloaded a fresh copy of Eclipse IDE for Java EE Developers, and installed the Mercurial plugin. I get the following error message: abort: couldn't find mercurial libraries in [...assorted Python directories...]. I do have Python 2.6.1 and 3.2.1 installed. I also have a directory System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7, which is on the list of places it looked for the Mercurial libraries. hg -y debuginstall gives me the same message. What are these libraries named, where is Eclipse likely to have put them when I installed the plugin, and how do I tell Eclipse where they are (or where should I move them to)? Thanks, Dave Full error message follows: abort: couldn't find mercurial libraries in [/usr/platlib/Library/Python/2.6/site-packages /usr/local/bin /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC /Library/Python/2.7/site-packages] (check your install and PYTHONPATH)
0
python,mercurial,eclipse-plugin,osx-lion
2011-08-31T18:12:00.000
1
7,261,451
Nobody answered me, but I figured out the answer. Maybe it will help someone. I finally realized that since 'hg -y debuginstall' at the command line was giving me the same error message, it wasn't an Eclipse problem at all (duh). Reinstalling a newer version of Mercurial solved the problem.
0
1,116
false
1
1
Mercurial plugin for Eclipse can't find Python--how to fix?
7,278,773
2
2
0
0
1
0
0
0
I'm on Mac OS X 10.7.1 (Lion). I just downloaded a fresh copy of Eclipse IDE for Java EE Developers, and installed the Mercurial plugin. I get the following error message: abort: couldn't find mercurial libraries in [...assorted Python directories...]. I do have Python 2.6.1 and 3.2.1 installed. I also have a directory System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7, which is on the list of places it looked for the Mercurial libraries. hg -y debuginstall gives me the same message. What are these libraries named, where is Eclipse likely to have put them when I installed the plugin, and how do I tell Eclipse where they are (or where should I move them to)? Thanks, Dave Full error message follows: abort: couldn't find mercurial libraries in [/usr/platlib/Library/Python/2.6/site-packages /usr/local/bin /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC /Library/Python/2.7/site-packages] (check your install and PYTHONPATH)
0
python,mercurial,eclipse-plugin,osx-lion
2011-08-31T18:12:00.000
1
7,261,451
I had two installation of mercurial in mac. One was installed directly and another using macport. Removing the direct installation solved the problem. Remove the direct installation using easy_install -m mercurial Update "Mercurial Executable" path to "/opt/local/bin/hg" Eclipse->Preference->Team->Mercurial-> Restart eclipse
0
1,116
false
1
1
Mercurial plugin for Eclipse can't find Python--how to fix?
12,130,976
1
4
0
1
3
1
0.049958
0
Which sites are the best for posting Python code that actually works? To show/share, and get input? I would like to post my code.
0
python
2011-09-01T02:26:00.000
0
7,265,548
I think Github (Git) or Bitbucket/Kiln (Mercurial) would be the best places to host any code. That way you can keep it in version control + get comments, suggestions, and even features or additional code for free via the pull requests.
0
1,231
false
0
1
Best site for posting Python code?
7,265,575
1
1
0
2
2
0
1.2
0
We're building a commercial (closed/proprietary) intranet application which makes used of hosted IronPython (2.7), targeting .NET 4.0. What approach would you recommend for ensuring the DLR runtimes (Microsoft.Scripting.dll & Microsoft.Dynamic.dll - both included in the IronPython 2.7 binary distribution) are available at runtime? They're both licensed under Apache license so including with our software wouldn't be a problem. Potentially an alternative would be ensuring they're available in the GAC. It seems the intention of the DLR developers is that more and more of the DLR will eventually end up in the .NET framework/CLR (presumably under System.Core). Any thoughts or considerations are appreciated.
0
c#,runtime,ironpython,distribution,dynamic-language-runtime
2011-09-01T04:57:00.000
0
7,266,270
The best thing to do is include the DLR DLLs in your application next to the IronPython DLLs. Putting them in the GAC will affect every other application on the system that uses the DLR, which is probably not what you want unless you have complete control of the systems involved. What's in .NET 4 is probably the extent of the DLR that's going to go in; Microsoft is not involved in the development of the DLR anymore.
0
309
true
0
1
Distrubuting DLR runtime for C# Application with embedded (hosted) IronPython
7,272,791
4
5
0
-17
5
0
-1
0
In perl debugger I can use DB::get_fork_TTY() to debug both parent and child process in different terminals. Is there anything similar in python debugger? Or, is there any good way to debug fork in python?
0
python,debugging,fork
2011-09-01T09:39:00.000
1
7,268,563
But I'm still curious if there's any similar feature in python debugger. I happen to find this feature in perldb and I find it's very handy No. You don't need it. No matter how handy it may appear in other environments, you just don't need it. You don't need fork() in Python; therefore you don't need fancy debugging to work with fork(). If you think you need fork() you should either use subprocess, multiprocessing or C.
0
2,992
false
0
1
How to debug python scripts that fork
7,272,926
4
5
0
1
5
0
0.039979
0
In perl debugger I can use DB::get_fork_TTY() to debug both parent and child process in different terminals. Is there anything similar in python debugger? Or, is there any good way to debug fork in python?
0
python,debugging,fork
2011-09-01T09:39:00.000
1
7,268,563
The debugger in pyCharm does this nicely. It seems to use gdb with python support to accomplish that, however all the tutorials on how to do this with gdb by Hand which I've found so far didn't work for me. In pyCharm it just works.
0
2,992
false
0
1
How to debug python scripts that fork
45,673,792
4
5
0
0
5
0
0
0
In perl debugger I can use DB::get_fork_TTY() to debug both parent and child process in different terminals. Is there anything similar in python debugger? Or, is there any good way to debug fork in python?
0
python,debugging,fork
2011-09-01T09:39:00.000
1
7,268,563
One possible way to debug a fork is to use pdb on the main process and winpdb on the fork. You put a software break early in the fork process and attach the winpdb app once the break has been hit. It might be possible to run the program under winpdb and attach another instance after the fork - I haven't tried this. You certainly can't attach two winpdb instances at the same time, I've tried and it fails. If it works, this would be preferable - pdb really sucks.
0
2,992
false
0
1
How to debug python scripts that fork
23,942,909
4
5
0
3
5
0
1.2
0
In perl debugger I can use DB::get_fork_TTY() to debug both parent and child process in different terminals. Is there anything similar in python debugger? Or, is there any good way to debug fork in python?
0
python,debugging,fork
2011-09-01T09:39:00.000
1
7,268,563
You can emulate forked process if you will set instead of fork and its condition (pid == 0) always True. For debugging main process debugger will work. For debugging multi-processing interaction better to use detailed logs as for me
0
2,992
true
0
1
How to debug python scripts that fork
7,268,624
1
2
0
2
1
0
1.2
0
We are running a very large framework of python scripts for test automation and I do really miss the opportunity to kill a running python script with ctrl + c in some situations on Windows. When the script might be doing some socket communications with long time-outs the only options sometimes is to kill the DOS window.. Is there any options I have missed?
0
python
2011-09-02T15:39:00.000
1
7,285,874
Rather than using blocking calls with long timeouts, use event-driven networking. This will allow you never to have long periods of time doing uninterruptable operations.
0
200
true
0
1
Make running python script more responsive to ctrl c?
7,285,945
1
3
0
7
9
0
1.2
0
Since Pyramid does not have any form dependencies, I need recommendations for form handling. This covers form generation, validation, etc. I only know wtforms, but I dont mind to use some other thing more advanced.
0
python,forms,pyramid,wtforms
2011-09-02T19:06:00.000
0
7,288,143
I'd recommend deform. Beyond supporting form generation and validation it has great documentation, a running demo app and it supports localization and ajax. I don't believe formalchemy directly support ajax.
0
3,636
true
0
1
Form handling in Pyramid
8,394,921
1
3
0
5
0
0
1.2
0
I recently implemented password reset on AD using python ldap module. This involved passing modified attributes in this manner: add_pass = [(ldap.MOD_REPLACE, "unicodePwd", )] This worked since the passwords on AD are stored in attribute "unicodePwd". Now I want to unlock a locked user account but I cannot find the attribute that must be changed to achieve the same. Could you guys please tell me which attribute I have to change?
0
python,active-directory
2011-09-03T16:06:00.000
0
7,294,218
To unlock a user, you need to set the lockoutTime attribute to 0.
0
6,179
true
0
1
unlocking Locked user accounts on Active Directory using Python ldap module
7,365,734
3
4
0
5
10
1
1.2
0
When you write some scripts that are self sufficient, is it a bad idea to use the if __name__ == '__main__' as a place to write tests?
0
python,unit-testing
2011-09-04T06:22:00.000
0
7,297,719
Test logic and tests should never be part of "production" (production can mean in use by you, released to client, etc.) code. So, it is a bad idea to have them anywhere within your script. Ideally, have them in separate files.
0
2,066
true
0
1
Use if __name__ == '__main__': for tests
7,297,727
3
4
0
0
10
1
0
0
When you write some scripts that are self sufficient, is it a bad idea to use the if __name__ == '__main__' as a place to write tests?
0
python,unit-testing
2011-09-04T06:22:00.000
0
7,297,719
I guess not, in fact, I saw a lot of python scripts (mostly plugins of another application) written that way.
0
2,066
false
0
1
Use if __name__ == '__main__': for tests
7,297,726
3
4
0
3
10
1
0.148885
0
When you write some scripts that are self sufficient, is it a bad idea to use the if __name__ == '__main__' as a place to write tests?
0
python,unit-testing
2011-09-04T06:22:00.000
0
7,297,719
Best practice is to put the tests in separate units that use the unittest module. This separation allows you to keep the main code clean (no need for lots of testing helper functions) and encourages you to write good comprehensive tests since you are not inhibited by cluttering the main code.
0
2,066
false
0
1
Use if __name__ == '__main__': for tests
7,297,763