Re: Problems with read_eager and Telnet

2011-03-01 Thread Robi
> > My conclusion being, fgfs cannot answer back quicker than this: 20Hz.
>
> I suspect that is by design, so as to not interfere with the simulation
> itself.

Actually it's not quite like that.

I talked about it in flightgear-devel mailing list; I was told FGFS
default telnet polling frequency is 5Hz (but it's nowhere documented
than in the source code). I had extremely low interaction at first,
slower than what I get now. Increasing this frequency to 120Hz gave me
those results I was talking about in the previous posts; I got
increasing speed but with my (quite crude) benchmark it never goes
over a real 20Hz as stated, it doesn't reach those 120Hz set at hand
by me. But there is no cap at 20Hz set by design in FlightGear, not
that I'm aware of.

I'm going to dig into some other communication media to talk to
FlightGear and leave Telnet for those cases where such a lag is
acceptable.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OT: Code Examples

2011-03-01 Thread Erik de Castro Lopo
Fred Marshall wrote:

> I'm interested in developing Python-based programs, including an 
> engineering app. ... re-writing from Fortran and C versions.  One of the 
> objectives would to be make reasonable use of the available structure 
> (objects, etc.).  So, I'd like to read a couple of good, simple 
> scientific-oriented programs that do that kind of thing.

Why Python? I really can't understand the rush of every man and
his dog to Python.

Its not that I'm a stick in the mud stuck with C and C++, rather
that I used Python for a number of years from 1998 to 2004 and
rejected it in favour of strict statically typed functional
langauges like Ocaml and Haskell.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problems of Symbol Congestion in Computer Languages

2011-03-01 Thread Dotan Cohen
On Tue, Mar 1, 2011 at 05:30, rusi  wrote:
>> Had there been more meta keys, it might be nice to have a symbol for
>> each key on the keyboard. I personally have experimented with putting
>> the symbols as regular keys and the numbers as the Shifted versions.
>> It's great for programming.
>
> Hmmm... Clever!
> Is it X or Windows?
> Can I have your setup?
>

It's X, on Kubuntu. I've since "destroyed" that layout, but you can
easily play around in /usr/share/X11/xkb/symbols/us or whichever
layout you prefer. I am working on another one, though, actually I
just stared working on it yesterday. It's currently broken (I'm in the
middle of troubleshooting it) but you can see what I currently have
here:
http://dotancohen.com/eng/keyboard_layout.html

> One problem we programmers face is that keyboards were made for
> typists not programmers.

Yes, I'm trying to solve that! Ideally in the end all the brackets
including {} won't need modifier keys. Give me some feedback, please,
on that layout.


-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problems of Symbol Congestion in Computer Languages

2011-03-01 Thread Dotan Cohen
On Tue, Mar 1, 2011 at 07:04, Xah Lee  wrote:
> hi Russ,
>
> there's a programer's dvorak layout i think is bundled with linux.
>
> or you can do it with xmodmap on X-11 or AutoHotKey on Windows, or
> within emacs... On the mac, you can use keyboardMaestro, Quickeys, or
> just write a os wide config file yourself. You can see tutorials and
> sample files for all these here 
> http://xahlee.org/Periodic_dosage_dir/keyboarding.html
>
> i'd be interested to know what Dotan Cohen use too.
>

You can see what I started working on yesterday, but it's far from finished:
http://dotancohen.com/eng/keyboard_layout.html

I tried reaching you on Skype yesterday, Xah, but I think that you
blocked me suspecting that I may be a bot. Try to Skype-chat with me
at user "dotancohen", I think that we can help each other.


> i tried the swapping number row with symbols a few years back. didn't
> like it so much because numbers are frequently used as well,
> especially when you need to enter a series of numbers. e.g. heavy
> math, or dates 2010-02-28. One can use the number pad but i use that
> as extra programable buttons.
>

I don't like the number pad so I'm looking for another solution. I
wired up a spring-off lightswitch to the Shift key and I operate it
with my foot. It's great but it only works when I'm home: it is too
ridiculous to take with me. I'm wiring up two more for Ctrl an Alt,
too bad it's too cumbersome to have ESC, Enter, and Backspace there as
well.

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OT: Code Examples

2011-03-01 Thread Richard Dobson

On 01/03/2011 08:43, Erik de Castro Lopo wrote:

Fred Marshall wrote:


I'm interested in developing Python-based programs, including an
engineering app. ... re-writing from Fortran and C versions.  One of the
objectives would to be make reasonable use of the available structure
(objects, etc.).  So, I'd like to read a couple of good, simple
scientific-oriented programs that do that kind of thing.


Why Python? I really can't understand the rush of every man and
his dog to Python.

Its not that I'm a stick in the mud stuck with C and C++, rather
that I used Python for a number of years from 1998 to 2004 and
rejected it in favour of strict statically typed functional
langauges like Ocaml and Haskell.



My understanding is/was that Guido originally proposed Python as the 
replacement for BASIC; i.e. to be the new first language students at 
school would be exposed to. So rather than compare it to C and C++, I 
suppose one should, strategically speaking, compare it to Visual Basic 
and/or Java.


The other aspect is purely pragmatic - it has bindings for tk, MIDI and 
audio (and of course Csound as you know), which adds up to a fairly 
hefty scripting package complete with GUI design options - great for 
"knocking up stuff quickly". But - I am ~still~ caught out by the 
semantic significance of indenting. Looks OK enough on paper, but doing 
it interactively is another matter.



