Re: Python Interpreter Error with PyDev (Eclipse IDE)

2011-12-16 Thread Joshua Jodrey
a some python directories laying around from an odd svn installation or something... Thanks again! From: Fabio Zadrozny To: Joshua Jodrey Cc: "python-list@python.org" Sent: Friday, December 16, 2011 12:57 PM Subject: Re: Python Interpreter Error

Re: Python Interpreter Error with PyDev (Eclipse IDE)

2011-12-16 Thread Fabio Zadrozny
It seems you have a version of Python 2.5 in your system and when starting up Python 3.2.2 it's getting things from 2.5 (this would probably also happen on the command line). The usual suspect is that you defined a PYTHONROOT variable which is pointing to Python 2.5 and not to the python you're us

Re: python interpreter

2011-01-26 Thread Dave Angel
On 01/-10/-28163 02:59 PM, nair rajiv wrote: Hi, I was exploring python. I wanted to know more about the python interpreter i.e the technical details of how it has been written. If I am directed to the code that also will be fine. The implementation of python data structures lists, tuples and d

Re: Python interpreter speed

2009-04-21 Thread Terry Reedy
Fabio Zadrozny wrote: Further, I have an accounting software which was previously in java, but now in python and the performance gain is ausom. Yes it depends on how we write the code but comparing the 2 at least at the middle layer and front-end (pygtk) python is faster than java. Infact I am m

Re: Python interpreter speed

2009-04-21 Thread Fabio Zadrozny
> Further, I have an accounting software which was previously in java, but > now in python and the performance gain is ausom. > > Yes it depends on how we write the code but comparing the 2 at least at > the middle layer and front-end (pygtk) python is faster than java. > Infact I am most certain t

Re: Python interpreter speed

2009-04-20 Thread Stefan Behnel
Tim Roberts wrote: > The Python you're thinking of (CPython) is compiled to an intermediate > language, which is then interpreted by an interpreter loop, somewhat > remeniscent of Forth. It takes more cycles per instruction to run that > interpreter loop than it does to run the machine language, b

Re: Python interpreter speed

2009-04-20 Thread Tim Roberts
Ryniek90 wrote: > >Standard Python interpreter's implementation is written in C language. C >code while compilation, is compilled into machine code (the fastest >code). Python code is compiled into into byte-code which is also some >sort of fast machine code. So why Python interpreter is slower

Re: Python interpreter speed

2009-04-20 Thread Krishnakant
On Mon, 2009-04-20 at 20:12 +0100, Tim Wintle wrote: > > I can't remember Java properly, but... > > Firstly, speed will depend on what you're writing. I dont' actually know > how much slower python is, but I'm sure there are some things that run > faster in python. > I know many instences which

Re: Python interpreter speed

2009-04-20 Thread Tim Wintle
On Sun, 2009-04-19 at 18:11 +0200, Ryniek90 wrote: > Hi. > > Standard Python interpreter's implementation is written in C language. C > code while compilation, is compilled into machine code (the fastest > code). Python code is compiled into into byte-code which is also some > sort of fast mach

Re: Python interpreter speed

2009-04-19 Thread Pascal Chambon
Hello I'm not expert in low level languages, but I'd say that Python and Java are "compiled" to bytecodes of similar level. The difference lies in the information contained in those bytecodes : java is statically typed, so attribute access and other basic operations are rather quick, allowing

Re: Python interpreter speed

2009-04-19 Thread Krishnakant
I don't mean to start a flame war, but a productive debate will be wonderful. I have been writing heavy applications in java for a few years untill recent past. My experience is that python is not just fast but also zippy and smooth when it comes to running the applications. Infact I have a coupl

Re: python interpreter black window

2008-12-25 Thread Gandalf
On Dec 26, 2:52 am, Scott David Daniels wrote: > Chris Rebert wrote: > > On Thu, Dec 25, 2008 at 3:32 PM, Gandalf wrote: > >> I use WX gui so the user doesn't actually need it, Is their any way to > >> hide it? > > > Make sure your Python program is run by pythonw.exe as opposed to python.exe > >

Re: python interpreter black window

2008-12-25 Thread Scott David Daniels
Chris Rebert wrote: On Thu, Dec 25, 2008 at 3:32 PM, Gandalf wrote: I use WX gui so the user doesn't actually need it, Is their any way to hide it? Make sure your Python program is run by pythonw.exe as opposed to python.exe pythonw.exe exists specifically for the purpose of suppressing the D

