Re: Does Python have equivalent to MATLAB "varargin", "varargout", "nargin", "nargout"?

2007-02-19 Thread openopt
Ok, thx But can I somehow determing how many outputs does caller func require? for example: MATLAB: function [objFunVal firstDerive secondDerive] = simpleObjFun(x) objFunVal = x^3; if nargout>1 firstDerive = 3*x^2; end if nargout>2 secondDerive = 6*x; end So if caller wants only [objFunVal firstDe

How to test if one dict is subset of another?

2007-02-19 Thread Jay Tee
Hi, I have some code that does, essentially, the following: - gather information on tens of thousands of items (in this case, jobs running on a compute cluster) - store the information as a list (one per job) of Job items (essentially wrapped dictionaries mapping attribute names to valu

Re: How do I create an array of functions?

2007-02-19 Thread Diez B. Roggisch
Steven W. Orr schrieb: > I have a table of integers and each time I look up a value from the > table I want to call a function using the table entry as an index into > an array whose values are the different functions. I haven't seen > anything on how to do this in python. def f(): pass f

Re: How do I create an array of functions?

2007-02-19 Thread Rob Wolfe
Steven W. Orr wrote: > I have a table of integers and each time I look up a value from the table > I want to call a function using the table entry as an index into an array > whose values are the different functions. I haven't seen anything on how > to do this in python. Do you mean something li

Re: How to test if one dict is subset of another?

2007-02-19 Thread Diez B. Roggisch
Jay Tee schrieb: > Hi, > > I have some code that does, essentially, the following: > > - gather information on tens of thousands of items (in this case, jobs > running on a > compute cluster) > - store the information as a list (one per job) of Job items > (essentially wrapped > diction

Re: How do I create an array of functions?

2007-02-19 Thread Paul Rubin
"Steven W. Orr" <[EMAIL PROTECTED]> writes: > I have a table of integers and each time I look up a value from the > table I want to call a function using the table entry as an index into > an array whose values are the different functions. I haven't seen > anything on how to do this in python. fu

Building Python Pagage for Newer Python Version

2007-02-19 Thread bg_ie
Hi, I have just downloaded the source for PyXML-0.8.4, which I would like to build for Python 2.5. How exactly do I go about doing this? Thanks for your help, Barry. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: java2python 0.2

2007-02-19 Thread Kay Schluehr
On 19 Feb., 15:38, Troy Melhase <[EMAIL PROTECTED]> wrote: > java2python - Java to Python Source Code Translator > --- > java2python 0.2 Released 18 February 2007 > > What is java2python? > -

Re: Does Python have equivalent to MATLAB "varargin", "varargout", "nargin", "nargout"?

2007-02-19 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Ok, thx > But can I somehow determing how many outputs does caller func require? > for example: > MATLAB: > function [objFunVal firstDerive secondDerive] = simpleObjFun(x) > objFunVal = x^3; > if nargout>1 > firstDerive = 3*x^2; > end > if nargout>2 > secondDerive = 6*x;

distutils and paths

2007-02-19 Thread billie
Hi there. I played with distutils for some hours but I didn't figured out how to solve this problem so I would really be thankful if someone could help me out. My package is structured as follows: setup.py | mypkg | | | __init

(beginners question) howto set self.field4.subfield8='asdf'?

2007-02-19 Thread openopt
I have class A: def __init__(self, objFun, x0): #(I want to have self.primal.f = objFun) #both self.primal.f = objFun #and self.primal = None self.primal.f = objFun yields error what should I do? Thx -- http://mail.python.org/mailman/listinfo/pytho

timeout in urllib.open()

2007-02-19 Thread Stefan Palme
Hi all, is there a way to modify the time a call of urllib.open(...) waits for an answer from the other side? Have a tool which automatically checks a list of websites for certain content. The tool "hangs" when one of the contacted websites behaves badly and "never" answers... Thanks and reg

Re: Django, one more newbie question

2007-02-19 Thread Stefan Scholl
Boris Ozegovic <[EMAIL PROTECTED]> wrote: > Umm, can somebody tell me which language is this one: >No polls are available. English? -- http://mail.python.org/mailman/listinfo/python-list

Re: (beginners question) howto set self.field4.subfield8='asdf'?

2007-02-19 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I have > class A: > def __init__(self, objFun, x0): > #(I want to have self.primal.f = objFun) > #both > self.primal.f = objFun > #and > self.primal = None > self.primal.f = objFun None is a singleton, so if Python were to

Re: How to test if one dict is subset of another?

2007-02-19 Thread Peter Otten
Jay Tee wrote: > Hi, > > I have some code that does, essentially, the following: > > - gather information on tens of thousands of items (in this case, jobs > running on a > compute cluster) > - store the information as a list (one per job) of Job items > (essentially wrapped > dictiona

Free URL Submission, Forum, Free Ebooks, Articles

2007-02-19 Thread Rohin
Free URL Submission, Forum, Free Ebooks, Articles. http://www.aonearticles.com. -- http://mail.python.org/mailman/listinfo/python-list

Re: timeout in urllib.open()

2007-02-19 Thread Peter Otten
Stefan Palme wrote: > is there a way to modify the time a call of > > urllib.open(...) > > waits for an answer from the other side? Have a tool > which automatically checks a list of websites for > certain content. The tool "hangs" when one of the > contacted websites behaves badly and "never"

Choices: scipy, matplot ...

2007-02-19 Thread dug
Hi, I would like to do some real time signal processing with a graphical display and I would like your advice as to what I should use. I would like to be able to view the results and to change parameters of some signal processing in 'real time'. Data is coming quite slowly in every 1-5 seconds an

Re: timeout in urllib.open()

2007-02-19 Thread Stefan Palme
Uuuh this is no solution for me, because the website-checking tool is part of a very very big application running in an application server, so globally setting the timeout may break a lot of other things... But when there is a "default timeout" (as indicated by the method name) - isn't there a "

Embedded and extending python 2.5: trouble with __main__ in PyRun_SimpleFileExFlags?

2007-02-19 Thread Carl Douglas
Hi Python fans, I am developing a DLL that is loaded by a host application on windows. I'm using python 2.5. My DLL uses an embedded python interpreter which can access the host application through an API which I have exposed using SWIG 1.3.31. Therefore I have both extended and embedded Python

Re: timeout in urllib.open()

2007-02-19 Thread Peter Otten
Stefan Palme wrote: (top-posting undone) [Peter] >> I believe this can only be set globally: >> >> import socket >> socket.setdefaulttimeout(seconds) [Stefan] > Uuuh this is no solution for me, because the > website-checking tool is part of a very very big > application running in an applicatio

writing a file:newbie question

2007-02-19 Thread kavitha thankaian
Hi, i have a file test.txt and it contains a list of strings say,,, "a","b","c","d","a1","b1","c1","d1","a2","b2","c2","d2", i would like to write the file as "a","b","c","d" "a1","b1","c1","d1 "a2","b2","c2","d2" and would like to delete the comma at the end.

ipython shortcut to reload modules

2007-02-19 Thread [EMAIL PROTECTED]
Hey! I'm using ipython as my python shell and often run scripts with the magic command %run: In [1]: %run script.py If modules are loaded within the script these are not reloaded when I rerun the script. Hence, when I changed some of the modules loaded, I have to call In [2]: reload(module1) Ou

Re: How to test if one dict is subset of another?

2007-02-19 Thread Jay Tee
On Feb 19, 11:07 am, Peter Otten <[EMAIL PROTECTED]> wrote: > Use a RDBMS (a database), they tend to be good at this kind of operations. yeah, one of the options is metakit ... sqlite and buzhug both looked promising but the constraint of pythons 2.2 and 2.3 ruled that out. disadvantage of metaki

Re: Help Required for Choosing Programming Language

2007-02-19 Thread sturlamolden
On Feb 17, 1:34 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > - designing the GUI will cost me about 2 .. 3 times as much in Python Use a design tool like GLADE for PyGTK, wxGlade for wxPython or Komodo for tkinter. The more of the GUI code you can remove from your functional code the better. GUI

Re: Help Required for Choosing Programming Language

2007-02-19 Thread sturlamolden
On Feb 16, 11:12 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > "GUI based programming languages" ? What's that ? LabView -- http://mail.python.org/mailman/listinfo/python-list

Re: 'import dl' on AMD64 platform

2007-02-19 Thread John Pye
On Feb 19, 6:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > John Pye <[EMAIL PROTECTED]> wrote: > > application from running on the Debian Etch AMD64 platform. > > It seems that the 'dl' module is not available on that platform. The > > only reason I need the 'dl' module, however, is for th

Re: (beginners question) howto set self.field4.subfield8='asdf'?

2007-02-19 Thread openopt
Thx but is there any simpleir way, if using not class, but just struct (or something like that, MATLAB equivalent for that one)? I'm thinking of rewriting some optimization solvers (non-smooth, constrained, with (sub)gradients or patterns provided by user) to Python and I don't know currently is it

Re: Choices: scipy, matplot ...

2007-02-19 Thread sturlamolden
On Feb 19, 11:34 am, "dug" <[EMAIL PROTECTED]> wrote: > I would like to do some real time signal processing with a graphical > display and I would like your advice as to what I should use. I would > like to be able to view the results and to change parameters of some > signal processing in 'real

Re: timeout in urllib.open()

2007-02-19 Thread Stefan Palme
>>> [Peter] >>> I believe this can only be set globally: >>> >>> import socket >>> socket.setdefaulttimeout(seconds) >>> >> [Stefan] >> ... >> But when there is a "default timeout" (as indicated by >> the method name) - isn't there a "per-socket timeout" >> too? > > [Peter] > Yes, but it isn't as

Re: How to test if one dict is subset of another?

2007-02-19 Thread Peter Otten
Jay Tee wrote: > On Feb 19, 11:07 am, Peter Otten <[EMAIL PROTECTED]> wrote: > >> Use a RDBMS (a database), they tend to be good at this kind of >> operations. > > yeah, one of the options is metakit ... sqlite and buzhug both looked > promising but the constraint of pythons 2.2 and 2.3 ruled th

Re: (beginners question) howto set self.field4.subfield8='asdf'?

2007-02-19 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Thx > but is there any simpleir way, if using not class, but just struct (or > something like that, MATLAB equivalent for that one)? > I'm thinking of rewriting some optimization solvers (non-smooth, > constrained, with (sub)gradients or patterns provided by user) to > P

ocaml to python

2007-02-19 Thread Gigs_
Is there any way to convert ocaml code to python? but not manually thx -- http://mail.python.org/mailman/listinfo/python-list

World Funniest Video

2007-02-19 Thread sidoy
you can find here the World Funniest Video at http://www.supperlaffn.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: (beginners question) howto set self.field4.subfield8='asdf'?

2007-02-19 Thread openopt
Thx but is there any simpleir way, if using not class, but just struct (or something like that, MATLAB equivalent for that one)? I'm thinking of rewriting some optimization solvers (non-smooth, constrained, with (sub)gradients or patterns provided by user) to Python and I don't know currently is it

Free Url submission, Forum, Free Ebooks, Articles etc

2007-02-19 Thread mona_jamil2000
Free Url submission, Forum, Free Ebooks, Articles etc.. http://www.aonearticles.com -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: java2python 0.2

2007-02-19 Thread Troy Melhase
> Hi Troy. What is the rationale for your project? Hi Kay, I maintain a python port of a java library. It finally got too complicated to do by hand, so I wrote java2python to make my life easier. I wrote more extensively about the library and this tool in my blog: http://blog.melhase.net/artic

Re: How do I create an array of functions?

2007-02-19 Thread Steven D'Aprano
On Mon, 19 Feb 2007 00:16:39 -0800, Rob Wolfe wrote: > > Steven W. Orr wrote: >> I have a table of integers and each time I look up a value from the table >> I want to call a function using the table entry as an index into an array >> whose values are the different functions. I haven't seen anyt

Re: How do I create an array of functions?

2007-02-19 Thread Rob Wolfe
Steven D'Aprano wrote: > On Mon, 19 Feb 2007 00:16:39 -0800, Rob Wolfe wrote: > > > > > Steven W. Orr wrote: > >> I have a table of integers and each time I look up a value from the table > >> I want to call a function using the table entry as an index into an array > >> whose values are the diffe

Re: How do I create an array of functions?

2007-02-19 Thread John Machin
On Feb 19, 11:47 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Mon, 19 Feb 2007 00:16:39 -0800, Rob Wolfe wrote: > > > Steven W. Orr wrote: > >> I have a table of integers and each time I look up a value from the table > >> I want to call a function using the table entry as an index into an a

Re: Building Python Pagage for Newer Python Version

2007-02-19 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi, > > I have just downloaded the source for PyXML-0.8.4, which I would like > to build for Python 2.5. How exactly do I go about doing this? python2.5 setup.py install usually does the trick. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: PyDev on Mac

2007-02-19 Thread Ahmer
On Feb 18, 12:01 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Ahmer schrieb: > > > > > On Feb 18, 4:50 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >> Ahmer schrieb: > > >>> I've been trying to set up PyDev on my new MacBook Pro, but i have not > >>> had an success. > >>> Could you pl

Re: Help Required for Choosing Programming Language

2007-02-19 Thread Muntasir Azam Khan
On Feb 17, 3:22 am, [EMAIL PROTECTED] wrote: > I am VB6 programmer and wants to start new programming language but i > am unable to deciced. > > i have read about Python, Ruby and Visual C++. but i want to go > through with GUI based programming language like VB.net > > so will you please guide me

Re: search cursor in pythonwin 2.1

2007-02-19 Thread GISDude
On Feb 18, 2:19 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 18 Feb 2007 13:12:20 -0300, GISDude <[EMAIL PROTECTED]> > escribió: > > > I am a GIS(geographic information systems) Analyst and in our > > software(ESRI ARCGIS 9.1) ESRI has implemented Python 2.1 as the > > scripting lan

Re: Python Threads

2007-02-19 Thread Sick Monkey
Great, thanks for the tip Gabriel! On 2/18/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: En Sun, 18 Feb 2007 23:37:02 -0300, Sick Monkey <[EMAIL PROTECTED]> escribió: > Well if this cannot be done, can a thread call a function in the main > method? > I have been trying and have not been suc

Re: Help Required for Choosing Programming Language

2007-02-19 Thread Steve Holden
Muntasir Azam Khan wrote: > On Feb 17, 3:22 am, [EMAIL PROTECTED] wrote: >> I am VB6 programmer and wants to start new programming language but i >> am unable to deciced. >> >> i have read about Python, Ruby and Visual C++. but i want to go >> through with GUI based programming language like VB.net

Re: Help Required for Choosing Programming Language

2007-02-19 Thread Andy Dingley
On 16 Feb, 21:22, [EMAIL PROTECTED] wrote: > I am VB6 programmer and wants to start new programming language Why? What is causing you to do this, and what do you need to achieve by doing it? > i want to go through with GUI based programming language like VB.net "GUI-based" is fairly unimportant

Re: Does Python have equivalent to MATLAB "varargin", "varargout", "nargin", "nargout"?

2007-02-19 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Ok, thx > But can I somehow determing how many outputs does caller func require? > for example: > MATLAB: > function [objFunVal firstDerive secondDerive] = simpleObjFun(x) > objFunVal = x^3; > if nargout>1 > firstDerive = 3*x^2; > end > if nargout>2 > secondDerive = 6*x;

Re: (beginners question) howto set self.field4.subfield8='asdf'?

2007-02-19 Thread Stargaming
[EMAIL PROTECTED] wrote: > Thx > but is there any simpleir way, if using not class, but just struct (or > something like that, MATLAB equivalent for that one)? Use this:: >>> A = type('', (), {}) >>> a = A() >>> a <__main__. object at 0x009E8490> >>> a.foo = 42 >>> a.foo 42 But perhaps usin

Re: timeout in urllib.open()

2007-02-19 Thread Steve Holden
Stefan Palme wrote: [Peter] I believe this can only be set globally: import socket socket.setdefaulttimeout(seconds) >>> [Stefan] >>> ... >>> But when there is a "default timeout" (as indicated by >>> the method name) - isn't there a "per-socket timeout" >>> too? >> [P

Re: PyDev on Mac

2007-02-19 Thread Fabio Zadrozny
Pythin runs but PyDev won't use the inerpreter. It gives me an error saying I'm using an invalid interpreter. Is there a way to do this using jPython? Pydev usually outputs something into your error log when it says you've specified an invalid interpreter... can you check it? (see http://pyde

Declare a variable global

2007-02-19 Thread [EMAIL PROTECTED]
Hi, I have the following code: colorIndex = 0; def test(): print colorIndex; This won't work. But it works if i do this: colorIndex = 0; def test(): global colorIndex; print colorIndex; My question is why do I have to explicit declaring 'global' for 'colorIndex'? Can't pyth

Re: Declare a variable global

2007-02-19 Thread Jean-Paul Calderone
On 19 Feb 2007 09:04:19 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >Hi, > >I have the following code: > >colorIndex = 0; > >def test(): > print colorIndex; > >This won't work. Are you sure? [EMAIL PROTECTED]:~$ cat foo.py colorIndex = 0 def test(): print

Re: timeout in urllib.open()

2007-02-19 Thread Paul Rubin
Stefan Palme <[EMAIL PROTECTED]> writes: > is there a way to modify the time a call of > > urllib.open(...) > > waits for an answer from the other side? Have a tool which > automatically checks a list of websites for certain content. The > tool "hangs" when one of the contacted websites behaves

Re: Declare a variable global

2007-02-19 Thread [EMAIL PROTECTED]
On Feb 19, 11:09 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On 19 Feb 2007 09:04:19 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > >Hi, > > >I have the following code: > > >colorIndex = 0; > > >def test(): > > print colorIndex; > > >This won't work. > > Are you sure? > >

Raw Imager

2007-02-19 Thread Andrew
Im looking at building a tool for previewing raw images as Thumbnails no editing really just viewing in a simple Tkinter GUI however from what I can tell Pil does not support raw images Does anyone have a link to a module that would allow this I guess I would need support for as many different

Re: Declare a variable global

2007-02-19 Thread Gary Herron
[EMAIL PROTECTED] wrote: > Hi, > > I have the following code: > > colorIndex = 0; > > def test(): > print colorIndex; > > This won't work. But it works if i do this: > Yes, it does work. Can you be more explicit about why you think it doesn't? (Also, this is Python not C/C++. Get *RID* o

Re: Help Required for Choosing Programming Language

2007-02-19 Thread Mark Morss
On Feb 16, 4:22 pm, [EMAIL PROTECTED] wrote: > I am VB6 programmer and wants to start new programming language but i > am unable to deciced. > > i have read about Python, Ruby and Visual C++. but i want to go > through with GUI based programming language like VB.net > > so will you please guide me

Re: Declare a variable global

2007-02-19 Thread Peter Otten
[EMAIL PROTECTED] wrote: > On Feb 19, 11:09 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> On 19 Feb 2007 09:04:19 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> >> wrote: >> >> >Hi, >> >> >I have the following code: >> >> >colorIndex = 0; >> >> >def test(): >> > print colorIndex; >> >>

Re: Declare a variable global

2007-02-19 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > I have the following code: > > colorIndex = 0; > > def test(): > print colorIndex; Don't use ";". It's redundant. > This won't work. But it works if i do this: > > colorIndex = 0; > > def test(): > global colorIndex; > print colorIndex; > > My qu

Re: What is more efficient?

2007-02-19 Thread Karlo Lozovina
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > It doesn't matter whether you have 0 or a million instances, > methods do not occupy more memory. That's what I was looking for! Thanks, to you and all the others. -- ___Ka

Re: function & class

2007-02-19 Thread Bjoern Schliessmann
jupiter wrote: > I am getting this error when I am using sql command within > class.function accessing from another class > > how can I create seperate instance for sqlite objects ??? Trying to help you gets boring. I suggest reading the material that's being offered. Regards, Björn --

Re: Help Required for Choosing Programming Language

2007-02-19 Thread Peter Decker
On 19 Feb 2007 09:56:06 -0800, Mark Morss <[EMAIL PROTECTED]> wrote: > Good grief. I suppose it is Microsoft to whom we owe the idea that > there could be such a thing as a "GUI based" programming language. Who do we blame for the idea that everyone in the world should be able to express themsel

Re: How to detect closing of wx.Panel?

2007-02-19 Thread Jacol
Morpheus wrote: > On Mon, 19 Feb 2007 01:18:11 +, Jacol wrote: > >> Hi everybody, >> >> I have poblem with detecting closing of wx.Panel by user. How to detect >> that event? > > Don't know why you want to do that, but you could register with the > enclosing (hosting) widget. In my program

Re: PyDev on Mac

2007-02-19 Thread Ahmer
On Feb 18, 4:50 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Ahmer schrieb: > > > I've been trying to set up PyDev on my new MacBook Pro, but i have not > > had an success. > > > Could you please help! > > Just wait until my crystal ball comes back from the cleaners, and I will > start looki

Re: PyDev on Mac

2007-02-19 Thread Fabio Zadrozny
On 19 Feb 2007 10:41:41 -0800, Ahmer <[EMAIL PROTECTED]> wrote: On Feb 18, 4:50 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Ahmer schrieb: > > > I've been trying to set up PyDev on my new MacBook Pro, but i have not > > had an success. > > > Could you please help! > > Just wait until my

Re: Declare a variable global

2007-02-19 Thread Terry Reedy
| Here is my complete script: | #!/usr/bin/python | | import re | import sys | import time | import os | import shutil | | colors = ["#FF", "#00FF00", "#FF", | "#00" ,"#FFA500" ,"#DA70D6"] | colorIndex = 0 | | def getText( intputstr): |rc = "" | |maxX = 0; |maxY = 0; |m

Re: ocaml to python

2007-02-19 Thread Jon Harrop
Gigs_ wrote: > Is there any way to convert ocaml code to python? but not manually Translating between dissimilar high-level languages is very difficult, so difficult that it is hard to do such a task justice by hand, let alone automating the procedure. If you must do it then write a compiler that

Forking SocketServer daemon -- updating state

2007-02-19 Thread Reid Priedhorsky
Hi folks, I am implementing a forking SocketServer daemon that maintains significant internal state (a graph that takes ~30s to build by fetching from a SQL database, and eventually further state that may take up to an hour to build). I would like to be able to notify the daemon that it needs to

Re: Forking SocketServer daemon -- updating state

2007-02-19 Thread Irmen de Jong
Reid Priedhorsky wrote: > Another possibility is that the signal handler simply sets a needs_update > flag, which I could check for in a handle_request() loop. The disadvantage > here is that the update wouldn't happen until after the next request is > handled, and I would like the state to be ava

How to call a function defined in another py file

2007-02-19 Thread silverburgh . meryl
Hi, I have a function called 'test' defined in A.py. How can I call that function test in my another file B.py? Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to call a function defined in another py file

2007-02-19 Thread Martin Blume
<[EMAIL PROTECTED]> schrieb > > I have a function called 'test' defined in A.py. > How can I call that function test in my another file B.py? > In B.py: import A A.test() HTH Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting a class name

2007-02-19 Thread Fuzzyman
On Feb 19, 5:11 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 18 Feb 2007 20:56:48 -0300, Fuzzyman <[EMAIL PROTECTED]> escribió: > > > > > [somebody] wrote: > >> >>> > def getCodeName(deap=0): > >> >>> > return sys._getframe(deap+1).f_code.co_name > > >> >>> > class MyClass (obje

Re: How to call a function defined in another py file

2007-02-19 Thread silverburgh . meryl
On Feb 19, 2:22 pm, "Martin Blume" <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> schrieb > > > I have a function called 'test' defined in A.py. > > How can I call that function test in my another file B.py? > > In B.py: > > import A > > A.test() > > HTH > Martin But Do I need to put A.py and B.

Re: bluetooth on windows.......

2007-02-19 Thread M�ta-MCI
Hi! >> try to find a PyBluez version already built for your Python 2.5 On the site : http://org.csail.mit.edu/pybluez/release/PyBluez-0.9.1.win32-py2.5.exe -- http://mail.python.org/mailman/listinfo/python-list

Re: How to call a function defined in another py file

2007-02-19 Thread Jeremy Gransden
from a import test be sure a is in your path. jeremy On Feb 19, 2007, at 3:20 PM, [EMAIL PROTECTED] wrote: > Hi, > > I have a function called 'test' defined in A.py. > How can I call that function test in my another file B.py? > > Thank you. > > -- > http://mail.python.org/mailman/listinfo/p

Re: How to call a function defined in another py file

2007-02-19 Thread Jeremy Gransden
On Feb 19, 2007, at 3:27 PM, [EMAIL PROTECTED] wrote: > On Feb 19, 2:22 pm, "Martin Blume" <[EMAIL PROTECTED]> wrote: >> <[EMAIL PROTECTED]> schrieb >> >>> I have a function called 'test' defined in A.py. >>> How can I call that function test in my another file B.py? >> >> In B.py: >> >> import A

Re: How to call a function defined in another py file

2007-02-19 Thread Martin Blume
<[EMAIL PROTECTED]> schrieb >> >>> I have a function called 'test' defined in A.py. >>> How can I call that function test in my another file B.py? >> >> In B.py: >> import A >> A.test() >> > > But Do I need to put A.py and B.py in the same directory? No, but then you have to take certain preca

Re: How to call a function defined in another py file

2007-02-19 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hi, > > I have a function called 'test' defined in A.py. > How can I call that function test in my another file B.py? > > Thank you. > # b.py import A A.test() -- http://mail.python.org/mailman/listinfo/python-list

Re: Declare a variable global

2007-02-19 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hi, > > I have the following code: > > colorIndex = 0; You don't need the ; > > def test(): > print colorIndex; Idem. > This won't work. Why ? Or more exactly : for which definition of "won't work" ? (hint: this code prints 0 on sys.stdout - I don't know

Re: Help Required for Choosing Programming Language

2007-02-19 Thread Bruno Desthuilliers
Hendrik van Rooyen a écrit : > "Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote: > > > >>Stef Mientki a écrit : >>(snip) >> >>>I've been using Python for just 2 months, and didn't try any graphical >>>design, >> >>So how can you comment on GUI programming with Python ? > > > I think we have a

Re: Help Required for Choosing Programming Language

2007-02-19 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > On Feb 16, 4:22 pm, [EMAIL PROTECTED] wrote: > >>I am VB6 programmer and wants to start new programming language but i >>am unable to deciced. >> >>i have read about Python, Ruby and Visual C++. but i want to go >>through with GUI based programming language like VB.ne

Re: Declare a variable global

2007-02-19 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > On Feb 19, 11:09 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > >>On 19 Feb 2007 09:04:19 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >> >> >>>Hi, >> >>>I have the following code: >> >>>colorIndex = 0; >> >>>def test(): >>>print colorIndex; >> >>>T

Re: Declare a variable global

2007-02-19 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Feb 19, 11:09 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> On 19 Feb 2007 09:04:19 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >> >>> Hi, >>> I have the following code: >>> colorIndex = 0; >>> def test(): >>> print colorIndex; >>> This won't work

Re: How do I create an array of functions?

2007-02-19 Thread Steven D'Aprano
On Mon, 19 Feb 2007 05:17:03 -0800, Rob Wolfe wrote: >> > # test.py >> > >> > def fun1(): return "fun1" >> > def fun2(): return "fun2" >> > def fun3(): return "fun3" >> > >> > # list of functions >> > dsp = [f for fname, f in sorted(globals().items()) if callable(f)] >> >> Hmmm... when I try that,

FPE: Add bindings to exception tracebacks.

2007-02-19 Thread Nathan
Hi folks! Throughout my python development career, I've occasionally made various developer tools to show more information about assertions or exceptions with less hassle to the programmer. Until now, these tools didn't pass a utility vs pain-to-use threshold. Now I've created a tool I believe t

Re: PyDev on Mac

2007-02-19 Thread Mark
On Sun, 18 Feb 2007 10:50:37 +0100, Diez B. Roggisch wrote: > Just wait until my crystal ball comes back from the cleaners, and I > will start looking at your problem. > > As you can lay back and do nothing while that happens, I suggest you > take this highly entertaining read: Now that is an ente

Newbie help looping/reducing code

2007-02-19 Thread Lance Hoffmeyer
Hey all, Can someone help me reduce this code? It sure seems like there ought to be a way to loop this or combine things so that there is only 1 or 3 lines to this instead of 6. I've been scratching my head over this for a while though I can't come up with anything. Just as a note, I need even_

Re: Help Required for Choosing Programming Language

2007-02-19 Thread Stef Mientki
> > It's now the *3rd* time I mention Glade, wxGlade and QTDesigner in this > thread. Hendrik, I know *exactly* what Stef is talking about - been > here, done that. Doubt, that know what I'm talking about ... ... Glade, wxGlade, QTDesigner are not my choice ;-) ... at the moment I tend towards

Free Flash Games

2007-02-19 Thread Flash Games
Free Flash Games http://www.clipplay.com/ fun videos games and more. Fun flash games. Free flash games... -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie help looping/reducing code

2007-02-19 Thread Paul Rubin
Lance Hoffmeyer <[EMAIL PROTECTED]> writes: > T2B = even_odd_round(float(str(T2B))) > VS = even_odd_round(float(str(VS))) > SS = even_odd_round(float(str(SS))) > sh.Cells(21,lastcol+1).Value = float(str(T2B))/100 > sh.Cells(22,lastcol+1).Value = float(str(VS))/100 > sh.Cells(23,lastcol+1).Va

Checking for EOF in stream

2007-02-19 Thread GiBo
Hi! Classic situation - I have to process an input stream of unknown length until a I reach its end (EOF, End Of File). How do I check for EOF? The input stream can be anything from opened file through sys.stdin to a network socket. And it's binary and potentially huge (gigabytes), thus "for line

Re: cmd all commands method?

2007-02-19 Thread Gabriel Genellina
En Mon, 19 Feb 2007 00:08:45 -0300, placid <[EMAIL PROTECTED]> escribió: > If anyone can provide a suggestion to replicate the following Tcl > command in Python, i would greatly appreciate it. > > namespace eval foo { > variable bar 12345 > } > > what this does is create a namespace foo with t

Re: Pep 3105: the end of print?

2007-02-19 Thread Peter mayne
Steven D'Aprano wrote: > If Python 3 dropped the print > statement and replaced it with official_print_function(), how would that > help you in your goal to have a single code base that will run on both > Python 2.3 and Python 3, while still using print? Is there any reason why official_print_func

Re: Building Python Pagage for Newer Python Version

2007-02-19 Thread Gabriel Genellina
En Mon, 19 Feb 2007 11:00:18 -0300, Diez B. Roggisch <[EMAIL PROTECTED]> escribió: >> I have just downloaded the source for PyXML-0.8.4, which I would like >> to build for Python 2.5. How exactly do I go about doing this? > > python2.5 setup.py install usually does the trick. Beware of this mes

Re: writing a file:newbie question

2007-02-19 Thread Gabriel Genellina
En Mon, 19 Feb 2007 08:02:29 -0300, kavitha thankaian <[EMAIL PROTECTED]> escribió: > Hi, > i have a file test.txt and it contains a list of strings say,,, > "a","b","c","d","a1","b1","c1","d1","a2","b2","c2","d2", > i would like to write the file as > "a","b","c","d" > "a1","b1","c1","d1

Re: Checking for EOF in stream

2007-02-19 Thread Grant Edwards
On 2007-02-19, GiBo <[EMAIL PROTECTED]> wrote: > Hi! > > Classic situation - I have to process an input stream of unknown length > until a I reach its end (EOF, End Of File). How do I check for EOF? The > input stream can be anything from opened file through sys.stdin to a > network socket. And it'

Re: search cursor in pythonwin 2.1

2007-02-19 Thread Gabriel Genellina
En Mon, 19 Feb 2007 12:21:27 -0300, GISDude <[EMAIL PROTECTED]> escribió: > Thanks for the reply. After looking at the docs again, you are correct > "NAMES" IS NOT NULL would be the correct syntax. > > I thought it was "NAMES" <> NULL Python has some gotchas like default mutable arguments, that

Re: Newbie help looping/reducing code

2007-02-19 Thread Paul Rubin
Lance Hoffmeyer <[EMAIL PROTECTED]> writes: > def even_odd_round(num): > if(round(num,2) + .5 == int(round(num,2)) + 1): > if num > .5: >if(int(num) % 2): > num = round(num,2) + .1 #an odd number >else: >

Re: Getting a class name

2007-02-19 Thread Gabriel Genellina
En Mon, 19 Feb 2007 17:25:56 -0300, Fuzzyman <[EMAIL PROTECTED]> escribió: > On Feb 19, 5:11 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >> En Sun, 18 Feb 2007 20:56:48 -0300, Fuzzyman <[EMAIL PROTECTED]> >> escribió: >> > [somebody] wrote: >> >> >>> > def getCodeName(deap=0): >> >> >>> >

  1   2   >