Q_Id
int64
337
49.3M
CreationDate
stringlengths
23
23
Users Score
int64
-42
1.15k
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
Tags
stringlengths
6
105
A_Id
int64
518
72.5M
AnswerCount
int64
1
64
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
6
11.6k
Available Count
int64
1
31
Q_Score
int64
0
6.79k
Data Science and Machine Learning
int64
0
1
Question
stringlengths
15
29k
Title
stringlengths
11
150
Score
float64
-1
1.2
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
8
6.81M
974,741
2009-06-10T10:18:00.000
1
0
0
0
python,urllib2,wget
974,809
10
false
1
0
Maybe you can wget and then inspect the data in Python?
5
9
0
I have a task to download Gbs of data from a website. The data is in form of .gz files, each file being 45mb in size. The easy way to get the files is use "wget -r -np -A files url". This will donwload data in a recursive format and mirrors the website. The donwload rate is very high 4mb/sec. But, just to play around I...
wget Vs urlretrieve of python
0.019997
0
1
37,225
974,821
2009-06-10T10:42:00.000
1
0
1
0
python,windows,django-admin
974,834
4
false
1
0
you can't run a command that isn't in your path. it should be set globally when you installed python. type 'set' at a dos prompt and look at the PATH variable. c:\python25 (or whever you installed python) has to be in that variable ie PATH=c:\windows;c:\python25;... etc if it isn't in PATH then you or the installer mi...
3
0
0
I have installed python and django in my system that uses win vista. Now when I go to command prompt and type python or django-admin.py both are not working. Every time I need to set the path to the python folder manually. But i have seen these commands running even without setting path. So how do i make it to run pro...
python not starting properly
0.049958
0
0
139
974,821
2009-06-10T10:42:00.000
0
0
1
0
python,windows,django-admin
974,848
4
true
1
0
Either use the system control panel to set the PATH environment variable that applies permanently or Reinstall Python as a system administrator so that the installer can set the registry and environment variables for you. If you install the "just for me" option, then you have to set the PATH variable in the control pan...
3
0
0
I have installed python and django in my system that uses win vista. Now when I go to command prompt and type python or django-admin.py both are not working. Every time I need to set the path to the python folder manually. But i have seen these commands running even without setting path. So how do i make it to run pro...
python not starting properly
1.2
0
0
139
974,821
2009-06-10T10:42:00.000
0
0
1
0
python,windows,django-admin
975,292
4
false
1
0
In your path, I think you need to have both the location of the Python install and the Python\Scripts folder. For example, on XP, I have C:\Python25;C:\Python25\Scripts. Can you verify that you have both?
3
0
0
I have installed python and django in my system that uses win vista. Now when I go to command prompt and type python or django-admin.py both are not working. Every time I need to set the path to the python folder manually. But i have seen these commands running even without setting path. So how do i make it to run pro...
python not starting properly
0
0
0
139
976,506
2009-06-10T15:54:00.000
1
0
1
0
python,eclipse,ubuntu,interpreter
1,393,294
2
false
0
0
I had a similar problems with this on Mac OS X. My problem was that I had a space in Eclipse's application path, e.g. "/Applications/eclipse 3.3/Eclipse". I changed the folder name to "/Applications/eclipse3.3" and it fixed it.
2
1
0
When trying to set the interpreter for python in Eclipse by choosing the executable, clicking OK displays "An error has occured." Does the interpreter name matter?
Problem with Python interpreter in Eclipse
0.099668
0
0
1,391
976,506
2009-06-10T15:54:00.000
0
0
1
0
python,eclipse,ubuntu,interpreter
983,463
2
false
0
0
Testing/running your apps on the command line is the safest bet, especially when writing threaded applications (you can kill your threadlocked program without killing eclipse)
2
1
0
When trying to set the interpreter for python in Eclipse by choosing the executable, clicking OK displays "An error has occured." Does the interpreter name matter?
Problem with Python interpreter in Eclipse
0
0
0
1,391
976,639
2009-06-10T16:13:00.000
1
0
0
1
java,python,google-app-engine,data-modeling
979,391
4
false
1
0
The non relational database design essentially involves denormalization wherever possible. Example: Since the BigTable doesnt provide enough aggregation features, the sum(cash) option that would be in the RDBMS world is not available. Instead it would have to be stored on the model and the model save method must be ove...
2
6
0
I'm looking for resources to help migrate my design skills from traditional RDBMS data store over to AppEngine DataStore (ie: 'Soft Schema' style). I've seen several presentations and all touch on the the overarching themes and some specific techniques. I'm wondering if there's a place we could pool knowledge from exp...
Thinking in AppEngine
0.049958
1
0
1,022
976,639
2009-06-10T16:13:00.000
1
0
0
1
java,python,google-app-engine,data-modeling
978,757
4
false
1
0
The timeouts are tight and performance was ok but not great, so I found myself using extra space to save time; for example I had a many-to-many relationship between trading cards and players, so I duplicated the information of who owns what: Card objects have a list of Players and Player objects have a list of Cards. N...
2
6
0
I'm looking for resources to help migrate my design skills from traditional RDBMS data store over to AppEngine DataStore (ie: 'Soft Schema' style). I've seen several presentations and all touch on the the overarching themes and some specific techniques. I'm wondering if there's a place we could pool knowledge from exp...
Thinking in AppEngine
0.049958
1
0
1,022
976,796
2009-06-10T16:40:00.000
0
0
1
1
python,windows,python-2.5
978,669
4
false
0
0
Run Cygwin Python if windowisms are bothering you... Unless what you are doing depends on pywin32 that is.
2
7
0
I'm used to ending the python interactive interpreter using Ctrl-d using Linux and OS X. On windows though, you have to use CTRL+Z and then enter. Is there any way to use CTRL+D?
Can I make Python 2.5 exit on ctrl-D in Windows instead of ctrl-Z?
0
0
0
5,212
976,796
2009-06-10T16:40:00.000
0
0
1
1
python,windows,python-2.5
977,031
4
false
0
0
You can change the key set that Idle should be using. Under Options->"Configure IDLE..." go to the "Keys" tab. On the right you can select the "IDLE Classic Unix" key set.
2
7
0
I'm used to ending the python interactive interpreter using Ctrl-d using Linux and OS X. On windows though, you have to use CTRL+Z and then enter. Is there any way to use CTRL+D?
Can I make Python 2.5 exit on ctrl-D in Windows instead of ctrl-Z?
0
0
0
5,212
977,404
2009-06-10T18:33:00.000
13
1
1
0
c++,python
977,443
13
false
0
1
I've heard these complaints before about C++, but the fact is, programming in any language with which you are unfamiliar is time consuming. A good C++ programmer can probably crank out the app much faster than an okay Python programmer and visa versa. I think C++ often gets a bad reputation because it allows you ge...
11
19
0
I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast. Anyways, could anyone elaborate on this? What exactly mak...
C++ slow, python fast? (in terms of development time)
1
0
0
5,902
977,404
2009-06-10T18:33:00.000
24
1
1
0
c++,python
977,451
13
false
0
1
There are two things that are relevant between C++ and Python that will affect your time-to-develop any project including a game. There are the languages themselves and the libraries. I've played with the SDL to some extent and peeked at PyGame and for your specific instance I don't think the libraries are going to b...
11
19
0
I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast. Anyways, could anyone elaborate on this? What exactly mak...
C++ slow, python fast? (in terms of development time)
1
0
0
5,902
977,404
2009-06-10T18:33:00.000
2
1
1
0
c++,python
977,412
13
false
0
1
It's time consuming because in C++ you have to deal with more low-level tasks. In Python you are free to focus on the development of the actual game instead of dealing with memory management etc.
11
19
0
I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast. Anyways, could anyone elaborate on this? What exactly mak...
C++ slow, python fast? (in terms of development time)
0.03076
0
0
5,902
977,404
2009-06-10T18:33:00.000
0
1
1
0
c++,python
4,546,946
13
false
0
1
Some people would argue that development time is slower in C++ when compared to Python. Wouldn't it be the case that the time you saved in developing an application (or game) in python is the time you gonna use in improving performance after its developed? and in the later part when you have least options left? It lar...
11
19
0
I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast. Anyways, could anyone elaborate on this? What exactly mak...
C++ slow, python fast? (in terms of development time)
0
0
0
5,902
977,404
2009-06-10T18:33:00.000
0
1
1
0
c++,python
1,079,100
13
false
0
1
Why limit yourself to those two options? With C# or Java you get access to a huge collection of useful libraries plus garbage collection and (in the case of C#) JIT compiling. Furthermore, you're saying that you're looking to do game development, but from your task description it sounds like you're also looking at codi...
11
19
0
I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast. Anyways, could anyone elaborate on this? What exactly mak...
C++ slow, python fast? (in terms of development time)
0
0
0
5,902
977,404
2009-06-10T18:33:00.000
2
1
1
0
c++,python
1,009,820
13
false
0
1
It takes about the same amount of time to write the same code in pretty much all of the high level languages. The win is that in certain languages it is easier to use other peoples code. In a lot of Python/Ruby/Perl apps, you write 10% of the code and import libraries to do the other 90%. That is harder in C/C++ since ...
11
19
0
I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast. Anyways, could anyone elaborate on this? What exactly mak...
C++ slow, python fast? (in terms of development time)
0.03076
0
0
5,902
977,404
2009-06-10T18:33:00.000
3
1
1
0
c++,python
986,810
13
false
0
1
Python has some big advantages over programming languages like C++. I myself have programmed a lot with C++, C and other programming languages. Lately I am also programming in Python and I got to like it very much! You can have a quick start with Python. Since it is rather simple to learn (at least with some programmin...
11
19
0
I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast. Anyways, could anyone elaborate on this? What exactly mak...
C++ slow, python fast? (in terms of development time)
0.046121
0
0
5,902
977,404
2009-06-10T18:33:00.000
0
1
1
0
c++,python
977,759
13
false
0
1
Do you have any programming experience at all? If not, I would start with Python which is easier to learn, even if it is not a better tool for game development. If you decide you want to program games for living, you'll probably need to switch to C++ at some point.
11
19
0
I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast. Anyways, could anyone elaborate on this? What exactly mak...
C++ slow, python fast? (in terms of development time)
0
0
0
5,902
977,404
2009-06-10T18:33:00.000
0
1
1
0
c++,python
977,460
13
false
0
1
Short Answer Yes python is faster in terms of development time. There are many case studies in real life that show this. However, you don't want to do a 3d graphics engine in Python.
11
19
0
I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast. Anyways, could anyone elaborate on this? What exactly mak...
C++ slow, python fast? (in terms of development time)
0
0
0
5,902
977,404
2009-06-10T18:33:00.000
0
1
1
0
c++,python
977,452
13
false
0
1
I'd focus more on choosing a framework to build your game on than trying to pick a language. Unless the goal is to learn how games work inside and out, you're going to want to use a framework. Try out a couple, and pick the one that meets your requirements and feels nice to you. Once you've picked the framework, the ...
11
19
0
I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast. Anyways, could anyone elaborate on this? What exactly mak...
C++ slow, python fast? (in terms of development time)
0
0
0
5,902
977,404
2009-06-10T18:33:00.000
2
1
1
0
c++,python
977,414
13
false
0
1
there are many things that make c++ longer to develop in. Its lower level, has pointers, different libraries for different systems, the type system, and there are others I am sure I am missing.
11
19
0
I'm thinking of trying to make some simple 2d games, but I've yet to choose a language. A lot of people recommend either C++ with SDL or python with pygame. I keep hearing that developement on C++ is fairly slow, and developement time with Python is fairly fast. Anyways, could anyone elaborate on this? What exactly mak...
C++ slow, python fast? (in terms of development time)
0.03076
0
0
5,902
978,581
2009-06-10T23:09:00.000
3
0
0
0
python,mysql,xml,django,parsing
978,590
9
false
1
0
Consuming the webservices is more efficient because there are a lot more things you can do to scale your webservices and webserver (via caching, etc.). By consuming the middle layer, you also have the options to change the returned data format (e.g. you can decide to use JSON rather than XML). Scaling database is muc...
9
1
0
I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma...
Is it more efficient to parse external XML or to hit the database?
0.066568
0
1
856
978,581
2009-06-10T23:09:00.000
0
0
0
0
python,mysql,xml,django,parsing
978,717
9
false
1
0
It depends from case to case, you'll have to measure (or at least make an educated guess). You'll have to consider several things. Web service it might hit database itself it can be cached it will introduce network latency and might be unreliable or it could be in local network and faster than accessing even local dis...
9
1
0
I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma...
Is it more efficient to parse external XML or to hit the database?
0
0
1
856
978,581
2009-06-10T23:09:00.000
1
0
0
0
python,mysql,xml,django,parsing
978,603
9
false
1
0
There is not enough information to be able to say for sure in the general case. Why don't you do some tests and find out? Since it sounds like you are using python you will probably want to use the timeit module. Some things that could effect the result: Performance of the web service you are using Reliability of the ...
9
1
0
I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma...
Is it more efficient to parse external XML or to hit the database?
0.022219
0
1
856
978,581
2009-06-10T23:09:00.000
0
0
0
0
python,mysql,xml,django,parsing
978,773
9
false
1
0
As a few people have said, it depends, and you should test it. Often external services are slow, and caching them locally (in a database in memory, e.g., with memcached) is faster. But perhaps not. Fortunately, it's cheap and easy to test.
9
1
0
I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma...
Is it more efficient to parse external XML or to hit the database?
0
0
1
856
978,581
2009-06-10T23:09:00.000
-1
0
0
0
python,mysql,xml,django,parsing
979,028
9
false
1
0
It sounds like you essentially want to cache results, and are wondering if it's worth it. But if so, I would NOT use a database (I assume you are thinking of a relational DB): RDBMSs are not good for caching; even though many use them. You don't need persistence nor ACID. If choice was between Oracle/MySQL and external...
9
1
0
I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma...
Is it more efficient to parse external XML or to hit the database?
-0.022219
0
1
856
978,581
2009-06-10T23:09:00.000
0
0
0
0
python,mysql,xml,django,parsing
978,864
9
false
1
0
Test definitely. As a rule of thumb, XML is good for communicating between apps, but once you have the data inside of your app, everything should go into a database table. This may not apply in all cases, but 95% of the time it has for me. Anytime I ever tried to store data any other way (ex. XML in a content manage...
9
1
0
I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma...
Is it more efficient to parse external XML or to hit the database?
0
0
1
856
978,581
2009-06-10T23:09:00.000
4
0
0
0
python,mysql,xml,django,parsing
978,857
9
true
1
0
Everyone is being very polite in answering this question: "it depends"... "you should test"... and so forth. True, the question does not go into great detail about the application and network topographies involved, but if the question is even being asked, then it's likely a) the DB is "local" to the application (on the...
9
1
0
I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma...
Is it more efficient to parse external XML or to hit the database?
1.2
0
1
856
978,581
2009-06-10T23:09:00.000
1
0
0
0
python,mysql,xml,django,parsing
978,607
9
false
1
0
It depends - who is calling the web service? Is the web service called every time the user hits the page? If that's the case I'd recommend introducing a caching layer of some sort - many web service API's throttle the amount of hits you can make per hour. Whether you choose to parse the cached XML on the fly or call th...
9
1
0
I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma...
Is it more efficient to parse external XML or to hit the database?
0.022219
0
1
856
978,581
2009-06-10T23:09:00.000
6
0
0
0
python,mysql,xml,django,parsing
978,593
9
false
1
0
First off -- measure. Don't just assume that one is better or worse than the other. Second, if you really don't want to measure, I'd guess the database is a bit faster (assuming the database is relatively local compared to the web service). Network latency usually is more than parse time unless we're talking a really...
9
1
0
I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma...
Is it more efficient to parse external XML or to hit the database?
1
0
1
856
978,643
2009-06-10T23:35:00.000
2
0
0
0
python,django,vim
10,666,285
5
false
1
0
Today, you not need special extentions for django autocomplete in vim. Make sure that you have vim with python support. To check it, type in xterm: vim --version|grep python output: +python -python3 +quickfix +reltime +rightleft -ruby +scrollbind +signs ... ... To make work autocomplete, add this lines in your .vimrc: ...
2
48
0
Does anyone know how to set up auto completion to work nicely with python, django, and vim? I've been trying to use pysmell, but I can't seem to get it set up correctly (or maybe I don't know how it works). Right now, I run pysmell in the django directory (I'm using the trunk) and move the resulting tags to my project ...
Vim, Python, and Django autocompletion (pysmell?)
0.07983
0
0
19,878
978,643
2009-06-10T23:35:00.000
3
0
0
0
python,django,vim
978,766
5
false
1
0
I've had good luck with exuberant-ctags for this. I use this macro in my vimrc: execute 'map :!/usr/bin/exuberant-ctags -f '.&tags.' --recurse '.$_P4ROOT.' ' You'll want to modify that slightly, so that it includes your python /site-packages/django/ directory as well as your own code. Then, hit F2 inside vim to upda...
2
48
0
Does anyone know how to set up auto completion to work nicely with python, django, and vim? I've been trying to use pysmell, but I can't seem to get it set up correctly (or maybe I don't know how it works). Right now, I run pysmell in the django directory (I'm using the trunk) and move the resulting tags to my project ...
Vim, Python, and Django autocompletion (pysmell?)
0.119427
0
0
19,878
979,551
2009-06-11T05:56:00.000
4
0
0
0
python,ssl,openssl
979,598
3
true
0
0
Did you install the OpenSSL development libraries? I had to install openssl-devel on CentOS, for example. On Ubuntu, sudo apt-get build-dep python2.5 did the trick (even for Python 2.6).
2
2
0
I tried using the ssl module in Python 2.6 but I was told that it wasn't available. After installing OpenSSL, I recompiled 2.6 but the problem persists. Any suggestions?
Adding SSL support to Python 2.6
1.2
0
1
7,646
979,551
2009-06-11T05:56:00.000
-1
0
0
0
python,ssl,openssl
996,622
3
false
0
0
Use the binaries provided by python.org or by your OS distributor. It's a lot easier than building it yourself, and all the features are usually compiled in. If you really need to build it yourself, you'll need to provide more information here about what build options you provided, what your environment is like, and p...
2
2
0
I tried using the ssl module in Python 2.6 but I was told that it wasn't available. After installing OpenSSL, I recompiled 2.6 but the problem persists. Any suggestions?
Adding SSL support to Python 2.6
-0.066568
0
1
7,646
979,599
2009-06-11T06:16:00.000
3
0
0
0
python,http,header,request,ip
979,637
2
false
0
0
web.env.get('REMOTE_ADDR')
1
3
0
I have a Pythonic HTTP server that is supposed to determine client's IP. How do I do that in Python? Is there any way to get the request headers and extract it from there? PS: I'm using WebPy.
Extracting IP from request in Python
0.291313
0
1
1,464
980,058
2009-06-11T08:57:00.000
3
0
0
0
python,html,perl,rendering,rendering-engine
980,098
7
false
1
0
lxml isn't going to help you at all. It isn't concerned about front-end rendering at all. To accurately work out how something renders, you need to render it. For that you need to hook into a browser, spawn the page and run some JS on the page to find the DOM element and get its attributes. It's totally possible but I ...
1
2
0
I would like to get the dimensions (coordinates) for all the HTML elements of a webpage as they are rendered by a browser, that is the positions they are rendered at. For example, (top-left,top-right,bottom-left,bottom-right) Could not find this in lxml. So, is there any library in Python that does this? I had also loo...
Finding rendered HTML element positions using WebKit (or Gecko)
0.085505
0
0
3,938
981,200
2009-06-11T13:50:00.000
0
0
1
1
python,windows,drivers
981,251
7
false
0
0
No they cannot. Windows drivers must be written in a language that can Interface with the C based API Compile down to machine code Then again, there's nothing stopping you from writing a compiler that translates python to machine code ;)
5
13
0
Can Windows drivers be written in Python?
Can Windows drivers be written in Python?
0
0
0
13,794
981,200
2009-06-11T13:50:00.000
0
0
1
1
python,windows,drivers
981,227
7
false
0
0
Never say never but eh.. no You might be able to hack something together to run user-mode parts of drivers in python. But kernel-mode stuff can only be done in C or assembly.
5
13
0
Can Windows drivers be written in Python?
Can Windows drivers be written in Python?
0
0
0
13,794
981,200
2009-06-11T13:50:00.000
1
0
1
1
python,windows,drivers
981,216
7
false
0
0
Python runs in a virtual machine, so no. BUT: You could write a compiler that translates Python code to machine language. Once you've done that, you can do it.
5
13
0
Can Windows drivers be written in Python?
Can Windows drivers be written in Python?
0.028564
0
0
13,794
981,200
2009-06-11T13:50:00.000
3
0
1
1
python,windows,drivers
981,320
7
false
0
0
The definitive answer is not without embedding an interpreter in your otherwise C/assembly driver. Unless someone has a framework available, then the answer is no. Once you have the interpreter and bindings in place then the rest of the logic could be done in Python. However, writing drivers is one of the things for wh...
5
13
0
Can Windows drivers be written in Python?
Can Windows drivers be written in Python?
0.085505
0
0
13,794
981,200
2009-06-11T13:50:00.000
1
0
1
1
python,windows,drivers
981,268
7
false
0
0
I don't know the restrictions on drivers on windows (memory allocation schemes, dynamic load of libraries and all), but you may be able to embed a python interpreter in your driver, at which point you can do whatever you want. Not that I think it is a good idea :)
5
13
0
Can Windows drivers be written in Python?
Can Windows drivers be written in Python?
0.028564
0
0
13,794
981,371
2009-06-11T14:17:00.000
2
0
0
0
python,django,file,forms,field
981,666
1
true
1
0
I think that is not possible, most browsers at least firefox3.0 do not allow fullpath to be seen, so even from JavaScript side you can not get full path If you could get full path you can send it to server, but I think you will have to be satisfied with file name
1
1
0
My django app accepts two files (in this case a jad and jar combo). Is there a way I can preserve the folders they came from? I need this so I can check later that they came from the same path. (And later on accept a whole load of files and be able to work out which came from the same folder).
Get original path from django filefield
1.2
0
0
1,174
981,411
2009-06-11T14:24:00.000
3
0
0
1
python,eclipse,root,sudo,gksudo
982,463
3
false
0
0
It may not be an ideal solution, but the rare times that I need this same functionality I end up just running Eclipse as root.
1
10
0
I use Eclipse as my IDE, and when I run my application I wish the application itself to run as root. My program currently checks if it is root, and if not it restarts itself with gksudo. The output, however, isn't written to the console. I can't use sudo, since it doesn't give me a graphical prompt. (While my program i...
Run a Python project in Eclipse as root
0.197375
0
0
4,783
981,691
2009-06-11T15:07:00.000
3
0
0
1
python,windows,command-line
981,705
6
true
0
0
python myscript.py
1
1
0
I have a python script that i want to run from the command line but unsure how to run it. Thanks :)
windows command line and Python
1.2
0
0
8,771
982,260
2009-06-11T16:47:00.000
0
0
1
0
python,linux,encryption,passwords,obfuscation
982,287
6
false
0
0
Many password-accepting protocols and facilities have a way to specify a keyfile rather than a password. That strategy will probably work here; rather than hard-coding a password, hard-code a filename (or better yet, make it a parameter!). You could even go as far as SSH and refuse to load keyfiles that aren't (1) ow...
3
10
0
I have a password string that must be passed to a method. Everything works fine but I don't feel comfortable storing the password in clear text. Is there a way to obfuscate the string or to truly encrypt it? I'm aware that obfuscation can be reverse engineered, but I think I should at least try to cover up the password...
Obfuscate strings in Python
0
0
0
9,052
982,260
2009-06-11T16:47:00.000
0
0
1
0
python,linux,encryption,passwords,obfuscation
982,431
6
false
0
0
It depends alot on why you're keeping the password around, and where you feel there is a security issue. If you're storing or matching this password to a database in the future: This shouldn't really be a problem, but if you're concerned, use your database's password encryption early and store that ( SELECT PASSWORD('m...
3
10
0
I have a password string that must be passed to a method. Everything works fine but I don't feel comfortable storing the password in clear text. Is there a way to obfuscate the string or to truly encrypt it? I'm aware that obfuscation can be reverse engineered, but I think I should at least try to cover up the password...
Obfuscate strings in Python
0
0
0
9,052
982,260
2009-06-11T16:47:00.000
2
0
1
0
python,linux,encryption,passwords,obfuscation
982,750
6
false
0
0
Obviously your best option is to delegate this to a third party. If you can authenticate with whatever you're connecting to using some other credential (eg. the user account your process is running as), you can leave the permission levels up to the OS layer. Alternatively, if sufficiently important / possible you cou...
3
10
0
I have a password string that must be passed to a method. Everything works fine but I don't feel comfortable storing the password in clear text. Is there a way to obfuscate the string or to truly encrypt it? I'm aware that obfuscation can be reverse engineered, but I think I should at least try to cover up the password...
Obfuscate strings in Python
0.066568
0
0
9,052
982,682
2009-06-11T18:05:00.000
2
0
1
0
python,security,passwords,coredump
982,735
5
false
0
0
No way to "mark as sensitive", but you could encrypt the data in memory and decrypt it again when you need to use it -- not a perfect solution but the best I can think of.
2
22
0
I need to store a user's password for a short period of time in memory. How can I do so yet not have such information accidentally disclosed in coredumps or tracebacks? Is there a way to mark a value as "sensitive", so it's not saved anywhere by a debugger?
Mark data as sensitive in python
0.07983
0
0
10,793
982,682
2009-06-11T18:05:00.000
2
0
1
0
python,security,passwords,coredump
982,748
5
false
0
0
XOR with a one-time pad stored separately always store salted hash rather than password itself or, if you're very paranoid about dumps, store unique random key in some other place, e.g. i a different thread, in a registry, on your server, etc.
2
22
0
I need to store a user's password for a short period of time in memory. How can I do so yet not have such information accidentally disclosed in coredumps or tracebacks? Is there a way to mark a value as "sensitive", so it's not saved anywhere by a debugger?
Mark data as sensitive in python
0.07983
0
0
10,793
983,399
2009-06-11T20:14:00.000
1
0
0
0
c#,c++,python,xml,schema
985,246
7
false
0
1
One solution could be to write an XSL transformation that converts the XML file into a XAML file.
2
15
0
I have to write a desktop application to edit data stored in a XML file. The format is defined by a XML schema file (.xsd). The format is quite complex. Are there tools which can generate a basic GUI automatically? It's not yet decided which language to use. I have experience in Python and C++ using wxWidgets and C# (...
Create a GUI from a XML schema automatically
0.028564
0
0
19,538
983,399
2009-06-11T20:14:00.000
1
0
0
0
c#,c++,python,xml,schema
1,015,238
7
false
0
1
If the GUI will be simple and you don't bother about the geometry of the components(widgets) in the dialogs, Qt will be a good option. Actually I'm working on a similar task for my project, and my goal was to validate the form data by using an XML file. Using Qt, it is possible to access any widget on the dialog at run...
2
15
0
I have to write a desktop application to edit data stored in a XML file. The format is defined by a XML schema file (.xsd). The format is quite complex. Are there tools which can generate a basic GUI automatically? It's not yet decided which language to use. I have experience in Python and C++ using wxWidgets and C# (...
Create a GUI from a XML schema automatically
0.028564
0
0
19,538
983,699
2009-06-11T21:09:00.000
371
0
1
0
python,list
983,727
3
true
0
0
If the "default value" you want is immutable, @eduffy's suggestion, e.g. [0]*10, is good enough. But if you want, say, a list of ten dicts, do not use [{}]*10 -- that would give you a list with the same initially-empty dict ten times, not ten distinct ones. Rather, use [{} for i in range(10)] or similar constructs, to ...
1
243
0
How do I initialise a list with 10 times a default value in Python? I'm searching for a good-looking way to initialize a empty list with a specific range. So make a list that contains 10 zeros or something to be sure that my list has a specific length.
Initialise a list to a specific length in Python
1.2
0
0
315,620
984,816
2009-06-12T03:16:00.000
4
0
0
0
python,wxpython,icons
984,833
1
true
0
1
I don't think wxPython provides native images on each platform but just for consistency sake you can use wx.ArtProvider e.g. wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN)
1
2
0
I'm designing a simple text editor using WxPython, and I want to put the platform's native icons in the toolbar. It seems that the only way to make toolbars is with custom images, which are not good for portability. Is there some kind of (e.g.) GetSaveIcon()?
How to use standard toolbar icons with WxPython?
1.2
0
0
1,725
985,155
2009-06-12T05:28:00.000
5
0
1
0
python
985,176
1
true
0
0
Assuming you're talking about a .so file, it's not up to Python to find it -- it's up to the operating system's dynamic library loaded. For Linux, for example, LD_LIBRARY_PATH is the environment variable you need to set.
1
5
0
I have installed lxml which was built using a standalone version of libxml2. Reason for this was that the lxml needed a later version of libxml2 than what was currently installed. When I use the lxml module how do I tell it (python) where to find the correct version of the libxml2 shared library?
How to specify native library search path for python
1.2
0
1
2,097
985,294
2009-06-12T06:41:00.000
0
0
1
0
python,pickle,memoization
985,362
2
false
0
0
What do you mean by same output ? You should normally always get the same output for a roundtrip (pickling -> unpickling), but I don't think the serialized format itself is guaranteed to be the same in every condition. Certainly, it may change between platforms and all that. Within one run of your program, using pickli...
1
8
0
Does Pickle always produce the same output for a certain input value? I suppose there could be a gotcha when pickling dictionaries that have the same contents but different insert/delete histories. My goal is to create a "signature" of function arguments, using Pickle and SHA1, for a memoize implementation.
Is the pickling process deterministic?
0
0
0
1,588
986,403
2009-06-12T12:35:00.000
3
0
0
0
python,sqlite,encryption
987,942
5
false
0
0
SQLite databases are pretty human-readable, and there isn't any built-in encryption. Are you concerned about someone accessing and reading the database files directly, or accessing them through your program? I'm assuming the former, because the latter isn't really database related--it's your application's security yo...
1
10
0
I have a sqlite3 db which i insert/select from in python. The app works great but i want to tweak it so no one can read from the DB without a password. How can i do this in python? note i have no idea where to start.
Encrypted file or db in python
0.119427
1
0
29,194
986,594
2009-06-12T13:17:00.000
-1
0
0
0
python,django
990,440
2
false
1
0
Are you saying that a random survey of some posted Django apps (not Django itself) reveals that some people post code that doesn't meet your standards of quality? Isn't that universally true of all code posted everywhere on the internet? A random survey of any code in any language for any framework will turn up quality...
1
13
0
I plan to sneak in some Python/Django to my workdays and a possible social network site project seems like a good possibility. Django itself seems excellent, but I am skeptical about the quality of large amount of Django apps that seem to be available. I would like to hear what kind of experiences you may have had with...
Experiences of creating Social Network site in Django
-0.099668
0
0
5,087
986,616
2009-06-12T13:23:00.000
0
0
1
0
python,multithreading,exit-code
986,658
3
false
0
0
You could set some global variable to 0 if success, or non-zero if there was an exception. This is a pretty standard convention. However, you'll need to protect this variable with a mutex or semaphore. Or you could make sure that only one thread will ever write to it and all others would just read it.
2
15
0
Is there a way to tell if a thread has exited normally or because of an exception?
Python thread exit code
0
0
0
12,475
986,616
2009-06-12T13:23:00.000
0
0
1
0
python,multithreading,exit-code
986,698
3
false
0
0
Have your thread function catch exceptions. (You can do this with a simple wrapper function that just calls the old thread function inside a try...except or try...except...else block). Then the question just becomes "how to pass information from one thread to another", and I guess you already know how to do that.
2
15
0
Is there a way to tell if a thread has exited normally or because of an exception?
Python thread exit code
0
0
0
12,475
988,346
2009-06-12T18:47:00.000
1
1
1
0
python,algorithm,list,tuples
988,462
5
false
0
0
I don't know how many types you have. But If we assume you have only type 1 and type 2, then it sounds like a problem similar to a merge sort. Doing it with a merge sort, you make a single pass through the list. Take two indexes, one for type 1 and one for type 2 (I1, I2). Sort the list by id, start1. Start I1 as ...
2
2
0
I am kind of hitting a wall on this problem and I was wondering if some fresh brains could help me out. I have a large list of four element tuples in the format: (ID number, Type, Start Index, End Index) Previously in the code, I have searched through thousands of blocks of text for two specific types of substrings. T...
Efficient Tuple List Comparisons
0.039979
0
0
551
988,346
2009-06-12T18:47:00.000
0
1
1
0
python,algorithm,list,tuples
988,650
5
false
0
0
Assuming there are lots of entries for each ID, I would (pseudo-code) for each ID: for each type2 substring of that ID: store it in an ordered list, sorted by start point for each type1 substring of that ID: calculate the end point (or whatever) look it up in the...
2
2
0
I am kind of hitting a wall on this problem and I was wondering if some fresh brains could help me out. I have a large list of four element tuples in the format: (ID number, Type, Start Index, End Index) Previously in the code, I have searched through thousands of blocks of text for two specific types of substrings. T...
Efficient Tuple List Comparisons
0
0
0
551
990,169
2009-06-13T06:56:00.000
10
0
1
0
python,unicode,python-2.x
12,083,259
3
false
0
0
Given a byte string with Unicode escapes b"\N{SNOWMAN}", b"\N{SNOWMAN}".decode('unicode-escape) will produce the expected Unicode string u'\u2603'.
1
31
0
When I tried to get the content of a tag using "unicode(head.contents[3])" i get the output similar to this: "Christensen Sk\xf6ld". I want the escape sequence to be returned as string. How to do it in python?
How do convert unicode escape sequences to unicode characters in a python string
1
0
0
44,729
990,459
2009-06-13T10:09:00.000
0
0
0
0
python,active-directory,ldap,webserver
991,550
2
false
1
0
There are quite a few components between your hosted django application and your internal AD. You will need to test each to see if everything in the pathways between them is correct. So your AD server is sitting behind your firewall. Your firewall has ip "a.b.c.d" and all traffic to the firewall ip on port 389 is forwa...
1
0
0
I have a django application hosted on webfaction which now has a static/private ip. Our network in the office is obviously behind a firewall and the AD server is running behind this firewall. From inside the network i can authenticate using python-ldap with the AD's internal IP address and the port 389 and all works we...
Python LDAP Authentication from remote web server
0
0
1
2,571
991,027
2009-06-13T16:57:00.000
5
0
1
0
python
41,274,686
7
false
0
0
I don't think you're fully grasping modulo. a % b and a mod b are just two different ways to express modulo. In this case, python uses %. No, 15 mod 4 is not 1, 15 % 4 == 15 mod 4 == 3.
2
168
0
Is there a modulo function in the Python math library? Isn't 15 % 4, 3? But 15 mod 4 is 1, right?
How to calculate a mod b in Python?
0.141893
0
0
700,325
991,027
2009-06-13T16:57:00.000
258
0
1
0
python
991,034
7
true
0
0
There's the % sign. It's not just for the remainder, it is the modulo operation.
2
168
0
Is there a modulo function in the Python math library? Isn't 15 % 4, 3? But 15 mod 4 is 1, right?
How to calculate a mod b in Python?
1.2
0
0
700,325
991,904
2009-06-14T01:12:00.000
56
0
1
0
java,python,multithreading,jvm,gil
1,162,596
5
false
0
0
The JVM (at least hotspot) does have a similar concept to the "GIL", it's just much finer in its lock granularity, most of this comes from the GC's in hotspot which are more advanced. In CPython it's one big lock (probably not that true, but good enough for arguments sake), in the JVM it's more spread about with differ...
2
186
0
I'm hoping someone can provide some insight as to what's fundamentally different about the Java Virtual Machine that allows it to implement threads nicely without the need for a Global Interpreter Lock (GIL), while Python necessitates such an evil.
Why is there no GIL in the Java Virtual Machine? Why does Python need one so bad?
1
0
0
19,199
991,904
2009-06-14T01:12:00.000
-2
0
1
0
java,python,multithreading,jvm,gil
37,918,400
5
false
0
0
Python lacks jit/aot and the time frame it was written at multithreaded processors didn't exist. Alternatively you could recompile everything in Julia lang which lacks GIL and gain some speed boost on your Python code. Also Jython kind of sucks it's slower than Cpython and Java. If you want to stick to Python consider ...
2
186
0
I'm hoping someone can provide some insight as to what's fundamentally different about the Java Virtual Machine that allows it to implement threads nicely without the need for a Global Interpreter Lock (GIL), while Python necessitates such an evil.
Why is there no GIL in the Java Virtual Machine? Why does Python need one so bad?
-0.07983
0
0
19,199
992,136
2009-06-14T04:07:00.000
32
0
1
0
python
992,141
2
true
0
0
The GIL only affects threads within a single process. The multiprocessing module is in fact an alternative to threading that lets Python programs use multiple cores &c. Your scenario will easily allow use of multiple cores, too.
1
20
0
I'm curious in how the Global Interpreter Lock in python actually works. If I have a c++ application launch four separate instances of a python script will they run in parallel on separate cores, or does the GIL go even deeper then just the single process that was launched and control all python process's regardless of...
Does running separate python processes avoid the GIL?
1.2
0
0
5,775
992,638
2009-06-14T10:57:00.000
1
0
1
0
python
992,645
2
false
0
0
easiest way is to just unzip the twill and keep it somewhere in PYTHONPATH e.g. in your project and just import twill else copy twill folder directly to D:\Python26\Lib\site-packages
1
0
0
I have already downloaded twill 0.9. Also, I have installed easy_install for python 2.6. Now I'm stuck with twill installation. Could you help me to settle the problem?
How to setup twill for python 2.6 on Windows?
0.099668
0
0
1,647
993,029
2009-06-14T15:33:00.000
3
0
0
0
python,templates,template-engine,cherrypy
994,184
6
false
1
0
I like Genshi. One reason that I like it is simply that the XML syntax looks much cleaner to me when mixed with HTML versus the text-level syntax of the other popular templating engines. For example, it's nice to be able to stick a py:for attribute on to output a table versus nesting messy #if or whatever lines. ...
1
11
0
I'm in the process of building a web application using cherrypy. What template technology do you recommend I use?
Which template technology should I use with CherryPy?
0.099668
0
0
8,175
993,274
2009-06-14T17:34:00.000
1
0
1
0
python
993,284
9
false
0
0
As these answers are implying, 1/2 doesn't return what you are expecting. It returns zero, because 1 and 2 are integers (integer division causes numbers to round down). Python 3 changes this behavior, by the way.
5
0
0
When I do 1/2 in Python why does it give me zero? Even if I coerce it with float(1/2) still I get zero. Why? And how can I get around it? When I give arctan(1/2) I get 0 as answer, but when I give arctan(.5) I get the correct answer!
Error while I use math.atan in Python!
0.022219
0
0
2,230
993,274
2009-06-14T17:34:00.000
1
0
1
0
python
993,285
9
false
0
0
Your coercing doesn't stand a chance because the answer is already zero before you hand it to float. Try 1./2
5
0
0
When I do 1/2 in Python why does it give me zero? Even if I coerce it with float(1/2) still I get zero. Why? And how can I get around it? When I give arctan(1/2) I get 0 as answer, but when I give arctan(.5) I get the correct answer!
Error while I use math.atan in Python!
0.022219
0
0
2,230
993,274
2009-06-14T17:34:00.000
2
0
1
0
python
993,281
9
false
0
0
From the standard: The / (division) and // (floor division) operators yield the quotient of their arguments. The numeric arguments are first converted to a common type. Plain or long integer division yields an integer of the same type; the result is that of mathematical division with the ‘floor’ function applied to the...
5
0
0
When I do 1/2 in Python why does it give me zero? Even if I coerce it with float(1/2) still I get zero. Why? And how can I get around it? When I give arctan(1/2) I get 0 as answer, but when I give arctan(.5) I get the correct answer!
Error while I use math.atan in Python!
0.044415
0
0
2,230
993,274
2009-06-14T17:34:00.000
1
0
1
0
python
993,293
9
false
0
0
If 1/2 == 0 then float(1/2) will be 0.0. If you coerce it to float after it's been truncated it'll still be truncated. There are a few options: Add the following import: from __future__ import division. This will make the / operator divide "correctly" in that module. You can use // if you need truncating division. Coe...
5
0
0
When I do 1/2 in Python why does it give me zero? Even if I coerce it with float(1/2) still I get zero. Why? And how can I get around it? When I give arctan(1/2) I get 0 as answer, but when I give arctan(.5) I get the correct answer!
Error while I use math.atan in Python!
0.022219
0
0
2,230
993,274
2009-06-14T17:34:00.000
1
0
1
0
python
993,288
9
false
0
0
In Python, dividing integers yields an integer -- 0 in this case. There are two possible solutions. One is to force them into floats: 1/2. (note the trailing dot) or float(1)/2. Another is to use "from future import division" at the top of your code, and use the behavior you need. python -c 'from future import division...
5
0
0
When I do 1/2 in Python why does it give me zero? Even if I coerce it with float(1/2) still I get zero. Why? And how can I get around it? When I give arctan(1/2) I get 0 as answer, but when I give arctan(.5) I get the correct answer!
Error while I use math.atan in Python!
0.022219
0
0
2,230
994,278
2009-06-15T02:05:00.000
5
0
0
0
python,compilation,tkinter
994,311
1
true
0
1
Unfortunately I suspect you can't do it without editing some file or other -- it's not a configure option we wrote in as far as I recall (I hope I'm wrong and somebody else snuck it in while I wasn't looking but a quick look at the configure file seems to confirm they didnt'). Sorry -- we never thought that somebody (w...
1
3
0
I'm trying to explicitly disable the compilation of the _tkinter module when compiling Python 2.4.3. It's easy enough to do by modifying the makefile but I'd rather just append a configuration option to avoid supplying a patch. I do not understand the complex interplay between Modules/Setup*, setup.py and their contrib...
How can I explicitly disable compilation of _tkinter.c when compiling Python 2.4.3 on CentOS 5?
1.2
0
0
672
994,476
2009-06-15T04:15:00.000
31
0
1
0
python,oop
994,482
2
true
0
0
An abstract method is one that (in the base class) raises NotImplementedError. An abstract class, like in C++, is any class that has one or more abstract methods. All methods in Python are virtual (i.e., all can be overridden by subclasses). A "pure virtual" method would presumably be the same thing as an abstract one....
1
9
0
How does python handle object oriented constructs such as abstract, virtual, pure virtual etc Examples and links would really be good.
What is the equivalent of object oriented constructs in python?
1.2
0
0
2,068
994,965
2009-06-15T08:03:00.000
2
0
0
0
python,google-app-engine,authentication,registration
995,085
3
false
1
0
You can't customize the login page. Allowing you to do so would introduce the possibility of XSS vulnerabilities, as well as making it harder for users to identify a legitimate login page. If you want to provide for federated login, you may want to simply redirect users to an interstitial page that allows them to pick ...
1
2
0
I need to add few more options for login and therefore need to customize create_login_url with some HTML code. Is there a way to add on your code in default login screen of Google? Environment: Python (Google App Engine) I want to continue having the default Google ext class Users behavior in place.
Customize login in Google App Engine
0.132549
0
0
4,081
995,165
2009-06-15T09:15:00.000
0
0
1
0
c++,python,regex,namespaces
998,230
6
false
0
0
That is what I did earlier today: Extract the comment out of the C++ files Use regex to extract the namespace definition Use a simple string search to get the open & close braces positions The various sanity check added show that I am successfully processing 99.925% of my files (5 failures ouf of 6678 files). The...
5
1
0
I am trying to extract the namespaces defined in C++ files. Basically, if my C++ file contains: namespace n1 { ... namespace n2 { ... } // end namespace n2 ... namespace n3 { ...} //end namespace n3 ... } //end namespace n1 I want to be able to retrieve: n1, n1::n2, n1::n3. Does someone have any suggestio...
Using python regex to extract namespaces from C++ sources
0
0
0
799
995,165
2009-06-15T09:15:00.000
1
0
1
0
c++,python,regex,namespaces
997,076
6
false
0
0
You could write a basic lexer for it. It's not that hard.
5
1
0
I am trying to extract the namespaces defined in C++ files. Basically, if my C++ file contains: namespace n1 { ... namespace n2 { ... } // end namespace n2 ... namespace n3 { ...} //end namespace n3 ... } //end namespace n1 I want to be able to retrieve: n1, n1::n2, n1::n3. Does someone have any suggestio...
Using python regex to extract namespaces from C++ sources
0.033321
0
0
799
995,165
2009-06-15T09:15:00.000
2
0
1
0
c++,python,regex,namespaces
997,110
6
false
0
0
The need is simple enough that you may not need a complex parser. You need to: extract the namespace names count the open/close braces to keep track of where your namespace is defined. This simple approach works if the other conditions are met: you don't get spurious namespace like strings inside comments or inside ...
5
1
0
I am trying to extract the namespaces defined in C++ files. Basically, if my C++ file contains: namespace n1 { ... namespace n2 { ... } // end namespace n2 ... namespace n3 { ...} //end namespace n3 ... } //end namespace n1 I want to be able to retrieve: n1, n1::n2, n1::n3. Does someone have any suggestio...
Using python regex to extract namespaces from C++ sources
0.066568
0
0
799
995,165
2009-06-15T09:15:00.000
6
0
1
0
c++,python,regex,namespaces
995,182
6
false
0
0
Searching for the namespace names is pretty easy with a regular expression. However, to determine the nesting level you will have to keep track of the curly bracket nesting level in the source file. This is a parsing problem, one that cannot be solved (sanely) with regular expressions. Also, you may have to deal with a...
5
1
0
I am trying to extract the namespaces defined in C++ files. Basically, if my C++ file contains: namespace n1 { ... namespace n2 { ... } // end namespace n2 ... namespace n3 { ...} //end namespace n3 ... } //end namespace n1 I want to be able to retrieve: n1, n1::n2, n1::n3. Does someone have any suggestio...
Using python regex to extract namespaces from C++ sources
1
0
0
799
995,165
2009-06-15T09:15:00.000
0
0
1
0
c++,python,regex,namespaces
997,065
6
false
0
0
Most of the time when someone asks how to do something with regex, they're doing something very wrong. I don't think this case is different. If you want to parse c++, you need to use a c++ parser. There are many things that can be done that will defeat a regex but still be valid c++.
5
1
0
I am trying to extract the namespaces defined in C++ files. Basically, if my C++ file contains: namespace n1 { ... namespace n2 { ... } // end namespace n2 ... namespace n3 { ...} //end namespace n3 ... } //end namespace n1 I want to be able to retrieve: n1, n1::n2, n1::n3. Does someone have any suggestio...
Using python regex to extract namespaces from C++ sources
0
0
0
799
996,129
2009-06-15T13:31:00.000
1
0
1
0
python,windows-services,py2exe
996,645
2
false
0
0
You will find an example in the py2exe package, look in site-packages\py2exe\samples\advanced.
1
6
0
I have successfully converted my python project to a service. When using the usual options of install and start/stop, everything works correctly. However, I wish to compile the project using py2exe, which seems to work correctly until you install the EXE as a service and try and run it. You get the following error me...
py2exe windows service problem
0.099668
0
0
2,895
997,485
2009-06-15T18:04:00.000
1
0
1
0
python,git,ide,editor
997,510
4
false
0
0
Eclipse should be able to fit the bill. I know there's a decent python plugin, and I'm sure there's one for git by now.
1
2
0
I am looking for a Text Editor on Windows which is integrated with GIT (check out, check in from the UI). Also, it would be nice is this editor could also support Python syntax highlighting. Is there anything like that available? Thanks!
Looking for Windows Text Editor which supports GIT
0.049958
0
0
3,475
997,904
2009-06-15T19:25:00.000
0
0
0
0
python,icons,pyqt4
999,115
3
false
0
1
I spent a decent amount of researching this myself not long ago, and my conclusion was that, unfortunately, Qt doesn't provide this functionality in a cross-platform fashion. Ideally the QIcon class would have defaults for file open, save, '+', '-', preferences, etc, but considering it doesn't you'll have to grab the ...
1
8
0
I'm writing a basic program in python using the PyQt4 module. I'd like to be able to use my system theme's icons for things like the preference dialog's icon, but i have no idea how to do this. So my question is, how do you get the location of an icon, but make sure it changes with the system's icon theme? If it matter...
System theme icons and PyQt4
0
0
0
3,720
1,000,540
2009-06-16T09:56:00.000
1
0
0
0
python,database,session,caching,memcached
1,130,289
1
false
0
0
Not that I know of. memcached is designed to be very fast and very straightforward, no fancy weights and priorities keep it simple. You should not rely on memcache for persistent session storage. You should keep your sessions in the DB, but you can cache them in memcache. This way you can enjoy both worlds.
1
0
0
A hashtable in memcached will be discarded either when it's Expired or when there's not enough memory and it's choosen to die based on the Least Recently Used algorithm. Can we put a Priority to hint or influence the LRU algorithm? I want to use memcached to store Web Sessions so i can use the cheap round-robin. I nee...
Is there an option to configure a priority in memcached? (Similiar to Expiry)
0.197375
1
0
799
1,000,900
2009-06-16T11:31:00.000
59
0
1
1
python,windows
1,031,891
25
false
0
0
cmd /k is the typical way to open any console application (not only Python) with a console window that will remain after the application closes. The easiest way I can think to do that, is to press Win+R, type cmd /k and then drag&drop the script you want to the Run dialog.
6
214
0
I have just started with Python. When I execute a python script file on Windows, the output window appears but instantaneously goes away. I need it to stay there so I can analyze my output. How can I keep it open?
How to keep a Python script output window open?
1
0
0
389,804
1,000,900
2009-06-16T11:31:00.000
6
0
1
1
python,windows
4,477,506
25
false
0
0
I had a similar problem. With Notepad++ I used to use the command : C:\Python27\python.exe "$(FULL_CURRENT_PATH)" which closed the cmd window immediately after the code terminated. Now I am using cmd /k c:\Python27\python.exe "$(FULL_CURRENT_PATH)" which keeps the cmd window open.
6
214
0
I have just started with Python. When I execute a python script file on Windows, the output window appears but instantaneously goes away. I need it to stay there so I can analyze my output. How can I keep it open?
How to keep a Python script output window open?
1
0
0
389,804
1,000,900
2009-06-16T11:31:00.000
1
0
1
1
python,windows
60,842,143
25
false
0
0
I found the solution on my py3 enviroment at win10 is just run cmd or powershell as Administrator,and the output would stay at the same console window,any other type of user run python command would cause python to open a new console window.
6
214
0
I have just started with Python. When I execute a python script file on Windows, the output window appears but instantaneously goes away. I need it to stay there so I can analyze my output. How can I keep it open?
How to keep a Python script output window open?
0.008
0
0
389,804
1,000,900
2009-06-16T11:31:00.000
-2
0
1
1
python,windows
56,816,573
25
false
0
0
You can open PowerShell and type "python". After Python has been imported, you can copy paste the source code from your favourite text-editor to run the code. The window won't close.
6
214
0
I have just started with Python. When I execute a python script file on Windows, the output window appears but instantaneously goes away. I need it to stay there so I can analyze my output. How can I keep it open?
How to keep a Python script output window open?
-0.015999
0
0
389,804
1,000,900
2009-06-16T11:31:00.000
0
0
1
1
python,windows
69,880,499
25
false
0
0
You can launch python with the -i option or set the environment variable PYTHONINSPECT=x. From the docs: inspect interactively after running script; forces a prompt even if stdin does not appear to be a terminal; also PYTHONINSPECT=x So when your script crashes or finishes, you'll get a python prompt and your window ...
6
214
0
I have just started with Python. When I execute a python script file on Windows, the output window appears but instantaneously goes away. I need it to stay there so I can analyze my output. How can I keep it open?
How to keep a Python script output window open?
0
0
0
389,804
1,000,900
2009-06-16T11:31:00.000
2
0
1
1
python,windows
30,281,797
25
false
0
0
Apart from input and raw_input, you could also use an infinite while loop, like this: while True: pass (Python 2.5+/3) or while 1: pass (all versions of Python 2/3). This might use computing power, though. You could also run the program from the command line. Type python into the command line (Mac OS X Terminal) and it...
6
214
0
I have just started with Python. When I execute a python script file on Windows, the output window appears but instantaneously goes away. I need it to stay there so I can analyze my output. How can I keep it open?
How to keep a Python script output window open?
0.015999
0
0
389,804
1,001,744
2009-06-16T14:09:00.000
5
1
0
1
python,linux,encryption,passwords
1,001,833
3
true
0
0
Encrypting the passwords doesn't really buy you a whole lot more protection than storing in plaintext. Anyone capable of accessing the database probably also has full access to your webserver machines. However, if the loss of security is acceptable, and you really need this, I'd generate a new keyfile (from a good sou...
1
7
0
First, my question is not about password hashing, but password encryption. I'm building a desktop application that needs to authentificate the user to a third party service. To speed up the login process, I want to give the user the option to save his credentials. Since I need the password to authentificate him to the ...
How To Reversibly Store Password With Python On Linux?
1.2
0
0
2,912
1,002,627
2009-06-16T16:34:00.000
0
1
0
1
c#,python,windows,ssh
11,246,704
7
false
0
0
pexpect can't import on Windows. So, I use plink.exe with a Python subprocess to connect to the ssh server.
1
1
0
I want to be able to execute openssh with some custom arguments and then be able to automatically login to the server. I want that my script will enter the password if needed and inject 'yes' if I'm prompted to add the fingerprint to the known hosts. I've found SharpSsh for C# that do that, but I also need to use -D p...
Automate SSH login under windows
0
0
0
3,061
1,003,131
2009-06-16T18:21:00.000
1
0
0
0
python,frameworks,web-frameworks
2,246,687
7
false
1
0
I would absolutely recommend Repoze.bfg with SQLAlchemy for what you describe. I've done projects now in Django, TurboGears 1, TurboGears 2, Pylons, and dabbled in pure Zope3. BFG is far and away the framework most designed to accomodate a project growing in ways you don't anticipate at the beginning, but is far more l...
4
4
0
I need your advices to choose a Python Web Framework for developing a large project: Database (Postgresql)will have at least 500 tables, most of them with a composite primary key, lots of constraints, indexes & queries. About 1,500 views for starting. The project belongs to the financial area. Alwasy new requirements a...
python web framework large project
0.028564
1
0
2,101
1,003,131
2009-06-16T18:21:00.000
2
0
0
0
python,frameworks,web-frameworks
1,003,329
7
false
1
0
Depending on what you want to do, you actually have a few possible frameworks : [Django] Big, strong (to the limit of what a python framework can be), and the older in the race. Used by a few 'big' sites around the world ([Django sites]). Still is a bit of an overkill for almost everything and with a deprecated coding ...
4
4
0
I need your advices to choose a Python Web Framework for developing a large project: Database (Postgresql)will have at least 500 tables, most of them with a composite primary key, lots of constraints, indexes & queries. About 1,500 views for starting. The project belongs to the financial area. Alwasy new requirements a...
python web framework large project
0.057081
1
0
2,101
1,003,131
2009-06-16T18:21:00.000
8
0
0
0
python,frameworks,web-frameworks
1,003,173
7
false
1
0
Yes. An ORM is essential for mapping SQL stuff to objects. You have three choices. Use someone else's ORM Roll your own. Try to execute low-level SQL queries and pick out the fields they want from the result set. This is -- actually -- a kind of ORM with the mappings scattered throughout the applications. It may ...
4
4
0
I need your advices to choose a Python Web Framework for developing a large project: Database (Postgresql)will have at least 500 tables, most of them with a composite primary key, lots of constraints, indexes & queries. About 1,500 views for starting. The project belongs to the financial area. Alwasy new requirements a...
python web framework large project
1
1
0
2,101
1,003,131
2009-06-16T18:21:00.000
12
0
0
0
python,frameworks,web-frameworks
1,003,161
7
false
1
0
Django has been used by many large organizations (Washington Post, etc.) and can connect with Postgresql easily enough. I use it fairly often and have had no trouble.
4
4
0
I need your advices to choose a Python Web Framework for developing a large project: Database (Postgresql)will have at least 500 tables, most of them with a composite primary key, lots of constraints, indexes & queries. About 1,500 views for starting. The project belongs to the financial area. Alwasy new requirements a...
python web framework large project
1
1
0
2,101
1,003,302
2009-06-16T18:50:00.000
-2
0
0
0
python,django
1,004,658
4
false
1
0
Edit: Added some more information about why I present this answer here. I found chartbeat when I tried to answer this same question for my django based site. I don't work for them. Not specifically Django, but chartbeat.com is very interesting to add to a website as well. django-tracking is great, +1 for that answer,...
1
3
0
In Django, how can I see the number of current visitors? Or how do I determine the number of active sessions? Is this a good method? use django.contrib.sessions.models.Session, set the expiry time short. Every time when somebody does something on the site, update expiry time. Then count the number of sessions that are ...
Number of visitors in Django
-0.099668
0
0
4,771