Need help in writing up a Python Syntax checker

2008-07-14 Thread Kinokunya
Hi guys, My group and I will be working on our final year project, the scope to do a program/web-based application similar areas of functionalities like the PyLint and PyChecker; a Python syntax checker. We have no Python background, equipped only with some knowledge of Java and Dot net. We did

Re: Newbie Threading Question

2008-07-14 Thread Lev Elbert
On Jul 13, 8:33 am, Sparky [EMAIL PROTECTED] wrote: It seems strange, but I can't find a list of operating systems which support / don't support threading in Python. Can anyone point me in the right direction? Thanks, Sam Here is the list (from Python documentation of thread module):

Re: spam

2008-07-14 Thread David Brown
rickman wrote: spam *Why* are you replying to spam messages like this? The spam in c.a.e. usually costs me about 10-15 seconds a day pressing K for kill thread on my newsreader - but your bizarre new habit has cost me far more in trying to think out a rational explanation for your posts.

Re: Why is there no GUI-tools like this for Windows?

2008-07-14 Thread Martin Walsh
maestro wrote: I can just do the layout with my mouse and then there is a program that writes the code for me. GUI-programming is hard for no reason. One good program then forever easy... Is there not something like this for Python/Windows? Is the Linux one only for ruby or for any

Re: Beginner Question : Iterators and zip

2008-07-14 Thread cokofreedom
zip(*vec_list) will zip together all entries in vec_list Do be aware that zip stops on the shortest iterable. So if vec[1] is shorter than vec[0] and matches otherwise, your output line will be truncated. Or if vec[1] is longer and vec[0] matches as far as it goes, there will be no signal

Re: About wmi

2008-07-14 Thread patrol
On 7月14日, 下午12时29分, Larry Bates [EMAIL PROTECTED] wrote: patrol wrote: On 7月13日, 下午10时26分, Larry Bates [EMAIL PROTECTED] wrote: patrol wrote: I want to prevent some process from running. The code is in the following. I encounter some unexpected troubles. Probelm1: This program cannot

Re: iterator clone

2008-07-14 Thread Yosifov Pavel
`tee()` doesn't copy the iterator or its internal state but just caches it's results, so you can iterate over them again. That makes only sense if you expect to use the two iterators in a way they don't get much out of sync. If your usage pattern is consume iterator 1 fully, and then

Simple Image Cropper

2008-07-14 Thread Mr SZ
Hi, I am designing a simple image cropper which simply takes an image and use PIL to do the cropping.Now in order to do the cropping I simply draw a rectangle on the image by dragging the mouse over the image.I then use button press and button release events to find the mouse postition and

Re: Dictionary bidirectional

2008-07-14 Thread Kless
But in my dictionary both keys and values are unique. On Jul 14, 7:34 am, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Sun, 13 Jul 2008 16:21:11 -0700 (PDT), Kless [EMAIL PROTECTED] declaimed the following in comp.lang.python: I need a dictionary where get the result from a 'key' (on left),

Re: while var, but var ==16 != true

2008-07-14 Thread John Machin
On Jul 14, 3:32 pm, Tim Roberts [EMAIL PROTECTED] wrote: maestro [EMAIL PROTECTED] wrote: why does this work?  while p = while p != 0 ? 1 is True and 0 is false in python but other numbers have no boolean value so why doesnt it abort. Because your statement is incorrect.  Everything has a

subprocess module

2008-07-14 Thread John Mechaniks
from subprocess import call call(['ls', '-l']) How do I get the result (not the exit status of the command) of ls - l into a variable? -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionary bidirectional

2008-07-14 Thread Ken Starks
Dennis Lee Bieber wrote: On Sun, 13 Jul 2008 16:21:11 -0700 (PDT), Kless [EMAIL PROTECTED] declaimed the following in comp.lang.python: I need a dictionary where get the result from a 'key' (on left), but also from a 'value' (on right), how to get it? I know that dictionaries aren't

Re: Does omniORBpy 3.2 supports DII?

2008-07-14 Thread Duncan Grisby
In article [EMAIL PROTECTED], Ilan [EMAIL PROTECTED] wrote: My apologies if this is not the correct forum for thses quiestions, by I'm rather new to python+CORBA Has anyone used omniORBpy as CORBA implementation? are there any drawbacks? As omniORBpy's author, I'm biased, so I'll let other

