Re: Why this difference?

2011-02-24 Thread Paul Anton Letnes
Den 24.02.11 13.41, skrev n00m: The 1st "False" is not surprising for me. It's the 2nd "True" is a bit hmmm... ok, it doesn't matter == Have a nice day! I am no expert, but I think python re-uses some integer and string objects. For instance, if you create the object int(2)

Re: Best approach to create humongous amount of files

2015-05-20 Thread paul . anton . letnes
There's a module called "template" that I've used before, for the find/replace part. I never investigated its performance, but my script used less than 1 s for 100 files IIRC :-) Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Uninstall

2015-08-04 Thread paul . anton . letnes
Right. Try "which python" in the terminal and report back! Cheers Paul -- https://mail.python.org/mailman/listinfo/python-list

Ordering dependent test failures

2015-09-20 Thread paul . anton . letnes
Hi! Fascinated by the concept of ordering dependent test failures [0], I've run the python test suite [1] with 256 different random seeds (took a little more than 12 hours). The results vary a lot - for instance, the number of tests reported as OK varies, the number of skips varies, etc. Since

Re: for loop

2015-09-20 Thread paul . anton . letnes
On Sunday, September 20, 2015 at 9:56:06 AM UTC+2, shiva upreti wrote: > https://ideone.com/BPflPk > > Please tell me why 'print s' statement is being executed inside loop, though > I put it outside. > Please help. I am new to python. Hi! Welcome to python, the most awesome programming language

PY3.5 and nnumpy and scipy installation problem

2015-09-27 Thread paul . anton . letnes
Easiest way of installing is removing the python you've installed already and installing continuum's anaconda python 3.x (for x = 4 or 5). It has "batteries included" - numpy, scipy and many others! Paul -- https://mail.python.org/mailman/listinfo/python-list

PY3.5 and nnumpy and scipy installation problem

2015-09-27 Thread paul . anton . letnes
I'll heartily recommend anaconda python. It's got everything you need prepackaged. Remove what you installed before. Cheers Pauk -- https://mail.python.org/mailman/listinfo/python-list

wrapping C functions in python

2008-04-09 Thread Paul Anton Letnes
Hello etc. I am a "scientific" user of Python, and hence have to write some performance critical algorithms. Right now, I am learning Python, so this is a "newbie" question. I would like to wrap some heavy C functions inside Python, specifically a wavelet transform. I am beginning to bec

Re: wrapping C functions in python

2008-04-09 Thread Paul Anton Letnes
$2 = (char**)alloca($1*sizeof(char*)); > for (Py_ssize_t i = 0; i < $1; ++i) { > PyObject *o = PySequence_GetItem($input, i); > $2[i] = PyString_AsString(o); > } > } > > That one works for mapping a python sequence (such as a list) into the > argc, argv arguments commonly pas

Re: wrapping C functions in python

2008-04-09 Thread Paul Anton Letnes
Brian and Diez: First of all, thanks for the advice. Brian: I have installed NumPy and SciPy, but I can't seem to find a wavelet transform there. The main point of this was more to learn C wrapping than to actually get a calculation done. I will probably be starting a PhD soon, doing real

Re: problem with using gnuplot/demo.py

2008-04-10 Thread Paul Anton Letnes
Could you include some code around line 39 in demo.py? Also, you could try to comment out the stuff before that point, and see if the demo runs that far. Paul. hi i want to use gnuplot with python i installed it seemingly successfully but when i try to run demo.py it gives the following e

Wrapping C++ class with SWIG, Mac OS X

2008-04-11 Thread Paul Anton Letnes
Hello guys, (related to previous thread on wrapping C/C++ in Python, trying the SWIG approach.) Trying to map a C++ class to python, one method for now. Running the following commands to "compile": -- #!/usr/bin/env bash MOD_NAME=Wavelet swig -c++ -pyth

Re: Wrapping C++ class with SWIG, Mac OS X

2008-04-12 Thread Paul Anton Letnes
Okay, installed SIP. Looks promising, following the tutorial on http://www.riverbankcomputing.com/static/Docs/sip4/sipref.html#using-sip It should be noted that I am working on a Mac - I know there are some differences, but it's still UNIX and should work somehow. Anyway, I copy-paste and create

Wrapping C++ class with SWIG, Mac OS X

2008-04-12 Thread Paul Anton Letnes
> > Thanks a lot for the comments. So, I post the code, which should let > you recreate the circumstances. I'm on 10.5.2, python2.5 (from > Fink), and got SIP from FINK recently - should be the latest version. > > I know C++ to some extent - the linking is the hardest part for me > to grasp.

Re: Process multiple files

2008-04-14 Thread Paul Anton Letnes
Funny, I'm just doing exactly this: import os def main(): dataFolder = 'data/' fileList = os.listdir(dataFolder) for file in fileList: inFile = open(dataFolder + file, 'r') print 'read inFile & do something useful here' Clear as an... egg?

Re: Java or C++?

2008-04-15 Thread Paul Anton Letnes
Brian: Impressive! This is the most balanced, well-informed and interesting reply to this debate. I would like to make some comments even so. I have tried all languages, and consider myself agnostic. However, I would like to roughly repeat what James Gosling (Java inventor) said at a lectu

Re: How to import C++ static library?

2008-04-15 Thread Paul Anton Letnes
Den 15. april. 2008 kl. 11.11 skrev Diez B. Roggisch: > Alexander Dong Back Kim wrote: > >> Hi all, >> >> I'm very very beginner of python but I'm dare to ask this question >> straight away. =P >> >> Is it possible to import C++ static library compiled by GCC? The >> target is definitely Linux ma

Re: Java or C++?

2008-04-15 Thread Paul Anton Letnes
hard for C newbies. Den 15. april. 2008 kl. 19.35 skrev [EMAIL PROTECTED]: > On Apr 15, 3:07 am, Paul Anton Letnes <[EMAIL PROTECTED]> > wrote: > > >> but C bogs you down with administrative stuff (try converting an int >> to a string; I found myself googling for a

Re: how to get and search a html file from a website

2011-02-01 Thread Paul Anton Letnes
Den 01.02.11 22.20, skrev Tracubik: Hi all! i'm writing a notification program and i'm quite new to python. The program have to check every 5 minutes a particular website and alert me when a particular sentence ("user online") is in the html. i've thinked to use a text browser (lynx) to retrieve

Re: python and parsing an xml file

2011-02-22 Thread Paul Anton Letnes
Den 21.02.11 18.30, skrev Matt Funk: Hi, I was wondering if someone had some advice: I want to create a set of xml input files to my code that look as follows: Alg1 ./Alg1.in c:\tmp 1 So there are co

Re: python and parsing an xml file

2011-02-22 Thread Paul Anton Letnes
Den 22.02.11 13.29, skrev pyt...@bdurham.com: Paul, How about skipping the whole xml thing? You can dynamically import any python module, even if it does not have a python filename. Great example! Can you do the same with a cStringIO based file that exists in memory vs. on disk? Your exampl

Re: Making Line Graphs

2011-02-22 Thread Paul Anton Letnes
Den 21.02.11 10.34, skrev Jean-Michel Pichavant: spam head wrote: I'm looking for an easy way to display simple line graphs generated by a python program in Windows. It could be done from within the program, or I could write the information out to a file and call an external program. Either is f