Available Count
int64
1
31
AnswerCount
int64
1
35
GUI and Desktop Applications
int64
0
1
Users Score
int64
-17
588
Q_Score
int64
0
6.79k
Python Basics and Environment
int64
0
1
Score
float64
-1
1.2
Networking and APIs
int64
0
1
Question
stringlengths
15
7.24k
Database and SQL
int64
0
1
Tags
stringlengths
6
76
CreationDate
stringlengths
23
23
System Administration and DevOps
int64
0
1
Q_Id
int64
469
38.2M
Answer
stringlengths
15
7k
Data Science and Machine Learning
int64
0
1
ViewCount
int64
13
1.88M
is_accepted
bool
2 classes
Web Development
int64
0
1
Other
int64
1
1
Title
stringlengths
15
142
A_Id
int64
518
72.2M
1
3
0
11
6
0
1
0
I want to send some modem AT commands using python code, and am wondering what is the keycode for the key combination control+z Gath
0
python
2009-09-16T07:30:00.000
0
1,431,495
Key code? If you send AT commands you are probably sending strings with ascii text and control codes, right? Ctrl-Z is usually 26 (decimal). So chr(26) should work, or if it's a part of a string, '\x1a' as 26 decimal is 1A hex. That said, Ctrl-Z is not usually a part of the AT command set... so if this doesn't help you...
0
13,499
false
0
1
What is the keycode for control+z key in python?
1,431,524
1
3
0
2
1
0
0.132549
0
I have a cherrypy web server that uses larges amounts of HTML data. Is there anyway in Python to minimize the HTML so that all comments, spaces, ext, are removed?
0
python,html,minimize
2009-09-17T07:59:00.000
0
1,437,357
there are bindings to tidy for python, called mxTidy from eGenix (Marc André Lemburg)
0
1,549
false
1
1
Python HTML Minimizer
1,531,684
2
2
1
0
7
0
0
0
I am embedding a c++ library (binding done with SIP) in my python application. Under certain circonstances (error cases), this library uses exit(), which causes my entire application to exit. Is there a way to catch this event, or do I need to modify the library to handle error cases differently ? Thank you very much...
0
python,exception,binding,exit
2009-09-17T15:19:00.000
0
1,439,533
You can override the library linking with LD_LIBRARY_PATH and make your own exit function. Works fine.
0
1,407
false
0
1
How to catch exit() in embedded C++ module from python code?
8,099,938
2
2
1
7
7
0
1.2
0
I am embedding a c++ library (binding done with SIP) in my python application. Under certain circonstances (error cases), this library uses exit(), which causes my entire application to exit. Is there a way to catch this event, or do I need to modify the library to handle error cases differently ? Thank you very much...
0
python,exception,binding,exit
2009-09-17T15:19:00.000
0
1,439,533
You must modify the source of the library. There is no "exception handling" in C and exit() does not return to the calling code under any circumstances.
0
1,407
true
0
1
How to catch exit() in embedded C++ module from python code?
1,439,585
3
5
0
1
7
1
0.039979
0
I write a lot of scripts in Python to analyze and plot experimental data as well as write simple simulations to test how theories fit the data. The scripts tend to be very procedural; calculate some property, calculate some other property, plot properties, analyze plot... Rather than just writing a procedure, would th...
0
python,oop,class-design,procedural-programming
2009-09-17T18:07:00.000
0
1,440,434
OOP lends itself well to complex programs. It's great for capturing the state and behavior of real world concepts and orchestrating the interplay between them. Good OO code is easy to read/understand, protects your data's integrity, and maximizes code reuse. I'd say code reuse is one big advantage to keeping your frequ...
0
4,545
false
0
1
Class usage in Python
1,440,734
3
5
0
1
7
1
0.039979
0
I write a lot of scripts in Python to analyze and plot experimental data as well as write simple simulations to test how theories fit the data. The scripts tend to be very procedural; calculate some property, calculate some other property, plot properties, analyze plot... Rather than just writing a procedure, would th...
0
python,oop,class-design,procedural-programming
2009-09-17T18:07:00.000
0
1,440,434
Object-oriented programming isn't the solution to every coding problem. In Python, functions are objects. You can mix as many objects and functions as you want. Modules with functions are already objects with properties. If you find yourself passing a lot of the same variables around — state — an object is probably bet...
0
4,545
false
0
1
Class usage in Python
1,447,527
3
5
0
4
7
1
0.158649
0
I write a lot of scripts in Python to analyze and plot experimental data as well as write simple simulations to test how theories fit the data. The scripts tend to be very procedural; calculate some property, calculate some other property, plot properties, analyze plot... Rather than just writing a procedure, would th...
0
python,oop,class-design,procedural-programming
2009-09-17T18:07:00.000
0
1,440,434
You don't need to use classes in Python - it doesn't force you to do OOP. If you're more comfortable with the functional style, that's fine. I use classes when I want to model some abstraction which has variations, and I want to model those variations using classes. As the word "class" implies, they're useful mainly wh...
0
4,545
false
0
1
Class usage in Python
1,440,655
3
7
0
0
8
0
0
0
I'd like to know if it's possible to find out the "command" that a PID is set to. When I say command, I mean what you see in the last column when you run the command "top" in a linux shell. I'd like to get this information from Python somehow when I have a specific PID. Any help would be great. Thanks.
0
python,linux,process
2009-09-17T19:44:00.000
1
1,440,941
The proc filesystem exports this (and other) information. Look at the /proc/PID/cmd symlink.
0
9,565
false
0
1
Finding the command for a specific PID in Linux from Python
1,440,965
3
7
0
5
8
0
0.141893
0
I'd like to know if it's possible to find out the "command" that a PID is set to. When I say command, I mean what you see in the last column when you run the command "top" in a linux shell. I'd like to get this information from Python somehow when I have a specific PID. Any help would be great. Thanks.
0
python,linux,process
2009-09-17T19:44:00.000
1
1,440,941
Look in /proc/$PID/cmdline, and then os.readlink() on /proc/$PID/exe. /proc/$PID/cmdline is not necessarily going to be correct, as a program can change its argument vector or it may not contain a full path. Three examples of this from my current process list are: avahi-daemon: chroot helper qmgr -l -t fifo -u /usr/sb...
0
9,565
false
0
1
Finding the command for a specific PID in Linux from Python
1,443,544
3
7
0
6
8
0
1
0
I'd like to know if it's possible to find out the "command" that a PID is set to. When I say command, I mean what you see in the last column when you run the command "top" in a linux shell. I'd like to get this information from Python somehow when I have a specific PID. Any help would be great. Thanks.
0
python,linux,process
2009-09-17T19:44:00.000
1
1,440,941
Look in /proc/$PID/cmdline
0
9,565
false
0
1
Finding the command for a specific PID in Linux from Python
1,440,969
2
5
0
0
1
0
0
1
I want to simulate MyApp that imports a module (ResourceX) which requires a resource that is not available at the time and will not work. A solution for this is to make and import a mock module of ResourceX (named ResourceXSimulated) and divert it to MyApp as ResourceX. I want to do this in order to avoid breaking a l...
0
python,testing,mocking,module,monkeypatching
2009-09-18T08:12:00.000
0
1,443,173
Yes, Python can do that, and so long as the methods exposed in the ResourceXSimulated module "look and smell" like these of the original module, the application should not see much any difference (other than, I'm assuming, bogus data fillers, different response times and such).
0
256
false
0
1
Is it possible to divert a module in python? (ResourceX diverted to ResourceXSimulated)
1,443,195
2
5
0
1
1
0
0.039979
1
I want to simulate MyApp that imports a module (ResourceX) which requires a resource that is not available at the time and will not work. A solution for this is to make and import a mock module of ResourceX (named ResourceXSimulated) and divert it to MyApp as ResourceX. I want to do this in order to avoid breaking a l...
0
python,testing,mocking,module,monkeypatching
2009-09-18T08:12:00.000
0
1,443,173
Yes, it's possible. Some starters: You can "divert" modules by manipulating sys.modules. It keeps a list of imported modules, and there you can make your module appear under the same name as the original one. You must do this manipulating before any module that imports the module you want to fake though. You can also m...
0
256
false
0
1
Is it possible to divert a module in python? (ResourceX diverted to ResourceXSimulated)
1,443,281
1
4
0
8
17
0
1
0
I need identify which file is binary and which is a text in a directory. I tried use mimetypes but it isnt a good idea in my case because it cant identify all files mimes, and I have strangers ones here... I just need know, binary or text. Simple ? But I couldn´t find a solution... Thanks
0
python,text,binary,file-type
2009-09-18T19:58:00.000
0
1,446,549
It's inherently not simple. There's no way of knowing for sure, although you can take a reasonably good guess in most cases. Things you might like to do: Look for known magic numbers in binary signatures Look for the Unicode byte-order-mark at the start of the file If the file is regularly 00 xx 00 xx 00 xx (for arbit...
0
20,864
false
0
1
How to identify binary and text files using Python?
1,446,580
1
3
0
0
2
0
0
0
I'm building a mobile photo sharing site in Python similar to TwitPic and have been exploring various queues to handle the image processing. I've looked into RabbitMQ and ActiveMQ but I'm thinking that there is a better solution for my use case. I'm looking for something a little more lightweight. I'm open to any sugg...
0
python,queue
2009-09-20T01:33:00.000
0
1,450,038
Are you considering single machine architecture, or a cluster of machines? Forwarding the image to an available worker process on the same machine or a different machine isn't profoundly different, particularly if you use TCP sockets. Knowing what workers are available, spawning more if necessary and the resources ar...
0
290
false
0
1
Which queue is most appropriate?
1,450,105
5
9
0
1
25
1
0.022219
0
I wanted to know Python is suited for what kind of applications? I am new to Python world but I know it's a scripting language like Perl but I was not sure about the kind of applications which one would build using Python and would certainly appreciate if someone can provide some useful information.
0
python
2009-09-21T01:24:00.000
0
1,452,509
Well, the short answer is, since you mentioned Perl, anything you could build in Perl you could build in Python. You can build anything in any language, and if the language has easy C bindings, you could even do it efficiently. Now, this being the case, the question becomes somewhat philosophical. Python has as a k...
0
80,717
false
0
1
What kind of applications are built using Python?
1,452,566
5
9
0
1
25
1
0.022219
0
I wanted to know Python is suited for what kind of applications? I am new to Python world but I know it's a scripting language like Perl but I was not sure about the kind of applications which one would build using Python and would certainly appreciate if someone can provide some useful information.
0
python
2009-09-21T01:24:00.000
0
1,452,509
Most of the 3d packages these days, such as Maya, SoftImage, Houdini, RealFlow, Blender, etc. all use Python as an embedded scripting and plugin language.
0
80,717
false
0
1
What kind of applications are built using Python?
1,452,576
5
9
0
10
25
1
1
0
I wanted to know Python is suited for what kind of applications? I am new to Python world but I know it's a scripting language like Perl but I was not sure about the kind of applications which one would build using Python and would certainly appreciate if someone can provide some useful information.
0
python
2009-09-21T01:24:00.000
0
1,452,509
You say: I am new to Python world but I know it's an scripting language. I think the distinction between "scripting languages" and "programming languages" is quite arbitrary. Nearly every language developed in the last 10-20 years has some kind of runtime support, usually in the form of a bytecode interpreter or vir...
0
80,717
false
0
1
What kind of applications are built using Python?
1,452,546
5
9
0
33
25
1
1.2
0
I wanted to know Python is suited for what kind of applications? I am new to Python world but I know it's a scripting language like Perl but I was not sure about the kind of applications which one would build using Python and would certainly appreciate if someone can provide some useful information.
0
python
2009-09-21T01:24:00.000
0
1,452,509
It's hard to think of kinds of general applications where Python would be unsuitable, but there are several kinds where, like just about all higher-level languages akin to it, it might be considered a peculiar and probably inferior choice. In "hard real time" applications, all dynamic memory allocation and freeing, and...
0
80,717
true
0
1
What kind of applications are built using Python?
1,452,532
5
9
0
0
25
1
0
0
I wanted to know Python is suited for what kind of applications? I am new to Python world but I know it's a scripting language like Perl but I was not sure about the kind of applications which one would build using Python and would certainly appreciate if someone can provide some useful information.
0
python
2009-09-21T01:24:00.000
0
1,452,509
Bittorrent was built on Python.
0
80,717
false
0
1
What kind of applications are built using Python?
1,452,528
3
11
0
-3
177
1
-0.054491
0
What are people's experiences with any of the Git modules for Python? (I know of GitPython, PyGit, and Dulwich - feel free to mention others if you know of them.) I am writing a program which will have to interact (add, delete, commit) with a Git repository, but have no experience with Git, so one of the things I'm lo...
0
python,git
2009-09-21T19:10:00.000
0
1,456,269
For the record, none of the aforementioned Git Python libraries seem to contain a "git status" equivalent, which is really the only thing I would want since dealing with the rest of the git commands via subprocess is so easy.
0
120,684
false
0
1
Python Git Module experiences?
2,180,936
3
11
0
0
177
1
0
0
What are people's experiences with any of the Git modules for Python? (I know of GitPython, PyGit, and Dulwich - feel free to mention others if you know of them.) I am writing a program which will have to interact (add, delete, commit) with a Git repository, but have no experience with Git, so one of the things I'm lo...
0
python,git
2009-09-21T19:10:00.000
0
1,456,269
The git interaction library part of StGit is actually pretty good. However, it isn't broken out as a separate package but if there is sufficient interest, I'm sure that can be fixed. It has very nice abstractions for representing commits, trees etc, and for creating new commits and trees.
0
120,684
false
0
1
Python Git Module experiences?
1,478,107
3
11
0
18
177
1
1
0
What are people's experiences with any of the Git modules for Python? (I know of GitPython, PyGit, and Dulwich - feel free to mention others if you know of them.) I am writing a program which will have to interact (add, delete, commit) with a Git repository, but have no experience with Git, so one of the things I'm lo...
0
python,git
2009-09-21T19:10:00.000
0
1,456,269
Maybe it helps, but Bazaar and Mercurial are both using dulwich for their Git interoperability. Dulwich is probably different than the other in the sense that's it's a reimplementation of git in python. The other might just be a wrapper around Git's commands (so it could be simpler to use from a high level point of vie...
0
120,684
false
0
1
Python Git Module experiences?
1,458,963
1
2
0
0
1
0
0
0
Microsoft Word has "send as attachment" functionality which creates a new message in Outlook with the document attached. I would like to replace Outlook with a custom mail agent, but I do not know how to achieve this. Now my mail agent is simply a program that runs, and takes a file name as parameter. As far as I kno...
0
c#,python,outlook,ms-word,mapi
2009-09-22T07:53:00.000
0
1,458,690
OK, to answer my own question. I need to build a DLL with "MAPISendDocuments" and/or "MAPISendMail" functions defined. This DLL can have any name, and is referenced in the registry at HKLM/Software/Clients/Mail/MyMailApp/DLLPath. Found examples using Delphi...
0
3,109
false
0
1
How to create a MAPI32.dll stub to be able to "send as attachment" from MS Word?
1,483,115
1
8
0
1
41
1
0.024995
0
I'm trying to find a way to lazily load a module-level variable. Specifically, I've written a tiny Python library to talk to iTunes, and I want to have a DOWNLOAD_FOLDER_PATH module variable. Unfortunately, iTunes won't tell you where its download folder is, so I've written a function that grabs the filepath of a few p...
0
python,module,variables,lazy-loading,itunes
2009-09-22T22:32:00.000
0
1,462,986
If that variable lived in a class rather than a module, then you could overload getattr, or better yet, populate it in init.
0
14,915
false
0
1
Lazy module variables--can it be done?
1,463,036
1
4
0
1
3
0
0.049958
0
I am currently running a high-traffic python/django website using Apache and mod_wsgi. I'm hoping that there's a faster webserver configuration out there, and I've heard a fair number of recommendations for lighttpd and fastcgi. Is this setup faster than apache+mod_wsgi for serving dynamic django pages (I'm already con...
0
python,django,apache,fastcgi,lighttpd
2009-09-24T04:26:00.000
0
1,469,770
Doesn't answer you question, but do you already use caching for your site? Like memcached? This might give you a better performance gain than going through the mess of switching webservers.
0
3,952
false
1
1
Better webserver performance for Python Django: Apache mod_wsgi or Lighttpd fastcgi
1,470,459
3
5
0
0
4
1
0
0
I'm setting up a web application to use IronPython for scripting various user actions and I'll be exposing various business objects ready for accessing by the script. I want to make it impossible for the user to import the CLR or other assemblies in order to keep the script's capabilities simple and restricted to the f...
0
python,ironpython
2009-09-25T20:33:00.000
0
1,479,454
If you'd like to disable certain built-in modules I'd suggest filing a feature request over at ironpython.codeplex.com. This should be an easy enough thing to implement. Otherwise you could simply look at either Importer.cs and disallow the import there or you could simply delete ClrModule.cs from IronPython and re-bu...
0
996
false
0
1
IronPython - How to prevent CLR (and other modules) from being imported
1,480,581
3
5
0
0
4
1
0
0
I'm setting up a web application to use IronPython for scripting various user actions and I'll be exposing various business objects ready for accessing by the script. I want to make it impossible for the user to import the CLR or other assemblies in order to keep the script's capabilities simple and restricted to the f...
0
python,ironpython
2009-09-25T20:33:00.000
0
1,479,454
In case anyone comes across this thread from google still (like i did) I managed to disable 'import clr' in python scripts by commenting out the line //[assembly: PythonModule("clr", typeof(IronPython.Runtime.ClrModule))] in ClrModule.cs, but i'm not convinced this is a full solution to preventing unwanted access, sinc...
0
996
false
0
1
IronPython - How to prevent CLR (and other modules) from being imported
59,887,790
3
5
0
1
4
1
1.2
0
I'm setting up a web application to use IronPython for scripting various user actions and I'll be exposing various business objects ready for accessing by the script. I want to make it impossible for the user to import the CLR or other assemblies in order to keep the script's capabilities simple and restricted to the f...
0
python,ironpython
2009-09-25T20:33:00.000
0
1,479,454
You'll have to search the script for the imports you don't want them to use, and reject the script in toto if it contains any of them. Basically, just reject the script if it contains Assembly.Load, import or AddReference.
0
996
true
0
1
IronPython - How to prevent CLR (and other modules) from being imported
1,479,480
1
4
0
12
33
0
1
0
Is there a python equivalent of phpMyAdmin? Here's why I'm looking for a python version of phpmyadmin: While I agree that phpmyadmin really rocks, I don't want to run php on my server. I'd like to move from apache2-prefork to apache2-mpm-worker. Worker blows the doors off of prefork for performance, but php5 doesn't wo...
1
python,phpmyadmin
2009-09-26T04:51:00.000
0
1,480,453
You can use phpMyAdmin for python project, because phpMyAdmin is meant for MySQL databases. If you are using MySQL, then regardless of whether you are using PHP or python, you can use phpMyAdmin.
0
23,600
false
0
1
phpMyAdmin equivalent in python?
1,480,549
1
1
0
1
0
0
1.2
0
I would like to write a small script that does the following (and that I can then run using my crontab): Look into a directory that contains directories whose names are in some date format, e.g. 30-10-09. Convert the directory name to the date it represents (of course, I could put this information as a string into a f...
0
python,date,scripting
2009-09-28T14:45:00.000
1
1,487,450
I would suggest using Python. You'll need the following functions: os.listdir gives you the directory contents, as a list of strings time.strptime(name, "%d-%m-%y") will try to parse such a string, and return a time tuple. You get a ValueError exception if parsing fails. time.mktime will convert a time tuple into seco...
0
289
true
0
1
Time difference between system date and string, e.g. from directory name?
1,487,702
1
5
0
1
6
1
0.039979
0
Perl habits die hard. Variable declaration, scoping, global/local is different between the 2 languages. Is there a set of recommended python language idioms that will render the transition from perl coding to python coding less painful. Subtle variable misspelling can waste an extraordinary amount of time. I understan...
0
python,perl,transitions
2009-09-28T21:02:00.000
0
1,489,355
In python $_ does not exist except in the python shell and variables with global scope are frowned upon. In practice this has two major effects: In Python you can't use regular expressions as naturally as Perl, s0 matching each iterated $_ and similarly catching matches is more cumbersome Python functions tend to be c...
0
539
false
0
1
Managing Perl habits in a Python environment
1,489,635
1
10
0
0
447
1
0
0
How do I find out which directories are listed in my system’s PYTHONPATH variable, from within a Python script (or the interactive shell)?
0
python,python-module,pythonpath
2009-09-28T22:01:00.000
1
1,489,599
If using conda, you can get the env prefix using os.environ["CONDA_PREFIX"].
0
822,516
false
0
1
How do I find out my PYTHONPATH using Python?
62,773,911
1
5
0
2
6
0
0.07983
1
I'm trying to create XML using the ElementTree object structure in python. It all works very well except when it comes to processing instructions. I can create a PI easily using the factory function ProcessingInstruction(), but it doesn't get added into the elementtree. I can add it manually, but I can't figure out ...
0
python,xml,elementtree
2009-09-29T00:09:00.000
0
1,489,949
Yeah, I don't believe it's possible, sorry. ElementTree provides a simpler interface to (non-namespaced) element-centric XML processing than DOM, but the price for that is that it doesn't support the whole XML infoset. There is no apparent way to represent the content that lives outside the root element (comments, PIs,...
0
4,332
false
0
1
ElementTree in Python 2.6.2 Processing Instructions support?
1,490,057
1
5
0
2
1
1
0.07983
0
I have a memory and CPU intensive problem to solve and I need to benchmark the different solutions in ruby and python on different platforms. To do the benchmark, I need to measure the time taken and the memory occupied by objects (not the entire program, but a selected list of objects) in both python and ruby. Please ...
0
python,ruby,performance,memory-management
2009-09-29T06:15:00.000
0
1,490,841
If you are using Python for CPU intensive algorithmic tasks I suggest use Numpy/Scipy to speed up your numerical calculations and use the Psyco JIT compiler for everything else. Your speeds can approach that of much lower-level languages if you use optimized components.
0
1,564
false
0
1
Comparing performance between ruby and python code
1,491,010
6
6
0
5
5
0
0.16514
0
I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries. I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM). The main concern is that re...
0
python,c,embedded,fuzzy-logic
2009-09-30T13:32:00.000
1
1,498,155
Make it work, then make it work fast.
0
1,593
false
0
1
Performance of Python worth the cost?
1,498,739
6
6
0
1
5
0
0.033321
0
I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries. I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM). The main concern is that re...
0
python,c,embedded,fuzzy-logic
2009-09-30T13:32:00.000
1
1,498,155
If most of your runtime is spent in C libraries, the language you use to call these libraries isn't important. What language are your time-eating libraries written in ?
0
1,593
false
0
1
Performance of Python worth the cost?
1,499,253
6
6
0
0
5
0
0
0
I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries. I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM). The main concern is that re...
0
python,c,embedded,fuzzy-logic
2009-09-30T13:32:00.000
1
1,498,155
From your description, speed should not be much of a concern (and you can use C, cython, whatever you want to make it faster), but memory would be. For environments with 64 Mb max (where the OS and all should fit as well, right ?), I think there is a good chance that python may not be the right tool for target deploym...
0
1,593
false
0
1
Performance of Python worth the cost?
1,502,231
6
6
0
0
5
0
0
0
I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries. I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM). The main concern is that re...
0
python,c,embedded,fuzzy-logic
2009-09-30T13:32:00.000
1
1,498,155
I never really measured the performance of pyfuzzy's examples, but as the new version 0.1.0 can read FCL files as FFLL does. Just describe your fuzzy system in this format, write some wrappers, and check the performance of both variants. For reading FCL with pyfuzzy you need the antlr python runtime, but after reading ...
0
1,593
false
0
1
Performance of Python worth the cost?
1,612,690
6
6
0
35
5
0
1.2
0
I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries. I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM). The main concern is that re...
0
python,c,embedded,fuzzy-logic
2009-09-30T13:32:00.000
1
1,498,155
In general, you shouldn't obsess over performance until you've actually seen it become a problem. Since we don't know the details of your app, we can't say how it'd perform if implemented in Python. And since you haven't implemented it yet, neither can you. Implement the version you're most comfortable with, and can im...
0
1,593
true
0
1
Performance of Python worth the cost?
1,498,214
6
6
0
12
5
0
1
0
I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries. I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM). The main concern is that re...
0
python,c,embedded,fuzzy-logic
2009-09-30T13:32:00.000
1
1,498,155
Python is very slow at handling large amounts of non-string data. For some operations, you may see that it is 1000 times slower than C/C++, so yes, you should investigate into this and do necessary benchmarks before you make time-critical algorithms in Python. However, you can extend python with modules in C/C++ code, ...
0
1,593
false
0
1
Performance of Python worth the cost?
1,498,176
2
3
0
-1
14
0
-0.066568
0
On a Linux box I want to run a Python script as another user. I've already made a wrapper program in C++ that calls the script, since I've realized that the ownership of running the script is decided by the ownership of the python interpreter. After that I change the C++ program to a different user and run the C++ prog...
0
python,linux
2009-09-30T16:31:00.000
1
1,499,268
Use the command sudo. In order to run a program as a user, the system must "authenticate" that user. Obviously, root can run any program as any user, and any user can su to another user with a password. The program sudo can be configured to allow a group of users to sudo a particular command as a particular user. For e...
0
33,209
false
0
1
Running python script as another user
1,499,282
2
3
0
0
14
0
0
0
On a Linux box I want to run a Python script as another user. I've already made a wrapper program in C++ that calls the script, since I've realized that the ownership of running the script is decided by the ownership of the python interpreter. After that I change the C++ program to a different user and run the C++ prog...
0
python,linux
2009-09-30T16:31:00.000
1
1,499,268
Give those users the ability to sudo su $dedicated_username and tailor the permissions on your system so that $dedicated_user has sufficient, but not excessive, access.
0
33,209
false
0
1
Running python script as another user
1,499,313
1
3
0
2
5
0
0.132549
0
I'm using cProfile, pstats and Gprof2dot to profile a rather long python script. The results tell me that the most time is spent calling a method in an object I've defined. However, what I would really like is to know exactly what line number within that function is eating up the time. Any idea's how to get this addit...
0
python,scripting,numbers,profiler,line
2009-09-30T20:46:00.000
0
1,500,564
cProfile does not track line numbers within a function; it only tracks the line number of where the function was defined. cProfile attempts to duplicate the behavior of profile (which is pure Python). profile uses pstats to store the data from running, and pstats only stores line numbers for function definitions, no...
0
2,434
false
0
1
cProfile and Python: Finding the specific line number that code spends most time on
1,500,818
3
4
0
5
4
1
0.244919
0
Because I'm a Python fan, I'd like to learn the .NET framework using IronPython. Would I be missing out on something? Is this in some way not recommended? EDIT: I'm pretty knowledgeable of Java ( so learning/using a new language is not a problem for me ). If needed, will I be able to use everything I learned in IronPyt...
0
c#,.net,ironpython
2009-10-01T15:55:00.000
0
1,504,804
If I wanted to just "learn the framework", I would do it in C# or VB for two main reasons: Intellisense - the framework is huge, and being offered suggestions for function overloads is one of the ways to find new stuff. There's almost no good intellisense for the framework with IronPython at the moment (Michael Foord...
0
477
false
1
1
Using IronPython to learn the .NET framework, is this bad?
1,551,802
3
4
0
11
4
1
1.2
0
Because I'm a Python fan, I'd like to learn the .NET framework using IronPython. Would I be missing out on something? Is this in some way not recommended? EDIT: I'm pretty knowledgeable of Java ( so learning/using a new language is not a problem for me ). If needed, will I be able to use everything I learned in IronPyt...
0
c#,.net,ironpython
2009-10-01T15:55:00.000
0
1,504,804
No, sounds like a good way to learn to me. You get to stick with a language and syntax that you are familiar with, and learn about the huge range of classes available in the framework, and how the CLR supports your code. Once you've got to grips with some of the framework and the CLR services you could always pick up C...
0
477
true
1
1
Using IronPython to learn the .NET framework, is this bad?
1,504,823
3
4
0
5
4
1
0.244919
0
Because I'm a Python fan, I'd like to learn the .NET framework using IronPython. Would I be missing out on something? Is this in some way not recommended? EDIT: I'm pretty knowledgeable of Java ( so learning/using a new language is not a problem for me ). If needed, will I be able to use everything I learned in IronPyt...
0
c#,.net,ironpython
2009-10-01T15:55:00.000
0
1,504,804
You can definitely do that to learn the class library, but I'm not sure if it's such a good idea when it comes to fundamental CLR concepts (e.g. delegates and events). You'll need to pay attention and distinguish what is strictly an IronPython feature, and what is CLR feature exposed in IronPython in a way that matches...
0
477
false
1
1
Using IronPython to learn the .NET framework, is this bad?
1,504,904
1
7
0
314
166
1
1.2
0
What is the cleanest and most Pythonic way to get tomorrow's date? There must be a better way than to add one to the day, handle days at the end of the month, etc.
0
python,datetime,date,time
2009-10-01T22:45:00.000
0
1,506,901
datetime.date.today() + datetime.timedelta(days=1) should do the trick
0
110,489
true
0
1
Cleanest and most Pythonic way to get tomorrow's date?
1,506,916
1
5
0
7
7
1
1
0
I've seen some comparisons between Smalltalk and Ruby on the one hand and Ruby and Python on the other, but not between Python and Smalltalk. I'd especially like to know what the fundamental differences in Implementation, Syntax, Extensiabillity and Philosophy are. For example Python does not seem to have Metaclasses....
0
python,comparison,language-features,smalltalk,language-comparisons
2009-10-02T08:09:00.000
0
1,508,256
Python certainly does have metaclasses. Smalltalk has some unusual features: Has a rather simple syntax and only about 6 (!) keywords. Everything else (including defining new classes) is accomplished by calling methods (sending messages in Smalltalk). This allows you to create some DSL within the language. In Smalltal...
0
3,672
false
0
1
How does Smalltalk (Pharo for example) compare to Python?
1,508,312
3
4
0
0
6
1
0
0
I have an application that generates some large log files > 500MB. I have written some utilities in Python that allows me to quickly browse the log file and find data of interest. But I now get some datasets where the file is too big to load it all into memory. I thus want to scan the document once, build an index and ...
0
python,utf-8,codec,seek
2009-10-02T15:17:00.000
0
1,510,188
Update: You can't do seek/tell on the object returned by codec.open(). You need to use a normal file, and decode the strings to unicode after reading. I do not know why it doesn't work but I can't make it work. The seek seems to only work once, for example. Then you need to close and reopen the file, which is of course...
0
2,140
false
0
1
Can seek and tell work with UTF-8 encoded documents in Python?
1,510,303
3
4
0
3
6
1
1.2
0
I have an application that generates some large log files > 500MB. I have written some utilities in Python that allows me to quickly browse the log file and find data of interest. But I now get some datasets where the file is too big to load it all into memory. I thus want to scan the document once, build an index and ...
0
python,utf-8,codec,seek
2009-10-02T15:17:00.000
0
1,510,188
If true, this sounds like a bug or limitation of the codecs module, as it's probably confusing byte and character offsets. I would use the regular open() function for opening the file, then seek()/tell() will give you byte offsets that are always consistent. Whenever you want to read, use f.readline().decode('utf-8'). ...
0
2,140
true
0
1
Can seek and tell work with UTF-8 encoded documents in Python?
1,510,276
3
4
0
2
6
1
0.099668
0
I have an application that generates some large log files > 500MB. I have written some utilities in Python that allows me to quickly browse the log file and find data of interest. But I now get some datasets where the file is too big to load it all into memory. I thus want to scan the document once, build an index and ...
0
python,utf-8,codec,seek
2009-10-02T15:17:00.000
0
1,510,188
For UTF-8, you don't actually need to open the file with codecs.open. Instead, it is reliable to read the file as a byte string first, and only then decode an individual section (invoking the .decode method on the string). Breaking the file at line boundaries is safe; the only unsafe way to split it would be in the mid...
0
2,140
false
0
1
Can seek and tell work with UTF-8 encoded documents in Python?
1,510,282
1
3
0
4
4
1
0.26052
0
All. I am trying to find a python module that I can use to parse a cron entry and get the next time it will run. With perl I use the Schedule::Cron::Events module but I would like to convert to python. Thanks in advance.
0
python,module,cron
2009-10-02T21:22:00.000
0
1,511,854
I could be wrong but doesn't python crontab offer ways to read and write to crontab but nothing regarding parsing the crontab to determine the time until the next time a job will be run?
0
8,165
false
0
1
Parse a cron entry in Python
3,256,325
1
2
0
1
5
1
1.2
0
I've got several eggs I maintain on Pypi but up until now I've always focused on Python 2.5x. I'd like to release my eggs under both Python 2.5 & Python 2.6 in an automated fashion i.e. running tests generating doc preparing eggs uploading to Pypi How do you guys achieve this? A related question: how do I tag an egg...
0
python,release-management,pypi
2009-10-03T02:45:00.000
0
1,512,644
You don't need to release eggs for anything else than Windows, and then only if your package uses C extensions so that they have compiled parts. Otherwise you simply release one source distribution. That will be enough for all Python versions on all platforms. Running the tests for different versions automated is trick...
0
817
true
0
1
Python Pypi: what is your process for releasing packages for different Python versions? (Linux)
1,513,884
1
6
0
9
2
0
1.2
1
I am making a community for web-comic artist who will be able to sync their existing website to this site. However, I am in debate for what CMS I should use: Drupal or Wordpress. I have heard great things about Drupal, where it is really aimed for Social Networking. I actually got to play a little bit in the back end o...
0
python,wordpress,drupal,content-management-system,social-networking
2009-10-03T07:17:00.000
0
1,513,062
Difficult decision. Normally I would say 'definitely Drupal' without hesitation, as Drupal was build as a System for community sites from the beginning, whereas Wordpress still shows its heritage as a blogging solution, at least that's what I hear quite often. But then I'm working with Drupal all the time recently and ...
0
3,472
true
0
1
Drupal or Wordpress CMS as a Social Network?
1,513,657
1
1
0
0
0
0
1.2
0
I can't seem to fetch the verifiedEmail field when trying to login to AOLs OpenID on my site. Every other provider that I know of provides this property, but not AOL. I realize that AOL somehow uses an old OpenID version, although is it feasible to just assume that their e-mail ends in @aol.com? I'm using the RPXNow li...
0
python,openid,rpxnow
2009-10-03T11:40:00.000
0
1,513,543
I believe that OpenID lets the user decide how much information to "share" during the login process. I can't say that I am an expert on the subject, but I know that my identity at myopenid.com lets me specify precisely what information to make available. Is it possible that the AOL default is to share nothing? If thi...
0
166
true
0
1
verifiedEmail AOL OpenID
1,513,794
3
5
0
3
3
1
0.119427
0
This is what I've done for a project. I have a few data structures that are bascially dictionaries with some methods that operate on the data. When I save them to disk, I write them out to .py files as code that when imported as a module will load the same data into such a data structure. Is this reasonable? Are there ...
0
python,data-persistence,dynamic-import
2009-10-03T16:40:00.000
0
1,514,228
The biggest drawback is that it's a potential security problem since it's hard to guarantee that the files won't contains arbitrary code, which could be really bad. So don't use this approach if anyone else than you have write-access to the files.
0
351
false
0
1
Is it reasonable to save data as python modules?
1,514,234
3
5
0
3
3
1
1.2
0
This is what I've done for a project. I have a few data structures that are bascially dictionaries with some methods that operate on the data. When I save them to disk, I write them out to .py files as code that when imported as a module will load the same data into such a data structure. Is this reasonable? Are there ...
0
python,data-persistence,dynamic-import
2009-10-03T16:40:00.000
0
1,514,228
It's reasonable, and I do it all the time. Obviously it's not a format you use to exchange data, so it's not a good format for anything like a save file. But for example, when I do migrations of websites to Plone, I often get data about the site (such as a list of which pages should be migrated, or a list of how old u...
0
351
true
0
1
Is it reasonable to save data as python modules?
1,514,248
3
5
0
7
3
1
1
0
This is what I've done for a project. I have a few data structures that are bascially dictionaries with some methods that operate on the data. When I save them to disk, I write them out to .py files as code that when imported as a module will load the same data into such a data structure. Is this reasonable? Are there ...
0
python,data-persistence,dynamic-import
2009-10-03T16:40:00.000
0
1,514,228
By operating this way, you may gain some modicum of convenience, but you pay many kinds of price for that. The space it takes to save your data, and the time it takes to both save and reload it, go up substantially; and your security exposure is unbounded -- you must ferociously guard the paths from which you reload mo...
0
351
false
0
1
Is it reasonable to save data as python modules?
1,514,250
1
7
0
0
29
1
0
0
This is a very basic question - but I haven't been able to find an answer by searching online. I am using python to control ArcGIS, and I have a simple python script, that calls some pre-written code. However, when I make a change to the pre-written code, it does not appear to result in any change. I import this module...
0
python,refresh,reload
2009-10-04T18:23:00.000
0
1,517,038
I had the exact same issue creating a geoprocessing script for ArcGIS 10.2. I had a python toolbox script, a tool script and then a common script. I have a parameter for Dev/Test/Prod in the tool that would control which version of the code was run. Dev would run the code in the dev folder, test from test folder and pr...
0
106,481
false
0
1
python refresh/reload
27,299,101
2
2
0
1
0
0
1.2
0
I have an open source project containing both Python and C code. I'm wondering that is there any use for distutils for me, because I'm planning to do a ubuntu/debian package. The C code is not something that I could or want to use as Python extension. C and Python programs communicate with TCP/IP through localhost. So ...
0
python,c,packaging,distutils
2009-10-06T06:17:00.000
1
1,523,874
distutils can be used to install end user programs, but it's most useful when using it for Python libraries, as it can create source packages and also install them in the correct place. For that I would say it's more or less required. But for an end user Python program you can also use make or whatever you like and are...
0
284
true
0
1
Reasons to use distutils when packaging C/Python project
1,523,993
2
2
0
1
0
0
0.099668
0
I have an open source project containing both Python and C code. I'm wondering that is there any use for distutils for me, because I'm planning to do a ubuntu/debian package. The C code is not something that I could or want to use as Python extension. C and Python programs communicate with TCP/IP through localhost. So ...
0
python,c,packaging,distutils
2009-10-06T06:17:00.000
1
1,523,874
Because it uses an unified python setup.py install command? distutils, or setuptools? Whatever, just use one of those. For development, it's also really useful because you don't have to care where to find such and such dependency. As long as it's standard Python/basic system library stuff, setup.py should find it for y...
0
284
false
0
1
Reasons to use distutils when packaging C/Python project
1,525,194
4
11
0
2
6
0
0.036348
0
I am basically from the world of C language programming, now delving into the world of scripting languages like Ruby and Python. I am wondering how to do debugging. At present the steps I follow is, I complete a large script, Comment everything but the portion I want to check Execute the script Though it works, I am...
0
python,ruby,scripting-language
2009-10-07T06:41:00.000
0
1,529,896
Script languages have no differences compared with other languages in the sense that you still have to break your problems into manageable pieces -- that is, functions. So, instead of testing the whole script after finishing the whole script, I prefer to test those small functions before integrating them. TDD always h...
0
1,224
false
0
1
Debugging a scripting language like ruby
1,529,931
4
11
0
10
6
0
1.2
0
I am basically from the world of C language programming, now delving into the world of scripting languages like Ruby and Python. I am wondering how to do debugging. At present the steps I follow is, I complete a large script, Comment everything but the portion I want to check Execute the script Though it works, I am...
0
python,ruby,scripting-language
2009-10-07T06:41:00.000
0
1,529,896
Your sequence seems entirely backwards to me. Here's how I do it: I write a test for the functionality I want. I start writing the script, executing bits and verifying test results. I review what I'd done to document and publish. Specifically, I execute before I complete. It's way too late by then. There are debugg...
0
1,224
true
0
1
Debugging a scripting language like ruby
1,529,996
4
11
0
0
6
0
0
0
I am basically from the world of C language programming, now delving into the world of scripting languages like Ruby and Python. I am wondering how to do debugging. At present the steps I follow is, I complete a large script, Comment everything but the portion I want to check Execute the script Though it works, I am...
0
python,ruby,scripting-language
2009-10-07T06:41:00.000
0
1,529,896
The debugging method you described is perfect for a static language like C++, but given that the language is so different, the coding methods are similarly different. One of the big very important things in a dynamic language such as Python or Ruby is the interactive toplevel (what you get by typing, say python on the ...
0
1,224
false
0
1
Debugging a scripting language like ruby
1,531,112
4
11
0
2
6
0
0.036348
0
I am basically from the world of C language programming, now delving into the world of scripting languages like Ruby and Python. I am wondering how to do debugging. At present the steps I follow is, I complete a large script, Comment everything but the portion I want to check Execute the script Though it works, I am...
0
python,ruby,scripting-language
2009-10-07T06:41:00.000
0
1,529,896
My question is, is there any better way of debugging?" Yes. Your approach, "1. I complete a large script, 2. Comment everything but the portion I want to check, 3. Execute the script" is not really the best way to write any software in any language (sorry, but that's the truth.) Do not write a large anything. Ever. Do...
0
1,224
false
0
1
Debugging a scripting language like ruby
1,530,723
2
6
0
0
3
1
0
0
I heard that Python has automated "garbage collection" , but C++ does not. What does that mean?
0
c++,python,garbage-collection
2009-10-07T08:21:00.000
0
1,530,245
As you have got your answer, now it's better to know the cons of automated garbage collection: it requires large amounts of extra memory and not suitable for hard real-time deadline applications.
0
1,606
false
0
1
I heard that Python has automated "garbage collection" , but C++ does not. What does that mean?
1,532,646
2
6
0
2
3
1
0.066568
0
I heard that Python has automated "garbage collection" , but C++ does not. What does that mean?
0
c++,python,garbage-collection
2009-10-07T08:21:00.000
0
1,530,245
It basically means the way they handle memory resources. When you need memory you usually ask for it to the OS and then return it back. With python you don't need to worry about returning it, with C++ you need to track what you asked and return it back, one is easier, the other performant, you choose your tool.
0
1,606
false
0
1
I heard that Python has automated "garbage collection" , but C++ does not. What does that mean?
1,530,267
5
6
0
5
6
1
0.16514
0
i need to transfer large files across network and need to create checksum for them on hourly basis. so the speed for generating checksum is critical for me. somehow i can't make zlib.crc32 and zlib.adler32 working with files larger than 4GB on Windows XP Pro 64bit machine. i suspect i've hit the 32bit limitation here? ...
0
python,multithreading,md5,crc32,hashlib
2009-10-07T16:28:00.000
0
1,532,720
It's an algorithm selection problem, rather than a library/language selection problem! There appears to be two points to consider primarily: how much would the disk I/O affect the overall performance? what is the expected reliability of the error detection feature? Apparently, the answer to the second question is som...
0
17,263
false
0
1
the fastest way to create checksum for large files in python
1,533,036
5
6
0
1
6
1
0.033321
0
i need to transfer large files across network and need to create checksum for them on hourly basis. so the speed for generating checksum is critical for me. somehow i can't make zlib.crc32 and zlib.adler32 working with files larger than 4GB on Windows XP Pro 64bit machine. i suspect i've hit the 32bit limitation here? ...
0
python,multithreading,md5,crc32,hashlib
2009-10-07T16:28:00.000
0
1,532,720
You cannot possibly use more than one core to calculate MD5 hash of a large file because of the very nature of MD5: it expects a message to be broken up in chunks and fed into hashing function in strict sequence. However, you can use one thread to read a file into internal queue, and then calculate hash in a separate t...
0
17,263
false
0
1
the fastest way to create checksum for large files in python
1,532,764
5
6
0
3
6
1
0.099668
0
i need to transfer large files across network and need to create checksum for them on hourly basis. so the speed for generating checksum is critical for me. somehow i can't make zlib.crc32 and zlib.adler32 working with files larger than 4GB on Windows XP Pro 64bit machine. i suspect i've hit the 32bit limitation here? ...
0
python,multithreading,md5,crc32,hashlib
2009-10-07T16:28:00.000
0
1,532,720
First, there is nothing inherent in any of the CRC algorithms that would prevent them working on an arbitrary length of data (however, a particular implementation might well impose a limit). However, in a file syncing application, that probably doesn't matter, as you may not want to hash the entire file when it gets la...
0
17,263
false
0
1
the fastest way to create checksum for large files in python
1,533,255
5
6
0
2
6
1
0.066568
0
i need to transfer large files across network and need to create checksum for them on hourly basis. so the speed for generating checksum is critical for me. somehow i can't make zlib.crc32 and zlib.adler32 working with files larger than 4GB on Windows XP Pro 64bit machine. i suspect i've hit the 32bit limitation here? ...
0
python,multithreading,md5,crc32,hashlib
2009-10-07T16:28:00.000
0
1,532,720
You might be hitting a size limit for files in XP. The 64-bit gives you more addressing space (removing the 2GB (or so) addressing space per application), but probably does nothing for the file size problem.
0
17,263
false
0
1
the fastest way to create checksum for large files in python
1,540,992
5
6
0
1
6
1
0.033321
0
i need to transfer large files across network and need to create checksum for them on hourly basis. so the speed for generating checksum is critical for me. somehow i can't make zlib.crc32 and zlib.adler32 working with files larger than 4GB on Windows XP Pro 64bit machine. i suspect i've hit the 32bit limitation here? ...
0
python,multithreading,md5,crc32,hashlib
2009-10-07T16:28:00.000
0
1,532,720
md5 itself can't be run in parallel. However you can md5 the file in sections (in parallel) and the take an md5 of the list of hashes. However that assumes that the hashing is not IO-limited, which I would suspect it is. As Anton Gogolev suggests - make sure that you're reading the file efficiently (in large power-of-2...
0
17,263
false
0
1
the fastest way to create checksum for large files in python
1,532,779
9
10
1
0
2
1
0
0
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or ...
0
c#,c++,python
2009-10-07T21:52:00.000
0
1,534,450
As someone familiar with C# and .NET you should consider IronPython. Python for .NET. This would be a good way to leverage what you know and learn a new dynamic language at the same time.
0
1,673
false
0
1
C++ or Python for C# programmer?
1,534,470
9
10
1
7
2
1
1
0
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or ...
0
c#,c++,python
2009-10-07T21:52:00.000
0
1,534,450
I Am a little scared of C++ because developing anything in it takes ages. I'm not sure how you can say that when you say yourself that you have no experience in the language. C++ is a good tool for some things, Python is good for other things. What you want to do should be driving this decision, not the technology i...
0
1,673
false
0
1
C++ or Python for C# programmer?
1,534,460
9
10
1
5
2
1
0.099668
0
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or ...
0
c#,c++,python
2009-10-07T21:52:00.000
0
1,534,450
Python may be easier to get started with, but a dynamically typed scripting language is a very different language from C# or C++. You will learn more about programming learning it than you will by hopping to a close cousin of a language you already know. Really, solid familiarity with at least one scripting language ...
0
1,673
false
0
1
C++ or Python for C# programmer?
1,534,467
9
10
1
2
2
1
1.2
0
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or ...
0
c#,c++,python
2009-10-07T21:52:00.000
0
1,534,450
C# is a little closer to Java and C++ than it is to Python, so learn Python first out of the two. However, my advice would be: Stick with your current language and learn more techniques, such as a wider range of algorithms, functional programming, design by contract, unit testing, OOAD, etc. learn C (focus on figuring...
0
1,673
true
0
1
C++ or Python for C# programmer?
1,534,729
9
10
1
3
2
1
0.059928
0
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or ...
0
c#,c++,python
2009-10-07T21:52:00.000
0
1,534,450
If you want to apply to Google then Python might be the one to go for, surely MS would like the C# already. If nothing else the competition would not be as fierce as there are much more folk out there with multi years of C++ experience. Also Python gives you a broader language skill and would be a good path to more l...
0
1,673
false
0
1
C++ or Python for C# programmer?
1,534,483
9
10
1
0
2
1
0
0
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or ...
0
c#,c++,python
2009-10-07T21:52:00.000
0
1,534,450
You might be interested in looking at Windows Powershell. It's the latest scripting technology from Microsoft, built on .NET, and can be extended via C#. Granted, it's not as portable as C++ or Python, but it would leverage your C#/.NET experience more readily. Otherwise, I would suggest C++ (and possibly C). Microsoft...
0
1,673
false
0
1
C++ or Python for C# programmer?
1,534,589
9
10
1
1
2
1
0.019997
0
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or ...
0
c#,c++,python
2009-10-07T21:52:00.000
0
1,534,450
C++ is usually used when speed, and low-level OS access is involved. It's a good skill to have if you want to expand. Python allows you to do thing quickly, and it's quite easy to learn, and provides more power than you'd expect from a scripting language, and probably one of the fastest ones out there. C++ isn't exactl...
0
1,673
false
0
1
C++ or Python for C# programmer?
1,534,645
9
10
1
1
2
1
0.019997
0
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or ...
0
c#,c++,python
2009-10-07T21:52:00.000
0
1,534,450
If you want to apply to Google and/ or Microsoft then I'd say that of the two you need both! Given more choice, probably C++ and one other language - either dynamic, functional, or both (Scala might be a good choice too). It's not necessarily about whether you'd use the languages themselves but more about the different...
0
1,673
false
0
1
C++ or Python for C# programmer?
1,534,651
9
10
1
1
2
1
0.019997
0
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or ...
0
c#,c++,python
2009-10-07T21:52:00.000
0
1,534,450
Why not learn some of each. Studying a language for a week or so won't make you an expert, but it will answer a lot of questions in your head and plant a seed for the future. It's important to not just read through exercises. Find some simple problems that can be programmed in a page or two at most and solve them with ...
0
1,673
false
0
1
C++ or Python for C# programmer?
1,534,556
4
9
0
1
7
0
0.022219
0
I want to write a hit counter script to keep track of hits on images on a website and the originating IPs. Impressions are upwards of hundreds of thousands per day, so the counters will be incremented many times a second. I'm looking for a simple, self-hosted method (php, python scripts, etc.). I was thinking of using...
0
php,python,mysql,tracking
2009-10-08T02:12:00.000
0
1,535,261
If accuracy is important, you can do it slightly slower with MySql... create a HEAP / Memory table to store your counter values. These a in-memory tables that are blazingly fast. You can write the data into a normal table at intervals. Based on the app engine ideas, you could use memcache as a temporary store for your...
0
6,857
false
0
1
How to write an efficient hit counter for websites
1,535,794
4
9
0
4
7
0
0.088656
0
I want to write a hit counter script to keep track of hits on images on a website and the originating IPs. Impressions are upwards of hundreds of thousands per day, so the counters will be incremented many times a second. I'm looking for a simple, self-hosted method (php, python scripts, etc.). I was thinking of using...
0
php,python,mysql,tracking
2009-10-08T02:12:00.000
0
1,535,261
You could take your webserver's Access log (Apache: access.log) and evaluate it time and again (cronjob) in case you do not need to have the data at hand at the exact moment in time when someone visits your site. Usually, the access.log is generated anyway and contains the requested resource as well as time, date and t...
0
6,857
false
0
1
How to write an efficient hit counter for websites
1,536,049
4
9
0
7
7
0
1
0
I want to write a hit counter script to keep track of hits on images on a website and the originating IPs. Impressions are upwards of hundreds of thousands per day, so the counters will be incremented many times a second. I'm looking for a simple, self-hosted method (php, python scripts, etc.). I was thinking of using...
0
php,python,mysql,tracking
2009-10-08T02:12:00.000
0
1,535,261
A fascinating subject. Incrementing a counter, simple as it may be, just has to be a transaction... meaning, it can lock out the whole DB for longer than makes sense!-) It can easily be the bottleneck for the whole system. If you need rigorously exact counts but don't need them to be instantly up-to-date, my favorite...
0
6,857
false
0
1
How to write an efficient hit counter for websites
1,535,311
4
9
0
0
7
0
0
0
I want to write a hit counter script to keep track of hits on images on a website and the originating IPs. Impressions are upwards of hundreds of thousands per day, so the counters will be incremented many times a second. I'm looking for a simple, self-hosted method (php, python scripts, etc.). I was thinking of using...
0
php,python,mysql,tracking
2009-10-08T02:12:00.000
0
1,535,261
I've done something very similar, on a similar scale (multiple servers, hundreds of domains, several thousand hits per hour) and log file analysis was definitely the way to go. (It also checked hit rates, weighted them by file type, and blacklisted IP addresses at the firewall if they were making too many requests; it...
0
6,857
false
0
1
How to write an efficient hit counter for websites
1,900,337
1
3
0
2
2
0
1.2
0
I'm starting a new webapp project in Python to get into the Agile mind-set and I'd like to do things "properly" with regards to deployment. However, I'm finding the whole virtualenv/fabric/zc.buildout/etc stuff a little confusing - I'm used to just FTP'ing PHP files to a server and pointing a webserver at it. After dep...
0
python,deployment,virtualenv
2009-10-08T11:40:00.000
0
1,537,298
You already mentioned buildout, and it's all you need. Google for example buildouts for the different parts. Takes a while to set it up the first time, but then you can reuse the setup between different projects too. Let supervisord start everything, not just the python server. Then start supervisord at reboot either f...
0
1,087
true
1
1
What do I need to know/learn for automated python deployment?
1,537,585
2
3
0
0
0
0
0
1
I have a server that has to respond to HTTP and XML-RPC requests. Right now I have an instance of SimpleXMLRPCServer, and an instance of BaseHTTPServer.HTTPServer with a custom request handler, running on different ports. I'd like to run both services on a single port. I think it should be possible to modify the CGIXM...
0
python,http,xml-rpc
2009-10-08T19:45:00.000
0
1,540,011
Is there a reason not to run a real webserver out front with url rewrites to the two ports you are usign now? It's going to make life much easier in the long run
0
849
false
0
1
Python HTTP server with XML-RPC
1,540,053
2
3
0
0
0
0
1.2
1
I have a server that has to respond to HTTP and XML-RPC requests. Right now I have an instance of SimpleXMLRPCServer, and an instance of BaseHTTPServer.HTTPServer with a custom request handler, running on different ports. I'd like to run both services on a single port. I think it should be possible to modify the CGIXM...
0
python,http,xml-rpc
2009-10-08T19:45:00.000
0
1,540,011
Use SimpleXMLRPCDispatcher class directly from your own request handler.
0
849
true
0
1
Python HTTP server with XML-RPC
1,543,370
3
8
0
7
68
0
1
1
If yes are there any frameworks/Tutorials/tips/etc recommended? N00b at Python but I have tons of PHP experience and wanted to expand my skill set. I know Python is great at server side execution, just wanted to know about client side as well.
0
python,client-side
2009-10-08T20:27:00.000
0
1,540,214
Silverlight can run IronPython, so you can make Silverlight applications. Which is client-side.
0
54,388
false
0
1
Can Python be used for client side web development?
1,540,379
3
8
0
-1
68
0
-0.024995
1
If yes are there any frameworks/Tutorials/tips/etc recommended? N00b at Python but I have tons of PHP experience and wanted to expand my skill set. I know Python is great at server side execution, just wanted to know about client side as well.
0
python,client-side
2009-10-08T20:27:00.000
0
1,540,214
No. Browsers don't run Python.
0
54,388
false
0
1
Can Python be used for client side web development?
1,540,233
3
8
0
3
68
0
0.07486
1
If yes are there any frameworks/Tutorials/tips/etc recommended? N00b at Python but I have tons of PHP experience and wanted to expand my skill set. I know Python is great at server side execution, just wanted to know about client side as well.
0
python,client-side
2009-10-08T20:27:00.000
0
1,540,214
On Windows, any language that registers for the Windows Scripting Host can run in IE. At least the ActiveState version of Python could do that; I seem to recall that has been superseded by a more official version these days. But that solution requires the user to install a python interpreter and run some script or .reg...
0
54,388
false
0
1
Can Python be used for client side web development?
7,437,506
1
3
0
1
8
0
0.066568
0
I'm writting a small python script notify me when certain condition met. I used smtplib which does the emailing for me, but I also want the script to call my cell phone as well. I can't find a free library for phone callings. Does anyone know any?
0
python,phone-call
2009-10-09T15:38:00.000
0
1,544,550
I've used Skype4Py very successfully. Keep in mind though it does require Skype to be installed and costs the standard rate for SkypeOut.
0
7,113
false
0
1
Is there a free python library for phone calling?
1,545,365
1
2
0
1
1
0
0.099668
1
I need to implement a small test utility which consumes extremely simple SOAP XML (HTTP POST) messages. This is a protocol which I have to support, and it's not my design decision to use SOAP (just trying to prevent those "why do you use protocol X?" answers) I'd like to use stuff that's already in the basic python 2....
0
python,http,soap
2009-10-10T09:49:00.000
0
1,547,520
I wrote something like this in Boo, using a .Net HTTPListener, because I too had to implement someone else's defined WSDL. The WSDL I was given used document/literal form (you'll need to make some adjustments to this information if your WSDL uses rpc/encoded). I wrapped the HTTPListener in a class that allowed client ...
0
515
false
0
1
A minimalist, non-enterprisey approach for a SOAP server in Python
1,547,642
1
6
0
1
14
0
0.033321
1
I have a two websites in php and python. When a user sends a request to the server I need php/python to send an HTTP POST request to a remote server. I want to reply to the user immediately without waiting for a response from the remote server. Is it possible to continue running a php/python script after sending a resp...
0
php,python,nonblocking
2009-10-12T16:22:00.000
0
1,555,517
What you need to do is have the PHP script execute another script that does the server call and then sends the user the request.
0
12,400
false
0
1
sending a non-blocking HTTP POST request
1,555,614
3
8
0
2
1
0
0.049958
0
We have a sizable code base in Perl. For the forseeable future, our codebase will remain in Perl. However, we're looking into adding a GUI-based dashboard utility. We are considering writing the dashboard in Python (using tkinter or wx). The problem, however, is that we would like to leverage our existing Perl codebase...
0
python,perl
2009-10-12T20:22:00.000
1
1,556,668
Well, if you really want to write the GUI in another language (which, seriously, is just a bad idea, since it will cost you more than it could ever benefit you), the thing you should do is the following: Document your Perl app in terms of the services it provides. You should do it with XML Schema Definition - XSD - fo...
0
406
false
0
1
Recommendations for perl-to-python interoperation?
1,557,216
3
8
0
1
1
0
0.024995
0
We have a sizable code base in Perl. For the forseeable future, our codebase will remain in Perl. However, we're looking into adding a GUI-based dashboard utility. We are considering writing the dashboard in Python (using tkinter or wx). The problem, however, is that we would like to leverage our existing Perl codebase...
0
python,perl
2009-10-12T20:22:00.000
1
1,556,668
Interesting project: I would opt for loose-coupling and consider an XML-RPC or JSON based approach.
0
406
false
0
1
Recommendations for perl-to-python interoperation?
1,560,979
3
8
0
7
1
0
1
0
We have a sizable code base in Perl. For the forseeable future, our codebase will remain in Perl. However, we're looking into adding a GUI-based dashboard utility. We are considering writing the dashboard in Python (using tkinter or wx). The problem, however, is that we would like to leverage our existing Perl codebase...
0
python,perl
2009-10-12T20:22:00.000
1
1,556,668
I hate to be another one in the chorus, but... Avoid the use of an alternate language Use Wx so it's native look and feel makes the application look "real" to non-technical audiences. Download the Padre source code and see how it does Wx Perl code, then steal rampantly from it's best tricks or maybe just gut it and us...
0
406
false
0
1
Recommendations for perl-to-python interoperation?
1,557,825
1
2
0
17
11
1
1
0
Usually I tend to install things via the package manager, for unixy stuff. However, when I programmed a lot of perl, I would use CPAN, newer versions and all that. In general, I used to install system stuff via package manager, and language stuff via it's own package manager ( gem/easy_install|pip/cpan) Now using pyth...
0
python,setuptools,distutils,pip
2009-10-13T10:25:00.000
0
1,559,372
There are two completely opposing camps: one in favor of system-provided packages, and one in favor of separate installation. I'm personally in the "system packages" camp. I'll provide arguments from each side below. Pro system packages: system packager already cares about dependency, and compliance with overall system...
0
1,252
false
0
1
Which is the most pythonic: installing python modules via a package manager ( macports, apt) or via pip/easy_install/setuptools
1,559,521
1
6
0
1
4
0
0.033321
0
Right now its a gmail box but sooner or later I want it to scale. I want to sync a copy of a live personal mailbox (inbox and outbox) somewhere else, but I don't want to affect the unread state of any unread messages. what type of access will make this easiest? I can't find any information if IMAP will affect the read...
0
python,gmail,imap,pop3,imaplib
2009-10-14T04:27:00.000
0
1,564,237
Nobody uses POP because typically they want the extra functionality of IMAP, such as tracking message state. When that functionality is only getting in your way and needs workarounds, I think using POP's your best bet!-)
0
5,515
false
0
1
get email unread content, without affecting unread state
1,564,294
1
2
0
1
1
0
0.099668
1
Standard libraries (xmlrpclib+SimpleXMLRPCServer in Python 2 and xmlrpc.server in Python 3) report all errors (including usage errors) as python exceptions which is not suitable for public services: exception strings are often not easy understandable without python knowledge and might expose some sensitive information....
0
python,xml-rpc
2009-10-15T10:50:00.000
0
1,571,598
I don't think you have a library specific problem. When using any library or framework you typically want to trap all errors, log them somewhere, and throw up "Oops, we're having problems. You may want to contact us at x@x.com with error number 100 and tell us what you did." So wrap your failable entry points in try...
0
1,435
false
0
1
XML-RPC server with better error reporting
1,608,160