Newby Windows User

2009-07-01 Thread rtm74
I am new to Python and use Windows XP. I would like to know how to run a python program file? -- http://mail.python.org/mailman/listinfo/python-list

Re: invoking a method from two superclasses

2009-07-01 Thread Mitchell L Model
[Continuing the discussion about super() and __init__] The documentation of super points out that good design of diamond patterns require the methods to have the same signature throughout the diamond. That's fine for non-mixin classes where the diamond captures different ways of handling the sa

System default sys.path

2009-07-01 Thread Brock Pytlik
Hi, I'm trying to find a way to get the value sys.path would have on a particular system if python was started with an empty python path. I do want it to include the site specific additional paths. I know I can hack this information myself, but I'd rather be able to get this on demand so that i

Re: invoking a method from two superclasses

2009-07-01 Thread Carl Banks
On Jun 30, 9:57 pm, Mitchell L Model wrote: > [Continuing the discussion about super() and __init__] > > The documentation of super points out that good design of > diamond patterns require the methods to have the same > signature throughout the diamond. That's fine for non-mixin > classes where t

Re: Newby Windows User

2009-07-01 Thread Xavier Ho
Double click should work. If it flashes up and goes away really quickly, then you need to run it under IDLE or some kind of python shell. Once you have Python installed, go to Start -> Run, and type in cmd to bring up the windows command line or whatever you wanna call it. Go to the folder where

Re: Using Python to set desktop background image under Windows XP

2009-07-01 Thread alex23
On Jul 2, 8:02 am, "ELLINGHAUS, LANCE" wrote: > Does anyone have any code that would allow setting the desktop background > image under Windows XP? It's amazing what typing "python windows desktop" into Google will find you: http://snippets.dzone.com/posts/show/3348 Any other searches you'd li

Re: Getting input the scanf way

2009-07-01 Thread alex23
On Jul 1, 6:33 pm, "Mr.SpOOn" wrote: > I need to do some kind of interactive command line program. > > I mean: I run the program, it asks me for input, I type something and > then I get the output or other questions. > I'm not sure what is the right way to achieve this. While the simplest way wou

Re: Why re.match()?

2009-07-01 Thread kj
In Duncan Booth writes: >So, for example: re.compile("c").match("abcdef", 2) ><_sre.SRE_Match object at 0x02C09B90> re.compile("^c").search("abcdef", 2) I find this unconvincing; with re.search alone one could simply do: >>> re.compile("^c").search("abcdef"[2:]) <_sre.S

Re: Open Source RSS Reader in Python?

2009-07-01 Thread alex23
On Jul 2, 9:18 am, Alex wrote: > I am looking for an open source RSS reader (desktop, not online) > written in Python but in vain. I am not looking for a package but a > fully functional software. > > Google: python "open source" (rss OR feeds) reader > > Any clue ? It's always worth taking a loo

Re: Basic question from pure beginner

2009-07-01 Thread alex23
On Jul 2, 3:47 am, Scott David Daniels wrote: > And even simpler: >      PASSWORD = "qwerty" >      MAXRETRY = 3 >      for attempt in range(MAXRETRY): >          if raw_input('Enter your password: ') == PASSWORD: >              print 'Password confirmed' >              break # this exits the for

Re: Why re.match()?

2009-07-01 Thread Steven D'Aprano
On Thu, 02 Jul 2009 03:49:57 +, kj wrote: > In Duncan Booth > writes: >>So, for example: > > re.compile("c").match("abcdef", 2) >><_sre.SRE_Match object at 0x02C09B90> > re.compile("^c").search("abcdef", 2) > > > I find this unconvincing; with re.search alone one cou

Re: Access NtQueryInformationProces() from Python

2009-07-01 Thread Rajat
On Jun 30, 2:10 pm, Tim Golden wrote: > Dudeja, Rajat wrote: > > Hi, > > > I'm looking for a way to call the NtQueryInformationProces() and > > ReadProcessMemory() of WindowsXP from Python. > > > Can anyone direct me to some examples where they have been successfully > > called through Python? >

Re: System default sys.path

2009-07-01 Thread David Lyon
On Wed, 01 Jul 2009 19:48:04 -0700, Brock Pytlik wrote: > Hi, I'm trying to find a way to get the value sys.path would have on a > particular system if python was started with an empty python path. I do > want it to include the site specific additional paths. I know I can hack > this informatio

Re: Multi thread reading a file

2009-07-01 Thread Stefan Behnel
Mag Gam wrote: > On Wed, Jul 1, 2009 at 12:54 AM, Gabriel Genellina wrote: >> Does the format conversion involve a significant processing time? If not, >> the total time is dominated by the I/O time (reading and writing the file) >> so it's doubtful you gain anything from multiple threads. > > The

Re: What are the limitations of cStringIO.StringIO() ?

2009-07-01 Thread Stephen Hansen
> > >1. Anyone knows whet's the limitation on cStringIO.StringIO() objects ? >2. Could you suggest a better way to create a string that contains the >concatenation of several big files ? > > This isn't a limit in cStringIO.StringIO, but a limit on the amount of memory a process is able