Re: python interpreter black window

2008-12-25 Thread Chris Rebert
On Thu, Dec 25, 2008 at 3:32 PM, Gandalf wrote: > I use WX gui so the user doesn't actually need it, Is their any way to > hide it? Make sure your Python program is run by pythonw.exe as opposed to python.exe pythonw.exe exists specifically for the purpose of suppressing the DOS Box on Windows.

Re: python interpreter

2008-08-15 Thread Benjamin
On Aug 12, 10:06 am, Wojtek Walczak <[EMAIL PROTECTED]> wrote: > > And keep in mind that reload() is removed in Py3k. Hope this helps. It's not gone; it's just renamed to imp.reload. > > -- > Regards, > Wojtek Walczak,http://www.stud.umk.pl/~wojtekwa/ -- http://mail.python.org/mailman/listinfo/py

Re: python interpreter

2008-08-14 Thread Alexandru Mosoi
On Aug 12, 7:46 pm, "Calvin Spealman" <[EMAIL PROTECTED]> wrote: > The best answer is: Don't do that! > > That isn't how you test things. Write test scripts, probably using the > unittest framework. You'll save yourself time and trouble having > easily reproducible tests. Many people suggested relo

Re: python interpreter

2008-08-12 Thread Calvin Spealman
The best answer is: Don't do that! That isn't how you test things. Write test scripts, probably using the unittest framework. You'll save yourself time and trouble having easily reproducible tests. Many people suggested reload(), but you should know it is dangerous. It can have results you don't e

Re: python interpreter

2008-08-12 Thread Diez B. Roggisch
Alexandru Mosoi wrote: > I'm using python's interpreter's to run various commands (like a > normal shell). However if sources are modified changes are not > reflected so I have to restart interpreter. Is there any way to avoid > restarting this? Other gave you advice on how to - partially - achi

Re: python interpreter

2008-08-12 Thread Wojtek Walczak
Dnia Tue, 12 Aug 2008 07:58:52 -0700 (PDT), [EMAIL PROTECTED] napisa�(a): >> I'm using python's interpreter's to run various commands (like a >> normal shell). However if sources are modified changes are not >> reflected so I have to restart interpreter. Is there any way to avoid >> restarting this

Re: python interpreter

2008-08-12 Thread Jerry Hill
On Tue, Aug 12, 2008 at 10:49 AM, Alexandru Mosoi <[EMAIL PROTECTED]> wrote: > I'm using python's interpreter's to run various commands (like a > normal shell). However if sources are modified changes are not > reflected so I have to restart interpreter. Is there any way to avoid > restarting this?

Re: python interpreter

2008-08-12 Thread s0suk3
On Aug 12, 9:49 am, Alexandru Mosoi <[EMAIL PROTECTED]> wrote: > I'm using python's interpreter's to run various commands (like a > normal shell). However if sources are modified changes are not > reflected so I have to restart interpreter. Is there any way to avoid > restarting this? > > example:

Re: python interpreter on solaris 10

2006-09-25 Thread MrJean1
FWIIW, On my stock Ultra 20 / Solaris 10 / Opteron box, python, idle, etc. just run fine provided /usr/sfw/bin is in your PATH environment variable. That is Python 2.3.3, however. In addition, I installed the Python 2.4.3 build for Solaris from ActiveState and python, idle, etc. run without any

Re: python interpreter on solaris 10

2006-09-25 Thread sam
> I would try to use the python executable located in /usr/bin if it is > exists, otherwise use the python executable in /usr/sfw/bin. > > casevh lordy lord, is that where it was. i just found it now. i had been thinking that idle was the name of the python interpreter, not just the IDE, hence m

Re: python interpreter on solaris 10

2006-09-25 Thread casevh
> > /usr/bin/python > not found > > /usr/lib/python2.4/idlelib/idle.py > /usr/sfw/python2.3/idlelib/idle.py gives > > 'there is no action associated with "idle.py"' > configure gnome to associate application? > > click yes: > edit file type window pops up. > program to run menu is empty. > browse i

Re: python interpreter on solaris 10

