Modifying the Python interpreter to create a custom secure version

2005-03-05 Thread Gouda Man
Hey everyone, I'm embedding the Python interpreter within my program to use as a scripting language. However, one of the unique features of our program is the ability of the internal language to possess per-object security permissions and restricted execution. Therefore, we need to add extra "

Re: win32 COM and data types / direction

2005-03-05 Thread Tim Roberts
Alexander Eisenhuth <[EMAIL PROTECTED]> wrote: > >Hello everybody, > >i wonder how the win32 COM extension handles different C-int types >(short, int, long). All of those types are passed on the stack as 32-bit dwords. No problem. >Another question for me is weather the >"out-direction" of par

Re: Setting default option values for Tkinter widgets

2005-03-05 Thread [EMAIL PROTECTED]
yep, that works better under Windows. Pretty obscure use of Python, though! :-) S -- http://mail.python.org/mailman/listinfo/python-list

Tough Spawn Problem

2005-03-05 Thread googlemike
I'm trying to use Python and PyGTK + Glade, along with Bash. I want to make a GUI for the Linux vpnclient command-line tool. (Look for linux-vpnclient.tar.gz on the Internet if you are curious.) Anyway, this vpnclient tool connects to VPN and then stays locked like that while the VPN connection is

Can a method in one class change an object in another class?

2005-03-05 Thread Stewart Midwinter
I've got an app that creates an object in its main class (it also creates a GUI). My problem is that I need to pass this object, a list, to a dialog that is implemented as a second class. I want to edit the contents of that list and then pass back the results to the first class. So my question i

yum install python2.4

2005-03-05 Thread richardun
My goal is to install python2.4 using yum (wouldn't you know it, it's a dependency for something else). >From this page (), I followed the following instructions: 1. ...creat "/etc/yum.repos.d/python24.repo" with the following lines: [python24] name=Fedora Core $releasever - $basearch - Python 2.

Modifying Call Tips and Intellisense Behavior

2005-03-05 Thread pytopo
I like the way call tips displays argument variables for functions when you type the "(" after the function name. However, if one of the arguments to the function is something like "SomeMod.attribute", the intellisense will display all the exposed methods and attributes when "SomeMod." is typed.

Re: os.join Windows action

2005-03-05 Thread John Machin
Michael Hoffman wrote: > Colin J. Williams wrote: > > > C:\XXX is required, C:XXX is not acceptable. > > C:XXX is acceptable, it just means something entirely different from > C:\XXX. There is a current working directory on each drive. C:XXX is > file XXX in the current directory on drive C:. Fur

How do I import everything in a subdir?

2005-03-05 Thread Dfenestr8
Hi. I have a program which I want a plugin directory for. I figured the way to go about that would be to just add a plugin/ dir to sys.path, and import everything in it. Then my program can just execute the main() method of each imported plugin. Is that a good way to go about it? If so, how do I

Re: site-packages versus site-python

2005-03-05 Thread msoulier
> Well, broadly, the reason is that it allows version-specific code to be > included in libraries. I've actually found this to be a bit of a pain. I build packages against say, python2.2, and if you upgrade python to 2.3 the package breaks. The code works fine so saying it requires python >= 2.2 s

using python to parse md5sum list

2005-03-05 Thread Ben Rf
Hi I'm new to programming and i'd like to write a program that will parse a list produced by md5summer and give me a report in a text file on which md5 sums appear more than once and where they are located. the end end goal is to have a way of finding duplicate files that are scattered across a l

Re: using python to parse md5sum list