Richard Dobson
--
http://mail.python.org/mailman/listinfo/python-list


Re: question about numpy.polyval

2011-03-01 Thread sirvival
On 28 Feb., 17:15, Robert Kern  wrote:
> On 2/28/11 9:34 AM, sirvival wrote:
>
> > Hi,
> > I have some simulated data of stellar absorption lines.
>
> You will want to ask numpy questions on the numpy mailing list:
>
>    http://www.scipy.org/Mailing_Lists
>
> It would be best if you could make a minimal, self-contained, runnable script
> that demonstrates your problem. I.e. provide x and y arrays that show the
> problem; all the details about chunking and such are just getting in the way.
> Please state what results you expect in addition to the results you got; you
> show plots but don't show exactly what you plotted. I have no idea what you 
> were
> expecting to get. Make sure you use variable names consistently. For example,
> you refer to a "plot of fita", but nothing in your code assigns to "fita".
>
> Thanks.
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless enigma
>   that is made terrible by our own mad attempt to interpret it as though it 
> had
>   an underlying truth."
>    -- Umberto Eco

Hi,
ok I will ask my question (modified with your sugestions) on the numpy
mailing list.
I just started using python last week, so I am sure my code looks
confusion. Sorry about that.


Thanks
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OT: Code Examples

2011-03-01 Thread Paul Rubin
Erik de Castro Lopo  writes:
> Why Python? I really can't understand the rush of every man and
> his dog to Python.

Are you trolling?  Anyway, try googling "evil mangler" and ask why it
wasn't done in Haskell.  Same idea.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OT: Code Examples

2011-03-01 Thread Tom Zych
Erik de Castro Lopo wrote:
> Why Python? I really can't understand the rush of every man and
> his dog to Python.
> Its not that I'm a stick in the mud stuck with C and C++, rather
> that I used Python for a number of years from 1998 to 2004 and
> rejected it in favour of strict statically typed functional
> langauges like Ocaml and Haskell.

Hmm, if we abused this guy enough for his heresy, do you think
he'd say he didn't expect the Spanish Inquisition? Then we could
riff on that theme for days :-D

-- 
Tom Zych / freethin...@pobox.com
Quidquid latine dictum sit, altum viditur.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: subclass urllib2

2011-03-01 Thread Jean-Michel Pichavant

monkeys paw wrote:

I'm trying to subclass urllib2 in order to mask the
version attribute. Here's what i'm using:

import urllib2

class myURL(urllib2):
def __init__(self):
urllib2.__init__(self)
self.version = 'firefox'

I get this>
Traceback (most recent call last):
  File "", line 1, in 
TypeError: Error when calling the metaclass bases
module.__init__() takes at most 2 arguments (3 given)

I don't see where i am supplying 3 arguments. What am i
missing?


Don't steal firefox's idendity to screen-scrap Wikipedia :p

JM
--
http://mail.python.org/mailman/listinfo/python-list


Re: how to properly pass literal strings python code to be executed using python -c

2011-03-01 Thread Jean-Michel Pichavant

jmoons wrote:

I need some help figuring out how to execute this python code from
python -c
I am have trouble formatting python so that it will execute for
another app in cmd I understand there maybe other ways to do what I am
doing but I am limited by the final execution using cmd python -c so
please keep this in mind.
I'm limited by the final delivery of code. The python is being called
by a server that does not have access to any python script file
  
Why ? You are about to delete a whole directory tree on that ser ver and 
cannot write a simple python file ?

So I have some python code ie,

import os
import shutil

myPath =r"C:\dingdongz"
for root, dirs, files in os.walk(myPath):
for file in files:
os.remove(os.path(root, file))
for dir in dirs:
shutil.rmtree(os.path.join(root,dir))

But I am trying to excute it using the following method, python -c
"print 'hotdogs'"

So this what i have but no worky

cmdline = "\" import os, shutil \n for root, dirs, files in
os.walk("+myPath+"):\n \t for file in files: \n \t \t
os.remove(os.path.join(root, file)) \n \t for dir in dirs: \n \t\t
shutil.rmtree(os.path.join(root, dir))"


I have also tried the following
python -c "import os; import shutil; for root, dirs, files in
os.walk('+myPath+'): for file in files: os.remove(os.path.join(root,
file)); for dir in dirs: shutil.rmtree(os.path.join(root, dir))"

I am still getting error tree(os.path.join(root, dir)) ^ SyntaxError:
invalid syntax
  

I don't understand exactly what you want to do... Anyway ...

1/ Your 'application' is running on the server, it has then access to 
the file system and can write python file => problem solved.
2/ Your 'application' is local and sends python code to the server => 
write a local python file, that uses the module 'execnet' to execute 
remote python code on the server. See http://codespeak.net/execnet/



JM
--
http://mail.python.org/mailman/listinfo/python-list


Re: OT: Code Examples

2011-03-01 Thread Martin De Kauwe
On Mar 1, 3:03 am, Fred Marshall 
wrote:
> I'm interested in developing Python-based programs, including an
> engineering app. ... re-writing from Fortran and C versions.  One of the
> objectives would to be make reasonable use of the available structure
> (objects, etc.).  So, I'd like to read a couple of good, simple
> scientific-oriented programs that do that kind of thing.
>
> Looking for links, etc.
>
> Fred

you could try searching here http://pypi.python.org/pypi. I had a look
for models, but didn't find anything in particular. But would be
really useful if anyone does know of some good examples
-- 
http://mail.python.org/mailman/listinfo/python-list