2006-09-25 Thread sam
[EMAIL PROTECTED] wrote: > > i think i've tracked down the equivalent files on my pc. one opens the > > interpreter in a white-backed text editor, the other at the > > black-backed command prompt. i have equivalent files of the same size > > on the workstation, which must be the same. does anyone k

Re: python interpreter on solaris 10

2006-09-25 Thread casevh
> i think i've tracked down the equivalent files on my pc. one opens the > interpreter in a white-backed text editor, the other at the > black-backed command prompt. i have equivalent files of the same size > on the workstation, which must be the same. does anyone know why i'm > getting 'there is n

Re: python interpreter on solaris 10

2006-09-25 Thread skip
sam> does anyone know why i'm getting 'there is no installed viewer sam> capable of displaying the document'? You probably need to associate files having .py file extensions with the Python interpreter. You've given no indication of the environment you're using other than "Solaris 10".

Re: python interpreter on solaris 10

2006-09-25 Thread sam
to update: i think i've tracked down the equivalent files on my pc. one opens the interpreter in a white-backed text editor, the other at the black-backed command prompt. i have equivalent files of the same size on the workstation, which must be the same. does anyone know why i'm getting 'there is

Re: python interpreter widget for Tkinter?

2006-04-11 Thread Alexandre Guimond
thx ian. exactly what I wanted. best, alex. -- http://mail.python.org/mailman/listinfo/python-list

Re: python interpreter widget for Tkinter?

2006-04-10 Thread Ian Parker
In message <[EMAIL PROTECTED]>, Alexandre Guimond <[EMAIL PROTECTED]> writes >Hi i was wondering if there already existed a simple python interpreter >widget for tkinter? Basically, i would like to be able to lauch a >python interpreter in a seperate window from my tkinter app for >debugging purpo

Re: PYTHON INTERPRETER

2006-01-02 Thread Alex Martelli
Corey Carter <[EMAIL PROTECTED]> wrote: > I am interested in creating programs in python. I am not sure how I would > run the programs on other machines without having to install python on each > machine. Is there a way to run python programs on machines without the > python interpreter? There a

Re: python interpreter

2005-10-13 Thread Neal Norwitz
g.franzkowiak wrote: > Hi everybody, > > my interest is for the internals of the Python interpreter. > > I've used up to now FORTH for something and this indirect interpreter is > very smart. > --- ASM --- > > Where can I find information

Re: python interpreter

2005-10-13 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, g.franzkowiak wrote: > my interest is for the internals of the Python interpreter. > > I've used up to now FORTH for something and this indirect interpreter is > very smart. > --- ASM --- > > NEXT: LODSW

Re: python interpreter

2005-10-11 Thread Paul Rubin
"g.franzkowiak" <[EMAIL PROTECTED]> writes: > Where can I find informations like this for Python ? "Use the force, read the source". Python's interpreter is more like a big switch statement on bytecodes, though. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python interpreter bug

2005-10-07 Thread Steve Holden
[EMAIL PROTECTED] wrote: >>Steve Holden wrote: >>Consider: > > > >>> a = {1:'one'} > >>> b = {2:'two'} > >>> c = {1:'one'} > >>> a is c > False > >>> a in [b, c] > True > >>> > > >>What would you have Python do differently in these circumstances? > > > You mean: What i would do i if i w

Re: Python interpreter bug

2005-10-07 Thread alainpoint
> Steve Holden wrote: >Consider: >>> a = {1:'one'} >>> b = {2:'two'} >>> c = {1:'one'} >>> a is c False >>> a in [b, c] True >>> >What would you have Python do differently in these circumstances? You mean: What i would do i if i was the benevolent dictator ? I would make a distinction bet

Re: Python interpreter bug

2005-10-07 Thread Steve Holden
[EMAIL PROTECTED] wrote: > I understand this, Steve. > I thought the _cmp_ method was a helper for sorting purposes. Why is it > that a membership test needs to call the __cmp__ method? Can you suggest another way to test for set membership, given that instances aren't singletons? The only way to

Re: Python interpreter bug

2005-10-07 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > No doubt you're right but common sense dictates that membership testing > would test identity not equality. what does "common sense" have to say about this case: >>> L = ("aa", "bb", "cc", "dd") >>> S = "a" + "a" >>> L ('aa', 'bb', 'cc', 'dd') >>> S 'aa' >>> S in L # T

Re: Python interpreter bug