2005-03-05 Thread James Stroud
Among many other things: First, you might want to look at os.path.walk() Second, look at the string data type. Third, get the Python essential reference. Also, Programming Python (O'Riely) actually has a lot in it about stuff like this. Its a tedious read, but in the end will help a lot for adm

[ANN] Alternative Readline for Windows -- Binary Installer for Python 2.4 released

2005-03-05 Thread Chris Gonnerman
This is to announce the release of a binary installer for my Alternative Readline for Windows. This module provides interactive command-line editing for Python on Windows. I realize the console functions of Windows 2000, XP, and 2003 work in the newest Python versions, but it appears that many p

multiple inheritance with builtins

2005-03-05 Thread Giovanni Bajo
Hello, I noticed that bultin types like list, set, dict, tuple don't seem to adhere to the convention of using super() in constructor to correctly allow diamond-shaped inheritance (through MRO). For instance: >>> class A(object): ... def __init__(self): ... print "A.__init__" ...

[ANN] WConio 1.5 Binary Installer for Python 2.4

2005-03-05 Thread Chris Gonnerman
At long last I've upgraded to Python 2.4 on my Windows development host, and as a direct result I have released a WConio 1.5 binary installer for Python 2.4. WConio is my Windows CONsole I/O for Python module. It emulates the conio.h functionality of Turbo C 2.0. This module is based heavily on

Re: Impersonating other broswers...

2005-03-05 Thread Eric Pederson
Skip Montanaro <[EMAIL PROTECTED]> wrote > It doesn't look any easier to do this using urllib2. Seems like a > semi-obvious oversight for both modules. That suggests few people have > ever > desired this capability. my $.02: I have trouble believing few people have not desired this for two r

Re: locale support and 4.10

2005-03-05 Thread "Martin v. Löwis"
Timothy Smith wrote: something strange is happening, no matter what i try nothing is a supported locale and yes it's freebsd 4.10 Sounds like a problem with your operating system. AFAICT, you ought to have a directory /usr/share/locale on your disk. What is its contents? Regards, Martin -- http://

Re: yield_all needed in Python

2005-03-05 Thread Isaac To
> "Paul" == Paul Moore <[EMAIL PROTECTED]> writes: Paul> You can work around the need for something like yield_all, Paul> or explicit loops, by defining an "iflatten" generator, Paul> which yields every element of its (iterable) argument, Paul> unless the element is a generator

Re: locale support and 4.10

2005-03-05 Thread Timothy Smith
Martin v. Löwis wrote: Timothy Smith wrote: >>> locale.setlocale(locale.LC_NUMERIC, 'us') the exact same thing works under windows xp. do i have to compile it with locale support? No. You have to choose a locale name that is supported by your operating system (which appears to be FreeBSD). Read y

Re: Python and VT100

2005-03-05 Thread TZOTZIOY
On Sat, 5 Mar 2005 22:10:38 +0100, rumours say that "Dominique Bouré" <[EMAIL PROTECTED]> might have written: >Using Python (Command line version, not IDLE, nor pythonwin) > >With Linux, print "\033[33mHello" prints a brown hello. Fine! >With Windows, the VT100 sequence seems to be unknown? > > >W

Re: Wrong with this script?

2005-03-05 Thread Daniel Fackrell
"R.Meijer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thank you very much for the help and the tips :-) This is my very first python > script, and I knew it would have some stupid mistakes; but it's doing something > weird right now...I did all the stuff you told, me, and now it'

Re: programmatically calling a function

2005-03-05 Thread Carl Banks
Carl Banks wrote: > Doug Schwarz wrote: > > I don't see how getattr solves the original problem. What, exactly, > is > > the first argument to getattr? > > > mod = __import__(__this__) That should be __import__(__name__) Silly me. -- CARL BANKS -- http://mail.python.org/mailman/listinfo/py

Re: Impersonating other broswers...

2005-03-05 Thread Skip Montanaro
sboyle> I'm using urlopen, and it works fine. But I'd like to be able sboyle> to change my browser string from "Python-urllib/1.15" to instead sboyle> impersonate Internet Explorer. sboyle> I know this can be done very easily with Perl, so I'm assuming sboyle> it's also easy

Re: how to execute Python in VIM

2005-03-05 Thread Diez B. Roggisch
DENG wrote: > ok > > i find it > > map :!d:\python24\python.exe % > > > but it comes with a new pop-up windowsdame~ I'm no windows expert - but maybe pythonw.exe helps here? -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Impersonating other broswers...

2005-03-05 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > So I wrote a quick python program (my first ever) that needs to > download pages off the web. > > I'm using urlopen, and it works fine. But I'd like to be able to > change my browser string from "Python-urllib/1.15" to instead > impersonate Internet Explorer. > > I kn

Re: how to execute Python in VIM

2005-03-05 Thread DENG
ok i find it map :!d:\python24\python.exe % but it comes with a new pop-up windowsdame~ -- http://mail.python.org/mailman/listinfo/python-list

Impersonating other broswers...

2005-03-05 Thread sboyle55
So I wrote a quick python program (my first ever) that needs to download pages off the web. I'm using urlopen, and it works fine. But I'd like to be able to change my browser string from "Python-urllib/1.15" to instead impersonate Internet Explorer. I know this can be done very easily with Perl,

[ICSEng'05] Final CFP - due date March 10, 2005

2005-03-05 Thread avinash
We apologize if this is a duplicate email. EIGHTEENTH INTERNATIONAL CONFERENCE ON SYSTEMS ENGINEERING (ICSEng05) LAS VEGAS, USA, AUGUST 16-18, 2005 (http://www.icseng.info) This series of International Conferences is jointly organized on a rotational basis among three institutions, University of

[ICCIMA'05] Final Call for Papers; Due Date March 10, 2005

2005-03-05 Thread avinash
We apologize if this is a duplicate email. International Conference on Computational Intelligence and Multimedia Applications, (ICCIMA) August 16-18, 2005 University of Nevada, Las Vegas, USA (www.iccima.org) F I N A LC A L L F O R P A P E R S The International Conference on Compu

Re: Equality operator

2005-03-05 Thread Anthony Boyd
italy wrote: > Why doesn't this statement execute in Python: > > 1 == not 0 > > I get a syntax error, but I don't know why. > > Thanks, > Adam Roan Of course, you would normally want to use != to see if something is not equal to something else. 1 != 0 True -- http://mail.python.org/mailman/lis

Re: Equality operator

2005-03-05 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, italy wrote: > Why doesn't this statement execute in Python: > > 1 == not 0 > > I get a syntax error, but I don't know why. `==` has a higher precedence than `not` so Python interprets it as:: (1 == not) 0 This works:: >>> 1 == (not 0) True Ciao, Marc

Re: python/linux guru needed.. now!!!!

2005-03-05 Thread grahamd
bruce wrote: > hi... > > i have a situation with a linux rh8 server. i can't seem to get > python/mod_python/apache working as one... > > i can't seem to import mod_python from the python interpreter to work, and > i'm not sure as to why. i'm fairly convinced that it's a conflict issue of > some t

Re: GOTO (was Re: Appeal for python developers)

2005-03-05 Thread Steven Bethard
Dennis Lee Bieber wrote: On 5 Mar 2005 08:00:23 -0800, [EMAIL PROTECTED] declaimed the following in comp.lang.python: "explicit GOTO"'. Goto's are less dangerous when they are in the forward direction, to code appearing later. UGH... That is the one direction I always avoid (in FORTRAN 77). Typica

python/linux guru needed.. now!!!!

2005-03-05 Thread bruce
hi... i have a situation with a linux rh8 server. i can't seem to get python/mod_python/apache working as one... i can't seem to import mod_python from the python interpreter to work, and i'm not sure as to why. i'm fairly convinced that it's a conflict issue of some type, but i'm not sure as to

GUI Guy auto-reply

2005-03-05 Thread GUI Guy
Thanks for e-mailing GUI Guy. Please note the following: If your e-mail was a request for technical support, it will be ignored. Please use the support forums available online here: http://guiguy.wminds.com/forums/ Due to large amounts of spam and recent increased virus activity, I am no lon

Re: Accessing Python parse trees

2005-03-05 Thread Manlio Perillo
On Sat, 05 Mar 2005 08:52:38 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote: >Manlio Perillo wrote: >> Anyway, here is an example of what I would like to do: >> >> #begin >> def foo(**kwargs): print kwargs >> >> foo(a = 1, b = 2, c = 3) >> #end >> >> >> In the current implementation kwargs is a

Re: how to execute Python in VIM

2005-03-05 Thread DENG
i change the path autocmd FileType python setlocal makeprg=\"d:\\Python24\\python.exe\"\ autocmd BufNewFile,BufRead test*.py setlocal makeprg=\"d:\\Python24\\python.exe\"\ % -- http://mail.python.org/mailman/listinfo/python-list

Re: site-packages versus site-python

2005-03-05 Thread Steve Holden
[EMAIL PROTECTED] wrote: I recently installed python 2.4, and many installed software packages stopped working. Some things got working after I copied some files and directories from /usr/lib/python2.3/site-packages to /usr/lib/python2.4/site-packages, but I also had to install a newer PyXml packag

calling a same class using threading python

2005-03-05 Thread Raghul
Hi friends, I am creating a jabber client and a separate class for dialog is created,So when the roster name is clicked this dialog open and can continue chat.What I need is I am calling the same class when reciving the message so that the application goes not responding.People told m

how to execute Python in VIM

2005-03-05 Thread DENG
hi, im a newbie to VIM(gVIM under WINXP), i want to execute python in vim like press F5 in SciTE. i try to search in google and config as follows in my _vimrc: --- map :D:\python24\python.exe % if has("autocmd") autocmd FileType python

Re: Wrong with this script?

2005-03-05 Thread Steven Bethard
R.Meijer wrote: Hi, I've been busy with an experimental script, and I can't seem to see what is wrong with it, can somebody tell me? For future notice, it's useful to (1) explain what it is you want your script to do, and (2) explain what it currently does (including an exception traceback if one

Python and VT100

2005-03-05 Thread Dominique Bouré
Using Python (Command line version, not IDLE, nor pythonwin) With Linux, print "\033[33mHello" prints a brown hello. Fine! With Windows, the VT100 sequence seems to be unknown? Why? and how can I correct that? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Equality operator

2005-03-05 Thread Chris Grebeldinger
"not" has a lower priority than non-Boolean operators, so not a == b is interpreted as not (a == b), and a == not b is a syntax error. http://docs.python.org/lib/boolean.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Equality operator

2005-03-05 Thread Marek Kubica
> Why doesn't this statement execute in Python: > > 1 == not 0 > > I get a syntax error, but I don't know why. This does: 1 == (not 0) I presume Python treats it like 1 (== not) 0 Which is a SyntaxError greets, Marek -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrong with this script?

2005-03-05 Thread R.Meijer
Daniel Fackrell gmail.com> writes: > > You need to close the () for input here. After doing that, if you run it > you will notice that you get an exception for most inputs, including "yes". > IIRC, input() is scheduled for removal in some future version of Python > because it doesn't do what yo

Re: Equality operator

2005-03-05 Thread Kent Johnson
italy wrote: Why doesn't this statement execute in Python: 1 == not 0 I get a syntax error, but I don't know why. Because == has higher precedence than 'not', so you are asking for (1 == not) 0 Try >>> 1 == (not 0) True Kent Thanks, Adam Roan -- http://mail.python.org/mailman/listinfo/python-list

Equality operator

2005-03-05 Thread italy
Why doesn't this statement execute in Python: 1 == not 0 I get a syntax error, but I don't know why. Thanks, Adam Roan -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrong with this script?

2005-03-05 Thread Daniel Fackrell
"R.Meijer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, I've been busy with an experimental script, and I can't seem to > see what is wrong with it, can somebody tell me? > > Here it is: > > a = 0 > b = 1 > mainloop = 1 > > print "Welcome to pyFibo" > print "For more informatio

Wrong with this script?

2005-03-05 Thread R.Meijer
Hi, I've been busy with an experimental script, and I can't seem to see what is wrong with it, can somebody tell me? Here it is: a = 0 b = 1 mainloop = 1 print "Welcome to pyFibo" print "For more information type \'help\'" while mainloop==1: limit = input("Until what number do you want to

Re: Win32 drive mapping... aka "net use"

2005-03-05 Thread Diez B. Roggisch
b = a.strip(r'\\\x00') b > 'A:\\\x00C:\\\x00D:\\\x00E:\\\x00Z:\\\x00' b = a.split(r'\\\x00') b > ['A:\\\x00C:\\\x00D:\\\x00E:\\\x00Z:\\\x00'] > > I'm a bit of a novice at python (even more so of the win32 api), but > I've used the split and strip functions before (for example t

Re: Win32 drive mapping... aka "net use"

2005-03-05 Thread Roger Upole
The split should work fine if you remove the r (raw string) prefix. >>> win32api.GetLogicalDriveStrings().split('\\\x00') ['A:', 'C:', 'D:', 'E:', 'F:', 'G:', 'H:', 'J:', 'K:', 'Y:', 'Z:', ''] Roger "Lucas Machado" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Roger Upol

Re: GOTO (was Re: Appeal for python developers)

2005-03-05 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: Goto is useful [...] when there is a clean-up section of a function that should be executed for various error conditions. Like this? def foo(): f = open('foo.txt') try: # do stuff with f finally: f.close() -- http://mail.python.org/mailman/listin

Re: Win32 drive mapping... aka "net use"

2005-03-05 Thread Lucas Machado
Roger Upole wrote: > You could use win32api.GetLogicalDriveStrings to list > the drive letters currently in use, and find the next free > letter. net use * probably does something like that under > the covers. I went and took your advice and this is where I am now: >>> import win32api >>> a = wi

Re: handling pywintypes.error exceptions

2005-03-05 Thread Roger Upole
You can capture the extra exception data like this. try: ...win32net.NetUseAdd(None, 1, {'remote':r'\\foo\bar','local':'X except pywintypes.error,details: ...err_code=details[0] ... Roger "Lucas Machado" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm using the win32 ap

Re: GOTO (was Re: Appeal for python developers)

2005-03-05 Thread Paul McGuire
At the risk of beating this into the Pythonic ground, here is a generator version which collapses the original nested loop into a single loop, so that break works just fine: .def getCombinations(*args): .if len(args) > 1: .for a0 in args[0]: .for remainder in ge

Re: Win32 drive mapping... aka "net use"

2005-03-05 Thread Roger Upole
You could use win32api.GetLogicalDriveStrings to list the drive letters currently in use, and find the next free letter. net use * probably does something like that under the covers. hth Roger "Lucas Machado" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Alex Ma

Re: programmatically calling a function

2005-03-05 Thread Carl Banks
Doug Schwarz wrote: > I don't see how getattr solves the original problem. What, exactly, is > the first argument to getattr? mod = __import__(__this__) f = getattr(mod,"foo") I tend to prefer this over globals() because it seems a little less magical to me, especially when setting a global.

handling pywintypes.error exceptions

2005-03-05 Thread Lucas Machado
I'm using the win32 api to map samba shares, and I'm having trouble handling some exceptions. In my script there are 2 possible exceptions when the script attempts to map a share: >>> win32net.NetUseAdd(None, 1, {'remote':r'\\foo\bar','local':'X Traceback (most recent call last): File "", line

Re: enum question

2005-03-05 Thread Carl Banks
M.N.A.Smadi wrote: > does python support a C-like enum statement where one can define a > variable with prespesified range of values? The thing is, variables don't have types; objects do. A variable can be bound to an object of any type, so there's no way to prespecify a range of values for a va

Re: Newbie getting confused again

2005-03-05 Thread It's me
Thanks, got it. "M.E.Farmer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > It's me wrote: > > If I have: > > > > a = (1,2,3) > > > > how do I ended up with: > > > > res=[(1), (2), (3), (4), (5)] > > > > without doing: > > > > res=[(a[0]), (a[1]), (a[2]), (4), (5)] > >

Re: Accessing Python parse trees

2005-03-05 Thread Steve Holden
Manlio Perillo wrote: On 3 Mar 2005 11:15:28 -0800, "Lonnie Princehouse" <[EMAIL PROTECTED]> wrote: No. I don't think it's possible to read the parse tree used by the interpreter, especially as it is being created. Here are a couple of kludgy ideas that might come close, though: Is this a 'limit

Re: Win32 drive mapping... aka "net use"

2005-03-05 Thread Lucas Machado
I have already seen the "net help use" and i know how to manage samba shares from a command prompt. What i need help with is using the win32 api for python to manage shares --Lucas -- http://mail.python.org/mailman/listinfo/python-list

Re: GOTO (was Re: Appeal for python developers)

2005-03-05 Thread Andrew Dalke
beliavsky wrote: > Goto is useful in breaking out of a nested loop and when there is a > clean-up section of a function that should be executed for various > error conditions. But much less useful in languages like Python which have exception handling. At rare times I've needed something like fo

Re: programmatically calling a function

2005-03-05 Thread Reinhold Birkenfeld
Doug Schwarz wrote: >> > Dave, >> > >> > I think eval might be what you're looking for: >> > >> > f = eval('len') >> > length = f([1,2,3]) >> >> But only if the string given to eval is checked thorougly for allowed >> contents. Better use getattr. > > Actually, upon reading Peter Hansen's repl

Re: Win32 drive mapping... aka "net use"

2005-03-05 Thread [EMAIL PROTECTED]
Lucas Machado wrote: > Alex Martelli wrote: > > > import win32net > > win32net.NetUseAdd(None,1,{'remote':r'\\server\share','local':'K:'}) > > > > is an example (not all that easy to fathom from the docs, but I > > found it out with a little help from the docs, a little from MSDN, > > and a little

Re: Win32 drive mapping... aka "net use"

2005-03-05 Thread Lucas Machado
Alex Martelli wrote: > import win32net > win32net.NetUseAdd(None,1,{'remote':r'\\server\share','local':'K:'}) > > is an example (not all that easy to fathom from the docs, but I > found it out with a little help from the docs, a little from MSDN, > and a little experimentation). I looked through

python/mod_python conflicts...

2005-03-05 Thread bruce
hi... i have a linux redhat8 server. i'm trying to get python andmod_python to play nicely, meaning that i have the right mod_python for the python that i've installed. it appears that the box has multiple versions of python. when i'm 'root' the python version is 2.2.1 when i'm a user 'test', th

Re: Appeal for python developers (THIS IS A TROLL)

2005-03-05 Thread Michael Hoffman
Dave Reed wrote: Or more likely a troll. Google for: Boogieman yahoo troll and you'll see this isn't the only place he/she does this sort of thing. I'm not convinced. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: os.join Windows action

2005-03-05 Thread Michael Hoffman
Colin J. Williams wrote: C:\XXX is required, C:XXX is not acceptable. C:XXX is acceptable, it just means something entirely different from C:\XXX. There is a current working directory on each drive. C:XXX is file XXX in the current directory on drive C:. How should os.path.join('C:', 'ugh') be tre

Re: programmatically calling a function

2005-03-05 Thread Doug Schwarz
In article <[EMAIL PROTECTED]>, Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote: > Doug Schwarz wrote: > > > Dave, > > > > I think eval might be what you're looking for: > > > > f = eval('len') > > length = f([1,2,3]) > > But only if the string given to eval is checked thorougly for allowed > c

Re: survey

2005-03-05 Thread beliavsky
Dave Zhu wrote: > Hello All, > > Is there any survey on scripting languages? I would > like to get information on several scripting languages > including Python, Perl, Ruby, Tcl, etc. The Language Shootout at http://shootout.alioth.debian.org/ has code samples in many languages, both interpreted a

Re: Appeal for python developers

2005-03-05 Thread Grant Edwards
On 2005-03-05, BOOGIEMAN <[EMAIL PROTECTED]> wrote: > Please include "goto" command in future python realeses > I know that proffesional programers doesn't like to use it, > but for me as newbie it's too hard to get used replacing it > with "while", "def" or other commands Troll. -- Grant Edwa

Re: Newbie getting confused again

2005-03-05 Thread M.E.Farmer
It's me wrote: > If I have: > > a = (1,2,3) > > how do I ended up with: > > res=[(1), (2), (3), (4), (5)] > > without doing: > > res=[(a[0]), (a[1]), (a[2]), (4), (5)] > > ??? > > ps: This is just a nobrainer example of what my real code is trying to do. > "a" might have many many eleme

os.join Windows action

2005-03-05 Thread Colin J. Williams
I am puzzled by the Windows XP usage below: C:\Python23\Lib\site-packages\PyMatrix>c:python23\python The system cannot find the path specified. C:\Python23\Lib\site-packages\PyMatrix>c:python23\python.exe The system cannot find the path specified. C:\Python23\Lib\site-packages\PyMatr

GOTO (was Re: Appeal for python developers)

2005-03-05 Thread beliavsky
Torsten Bronger wrote: > Hallöchen! > > BOOGIEMAN <[EMAIL PROTECTED]> writes: > > > Please include "goto" command in future python realeses I know > > that proffesional programers doesn't like to use it, but for me as > > newbie it's too hard to get used replacing it with "while", "def" > > or othe

Re: Appeal for python developers

2005-03-05 Thread Andrew Dalke
Torsten Bronger wrote: > Accordings to Stroustrup's C++ book, the only good reason for goto > statements in a language is to have it in computer-generated code. I've needed goto statements when translating old code written with gotos. > Most gotos are disguised function calls, so > just copy the

Re: Appeal for python developers (THIS IS A TROLL)

2005-03-05 Thread Torsten Bronger
HallÃchen! Dave Reed <[EMAIL PROTECTED]> writes: > On Saturday 05 March 2005 09:34, Thomas RÃsner aka TRauMa wrote: > >> [...] >> >> Technically, as a newbie you shouldn't know about GOTO at all. So >> you're more a "Tainted by previous spaghetti code practices"-guy >> than newbie. > > Or more l

Re: Relative imports

2005-03-05 Thread Kent Johnson
Chris wrote: After reading that link I tried to change my imports like this: " from .myPythonFileInTheSameFolder import MyClass" This style of import is not yet implemented. I'm getting more and more confused... How can I correctly do a relative import ? I think your choices are - keep doing what y

site-packages versus site-python

2005-03-05 Thread enrio
I recently installed python 2.4, and many installed software packages stopped working. Some things got working after I copied some files and directories from /usr/lib/python2.3/site-packages to /usr/lib/python2.4/site-packages, but I also had to install a newer PyXml package, as some of the files t

Re: enum question

2005-03-05 Thread Patrick Useldinger
M.N.A.Smadi wrote: does python support a C-like enum statement where one can define a variable with prespesified range of values? thanks m.smadi >>> BLUE, RED, GREEN = 1,5,8 >>> BLUE 1 >>> RED 5 >>> GREEN 8 -- http://mail.python.org/mailman/listinfo/python-list

Re: Relative imports

2005-03-05 Thread Chris
After reading that link I tried to change my imports like this: " from .myPythonFileInTheSameFolder import MyClass" Well, this caused an error in PyLint: Encountered "." at line 1, column 6. Was expecting one of: "or" ... "and" ... "not" ... "is" ... "in" ... "lambda" ...

Re: Calling python scripts from php

2005-03-05 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Michael Livingston <[EMAIL PROTECTED]> wrote: >Hi all, > >I'm currently working on a project to develop an online simulation model of >the juvenile justice system in Queensland. We've developed the simulation >model using the python module simPy and currently we're

Re: Appeal for python developers (THIS IS A TROLL)

2005-03-05 Thread Dave Reed
On Saturday 05 March 2005 09:34, Thomas Rösner aka TRauMa wrote: > BOOGIEMAN wrote: > > Please include "goto" command in future python realeses > > I know that proffesional programers doesn't like to use it, > > but for me as newbie it's too hard to get used replacing it > > with "while", "def" o

Re: Appeal for python developers

2005-03-05 Thread Torsten Bronger
HallÃchen! BOOGIEMAN <[EMAIL PROTECTED]> writes: > Please include "goto" command in future python realeses I know > that proffesional programers doesn't like to use it, but for me as > newbie it's too hard to get used replacing it with "while", "def" > or other commands Accordings to Stroustrup'

Re: programmatically calling a function

2005-03-05 Thread Reinhold Birkenfeld
Doug Schwarz wrote: > Dave, > > I think eval might be what you're looking for: > > f = eval('len') > length = f([1,2,3]) But only if the string given to eval is checked thorougly for allowed contents. Better use getattr. Reinhold -- http://mail.python.org/mailman/listinfo/python-list

Re: Appeal for python developers

2005-03-05 Thread Thomas Rösner aka TRauMa
BOOGIEMAN wrote: Please include "goto" command in future python realeses I know that proffesional programers doesn't like to use it, but for me as newbie it's too hard to get used replacing it with "while", "def" or other commands Technically, as a newbie you shouldn't know about GOTO at all. So

Re: Appeal for python developers

2005-03-05 Thread Michael Hoffman
BOOGIEMAN wrote: Please include "goto" command in future python realeses As has been said before, you can only use goto in Python if you are using Python with line numbers: http://groups-beta.google.com/group/comp.lang.python/msg/98264a0daa007c46 > I know that proffesional programers doesn't like t

Re: programmatically calling a function

2005-03-05 Thread Doug Schwarz
In article <[EMAIL PROTECTED]>, Dave Ekhaus <[EMAIL PROTECTED]> wrote: > hi > > i'd like to call a python function programmatically - when all i have > is the functions name as a string. i.e. > > > fnames = ['foo', 'bar'] > > for func in fnames: > > # > # how do i c

Appeal for python developers

2005-03-05 Thread BOOGIEMAN
Please include "goto" command in future python realeses I know that proffesional programers doesn't like to use it, but for me as newbie it's too hard to get used replacing it with "while", "def" or other commands -- http://mail.python.org/mailman/listinfo/python-list

Re: survey

2005-03-05 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Peter Hansen <[EMAIL PROTECTED]> wrote: >Dave Zhu wrote: >> Hello All, >> >> Is there any survey on scripting languages? I would >> like to get information on several scripting languages >> including Python, Perl, Ruby, Tcl, etc. > >What kind of information? ... P

Re: programmatically calling a function

2005-03-05 Thread Simon Percivall
You might also want to take a peek at the getattr() function: http://docs.python.org/lib/built-in-funcs.html#l2h-31 -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing Python parse trees

2005-03-05 Thread Kent Johnson
Manlio Perillo wrote: Anyway, here is an example of what I would like to do: #begin def foo(**kwargs): print kwargs foo(a = 1, b = 2, c = 3) #end In the current implementation kwargs is a dict, but I need to have the keyword argument sorted. Unfortunately subclassing fron dict and installing the cl

Re: intigrate the PyGame module with my Python

2005-03-05 Thread Lucas Raab
[EMAIL PROTECTED] wrote: I want to intigrate the PyGame module with my Python exe, means i DONT want to generate .PYD files separtely rather than that want to put PyGame "c" src with Python workspace of VC project workspace. I am unable to import the sub modules( display, rect etc) of pygame, its r

Re: Relative imports

2005-03-05 Thread Kent Johnson
Michael Hoffman wrote: Chris wrote: Why do relative imports cause warnings in PyLint? http://www.python.org/peps/pep-0328.html#rationale-for-absolute-imports I notice that this section says that from __future__ import absolute_import will be a feature of Python 2.4. Apparently it didn't make the

Re: Python 2.4 removes None data type?

2005-03-05 Thread John J. Lee
Steve Holden <[EMAIL PROTECTED]> writes: > Warren Postma wrote: [...] > > gloat. Are there any really evil glitches LEFT in Python? Now go > > look at Perl and come back and say > > "Thank-deity-of-my-choice-I'm-using-Python". > > > Remaining warts that won't disappear: > > print >> file, stuff

Re: "Static" python program

2005-03-05 Thread Stephen Thorne
On Fri, 04 Mar 2005 12:10:00 +0100, Daniel Frickemeier <[EMAIL PROTECTED]> wrote: > I´m developing a small python-program wiht the mysql-python-module. > The program should run on a server without any mysql-installation. > Is there any posibility to "kompile" a python with static libaries? Sure, h

Re: Accessing Python parse trees

2005-03-05 Thread Manlio Perillo
On 3 Mar 2005 11:15:28 -0800, "Lonnie Princehouse" <[EMAIL PROTECTED]> wrote: >No. I don't think it's possible to read the parse tree used by the >interpreter, especially as it is being created. Here are a couple of >kludgy ideas that might come close, though: Is this a 'limitation' of the curre

Re: Integer From A Float List?!?

2005-03-05 Thread Kent Johnson
[EMAIL PROTECTED] wrote: Hello NG, sorry to bother you again with this question... I never used the "timeit" function, and I would like to ask you if the call I am doing is correct: C:\Python23\Lib>python timeit.py -n 1000 -s "from Numeric import ones" -s "floa ts=ones((1000,1),'f')" -s "ints

GUI Guy auto-reply

2005-03-05 Thread GUI Guy
Thanks for e-mailing GUI Guy. Please note the following: If your e-mail was a request for technical support, it will be ignored. Please use the support forums available online here: http://guiguy.wminds.com/forums/ Due to large amounts of spam and recent increased virus activity, I am no lon

Integer From A Float List?!?

2005-03-05 Thread andrea_gavana
Hello NG, sorry to bother you again with this question... I never used the "timeit" function, and I would like to ask you if the call I am doing is correct: C:\Python23\Lib>python timeit.py -n 1000 -s "from Numeric import ones" -s "floa ts=ones((1000,1),'f')" -s "ints = floats.astype(int)" 1

  1   2   >