Python 3.2 is excellent, but

2011-03-01 Thread jmfauth
Well, Python (as 3.2) has never reached this level of excellence, but
__pycache__, no, not for me.

(I feel better now, after I wrote it.)


-- 
http://mail.python.org/mailman/listinfo/python-list


psycopg2 insertion and reading binary data to PostgreSQL database (bytea datatype)

2011-03-01 Thread romap
Hello.
This is the full work version.

Do yuo have:
- Pyton, PostgreSQL, Psycopg2
- PostgreSQL dababase named "MyDATABASE" with table named "phonebook"
- Table "phonebook" have this columns: "lastname" [TEXT datatype] and
"c2image" [BYTEA datatype]
- Do you have an jpeg file named "sun.jpg" on c:/

Open  db connection

>>> import psycopg2
>>> conn_string = "host='localhost' dbname='MyDATABASE' user='MyUSER' 
>>> password='MyPASSWORD'"
>>> conn = psycopg2.connect(conn_string)

Write image on database (binary data on bytea column)

>>> mypic=open('c:/sun.jpg','rb').read()
>>> cursor = conn.cursor()
>>> cursor.execute("INSERT INTO phonebook(lastname,c2image) VALUES (%s,%s);", 
>>> ('MyPICTURENAME', psycopg2.Binary(mypic)))
>>> conn.commit()

Read image from database and write to a file

>>> cursor = conn.cursor()
>>> cursor.execute("SELECT (c2image) FROM phonebook WHERE 
>>> lastname='MyPICTURENAME';")
>>> mypic2 = cursor.fetchone()
>>> open('c:/copyofsun.jpg', 'wb').write(str(mypic2[0]))

Close db connection

>>> cursor.close()
>>> conn.close()
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 3.2 is excellent, but

2011-03-01 Thread Stefan Behnel

jmfauth, 01.03.2011 11:40:

__pycache__, no, not for me.


This has been discussed before. The 'argument' you presented is usually due 
to a misunderstanding of how __pycache__ works. Consider reading the PEP.


Stefan

--
http://mail.python.org/mailman/listinfo/python-list


Re: Python 3.2 is excellent, but

2011-03-01 Thread Tom Zych
jmfauth wrote:
> Well, Python (as 3.2) has never reached this level of excellence, but
> __pycache__, no, not for me.
> 
> (I feel better now, after I wrote it.)

Could you be more specific? :)

-- 
Tom Zych / freethin...@pobox.com
Quidquid latine dictum sit, altum viditur.
-- 
http://mail.python.org/mailman/listinfo/python-list


I cant import my function from compiled cython module.

2011-03-01 Thread Şansal Birbaş
Hi All,
I needed to improve the computation speed of my numpy algorithm which works 
correctly with
cython. So I created a .pyx file like belows and then compiled to a .pyd file 
successfully:
***­***
import numpy
cimport cython
cimport numpy as np
DTYPE = np.int
ctypedef np.int_t DTYPE_t
@cython.boundscheck(False)
@cython.wraparound(False)
def CombiHesapla4(np.ndarray[DTYPE_t, ndim=1] X,
  np.ndarray[DTYPE_t, ndim=1] Y,
  np.ndarray[DTYPE_t, ndim=1] Z,
  np.ndarray[DTYPE_t, ndim=1] T,
  np.ndarray[DTYPE_t, ndim=1] W,
  np.ndarray[DTYPE_t, ndim=1] istenen,
  unsigned int max_expander):