2005-10-07 Thread Christopher Subich
[EMAIL PROTECTED] wrote: > No doubt you're right but common sense dictates that membership testing > would test identity not equality. > This is one of the rare occasions where Python defeats my common sense But object identity is almost always a fairly ill-defined concept. Consider this (Python

Re: Python interpreter bug

2005-10-07 Thread alainpoint
No doubt you're right but common sense dictates that membership testing would test identity not equality. This is one of the rare occasions where Python defeats my common sense ;-( Alain -- http://mail.python.org/mailman/listinfo/python-list

Re: Python interpreter bug

2005-10-07 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > In fact, i want to sort the list based on the 'allocated attribute' and > at the same time, test membership based on the id attribute. > __cmp__ logically implies an ordering test really? http://dictionary.reference.com/search?q=compare com·pare v. com·pare

Re: Python interpreter bug

2005-10-07 Thread bruno modulix
[EMAIL PROTECTED] wrote: > Sorry Fredrik but I don't understand. Just comment out the assert and > you have different results depending on whether an unrelated sort > function is defined. > This seems weird to me ! code snippet: > from random import choice > class OBJ: > def __init__(self,i

Re: Python interpreter bug

2005-10-07 Thread Robert Kern
[EMAIL PROTECTED] wrote: > In fact, i want to sort the list based on the 'allocated attribute' and > at the same time, test membership based on the id attribute. > __cmp__ logically implies an ordering test, not an identity test. These > two notions seems to be confounded in python which is unfortu

Re: Python interpreter bug

2005-10-07 Thread Carsten Haese
On Fri, 2005-10-07 at 10:33, [EMAIL PROTECTED] wrote: > In fact, i want to sort the list based on the 'allocated attribute' and > at the same time, test membership based on the id attribute. > __cmp__ logically implies an ordering test, not an identity test. These > two notions seems to be confound

Re: Python interpreter bug

2005-10-07 Thread [EMAIL PROTECTED]
For this, you can also define the __eq__ method, which will be preferred to __cmp__ for equallity tests while still using __cmp__ for searching / comparisons. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python interpreter bug

2005-10-07 Thread alainpoint
In fact, i want to sort the list based on the 'allocated attribute' and at the same time, test membership based on the id attribute. __cmp__ logically implies an ordering test, not an identity test. These two notions seems to be confounded in python which is unfortunate. Two objects could have the

Re: Python interpreter bug

2005-10-07 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Why is it that a membership test needs to call the __cmp__ method? because the membership test has to check if the tested item is a member of the sequence. if it doesn't do that, it's hardly qualifies as a membership test. from the reference manual: For the list a

Re: Python interpreter bug

2005-10-07 Thread [EMAIL PROTECTED]
Your __cmp__ method will always return 0, so all objects will be equal when you add the method, as Simon and Steve pointed out. The result is all objects will pass the test of being a member of excluded. If you do not add a __cmp__ method objects will be compared on identy - call the id() function

Re: Python interpreter bug

2005-10-07 Thread [EMAIL PROTECTED]
Your __cmp__ method will always return 0, so all objects will be equal when you add the method, as Simon and Steve pointed out. The result is all objects will pass the test of being a member of excluded. If you do not add a __cmp__ method objects will be compared on identy - call the id() function

Re: Python interpreter bug

2005-10-07 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Sorry Fredrik but I don't understand. Just comment out the assert and > you have different results depending on whether an unrelated sort > function is defined. > > This seems weird to me ! not if you look at what it prints. (if it seems weird to you that 0 equals 0, i

Re: Python interpreter bug

2005-10-07 Thread alainpoint
I understand this, Steve. I thought the _cmp_ method was a helper for sorting purposes. Why is it that a membership test needs to call the __cmp__ method? If this isn't a bug, it is at least unexpected in my eyes. Maybe a candidate for inclusion in the FAQ? Thank you for answering Alain -- http:/

Re: Python interpreter bug

2005-10-07 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Sorry Fredrik but I don't understand. Just comment out the assert and > you have different results depending on whether an unrelated sort > function is defined. > This seems weird to me ! > Perhaps you don't understand what's going on. The test obj in excluded is

Re: Python interpreter bug

2005-10-07 Thread alainpoint
Sorry Fredrik but I don't understand. Just comment out the assert and you have different results depending on whether an unrelated sort function is defined. This seems weird to me ! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python interpreter bug