Re: Adding an object to the global namespace through " f_globals" is that allowed ?

2009-07-01 Thread Terry Reedy
Stef Mientki wrote: hello, I need to add an object's name to the global namespace. The reason for this is to create an environment, where you can add some kind of math environment, where no need for Python knowledge is needed. The next statement works, but I'm not sure if it will have any drama

Re: pep 8 constants

2009-07-01 Thread Eric S. Johansson
Tim Chase wrote: >> I've tried it least two dozen editors and they all fail miserably >> because they're focused on keyboard use (but understandable) > [...snip...] >> I've tried a whole bunch, like I said at least a dozen. They >> all fail for first reasons such as inability to access all >> funct

Re: Trying to use sets for random selection, but the pop() method returns items in order

2009-07-01 Thread Mario Garcia
Thank you all for your input, Yes random is what I need!! I checked the docs, and follow your comments, I will use both random.sample and random.shuffle,and random.choice etc. !! For this particular problem I think ramdom.shuffle() is what I need. I was not very clear or complete in my explanati

Accessing windows structures through ctypes.

2009-07-01 Thread Rajat
Hi, Using ctypes can I access the windows structures like: PROCESS_INFORMATION_BLOCK, Process Environment Block(PEB), PEB_LDR_DATA, etc? Regards, Rajat -- http://mail.python.org/mailman/listinfo/python-list

Re: pep 8 constants

2009-07-01 Thread Eric S. Johansson
Rhodri James wrote: > > Gah. Ignore me. I hit 'send' instead of 'cancel', after my musings > concluded that yes, an editor could be smart enough, but it would have to > embed a hell of a lot of semantic knowledge of Python and it still wouldn't > eliminate the need to speak the keyboard at time

Re: Making code run in both source tree and installation path

2009-07-01 Thread Lawrence D'Oliveiro
In message , Robert Kern wrote: > On 2009-07-01 01:04, Carl Banks wrote: >> >> The most common way I've seen people work around this issue is to >> throw their data files into the package directories. Yuck. > > Huh. I always found that to be a more elegant solution than hardcoding the > data lo

Re: Basic question from pure beginner

2009-07-01 Thread alex23
Dennis Lee Bieber wrote: >         There is also the getpass module to play with! I don't think I've ever seen getpass, so thanks for pointing that out. Unfortunately, it wouldn't have helped the OP understand why his original code wasn't working ;) -- http://mail.python.org/mailman/listinfo/pyt

Re: Accessing windows structures through ctypes.

2009-07-01 Thread Horace Blegg
http://www.codeproject.com/KB/threads/GetNtProcessInfo.aspx Looks rather to be pretty simple: Acquire the PED base pointer (article explains how) and then just read that information into a struct using ReadProcessMemory(). On Wed, Jul 1, 2009 at 10:42 PM, Rajat wrote: > Hi, > > Using ctypes can

dealloc function in python extend c module

2009-07-01 Thread Shen, Yu-Teh
I create my extend type something like http://www.python.org/doc/current/extending/newtypes.html. And my type has a member which is a pointer point to my allocate memory ( no ref count). ex: --- typedef struct { PyObject_HEAD /* Type-specific

Re: A question about fill_free_list(void) function

2009-07-01 Thread Pedram
On Jul 1, 10:01 pm, Christian Heimes wrote: > Pedram schrieb: > > > Hello community, > > I'm reading the CPython interpreter source code, > > first, if you have something that I should know for better reading > > this source code, I would much appreciate that :) > > second, in intobject.c file, I

wxPython: Plaing widgets in status bar

2009-07-01 Thread iu2
Hi all, I try to placs widgets (button, static text labels) in a status bar, wxPython. >From the examples I could place them using exact positioning by the status bar methof GetFieldRect. In this case I need to add an EVT_SIZER handler to keep the widgets in their propotional places within the sta

Re: Accessing windows structures through ctypes.

2009-07-01 Thread alex23
On Jul 2, 3:42 pm, Rajat wrote: > Using ctypes can I access the windows structures like: > > PROCESS_INFORMATION_BLOCK, Process Environment Block(PEB), > PEB_LDR_DATA, etc? ctypes.wintypes lists all of the Windows structures included with the module. You should be able to use ctypes.Structure cl

Re: pep 8 constants

2009-07-01 Thread Eric S. Johansson
Steven D'Aprano wrote: > That assumes that every word is all caps. In practice, for real-life > Python code, I've tripled the vocal load of perhaps one percent of your > utterances, which cuts your productivity by 2%. > > If you have 1 words in you per day, and one percent get wrapped with

Re: Accessing windows structures through ctypes.

2009-07-01 Thread Rajat
> > Using ctypes can I access the windows structures like: > > > PROCESS_INFORMATION_BLOCK, Process Environment Block(PEB), > > PEB_LDR_DATA, etc? > > ctypes.wintypes lists all of the Windows structures included with the > module. > > You should be able to use ctypes.Structure class to roll your o

<    1   2