cdef int kalanUO=0
cdef int m_UI
cdef int m_UO
cdef int m_AO
cdef int m_BO
cdef int i_AI
cdef int i_AO
cdef int i_BI
cdef int i_BO
cdef long fiyat
cdef int possible_max_exp_number
cdef int possible_max_exp
combo=[]
row=[]
combinations=[]
cdef long min_price=99
cheapest_combi=[]
cdef np.ndarray toplamIO=numpy.zeros([1, 5], dtype=DTYPE)
cdef np.ndarray mevcut=numpy.zeros([1, 5], dtype=DTYPE)
cdef Py_ssize_t i, j, k, l, m
for i in range(1,5):
possible_max_exp_number=i*range(max_expander+1)
possible_max_exp=i*max_expander
for j in possible_max_exp_number:
for k in possible_max_exp_number:
for l in possible_max_exp_number:
for m in possible_max_exp_number:
if (j+k+l+m)<=(possible_max_exp):
mevcut=0
mevcut+=X*i
mevcut+=Y*j
mevcut+=Z*k
mevcut+=T*l
mevcut+=W*m
m_UI=mevcut[0][0]
m_UO=mevcut[0][1]
m_AO=mevcut[0][2]
m_BO=mevcut[0][3]
i_AI=istenen[0]
i_AO=istenen[1]
i_BI=istenen[2]
i_BO=istenen[3]
if (m_UI>=(i_AI+i_BI)):
if ((m_UO+m_BO)>=i_BO):
kalanUO=(m_UO+m_BO)-i_BO
if ((m_BO>=i_BO)):
kalanUO=m_UO
if ((kalanUO+m_AO)>=i_AO):
fiyat=i*X[4]+j*Y[4]+k*Z[4]+l*T[4]+m*W[4]
combo = [i, j, k, l, m, fiyat]
combinations.append(combo)
if len(combinations)>0:
for row in combinations:
if (row[5]-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OT: Code Examples

2011-03-01 Thread Nicholas Devenish

On 01/03/2011 09:24, Richard Dobson wrote:

But - I am ~still~ caught out by the
semantic significance of indenting. Looks OK enough on paper, but doing
it interactively is another matter.


I still don't fully understand this argument. With Python, I am still 
doing indentation almost exactly the same way I was in any other 
language (and should be - I haven't ever seen any arguments for not 
indenting logical blocks).


The only difference is, I don't need to put a block-end-identifier.

I suppose I see how one could argue that this could potentially cause 
*mildly* confusing code, but only in extreme examples, and mainly only 
for multi-screen functions, that should rarely exist (and these are 
confusing even with bracketed blocks).

--
http://mail.python.org/mailman/listinfo/python-list


Re: I cant import my function from compiled cython module.

2011-03-01 Thread Stefan Behnel

Hi,

note that the cython-users mailing list, where you cross-posted this, is 
the right place to ask.


Stefan

--
http://mail.python.org/mailman/listinfo/python-list


Re: Problems of Symbol Congestion in Computer Languages

2011-03-01 Thread Mark Thomas
I know someone who was involved in creating a language called A+. It
was invented at Morgan Stanley where they used Sun keyboards and had
access to many symbols, so the language did have set symbols, math
symbols, logic symbols etc. Here's a keyboard map including the
language's symbols (the red characters). http://www.aplusdev.org/keyboard.html

I have no idea if this language is still in use.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: backwards-compatibility

2011-03-01 Thread Jason Swails
> subpackage1 imports the exceptions module from package1, and I do that
> like
> > this:
> >
> > from ..exceptions import MyException
> >
>
> You'll have to import that using the absolute import. It would be
> "from package1.exceptions import MyException".
>

Ah; I didn't quite see how something in subpackage1 would know to look up a
directory to see if it was in another package (I thought I would have to
play games with PYTHONPATH).  Works like a charm though.  Thanks!


>
> > Which is perfectly fine by python2.5, 2.6, and 2.7; but unacceptable in
> > python2.4.  Any thoughts?
> >
> > Another python2.6 feature I'm using is
> >
> > except Exception as err:
> >print err
> >
>
> except Exception, err :
>

Ah, great.  And it also works for python2.6 and 2.7.


> > Is there any way of rewriting this so I can still print the error message
> in
> > python2.5/2.4?
> > 
>

Many Unix OSes (especially on supercomputers) have painfully out-of-date
system python versions, so unfortunately I have to maintain compatibility
with these super old versions.

Thanks again!
Jason

-- 
Jason M. Swails
Quantum Theory Project,
University of Florida
Ph.D. Candidate
352-392-4032
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: question about numpy.polyval

2011-03-01 Thread sirvival
Hi,
found the error

I had x for coeff wrong definded.
Instead of
x = np.arange(num_chunk)
it should be
x = data_fin[::,0]

Now it works.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Embedding python : can't find encoding error

2011-03-01 Thread swapnil
On Feb 28, 4:57 pm, Mathieu CLERICI  wrote:
> Hi,
>
> I'm trying to embed python in a c++ program.
> I have compiled python32.lib with msvc 2010 targetting 32bits, i link
> it with my program wich is also 32bit.
> I get an error when calling Py_Initialize() : "no codec search
> functions registered:  can't find encoding"
>
> Py_FileSystemDefaultEncoding value is "mbcs".
>
> _PyCodec_Lookup raise an eror because  len = PyList_Size(interp-
>
> >codec_search_path); returns 0 in codecs.c
>
> Does someone already had this problem ? I have no idea how to solve
> that.
>
> Sorry for my bad english.

While initializing python import site.py module and I think
subsequently several other modules. Probably its in this process that
Python is trying to register the codes from the encoding package of
standard library. You must provide the path to the standard library to
the exe that you generate. You can do this by setting the environment
variables PYTHONPATH, PYTHONHOME (Refer
http://docs.python.org/using/cmdline.html#environment-variables ) in
your program before calling Py_Initialize()
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to properly pass literal strings python code to be executed using python -c

2011-03-01 Thread jmoons
On Feb 28, 3:14 pm, Steven D'Aprano  wrote:
> On Mon, 28 Feb 2011 10:59:01 -0800, jmoons wrote:
> > I need some help figuring out how to execute this python code from
> > python -c
> > I am have trouble formatting python so that it will execute for another
> > app in cmd I understand there maybe other ways to do what I am doing but
> > I am limited by the final execution using cmd python -c so please keep
> > this in mind.
> > I'm limited by the final delivery of code. The python is being called by
> > a server that does not have access to any python script file
>
> Let me translate that...
>
> "I'm having trouble hammering this nail with a screwdriver. Keep in mind
> that I am limited by the requirement that I use a screwdriver, not a
> hammer, to hammer the nail. The nail is being hammered by somebody who
> doesn't have a hammer."
>
> So give them a hammer. Put the code in a text file, call it "main.py" or
> something, and execute "python -m main", or "python -c 'import main'" if
> you prefer.
>
> I don't understand the requirement to avoid storing your code in a file
> -- surely you won't be typing the script into cmd every single time you
> want to run it, so surely it will be stored in a batch file or similar?
> As far as I can tell, the *only* legitimate reason for the requirement is
> to win a bet :) Otherwise, you're just making your life much much harder
> than it needs to be.
>
> [...]
>
> > So this what i have but no worky
>
> > cmdline = "\" import os, shutil \n for root, dirs, files in
> > os.walk("+myPath+"):\n \t for file in files: \n \t \t
> > os.remove(os.path.join(root, file)) \n \t for dir in dirs: \n \t\t
> > shutil.rmtree(os.path.join(root, dir))"
>
> I have no idea what the string handling rules for cmd are, and I'm not
> going to try to guess. This doesn't appear to be a Python problem, it's a
> cmd problem. You need to work out how to correctly quote your string.
> Perhaps try on some Windows forums.
>
> > I have also tried the following
> > python -c "import os; import shutil; for root, dirs, files in
> > os.walk('+myPath+'): for file in files: os.remove(os.path.join(root,
> > file)); for dir in dirs: shutil.rmtree(os.path.join(root, dir))"
>
> > I am still getting error tree(os.path.join(root, dir)) ^ SyntaxError:
> > invalid syntax
>
> No you don't. You don't call a function "tree", so you can't be getting
> that error. The actual function you call is shutil.rmtree. Please don't
> retype, summarize, simplify or paraphrase error messages. Copy and paste
> them *exactly* as they are shown, complete with any traceback which is
> printed.
>
> --
> Steven

Thank you steven for trying to help, I appreciate trying to understand
my questions it was hard to articulate through writing I can see know
with out writing a page regarding the envorment in which I need to
complete my task, there is no way for you to help.
I will hit the windows forums on the cmd formatting.
Thank you
-Jentzen
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problems of Symbol Congestion in Computer Languages

2011-03-01 Thread rusi
On Mar 1, 6:01 pm, Mark Thomas  wrote:
> I know someone who was involved in creating a language called A+. It
> was invented at Morgan Stanley where they used Sun keyboards and had
> access to many symbols, so the language did have set symbols, math
> symbols, logic symbols etc. Here's a keyboard map including the
> language's symbols (the red characters).http://www.aplusdev.org/keyboard.html
>
> I have no idea if this language is still in use.

Runs (ok limps) under debian/ubuntu -- see 
http://packages.debian.org/squeeze/aplus-fsf

My own attempts at improving the scene 
http://www.emacswiki.org/emacs/AplInDebian

If anyone has any further findings on this, I'd be happy to know.
-- 
http://mail.python.org/mailman/listinfo/python-list


Hello Friends

2011-03-01 Thread Ashraf Ali
It's a suprise.Do you know what the following blog is about.Just visit
to know
www.hotpics00.blogspot.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Hello Friends

2011-03-01 Thread Ashraf Ali
It's a suprise.Do you know what the following blog is about.Just visit
to know
www.hotpics00.blogspot.com
-- 
http://mail.python.org/mailman/listinfo/python-list


I am not able to open IDLE in python on Vista.

2011-03-01 Thread Jayneil Dalal
This is the error message I get when I try to run Pyhon on Vista:

unable to create user config directory
C:\Users\Jayneil\.idlerc
Check path and permissions.
Exiting!

So please help me out!.

Thank you.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OT: Code Examples

2011-03-01 Thread Robert Kern

On 2/28/11 10:03 AM, Fred Marshall wrote:

I'm interested in developing Python-based programs, including an engineering
app. ... re-writing from Fortran and C versions. One of the objectives would to
be make reasonable use of the available structure (objects, etc.). So, I'd like
to read a couple of good, simple scientific-oriented programs that do that kind
of thing.


You may want to take a look at Clear Climate Code. It is a rewrite of an old, 
hairy FORTRAN climate analysis program with the goal of making it clearer and 
easier to understand. That's somewhat different from having an example of what 
you would write de novo, but it might help give you strategies for the process 
of translating your own FORTRAN and C engineering codes.


  http://clearclimatecode.org/

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

--
http://mail.python.org/mailman/listinfo/python-list


Re: OT: Code Examples

2011-03-01 Thread Erik de Castro Lopo
Paul Rubin wrote:

> Erik de Castro Lopo  writes:
> > Why Python? I really can't understand the rush of every man and
> > his dog to Python.
> 
> Are you trolling?

Definitely not. As I said I used Python for a number of years
and ditched it in favour of Ocaml and Haskell.

The ease of development and high level language features of
Python look really good if all you know is C, C++ and Java.
The big difference Python and those three languages is that
there are a huge number of classes of bugs which are run time
errors in Python but compile time errors in C/C++/Java.

I will always chose compile time errors over run time errors.

> Anyway, try googling "evil mangler"

I know what the "evil mangler" is. It was called that because it
threw away all the principles of good software design in favour
of expediency. GHC now has a new LLVM backend which does not
depend on the evil mangler and I strongly suspect that the backend
which uses the evil mangler will be dumped in the next year or
two.

> and ask why it wasn't done in Haskell.  Same idea.

Expediency over common sense?

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OT: Code Examples

2011-03-01 Thread Emile van Sebille

On 3/1/2011 12:43 AM Erik de Castro Lopo said...

Why Python?


For me?  Because it's executable pseudocode

Emile

--
http://mail.python.org/mailman/listinfo/python-list


Re: OT: Code Examples

2011-03-01 Thread Erik de Castro Lopo
Paul Rubin wrote:

> Erik de Castro Lopo  writes:
> > Why Python? I really can't understand the rush of every man and
> > his dog to Python.
> 
> Are you trolling?

All my responses to this thread are really mean for comp.dsp,
not for comp.lang.python.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I am not able to open IDLE in python on Vista.

2011-03-01 Thread Andrea Crotti
Jayneil Dalal  writes:

> This is the error message I get when I try to run Pyhon on Vista:
>
> unable to create user config directory
> C:\Users\Jayneil\.idlerc
> Check path and permissions.
> Exiting!
>
> So please help me out!.
>
> Thank you.

Best solution would be to avoid Windows Vista.
If that is not possible than you probably need to be administrator of
your machine.

Or at least who installed the program should have installed it for
everyone.
If you installed that I don't know how that thing could happen, but I'm
windows-free since the last century...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I am not able to open IDLE in python on Vista.

2011-03-01 Thread Werner Thie

Ever tried to run it as Administrator (right click, Run as Administrator...)

Werner

Am 01.03.2011 17:12, schrieb Jayneil Dalal:

This is the error message I get when I try to run Pyhon on Vista:

unable to create user config directory
C:\Users\Jayneil\.idlerc
Check path and permissions.
Exiting!

So please help me out!.

Thank you.
<>-- 
http://mail.python.org/mailman/listinfo/python-list


VipIMAGE 2011 – ECCOMAS Thematic Conference - FIRST ANNOUNCE

2011-03-01 Thread tava...@fe.up.pt
---

International ECCOMAS Thematic Conference VipIMAGE 2011 - III ECCOMAS
THEMATIC
CONFERENCE ON COMPUTATIONAL VISION AND MEDICAL IMAGE PROCESSING
12-14th October 2011, Olhão, Algarve, Portugal
www.fe.up.pt/~vipimage

CALL for PAPERS AND THEMATIC SESSIONS

We would appreciate if you could distribute this information by your
colleagues and co-workers.

---

Dear Colleague,

We would like to call your attention to the International Conference
VipIMAGE 2011 - III ECCOMAS THEMATIC CONFERENCE ON COMPUTATIONAL
VISION AND MEDICAL IMAGE PROCESSING that will be held in Real Marina
Hotel & Spa, Olhão, Algarve, Portugal, on October 12-14, 2011.


Possible Topics (not limited to)

- Signal and Image Processing
- Computational Vision
- Medical Imaging
- Physics of Medical Imaging
- Tracking and Analysis of Movement
- Simulation and Modeling
- Image Acquisition
- Shape Reconstruction
- Objects Segmentation, Matching, Simulation
- Data Interpolation, Registration, Acquisition and Compression
- 3D Vision
- Virtual Reality
- Software Development for Image Processing and Analysis
- Computer Aided Diagnosis, Surgery, Therapy, and Treatment
- Computational Bioimaging and Visualization
- Telemedicine Systems and their Applications


Invited Lecturers

- Armando J. Pinho - University of Aveiro, Portugal
- Irene M. Gamba - The University of Texas at Austin, USA
- Marc Pollefeys - ETH Zurich, Switzerland
- Marc Thiriet - Universite Pierre et Marie Curie (Paris VI), France
- Xavier Roca Marvà - Autonomous University of Barcelona, Spain
- Stan Sclaroff - Boston University, USA


Thematic Sessions

Proposals to organize Thematic Session within VipIMAGE 2011 are mostly
welcome.
Proposals for Thematic Sessions should be submitted by email to the
conference co-chairs (tava...@fe.up.pt, rna...@fe.up.pt)


Thematic Sessions Confirmed

- Simultaneous MR-PET imaging
- Satellite image analysis for environmental risk assessment
- Dental Imaging and Processing Techniques
- Digital Mammography
- Imaging of Biological Flows: trends and challenges
- Imaging techniques applied to soft tissue Biomechanics


Publications

The proceedings book will be published by the Taylor & Francis Group
and indexed by Thomson Reuters Conference Proceedings Citation Index,
IET Inspect and Elsevier Scopus.
A book with 20 invited works from the best ones presented in
VipIMAGE2011 (extended versions) will be published by Springer Verlag.
The organizers will encourage the submission of extended versions of
the accepted papers to related International Journals; in particular,
for special issues dedicated to the conference.


Important dates

- Deadline for Thematic Sessions proposals: 10th March 2011
- Deadline for Extended Abstracts: 15th March 2011
- Authors Notification: 15th April 2011
- Deadline for Full Papers: 15th June 2011


Awards

"best paper award" and "best student paper award" are going to be
given to the author(s) of two papers presented at the conference,
selected by the Organizing Committee based on the best combined marks
from the Scientific Committee and Session Chairs.


We are looking forward to see you in Algarve next October.

Kind regards,

João Manuel R. S. Tavares
Renato Natal Jorge
(conference co-chairs)

PS. For further details please see the conference website at:
www.fe.up.pt/~vipimage
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OT: Code Examples

2011-03-01 Thread geremy condra
On Tue, Mar 1, 2011 at 9:11 AM, Erik de Castro Lopo  wrote:
> Paul Rubin wrote:
>
>> Erik de Castro Lopo  writes:
>> > Why Python? I really can't understand the rush of every man and
>> > his dog to Python.
>>
>> Are you trolling?
>
> All my responses to this thread are really mean for comp.dsp,
> not for comp.lang.python.

Ah, so you're looking for an argument. This is abuse, you want room
12A just down the hall.

Geremy Condra
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OT: Code Examples

2011-03-01 Thread Tom Zych
geremy condra  wrote:
> Ah, so you're looking for an argument. This is abuse, you want room
> 12A just down the hall.

They have comfy chairs there. No one expects it.

-- 
Tom Zych / freethin...@pobox.com
Quidquid latine dictum sit, altum viditur.
-- 
http://mail.python.org/mailman/listinfo/python-list


AES Encryption of byte array

2011-03-01 Thread Meszaros, Stacy
Hello all,

I am very new to python, using it to write a test application.  I need
to be able to encrypt part of a byte array (up to 256 bytes where the
first 7 bytes remain plain text) using AES 128 bit CBC encryption.  I am
using Python 2.6, can anyone recommend a toolkit or module?

Thanks,
Stacy
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I am not able to open IDLE in python on Vista.

2011-03-01 Thread Tom Zych
Andrea Crotti  wrote:
> Best solution would be to avoid Windows Vista.

s/Vista//

There, fixed that for ya.

-- 
Tom Zych / freethin...@pobox.com
Quidquid latine dictum sit, altum viditur.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: AES Encryption of byte array

2011-03-01 Thread Tom Zych
On Tue, 01 Mar 2011 14:38 -0500, "Meszaros, Stacy"
 wrote:
> I am very new to python, using it to write a test application.  I need
> to be able to encrypt part of a byte array (up to 256 bytes where the
> first 7 bytes remain plain text) using AES 128 bit CBC encryption.  I am
> using Python 2.6, can anyone recommend a toolkit or module?

I haven't used it, but it looks like this does what you want:
http://www.dlitz.net/software/pycrypto/

-- 
Tom Zych / freethin...@pobox.com
Quidquid latine dictum sit, altum viditur.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OT: Code Examples

2011-03-01 Thread mblume
Am Mon, 28 Feb 2011 08:03:01 -0800 schrieb Fred Marshall:

> I'm interested in developing Python-based programs, including an
> engineering app. ... re-writing from Fortran and C versions.  One of the
> objectives would to be make reasonable use of the available structure
> (objects, etc.).  So, I'd like to read a couple of good, simple
> scientific-oriented programs that do that kind of thing.
> 
> Looking for links, etc.
> 
> Fred

An execellent book in this domain is
"Python Scripting for Computational Science"
by Hans Petter Langtangen

Springer, ISBN 3-450-43508-5

HTH.
Martin
-- 
http://mail.python.org/mailman/listinfo/python-list


Did MySQL support ever make it to Python 3.x?

2011-03-01 Thread John Nagle

   Is there Python 3.x support for MySQL yet?  MySQLdb's
page still says "Python versions 2.3-2.6 are supported.":

   https://sourceforge.net/projects/mysql-python/

There's PyMySQL, which is pure Python, but it's at version
0.4.  There's good progress there, but it's not being used
heavily yet, and users are reporting bugs like "broken pipe"
errors.

John Nagle
--
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-03-01 Thread Gregory Ewing

rantingrick wrote:

All we have to do is create an abstraction API that
calls wxPython until we can create OUR OWN wxPython from WxWidgets.


There seems to be at least one other project around
like that:

http://dabodev.com/

--
Greg
--
http://mail.python.org/mailman/listinfo/python-list


Re: OT: Code Examples

2011-03-01 Thread Chris Jones
On Tue, Mar 01, 2011 at 12:03:02PM EST, Emile van Sebille wrote:
> On 3/1/2011 12:43 AM Erik de Castro Lopo said...

>> Why Python?
>
> For me?  Because it's executable pseudocode

Not for nothing, Emile.. hey.. you could end up with pseudo bugs and
pseudo headaches ..

cj
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problems of Symbol Congestion in Computer Languages

2011-03-01 Thread Chris Jones
On Tue, Mar 01, 2011 at 09:46:19AM EST, rusi wrote:
> On Mar 1, 6:01 pm, Mark Thomas  wrote:

> > I know someone who was involved in creating a language called A+. It
> > was invented at Morgan Stanley where they used Sun keyboards and had
> > access to many symbols, so the language did have set symbols, math
> > symbols, logic symbols etc. Here's a keyboard map including the
> > language's symbols (the red characters).
> > http://www.aplusdev.org/keyboard.html

> > I have no idea if this language is still in use.
> 
> Runs (ok limps) under debian/ubuntu -- see 
  http://packages.debian.org/squeeze/aplus-fsf

> My own attempts at improving the scene 
  http://www.emacswiki.org/emacs/AplInDebian

> If anyone has any further findings on this, I'd be happy to know.

Well.. a couple months back I got to the point where I'd really had it
with the anglo-centric verbosity of common programming languages (there
are days when even python makes me think of COBOL.. ugh..) and I took
a look at A+.

At first it looks like something MS (Morgan Stanley..) dumped into the
OSS lap fifteen years ago and nobody ever used it or maintained it.. so
it takes a bit of digging to make it.. sort of work in current GNU/linux
distributions.. especially since it knows nothing about Unicode.

Here's the X/A+ map I came up with:

// A+ keyboard layout: /usr/share/X11/xkb/symbols/apl
// Chris Jones - 18/12/2010

// Enable via:
//  $ setxkbmap -v 10 apl

default
partial alphanumeric_keys modifier_keys 
xkb_symbols "APL" {

name[Group1]= "APL";

// Alphanumeric section
key  {[ grave,asciitilde, 0x01fe, 
0x017e  ]   };
key  {[ 1,exclam, 0x01a1, 
0x01e0  ]   };
key  {[ 2,at, 0x01a2, 
0x01e6  ]   };
key  {[ 3,numbersign, 0x013c, 
0x01e7  ]   };
key  {[ 4,dollar, 0x01a4, 
0x01e8  ]   };
key  {[ 5,percent,0x013d, 
0x01f7  ]   };
key  {[ 6,asciicircum,0x01a6, 
0x01f4  ]   };
key  {[ 7,ampersand,  0x013e, 
0x01e1  ]   };
key  {[ 8,asterisk,   0x01a8, 
0x01f0  ]   };
key  {[ 9,parenleft,  0x01a9, 
0x01b9  ]   };
key  {[ 0,parenright, 0x015e, 
0x01b0  ]   };
key  {[ minus,underscore, 0x01ab, 
0x0121  ]   };
key  {[ equal,plus,   0x01df, 
0x01ad  ]   };

key  {[ q,Q,  0x013f, 
0x01bf  ]   };
key  {[ w,W,  0x01d7, 
Nosymbol]   };
key  {[ e,E,  0x01c5, 
0x01e5  ]   };
key  {[ r,R,  0x01d2, 
Nosymbol]   };
key  {[ t,T,  0x017e, 
Nosymbol]   };
key  {[ y,Y,  0x01d9, 
0x01b4  ]   };
key  {[ u,U,  0x01d5, 
Nosymbol]   };
key  {[ i,I,  0x01c9, 
0x01e9  ]   };
key  {[ o,O,  0x01cf, 
0x01ef  ]   };
key  {[ p,P,  0x012a, 
0x01b3  ]   };
key  {[ bracketleft,  braceleft,  0x01fb, 
0x01dd  ]   };
key  {[ bracketright, braceright, 0x01fd, 
0x01db  ]   };

key  {[ a,A,  0x01c1, 
Nosymbol]   };
key  {[ s,S,  0x01d3, 
0x01be  ]   };
key  {[ d,D,  0x01c4, 
Nosymbol]   };
key  {[ f,F,  0x015f, 
0x01bd  ]   };
key  {[ g,G,  0x01c7, 
0x01e7  ]   };
key  {[ h,H,  0x01c8, 
0x01e8  ]   };
key  {[ j,J,  0x01ca, 
0x01ea  ]   };
key  {[ k,K,  0x0127, 
Nosymbol]   };
key  {[ l,L,  0x01cc, 
0x01ec  ]   };
key  {[ semicolon,colon,  0x01db, 
0x01bc  ]   };
key  {[ apostrophe,   quotedbl,   0x01dd, 
0x01bb  ]   };

key  {[ z,Z,  

Problem compiling Python 3.2 in 32bit on Snow Leopard

2011-03-01 Thread Gregory Ewing

Attempting to compile Python 3.2 in 32-bit mode
on MacOSX 10.6.4 I get:

Undefined symbols:
  "___moddi3", referenced from:
  _PyThread_acquire_lock_timed in libpython3.2m.a(thread.o)
  _acquire_timed in libpython3.2m.a(_threadmodule.o)
  "___divdi3", referenced from:
  _PyThread_acquire_lock_timed in libpython3.2m.a(thread.o)
  _acquire_timed in libpython3.2m.a(_threadmodule.o)
ld: symbol(s) not found
/usr/bin/libtool: internal link edit command failed

Any suggestions?

--
Greg
--
http://mail.python.org/mailman/listinfo/python-list


Re: OT: Code Examples

2011-03-01 Thread Dan Stromberg
On Tue, Mar 1, 2011 at 8:51 AM, Erik de Castro Lopo wrote:

> Definitely not. As I said I used Python for a number of years
> and ditched it in favour of Ocaml and Haskell.
>
These are all 3 intriguing languages.  I wish I had time to learn OCaML and
Haskell, and I wish one or both of them were near gaining critical mass.  I
suspect it'll take one of them becoming implicitly parallel for that to
happen.

The ease of development and high level language features of
> Python look really good if all you know is C, C++ and Java.
> The big difference Python and those three languages is that
> there are a huge number of classes of bugs which are run time
> errors in Python but compile time errors in C/C++/Java.
>
> I will always chose compile time errors over run time errors.
>
Yes, me too.  But of course, python has pylint, pyflakes and pychecker,
which make short work of what would be compile-time errors in statically
typed languages.  For any serious python programming, I use pylint - often
even on my unit tests, which of course themselves also catch many blunders.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problem compiling Python 3.2 in 32bit on Snow Leopard

2011-03-01 Thread Ned Deily
In article <8t5vunfca...@mid.individual.net>,
 Gregory Ewing  wrote:
> Attempting to compile Python 3.2 in 32-bit mode
> on MacOSX 10.6.4 I get:
> 
> Undefined symbols:
>"___moddi3", referenced from:
>_PyThread_acquire_lock_timed in libpython3.2m.a(thread.o)
>_acquire_timed in libpython3.2m.a(_threadmodule.o)
>"___divdi3", referenced from:
>_PyThread_acquire_lock_timed in libpython3.2m.a(thread.o)
>_acquire_timed in libpython3.2m.a(_threadmodule.o)
> ld: symbol(s) not found
> /usr/bin/libtool: internal link edit command failed
> 
> Any suggestions?

http://article.gmane.org/gmane.comp.python.general/685151

-- 
 Ned Deily,
 n...@acm.org

-- 
http://mail.python.org/mailman/listinfo/python-list


Playing WAV file with Python

2011-03-01 Thread VGNU Linux
Hi All,
How can I play WAV file in python without OS(like Linux/Windows/MAC) on a
device ?
On Google I found lot of different solution but related to OS's like
winsound, ossaudiodev etc which are not useful.
Thanks in advance.

Regards,
VGNU
-- 
http://mail.python.org/mailman/listinfo/python-list