2005-10-07 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I came accross what i think is a serious bug in the python interpreter. > Membership testing seems not to work for list of objects when these > objects have a user-defined __cmp__ method. it does not work if they have *your* __cmp__ method, no. if you add a print stat

Re: Python interpreter bug

2005-10-07 Thread alainpoint
There is definitely a bug. Maybe the follownig snippet is more clear: class OBJ: def __init__(self,identifier): self.id=identifier self.allocated=0 #def __cmp__(self,other): # return cmp(other.allocated,self.allocated) mylist=[OBJ(i) for

Re: Python interpreter bug

2005-10-07 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hello, > > I came accross what i think is a serious bug in the python interpreter. > > Membership testing seems not to work for list of objects when these > objects have a user-defined __cmp__ method. > It is present in Python 2.3 and 2.4. I don't know about other versi

Re: Python interpreter bug

2005-10-07 Thread Simon Percivall
Why would it be a bug? You've made it so that every instance of OBJ is equal to every other instance of OBJ. The behaviour is as expected. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python interpreter error: unsupported operand type(s) for |:

2005-08-11 Thread Bruno Desthuilliers
yaffa a écrit : > hey folks i get this error: Python interpreter error: unsupported > operand type(s) for |: > > when i run this line of code: > > for incident in bs('tr', {'bgcolor' : '#ee'} | {'bgcolor' : > 'white'} ): > > any idea what i'm doing wrong here? yes: trying to do a bitwis

Re: Python interpreter error: unsupported operand type(s) for |:

2005-08-11 Thread Bruno Desthuilliers
Szabolcs Nagy a écrit : > you cannot use | with two dict (dict has no .__or__ method) > > what are you trying to do? > read the post: "need help with python syntax"... (posted one hour sooner) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python interpreter error: unsupported operand type(s) for |:

2005-08-11 Thread Szabolcs Nagy
you cannot use | with two dict (dict has no .__or__ method) what are you trying to do? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python interpreter in Basic or a Python-2-Basic translator.

2005-05-02 Thread rrr
On 1 May 2005 at 6:18, Engineer wrote: > The security 'droids have decided that since the MS Office Suite is a > "standard" application then software written in MS Office VBA must be > "safe." Any other development environments (such as Java, Perl, > Cygwin) are "unsafe" and can't be installed.

Re: Python interpreter in Basic or a Python-2-Basic translator.

2005-05-01 Thread Jeremy Bowers
On Sun, 01 May 2005 06:18:27 -0700, Engineer wrote: > The security 'droids have decided that since the MS Office Suite is a > "standard" application then software written in MS Office VBA must be > "safe." "Melissa". (Google hint: "Virus".) Given the brazen stupidity demonstrated by these decisio

Re: Python interpreter in Basic or a Python-2-Basic translator.

2005-05-01 Thread Do Re Mi chel La Si Do
Hi ! VBA is at the end of his lifetime. The next MS-Office will not have VBA (because dotNet). You should really adopt Python. @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Python interpreter in Basic or a Python-2-Basic translator.

2005-05-01 Thread Larry Bates
I don't think this is going to happen. Applications that drive MS Office applications merely call COM objects that perform the actual operations. It doesn't really matter what language calls the COM objects, they are the same objects all the time. If they don't like the "installation" of the Pyt

Re: Python interpreter error: unsupported operand type(s) for -: 'tuple' and 'int'

2005-03-30 Thread Rakesh
George Yoshida wrote: > Rakesh wrote: > > > To quote a much smaller trimmed-down example, here is how it looks > > like: > > ## --- > > # Entry Point to the whole program > > ## --- > > def main(): > >

Re: Python interpreter error: unsupported operand type(s) for -: 'tuple' and 'int'

2005-03-29 Thread George Yoshida
Rakesh wrote: > To quote a much smaller trimmed-down example, here is how it looks > like: > ## --- > # Entry Point to the whole program > ## --- > def main(): > mylist = GenerateList() > minnumber = min

Re: Python interpreter error: unsupported operand type(s) for -: 'tuple' and 'int'

2005-03-29 Thread Rakesh
To quote a much smaller trimmed-down example, here is how it looks like: <--> import sys ## ## def GenerateList(): array = ' ' for i in xrange(10): array = (array, i) return array ## --