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
2,543,315
2010-03-30T06:52:00.000
1
0
0
0
python,pylons,authkit
2,543,332
1
true
1
0
There is no single "logged-in user" if you're serving requests on multiple threads -- by setting a single global variable the threads would trample upon each other and end up very very confused on who "the logged-in user" actually is. There is (at most;-) a single logged-in user per request, so keeping that info in th...
1
0
0
How can I can set a global variable for the username of the logged-in user? At the moment i have the following code in all my controllers to get the username. I rather set it as a global variable if possible. request.environ.get("REMOTE_USER") I tried putting the same code in the app_globals.py file but it gave me the ...
Pylons: Set global variable for Authkit user
1.2
0
0
360
2,544,331
2010-03-30T10:09:00.000
3
0
0
0
python,xml,soap,suds,envelope
2,545,937
4
true
1
0
I managed to get this working, the soap envelope is hard coded into bindings.py that is stored in suds.egg installed in your site-packages. I changed the SOAP envelope address to http://www.w3.org/2003/05/soap-envelope. This was compatible with my camera. I was unable to find a command to overwrite this envelope in sud...
1
7
0
I have a camera and I am trying to connect to it vis suds. I have tried to send raw xml and have found that the only thing stopping the xml suds from working is an incorrect Soap envelope namespace. The envelope namespace is: xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" and I want to rewrite it to: xmlns:...
Overwrite the Soap Envelope in Suds python
1.2
0
0
4,252
2,545,783
2010-03-30T14:02:00.000
0
0
1
0
python,xml
2,546,454
5
false
0
0
It looks like you're dealing with data which are saved with some kind of encoding "as if" they were ASCII. XML file should normally be UTF8, and SAX (the underlying parser used by minidom) should handle that, so it looks like something's wrong in that part of the processing chain. Instead of focusing on "cleaning up" ...
1
1
0
I'm using minidom to parse an xml file and it threw an error indicating that the data is not well formed. I figured out that some of the pages have characters like ไอเฟล &, causing the parser to hiccup. Is there an easy way to clean the file before I start parsing it? Right now I'm using a regular expressing ...
Cleaning an XML file in Python before parsing
0
0
1
5,927
2,545,820
2010-03-30T14:07:00.000
6
1
0
0
python
2,545,940
9
false
1
0
ok, not entirely to the point, but before you go and start fixing it, make sure everyone understands the situation. it seems to me that they're putting some pressure on you to fix the "problem". well first of all, when you wrote the application, have they specified the performance requirements? did they tell you that t...
3
11
0
Recently i have developed a billing application for my company with Python/Django. For few months everything was fine but now i am observing that the performance is dropping because of more and more users using that applications. Now the problem is that the application is now very critical for the finance team. Now the...
Optimization Techniques in Python
1
1
0
1,942
2,545,820
2010-03-30T14:07:00.000
4
1
0
0
python
2,546,955
9
true
1
0
A surprising feature of Python is that the pythonic code is quite efficient... So a few general hints: Use built-ins and standard functions whenever possible, they're already quite well optimized. Try to use lazy generators instead one-off temporary lists. Use numpy for vector arithmetic. Use psyco if running on x86 3...
3
11
0
Recently i have developed a billing application for my company with Python/Django. For few months everything was fine but now i am observing that the performance is dropping because of more and more users using that applications. Now the problem is that the application is now very critical for the finance team. Now the...
Optimization Techniques in Python
1.2
1
0
1,942
2,545,820
2010-03-30T14:07:00.000
2
1
0
0
python
2,546,996
9
false
1
0
before you can "fix" something you need to know what is "broken". In software development that means profiling, profiling, profiling. Did I mention profiling. Without profiling you don't know where CPU cycles and wall clock time is going. Like others have said to get any more useful information you need to post the det...
3
11
0
Recently i have developed a billing application for my company with Python/Django. For few months everything was fine but now i am observing that the performance is dropping because of more and more users using that applications. Now the problem is that the application is now very critical for the finance team. Now the...
Optimization Techniques in Python
0.044415
1
0
1,942
2,545,961
2010-03-30T14:26:00.000
3
0
1
0
python,multiprocessing,dictionary
2,546,152
4
false
0
0
Is there a reason that the dictionary needs to be shared in the first place? Could you have each thread maintain their own instance of a dictionary and either merge at the end of the thread processing or periodically use a call-back to merge copies of the individual thread dictionaries together? I don't know exactly w...
1
28
0
I am using Python 2.6 and the multiprocessing module for multi-threading. Now I would like to have a synchronized dict (where the only atomic operation I really need is the += operator on a value). Should I wrap the dict with a multiprocessing.sharedctypes.synchronized() call? Or is another way the way to go?
How to synchronize a python dict with multiprocessing
0.148885
0
0
19,928
2,546,039
2010-03-30T14:35:00.000
3
0
0
0
python,random
2,546,266
4
false
0
0
jumpahead(1) is indeed sufficient (and identical to jumpahead(50000) or any other such call, in the current implementation of random -- I believe that came in at the same time as the Mersenne Twister based implementation). So use whatever argument fits in well with your programs' logic. (Do use a separate random.Rand...
1
4
1
I have a application that does a certain experiment 1000 times (multi-threaded, so that multiple experiments are done at the same time). Every experiment needs appr. 50.000 random.random() calls. What is the best approach to get this really random. I could copy a random object to every experiment and do than a jumpahea...
How should I use random.jumpahead in Python
0.148885
0
0
2,828
2,546,197
2010-03-30T14:55:00.000
3
0
1
1
python,windows
2,546,238
2
false
0
0
Environment settings always happen in the child process and never directly affect the parent process. However you can run (in the same child process that has changed its environment, at the very end of that process) a command (env in Unix-like environment, I believe set in DOS where .bat files lived and in Windows whe...
1
4
0
I call .bat files in Python to set system environments, and check the system environments were set properly, and then back to run python code, the system environments are changed back to original. How can I solve this problem?
How can I keep the system environments set by a bat file, which called by a python script
0.291313
0
0
375
2,547,554
2010-03-30T18:19:00.000
91
0
1
1
python
2,547,577
11
true
0
0
I think it is totally independent. Just install them, then you have the commands e.g. /usr/bin/python2.5 and /usr/bin/python2.6. Link /usr/bin/python to the one you want to use as default. All the libraries are in separate folders (named after the version) anyway. If you want to compile the versions manually, this is ...
3
107
0
Is there official documentation on the Python website somewhere, on how to install and run multiple versions of Python on the same machine on Linux? I can find gazillions of blog posts and answers, but I want to know if there is a "standard" official way of doing this? Or is this all dependent on OS?
Multiple Python versions on the same machine?
1.2
0
0
165,340
2,547,554
2010-03-30T18:19:00.000
0
0
1
1
python
2,547,576
11
false
0
0
It's most strongly dependent on the package distribution system you use. For example, with MacPorts, you can install multiple Python packages and use the pyselect utility to switch the default between them with ease. At all times, you're able to call the different Python interpreters by providing the full path, and yo...
3
107
0
Is there official documentation on the Python website somewhere, on how to install and run multiple versions of Python on the same machine on Linux? I can find gazillions of blog posts and answers, but I want to know if there is a "standard" official way of doing this? Or is this all dependent on OS?
Multiple Python versions on the same machine?
0
0
0
165,340
2,547,554
2010-03-30T18:19:00.000
28
0
1
1
python
2,547,801
11
false
0
0
On Windows they get installed to separate folders, "C:\python26" and "C:\python31", but the executables have the same "python.exe" name. I created another "C:\python" folder that contains "python.bat" and "python3.bat" that serve as wrappers to "python26" and "python31" respectively, and added "C:\python" to the PATH...
3
107
0
Is there official documentation on the Python website somewhere, on how to install and run multiple versions of Python on the same machine on Linux? I can find gazillions of blog posts and answers, but I want to know if there is a "standard" official way of doing this? Or is this all dependent on OS?
Multiple Python versions on the same machine?
1
0
0
165,340
2,548,705
2010-03-30T21:02:00.000
1
1
0
0
python,wsgi
9,439,466
2
false
1
0
Psyco is dead -- its successor is called PyPy. You are unlikely to get any speed increase with an I/O bound application however.
2
2
0
Have you tried Psyco in a wsgi application (custom, Pylons, Django...)? What does your set up look like? Did you get measurable results?
Does anyone have any feedback on using Psyco in a wsgi application?
0.099668
0
0
186
2,548,705
2010-03-30T21:02:00.000
2
1
0
0
python,wsgi
2,553,516
2
true
1
0
The question you should ask is not did you get measurable results, but does it make your site noticeably faster? Most web applications are not CPU bound, so even if JIT makes them faster, you probably weren't fully utilizing your processor to begin with. It has been a very long time since I played with psyco, but orde...
2
2
0
Have you tried Psyco in a wsgi application (custom, Pylons, Django...)? What does your set up look like? Did you get measurable results?
Does anyone have any feedback on using Psyco in a wsgi application?
1.2
0
0
186
2,550,292
2010-03-31T03:19:00.000
6
0
0
0
python,sql,mysql,sqlalchemy
2,550,578
3
false
0
0
In addition to what Alex said... "Not wanting to learn SQL" is probably a bad thing. However, if you want to get more non-technical people involved as part of the development process, ORMs do a pretty good job at it because it does push this level of complexity down a level. One of the elements that has made Django su...
3
24
0
Why do people use SQLAlchemy instead of MySQLdb? What advantages does it offer?
Purpose of SQLAlchemy over MySQLdb
1
1
0
19,410
2,550,292
2010-03-31T03:19:00.000
32
0
0
0
python,sql,mysql,sqlalchemy
2,550,364
3
true
0
0
You don't use SQLAlchemy instead of MySQLdb—you use SQLAlchemy to access something like MySQLdb, oursql (another MySQL driver that I hear is nicer and has better performance), the sqlite3 module, psycopg2, or whatever other database driver you are using. An ORM (like SQLAlchemy) helps abstract away the details of the ...
3
24
0
Why do people use SQLAlchemy instead of MySQLdb? What advantages does it offer?
Purpose of SQLAlchemy over MySQLdb
1.2
1
0
19,410
2,550,292
2010-03-31T03:19:00.000
12
0
0
0
python,sql,mysql,sqlalchemy
2,550,304
3
false
0
0
Easier portability among different DB engines (say that tomorrow you decide you want to move to sqlite, or PostgreSQL, or...), and higher level of abstraction (and thus potentially higher productivity). Those are some of the good reasons. There are also some bad reasons for using an ORM, such as not wanting to learn S...
3
24
0
Why do people use SQLAlchemy instead of MySQLdb? What advantages does it offer?
Purpose of SQLAlchemy over MySQLdb
1
1
0
19,410
2,550,308
2010-03-31T03:25:00.000
0
0
0
0
python,django,views
2,550,450
2
false
1
0
whenever the view needs a particular object from the ORM, it attempts to fetch it using any "id" parameter in several ways (e.g. as a slug, as a database id) (this may be a bad practice...) So... why not just expect a model instance to be passed in as a parameter? Or a QuerySet from which you will take element 0? Th...
2
0
0
These are the techniques that I use regularly to make my views reusable: take the template_name as an argument with a default take an optional extra_context which defaults to empty {} right before the template is rendered the context is updated with the extra_context for further re-usability, call any callable in ex...
how to write re-usable views in django?
0
0
0
151
2,550,308
2010-03-31T03:25:00.000
0
0
0
0
python,django,views
2,550,339
2
false
1
0
I would think that doing all of those puts a large burden on your urlconf to get everything right. Perhaps making a function that takes all that and hardcoding your views to be a glorified wrapper around said function would be better.
2
0
0
These are the techniques that I use regularly to make my views reusable: take the template_name as an argument with a default take an optional extra_context which defaults to empty {} right before the template is rendered the context is updated with the extra_context for further re-usability, call any callable in ex...
how to write re-usable views in django?
0
0
0
151
2,550,370
2010-03-31T03:45:00.000
3
0
1
0
c#,visual-studio,ironpython,ironruby
2,550,627
2
true
0
1
You can't add reference to a project since it's a Visual Studio thing. I suggest that during the development process, call import (IronPython) or require (IronRuby) with the full path of your project assembly like c:\dev\MyProject\bin\Debug\MyProject.dll.
1
2
0
I know how to reference an existing .dll to IronPython, but is there any way to add my project as a reference like I can between Visual Studio projects? Or is it best practice to create a separate class library?
Any way to add my C# project as a reference in IronPython / IronRuby?
1.2
0
0
1,069
2,550,523
2010-03-31T04:37:00.000
1
0
0
1
python,linux,dbus
2,559,633
2
true
0
0
I'm pretty sure that both Pidgin and Empathy assume you're online if you disable NM by right-clicking the Network Manager tray icon and untick Enable Networking. So you can do this when you're connecting via a non-NM mechanism. No code necessary! (You could write an application which implements the same D-Bus interface...
2
0
0
Is there a way using Python to simulate the presence of an active network connection using dbus? If I call getstate() on the dbus, I'm able to get the current network state. I want to set the current state to 4 (Connection Present). This is because Network Manager is not able to connect using my modem and I use other t...
Simulate Network Presence in dbus
1.2
0
0
438
2,550,523
2010-03-31T04:37:00.000
0
0
0
1
python,linux,dbus
2,550,541
2
false
0
0
Your options are to write something that mocks NetworkManager's D-Bus interface, or to write a module for NetworkManager that supports the tools you use.
2
0
0
Is there a way using Python to simulate the presence of an active network connection using dbus? If I call getstate() on the dbus, I'm able to get the current network state. I want to set the current state to 4 (Connection Present). This is because Network Manager is not able to connect using my modem and I use other t...
Simulate Network Presence in dbus
0
0
0
438
2,550,980
2010-03-31T06:51:00.000
0
0
1
0
python,dictionary,dataset,large-files
2,550,988
4
false
0
0
Assuming you are on a *nix platform, you are just BEGGING for tokyo-cabinet... It has a native set of ruby bindings... You can more information at 1978th.net...
1
2
0
I have a set of key/values (all text) that is too large to load in memory at once. I would like to interact with this data via a Python dictionary-like interface. Does such a module already exist? Reading key values should be efficient and values compressed on disk to save space. Edit: Ideally cross platform, but on...
dictionary interface for large data sets
0
0
0
1,360
2,552,605
2010-03-31T11:53:00.000
4
1
0
0
python,pylint
2,552,989
6
true
0
0
No you can't, Global Evaluation is part of the reports and with --reports=n you disable all the reports .
2
8
0
In pylint I use this command --reports=n to disable the reports, but now I don't see the Global evaluation more. Is possible enable only the Global evaluation?
Pylint only Global evaluation
1.2
0
0
2,700
2,552,605
2010-03-31T11:53:00.000
0
1
0
0
python,pylint
3,458,752
6
false
0
0
As systempunttoout said, this is currently not possible. But you can ask for this on the python-projects@logilab.org mailing list, and submitting a patch is a very good way of getting that feature soon. :-)
2
8
0
In pylint I use this command --reports=n to disable the reports, but now I don't see the Global evaluation more. Is possible enable only the Global evaluation?
Pylint only Global evaluation
0
0
0
2,700
2,553,088
2010-03-31T13:04:00.000
2
0
0
0
python,django,django-admin
2,553,104
4
false
1
0
do you have permission to write to the directory?
2
0
0
I'm totally new to django, and I'm using its documentation to get help on how to use it but seems like something is missing. i installed django using setup.py install command and i added the ( django/bin ) to system path variable but. i still cant start a new project i use the following syntax to start a project : d...
Django newbie question: can't start a new project
0.099668
0
0
2,582
2,553,088
2010-03-31T13:04:00.000
0
0
0
0
python,django,django-admin
2,559,610
4
false
1
0
check whether you have djagno or not and the it is in python path or not.if using linux go to terminal type python and then try to import django
2
0
0
I'm totally new to django, and I'm using its documentation to get help on how to use it but seems like something is missing. i installed django using setup.py install command and i added the ( django/bin ) to system path variable but. i still cant start a new project i use the following syntax to start a project : d...
Django newbie question: can't start a new project
0
0
0
2,582
2,553,110
2010-03-31T13:07:00.000
10
0
0
1
python,distutils,cx-freeze
2,553,685
1
true
0
0
You need all of them.
1
2
0
I'm using cx_freeze to freeze a Python script for distribution to other windows systems. I did everything as instructed and cx_freeze generated a build\exe.win32-2.6 folder in the folder containing my sources. This directory now contains a a bunch of PYD files, a library.zip file, the python DLL file and the main exec...
Which files to distribute using cx_Freeze?
1.2
0
0
897
2,554,722
2010-03-31T16:37:00.000
9
0
1
0
.net,python,exception,invalidoperationexception
2,554,808
4
false
0
0
I'd probably go between one of two options: A custom exception, best defined as follows: class InvalidOperationException(Exception): pass Just using Exception I don't believe there's a direct analogue; Python seems to have a very flat exception hierarchy.
2
26
0
What is the analog for .Net InvalidOperationException in Python?
What is the analog for .Net InvalidOperationException in Python?
1
0
0
4,104
2,554,722
2010-03-31T16:37:00.000
20
0
1
0
.net,python,exception,invalidoperationexception
2,554,816
4
true
0
0
There's no direct equivalent. Usually ValueError or TypeError suffices, perhaps a RuntimeError or NotImplementedError if neither of those fit well.
2
26
0
What is the analog for .Net InvalidOperationException in Python?
What is the analog for .Net InvalidOperationException in Python?
1.2
0
0
4,104
2,554,758
2010-03-31T16:41:00.000
0
0
1
0
python,format,specifications
2,555,037
3
false
0
0
I don't believe that it's possible to define a new format specifier for print. You might be able to add a method to your class that sets a format that you use, and define the str method of the class to adjust it's output according to how it was set. Then the main print statement would still use a '%s' specifier, and c...
2
2
0
in python, how can a custom format-specification be added, to a class ? for example, if i write a matrix class, i would like to define a '%M' (or some such) which would then dump the entire contents of the matrix... thanks
custom format specifications in python
0
0
0
1,108
2,554,758
2010-03-31T16:41:00.000
5
0
1
0
python,format,specifications
2,554,780
3
false
0
0
Defining the __str__()/__unicode__() and/or __repr__() methods will let you use the existing %s and %r format specifiers as you like.
2
2
0
in python, how can a custom format-specification be added, to a class ? for example, if i write a matrix class, i would like to define a '%M' (or some such) which would then dump the entire contents of the matrix... thanks
custom format specifications in python
0.321513
0
0
1,108
2,555,393
2010-03-31T18:18:00.000
1
0
1
0
python,distribution
2,555,428
5
false
0
0
Normally you would just include the libraries in the final released version, but not necessarily include them in the source releases.
3
1
0
I'm writing a Python open-source app. My app uses some open source Python libraries. These libraries in turn use other open-source libraries. I intend to release my code at Sourceforge or Google Code but do I need to include the sources of the other libraries? Is this a good practice? ...or should I simply write this i...
Including libraries in project. Best practice
0.039979
0
0
734
2,555,393
2010-03-31T18:18:00.000
1
0
1
0
python,distribution
2,555,599
5
false
0
0
In general (for Python): don't ship the source of other libraries which you depend upon in your code. Just state the required dependencies (complete with minimum required version, installation instructions etc) on a website and in instructions shipped with the source.
3
1
0
I'm writing a Python open-source app. My app uses some open source Python libraries. These libraries in turn use other open-source libraries. I intend to release my code at Sourceforge or Google Code but do I need to include the sources of the other libraries? Is this a good practice? ...or should I simply write this i...
Including libraries in project. Best practice
0.039979
0
0
734
2,555,393
2010-03-31T18:18:00.000
3
0
1
0
python,distribution
2,555,736
5
false
0
0
As others say, do not include the libraries, state the requirements in documentation. This way your project can use the libraries users already have, sometimes provided by their operating system distribution. But then, keep in mind those external dependencies, that may exist in different versions or even configurations...
3
1
0
I'm writing a Python open-source app. My app uses some open source Python libraries. These libraries in turn use other open-source libraries. I intend to release my code at Sourceforge or Google Code but do I need to include the sources of the other libraries? Is this a good practice? ...or should I simply write this i...
Including libraries in project. Best practice
0.119427
0
0
734
2,559,659
2010-04-01T10:21:00.000
2
0
1
1
python,database,jet
2,559,686
4
false
0
0
Probably the most simple solution: Download VirtualBox and install Windows and MS access in it. Write a small Python server which use ODBC to access the database and which receives commands from a network socket. On Linux, connect to the server in the virtual machine and access the database this way. This gives you f...
1
12
0
Is there a way to access a JET database from Python? I'm on Linux. All I found was a .mdb viewer in the repositories, but it's very faulty. Thanks
Accessing a JET (.mdb) database in Python
0.099668
0
0
8,629
2,561,472
2010-04-01T15:20:00.000
0
1
0
0
python,svn,fabric
2,561,630
6
false
0
0
You might need to supply the user as well? If not, you may have better luck exporting your repo and making a tar of it (locally) to upload+deploy on the server. If you run the svn commands locally, you'll be able to get prompted for your username and/or password.
1
7
0
Assuming that I cannot run something like this with Fabric: run("svn update --password 'password' .") how's the proper way to pass to Fabric the password for the remote interactive command line? The problem is that the repo is checked out as svn+ssh and I don't have a http/https/svn option
fabric and svn password
0
0
0
3,015
2,561,542
2010-04-01T15:28:00.000
3
0
0
1
python,eclipse,wxpython
12,983,874
3
false
0
1
wxPython install by default to the following path /usr/local/lib/wxPython-2.9.4.0 When adding a path to the Interpreter libraries section in the eclipse preferences add this path: /usr/local/lib/wxPython-2.9.4.0/lib/python2.7/site-packages/wx-2.9.4-osx_cocoa
2
3
0
I've been browsing documentation, but haven't been able to find a straightforward tutorial, so I apologize if this is a really simple question. Anyway, I have eclipse with pydev installed on MAC OSX, and I want configure wxPython to work with eclipse, how do I do this? Once I've downloaded wxpython, what steps do I tak...
Configuring Eclipse with wxPython
0.197375
0
0
8,700
2,561,542
2010-04-01T15:28:00.000
7
0
0
1
python,eclipse,wxpython
2,562,141
3
false
0
1
Vinay's answer above is correct. However, if code completion is not picking it up, you might need to add the WX directory to the Pydev's interpreter library path. Window | Preferences | Pydev | Interpreter - Python | Libraries If wx is not present, New Folder and select the install directory.
2
3
0
I've been browsing documentation, but haven't been able to find a straightforward tutorial, so I apologize if this is a really simple question. Anyway, I have eclipse with pydev installed on MAC OSX, and I want configure wxPython to work with eclipse, how do I do this? Once I've downloaded wxpython, what steps do I tak...
Configuring Eclipse with wxPython
1
0
0
8,700
2,561,804
2010-04-01T16:05:00.000
4
0
0
0
python,database,cassandra,thrift
2,567,396
1
true
0
0
Use pycassa if you don't know what to use. Use lazyboy if you want it to maintain indexes for you. It's significantly more complex.
1
5
0
I'm going to write the web portal using Cassandra databases. Can you advise me which python interface to use? thrift, lazygal or pycassa? Are there any benefits to use more complicated thrift then cleaner pycassa? What about performace - is the same (all of them are just the layer)? Thanks for any advice.
Cassandra database, which python interface?
1.2
1
0
1,065
2,562,167
2010-04-01T17:03:00.000
4
0
0
0
python,django,template-engine,mako
2,562,356
3
false
1
0
Ask yourself this question: What are you getting out of this project? What do you want to learn? If you want to know the nuts and bolts of a web server the hard way: concoct your own web framework using Mako and other useful building blocks as needed. As @pulegium says, you'll have to choose how to handle the HTTP laye...
3
4
0
I'm making a website that mail users when a movie or a pc game has released. It isn't too complex - users can sign up, choose movies/music or a genre and save the settings. When the movie/music is released - it mails the user. Some other functionality too but this is the jist. Now, I've been working with Python for a b...
What should I use - Mako or Django?
0.26052
0
0
1,845
2,562,167
2010-04-01T17:03:00.000
2
0
0
0
python,django,template-engine,mako
2,562,185
3
true
1
0
Django. Because it takes care for all bits and pieces (url mapping, request object handling etc) and hides the DB access from you as well. If you want you can use SQLite DB so no need for MysQL or other "proper" DBs. If you were using just template engine you'd have to take care of HTTP layer yourself. And the DB stuff...
3
4
0
I'm making a website that mail users when a movie or a pc game has released. It isn't too complex - users can sign up, choose movies/music or a genre and save the settings. When the movie/music is released - it mails the user. Some other functionality too but this is the jist. Now, I've been working with Python for a b...
What should I use - Mako or Django?
1.2
0
0
1,845
2,562,167
2010-04-01T17:03:00.000
0
0
0
0
python,django,template-engine,mako
5,249,036
3
false
1
0
I have used mako for some time and have also tried to get to grips with django in google appengine. If you are a python whizz... definitely opt for Mako. I'm finding django frustrating as the syntax doesn't allow me to do really nice pythonic code. I'm going to drop Mako into my appengine project before it's too late!
3
4
0
I'm making a website that mail users when a movie or a pc game has released. It isn't too complex - users can sign up, choose movies/music or a genre and save the settings. When the movie/music is released - it mails the user. Some other functionality too but this is the jist. Now, I've been working with Python for a b...
What should I use - Mako or Django?
0
0
0
1,845
2,562,697
2010-04-01T18:31:00.000
0
0
1
0
python,numpy,ipython
2,569,226
4
false
0
0
in ipython, ipipe.igrid() can be used to view tabular data.
2
4
1
Is there a data viewer in Python/IPython like the variable editor in MATLAB?
MATLAB-like variable editor in Python
0
0
0
2,415
2,562,697
2010-04-01T18:31:00.000
0
0
1
0
python,numpy,ipython
28,463,696
4
false
0
0
Even Pycharm will be a good option if you are looking for MATLAB like editor.
2
4
1
Is there a data viewer in Python/IPython like the variable editor in MATLAB?
MATLAB-like variable editor in Python
0
0
0
2,415
2,563,528
2010-04-01T20:40:00.000
1
1
0
0
python,pylons
2,563,615
1
true
0
0
You can modify __call__ function in BaseController.
1
1
0
I want to check whether or not a cookie is set with every page load in Pylons. Where's the best place to put this logic? Thanks!
Pylons check for cookie on every page load
1.2
0
0
109
2,563,773
2010-04-01T21:17:00.000
3
1
0
0
python,arrays,numpy,tuples,complex-numbers
2,564,787
2
false
0
0
A numpy array with an extra dimension is tighter in memory use, and at least as fast!, as a numpy array of tuples; complex numbers are at least as good or even better, including for your third question. BTW, you may have noticed that -- while questions asked later than yours were getting answers aplenty -- your was la...
2
10
1
I'm porting an C++ scientific application to python, and as I'm new to python, some problems come to my mind: 1) I'm defining a class that will contain the coordinates (x,y). These values will be accessed several times, but they only will be read after the class instantiation. Is it better to use an tuple or an numpy a...
Better use a tuple or numpy array for storing coordinates
0.291313
0
0
6,196
2,563,773
2010-04-01T21:17:00.000
7
1
0
0
python,arrays,numpy,tuples,complex-numbers
2,564,868
2
true
0
0
In terms of memory consumption, numpy arrays are more compact than Python tuples. A numpy array uses a single contiguous block of memory. All elements of the numpy array must be of a declared type (e.g. 32-bit or 64-bit float.) A Python tuple does not necessarily use a contiguous block of memory, and the elements of th...
2
10
1
I'm porting an C++ scientific application to python, and as I'm new to python, some problems come to my mind: 1) I'm defining a class that will contain the coordinates (x,y). These values will be accessed several times, but they only will be read after the class instantiation. Is it better to use an tuple or an numpy a...
Better use a tuple or numpy array for storing coordinates
1.2
0
0
6,196
2,563,788
2010-04-01T21:22:00.000
0
1
1
0
python,windows,audio,pywin32
10,114,610
3
true
0
0
PyAudiere turns out to be the most convenient. It allows me to simply play an MP3, rather than generate the sound on the fly.
1
3
0
I am trying to get python to make noise when certain things happen. Preferably, i would like to play music of some kind, however some kind of distinctive beeping would be sufficient, like an electronic timer going off. I have thus far only been able to make the system speaker chime using pywin32's Beep, however this si...
Making Noise with Python
1.2
0
0
1,463
2,563,990
2010-04-01T22:04:00.000
3
0
1
0
python
2,564,014
3
false
0
0
To get the files with the latest timestamps for each day, use a dict with days as keys and tuples of (filename, timestamp) as the values. Loop through all the files, and update the dict value for that day if the dict timestamp is less than the current file, or if no value for that day exists yet.
1
1
0
I have an array of files. I'd like to be able to break that array down into one array with multiple subarrays, each subarray contains files that were created on the same day. So right now if the array contains files from March 1 - March 31, I'd like to have an array with 31 subarrays (assuming there is at least > 1 fil...
Python: Taking an array and break it into subarrays based on some criteria
0.197375
0
0
2,256
2,564,137
2010-04-01T22:44:00.000
9
0
1
0
python,multithreading,python-multithreading
18,219,516
6
false
0
0
If you spawn a Thread like so - myThread = Thread(target = function) - and then do myThread.start(); myThread.join(). When CTRL-C is initiated, the main thread doesn't exit because it is waiting on that blocking myThread.join() call. To fix this, simply put in a timeout on the .join() call. The timeout can be as long a...
1
91
0
If I have a thread in an infinite loop, is there a way to terminate it when the main program ends (for example, when I press Ctrl+C)?
How to terminate a thread when main program ends?
1
0
0
184,722
2,564,312
2010-04-01T23:42:00.000
1
0
0
0
python,sql,database,authorization,md5
2,564,367
2
false
0
0
You should use SSL to encrypt the connection, then send the password over plain text from the client. The server will then md5 and compare with the md5 hash in the database to see if they are the same. If so auth = success. MD5'ing the password on the client buys you nothing because a hacker with the md5 password can g...
1
2
0
I currently have a SQL database of passwords stored in MD5. The server needs to generate a unique key, then sends to the client. In the client, it will use the key as a salt then hash together with the password and send back to the server. The only problem is that the the SQL DB has the passwords in MD5 already. Theref...
Server authorization with MD5 and SQL
0.099668
1
0
260
2,564,896
2010-04-02T03:46:00.000
3
0
1
0
python,sorting
2,564,904
3
true
0
0
[x for x in N if n - 10 <= x <= n + 10]
1
3
0
I have 1M numbers:N[], and 1 single number n, now I want to find in those 1M numbers that are similar to that single number, say an area of [n-10, n+10]. what's the best way in python to do this? Do I have to sort the 1M number and do an iteration?
Best way to find similar items in python
1.2
0
0
378
2,565,484
2010-04-02T07:15:00.000
2
0
0
0
python,django,multithreading,django-models
2,565,806
2
false
1
0
But why you need thread? why can't you just do whatever you want to do in django view? If you are using servers like apache with mod-wsgi you should be able to have good control over number of process and threads , so that part shouldn't be your worry or should not be in django views.
2
0
0
One of my applications in my Django project require each request/visitor to that instance to have their own thread. This might sound confusing, so I'll describe what I'm looking to accomplish in a case based scenario, with steps: User visits application Thread starts Until the thread finishes, that user's server insta...
Django - Threading in views without hanging the server
0.197375
0
0
458
2,565,484
2010-04-02T07:15:00.000
0
0
0
0
python,django,multithreading,django-models
4,045,424
2
false
1
0
I dread to think why you'd want to do that. Are you sure you're not looking for session variables?
2
0
0
One of my applications in my Django project require each request/visitor to that instance to have their own thread. This might sound confusing, so I'll describe what I'm looking to accomplish in a case based scenario, with steps: User visits application Thread starts Until the thread finishes, that user's server insta...
Django - Threading in views without hanging the server
0
0
0
458
2,565,776
2010-04-02T08:43:00.000
0
0
0
0
python,wxpython,cursor
2,565,793
2
true
1
0
Use two cursors and change them on events as they need to be.
1
0
0
I want to use the google maps hand cursor in Python but I don't know how to do it. I've downloaded the cursor but I only get to use the hand open, I also have a event that "closes" the hand when clicked but I don't know how can I change the style cursor on it. I say this because the google maps hand cursor has two styl...
How use the google maps hand cursor in Python?
1.2
0
0
593
2,566,357
2010-04-02T11:24:00.000
0
0
1
0
python,macports
2,566,581
2
false
0
0
If you simply want the latest version, couldn't you just not install the old version? If you are planning to build and deploy the svn version yourself and want to test it while not removing the old version, you might find virtualenv useful. It allows you to deploy a parallel Python environment with its own independent ...
1
2
0
I am installing one library for python from MacPorts. But macports version of the library is older than actual development svn version. Is it possible to specify a custom location for a port installation in MacPorts so I could install latest library from the developer's site?
MacPorts manual port location
0
0
0
725
2,567,895
2010-04-02T16:48:00.000
0
1
0
1
python,eclipse,pydev
15,892,577
1
false
1
0
there's an easy way to install plugin for eclipse, download the pydev package zip file (not install it via eclipse update), extract it, and put it into your eclipse/dropins/pydev folder. this is a hidden way to install plugin.
1
0
0
I'm having difficulty getting PyDev to work. I had an installation of Eclipse for PHP developers (1.2.1.20090918-0703). A month ago, I installed PyDev, and everything worked great. I go to fire it up this morning, and PyDev is gone. There is no option to create a Python project, the Python language editor is missing, e...
Eclipse: PyDev installation difficulties
0
0
0
1,097
2,568,707
2010-04-02T19:23:00.000
0
0
0
0
python,algorithm,math,matlab,digital-filter
2,569,232
7
false
0
0
It seems unlikely that you'll find exactly what you seek already written in Python, but perhaps the Matlab function's help page gives or references a description of the algorithm?
1
3
1
I am porting code from Matlab to Python and am having trouble finding a replacement for the firls( ) routine. It is used for, least-squares linear-phase Finite Impulse Response (FIR) filter design. I looked at scipy.signal and nothing there looked like it would do the trick. Of course I was able to replace my remez a...
Does Python/Scipy have a firls( ) replacement (i.e. a weighted, least squares, FIR filter design)?
0
0
0
4,383
2,568,783
2010-04-02T19:38:00.000
3
0
1
0
python,random,integer,boundary
2,568,804
4
false
0
0
I don't think there's a reason for that. But at least it's documented.
2
57
0
It has always seemed strange to me that random.randint(a, b) would return an integer in the range [a, b], instead of [a, b-1] like range(...). Is there any reason for this apparent inconsistency?
Python: why does `random.randint(a, b)` return a range inclusive of `b`?
0.148885
0
0
61,160
2,568,783
2010-04-02T19:38:00.000
9
0
1
0
python,random,integer,boundary
2,568,995
4
false
0
0
This is speculation, but normal human usage of 'give me a random number from a to b' is inclusive. Implementing it that way sort of makes sense, given Python's general philosophy of being a more human-readable language.
2
57
0
It has always seemed strange to me that random.randint(a, b) would return an integer in the range [a, b], instead of [a, b-1] like range(...). Is there any reason for this apparent inconsistency?
Python: why does `random.randint(a, b)` return a range inclusive of `b`?
1
0
0
61,160
2,569,089
2010-04-02T20:42:00.000
1
0
0
0
python,html,http,forms,screen-scraping
2,574,423
2
false
1
0
If it uses meta tags then you need to parse the HTML manually. Otherwise mechanize will handle the redirect automatically.
1
1
0
I'm trying to submit a few forms through a Python script, I'm using the mechanized library. This is so I can implement a temporary API. The problem is that before after submission a blank page is returned informing that the request is being processed, after a few seconds the page is redirected to the final page. I und...
How to handle redirects while parsing HTML? - Python
0.099668
0
1
553
2,569,427
2010-04-02T22:00:00.000
-1
0
0
0
php,python,mysql
2,569,567
3
false
0
0
No, there is no way that I've ever heard of or can think of to connect to a MySQL database with vanilla python. Just install the MySqldb python package- You can typically do: sudo easy_install MySqldb
2
0
0
Is there an easy way (without downloading any plugins) to connect to a MySQL database in Python? Also, what would be the difference from calling a PHP script to retrieve the data from the database and hand it over to Python and importing one of these third-parties plugins that requires some additional software in the s...
Python and MySQL
-0.066568
1
0
332
2,569,427
2010-04-02T22:00:00.000
-1
0
0
0
php,python,mysql
2,569,448
3
false
0
0
If you don't want to download the python libraries to connect to MySQL, the effective answer is no, not trivially.
2
0
0
Is there an easy way (without downloading any plugins) to connect to a MySQL database in Python? Also, what would be the difference from calling a PHP script to retrieve the data from the database and hand it over to Python and importing one of these third-parties plugins that requires some additional software in the s...
Python and MySQL
-0.066568
1
0
332
2,569,503
2010-04-02T22:21:00.000
3
0
1
0
python,hash,mixed-case
2,569,508
2
true
0
0
you can base64 encode the output of the hash. This has a couple of additional characters beyond those you mentioned.
1
1
0
I am having a hard time figuring out a reasonable way to generate a mixed-case hash in Python. I want to generate something like: aZeEe9E Right now I'm using MD5, which doesn't generate case-sensitive hashes. Do any of you know how to generate a hash value consisting of upper- and lower- case characters + numbers? - Ok...
How to generate a mixed-case hash in Python?
1.2
0
0
1,256
2,570,193
2010-04-03T04:03:00.000
0
0
0
0
python,django,twitter
2,570,547
3
false
1
0
I'm not sure exactly what you're asking, but what's wrong with something like {{ user.get_absolute_url }}? For the tag detail URLs, it really depends on what you're looking for, but you would have to construct the url and view for that yourself.
1
0
0
I'm writing a twitter-like note-taking web app. In a page the latest 20 notes of the user will be listed, and when the user scroll to the bottom of the browser window more items will be loaded and rendered. The initial 20 notes are part of the generated html of my django template, but the other dynamically loaded item...
How to convert tag-and-username-like text into proper links in a twitter message?
0
0
0
207
2,570,621
2010-04-03T08:07:00.000
0
1
0
0
php,python,ftp,curl,multithreading
6,735,686
4
false
0
0
You can run the script in multiple command prompts / shells (just make sure each file is only handled once by all the different scripts). I am not sure if this quick and dirty trick will improve transfer speed though..
1
3
0
I need to upload multiple files from directory to the server via FTP and SFTP. I've solved this task for SFTP with python, paramiko and threading. But I have problem with doing it for FTP. I tried to use ftplib for python, but it seems that it doesn't support threading and I upload all files one by one, which is very s...
Multithreaded FTP upload. Is it possible?
0
0
1
4,789
2,571,202
2010-04-03T12:07:00.000
4
0
0
0
python,user-interface,gtk,pygtk,gnome
2,571,279
1
true
0
1
I think that you should use ComboBox.set_row_separator_func to set a separator function where you would determine which items of your list will be separators. Since ListStore implements TreeModel interface, you should have no problem simply using it in your case. P.S.: nothing is easy in GTK :)
1
4
0
I'm using gtk.combo_box_new_text() to make combobox list, this uses a gtk.ListStore to store only strings, so there are some way to add a separator between items without use a complex gtk.TreeModel? If this is not possible, what is the simplest way to use a gtk.TreeModel to able secuential widget addition?
How to add a separator in a PyGTK combobox?
1.2
0
0
825
2,573,044
2010-04-03T23:32:00.000
1
0
0
0
python,timeout,httpresponse
3,602,969
4
false
0
0
Setting the default timeout might abort a download early if it's large, as opposed to only aborting if it stops receiving data for the timeout value. HTTPlib2 is probably the way to go.
1
1
0
I'm building a download manager in python for fun, and sometimes the connection to the server is still on but the server doesn't send me data, so read method (of HTTPResponse) block me forever. This happens, for example, when I download from a server, which located outside of my country, that limit the bandwidth to oth...
set timeout to http response read method in python
0.049958
0
1
3,858
2,573,132
2010-04-04T00:25:00.000
20
0
0
0
python,r,interface,python-3.x
2,661,971
3
true
0
0
edit: Rewrite to summarize the edits that accumulated over time. The current rpy2 release (2.3.x series) has full support for Python 3.3, while no claim is made about Python 3.0, 3.1, or 3.2. At the time of writing the next rpy2 release (under development, 2.4.x series) is only supporting Python 3.3. History of Python ...
1
12
1
I am using Python 3.1.1 on Mac OS X 10.6.2 and need an interface to R. When browsing the internet I found out about RPy. Is this the right choice? Currently, a program in Python computes a distance matrix and, stores it in a file. I invoke R separately in an interactive way and read in the matrix for cluster analysis....
What is the best interface from Python 3.1.1 to R?
1.2
0
0
4,111
2,573,135
2010-04-04T00:28:00.000
2
1
0
0
python
2,573,225
19
false
0
0
Not precisely what you're asking for, but I think it's good advice. Learn another language, doesn't matter too much which. Each language has it's own ideas and conventions that you can learn from. Learn about the differences in the languages and more importantly why they're different. Try a purely functional languag...
5
659
0
I've been learning, working, and playing with Python for a year and a half now. As a biologist slowly making the turn to bio-informatics, this language has been at the very core of all the major contributions I have made in the lab. I more or less fell in love with the way Python permits me to express beautiful solutio...
Python progression path - From apprentice to guru
0.02105
0
0
383,814
2,573,135
2010-04-04T00:28:00.000
24
1
0
0
python
4,147,969
19
false
0
0
If you're in and using python for science (which it seems you are) part of that will be learning and understanding scientific libraries, for me these would be numpy scipy matplotlib mayavi/mlab chaco Cython knowing how to use the right libraries and vectorize your code is essential for scientific computing. I wante...
5
659
0
I've been learning, working, and playing with Python for a year and a half now. As a biologist slowly making the turn to bio-informatics, this language has been at the very core of all the major contributions I have made in the lab. I more or less fell in love with the way Python permits me to express beautiful solutio...
Python progression path - From apprentice to guru
1
0
0
383,814
2,573,135
2010-04-04T00:28:00.000
41
1
0
0
python
2,576,226
19
false
0
0
I'll give you the simplest and most effective piece of advice I think anybody could give you: code. You can only be better at using a language (which implies understanding it) by coding. You have to actively enjoy coding, be inspired, ask questions, and find answers by yourself. Got a an hour to spare? Write code that ...
5
659
0
I've been learning, working, and playing with Python for a year and a half now. As a biologist slowly making the turn to bio-informatics, this language has been at the very core of all the major contributions I have made in the lab. I more or less fell in love with the way Python permits me to express beautiful solutio...
Python progression path - From apprentice to guru
1
0
0
383,814
2,573,135
2010-04-04T00:28:00.000
12
1
0
0
python
2,573,531
19
false
0
0
Thoroughly Understand All Data Types and Structures For every type and structure, write a series of demo programs that exercise every aspect of the type or data structure. If you do this, it might be worthwhile to blog notes on each one... it might be useful to lots of people!
5
659
0
I've been learning, working, and playing with Python for a year and a half now. As a biologist slowly making the turn to bio-informatics, this language has been at the very core of all the major contributions I have made in the lab. I more or less fell in love with the way Python permits me to express beautiful solutio...
Python progression path - From apprentice to guru
1
0
0
383,814
2,573,135
2010-04-04T00:28:00.000
3
1
0
0
python
4,169,614
19
false
0
0
Teaching to someone else who is starting to learn Python is always a great way to get your ideas clear and sometimes, I usually get a lot of neat questions from students that have me to re-think conceptual things about Python.
5
659
0
I've been learning, working, and playing with Python for a year and a half now. As a biologist slowly making the turn to bio-informatics, this language has been at the very core of all the major contributions I have made in the lab. I more or less fell in love with the way Python permits me to express beautiful solutio...
Python progression path - From apprentice to guru
0.031568
0
0
383,814
2,573,670
2010-04-04T05:30:00.000
4
1
0
0
python,simplehttpserver
2,573,685
5
false
0
0
There is no one liner which would do it, also what do you mean by "download whole dir" as tar or zip? Anyway you can follow these steps Derive a class from SimpleHTTPRequestHandler or may be just copy its code Change list_directory method to return a link to "download whole folder" Change copyfile method so that for ...
1
6
0
I really like how I can easily share files on a network using the SimpleHTTPServer, but I wish there was an option like "download entire directory". Is there an easy (one liner) way to implement this? Thanks
Download whole directories in Python SimpleHTTPServer
0.158649
0
1
11,099
2,574,195
2010-04-04T10:55:00.000
0
0
0
0
python,qt,qt4,pyqt
2,574,214
2
false
0
1
How about creating multiple cursors (QTextCursor), each selection a different portion of the text. Would that work for you?
2
1
0
Qt3.3 used to allow for multiple selections in the QTextEdit widget by calling the setSelection() function and specifying a different selection id (selNum) as the last argument in that function. In Qt4, to create a selection, I do it by creating a QTextCursor object and call the setPosition() or movePosition() methods...
how to create multiple selections in text edit box in qt4?
0
0
0
1,173
2,574,195
2010-04-04T10:55:00.000
1
0
0
0
python,qt,qt4,pyqt
2,574,559
2
true
0
1
The solution, i realise now is actually quite simple. To graphically visualise all the various selections (separate QTextCursor objects), instead of calling the setTextCursor() method for the QTextEdit widget for each of the selections, i change the background color of each of those sections of text by calling the set...
2
1
0
Qt3.3 used to allow for multiple selections in the QTextEdit widget by calling the setSelection() function and specifying a different selection id (selNum) as the last argument in that function. In Qt4, to create a selection, I do it by creating a QTextCursor object and call the setPosition() or movePosition() methods...
how to create multiple selections in text edit box in qt4?
1.2
0
0
1,173
2,574,451
2010-04-04T13:04:00.000
0
0
0
0
python,django,django-evolution
2,574,461
4
false
1
0
You need to add it to your INSTALLED_APPS section of settings.py.
4
0
0
When I run python manage.py shell I get an error about the last app I've added to INSTALLED_APPS, namely django-evolution, saying it's an undefined module. This is despite the fact that I've added the path to django-evolution to the system path. In fact right after this error I can run python and do an import on django...
Django manage.py can't find an INSTALLED_APP even though the module is in the path
0
0
0
2,147
2,574,451
2010-04-04T13:04:00.000
1
0
0
0
python,django,django-evolution
2,575,989
4
false
1
0
Does your django_evolution have a init.py file in it? Also any folder containing django_evolution needs one.
4
0
0
When I run python manage.py shell I get an error about the last app I've added to INSTALLED_APPS, namely django-evolution, saying it's an undefined module. This is despite the fact that I've added the path to django-evolution to the system path. In fact right after this error I can run python and do an import on django...
Django manage.py can't find an INSTALLED_APP even though the module is in the path
0.049958
0
0
2,147
2,574,451
2010-04-04T13:04:00.000
0
0
0
0
python,django,django-evolution
8,602,397
4
false
1
0
If you are using virtualenv and ipython is installed at the system level but your app at the env level, it will lead to this. The way out of it is to remove ipython from the system and to install it into your env.
4
0
0
When I run python manage.py shell I get an error about the last app I've added to INSTALLED_APPS, namely django-evolution, saying it's an undefined module. This is despite the fact that I've added the path to django-evolution to the system path. In fact right after this error I can run python and do an import on django...
Django manage.py can't find an INSTALLED_APP even though the module is in the path
0
0
0
2,147
2,574,451
2010-04-04T13:04:00.000
0
0
0
0
python,django,django-evolution
52,769,162
4
false
1
0
I know this is super old, but in case anyone has this issue, my issue was because I had elevated to root inside my venv. I had initialized my virtual environment, and then upgraded my privileges to root. If deactivate doesn't work and you're root, then you should exit then deactivate, then you can do sudo su and then s...
4
0
0
When I run python manage.py shell I get an error about the last app I've added to INSTALLED_APPS, namely django-evolution, saying it's an undefined module. This is despite the fact that I've added the path to django-evolution to the system path. In fact right after this error I can run python and do an import on django...
Django manage.py can't find an INSTALLED_APP even though the module is in the path
0
0
0
2,147
2,575,810
2010-04-04T20:40:00.000
6
0
1
0
python,regex
2,575,830
3
true
0
0
No, not really. Regex is not the correct tool to parse nested structures like you describe; instead you will need to parse the C syntax (or the "dumb subset" of it you're interested in, anyway), and you might find regex helpful in that. A relatively simple state machine with three states (CODE, STRING, COMMENT) would ...
1
0
0
I am trying to count characters in comments included in C code using Python and Regex, but no success. I can erase strings first to get rid of comments in strings, but this will erase string in comments too and result will be bad ofc. Is there any chance to ask by using regex to not match strings in comments or vice ve...
Comments in string and strings in comments
1.2
0
0
931
2,576,320
2010-04-04T23:49:00.000
1
0
1
0
python
2,576,337
3
false
0
0
That is correct, or very close. Jython and IronPython have changed their numbering scheme to match the CPython version whose features they most closely implement.
3
5
0
for example Jython is at version 2.5.1, does that imply a parallel fidelity to cpython syntax when it was at version 2.5.1?
Do alternate python implementation version numbers imply that they provide the same syntax?
0.066568
0
0
108
2,576,320
2010-04-04T23:49:00.000
1
0
1
0
python
2,576,420
3
false
0
0
The syntax (and feature set) are controlled strictly by the first two numbers -- every 2.5.* is claiming to implement the same syntax and feature set (in terms of language definition, not of aspects the language-reference manual explicitly leaves up to the implementation: for example, both Jython and IronPython have 'b...
3
5
0
for example Jython is at version 2.5.1, does that imply a parallel fidelity to cpython syntax when it was at version 2.5.1?
Do alternate python implementation version numbers imply that they provide the same syntax?
0.066568
0
0
108
2,576,320
2010-04-04T23:49:00.000
2
0
1
0
python
2,576,341
3
false
0
0
Generally yes, but there's technically nothing stopping alternate implementations from choosing whatever version numbers they want. It's also important to note that just because Jython 2.5.1 is intended to match CPython 2.5.1, doesn't mean that they're going to behave exactly the same or be entirely compatible -- consi...
3
5
0
for example Jython is at version 2.5.1, does that imply a parallel fidelity to cpython syntax when it was at version 2.5.1?
Do alternate python implementation version numbers imply that they provide the same syntax?
0.132549
0
0
108
2,577,967
2010-04-05T10:59:00.000
1
0
0
0
python,database,nosql,data-mining
2,981,162
9
false
0
0
It has been a couple of months since I posted this question and I wanted to let you all know how I solved this problem. I am using Berkeley DB with the module bsddb instead loading all the data in a Python dictionary. I am not fully happy, but my users are. My next step is trying to get a shared server with redis, but ...
7
15
0
I am an occasional Python programer who only have worked so far with MYSQL or SQLITE databases. I am the computer person for everything in a small company and I have been started a new project where I think it is about time to try new databases. Sales department makes a CSV dump every week and I need to make a small s...
Best DataMining Database
0.022219
1
0
11,416
2,577,967
2010-04-05T10:59:00.000
0
0
0
0
python,database,nosql,data-mining
2,581,460
9
false
0
0
Take a look at mongodb.
7
15
0
I am an occasional Python programer who only have worked so far with MYSQL or SQLITE databases. I am the computer person for everything in a small company and I have been started a new project where I think it is about time to try new databases. Sales department makes a CSV dump every week and I need to make a small s...
Best DataMining Database
0
1
0
11,416
2,577,967
2010-04-05T10:59:00.000
12
0
0
0
python,database,nosql,data-mining
2,577,979
9
false
0
0
You probably do need a full relational DBMS, if not right now, very soon. If you start now while your problems and data are simple and straightforward then when they become complex and difficult you will have plenty of experience with at least one DBMS to help you. You probably don't need MySQL on all desktops, you m...
7
15
0
I am an occasional Python programer who only have worked so far with MYSQL or SQLITE databases. I am the computer person for everything in a small company and I have been started a new project where I think it is about time to try new databases. Sales department makes a CSV dump every week and I need to make a small s...
Best DataMining Database
1
1
0
11,416
2,577,967
2010-04-05T10:59:00.000
1
0
0
0
python,database,nosql,data-mining
2,578,659
9
false
0
0
It sounds like each department has their own feudal database, and this implies a lot of unnecessary redundancy and inefficiency. Instead of transferring hundreds of megabytes to everyone across your network, why not keep your data in MySQL and have the departments upload their data to the database, where it can be norm...
7
15
0
I am an occasional Python programer who only have worked so far with MYSQL or SQLITE databases. I am the computer person for everything in a small company and I have been started a new project where I think it is about time to try new databases. Sales department makes a CSV dump every week and I need to make a small s...
Best DataMining Database
0.022219
1
0
11,416
2,577,967
2010-04-05T10:59:00.000
0
0
0
0
python,database,nosql,data-mining
2,578,310
9
false
0
0
If you have that problem with a CSV file, maybe you can just pickle the dictionary and generate a pickle "binary" file with pickle.HIGHEST_PROTOCOL option. It can be faster to read and you get a smaller file. You can load the CSV file once and then generate the pickled file, allowing faster load in next accesses. Anywa...
7
15
0
I am an occasional Python programer who only have worked so far with MYSQL or SQLITE databases. I am the computer person for everything in a small company and I have been started a new project where I think it is about time to try new databases. Sales department makes a CSV dump every week and I need to make a small s...
Best DataMining Database
0
1
0
11,416
2,577,967
2010-04-05T10:59:00.000
1
0
0
0
python,database,nosql,data-mining
2,578,080
9
false
0
0
Have you done any bench marking to confirm that it is the text files that are slowing you down? If you haven't, there's a good chance that tweaking some other part of the code will speed things up so that it's fast enough.
7
15
0
I am an occasional Python programer who only have worked so far with MYSQL or SQLITE databases. I am the computer person for everything in a small company and I have been started a new project where I think it is about time to try new databases. Sales department makes a CSV dump every week and I need to make a small s...
Best DataMining Database
0.022219
1
0
11,416
2,577,967
2010-04-05T10:59:00.000
1
0
0
0
python,database,nosql,data-mining
2,578,751
9
false
0
0
Does the machine this process runs on have sufficient memory and bandwidth to handle this efficiently? Putting MySQL on a slow machine and recoding the tool to use MySQL rather than text files could potentially be far more costly than simply adding memory or upgrading the machine.
7
15
0
I am an occasional Python programer who only have worked so far with MYSQL or SQLITE databases. I am the computer person for everything in a small company and I have been started a new project where I think it is about time to try new databases. Sales department makes a CSV dump every week and I need to make a small s...
Best DataMining Database
0.022219
1
0
11,416
2,578,540
2010-04-05T13:18:00.000
0
1
0
0
python,django,cakephp,web-frameworks,yii
2,844,890
8
false
1
0
If for the PHP part I would choose CodeIgniter - it doesn't get too much into your way. But it doesn't have any code/view/model generators out of the box, you need to type a bit. But languages other than PHP appear to be more sexy.
5
21
0
I have to develop a site which has to accomodate around 2000 users a day and speed is a criterion for it. Moreover, the site is a user oriented one where the user will be able to log in and check his profile, register for specific events he/she wants to participate in. The site is to be hosted on a VPS server.Although ...
PHP Frameworks (CodeIgniter, Yii, CakePHP) vs. Django
0
0
0
30,143
2,578,540
2010-04-05T13:18:00.000
4
1
0
0
python,django,cakephp,web-frameworks,yii
10,847,083
8
false
1
0
Codeigniter it's fast and very documented also has a large community to and finaly friendly with the programmer.
5
21
0
I have to develop a site which has to accomodate around 2000 users a day and speed is a criterion for it. Moreover, the site is a user oriented one where the user will be able to log in and check his profile, register for specific events he/she wants to participate in. The site is to be hosted on a VPS server.Although ...
PHP Frameworks (CodeIgniter, Yii, CakePHP) vs. Django
0.099668
0
0
30,143
2,578,540
2010-04-05T13:18:00.000
0
1
0
0
python,django,cakephp,web-frameworks,yii
7,084,868
8
false
1
0
I am using CodeIgniter 1.7.2 and for complex websites it's very good and powerfull, but it definitely is missing some kind of code generator which will allow for example to build an IT application in one click. I had the impression (from watching a tutorial) that Django has it.
5
21
0
I have to develop a site which has to accomodate around 2000 users a day and speed is a criterion for it. Moreover, the site is a user oriented one where the user will be able to log in and check his profile, register for specific events he/she wants to participate in. The site is to be hosted on a VPS server.Although ...
PHP Frameworks (CodeIgniter, Yii, CakePHP) vs. Django
0
0
0
30,143
2,578,540
2010-04-05T13:18:00.000
31
1
0
0
python,django,cakephp,web-frameworks,yii
2,578,635
8
false
1
0
This is a very subjective question but personally I'd recommend Django. Python is a very nice language to use and the Django framework is small, easy to use, well documented and also has a pretty active community. This choice was made partly because of my dislike for PHP though, so take the recommendation with a pinch ...
5
21
0
I have to develop a site which has to accomodate around 2000 users a day and speed is a criterion for it. Moreover, the site is a user oriented one where the user will be able to log in and check his profile, register for specific events he/she wants to participate in. The site is to be hosted on a VPS server.Although ...
PHP Frameworks (CodeIgniter, Yii, CakePHP) vs. Django
1
0
0
30,143
2,578,540
2010-04-05T13:18:00.000
29
1
0
0
python,django,cakephp,web-frameworks,yii
2,578,670
8
true
1
0
Most of the frameworks out there nowadays are fast enough to serve whatever needs you will have. It really depends on in which environment you feel most comfortable. Though there are nuances here and there, MVC frameworks share a lot of the same principles, so whichever you choose to use is really a matter of which you...
5
21
0
I have to develop a site which has to accomodate around 2000 users a day and speed is a criterion for it. Moreover, the site is a user oriented one where the user will be able to log in and check his profile, register for specific events he/she wants to participate in. The site is to be hosted on a VPS server.Although ...
PHP Frameworks (CodeIgniter, Yii, CakePHP) vs. Django
1.2
0
0
30,143
2,579,535
2010-04-05T16:32:00.000
0
0
1
0
python,angle,degrees,format-conversion,unit-conversion
2,579,617
11
false
0
0
Use fmod and rounding to get the degrees and fraction separated. Multiply the fraction by 60 and repeat to get minutes and a remainder. Then multiply that last part by 60 again to get the number of seconds.
1
19
0
How do you convert Decimal Degrees to Degrees Minutes Seconds In Python? Is there a Formula already written?
Convert DD (decimal degrees) to DMS (degrees minutes seconds) in Python?
0
0
0
42,007
2,579,840
2010-04-05T17:26:00.000
0
0
1
0
python,getter-setter
55,134,465
8
false
0
0
I had come here for that answer(unfortunately i couldn't) . But i found a work around else where . This below code could be alternative for get . class get_var_lis: def __init__(self): pass def __call__(self): return [2,3,4] def __iter__(self): return iter([2,3,4]) some_other_var = g...
2
87
0
Using get/set seems to be a common practice in Java (for various reasons), but I hardly see Python code that uses this. Why do you use or avoid get/set methods in Python?
Do you use the get/set pattern (in Python)?
0
0
0
98,318