Available Count
int64
1
31
AnswerCount
int64
1
35
GUI and Desktop Applications
int64
0
1
Users Score
int64
-17
588
Q_Score
int64
0
6.79k
Python Basics and Environment
int64
0
1
Score
float64
-1
1.2
Networking and APIs
int64
0
1
Question
stringlengths
15
7.24k
Database and SQL
int64
0
1
Tags
stringlengths
6
76
CreationDate
stringlengths
23
23
System Administration and DevOps
int64
0
1
Q_Id
int64
469
38.2M
Answer
stringlengths
15
7k
Data Science and Machine Learning
int64
0
1
ViewCount
int64
13
1.88M
is_accepted
bool
2 classes
Web Development
int64
0
1
Other
int64
1
1
Title
stringlengths
15
142
A_Id
int64
518
72.2M
1
1
0
2
2
0
0.379949
0
I have a pyramid project that uses mongodb for storage. Now I'm trying to write a test but how do I specify connection to the mongodb? More specifically, which database should I connect to (test?) and how do I use fixtures? In Django it creates a temporary database but how does it work in pyramid?
1
python,mongodb,pyramid
2011-06-29T02:30:00.000
0
6,515,160
Just create a database in your TestCase.setUp and delete in TestCase.tearDown You need mongodb running because there is no mongolite3 like sqlite3 for sql I doubt that django is able to create a temporary file to store a mongodb database. It probably just use sqlite:/// which create a database with a memory storage.
0
594
false
0
1
How do i create unittest in pyramid with mongodb?
6,934,811
1
1
0
0
0
0
1.2
0
I have a test footest.py which runs with mysql database, and the same test runs on psql database, is there a way to distinguish this difference in an XML result file between the two tests.
0
python,xml,nosetests
2011-06-29T02:31:00.000
0
6,515,166
Why not trying to create a base_test_class.py with a base test class class BaseSQLTest(unittest.TestCase) that contains all your tests, and 2 other files mysqltest.py and psqltest.py that contains 2 inherited classes (class MySQLTest(BaseSQLTest) and class PSQLTest(BaseSQLTest)) for your MySQL and PSQL tests. Doing this will split your tests in the resulting XML.
0
63
true
0
1
How can i distinguish the XML results of two python tests (using nosetests as test runner) with the same name but with different context
6,517,155
1
2
0
0
0
0
0
1
I checked the documentation for Python-Twitter and I couldn't find any methods for OAuthentication. There is a methods for Basic Auth, but I obviously can't use that any more. If I get a separate module for Oauth can I still use methods in Python-Twitter that require Oauth or does the Oauth only support methods from the same module I authenticated in.
0
python,twitter,module
2011-06-29T03:33:00.000
0
6,515,477
OAuth is a generic protocol; any well-behaved library that implements it should work with any site's API (this is the whole point of having a standard...)
0
66
false
0
1
Do I need a specific Python module Oauthentication?
6,515,489
1
3
0
1
1
1
0.066568
0
I have created a Python-based GUI application which has certain dependencies such as the "request" and "psycopg2" modules among others. I want to create a setup script that will install all such dependencies when run, so that a user can run the GUI application without having any missing package errors. I did try looking up the distutils module, but am not able to fully understand its usage.
0
python,installation
2011-06-29T16:33:00.000
1
6,524,104
You specify all dependent packages in the 'install_requires' option within your setup.py - that's it. If this is not sufficient or good enough (for whatever reason): look into zc.buildout giving your more options installing and configuring external dependencies.
0
1,635
false
0
1
Installing dependencies for Python program
6,524,127
1
2
0
3
13
1
1.2
0
I'd like to mangle and demangle C++ function names in a Python program. Is there anything like that available? I searched for hours now, perhaps I'm lucky here...
0
c++,python,name-mangling
2011-06-29T19:59:00.000
0
6,526,500
You most likely don't want to be doing this in Python. As an aside you probably shouldn't be exporting mangled names from your DLLs since it makes it hard to use for anyone with a different compiler. If you have to use mangled names then just hard code them in your Python code. If you were going to do mangling in Python code then you'd have to: Know the implementation specific rules for the compiler in question. Specify in Python the C++ function signature for each function. It seems highly unlikely to me that coding all this up in Python would be better than simply hard coding the mangled names.
0
5,841
true
0
1
C++ Name Mangling Library for Python
6,526,604
1
1
0
0
0
0
0
0
I have a python project that takes in two Excel spreadsheets with various data as input, and depending on given parameters in a python 'run' type module, produces several spreadsheets which contain statistical information as outputs. I have several versions of this project released already to a few clients, but testing to make sure that the input spreadsheets, their parameters (in a python module), and their corresponding output spreadsheets are the same is very time consuming because I have a lot of possible parameters that can be used. Is there a tool or something I can do or use to automate testing for my project to ensure inputs, parameters and outputs of past versions of the project match the latest version? I know that there are many testing modules in python (in particular unittest, nose, Scons, doctest etc), but I was wondering if anyone knew of a simpler tool for testing inputs and outputs, or a way to create my own quickly. I do not want to test every single method due to time and cost constraints and complexity of the project. Thanks in advance!
0
python,unit-testing,excel,testing
2011-06-29T22:36:00.000
0
6,528,059
One of the unit testing frameworks you list is just what you need. Testing is hard and takes time. If you try to do it without putting in sufficient time and thought your testing won't be worth very much. It sounds like you are wanting a list of inputs and outputs that your test loops through. That's easy. Just declare such a list in your test case and run a loop across it. That's the easy bit. The hard bit is working out the test data.
0
202
false
0
1
Simple test tool for python projects
6,528,157
1
2
0
-1
1
1
-0.099668
0
How can I access my php script from a Python script? I need my Python script to be able to access the variables within the php script. (By the way, I'm new to php and Python.) Thanks in advance.
0
php,python,import
2011-06-30T06:16:00.000
0
6,530,663
Elaborate. Is the PHP file local? On a webserver? Where's the python file? If the php file is on a server with the python file, use an exec statement. If the python file is local and the php file is on a server, then you need to use urllib. If both are local, write an interpreter...
0
1,637
false
0
1
How to access variable values of a php script from a python script?
6,530,718
1
1
0
7
4
0
1.2
0
Is there an equivalent to the POSIX sigaction available through Python? I realize python has traditional support for signals, but I need sigaction. I'm trying to identify the pid of a process that is the source of a signal being issued. From what I can see from the documentation, there isn't a way to do this. I'm only concerned with functionality on Linux.
0
python,linux,posix,signals
2011-06-30T08:43:00.000
1
6,532,213
There is a standard module called, unsurprisingly, signal. This seems to carry out the functionality of sigaction(2). However I'm guessing that what you really need is the siginfo_t struct, which gives the PID of the source of the signal, which is not part of the module at the moment (possibly because it is not implemented on all UNIXs). The only alternative I can suggest is to use ctypes.
0
2,124
true
0
1
Python, sigaction(2) available?
6,534,882
1
1
0
4
1
0
1.2
0
Currently Fabric's 'rsync_projecct' requires a user and a host parameter to be specified. I'having a lot of issues copying user@127.0.0.1 because it is still asking me for the password for rsync. I've spent hours on this and am wondering if there is just a way to use the rsync [src] [dest] without having to specify a [user] and [host]? Or do you guys recommend something better? The reason I like rsync over anything else is because I already have the rsync files/folders/excludes setup for that specific command. Then again, I could just write my own rsync command right? Thanks.
0
python,fabric
2011-06-30T15:04:00.000
1
6,536,862
you can just local() out and use rsync any way you want to.
0
1,806
true
0
1
Python's Fabric to use rsync locally, is it possible?
6,605,088
1
2
0
0
0
0
0
0
I started coding an RPG engine in python and I want it to be very scripted(buffs, events). I am experimenting with events and hooking. I would appreciate if you could tell me some matured opensource projects(so i can inspect the code) to learn from. Not necessarily python, but it would be ideal. Thanks in advance.
0
python
2011-06-30T18:17:00.000
0
6,539,267
You might have a look at pygame, it's pretty common for this sort of thing.
0
730
false
0
1
Python rpg adivce?
6,539,682
1
2
0
6
9
0
1.2
0
I want to my tests to fail if they take longer than a certain time to run (say 500ms) because it sucks when a load of slightly slow tests mount up and suddenly you have this big delay every time you run the test suite. Are there any plugins or anything for Nose that do this already?
0
python,unit-testing,nose
2011-07-01T13:20:00.000
0
6,548,496
I respectfully suggest that changing the meaning of "broken" is a bad idea. The meaning of a failed/"red" test should never be anything other than "this functionality is broken". To do anything else risks diluting the value of the tests. If you implement this and then next week a handful of tests fail, would it be an indicator that Your tests are running slowly? The code is broken? Both of the above at the same time? I suggest it would be better to gather MI from your build process and monitor it in order to spot slow tests building up, but let red mean "broken functionality" rather then "broken functionality and/or slow test."
0
1,155
true
0
1
Making Nose fail slow tests
6,548,606
2
5
0
0
3
0
0
0
I am very new to programming. I am familiar with HTML, C++ and learning PHP to start a database. I want to make a website which tracks a stock price. I have written various algorithms in Matlab however, MATLAB only has a to-Java conversion. I was wondering what language would be the best to do a lot of calculations. I want my calculations to be done in real time and plotted. Would Java be the best language for this? I can do the calculations in C++ but I don't know how to put the plots on the website. Likewise I believe I can do everything in Matlab but the conversion looks a little sketchy. I would be very thankful if someone with experience with Java, or I also heard python, would comment on my post.
0
java,c++,python,math,matlab
2011-07-04T18:04:00.000
0
6,574,740
I think you can use PHP or Java Web.
0
1,004
false
1
1
Math Intensive, Calculation Based Website - Which Language Should I Use?
6,574,755
2
5
0
0
3
0
0
0
I am very new to programming. I am familiar with HTML, C++ and learning PHP to start a database. I want to make a website which tracks a stock price. I have written various algorithms in Matlab however, MATLAB only has a to-Java conversion. I was wondering what language would be the best to do a lot of calculations. I want my calculations to be done in real time and plotted. Would Java be the best language for this? I can do the calculations in C++ but I don't know how to put the plots on the website. Likewise I believe I can do everything in Matlab but the conversion looks a little sketchy. I would be very thankful if someone with experience with Java, or I also heard python, would comment on my post.
0
java,c++,python,math,matlab
2011-07-04T18:04:00.000
0
6,574,740
I would do C++ and write them to a database, then using php you can grab them from the same database and show them online, otherwise then java can do all that but make sure all calculations aren't done on the fly since that will kill your server, especially with stocks that can turn into a lot of data.
0
1,004
false
1
1
Math Intensive, Calculation Based Website - Which Language Should I Use?
6,574,803
5
8
0
7
18
1
1
0
Is it possible without any plugins? Or what's the best plugin for edit python file?
0
python,vim
2011-07-05T08:20:00.000
0
6,579,723
The way I do it is not specific to functions. It will just select a continuous block of Python code: v]] if what you want to select is below the cursor v[[ if it is above the cursor. Just remove one bracket if the cursor is on the first line of the code block you want to select.
0
5,089
false
0
1
what's the fastest way to select a function of Python via VIM?
57,220,317
5
8
0
0
18
1
0
0
Is it possible without any plugins? Or what's the best plugin for edit python file?
0
python,vim
2011-07-05T08:20:00.000
0
6,579,723
I try to avoid visual, hence for actions like yank, I tend to go to the beginning of the paragraph [[, yank till the end y]] and come back ^o. All in one, it is [[y]]^o (With ^ standing for control). For visual you might use [[v]] or some variations like [[v][, [[v]m, or [[v]M.
0
5,089
false
0
1
what's the fastest way to select a function of Python via VIM?
64,190,015
5
8
0
2
18
1
0.049958
0
Is it possible without any plugins? Or what's the best plugin for edit python file?
0
python,vim
2011-07-05T08:20:00.000
0
6,579,723
I normally use vip or any of the above depending on the need, do not forget that you can always select up (i.e., down =)) to the next occurrence using v/match (followed by Enter to confirm, and possibly n for next). For python, you could look for the next def or for the return (ret is normally enough). This isn't the fastest at the beginning, but it is very general, use it in any language and also outside coding (md, latex, etc.).
0
5,089
false
0
1
what's the fastest way to select a function of Python via VIM?
59,506,958
5
8
0
0
18
1
0
0
Is it possible without any plugins? Or what's the best plugin for edit python file?
0
python,vim
2011-07-05T08:20:00.000
0
6,579,723
If your function is long or has many blank lines, using v}}...}}d is pretty slow. The quickest way I've found (without plug-ins) is zc2dd. The command zc closes the fold under the cursor, so if you are at the function declaration or any line at the outermost indent level, the whole function will fold. Then 2dd (or 3dd if you have two blank lines before/after your function) will remove the whole thing.
0
5,089
false
0
1
what's the fastest way to select a function of Python via VIM?
68,185,960
5
8
0
14
18
1
1
0
Is it possible without any plugins? Or what's the best plugin for edit python file?
0
python,vim
2011-07-05T08:20:00.000
0
6,579,723
try vis to visualy select and o to jump edges
0
5,089
false
0
1
what's the fastest way to select a function of Python via VIM?
6,597,250
1
1
0
2
0
1
1.2
0
Anyone knows how to build and run emesene - the chat client in Python - on OS X once you get the code from GitHub? I have searched online and I cannot find a source that is working. I did find some documents on sidhosting website. But that did not work for me completely. Hence I need help here. Thanks Sumod
0
python,git
2011-07-05T17:53:00.000
1
6,586,793
Have you tried running python setup.py install in the emesene directory?
0
73
true
0
1
How to build and run emesene on OS X using Git
6,587,062
2
4
0
3
0
1
1.2
0
I wrote a simple file parser and writer, but then I came across an article talking about the importance of unicode and then it occurred to me that I'm assuming the input file is ascii encoded, which may not be the case all the time, though it would be rare in my situation. In those rare cases, I would expect UTF-8 encoded files. Is there a way to work with UTF-8 files by simply changing how I read and write? All I do with the strings is store them and then write them out, so I just need to make sure I can read them, store them, and write them properly. Furthermore, would I have to treat ascii and UTF-8 files separately and write different functions for each? I have not worked with anything other than ascii files yet and only read about handling unicode.
0
python,unicode-string,python-2.7
2011-07-05T19:46:00.000
0
6,588,041
Python natively supports Unicode. If you directly read and write from the first file to the second, then no data is lost as it copies the bytes verbatim. However, if you decode the string and then re-encode it, you'll need to make sure you use the right encoding.
0
669
true
0
1
Writing UTF-8 friendly parsers in python
6,588,072
2
4
0
2
0
1
0.099668
0
I wrote a simple file parser and writer, but then I came across an article talking about the importance of unicode and then it occurred to me that I'm assuming the input file is ascii encoded, which may not be the case all the time, though it would be rare in my situation. In those rare cases, I would expect UTF-8 encoded files. Is there a way to work with UTF-8 files by simply changing how I read and write? All I do with the strings is store them and then write them out, so I just need to make sure I can read them, store them, and write them properly. Furthermore, would I have to treat ascii and UTF-8 files separately and write different functions for each? I have not worked with anything other than ascii files yet and only read about handling unicode.
0
python,unicode-string,python-2.7
2011-07-05T19:46:00.000
0
6,588,041
If you are using Python 2.6 or later, you can use the io library and its io.open method to open the files you want. It has an encoding argument which should be set to 'utf-8' in your case. When you read or write the returned file objects, string are automatically en-/decoded. Anyway, you don't need to do something special for ASCII, because UTF-8 is a superset of ASCII.
0
669
false
0
1
Writing UTF-8 friendly parsers in python
6,588,187
1
2
0
0
0
0
0
0
I am trying to use the mpdboot command to start 4 processors on which to run my MPI program. I created a mpd.hosts file with 4 nodes (75, 77, 79 and 80). Each of them run python 2.3.4. I also modified the bashrc and cshrc files to ensure that the variables contain the path to the directory of the compiler libraries. I also set up the mpd.conf file and checked that it has rw (600) permissions. I have copied below the output screen when I run mpdboot [n@heart]$ mpdboot -n 4 -r ssh :38: Deprecation Warning: The popen2 module is deprecated. Use the subprocess module. n@75's password:xxx n@77's password:xxx n@79's password:xxx n@80's password:xxx mpdboot_heart.int(err_exit 526): mpd failed to start correctly on heart.int reason: 0: invalid port from mpd /opt/intel/mpi/2.0/bin/mpd.py:85: DeprecationWarning: the md5 module is deprecated; use hashlib instead Killed PART 2: I also logged into one of the nodes and tried running mpdboot. Here is the output by doing that [n@79 ~]$ mpdboot -n 4 -r ssh n@75's password:xxx n@77's password:xxx n@79's password:xxx n@80's password:xxx mpdboot_79_0 (mpdboot 499): problem has been detected during mpd(boot) startup at 1 75; output: Permission denied, please try again. n@75's password: Permission denied, please try again. n@77's password: mpdboot_79_0 (mpdboot 515): problem has been detected during mpd(boot) startup at 2 77; output: Permission denied, please try again. Permission denied (publickey,gssapi-with-mic,password). n@77's password: Permission denied, please try again. Permission denied (publickey,gssapi-with-mic,password). How should I proceed on this matter?
0
python,mpi,mpich,mpiexec
2011-07-06T00:24:00.000
1
6,590,343
Is mpdboot compatible with such a version of python? That's downright ancient, I didn't know there was even any distribution left that still shipped 2.3. Have you tried with 2.7?
0
2,152
false
0
1
Mpdboot: Deprecation Warning
6,590,376
1
1
0
5
0
0
1.2
0
Lets say for batch processing of over 10000 videos, is there any thing to be gained from using FFmpeg rather than the pyFFmpeg?
0
python,ffmpeg,video-encoding
2011-07-06T22:28:00.000
1
6,603,810
Considering that pyFFmpeg is just a wrapper over the libraries, I'd say you shouldn't have any negligible performance difference between the 2, since they use the same libraries at the core.
0
774
true
0
1
FFmpeg VS PyFFmpeg performance wise?
6,603,847
1
2
0
0
3
0
0
1
I know about gethostbyaddr in Python and that is somewhat useful for me. I would like to get even more info about an ip address like one can find at various websites such as who hosts that ip address, the country of origin, ..., etc. I need to accomplish this programmatically. Are there any built in commands for Python, or would I need access to some database which contains this type of information, or are there any Python APIs? Python is not my native language so I am not as familiar with how one would approach such a problem in Python.
0
python,reverse-dns,gethostbyaddr,pywhois
2011-07-07T13:24:00.000
0
6,611,298
Ok, here is my answer. I am going to work on cleaning up for public consumption a Python 3.x version of pywhois that I have on my machine and hopefully in the next week I will submit my code to the subversion repository. From the IP addresses I am using, I have about a 78% success rate for retrieving info first by applying gethostbyaddr to the IP address as phihag suggested and then putting that through pywhois. I will let the reader decide for themselves whether that rate is high enough for their particular application.
0
3,195
false
0
1
In Python, Getting More Info About An IP Address
6,644,900
2
2
0
5
0
1
1.2
0
I already did a search, but I just couldn't find what I searched for. I want to create a Python Module using C++ and Visual C++ Express 2010. Now, I need to include Python.h, but when I compile it says it couldn't find Python.h. How do I give my VC the Python header file ?
0
c++,python,visual-c++-2010-express
2011-07-07T15:24:00.000
0
6,613,039
Tell IDE where header is located: Project -> Properties -> C/C++ -> Additional Include Directories
0
4,649
true
0
1
How do I get Visual Express 2010 to find my python.h header file?
6,613,094
2
2
0
0
0
1
0
0
I already did a search, but I just couldn't find what I searched for. I want to create a Python Module using C++ and Visual C++ Express 2010. Now, I need to include Python.h, but when I compile it says it couldn't find Python.h. How do I give my VC the Python header file ?
0
c++,python,visual-c++-2010-express
2011-07-07T15:24:00.000
0
6,613,039
You either have to set the path to to the python include files in your IDE. Navigate to Tools | Options | Projects and Solutions | VC++ Directories and add the path under Include Directories.
0
4,649
false
0
1
How do I get Visual Express 2010 to find my python.h header file?
6,613,085
1
1
0
3
1
1
1.2
0
I came across a potential issue when migrating from a 32bit system to a 64bit system. the system runs two 'one way' encryption algos on the string. However when I tried the same code on a 64 bit system the hashes were different, now thats fine but does anyone have any method on how to ensure the the hash can still be retreived and matched in the future when upgrading to 64bit and beyond? Without risking the customers sensitive password? or ever storing the raw password or other sensitive data without encryption?
0
java,php,python,encryption
2011-07-07T18:44:00.000
0
6,615,529
Basically, just make sure that you're using the same algorithm. If your hashes were different with the same inputs, you were using a different algorithm; there may be some unstated dependencies upon the underlying word size. Make sure you don't use those types of algorithms, or if you do, that they have very clear expectations of the word sizes and that those things can be overridden by you.
0
309
true
0
1
Password hashing on 32bit system then migrating to 64bit systems
6,615,599
1
1
0
5
0
0
1.2
0
I am trying to use python in order to simulate social networks, this requires matplotlib.pyplot, networkx and xlrd. Everything works fine from terminal, IDLE or X11 but when I try to use TextMate import matplotlib.pyplot as plt and import xlrd throws up ImportError: No module named... however import networkx works fine! I downloaded python via EPD and so matplotlib came ready baked in however I got xlrd and networkx with easy_install. Anybody have an idea what might be going on?
0
python,module,matplotlib,textmate
2011-07-07T19:29:00.000
0
6,616,005
You need to tell TextMate which Python to use. One way to do that is to define the shell variable TM_PYTHON with an absolute path to the Python interpreter you want to use. In the TextMate menu, select Preferences, then the Advanced tab, then the Shell Variables tab, and click + to add the new variable. If you don't know the absolute path to the EPD Python, type which python (or whatever you are using to start Python) in a Terminal shell window.
0
1,391
true
0
1
Just downloaded TextMate, can't import modules
6,616,093
1
3
0
3
13
1
0.197375
0
Background The group I work with has been using and developing a Python package, which for the purposes of this question I'll call foobuilder. We serve updates for Linux systems using private RPM and Deb repositories we provide for our users. Recently, a public package was added to PyPi with the same name. It also got packaged on the public Debian repository, among other places. Since we don't publicly advertise our package, it's understandable that a package with the same name has popped up. Concerns This looks like a big problem for foobuilder because somewhere down the line, a user might try to install our foobuilder while the public foobuilder package is installed on the same system. Besides the obvious problem in Python, I would guess that adding our repository to a Debian package manager program could also cause some issues, though I haven't played around with this situation yet. Problem Since we've been using the proprietary foobuilder for years, there is a ton of code in existence which wants to import foobuilder and expects to get our package, so I don't think it's feasible to change the name. My thoughts on possible solutions Python I've considered changing the name of the package to my_foobuilder, and having it include a meta-package called foobuilder which consists only of an __init__.py that imports everything from my_foobuilder. I could instruct new users to import my_foobuilder directly. Then I could begin to deprecate the foobuilder name. In the end this would result in the same amount of work as if I changed foobuilder to my_foobuilder now, since everyone needs to be served updates and the foobuilder name can't be in deprecation purgatory forever. Debian The Debian problem shouldn't be too hard to solve; I can change the debian package name to my_foobuilder but have it still install the same (conflicting) Python package. I could then set the my_foobuilder package to Conflict with foobuilder. It might require users to fiddle around with their package manager to get things back on track during the transition but I don't think that's a big deal. Still, this prevents users from using the public foobuilder package at the same time. Question Is there an easier or better way to treat this situation than what I've considered above? Are there any problems with the solutions I'm considering? How would you deal with this?
0
python,debian,packages,naming
2011-07-07T22:28:00.000
0
6,617,895
I'd email the new foobuilder package author to discuss the problem. Obviously one of you needs to change package name; due to proprietary nature of your program is may be undesirable to change its name... Asking this question to the new package author may come up with some new solutions. There really is no sane way to have Python handle this in a way so 'import foobuilder' can mean 2 things.
0
1,217
false
0
1
How to deal with a proprietary Python package name conflicting with a public one?
6,634,222
1
1
0
1
0
0
1.2
0
I am about to start into a daemon project with a friend, he will do the design and I will do the coding I am confused between Python and C++ I know C++, but I need to learn Python if I will go with it The daemon I am about to write will be more than 1 daemon actually, each one is responsible for a function, such as accepting SSL connections from network, stream audio and video, sending files and data and more network operations, I like going with C++ but I am afraid from the time I'll lose fixing the memory leaks that will occur (for sure), but also I am afraid from Python because I don't know it and I don't know if it can do the job for me or not Any suggestions?
0
python,linux,daemon
2011-07-08T07:48:00.000
1
6,621,501
Use the right tool for the right job. If you want a process that keeps on running for a long time you will want a proof of some of it's correctness (not a complete one, but at least something). This proof is given to you by the compiler or interpreter accepting the language. It depends a lot on the language, what kind of things are proven about your program. For python you get a proof of syntactic correctness, that is all. If you use C++ existence of all methods and some type soundness will also be proven. This is much better for long running processes, such as daemon. There are languages, where you can use the compiler to prove even more, but this is often not as simple. Don't worry too much about the memory leaks. As has been pointed out in the comments, if you use modern C++ memory leaks or memory corruption are not an issue anymore and speed will be much higher, than if a garbage collector is present. Use C++ or C++0x but not C/C++, and all will be fine.
0
453
true
0
1
Using python to write a daemon instead of C++
6,622,182
2
2
0
0
12
1
0
0
I'm trying to import pycassa library in a Python project in Aptana 3, but in the line "import pycassa" it show me the next error: "Unresolved import: pycassa". I installed pycassa with easy install and if I run "import pycassa" in a python shell it run with no errors. If I run the Aptana project run with no errors too, but the error mark continues. Why? Sorry for my english.
0
python,pydev,aptana,pycassa
2011-07-08T08:31:00.000
0
6,621,902
I had the same problem with Tastypie. I tried to add external library to project using Preferences-PyDev PUTHONPATH, but it didn't work for me... But then I found solution: Window-Preferences-PyDev-Interpreter Python-Libraries-New folder (Button). Choose folder with needed library and Aptana should work fine then.
0
5,859
false
0
1
Aptana 3 Unresolved import - Python
26,035,528
2
2
0
5
12
1
0.462117
0
I'm trying to import pycassa library in a Python project in Aptana 3, but in the line "import pycassa" it show me the next error: "Unresolved import: pycassa". I installed pycassa with easy install and if I run "import pycassa" in a python shell it run with no errors. If I run the Aptana project run with no errors too, but the error mark continues. Why? Sorry for my english.
0
python,pydev,aptana,pycassa
2011-07-08T08:31:00.000
0
6,621,902
The only working solution for me: open menu “Window” → “Preferences” → “Interpreter - Python”, then click button “Apply”, select your interpreter and then “OK”. Pydev will rescan all packages and in some seconds all unresolved imports disappear. Unfortunately I have to do these steps on every restart because Pydev always “forget” some packages after restart…
0
5,859
false
0
1
Aptana 3 Unresolved import - Python
6,888,449
1
2
0
0
5
1
1.2
0
I have some code available in some form of AST and I would like to execute it. I can think of several ways to do this, e.g.: Just straight-forwardly interpret it. Translate it into a Python AST (the ast module) and Python-compile that or Python-eval that. Translate it into Python source code (e.g. a pure string) and Python-compile that or Python-eval that. Translate it in some form of low level code and write a simple VM in Python which runs that. I guess I would get the fasted execution by translating it into a Python AST, compile that and run that. Esp. when using PyPy, I might even get improvements by PyPys JIT compiling optimizations (I hope I do, do I?). Can you think of other possibilities? Can you give suggestions on what might be the best way?
0
python,scripting,abstract-syntax-tree,jit,vm-implementation
2011-07-08T15:42:00.000
0
6,626,901
Another possibility: translate the AST directly to Python byte code and execute that. This is like your last idea except using the existing Python VM. It is not a great possibility because it could be a lot of work and Python compile would probably do a better job except in rather peculiar cases, but I'm just throwing it out there.
0
314
true
0
1
possibilities for fast dynamic code execution in Python
6,627,457
1
5
0
0
11
1
0
0
I have a Python project with the following directory structure: project/ project/src/ project/src/somecode.py project/src/mypackage/mymodule.py project/src/resources/ project/src/resources/datafile1.txt In mymodule.py, I have a class (lets call it "MyClass") which needs to load datafile1.txt. This sort of works when I do: open ("../resources/datafile1.txt") Assuming the code that creates the MyClass instance created is run from somecode.py. The gotcha however is that I have unit tests for mymodule.py which are defined in that file, and if I leave the relative pathname as described above, the unittest code blows up as now the code is being run from project/src/mypackage instead of project/src and the relative filepath doesn't resolve correctly. Any suggestions for a best practice type approach to resolve this problem? If I move my testcases into project/src that clutters the main source folder with testcases.
0
python,unit-testing,resources
2011-07-08T19:40:00.000
0
6,629,597
The filepath will be relative to the script that you initially invoked. I would suggest that you pass the relative path in as an argument to MyClass. This way, you can have different paths depending on which script is invoking MyClass.
0
11,129
false
0
1
Accessing resource files in Python unit tests & main code
6,629,638
1
3
0
0
1
1
0
0
I am running Ubuntu Natty and install Emacs and pymacs and ropemacs all from the repos. So when I add to my .emacs file the script to load ropemacs and pymacs I get the following error: File mode specification error: (error "Pymacs Lisp version is 0.23, Python is 0.24-beta2" I've been reading the docs and readmes but I haven't found out what is happening here. So I turn to you. Any ideas? Thanks!
0
python,emacs23,ropemacs,pymacs
2011-07-09T15:42:00.000
0
6,635,759
I install pymacs manually the python part,and i use the pymacs package in the elpa's python-mode (it contains pymacs.el),then this two conflict,i remove the pymacs in python-mode,it works well.maybe you are the same error.Or you should check your python version.
0
486
false
0
1
Pymacs lisp version rarities
8,797,023
1
2
0
3
0
1
1.2
0
So I have a Superclass (which for simplicity I'll call), Mammal, from which classes Dog, Monkey, and Bear inherit methods. Some of the inherited methods return an object that needs to be of the same class it is called from. For example, Dog.find(...) should return Dog objects. But because the find() method is inherited from Mammal, the method can't be coded to explicitly return Dog(...). It would need to be able to return Dog, Monkey, Bear, or Mammal objects, depending on the value of self.__class__.__name__. I've achieved this with return eval(self.__class__.__name__)(...), but I'd prefer to avoid using eval. Is there a better way?
0
python
2011-07-10T06:06:00.000
0
6,639,536
Just try return self.__class__()
0
1,943
true
0
1
Returning an object based on __class__.__name__ in Python
6,639,553
1
2
0
0
8
1
0
0
I am looking to set up a continuous integration server for a python project. Normally this would build the project however as python is not built as such, what should be done instead? Just unit tests? Or are there additional steps that anyone can recommend?
0
python,continuous-integration
2011-07-10T09:50:00.000
0
6,640,385
Using Jenkins/Hudson for continuous integration is the standard approach.
0
2,281
false
0
1
python continuous integration
6,640,410
1
1
0
1
1
0
1.2
0
This is my python script which creates a "test.txt" file when executed. when I execute using terminal (Ubuntu 11.04) root@gml-VirtualBox:/var/www/HMS# python test.py. It creates the "test.txt" in the /var/www/HMS directory as I expected. test.py: #!/usr/bin/env python def init(): filename = "test.txt" file = open(filename, 'w') file.write("This is the new content of test.txt :-)") file.close() print "done" def main(): init() if __name__ == '__main__': main() But when I try to call this test.py using PHP, It's not creating the 'test.txt' output file. index.php: $tmp = exec("python test.py"); echo "temp: $tmp"; Both test.py & index.php are in the same directory(/var/www/HMS/). But when I modified the test.py like this: #!/usr/bin/env python def init(): print "done" def main(): init() if __name__ == '__main__': main() It prints temp: done in the browser, which is what I expected. I don't know why my previous python code didn't work as expected.
0
php,python
2011-07-11T04:37:00.000
1
6,645,801
When you test the python script on the command line, you're running as root. Chances are you're not running the webserver as root (which is a good thing), and the webserver's user does not have appropriate permissions to create and/or write to that file.
0
584
true
0
1
Problem in calling Python script from PHP
6,645,831
2
5
1
1
8
1
0.039979
0
I'm a self-taught programmer who jumped into Python as my first language about 7-8 months ago. I'm fairly solid at making things work, though my foundational knowledge is limited thanks to my questionable choice in college to not study computer science. Beyond Python, I'm not really familiar with C or other lower level languages. I would like to teach myself Objective C as a foray into programming iPhone apps (as a hobby initially). I initially want to create relatively simple utility apps (I think they are relatively simple, at least). Could any one give me a guess as to how long it might take me to pick up Objective C and actually produce a semi-decent app? If time is of the essence, should I just scrap it and go with HTML5? I pick things up fairly fast but, again, my background in Comp Sci is really limited. Sorry if this question is a bit too general and thanks for any insight!
0
iphone,python,objective-c,c
2011-07-12T15:11:00.000
0
6,666,499
You should learn both, Objective-C and HTML5. HTML5 isn't very difficult to grasp even if you don't have any experience.
0
5,620
false
0
1
Python to Objective C (Expected Learning Curve)
6,666,567
2
5
1
0
8
1
0
0
I'm a self-taught programmer who jumped into Python as my first language about 7-8 months ago. I'm fairly solid at making things work, though my foundational knowledge is limited thanks to my questionable choice in college to not study computer science. Beyond Python, I'm not really familiar with C or other lower level languages. I would like to teach myself Objective C as a foray into programming iPhone apps (as a hobby initially). I initially want to create relatively simple utility apps (I think they are relatively simple, at least). Could any one give me a guess as to how long it might take me to pick up Objective C and actually produce a semi-decent app? If time is of the essence, should I just scrap it and go with HTML5? I pick things up fairly fast but, again, my background in Comp Sci is really limited. Sorry if this question is a bit too general and thanks for any insight!
0
iphone,python,objective-c,c
2011-07-12T15:11:00.000
0
6,666,499
Well when i started progamming for Objective-c i was well known in Java, but nothing close to C/Objective-c. It took me around 1 month to learn the basics (using tutorials etc). There are some really good tutorials on iTunes (search for Objective-c seminar). I also used a couple of pdf's to use them as backup while making my first app. That helped alot!
0
5,620
false
0
1
Python to Objective C (Expected Learning Curve)
6,666,588
1
1
0
2
3
0
1.2
0
I am using to twill to do integration testing for an AppEngine (using tipfy micro framework) application but unfortunately twill is not maintained and I cannot test PUT and DELETE requests. Is there any similar solution? I am thinking of using PhantomJS, there are some python bindings and it can execute JS (as it is a headless webkit but I have not found much).
0
python,google-app-engine,integration-testing,tipfy,twill
2011-07-13T12:02:00.000
0
6,678,523
There are not many alternatives for headless JS testing, you could try selenium 2 web driver. Good luck :)
0
1,072
true
1
1
Twill alternative for integration testing
6,681,186
1
1
0
2
2
0
1.2
0
Im having some import problems with an application I developed in python with Eclipse/PyDev. Running the app from within Eclipse is no problem but when I try running it through the linux terminal the imports (which are imported from other folders (packages in Eclipse)) are broken and I get an ImportError: No module named xxx.. From previous experiences developing Java-apps in Eclipse I always solved this through exporting the project to a runnable jar-file but this isn't an option with Python. Is there a way of circumventing this? I'd rather not put all my .py-files in a single folder since I very much like the package-system (guess Java has damaged me). Can I change the import statement to make it work in both Eclipse and the terminal or do I have to abandon PyDev if I want this to work in the terminal? Thanks for any help! Slim
0
python,eclipse,terminal,pydev
2011-07-13T15:45:00.000
1
6,681,690
The key here is that PyDev and Eclipse manage a custom Python Path when you're launching within Eclipse. You can modify your environment variables to contain a more complete PYTHONPATH value that contains the locations where you're importing from, or you can use sys.path.append() to add directories to the path at run time so that the imports can be resolved.
0
408
true
1
1
Problem running PyDev-developed apps in terminal
6,681,756
1
3
0
0
4
1
0
0
Currently I have a "main" folder where all of the modules I write eventually go, but I usually place the modules I'm currently working on in a 'dev' folder just so I don't clutter up the other folder with stuff that aren't ready. The structure looks like this MyProg |-run.py |-\lib | |-someLibrary.py | ... | |-\main | |-readyScripts.py | ... | |-\dev |-inProgress.py Run.py will import scripts from the main folder. Scripts in the main folder use relative imports to import someLibrary from the lib folder, and it works fine. However, it doesn't work when I'm still writing my program in the dev folder and running it directly from there (ie: python inProgress.py), saying that I "attempted relative import in non-package" Is there a way to be able to import modules from the lib folder while I am working on scripts in dev? EDIT: this is my import statement in inProgress.py: from .lib import someLibrary Ideally, I would like to keep it this way so that when I move it to the main folder, I won't have to do anything to the import statement.
0
python,import
2011-07-13T17:40:00.000
0
6,683,165
Set your PYTHONPATH to one level up, and then run it with the package syntax?
0
2,770
false
0
1
Relative import from current file
6,683,207
1
1
0
1
0
0
1.2
0
Here is my scenario. I have a ajax call in my web site to find the elevation at particular point. Once this point comes into an action of a controller in Ruby on rails, I have to use python on command line to find the elevation. The following sequence of commands in DOS does that for me. python (starts a python session) import arcpy (takes a lot of time) function call (very fast). Now if I put this into a script and run it, I do get the result, but its very slow, because the 'import' step takes a lot of time. But the actual function takes less than a second. As all this is suppose to happen behind an Ajax call on ror web site, such a large delay is unacceptable. Question: Is it possible for me in Ror to open a 'command line session' when the application loads and issue the first two commands, and then use this session every time a request comes in a controller's action, and issue the third command, and return its output? If yes can someone please post some samples? Thanks Shaunak
0
python,ruby-on-rails,session,command-line,dos
2011-07-13T20:54:00.000
0
6,685,530
What you are proposing could be possible if Rails was friendlier about forked processes. A cleaner and better solution would be to write a python daemon that you could query so that you don't incur the startup penalty. (This could be a web-service or a daemon you communicate with standard network sockets or whatever).
0
95
true
1
1
issuing dos commands from inside ruby on rails controller in the same dos session
6,685,611
1
2
0
2
0
0
0.197375
0
Is there a way in a huge python file , you just see the function def you are interested in ? I remember Eclipse has an option to do this in Java and it was pretty helpful.How about for Python in PyDev/Aptana Studio 3?
0
python,eclipse,pydev,aptana,outline-view
2011-07-14T21:56:00.000
0
6,700,416
Look in Window > Preferences > PyDev > Editor > Code Folding. Enable Folding for Function Definitions. Then hit Ctrl-9 and Ctrl-0 to fold and unfold your code. Edit: You can also use Ctrl-- (minus) and Ctrl-= to fold and unfold single levels.
0
1,098
false
1
1
Show only python function def in PyDev Eclipse/Aptana
6,700,834
1
1
0
0
0
0
0
0
I have an application made in Django which finally uses Reportlab to generate the pdf file by accessing the data from some tables. There are some imports like: from rlextra.graphics.guiedit.datacharts import DataAwareDrawing, ODBCDataSource, DataAssociation from reportlab.graphics.charts.barcharts import VerticalBarChart3D from reportlab.graphics.shapes import _DrawingEditorMixin in my reportlab file. I am using Eclipse for generating the Django application. When I included the reportlab py file in the application, its showing errors that these imports can not be resolved. I included the rlextra and reportlab folders in the application by which the last 2 imports can be resolved by first one couldnt be. I went inside diving through the rlextra folder to find that,folder guidedit does not contain any folder datacharts by has a pyc file of that name. My eclipse is not understanding what does DataAwareDrawing, ODBCDataSource, DataAssociation mean. When I run the same reportlab py from outside eclipse separately as a python file it does the work properly. But Eclipse is not understanding what is required and from where to get it.
0
python,django,eclipse,eclipse-plugin,reportlab
2011-07-14T23:20:00.000
0
6,701,114
rlextra is a proprietary addition on top of ReportLab. You only get the .pyc files but not the source .py files when you receive the package. I do remember a packaging issue with datacharts.pyc on version 2.4 that was reported by a client and fixed on the day. If you contact ReportLab they will be more than happy to help you.
0
318
false
1
1
eclipse with reportlab
8,851,849
1
3
0
8
8
0
1
0
I retrieve a unix timestamp from a web service in a Python program. This timestamp is in a USA timezone. In order to insert it in a MySQL database with other objects, localized in France, I would like to convert this timestamp to the French timezone. I could do it with mathematical functions, but there is the issue of daylight savings time. I would prefer to use Python time and date specific functions which should deal with these concepts. Do you have a hint, I am lost in the Python documentation?
0
python,datetime,date,timezone
2011-07-15T12:16:00.000
0
6,706,808
If it's really a unix timestamp, then it's UTC based. Just interpret it correctly for your use case. Apply the timezone translation only when you have to print this date as text. If you're storing it as timestamp on your side too, keep it exactly as it is.
0
8,568
false
0
1
Changing a unix timestamp to a different timezone
6,706,828
1
1
0
2
1
0
0.379949
0
I have some python modules to copy into my Linux computer. I found out that I need to copy them into one of the directory that python searches or else show a new path for it. 1. when I tried to copy files into /usr/bin/..../python2.6 .. its not allowing me. how do I make it. 2. Also do tell me how do I add a new search path ? please guide me in detail. I have very less knowledge in linux Also please tell me how do I get over this kind of problems myself. Is there any small book or a kind of to learn?
0
python,linux,module,copy
2011-07-15T18:08:00.000
1
6,711,365
Make it a proper Python package on top of setuptools and register your command-line frontends using the 'console_scripts' entry-point.
0
1,248
false
0
1
how to copy python modules into python lib directory
6,711,450
1
1
0
1
0
0
1.2
1
I have a very simple CGI webserver running using python CGIHTTPServer class. This class spawns and executes a cgi-php script. If the webpage sends POST request, how can I access the POST request data in the php script?
0
php,python,cgi,webserver,cgihttprequesthandler
2011-07-15T19:16:00.000
0
6,712,092
When you say your Python process "spawns and executes" a cgi-php script, I believe what you mean is "it calls my PHP script by executing the PHP CLI executable, passing it the name of my script." Using the PHP CLI executable, HTTP-specific superglobals and environment values will not be set automatically. You would have to read in all HTTP request headers and GET/POST data in your Python server process, and then set them in the environment used by your PHP script. The whole experiment sounds interesting, but this is what mod_php does already.
0
1,199
true
0
1
Accessing POST request data from CGIHTTPServer (python)
6,712,146
1
1
0
2
1
1
1.2
0
I'm using Pydev with Eclipse on Mac. My python interpeter is macports python 2.6. Right now the python package i'm working on is in my eclipse workspace, but the only way I can get my scripts to run is if I first install it into the macports 2.6 python site_packages folder. This means each time I make a code change I have to uninstall it, and then re-install it for my python interpreter to pick up the change. How to I tell eclipse to tell python that {workspace}/mypythonporject should be part of the python path environment?
0
python,eclipse,macos
2011-07-15T20:31:00.000
1
6,712,824
Go to Window > Preferences > PyDev > Interpreter - Python. You should have an interpreter set up. If not, click New and browse to it. Under Libraries, click New Folder and browse to the directory you want to include. Click Apply, let it build, and try again. Edit: That is if you want to run the scripts THROUGH Eclipse. If you want to run them from, say, the command line, you'll need to add the path to your PYTHONPATH environment variable.
0
932
true
0
1
Eclipse pydev project PYTHONPATH with macports python 2.6
6,712,886
1
2
0
1
0
1
1.2
0
I want to add a feature to search documents stored in a directory. The back end is developed in Python to additionally manipulate the search results. The documents are stored in a dedicated web server. The established technologies (Lucene, Xapian, Whoosh) have mature python bindings. My colleagues have set up Apache, Lucene and PHP for their clients. I would choose Whoosh for being written in Python, but I am scared by reviews of its slow performance and lack of "feature X". My specific requirements are: Support (makes me bite my nails) well supported in Python tech support of major hosts can easily set it up scales well for upto 100000 documents updating the index for 4 new files shouldnt slow down our dedicated server Features (I am a newb here) returns data in a format which I can manipulate by myself can return highlighted text snippets higher priority for certain files and words in title or bold
0
python,full-text-search
2011-07-16T07:48:00.000
0
6,716,125
Solr, even though written in Java is an amazingly powerful search engine. It has everything you need like highlighting, weight, ability to insert new items in the index relatively fast, and also a whole slew of other features like ability to provide autocomplete-like features. It has json / xml / other response methonds, and a fairly good way in python to the search engine.
0
174
true
0
1
Best-suited text indexer for handling 10000s of (formatted) documents in python
6,720,127
1
1
0
1
0
1
1.2
0
I want to design an application that reads some a folder of text files and shows the user its contents. Three problems arise: I need the folder containing the text files to be encrypted which I don't know how to do, two, I need a way to read the encrypted files without revealing the key in the python code, so I guess C would be the best way to do that even if I don't like that way(any suggestions are welcome,using python if possible), and three, I need a way to add files to the folder and then send the encrypted folder along with the program. Is there any way to do those things without ever revealing the key or giving the user the possibility to read the folder except using my program? Thanks in advance for any help! EDIT: Also, is there a way to use C to encrypt and decrypt files so that I can put the key in the compiled file and distribute that with my program?
0
python,c,encryption,directory
2011-07-17T00:21:00.000
0
6,721,138
I think the best thing to do would be to encrypt the individual text files using GPG, one of the strongest encryption systems available(and for free!) You can get several python libraries to do this, and I recommend python-gnupg. Also, you can probably just reference the file where the key is located and distribute it along with the application? If you want to include a preset key and not have your users be able to see where that key is, you are going to have a very hard time. How about using a key on a server you control that somehow only accepts requests for the key from copies of your application? I don't know how you'd make this secure though through Python. About adding files to the folder and sending it along with the program, perhaps you aren't thinking of the most optimal solution? There are plenty of python data structures that can be serialized and accomplish most of the things you are talking about in your post.
0
870
true
0
1
How to use python to read an encrypted folder
6,721,220
1
3
0
1
0
0
0.066568
1
I'm looking for a way to write a XMPP bot that would listen to a RabbitMQ queue and send messages to the XMPP channel notifying users of any new issues ( already got Nagios sending notifications to RabbitMQ). I've tried using xmppy and it stopped working and I stumbled across SleekXMPP which looks fairly better. I'm just wondering if I define a AMQP listener to automatically call the XMPP "send" method in the bot. So it would be listening both on AMQP and XMPP at the same time. Thank you for your help! Edit: Would BOSH be much better solution here ?
0
python,xmpp,amqp
2011-07-17T11:40:00.000
0
6,723,588
This is really quite simple. I suggest that you start by writing an AMQP listener that simply prints out received messages. Once you get that working it should be obvious how to integrate that into an XMPP bot.
0
571
false
0
1
Interconnecting AMQP and XMPP
6,724,730
1
3
0
2
8
1
0.132549
0
I am a newb coder in a startup and I am implementing search of documents in a directory in a web host. I am comparing Lucene/Solr, Whoosh, Sphinx and Xapian. Whoosh is natively python. But I want your opinions on it too. Which of these have mature and easy to use and install interfaces with python? (Whoosh is a no-brainer) no chance for crashes, bottlenecks and other failures best documented interface (Im not reading PHP docs because python docs were sparse) easiest to get up and running (only one has a quick-start tutorial)
0
python,solr,full-text-search,sphinx,whoosh
2011-07-17T15:04:00.000
0
6,724,672
Use Whoosh if you don't need the speed, extra features of the alternatives. It's great, has a nice API, good documentation. My second choice would probably be Xapian, which is fast and has a fairly decent API. They are all fairly mature products. If you don't know what you really need, I'd just go with Whoosh for now.
0
2,946
false
0
1
Among Lucene/Solr, Whoosh, Sphinx, Xapian which integrates best with python?
6,724,817
1
2
0
1
1
0
1.2
1
I'm trying to get an xml report of the results of my behavior tests running in the lettuce framework. According the --help for lettuce, you should use the switch --with-xunit. I've done that (and also used --xunit-file) but no report is generated. I tried reinstalling lettuce but still no luck. How can I get it to generate this report?
0
python,lettuce
2011-07-18T21:49:00.000
0
6,739,856
This was actually something simple: the folder the tests were running in were owned by root so I needed to run the tests with sudo in order for it to generate the report.
0
2,043
true
0
1
Python lettuce test results in XML
6,884,086
1
7
0
3
52
1
0.085505
0
Apologies if this is straight forward, but I have not found any help in the python manual or google. I am trying to find the inverse cosine for a value using python. i.e. cos⁻¹(x) Does anyone know how to do this? Thanks
0
python,math,trigonometry
2011-07-19T10:05:00.000
0
6,745,464
You're looking for the math.acos() function.
0
117,730
false
0
1
Inverse Cosine in Python
6,745,509
1
4
0
0
1
0
0
0
My hard drive is full. What is the easiest way to find out the TOP 5 FOLDERS that consume the most disk space? A python solution would be greatly appreciated. I use Ubuntu Linux.
0
python
2011-07-19T14:26:00.000
1
6,748,791
You could just check the properties of each folder and look for the total size of the files in it. In Ubuntu, just right click on the folder, click properties and check the contents size. Not a python solution, but much easier (not everything needs a script to find the answer). The biggest folders will likely be the ones at the top of the tree.
0
475
false
0
1
Top 5 Folders Consuming The Most Space?
6,748,862
2
2
0
4
7
0
0.379949
0
Suppose that one is interested to write a python app where there should be communication between different processes. The communications will be done by sending strings and/or numpy arrays. What are the considerations to prefer OpenMPI vs. a tool like RabbitMQ?
0
python,messaging,mpi,rabbitmq,amqp
2011-07-20T03:18:00.000
0
6,756,630
This is exactly the scenario I was in a few months ago and I decided to use AMQP with RabbitMQ using topic exchanges, in addition to memcache for large objects. The AMQP messages are all strings, in JSON object format so that it is easy to add attributes to a message (like number of retries) and republish it. JSON objects are a subset of JSON that correspond to Python dicts. For instance {"recordid": "272727"} is a JSON object with one attribute. I could have just pickled a Python dict but that would have locked us into only using Python with the message queues. The large objects don't get routed by AMQP, instead they go into a memcache where they are available for another process to retrieve them. You could just as well use Redis or Tokyo Tyrant for this job. The idea is that we did not want short messages to get queued behind large objects. In the end, my Python processes ended up using both AMQP and ZeroMQ for two different aspects of the architecture. You may find that it makes sense to use both OpenMPI and AMQP but for different types of jobs. In my case, a supervisor process runs forever, starts a whole flock of worker who also run forever unless they die or hang, in which case the supervisor restarts them. The work constantly flows in as messages via AMQP, and each process handles just one step of the work, so that when we identify a bottleneck we can have multiple instances of the process, possibly on separate machines, to remove the bottleneck. In my case, I have 15 instances of one process, 4 of two others, and about 8 other single instances.
0
4,063
false
0
1
Python: OpenMPI Vs. RabbitMQ
6,757,194
2
2
0
13
7
0
1.2
0
Suppose that one is interested to write a python app where there should be communication between different processes. The communications will be done by sending strings and/or numpy arrays. What are the considerations to prefer OpenMPI vs. a tool like RabbitMQ?
0
python,messaging,mpi,rabbitmq,amqp
2011-07-20T03:18:00.000
0
6,756,630
There is no single correct answer to such question. It all depends on a big number of different factors. For example: What kind of communications do you have? Are you sending large packets or small packets, do you need good bandwidth or low latency? What kind of delivery guarantees do you need? OpenMPI can instantly deliver messages only to a running process, while different MQ solutions can queue messages and allow fancy producer-consumer configurations. What kind of network do you have? If you are running on the localhost, something like ZeroMQ would probably be the fastest. If you are running on the set of hosts, depends on the interconnections available. E.g. OpenMPI can utilize infiniband/mirynet links. What kind of processing are you doing? With MPI all processes are usually started at the same time, do the processing and terminate all at once.
0
4,063
true
0
1
Python: OpenMPI Vs. RabbitMQ
6,756,939
1
1
0
0
1
0
1.2
0
I have ported python3 csv module to C# what license could I use for my module? Should I distribute my module? Should I put PSF copyright in every header of my module? thanks
0
python,module,licensing
2011-07-20T11:33:00.000
0
6,761,201
You need to pay a copyright lawyer to tell you that. But my guess is that you need to use the PSF license. Note that PSF does not have the copyright to Python source code. They coders do how that copyright translates into you making a C# port is something only a copyright expert can say. Also note that it is likely to vary from country to country. Copyright sucks.
1
122
true
0
1
Ported python3 csv module to C# what license should I use for my module?
6,761,407
1
5
0
2
17
0
0.07983
0
How do I generate a unique ID value that can be easily passed on via phone or email, that can be easily remembered while still not being easily guessable. I am using database. But as I am giving away the ID to people I do not want it to be bound to a database. I could do something with the unique ID I already have in database, but cannot use it directly, to avoid it being guessable. I am using Python and have tried using uuid, but uuid is too long to be human readable. Is there any way to create a human friendly pronounceable ID?
0
python,random,unique,uniqueidentifier
2011-07-20T12:30:00.000
0
6,761,898
How about something like Amazon's payphrases? Convert the binary ID to a sequence of english words. If you want something with the same range as a UUID, you need to represent 16 bytes. To keep it reasonable, restrict the phrase to 4 words, so each word represents 4 bytes, or 65536 possibilities, so you'll need a dictionary of 262,144 words. EDIT: Actually on reflection what might be better is a sort of mad lib sentence - it will restrict the number of needed words and may make it easier to remember since it has a grammatical structure. It will need to be longer, of course, perhaps something like this: (a/an/the/#) (adj) (noun) (verb)(tense) (adverb) while (a/an/the/#) (adj) (noun) (verb) (adverb).
0
14,441
false
0
1
How to generate a human friendly unique ID in Python?
6,762,089
1
2
0
1
0
0
0.099668
0
I'm writing an application that connects to twitter and uses the OAuth API, my issue is with storing the consumer_key and the consumer_key_secret How can I safely store these values so they're difficult for the user to get to but still have ability to use them within my application? I've had storing them within a pyc and encrypting them as suggestions so far, but I'm open to any other ideas.
0
python,encryption,credentials
2011-07-21T02:12:00.000
0
6,770,610
An alternative to DRM (which is what you are describing) is to proxy the secured interaction through a server application on your own, controlled machine. Since you're using OAuth, you can use the same authentication credentials against your own server as you would connecting directly to twitter. The advantage to this approach is that there is no private key disclosure; you don't share your private key with your consumers, since that's stored on a remote server that they cannot read, and your consumers don't share their passwords with you (instead, they get an OAuth token which ties that particular login to your specific service).
0
167
false
0
1
A way to store sensitive data to disk, without (serious) fear of user tampering?
6,770,811
2
2
0
2
1
0
0.197375
0
Wanted to get some feedback on this implementation. I'm developing an application on the PC to send and receive data to the serial port. Some of the data received by the application will be solicited, while other data unsolicited. Controlling the serial port and processing messages would be handled by a Python application that would reside between the serial port and the MySQL database. This would be a threaded application with one thread handling sending/receiving using the Queue library and other threads handling logic and the database chores. They MySQL database would contain tables for storing data received from the serial port, as well as tables of outgoing commands that need to be sent to the serial port. A command sent out may or not be received, so some means of handling retries would be required. The webapp using HTML, PHP, and javascript would provide the UI. Users can query data and send commands to change parameters, etc. All commands sent out would be written into an outgoing table in the database and picked up by the python app. My question: Is this a reasonable implementation? Any ideas or thoughts would be appreciated. Thanks.
0
javascript,php,python,mysql,serial-port
2011-07-22T14:50:00.000
0
6,791,799
It seems there's a lot of places for things to go wrong. Why not just cut out PHP all together and use python? e.g. Use a python web framework & let your JavaScript communicate with that and while also reading the serial port and logging to MySQL. That's just me though. I'd try and cut out as many points where it could fail as possible and keep it super simple.
0
743
false
1
1
Controlling serial port through a webapp(PHP, javascript) using MySQL and Python
9,482,670
2
2
0
0
1
0
0
0
Wanted to get some feedback on this implementation. I'm developing an application on the PC to send and receive data to the serial port. Some of the data received by the application will be solicited, while other data unsolicited. Controlling the serial port and processing messages would be handled by a Python application that would reside between the serial port and the MySQL database. This would be a threaded application with one thread handling sending/receiving using the Queue library and other threads handling logic and the database chores. They MySQL database would contain tables for storing data received from the serial port, as well as tables of outgoing commands that need to be sent to the serial port. A command sent out may or not be received, so some means of handling retries would be required. The webapp using HTML, PHP, and javascript would provide the UI. Users can query data and send commands to change parameters, etc. All commands sent out would be written into an outgoing table in the database and picked up by the python app. My question: Is this a reasonable implementation? Any ideas or thoughts would be appreciated. Thanks.
0
javascript,php,python,mysql,serial-port
2011-07-22T14:50:00.000
0
6,791,799
You might also want to check out pySerial (http://pyserial.sourceforge.net/). You might also want to think about you sampling rates, i.e. how much data are you going to be generating and at what frequency. in other words how much data are you planning to store. Will give you some idea of system sizing.
0
743
false
1
1
Controlling serial port through a webapp(PHP, javascript) using MySQL and Python
10,899,487
1
2
0
0
1
0
0
0
Any ideas on connecting GitHub with a locally hosted Trac 0.12 instance? We were thinking of using GitHub's email service hook to shoot off an email anytime GitHub is pushed to, which would fire off a script to have our local repo pull from GitHub, and also tell Trac to re-sync the repo. Any ideas to improve on what we were thinking? If you need any more background info, let me know. Thanks!
0
python,git,github,trac
2011-07-22T17:56:00.000
0
6,794,100
We were trying to avoid opening a port on on our firewall, so we thought an email might be easier than using the post-receive url service hook. If we had a publicly hosted Trac instance, we would definitely go the rout of the post-receive url, but since we are hosted internally, this is not an option.
0
161
false
0
1
Trying to connect Trac 0.12 (privately hosted) with GitHub
6,808,464
2
2
0
2
0
0
1.2
0
I'm trying to figure out the best way to upload a file to a NodeJS(any server I guess, but just being specific) every 30 mins. I was thinking about using perl or python to acheive this, or even NodeJS or a CGI script? Would it be best to just create a multi-part form? Trying to figure out the best practice. Thanks.
0
python,perl,file-upload,node.js
2011-07-23T04:50:00.000
0
6,798,305
If this isn't part of other program logic, a simple curl --upload-file <file> <url> would do the job. If not, like Dan Grossman commented, any language capable of opening a socket and write HTTP headers and body would work (all assuming your node.js server is speaking http).
0
598
true
1
1
Upload file to NodeJS server every 30 minutes
6,798,369
2
2
0
1
0
0
0.099668
0
I'm trying to figure out the best way to upload a file to a NodeJS(any server I guess, but just being specific) every 30 mins. I was thinking about using perl or python to acheive this, or even NodeJS or a CGI script? Would it be best to just create a multi-part form? Trying to figure out the best practice. Thanks.
0
python,perl,file-upload,node.js
2011-07-23T04:50:00.000
0
6,798,305
I might recommend crontab for a job like this. It's a sort of job-scheduler for the operating system, and is designed for 'do this job every so often' tasks.
0
598
false
1
1
Upload file to NodeJS server every 30 minutes
6,798,370
2
2
0
0
8
0
0
0
Does anybody know how to distinguish new errors (those that were found during latest Pylint execution) and old errors (those that were alredy found during previous executions) in the Pylint report? I'm using Pylint in one of my projects, and the project is pretty big. Pylint reports pretty many errors (even though I disabled lots of them in the rcfile). While I fix these errors with time, it is also important to not introduce new ones. But Pylint HTML and "parseable" reports don't distinguish new errors from those that were identified previously, even though I run Pylint with persistent=yes option. As for now - I compare old and new reports manually. What would be really nice though, is if Pylint could highlight somehow those error messages which were found on a latest run, but were not found on a previous one. Is it possible to do so using Pylint or existing tools or something? Becuase if not - it seems I will end up writing my own comparison and report generation.
0
python,pylint
2011-07-23T17:35:00.000
0
6,802,119
Run pylint on dev branch, get x errors Run pylint on master branch, get y errors If y > x, which means you have new errors You can do above things in CI process, before code is merged to master
0
925
false
0
1
Pylint - distinguish new errors from old ones
64,587,242
2
2
0
4
8
0
1.2
0
Does anybody know how to distinguish new errors (those that were found during latest Pylint execution) and old errors (those that were alredy found during previous executions) in the Pylint report? I'm using Pylint in one of my projects, and the project is pretty big. Pylint reports pretty many errors (even though I disabled lots of them in the rcfile). While I fix these errors with time, it is also important to not introduce new ones. But Pylint HTML and "parseable" reports don't distinguish new errors from those that were identified previously, even though I run Pylint with persistent=yes option. As for now - I compare old and new reports manually. What would be really nice though, is if Pylint could highlight somehow those error messages which were found on a latest run, but were not found on a previous one. Is it possible to do so using Pylint or existing tools or something? Becuase if not - it seems I will end up writing my own comparison and report generation.
0
python,pylint
2011-07-23T17:35:00.000
0
6,802,119
Two basic approaches. Fix errors as they appear so that there will be no old ones. Or, if you have no intention of fixing certain types of lint errors, tell lint to stop reporting them. If you have a lot of files it would be a good idea to get a lint report for each file separately, commit the lint reports to revision control like svn, and then use the revision control systems diff utility to separate new lint errors from older pre-existing ones. The reason for seperate reports for each .py file is to make it easier to read the diff output. If you are on Linux, vim -d oldfile newfile is a nice way to read diff. If you are on Windows then just use the diff capability built into Tortoise SVN.
0
925
true
0
1
Pylint - distinguish new errors from old ones
6,805,524
2
3
0
0
0
0
0
0
I have a Pyramid web application that needs to send emails such as confirmation emails after registration, newsletters and so forth. I know how to send emails using smtplib in python and I decided on an smtp service (I think sendgrid will do the trick). The real problem is the scheduling and delay sending of the emails - for example, when a user registers, the email is to be sent on the form post view. But, I don't want to block the request, and therefore would like to "schedule" the email in a non-blocking way. Other than implementing this myself (probably with a DB and a worker), is there an existing solution to email queue and scheduling? Thanks!
0
python,email,queue,scheduling
2011-07-23T19:06:00.000
0
6,802,638
In my app, I insert emails in DB table, and I have python script running under cron that checks this table and sends email updating record as sent.
0
493
false
0
1
Best way to do email scheduling on a python web application?
6,806,145
2
3
0
0
0
0
0
0
I have a Pyramid web application that needs to send emails such as confirmation emails after registration, newsletters and so forth. I know how to send emails using smtplib in python and I decided on an smtp service (I think sendgrid will do the trick). The real problem is the scheduling and delay sending of the emails - for example, when a user registers, the email is to be sent on the form post view. But, I don't want to block the request, and therefore would like to "schedule" the email in a non-blocking way. Other than implementing this myself (probably with a DB and a worker), is there an existing solution to email queue and scheduling? Thanks!
0
python,email,queue,scheduling
2011-07-23T19:06:00.000
0
6,802,638
The existing solution to which you refer is to run your own SMTP server on the machine, bound only to localhost to prevent any other machines from connecting to it. Since you're the only one using it, submitting a message to it should be close to instantaneous, and the server will handle queuing, retries, etc. If you are running on a UNIX/Linux box, there's probably already such a server installed.
0
493
false
0
1
Best way to do email scheduling on a python web application?
6,802,910
1
2
0
3
3
1
0.291313
0
I am quoting a part of Python documentation: "A program doesn’t run any faster when it is read from a .pyc or .pyo file than when it is read from a .py file; the only thing that’s faster about .pyc or .pyo files is the speed with which they are loaded." I don't understand what does it mean when it says it doesn't affect the running time but the loading time? Could someone please explain it a little deep that I can understand completely?
0
python,time,module,loading
2011-07-23T20:31:00.000
0
6,803,126
When you import a module test.py, Python must read the source and convert it into the bytecode Python can execute. This takes time, but Python will store this in test.pyc. This Bytecode is the result of breaking your code down into simpler terms able to run directly on the CPython Virtual Machine. If you load test.pyc, Python doesn't need to compile your source into bytecode before running, so it takes slightly less time to start. If you import the module test.py twice without modifying it or deleting the generated test.pyc, Python checks for the existence of test.pyc and loads it instead - so the performance benefit is automatic.
0
365
false
0
1
Difference between loading time and running time in python?
6,803,141
1
4
0
1
2
1
0.049958
0
am working on a code which I would like to retrieve the commits from a repository on github. Am not entirely sure how to do such a thing, I got git-python but most the api's are for opening a local git repository on the same file system. Can someone advice? regards,
0
python,git
2011-07-24T10:30:00.000
0
6,806,266
I really advise using only the command line git, git-python its used for macros or complicated things, not just for pulling, pushing or cloning :)
0
10,402
false
0
1
git-python get commit feed from a repository
6,806,465
3
4
0
74
36
0
1.2
0
When it comes to the frontend code you always minify it (remove white spaces, comments etc) in production. Should one do the same with server code? I usually have a lot of comments in my server files. But I have never heard about people doing so. Wouldn't the server run faster if the code was optimized in the same way?
0
php,python,ruby,perl,node.js
2011-07-25T01:24:00.000
0
6,810,977
You're not going to have any improvement as the whitespaces and all formatting are lost when your server side code is translated to machine code (or interpreted). It's also not sent over the wire, it's read from the local filesystem, so while having less characters would lead to a faster startup, it would not make any difference on the long run and the startup speed gain would be marginal (or even unnoticeable). So, no, minifying your server side code is basically useless, worse, it's probably going to make stack traces completely useless, as there's going to be a lot of code in the same line (and not necessarily with the same formatting you used).
0
3,747
true
1
1
Should one minify server code when it's in production?
6,811,003
3
4
0
18
36
0
1
0
When it comes to the frontend code you always minify it (remove white spaces, comments etc) in production. Should one do the same with server code? I usually have a lot of comments in my server files. But I have never heard about people doing so. Wouldn't the server run faster if the code was optimized in the same way?
0
php,python,ruby,perl,node.js
2011-07-25T01:24:00.000
0
6,810,977
I think that minification has more to do with reducing bytes on the wire than it does runtime efficiency.
0
3,747
false
1
1
Should one minify server code when it's in production?
6,811,008
3
4
0
6
36
0
1
0
When it comes to the frontend code you always minify it (remove white spaces, comments etc) in production. Should one do the same with server code? I usually have a lot of comments in my server files. But I have never heard about people doing so. Wouldn't the server run faster if the code was optimized in the same way?
0
php,python,ruby,perl,node.js
2011-07-25T01:24:00.000
0
6,810,977
i do not believe this offers any benefit to server side code since the server evaluates the code and doesn't actually send it down. If you are looking to optimize production code you can look into setting up a compiler cache such as APC for PHP
0
3,747
false
1
1
Should one minify server code when it's in production?
6,811,024
1
3
0
2
8
0
0.132549
0
What I have is a bunch of PDFs (few 100s). They don't have a proper structure nor do they have particular fields. All they have is lot of text. What I am trying to do : Index the PDFs and search for some keywords against the index. I am interested in finding if that particular keyword is in the PDF doc and if it is, I want the line where the keyword is found. If I searched for 'Google' in a PDF doc that has that term, I would like to see 'Google is a great search engine' which is the line in the PDF. How I decided to do : Either use SOLR or Whoosh but SOLR is looking good for inbuilt PDF support. I prefer to code in Python and Sunburst is a wrapper on SOLR which I like. SOLR's sample/example project has some price comparision based schema file. Now I am not sure if I can use SOLR to answer my problem. What do you guys suggest? Any input is much appreciated.
0
python,pdf,indexing,solr
2011-07-25T22:00:00.000
0
6,822,884
I once solved this by converting the PDF files to text with utilities as pdftotext (pdftohtml would also work I guess), generating a 'cache' of some sorts. Then using some grep I searched the text file cache for keywords. This is slightly different from your proposed solution, but I can imagine you can call this from Python as well.
0
13,288
false
0
1
How do I Index PDF files and search for keywords?
6,827,387
1
4
0
3
66
1
0.148885
0
I've got a background in PHP, dotNet and am charmed by Python. I want to transpose functionality from PHP to Python step by step, running bits and pieces side-by-side. During this transition, which could take 2 years since the app is enormous, I am bound to IIS. I've got 15 years background of web-programming, including some C work in an ISAPI module on IIS which is the kind of work I don't want to dive into any more. It seems Python just doesn't run well on IIS. I've struggled with FastCGI (not supported, just for PHP) and PyIsapie (badly documented, couldn't get it up and running). In the end I got it up and running with a HeliconZoo dll BUT: My next problem is: how to debug/develop a site? In PHP you install a debugger and whenever you have a problem in your website, you just debug it, set a breakpoint, step through code, inspect watches and such. It seems to me this is the most rudimentary type of work for a developer or troubleshooter. I've bought WingIDE which is an excellent tool and debugger but it can't hook into the Python instance in the IIS process for some reason so no debugging. I noticed Helicon starts Python with -O so I even recompiled Python to ignore this flag altogether but my debugger (WingIDE) just won't come up. I can set up a PHP 'hello world' website on IIS in half an hour including download time. I think I've spent about 120 hours or more getting this to work for Python to no avail. I've bought Programming Python and Learning Python which is about 3000 pages. And I've googled until I dropped. I think Python is a great language but I'm on the verge of aborting my attempts. Is there anyone who can give me a step-by-step instruction on how to set this up on IIS7?
0
python,iis
2011-07-25T22:47:00.000
0
6,823,316
just make sure the path to the directory holding the cgi scripts doesn't have spaces or &. i tried lots of things for many days and nothing worked then i changed the path and it worked UPDATE: If it has spaces, put quotes around the path, but not the %s %s like this: "C:\Program Files\Python36\python.exe" %s %s
0
85,151
false
1
1
Python on IIS: how?
25,462,179
3
3
0
0
1
0
0
0
At work we are using Trac on several internal wiki's and an external wiki. REcently we found the need for a new plugin. After we going through a few tutorials we went to install a plugin to make sure it would work. It didn't. We've been going through trying to figure out. Below I will list the steps and various things I did while trying to get it to work. 1) I went to trac-hacks website and downloaded their hellow world plugin, figured I couldn't make a mistake using their code. 2) I compiled and made an egg using python setup.py bdist_egg on the machine where trac is installed, to make sure it's the same Python version being used. 3) I then copied it over to /directory/where/trac/is/plugins/ folder and chmod 755 the file egg file. 4) I then restarted http, unable to find a better way of restaring trac so this may be where my problem is. It didn't work. So I deleted the egg folder in plugins 5) Uploaded it via trac->administration->plugins and restarted httpd again. Nothing. 6) I realized I had to edit the trac.ini file and added helloworld.* = enabled under component and restarted the web server. It's quite possible it's me but any help would be greatly appreciated! Its the helloworld plugin from trachack, essentially displays hello world and theres a button. There are no error messages provided, hence why googling was hard. I'm assuming that it's using root and that's the user I built it with. I will look into seeing if it's anybody else, just taking a quick look though I don't see anything else that could be using it. I only copied the egg file to the plugins folder, I set up another folder elsewhere and built it and cp to the plugins folder. I'm glad to know I was doing that right because looking up documentation on how to restart trac turns up practically nothing, they just say restart trac or restart apache. I will look into the logs later on tomorrow. Thanks for the replies! Also we are using trac .12.1. So after looking at the log files it seems that it doesn't even load the plugin, can't find anywhere that says it's loading or any errors with it. Now we have a few trac sites for various projects and one of the sites already has plugins installed so I went there and and put the test plugin there and checked logs and it didn't work either. So I'm just going to conclude it's the plugin or something we already have in place and it's not me. I believe I'm going to try and make one and test it. Thanks for the help!
0
python,plugins,webserver,trac
2011-07-26T19:14:00.000
0
6,835,274
Quite an old thread, but since I ran into the same problem at one point: Make sure you build the .egg with the same Python version that you use to run Trac with!Backwards compatibility between Python versions does not matter here, because Trac reads information about the Python version out of the .egg file before it even loads it, to make sure it is compatible. (Small version numbers should not matter, so you should be able to run a .egg with Python 2.7.10 when it was built with 2.7.3, but not when it was built with 2.6.x. Look at the Version number that is written into the .egg file name.)
0
1,484
false
0
1
Trac Plugin Not working
33,694,758
3
3
0
0
1
0
0
0
At work we are using Trac on several internal wiki's and an external wiki. REcently we found the need for a new plugin. After we going through a few tutorials we went to install a plugin to make sure it would work. It didn't. We've been going through trying to figure out. Below I will list the steps and various things I did while trying to get it to work. 1) I went to trac-hacks website and downloaded their hellow world plugin, figured I couldn't make a mistake using their code. 2) I compiled and made an egg using python setup.py bdist_egg on the machine where trac is installed, to make sure it's the same Python version being used. 3) I then copied it over to /directory/where/trac/is/plugins/ folder and chmod 755 the file egg file. 4) I then restarted http, unable to find a better way of restaring trac so this may be where my problem is. It didn't work. So I deleted the egg folder in plugins 5) Uploaded it via trac->administration->plugins and restarted httpd again. Nothing. 6) I realized I had to edit the trac.ini file and added helloworld.* = enabled under component and restarted the web server. It's quite possible it's me but any help would be greatly appreciated! Its the helloworld plugin from trachack, essentially displays hello world and theres a button. There are no error messages provided, hence why googling was hard. I'm assuming that it's using root and that's the user I built it with. I will look into seeing if it's anybody else, just taking a quick look though I don't see anything else that could be using it. I only copied the egg file to the plugins folder, I set up another folder elsewhere and built it and cp to the plugins folder. I'm glad to know I was doing that right because looking up documentation on how to restart trac turns up practically nothing, they just say restart trac or restart apache. I will look into the logs later on tomorrow. Thanks for the replies! Also we are using trac .12.1. So after looking at the log files it seems that it doesn't even load the plugin, can't find anywhere that says it's loading or any errors with it. Now we have a few trac sites for various projects and one of the sites already has plugins installed so I went there and and put the test plugin there and checked logs and it didn't work either. So I'm just going to conclude it's the plugin or something we already have in place and it's not me. I believe I'm going to try and make one and test it. Thanks for the help!
0
python,plugins,webserver,trac
2011-07-26T19:14:00.000
0
6,835,274
Check the Trac version and downloaded plugin instead python setup.py bdist_egg try python setup.py install
0
1,484
false
0
1
Trac Plugin Not working
27,168,395
3
3
0
1
1
0
0.066568
0
At work we are using Trac on several internal wiki's and an external wiki. REcently we found the need for a new plugin. After we going through a few tutorials we went to install a plugin to make sure it would work. It didn't. We've been going through trying to figure out. Below I will list the steps and various things I did while trying to get it to work. 1) I went to trac-hacks website and downloaded their hellow world plugin, figured I couldn't make a mistake using their code. 2) I compiled and made an egg using python setup.py bdist_egg on the machine where trac is installed, to make sure it's the same Python version being used. 3) I then copied it over to /directory/where/trac/is/plugins/ folder and chmod 755 the file egg file. 4) I then restarted http, unable to find a better way of restaring trac so this may be where my problem is. It didn't work. So I deleted the egg folder in plugins 5) Uploaded it via trac->administration->plugins and restarted httpd again. Nothing. 6) I realized I had to edit the trac.ini file and added helloworld.* = enabled under component and restarted the web server. It's quite possible it's me but any help would be greatly appreciated! Its the helloworld plugin from trachack, essentially displays hello world and theres a button. There are no error messages provided, hence why googling was hard. I'm assuming that it's using root and that's the user I built it with. I will look into seeing if it's anybody else, just taking a quick look though I don't see anything else that could be using it. I only copied the egg file to the plugins folder, I set up another folder elsewhere and built it and cp to the plugins folder. I'm glad to know I was doing that right because looking up documentation on how to restart trac turns up practically nothing, they just say restart trac or restart apache. I will look into the logs later on tomorrow. Thanks for the replies! Also we are using trac .12.1. So after looking at the log files it seems that it doesn't even load the plugin, can't find anywhere that says it's loading or any errors with it. Now we have a few trac sites for various projects and one of the sites already has plugins installed so I went there and and put the test plugin there and checked logs and it didn't work either. So I'm just going to conclude it's the plugin or something we already have in place and it's not me. I believe I'm going to try and make one and test it. Thanks for the help!
0
python,plugins,webserver,trac
2011-07-26T19:14:00.000
0
6,835,274
It sounds like you built the egg correctly. After you copy it into your plugins folder, change the file's owner and group (I'm assuming you're on Linux since you mentioned chmod) to match the account that your webserver uses. I'm not sure if that's strictly necessary, but it's what's always worked for me. I may be misreading your #4, but it sounds like you copied the whole egg folder to your plugins directory. Only the .egg file needs to be copied over, it's a self-contained package. I don't think Trac looks for .egg files in subdirectories. Restarting your webserver is the easiest way to restart Trac. Actually, I'm not aware of any other way to do it. When it comes to plugin problems, Trac's log is usually a very good source of information. I recommend setting Trac's log level to DEBUG, then shut down the web server. Clear out the contents of Trac's log file, then start the web server and make a copy of Trac's log file after the server has completely come back online. Do this process twice: once with the plugin installed and once without it installed. The difference in the logfiles should give you a good indication of what the problem is. Once you get accustomed to what your logs normally look like, you'll be able to read the log in place without clearing it out and generating two versions of it. By the way, what Trac version are you using?
0
1,484
false
0
1
Trac Plugin Not working
6,848,819
1
4
0
1
7
0
0.049958
0
I am using a proprietary Matlab MEX file to import some simulation results in Matlab (no source code available of course!). The interface with Matlab is actually really simple, as there is a single function, returning a Matlab struct. I would like to know if there is any way to call this function in the MEX file directly from Python, without having to use Matlab? What I have in mind is for example using something like SWIG to import the C function into Python by providing a custom Matlab-wrapper around it... By the way, I know that with scipy.io.loadmat it is already possible to read Matlab binary *.mat data files, but I don't know if the data representation in a mat file is the same as the internal representation in Matlab (in which case it might be useful for the MEX wrapper). The idea would be of course to be able to use the function provided in the MEX with no Matlab installation present on the system. Thanks.
0
python,matlab,mex
2011-07-27T17:42:00.000
0
6,848,790
A mex function is an api that allows Matlab (i.e. a matlab program) to call a function written in c/c++. This function, in turn, can call Matlab own internal functions. As such, the mex function will be linked against Matlab libraries. Thus, to call a mex function directly from a Python program w/o Matlab libraries doesn't look possible (and doesn't makes sense for that matter). Of consideration is why was the mex function created in the first place? Was it to make some non-matlab c libraries (or c code) available to matlab users, or was it to hide some proprietery matlab-code while still making it available to matlab users? If its the first case, then you could request the owners of the mex function to provide it in a non-mex dynamic lib form that you can include in another c or python program. This should be easy if the mex function doesnt depend on Matlab internal functions. Others above have mentioned the matlab compiler... yes, you can include a mex function in a stand alone binary callable from unix (thus from python but as a unix call) if you use the Matlab Compiler to produce such binary. This would require the binary to be deployed along with Matlab's runtime environment. This is not quite the same as calling a function directly from python-- there are no return values for example.
1
7,858
false
0
1
Embed a function from a Matlab MEX file directly in Python
11,173,545
2
2
0
10
10
1
1
0
I have of late been learning Python, and am amazed by its superb runtime metaprogramming capabilities. Previously I came across the term 'runtime metaprogramming' was when I was reading about Smalltalk, which as far as I know boasts of best runtime metaprogramming capabilities. How well does Python stack up against Smalltalk w.r.t. metaprogramming? What are the notable differences between the approaches taken by two languages?
0
python,oop,programming-languages,metaprogramming,smalltalk
2011-07-27T22:52:00.000
0
6,852,189
Posted as an answer at questioner's request. One of the big ideas of Smalltalk is orthogonality. Frankly Python suffers in this respect. Not everything works on everything. Examples: inspect.getargspec() does not work on built-in functions or the results of calls to functools.partial (in the C interpreter anyway). eval only works for expression strings, and exec only works for statement strings. Lambda expressions cannot be pickled. myclass = type('x', (object,), {'__init__': partial(foo, value)}) produces a class that can't be instantiated, whereas passing an equivalent lambda expression instead of a partial works fine. (Though this may just be a bug not a feature.) Maybe PyPy doesn't have these problems, I'm not sure. But I do love Python very much and find it very convenient to use metaclasses, currying and the occasional descriptor in real applications.
0
1,442
false
0
1
Python and Smalltalk - Metaprogramming capabilities comparison
6,864,488
2
2
0
12
10
1
1.2
0
I have of late been learning Python, and am amazed by its superb runtime metaprogramming capabilities. Previously I came across the term 'runtime metaprogramming' was when I was reading about Smalltalk, which as far as I know boasts of best runtime metaprogramming capabilities. How well does Python stack up against Smalltalk w.r.t. metaprogramming? What are the notable differences between the approaches taken by two languages?
0
python,oop,programming-languages,metaprogramming,smalltalk
2011-07-27T22:52:00.000
0
6,852,189
Python actually holds up fairly well here. Smalltalk usually doesn't make explicit distinction between program and metaprogramm, but Python is more explicit - eg, the special syntax for decorators or the __foo__() naming convention for metaprogramming hooks. This is a good thing. On the other hand, it's a bit of an apples-to-oranges comparison. Smalltalk is a smaller, tighter language than Python, and so there's just less material to manipulate with metaprograms. For example, consider __getattr__(). This is a hook that lets Python objects provide a custom implementation of attribute access. Smalltalk doesn't have anything like this. But! Smalltalk enforces tighter encapsulation of an object's internal state, and there's no equivalent of the object.attribute syntax that's used in Python. So reading an object's state requires going through a method... which is exactly what __getattr__() provides. So for a lot of cases where you'd use __getattr__() in Python, you'd just write a normal method in Smalltalk - no metaprogramming needed. And it's like that all over the place: Python's __getitem__() and friends make it possible to write classes that mimic lists or dictionaries. Smalltalk doesn't need that because Array and Dictionary are just regular Smalltalk classes and there's no special syntax for using them. Python __eq__() and so on enable operator overloading. Smalltalk doesn't have operators, so you can implement + without doing anything special. Python's contextlib provides some nifty tools for implementing your own context managers. Smalltalk doesn't have a with construct, but it does have really lightweight syntax for lambdas, which lets you do the same sort of thing in a straightforward way. Smalltalk's metaprogramming facilities tend to be pretty low-level. You can, for example, create your own CompiledMethod instances, and stick them into a class's method dictionary. You can also write your own compiler and specify that all the methods of a particular class be compiled with it. That enables all sorts of things - I've seen projects that experiment with alternate syntaxes, instrument bytecode for profiling, trap reads and writes to instance variables for transparent persistence, and so on. Smalltalk's metaprogramming facilities are powerful, but they're not as neatly organized as Python's, and don't get used as often.
0
1,442
true
0
1
Python and Smalltalk - Metaprogramming capabilities comparison
6,853,978
1
3
0
3
0
0
0.197375
0
I was reading through Facebook's hiring now job listings and I saw this... * Competency in Shell, PHP, Perl or Python. C is a plus This sparked a question in my mind, is it possible to use (for example) python and PHP together? As in... I write a function in PHP to read a MySQL database and cut the data read into raw string form. I then use python to use this PHP function to perform operations on this data. The part where I say "use python to use this PHP function" is this possible? If so, how? (a small code example would be awesome)
0
php,python,perl
2011-07-28T00:49:00.000
0
6,852,990
First, Facebook is a large company. They have many different software projects, apart from the site itself, and some of them are probably written in languages different from the company's mainstream. Second, teaching a good $lang1 programmer $lang2's syntax takes two weeks, while teaching a bad $lang2 programmer how to program takes life.
0
406
false
0
1
Python PHP and Perl being used together?
6,854,713
1
3
0
9
116
1
1
0
Can anyone explain the use of Python's setUp and tearDown methods while writing test cases apart from that setUp is called immediately before calling the test method and tearDown is called immediately after it has been called?
0
python,unit-testing,python-unittest
2011-07-28T05:59:00.000
0
6,854,658
Suppose you have a suite with 10 tests. 8 of the tests share the same setup/teardown code. The other 2 don't. setup and teardown give you a nice way to refactor those 8 tests. Now what do you do with the other 2 tests? You'd move them to another testcase/suite. So using setup and teardown also helps give a natural way to break the tests into cases/suites
0
128,148
false
0
1
Explain the "setUp" and "tearDown" Python methods used in test cases
6,854,720
1
2
1
2
1
0
0.197375
0
I have a USB camera (uEye) which has a C++ interface allowing you to configure some features of the camera. The C++ program can read the image data from the camera and store it somewhere in pre-allocated memory. All of this runs under Windows. Python with numpy gives me a simple environment to manipulate images and spend some quality time working on my processing algorithms. What I would like to do is: Use the c++ program to configure the camera and obtain images (at video rate), Pass the data to Python Process the data in Python I am under the impression that I do not want to embed C++ in Python or Python in C++, as I prefer to have two stand-alone systems (so I can use the camera without the Python stuff, or use the Python stuff without the camera). What I can find so far are methods to share some data using pipes, sockets, or mapped memory, though it appears to be restricted to small amounts of data or strings. What I can not find, however, is an indication if this is fast enough and something that I should attempt to implement. Should I want to do this? If this is a bad idea, what would be a better alternative? Embed the Python code in C++ or vice versa? Or ditch Python all together because the savings in development time there do not offset the additional effort in getting the interprocess communication to work?
0
c++,python,windows,ipc
2011-07-29T10:08:00.000
0
6,871,537
Since you say the device has a "C++ interface", I assume it provides a header file + DLL which you can link to and control the device via an API. In such a case, the fastest approach would be to wrap this API in Python (using Swig or other C++-to-Python API tools). This will provide a very low overhead of just a couple of procedure calls, passing the data directly as pointers to memory. If you don't want to "marry" Python, write yourself a controlling app in C++ too, but I think the fastest and most convenient way of connecting the API to Python is the above.
0
1,214
false
0
1
Share video data between C++ and Python
6,872,320
1
1
0
0
0
0
1.2
0
I am wondering what modules or methods I should use to control a File Upload box from Python. I want Python to take control of this box when it pops up, and automatically navigate to a specific folder/file and select this file.
0
python
2011-07-29T19:48:00.000
0
6,878,273
I used the SendKeys module, which allows you to send keystrokes to Windows. Not perfect, but it works in the meantime.
0
175
true
0
1
Controlling a File Upload Box with Python
6,892,524
2
2
0
0
0
0
0
0
I am getting a 500 : Internal error, the payload of the POST is definately right, one thing I noticed is the Content-Type is not "sticking" using b.addheaders = [('Content-Type',"text-x-gwt-rpc")] -- and I'm not sure why. Does anyone have quick/dirty code used to access a GWT RPC (i.e. emulate the GWT client) in Python using mechanize. Browser?
0
python,gwt,gwt-rpc
2011-07-29T23:59:00.000
0
6,880,142
The answer to the question is GWT requires the content-type to be x-gwt-rpc; rather than 'application/x-www-form-urlencoded'; which is hard coded in _http.py in the mechanize library. Quick and dirty hack is to change this to text/x-gwt-rpc; charset=UTF-8 -- I'm sure this could be done better by subclassing AbstractHTTPHandler; maybe someone else could contribute a quick way to do that.
0
425
false
1
1
Calling a GWT RPC function from Python-mechanize
6,883,832
2
2
0
0
0
0
0
0
I am getting a 500 : Internal error, the payload of the POST is definately right, one thing I noticed is the Content-Type is not "sticking" using b.addheaders = [('Content-Type',"text-x-gwt-rpc")] -- and I'm not sure why. Does anyone have quick/dirty code used to access a GWT RPC (i.e. emulate the GWT client) in Python using mechanize. Browser?
0
python,gwt,gwt-rpc
2011-07-29T23:59:00.000
0
6,880,142
Do not use GWT-RPC from non-GWT solutions, the format is internal and subject to change without notice. Consider RESTifying the app (or use SOAP and reuse the existing code of the methods, but care needs to be given to the interface definitions).
0
425
false
1
1
Calling a GWT RPC function from Python-mechanize
6,880,354
1
2
1
1
2
0
1.2
0
I am trying to get a Python script which I normally run on my PC to run on my Android phone (HTC Hero). I have SL4A running on my phone and have made a few tweaks to the Python script so that this does now run. The problem that I am having is how to pass parameters to the script. I have tried creating a sh script in SL4A which called the python file with the parameters, but this didn't work. I have also tried using the app TaskBomb to call through to the python file, but again this doesn't work when parameters are supplied. When no params are supplied the file loads correctly, but when I add -h to the filename it says it can no longer find the python file I am calling. Is anybody able to provide assistance with how to this?
0
android,python,sl4a
2011-07-30T09:17:00.000
0
6,882,218
I used a round about method to circumvent the problem. First the python script needs to be modified to look for a text file containing the attributes. Now whenever I need to start the script, i have to push the txt file containing the attributes and then start the script.
0
2,086
true
1
1
Passing parameters to a python script using SL4A on Android
10,452,996
1
2
0
0
0
0
0
0
I was thinking of rewriting my custom PHP app on a framework... mainly for the solidity and more ease of growth going forward. Right now its a pseudo MVC setup with lots of hacks in between. I already have the db built out and the app uses a lot of AJAX too. I am not concerned with the amount of work involved as the solidity of the platform I move things to. Server configurations are no worries. I am also looking to increase performance all around. My friend (and Python enthusiast) told me things of python rendering tabular type data at almost 40% increase over PHP and speed is definitely a decision maker in this. Taking out the fact that there would be significantly less work moving to a PHP based framework since the app is PHP already which would be the best fit? I know there are a lot of PHP vs Python stories out there. Python seems to be the clear winner, but how easy is it to use with standard web stuff like AJAX? I just want to know who would use which and why vs the other.
0
php,python,django
2011-07-31T00:05:00.000
0
6,886,699
Which language do you prefer? That's all that really matters. Both have solid frameworks and similar performance. If you want to increase performance, writing more efficient code is going to make a way bigger difference. Personally, I like python. Django is great, but you might also consider Flask or Pyramid/Pylons. Ajax is just as easy with python as it is with PHP--it's only a request. The server configuration is definitely harder--it doesn't get any easier than PHP--but it's not that hard, and you said you didn't mind it. If you like both languages equally, give python a shot.
0
259
false
1
1
Rewriting A Custom PHP App on a framework. Torn between Python (Django) and PHP (CodeIgniter)
6,886,763
1
1
0
3
1
1
0.53705
0
I am curious about the complexity of Python and JS 's looking up: Python supports multi-inheritance, which affects the member lookup. Specifically, when referencing a member from an instance of a class, the process will start from the instance's dict, then to the class of the instance, then up to the super classes of the class of the instance, which for each super class, it has its own super class list..... which seems to end up with the complexity to be exponential (theoretically). While it seems that the JS's member lookup time is linear -- which just has to trace back to the prototype chain. Am I reasoning the right way? or I am missing something?
0
javascript,python
2011-07-31T08:22:00.000
0
6,888,332
You're missing the fact that MI is very, very rarely used in Python, usually only for mixins where the inheritance chain tends to be very short anyways.
0
121
false
0
1
The complexity of member looking up: Python Vs. Javascript
6,888,348
1
4
1
2
0
0
0.099668
0
I'm looking for solutions that make it possible to create AJAX-enabled web applications without need to write JavaScript code manually. The requirements are: Performance doesn't matter. It can be slow, JavaScript may be unoptimized, amount of code it generates may be large. Platform doesn't matter as long as I can work with it on either Linux or Windows. Language doesn't matter as long as it's Python, Java or C#. I want to be able to create composite 'widgets' that can be updated dynamically using AJAX. For instance, I want to be able to load data dynamically and replace existing controls with the other ones when user clicks the button on that page. As long as this solution provides concepts like 'Panel' (composite widget), 'EditBox' and 'Label', I don't care if it's hard to create my own controls. What do you think?
0
c#,java,javascript,python
2011-07-31T10:20:00.000
0
6,888,856
I'd recommend you GWT from Google. It is great, well done framework that allows creating Web 2.0 applications without dealing with HTML/JavaScript at all.
0
217
false
1
1
AJAX web applications with no hand-written JavaScript
6,888,882
1
1
0
5
15
0
0.761594
0
I work for a webhost and my job is to find and cleanup hacked accounts. The way I find a good 90% of shells\malware\injections is to look for files that are "out of place." For example, eval(base64_decode(.......)), where "....." is a whole bunch of base64'ed text that is usually never good. Odd looking files jump out at me as I grep through files for key strings. If these files jump out at me as a human I'm sure I can build some kind of profiler in python to look for things that are "out of place" statistically and flag them for manual review. To start off I thought I can compare the length of lines in php files containing key strings (eval, base64_decode, exec, gunzip, gzinflate, fwrite, preg_replace, etc.) and look for lines that deviate from the average by 2 standard deviations. The line length varies widely and I'm not sure if this would be a good statistic to use. Another approach would be to assign weighted rules to cretin things (line length over or under threshold = X points, contains the word upload = Y points) but I'm not sure what I can actually do with the scores or how to score the each attribute. My statistics is a little rusty. Could anyone point me in the right direction (guides, tutorials, libraries) for statistical profiling?
0
python,machine-learning,statistics,intrusion-detection
2011-07-31T21:32:00.000
0
6,892,449
Here's a simple machine learning approach to the problem, and is what I'd do to get started on this problem and develop a baseline classifier: Build up a corpus of scripts and attach a label either 'good' (label= 0) or 'bad' (label = 1) the more the better. Try to ensure that the 'bad' scripts are a reasonable fraction of the total corpus,50-50 good/bad is ideal. Develop binary features that indicate suspicious or bad scripts. For example, the presence of 'eval', the presence of 'base64_decode'.Be as comprehensive as you can be and don't be afraid of including afeature that might capture some 'good' scripts too. One way to help to do this might be to calculate the frequency counts of words in the two classes of script and select as features words that appear prominently in 'bad' but less prominently in 'good'. Run the feature generator over the corpus and build up a binary matrix of features with labels. Split the corpus into train (80% of examples) and test sets (20%). Using the scikit learn library, train a few different classification algorithms (random forests, support vector machines, naive bayes etc) with the training set and test their performance on the unseen test set. Hopefully I have a reasonable classification accuracy to benchmark against. I'd then look at improving the features, some unsupervised methods (without labels) and more specialised algorithms to get better performance. For resources, Andrew Ng's Coursera course on Machine Learning (which includes example spam classification, I believe) is a good start.
0
3,832
false
0
1
Anomaly detection using Python
17,491,843
1
1
0
2
0
0
1.2
0
i want to create a django project using ssh, my host give me some options when i enable ssh, i'm allowed to use bash, zsh, ksh, csh,fish and tcsh, I'm familiar with bash but not with the rest so which is better for django? which is the closest to python? or are they all the same when it comes to application development?
0
python,django,bash,ssh
2011-07-31T22:16:00.000
0
6,892,686
The chosen UNIX shell does not matter for the Python development. AFAIK the only shell specific part in Python development, which is currently being widely used, is virtualenv and it should work with sh compatible shells.
0
342
true
1
1
run django from ssh
6,898,424
1
1
0
4
2
1
0.664037
0
I know that this question will recieve some fairly strong comments but I'm going to post it anyway. I'm working on a project in Python. My simple reasons for choosing Python are the available librtaries and it is cross platform and open source. My problem is that I really enjoy coding with the very verbose, descriptive method names of Objective C. The type of functions that I have to write can have fairly complex arguments and I find that with the Objective C approach I'm not having to constantly refer back to other pieces of dicumentation to make sure I'm using the right arguments with the right functions. Is there any way of using the Objective C style for calling functions with Python? I am aware this probably doesn't suit recommended coding styles for Python, but it does suit what I am doing right now so I'd like to try and find a way of doing it if possible.
0
python,objective-c,coding-style
2011-08-01T09:36:00.000
0
6,896,565
If you mean, "can I write the call with square brackets instead of round ones and put them around the object and method names instead of after and omit the commas", then no. If you mean "can I make verbose, descriptive method names", then of course you can; you can do that in any language worth mentioning. I think what you really mean is "can I use keyword arguments as in [myObject frobnicateWithHax:42 Foo:23 Bar:69]?". Yes; in Python, this is spelled myObject.frobnicateWith(hax=42, foo=23, bar=69). On the function-definition side, there are a number of ways to make it work, depending on exactly what you want; see the documentation (or a good reference or tutorial) for default arguments and kwargs. Honestly, Google answers this kind of question better than SO, once you know a little bit about what these kinds of language features are called.
0
142
false
0
1
Using Objective C function call styles in Python
6,896,630
3
3
0
1
2
1
0.066568
0
I know similar questions to this have been asked before, but I'm looking for a more specific answer so here it goes: I'm a student and am looking to develop a web app. I have little experience with all mentioned and like different aspects of each. I like the Visual Web Dev that can be used to create ASP.NET sites, a aspect that isn't there for PHP or Python.. I'm also looking to learn and develop with the language that will be most beneficial for uni, and work in the future - the language that is used and respected most in industry. I've heard mixed views about this. Because I'd want to know the language that is most used, most in demand, and has the longest future. I'd also like the ability to make things fast, they all come with frameworks.. But would it be better me learning things from scratch and understanding how it works that use a framework? Which language has the most frameworks and support? I see that a lot of industries (the ones I've looked at) use ASP.NET. But it seems (remember no real experience) to be easier (especially as a GUI can be used) so does that make it less valuable. Basically - which language do you think would be best for me based on this? WHich would you recommend based on the advantages and disadvantages of each and ease of fast efficient and powerful development? Thanks
0
php,asp.net,python,django
2011-08-01T10:10:00.000
0
6,896,942
python has a ui like vb, it's called pygtk (pygtk.org), i suggest you learn python, it's the easiest to learn, and you don't have to write as much as you would in .net php is powerful, and you have to learn it, you just have to, but for big complicated web apps, I rather choose ruby on rails or even better django which is the best? "the best" is just an opinion, asp.net developers think that it's the best and i think that python is the best, it's an argument that will never end
0
3,202
false
1
1
Python + Django vs. ASP.NET + C#/VB vs PHP?
6,899,782
3
3
0
1
2
1
1.2
0
I know similar questions to this have been asked before, but I'm looking for a more specific answer so here it goes: I'm a student and am looking to develop a web app. I have little experience with all mentioned and like different aspects of each. I like the Visual Web Dev that can be used to create ASP.NET sites, a aspect that isn't there for PHP or Python.. I'm also looking to learn and develop with the language that will be most beneficial for uni, and work in the future - the language that is used and respected most in industry. I've heard mixed views about this. Because I'd want to know the language that is most used, most in demand, and has the longest future. I'd also like the ability to make things fast, they all come with frameworks.. But would it be better me learning things from scratch and understanding how it works that use a framework? Which language has the most frameworks and support? I see that a lot of industries (the ones I've looked at) use ASP.NET. But it seems (remember no real experience) to be easier (especially as a GUI can be used) so does that make it less valuable. Basically - which language do you think would be best for me based on this? WHich would you recommend based on the advantages and disadvantages of each and ease of fast efficient and powerful development? Thanks
0
php,asp.net,python,django
2011-08-01T10:10:00.000
0
6,896,942
This question is really too open ended. there is no one true language, otherwise we'd all be using it. As you've seen they all have merit. You didn't mention Java which still holds a lot of clout in enterprise computing. The only answer is pick one you like and get good at it. You can spends years wishing you'd picked one of the others. Also, if you get good at one & have a firm understanding of the basics, at a later date you'll find it easy (ish) to pick up another one. For what it's worth. my money's on .net. But that's just me. Simon
0
3,202
true
1
1
Python + Django vs. ASP.NET + C#/VB vs PHP?
6,899,152
3
3
0
0
2
1
0
0
I know similar questions to this have been asked before, but I'm looking for a more specific answer so here it goes: I'm a student and am looking to develop a web app. I have little experience with all mentioned and like different aspects of each. I like the Visual Web Dev that can be used to create ASP.NET sites, a aspect that isn't there for PHP or Python.. I'm also looking to learn and develop with the language that will be most beneficial for uni, and work in the future - the language that is used and respected most in industry. I've heard mixed views about this. Because I'd want to know the language that is most used, most in demand, and has the longest future. I'd also like the ability to make things fast, they all come with frameworks.. But would it be better me learning things from scratch and understanding how it works that use a framework? Which language has the most frameworks and support? I see that a lot of industries (the ones I've looked at) use ASP.NET. But it seems (remember no real experience) to be easier (especially as a GUI can be used) so does that make it less valuable. Basically - which language do you think would be best for me based on this? WHich would you recommend based on the advantages and disadvantages of each and ease of fast efficient and powerful development? Thanks
0
php,asp.net,python,django
2011-08-01T10:10:00.000
0
6,896,942
I would recomend looking at asp.net mvc and scaffolding. That way you can create good applications quick and effective.
0
3,202
false
1
1
Python + Django vs. ASP.NET + C#/VB vs PHP?
6,897,150