Re: subprocess module

2008-07-14 Thread sukkopera
On 14 Lug, 10:34, Peter Otten [EMAIL PROTECTED] wrote: John Mechaniks wrote: from subprocess import call call(['ls', '-l']) How do I get the result (not the exit status of the command) of ls - l into a variable? output = subprocess.Popen([ls, -l], stdout=subprocess.PIPE).stdout.read()

Re: Moving to functional programming

2008-07-14 Thread James Fassett
On Jul 12, 12:18 am, George Sakkis [EMAIL PROTECTED] wrote: It relies on positional arguments, tuple unpacking and the signature of zip(), It moreso relies on the fact that: t1 = (0,1,2,3) t2 = (7,6,5,4) [t1, t2] == zip(*zip(t1, t2)) True This is mathematically true given the definition of

Re: subprocess module

2008-07-14 Thread John Mechaniks
On Jul 14, 12:34 pm, Peter Otten [EMAIL PROTECTED] wrote: John Mechaniks wrote: from subprocess import call call(['ls', '-l']) How do I get the result (not the exit status of the command) of ls - l into a variable? output = subprocess.Popen([ls, -l],

Re: Simple Image Cropper

2008-07-14 Thread Victor Noagbodji
Hi, I am designing a simple image cropper which simply takes an image and use PIL to do the cropping.Now in order to do the cropping I simply draw a rectangle on the image by dragging the mouse over the image.I then use button press and button release events to find the mouse postition and

RPC Client acts like a server

2008-07-14 Thread Utku Altinkaya
Hello, I need a client that connects to the server and answers remote calls. Is there a way to dot that using sandart xmlrpclib ? Currently I am using Remote Python Call library, but looking for alternative solutions as well. regards -- http://mail.python.org/mailman/listinfo/python-list

Do we have perl's Data::Dumper equivalent in Python??

2008-07-14 Thread srinivasan srinivas
Thanks, Srini Bollywood, fun, friendship, sports and more. You name it, we have it on http://in.promos.yahoo.com/groups/bestofyahoo/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help in writing up a Python Syntax checker

2008-07-14 Thread Kay Schluehr
On 14 Jul., 08:22, Kinokunya [EMAIL PROTECTED] wrote: Hi guys, My group and I will be working on our final year project, the scope to do a program/web-based application similar areas of functionalities like the PyLint and PyChecker; a Python syntax checker. We have no Python background,

Re: importing from .pyd

2008-07-14 Thread Kay Schluehr
On 14 Jul., 06:03, moijes12 [EMAIL PROTECTED] wrote: hi there is a .pyd file present in the same folder as the script abc.py by the name foo.pyd .I don't have foo.py .In the script abc.py I try import foo Error i get is ImportError: DLL load failed: The specified module could not be

Re: About wmi

2008-07-14 Thread Tim Golden
Larry Bates wrote: patrol wrote: I want to prevent some process from running. The code is in the following. I encounter some unexpected troubles. Probelm1: This program cannot terminate scrcons.exe and FNPLicensingService.exe,which are system processes. Problem2:After a while, this program

a module.pth question

2008-07-14 Thread oyster
My py24 is installed in h:\python24 I installed pyglet(http://pyglet.org/) in H:\pure_pylib\Multimedia\pyglet-1.0\, if I do [code] import sys sys.path.append(r'H:\pure_pylib\Multimedia\pyglet-1.0') import pyglet [/code] it is ok. but if I created h:\pure_pylib\pyglet.pth file, which containts

Re: Dictionary bidirectional

2008-07-14 Thread bearophileHUGS
Larry Bates: The only case where it would be faster would be if most of the keys were NOT in the dictionary (rather odd use case). Otherwise I believe you will find the first way quicker as the exceptions are infrequent. I have written a small benchmark: from random import shuffle def

Re: Dictionary bidirectional

2008-07-14 Thread Kless
Akathorn Greyhat sent me by email the next solution, which althought isn't generic it works well: - You could make your own class for that, maybe something like # class MyCoolDictionary(dict): def __init__(self, *args, **kargs): dict.__init__(self, *args,

Re: Dictionary bidirectional

2008-07-14 Thread Impotent Verse
If keys and values are unique you could do this... -- # Left : Right roman = { One : I, Two : II, Three : III, Four: IV, Five: V, Six : VI, Seven : VII, Eight : VIII,

Python beginner, unicode encode/decode Q

2008-07-14 Thread anonymous
1 Objective to write little programs to help me learn German. See code after numbered comments. //Thanks in advance for any direction or suggestions. tk 2 Want keyboard answer input, for example: answer_str = raw_input(' Enter answer ') Herr Üü [ I keyboard in the following characters

BootCampArama Final Reminder

2008-07-14 Thread Chris Calloway
Final reminder, we're in the last two weeks of open registration for PyCamp, Plone Boot Camp, and Advanced Plone Boot Camp: http://trizpug.org/boot-camp/2008/ Registration is now open for: PyCamp: Python Boot Camp, August 4 - 8 Plone Boot Camp: Customizing Plone, July 28 - August 1

Re: a module.pth question

2008-07-14 Thread Mike Driscoll
On Jul 14, 6:26 am, oyster [EMAIL PROTECTED] wrote: My py24 is installed in h:\python24 I installed pyglet(http://pyglet.org/) in H:\pure_pylib\Multimedia\pyglet-1.0\, if I do [code] import sys sys.path.append(r'H:\pure_pylib\Multimedia\pyglet-1.0') import pyglet [/code] it is ok. but

Re: How to package a logging.config file?

2008-07-14 Thread Vinay Sajip
On Jul 14, 1:21 am, Matthew Wilson [EMAIL PROTECTED] wrote: I'm working on a package that uses the standard libraryloggingmodule along with a .cfg file. In my code, I uselogging.config.fileConfig('/home/matt/mypackage/matt.cfg') to load in theloggingconfig file. However, it seems really

Turbogear installing error.

2008-07-14 Thread CL (Ciu Loeng) Lam
HI,there: I get the errors below when installing the Turebogear,could anyone help me ? Thanks in advance. error: Not a recognized archive type: c:\docume~1\admini~1\locals~1\ temp\easy_in stall-y2znne\PasteScript-1.6.3.tar.gz -- http://mail.python.org/mailman/listinfo/python-list

trying to use sax for a very basic first xml parser

2008-07-14 Thread manu
Hi, I need to parse xml files for the Blender Game Engine. ATM I am trying to get this script running in the BGE. This is my first script and I dont have much experience programming... import xml.sax class PnmlHandler(xml.sax.ContentHandler): def __init__(self): self.inPlace=0

Re: logging via SocketHandler and TCPserver

2008-07-14 Thread Vinay Sajip
On Jul 13, 9:25 pm, Larry Bates [EMAIL PROTECTED] wrote: Every time I look at theloggingmodule (up until now) I've given up and continue to use my home-grown logger that I've been using for years. I'm not giving up this time ;-) I find that I REALLY need to be able to monitor LOTS of

Re: Dictionary bidirectional

2008-07-14 Thread Akathorn Greyhat
This is a better version of the class that I sen't you, now it raises a KeyError when you try to insert a value that is already in class MyCoolDictionary(dict): def __init__(self, *args, **kargs): dict.__init__(self, *args, **kargs) def

Re: Dictionary bidirectional

2008-07-14 Thread Gerry
If keys and values are unique, maybe just store both in the same dictionary: mydict[a] = b mydict[b] = a ... Gerry On Jul 14, 8:31 am, Impotent Verse [EMAIL PROTECTED] wrote: If keys and values are unique you could do this... -- #         Left      : Right roman =

Re: Beginner Question : Iterators and zip

2008-07-14 Thread moogyd
On 13 Jul, 19:49, Terry Reedy [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: What is this *lis operation called? I am having trouble finding any reference to it in the python docs or the book learning python. One might call this argument unpacking, but Language Manual / Expressions /

new python podcast

2008-07-14 Thread [EMAIL PROTECTED]
http://www.podango.com/tag/python I just started to play with this and I wanted to know if there is any interest in this sort of thing now that the last (maybe I should say most proliffic) python podcaster has stopped being active.. I would also be intrested in knowing if there is a particular

screencapture with PIL question

2008-07-14 Thread greg
I am able to use the PIL module to capture a screen or specific window. My problem is when capturing a window (on windows XP) I can only capture the visible portion of the window. Is there any way to capture the entire window? specifically the scrolled portion of a window that is not visible on

Is it possible to create network conneciton on windows system?

2008-07-14 Thread Evan
Hello, one of my PC is window system, and in control panel - Network Connections, I can see some network connections such as PPPOE or VPN which I created by click create a new connection. My question is, is it possible to create a new connection by using Python script? which means I do not want

Re: screencapture with PIL question

2008-07-14 Thread Matimus
On Jul 14, 8:11 am, greg [EMAIL PROTECTED] wrote: Is there any way to capture the entire window?  specifically the scrolled portion of a window that is _not_visible_on_the_screen_. I don't think there is. That is why it is called a _screen_ capture. Matt --

Re: Do we have perl's Data::Dumper equivalent in Python??

2008-07-14 Thread oj
On Jul 14, 11:41 am, srinivasan srinivas [EMAIL PROTECTED] wrote: Thanks, Srini       Bollywood, fun, friendship, sports and more. You name it, we have it onhttp://in.promos.yahoo.com/groups/bestofyahoo/ You might have more luck asking for help if you explained what Perl's Data::Dumper

Re: Python beginner, unicode encode/decode Q

2008-07-14 Thread MRAB
On Jul 14, 1:51 pm, anonymous [EMAIL PROTECTED] wrote: 1 Objective to write little programs to help me learn German.  See code after numbered comments. //Thanks in advance for any direction or suggestions. tk 2  Want keyboard answer input, for example:   answer_str  = raw_input(' Enter

Re: subprocess module

2008-07-14 Thread Peter Otten
John Mechaniks wrote: On Jul 14, 12:34 pm, Peter Otten [EMAIL PROTECTED] wrote: John Mechaniks wrote: from subprocess import call call(['ls', '-l']) How do I get the result (not the exit status of the command) of ls - l into a variable? output = subprocess.Popen([ls, -l],

About the slot declaration decorator in PyQt4

2008-07-14 Thread Bighead
I remember when I did UI Design in PyQt4 for the first time, I found a manual. In it, no connect was used. Instead, an OO approach is applied, new UI classes inherit from old ones, and all the slot functions are automatically connected to some signals, using a decorator. In the __init__ function

Using McMillan Installer, PyInstall or py2exe cross-platform?

2008-07-14 Thread Hartmut Goebel
Hi, has anybody used McMillan Installer, PyInstall or py2exe cross-platform? I have a Windows partition with Python installed there, so this would only required working on a different directory and for a different OS. Since I'm working on Linux, it's awful to boot Windows each time I want to

Re: Determining when a file has finished copying

2008-07-14 Thread Ethan Furman
Sean DiZazzo wrote: On Jul 9, 5:34 pm, keith [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ethan Furman wrote: writeson wrote: Guys, Thanks for your replies, they are helpful. I should have included in my initial question that I don't have as much control

Re: Using McMillan Installer, PyInstall or py2exe cross-platform?

2008-07-14 Thread Grant Edwards
On 2008-07-14, Hartmut Goebel [EMAIL PROTECTED] wrote: has anybody used McMillan Installer, PyInstall or py2exe cross-platform? I know that py2exe doesn't work cross-platform. I'd be very surprised if the the others do. I have a Windows partition with Python installed there, so this would

Re: Determining when a file has finished copying

2008-07-14 Thread Michiel Overtoom
Ethan wrote: One more option may be to attempt to rename the file -- if it's still open for copying, that will fail; success indicates the copy is done. Caveat -- this is dependent on the operating system! Windows will indeed not allow you to rename or delete a file that's still open for

Re: Moving to functional programming

2008-07-14 Thread [EMAIL PROTECTED]
On 14 juil, 11:51, James Fassett [EMAIL PROTECTED] wrote: On Jul 12, 12:18 am, George Sakkis [EMAIL PROTECTED] wrote: It relies on positional arguments, tuple unpacking and the signature of zip(), It moreso relies on the fact that: t1 = (0,1,2,3) t2 = (7,6,5,4) [t1, t2] ==

RE: How to package a logging.config file?

2008-07-14 Thread Younger Wang
I had the similar question and my solution is: default_config = os.path.join(os.getcwd(), log.config) def get_logger(name, config_file=None): if config_file: logging.config.fileConfig(config_file) else: logging.basicConfig(level=logging.INFO,

Re: iterator clone

2008-07-14 Thread [EMAIL PROTECTED]
On 13 juil, 12:05, Yosifov Pavel [EMAIL PROTECTED] wrote: (snip) def cloneiter( it ): return (clonable,clone) return tee(it) This might as well be written as cloneiter = tee Or yet better, just remove the above code and s/cloneiter/tee/g in the remaining... --

Unicode confusion

2008-07-14 Thread Tim Cook
Hi All, I'm not clear on how to use the unicode module. I need to be able to use certain characters such as the degree symbol and the mu symbol, i.e.: units = ° if I say units=unicode(°). I

Re: while var, but var ==16 != true

2008-07-14 Thread [EMAIL PROTECTED]
On 14 juil, 07:32, Tim Roberts [EMAIL PROTECTED] wrote: (snip) Everything has a boolean value in Python. 0, None, False, '' (empty string), [] (empty list), () (empty tuple), and {} (empty dictionary) all have a False value. Everything else has a True value. Unless the author of the class

Re: subprocess module

2008-07-14 Thread John Mechaniks
On Jul 14, 7:44 pm, Peter Otten [EMAIL PROTECTED] wrote: John Mechaniks wrote: On Jul 14, 12:34 pm, Peter Otten [EMAIL PROTECTED] wrote: John Mechaniks wrote: from subprocess import call call(['ls', '-l']) How do I get the result (not the exit status of the command) of ls - l

Re: Unicode confusion

2008-07-14 Thread Jerry Hill
On Mon, Jul 14, 2008 at 12:40 PM, Tim Cook [EMAIL PROTECTED] wrote: if I say units=unicode(°). I get UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128) If I try x=unicode.decode(x,'utf-8'). I get TypeError: descriptor 'decode' requires a

Re: Building a Python app with Mozilla

2008-07-14 Thread Trent Mick
Brian Quinlan wrote: Most application logic in Komodo is implemented in Python, using the PyXPCOM bindings. The UI is implemented using XUL and JavaScript. The editor is Scintilla (C++). ../Komodo Edit.app/Contents/MacOS % find . -name *.py | xargs wc ... ... 126392 456858 4949602 total

Re: About the slot declaration decorator in PyQt4

2008-07-14 Thread Sebastian lunar Wiesner
Bighead [EMAIL PROTECTED]: I remember when I did UI Design in PyQt4 for the first time, I found a manual. In it, no connect was used. Instead, an OO approach is applied, new UI classes inherit from old ones, and all the slot functions are automatically connected to some signals, using a

Re: trying to use sax for a very basic first xml parser

2008-07-14 Thread Miki
Hello, but when I copy the script into blender and run it I get: [code]Compiled with Python version 2.5. Checking for installed Python... got it! Traceback (most recent call last):   File Text, line 27, in module   File H:\Python25\lib\xml\sax\__init__.py, line 93, in make_parser    

Re: Moving to functional programming

2008-07-14 Thread Terry Reedy
James Fassett wrote: zip ... robust and efficient than the list comprehension. I don't know the internals of how the Python interpreter treats list comprehensions and zip but it seems reasonable to assume an extra list is created for the zip approach. Minor times differences between this

Re: trying to use sax for a very basic first xml parser

2008-07-14 Thread manu
On Jul 14, 8:14 pm, Miki [EMAIL PROTECTED] wrote: Python is using an external library for SAX (expat IIRC). I *guess* the Python that comes with Blender don't have this library. I don't know... I didnt install any external libraries for sax. I think python comes with a standard sax library.

Re: while var, but var ==16 != true

2008-07-14 Thread Jeffrey Froman
Tim Roberts wrote: Everything has a boolean value in Python.  0, None, False, '' (empty string), [] (empty list), () (empty tuple), and {} (empty dictionary) all have a False value.  Everything else has a True value. Empty set objects also evaluate as false in a boolean context. Jeffrey --

new itertools functions in Python 2.6

2008-07-14 Thread Mensanator
With the new functions added to itertools in Python 2.6, I can finally get rid of this monstrosity: def ooloop6(a, n, perm=True, repl=True): if (not repl) and (nlen(a)): return r0 = range(n) r1 = r0[1:] if perm and repl: # ok v = ','.join(['c%s' % i for i in

Re: Problems Returning an HTTP 200 Ok Message

2008-07-14 Thread samwyse
On Jul 10, 4:10 pm, Guy Davidson [EMAIL PROTECTED] wrote: I try to send the following message, using the socket.send() command: 'HTTP/1.1 200 OK\r\nDate: Thu, 10 July 2008 14:07:50 GMT\r\nServer: Apache/2.2.8 (Fedora)\r\nX-Powered-By: PHP/5.2.4\r\nContent-Length: 4\r \nConnection:

Re: Problems Returning an HTTP 200 Ok Message

2008-07-14 Thread samwyse
On Jul 11, 3:46 am, Gabriel Genellina [EMAIL PROTECTED] wrote: As Guy Davidson has already pointed out, this is a problem in the meter   TCP implementation, and you should ask the vendor to fix it. That would have been me, not Guy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Python To Launch Python

2008-07-14 Thread Derek Martin
On Mon, Jul 14, 2008 at 02:01:04PM -0700, aha wrote: Since my application has it's own version of Python installed with it how should I use the system Python to launch the version of Python that launches my Application. Yes, this is a convoluted process, but not all Pythons are built the same

Re: Using Python To Launch Python

2008-07-14 Thread Mike Driscoll
On Jul 14, 4:01 pm, aha [EMAIL PROTECTED] wrote: Hello All,   I have a situation where I can count on a Python installation being available on a system, but I can't count on it being a version of Python needed by my application.  Since my application has it's own version of Python installed

Python Tiddlywiki class

2008-07-14 Thread CracKPod
Hello, I wrote a Python class to interact with the TiddlyWiki. In case you are interested you can find it on my blog: http://crackpod.bplaced.net/ CracKPod -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Python To Launch Python

2008-07-14 Thread Ivan Ven Osdel
Hello All, I have a situation where I can count on a Python installation being available on a system, but I can't count on it being a version of Python needed by my application. Since my application has it's own version of Python installed with it how should I use the system Python to launch

Bug when using with_statement with exec

2008-07-14 Thread Matimus
I think I'm going to create a new issue in Pythons issue database, but I wanted to run it by the news group first. See if I can get any useful feed back. The following session demonstrates the issue: Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type help,

Re: logging via SocketHandler and TCPserver

2008-07-14 Thread Larry Bates
Vinay Sajip wrote: On Jul 13, 9:25 pm, Larry Bates [EMAIL PROTECTED] wrote: Every time I look at theloggingmodule (up until now) I've given up and continue to use my home-grown logger that I've been using for years. I'm not giving up this time ;-) I find that I REALLY need to be able to

Re: Is it possible to create network conneciton on windows system?

2008-07-14 Thread Larry Bates
Evan wrote: Hello, one of my PC is window system, and in control panel - Network Connections, I can see some network connections such as PPPOE or VPN which I created by click create a new connection. My question is, is it possible to create a new connection by using Python script? which means

Re: Bug when using with_statement with exec

2008-07-14 Thread Jerry Hill
On Mon, Jul 14, 2008 at 6:00 PM, Matimus [EMAIL PROTECTED] wrote: If I create a function by using exec on a string and _don't_ end the string with a new-line it will work just fine unless I from __future__ import with_statement. [snip] I searched python's issue database and didn't see anything

Re: Why is there no GUI-tools like this for Windows?

2008-07-14 Thread name
It seems the video is showing glade, which is also available for wx under the name wxglade, I do not know whether it's available for Windows. I think it should work because it itself is written in Python. I personally prefer to code my GUI myself, so I can do looping stuff with it, but that is

Method behavior for user-created class instances

2008-07-14 Thread crazychimp132
Greetings. I am looking for a way to achieve method behavior for a class I created. That is, it has a __call__ method, so can be called like a function. But I also want it to be treated as a method when it appears in a class body. Eg. class foo: def __call__(self, inst): pass class bar:

Re: Using Python To Launch Python

2008-07-14 Thread Derek Martin
On Mon, Jul 14, 2008 at 05:40:43PM -0400, Aquil H. Abdullah wrote: You've hit the proverbial nail with the hammer. The problem is that my application needs to run under both the Linux and Windows OSs, so while I would love to use a nice sh, csh, or bash shell script. My hands are tied because

Python ver of System.arraycopy() in Java

2008-07-14 Thread Jordan
I could seem to find a built in function that would serve the purpose of System.arraycopy() in java. I was able to accomplish it with something like this: def arraycopy(source, sourcepos, dest, destpos, numelem): dest[destpos:destpos+numelem] = source[sourcepos:sourcepos +numelem] is there

Re: Is it possible to create network conneciton on windows system?

2008-07-14 Thread Evan
On Jul 15, 6:22 am, Larry Bates [EMAIL PROTECTED] wrote: Evan wrote: Hello, one of my PC is window system, and in control panel -Network Connections, I can see somenetworkconnectionssuch as PPPOE or VPN which I created by click create a new connection. My question is, is it possible to

Re: Method behavior for user-created class instances

2008-07-14 Thread Larry Bates
[EMAIL PROTECTED] wrote: Greetings. I am looking for a way to achieve method behavior for a class I created. That is, it has a __call__ method, so can be called like a function. But I also want it to be treated as a method when it appears in a class body. Eg. class foo: def

Re: Python Tiddlywiki class

2008-07-14 Thread David
CracKPod wrote: Hello, I wrote a Python class to interact with the TiddlyWiki. In case you are interested you can find it on my blog: http://crackpod.bplaced.net/ CracKPod -- http://mail.python.org/mailman/listinfo/python-list Thank you :) -- Powered by Gentoo GNU/LINUX

One step up from str.split()

2008-07-14 Thread Joel Koltner
I normally use str.split() for simple splitting of command line arguments, but I would like to support, e.g., long file names which-- under windows -- are typically provided as simple quoted string. E.g., myapp --dosomething --loadthis my file name.fil ...and I'd like to get back a list

Re: One step up from str.split()

2008-07-14 Thread Matimus
On Jul 14, 6:33 pm, Joel Koltner [EMAIL PROTECTED] wrote: I normally use str.split() for simple splitting of command line arguments, but I would like to support, e.g., long file names which-- under windows -- are typically provided as simple quoted string. E.g., myapp --dosomething

urllib2 http authentication/redirection/cookie issue

2008-07-14 Thread Neuberger, Sheldon N.
I have a tricky situation here with auth/redirection/cookies and I think I am messing something up with the handler. I am trying to open a site http://foo.example.com which redirects (status 302) to https://bar.example.com/ where the dashes represent lots of subdirectories and

Python pack and unpack question

2008-07-14 Thread joe shoemaker
If you have the following: data = unpack('L', sock.recv(4)) Does this line of code means that incoming data is big endian and unpack it to endianess of local machine? If local machine is little endian, then big endian is automatically converted to little endian format? thank you. --

Re: One step up from str.split()

2008-07-14 Thread Timothy Grant
On Mon, Jul 14, 2008 at 6:33 PM, Joel Koltner [EMAIL PROTECTED] wrote: I normally use str.split() for simple splitting of command line arguments, but I would like to support, e.g., long file names which-- under windows -- are typically provided as simple quoted string. E.g., myapp

Re: Need help in writing up a Python Syntax checker

2008-07-14 Thread Kinokunya
On Jul 14, 6:48 pm, Kay Schluehr [EMAIL PROTECTED] wrote: On 14 Jul., 08:22, Kinokunya [EMAIL PROTECTED] wrote: Hi guys, My group and I will be working on our final year project, the scope to do a program/web-based application similar areas of functionalities like the PyLint and

Re: One step up from str.split()

2008-07-14 Thread Larry Bates
Joel Koltner wrote: I normally use str.split() for simple splitting of command line arguments, but I would like to support, e.g., long file names which-- under windows -- are typically provided as simple quoted string. E.g., myapp --dosomething --loadthis my file name.fil ...and I'd like to

Re: About wmi

2008-07-14 Thread patrol
Situation (1): result = new_process.terminate() TypeError: 'int' object is not callable Situation (2): result = new_process.terminate() File C:\Python25\lib\wmi.py, line 494, in __getattr__ handle_com_error (error_info) File C:\Python25\lib\wmi.py, line 190, in handle_com_error

Re: a module.pth question

2008-07-14 Thread oyster
there are 2 reasons: 1. I use both py24 and py25, I don't like to install 2 copies of pyglet, which is a pure python module and can be used by py24/25 at the same time, thus I am not willing to put a module under site-packages, instead I use a separate directory(h:\pure_pylib in my case) 2. I

How to write a custom tracer/profiler?

2008-07-14 Thread [EMAIL PROTECTED]
Hi, all, Just wanna look for some suggestions on how to appoarch this problem... I have some code (main logic) which has a dependency on a library. Let's call it DS. (data source). The main logic will issue a number of calls to the DS in order to get the data it needs and then carry out some

Re: Python ver of System.arraycopy() in Java

2008-07-14 Thread Miki
Hello, I could seem to find a built in function that would serve the purpose of System.arraycopy() in java. I was able to accomplish it with something like this: def arraycopy(source, sourcepos, dest, destpos, numelem):     dest[destpos:destpos+numelem] = source[sourcepos:sourcepos

Re: trying to use sax for a very basic first xml parser

2008-07-14 Thread Miki
Hello, Could it be that I have to install the same python version Blender was compiled with? I have no idea. May I suggest you ask in the blender list? HTH, -- Miki [EMAIL PROTECTED] http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems Returning an HTTP 200 Ok Message

2008-07-14 Thread Gabriel Genellina
En Mon, 14 Jul 2008 17:46:12 -0300, samwyse [EMAIL PROTECTED] escribió: On Jul 11, 3:46 am, Gabriel Genellina [EMAIL PROTECTED] wrote: As Guy Davidson has already pointed out, this is a problem in the meter That would have been me, not Guy. Indeed, sorry the misattribution! -- Gabriel

Re: a module.pth question

2008-07-14 Thread Gabriel Genellina
En Mon, 14 Jul 2008 08:26:49 -0300, oyster [EMAIL PROTECTED] escribi�: My py24 is installed in h:\python24 I installed pyglet(http://pyglet.org/) in H:\pure_pylib\Multimedia\pyglet-1.0\, if I do [code] import sys sys.path.append(r'H:\pure_pylib\Multimedia\pyglet-1.0') import pyglet [/code]

Re: how can I use exec with main module globals?

2008-07-14 Thread Gabriel Genellina
En Sat, 12 Jul 2008 16:15:36 -0300, Akathorn Greyhat [EMAIL PROTECTED] escribi�: Hello, this is my first message in the group. Welcome! I'm spanish so my english sometimes is really bad, sorry =( I have a problem and I hope someone has the answer. I'm trying to make an in-game python

Re: How to write a custom tracer/profiler?

2008-07-14 Thread Gabriel Genellina
En Mon, 14 Jul 2008 23:48:20 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribi�: The main logic will issue a number of calls to the DS in order to get the data it needs and then carry out some calculations. I want to have a non-intrusive way to find out all the DS data requested by the main

[issue3335] subprocess lib - opening same command fails

2008-07-14 Thread Gregory P. Smith
Gregory P. Smith [EMAIL PROTECTED] added the comment: I am unable to reproduce this (using release24-maint on OS X 10.4). the script I used is attached. Does this script fail for you? If not, please upload something that fails. -- nosy: +gregory.p.smith Added file:

[issue3352] Deficiencies in multiprocessing/threading API

2008-07-14 Thread Nick Coghlan
New submission from Nick Coghlan [EMAIL PROTECTED]: The PEP 8 compliant API for multiprocessing and threading needs to be cleaned up before release as per the thread on python-dev. The release manager gave approval for this change during that discussion [1]. Changes needed: - remove Py3k

[issue3352] Deficiencies in multiprocessing/threading API

2008-07-14 Thread Andrii V. Mishkovskyi
Andrii V. Mishkovskyi [EMAIL PROTECTED] added the comment: Actually, 'getx' - 'fget'. Sorry for the typo. :) ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3352 ___

[issue3353] make built-in tokenizer available via Python C API

2008-07-14 Thread Fredrik Lundh
New submission from Fredrik Lundh [EMAIL PROTECTED]: CPython provides a Python-level API to the parser, but not to the tokenizer itself. Somewhat annoyingly, it does provide a nice C API, but that's not properly exposed for external modules. To fix this, the tokenizer.h file should be moved

[issue3354] sort(reverse=None) prints misleading error message

2008-07-14 Thread Christoph Zwerschke
New submission from Christoph Zwerschke [EMAIL PROTECTED]: When you sort a list with list.sort() or sorted(list), and set the reverse parameter to None, then you get the following misleading error message: TypeError: an integer is required I would expect a more proper error message for the

  1   2   >