Re: ftp recursively

2008-03-20 Thread Paul Rubin
Jeff Schwab <[EMAIL PROTECTED]> writes: > I thought os.walk was for locally mounted directories... How is it > relevant on remote filesystems? Yes, os.walk is for local directories. I thought you wanted to push a local tree to a remote host. For pulling, yes, you need to do something different;

Re: finding items that occur more than once in a list

2008-03-20 Thread John Machin
On Mar 20, 12:50 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 19 Mar 2008 20:16:36 -0300, John Machin <[EMAIL PROTECTED]>   > escribió: > > > On Mar 20, 9:14 am, sturlamolden <[EMAIL PROTECTED]> wrote: > >> Is a Python set implemented using a hash table? > > > What don't you underst

Removal of tkinter from python 3.0? [was: Fate of the repr module in Py3.0]

2008-03-20 Thread Daniel Fetchinson
> Was looking at PEP 3108, http://www.python.org/dev/peps/pep-3108/ , > and saw that the repr module was slated for vaporization. I've only > used the module a few times ever. I'm curious if the community wants > it kept around or whether it is considered clutter. > > The PEP is going to be finaliz

forkpty not working?

2008-03-20 Thread est
Hello everyone. I am trying to write a bash/ssh wrapper in python so python scripts could interact with bash/ssh. Because when input passwords to ssh it requires a tty rather than stdin pipe, so i have to use a pty module to do that. I copied this snippet from this thread http://groups.google.com

Re: dividing tuple elements with an int or float

2008-03-20 Thread Steven D'Aprano
On Wed, 19 Mar 2008 23:06:44 -0700, royG wrote: > suppose > origsz=(400,300) > i want to divide the origsize by 2.5 so i can resize to (160,120) > > scale=2.5 > how can i get the newsz? > obviously origsz/2.5 won't work .. newsz = (origsz[0]/scale, origsz[1]/scale) -- Steven -- http://ma

Re: parsing json output

2008-03-20 Thread Gowri
Hi Tim, I understand it's JSON. My problem is that it just prints crazy characters instead of the JSON data. Like I mentioned, this happens on my windows machine which has python 2.5. On the other hand, the same code worked perfectly great on my linux machine with python 2.3.4. What could the prob

Re: ftp recursively

2008-03-20 Thread Steven D'Aprano
On Wed, 19 Mar 2008 23:53:22 -0700, Jeff Schwab wrote: > The point of rsync is to keep a local directory tree in sync with a > remote one, by transferring only change-sets that are conceptually > similar to patches. If you're only transferring files once, there's no > particular benefit (AFAIK) t

Re: Removal of tkinter from python 3.0? [was: Fate of the repr module in Py3.0]

2008-03-20 Thread Paul Rubin
"Daniel Fetchinson" <[EMAIL PROTECTED]> writes: > Is it just me or others also think that it would be a major loss to > remove tkinter from the python core? That would be terrible. Every time I've tried to use one of the other packages it has led to installation hell. Tkinter isn't great, but it

Re: Is this valid ?

2008-03-20 Thread Lie
On Mar 20, 4:18 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > by accident I typed a double value test, > and to my surprise it seems to work. > Is this valid ? > > a = 2 > b = 2 > > a == b == 2 > > thanks, > Stef Mientki a == b == 2 is equivalent to a == b and b == 2 except that b is on

Re: Calling Mac programs from Python instead of from AppleScript

2008-03-20 Thread Python.Arno
On 19 mrt 2008, at 20:41, [EMAIL PROTECTED] wrote: > > When I'm running Script Editor, I can get Maya to draw a sphere by > typing: > > tell application "Maya" > execute "sphere" > end tell > > When I try this using Python, I get this error message: > > IDLE 1.2.2 app('Maya').execute('

Re: finding items that occur more than once in a list

2008-03-20 Thread Arnaud Delobelle
On Mar 19, 3:08 am, Bryan Olson <[EMAIL PROTECTED]> wrote: > Arnaud Delobelle wrote: > > Ninereeds wrote: > >> Hrvoje Niksic wrote: > >>> This doesn't apply to Python, which implements dict storage as an > >>> open-addressed table and automatically (and exponentially) grows the > >>> table when the

Re: Script Request...

2008-03-20 Thread Diez B. Roggisch
some one wrote: > Thanks Diez, I found some docs and examples on urllib2. Now how do i > search the string I get from urllib2, lets say I put it in "myURL", How > do I search for only Numbers and ".'s" in the "#.#.#.#" pattern. That > is all I am interested in with all the data retrieved. Just

backslash in reading bytes

2008-03-20 Thread Dravidan
I am trying to read some byte data as a string then using a library to convert them a code: >>>reader = csv.DictReader(open('table.txt')) >>>def eleFind(value): >>> for row in reader: >>> if row['byteCode'] == value: >>> print row['Element'] >>>

Re: csv dictreader

2008-03-20 Thread Dravidan
It looks like the backslash is messing the whole thing up so I reposted to try to find out how to get over the backslash hump. On Mar 20, 2:08 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Wed, 19 Mar 2008 11:06:40 -0700 (PDT), brnstrmrs > <[EMAIL PROTECTED]> declaimed the following in co

Regarding Threads and locals()

2008-03-20 Thread Teja
Hi all, I have a GUI applicaion(along with threads). When the run button is pressed in the GUI a separate thread starts( Thread is created using beginthreadex) and does the required activity. Now, while the thread is being executed, i want the locals() present inside the thread's run function to b

Re: Script Request...

2008-03-20 Thread Gerard Flanagan
On Mar 19, 10:29 pm, some one <[EMAIL PROTECTED]> wrote: > Thanks Diez, I found some docs and examples on urllib2. Now how do i > search the string I get from urllib2, lets say I put it in "myURL", How > do I search for only Numbers and ".'s" in the "#.#.#.#" pattern. That > is all I am intereste

Re: Speaking Text

2008-03-20 Thread David C. Ullrich
On Wed, 19 Mar 2008 07:41:29 -0500, David C. Ullrich <[EMAIL PROTECTED]> wrote: >Mac OS X has text-to-speech built into the interface. >So there must be a way to access that from the command >line as well - in fact the first thing I tried worked: > >os.system('say hello') > >says 'hello'. > >Is th

A question about a metacharacter

2008-03-20 Thread igbt
I am creating a simple script which is using gtk. In this script you must enter a text, if you do not enter anything or you enter a dot, the script will be finished. However, if you don't enter anything the script works but if you enter a dot (.) the script does not work. I was investigating about

Strange behavior of the Eclipse embedded console

2008-03-20 Thread hellt
i've faced with some strangeness while executing this sample: choice = raw_input("your choice: ") print len(choice) when i run this sample in my eclipse console with CPython and print Yes, i have this output 4 #trailing \t is the fourth element but when i use command line method python sample.py

Re: Prototype OO

2008-03-20 Thread Bruno Desthuilliers
sam a écrit : > > Some time ago (2004) there were talks about prototype-based languages > and Prothon emerged. > > Can someone tell me why class-based OO is better that Prototype based, For which definition of "better" ?-) > especially in scripting langage with dynamic types as Python is? >

Re: A question about a metacharacter

2008-03-20 Thread Chris
On Mar 20, 1:19 pm, igbt <[EMAIL PROTECTED]> wrote: > I am creating a simple script which is using gtk. In this script you > must enter a text, if you do not enter anything or you enter a dot, > the script will be finished. However, if you don't enter anything the > script works but if you enter a

Re: Anomaly in time.clock()

2008-03-20 Thread Godzilla
Thanks Ross and John for your help. I apologise for the code I posted earlier not being the full picture of what I was trying to achieve. I had instantiated multiple instances of elapseTime class and each of them gets called approximately the same time. Below is the updated code: import time impo

Change user on UNIX

2008-03-20 Thread Giampaolo Rodola'
Hi all. Is there any way to su or login as a different user within a python script? I mainly need to temporarily impersonate another user to execute a command and then come back to the original user. I tried to google a little bit about it but I still didn't find a solution. Thanks in advance. -

Re: Change user on UNIX

2008-03-20 Thread Bjoern Schliessmann
Giampaolo Rodola' wrote: > Is there any way to su or login as a different user within a > python script? I mainly need to temporarily impersonate another > user to execute a command and then come back to the original user. > I tried to google a little bit about it but I still didn't find a > solut

Re: Calling Mac programs from Python instead of from AppleScript

2008-03-20 Thread has
On 19 Mar, 20:10, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Take a look at appscript: > > http://appscript.sourceforge.net/ Also, once appscript is installed, don't forget to import it before use: from appscript import * app('Maya').execute('sphere') HTH has -- Control AppleScriptable applic

eval and unicode

2008-03-20 Thread Laszlo Nagy
How can I specify encoding for the built-in eval function? Here is the documentation: http://docs.python.org/lib/built-in-funcs.html It tells that the "expression" parameter is a string. But tells nothing about the encoding. Same is true for: execfile, eval and compile. The basic problem: - e

Re: A question about a metacharacter

2008-03-20 Thread igbt
On 20 mar, 12:38, Chris <[EMAIL PROTECTED]> wrote: > On Mar 20, 1:19 pm, igbt <[EMAIL PROTECTED]> wrote: > > > > > I am creating a simple script which is using gtk. In this script you > > must enter a text, if you do not enter anything or you enter a dot, > > the script will be finished. However, i

Re: Removal of tkinter from python 3.0? [was: Fate of the repr module in Py3.0]

2008-03-20 Thread Kay Schluehr
> Is it just me or others also think that it would be a major loss to > remove tkinter from the python core? PEP 3108 starts off with: > > Each module to be removed needs to have a justification as to why it > should no longer be distributed with Python. >From time to time someone makes a serious

Re: Removal of tkinter from python 3.0? [was: Fate of the repr module in Py3.0]

2008-03-20 Thread bearophileHUGS
Paul Rubin: > Python needs more stuff in its stdlib, not less. > If Tkinter doesn't satisfy, then add Gtk (or whatever) to the standard > distro. If that happens (i.e. some new toolkit is brought in and > declared to be the standard) then it might be ok to drop Tkinter but > it certainly shouldn't

Re: Removal of tkinter from python 3.0? [was: Fate of the repr module in Py3.0]

2008-03-20 Thread sturlamolden
On 20 Mar, 08:39, "Daniel Fetchinson" <[EMAIL PROTECTED]> wrote: > Thoughts anyone? I don't use tk myself, but scheduling tkinter for vaporization would be a bad idea. A lot of programs depend on it, and it doesn't look ugly anymore (the one that ship with Python still does). Would inclusion of

wxFormBuilder

2008-03-20 Thread sturlamolden
I just discovered wxFormBuilder. After having tried several GUI builders for wx (including DialogBlocks, wxGlade, XRCed, Boa constructor), this is the first one I can actually use. To use it wxFormBuilder with wxPython, I generated an xrc resource and loaded it with wxPython. All the tedious GUI

Re: os.path.getsize() on Windows

2008-03-20 Thread Duncan Booth
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Wed, 19 Mar 2008 12:34:34 +, Duncan Booth wrote: >> By default Python on Windows allows you to open a file for reading >> unless you specify a sharing mode which prevents it: > > But the OP is talking about another process having opened the fil

Thanks. (Re: keeping state in an iterator object by rebinding next())

2008-03-20 Thread Wilbert Berendsen
Thanks for all the elaborate answers and help! It helped me deepening my understanding of Python. Sincere, Wilbert Berendsen -- http://www.wilbertberendsen.nl/ "You must be the change you wish to see in the world." -- Mahatma Gandhi -- http://mail.python.org/mailman/listinfo/python-list

Problem with PARAGRAPH SEPARATOR

2008-03-20 Thread Dominique . Holzwarth
Hello everyone I'm doing a transformation with (MSXML) from a xml file to a tex file (actually it's just output format "text" with tex commands inside). The output of the transformation (a big string containg the whole file) contains a so called 'paragraph separator' (unicode: 2029). If I want t

Re: Is this valid ?

2008-03-20 Thread Rolf van de Krol
John Machin wrote: > Of course. You can chain comparisons as much as you like and is > (semi-)sensible, e.g. > Hmm, 'of course' is not the correct word for it. Although the Stef Mientki would probably be able to find it in the documentation it is not as simple as you might think. Most language

Re: Strange behavior of the Eclipse embedded console

2008-03-20 Thread hellt
On 20 мар, 14:31, hellt <[EMAIL PROTECTED]> wrote: > i've faced with some strangeness while executing this sample: > > choice = raw_input("your choice: ") > print len(choice) > > when i run this sample in my eclipse console with CPython and print > Yes, i have this output > 4 #trailing \t is the fo

Deleting Microsoft access database

2008-03-20 Thread Ahmed, Shakir
I have a Microsoft Access database that I want to delete whether anyone is using that file. The database is already read only mode residing in a server, users are opening in read only mode. I want to delete that file, I remove read only check but could not delete that file. Getting error messag

Re: Deleting Microsoft access database

2008-03-20 Thread Michael Wieher
Are you going to be replacing it with a new database? Problem: Users are accessing the file. (as you said, users are opening in read-only) Solution: (assuming you will be using a new, better... anything is better than M$, database) --- put the new database online, redirect your users to hit the n

Re: Deleting Microsoft access database

2008-03-20 Thread sturlamolden
On 20 Mar, 15:11, "Ahmed, Shakir" <[EMAIL PROTECTED]> wrote: > I have a Microsoft Access database that I want to delete whether anyone > is using that file. > > The database is already read only mode residing in a server, users are > opening in read only mode. I want to delete that file, I remove r

Re: Problem with PARAGRAPH SEPARATOR

2008-03-20 Thread Marc 'BlackJack' Rintsch
On Thu, 20 Mar 2008 13:03:17 +, Dominique.Holzwarth wrote: > The output of the transformation (a big string containg the whole file) > contains a so called 'paragraph separator' (unicode: 2029). If I want to > pring that string (file) to the std out or a file object then I get a > "UnicodeErro

Re: dividing tuple elements with an int or float

2008-03-20 Thread Jerry Hill
On Thu, Mar 20, 2008 at 3:42 AM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Wed, 19 Mar 2008 23:06:44 -0700, royG wrote: > > > > suppose > > origsz=(400,300) > > i want to divide the origsize by 2.5 so i can resize to (160,120) > > > > scale=2.5 > > how can i get the newsz? > > obviousl

Re: eval and unicode

2008-03-20 Thread Jonathan Gardner
On Mar 20, 5:20 am, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > How can I specify encoding for the built-in eval function? Here is the > documentation: > > http://docs.python.org/lib/built-in-funcs.html > > It tells that the "expression" parameter is a string. But tells nothing > about the encoding. S

Re: backslash in reading bytes

2008-03-20 Thread Marc 'BlackJack' Rintsch
On Thu, 20 Mar 2008 03:24:49 -0700, Dravidan wrote: > I am trying to read some byte data as a string then using a library to > convert them a code: > reader = csv.DictReader(open('table.txt')) def eleFind(value): for row in reader: if row['byteCode'] == value:

Re: Change user on UNIX

2008-03-20 Thread Jonathan Gardner
On Mar 20, 4:51 am, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > Hi all. > Is there any way to su or login as a different user within a python > script? I mainly need to temporarily impersonate another user to > execute a command and then come back to the original user. > I tried to google a li

Can I dyanmically add Pyro objects to a running Pyro server?

2008-03-20 Thread writeson
Hi everyone, I'm trying to build a distributed system using the code in the examples/distributed_computing2 directory of the Pyro un-tarred distribution. I'm trying to make this generic so one Pyro class can kick off another on mulit-core/multi-cpu/multi-server systems. What I'd like to know is th

Can I run a python program from within emacs?

2008-03-20 Thread jmDesktop
Hi, I'm trying to learn Python. I using Aquamac an emac implementation with mac os x. I have a program. If I go to the command prompt and type pythong myprog.py, it works. Can the program be run from within the editor or is that not how development is done? I ask because I was using Visual Stud

Re: Change user on UNIX

2008-03-20 Thread Jeffrey Froman
Giampaolo Rodola' wrote: > I mainly need to temporarily impersonate another user to > execute a command and then come back to the original user. If the script is run as root, you can freely impersonate other users with the os.seteuid() and os.setegid() methods. If the script is not run as root (

Re: Change user on UNIX

2008-03-20 Thread Jeff Schwab
Jonathan Gardner wrote: > On Mar 20, 4:51 am, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: >> Is there any way to su or login as a different user within a python >> script? I mainly need to temporarily impersonate another user to >> execute a command and then come back to the original user. > I

Re: Can I run a python program from within emacs?

2008-03-20 Thread Grant Edwards
On 2008-03-20, jmDesktop <[EMAIL PROTECTED]> wrote: > Hi, I'm trying to learn Python. I using Aquamac an emac > implementation with mac os x. I have a program. If I go to the > command prompt and type pythong myprog.py, it works. Can the program > be run from within the editor or is that not h

Re: Can I run a python program from within emacs?

2008-03-20 Thread Jeff Schwab
Grant Edwards wrote: > On 2008-03-20, jmDesktop <[EMAIL PROTECTED]> wrote: > >> Hi, I'm trying to learn Python. I using Aquamac an emac >> implementation with mac os x. I have a program. If I go to the >> command prompt and type pythong myprog.py, it works. Can the program >> be run from withi

Re: Can I run a python program from within emacs?

2008-03-20 Thread jmDesktop
On Mar 20, 11:21 am, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-03-20, jmDesktop <[EMAIL PROTECTED]> wrote: > > > Hi, I'm trying to learn Python.  I using Aquamac an emac > > implementation with mac os x.  I have a program.  If I go to the > > command prompt and type pythong myprog.py, it w

RE: Problem with PARAGRAPH SEPARATOR

2008-03-20 Thread Dominique . Holzwarth
Actually that's what I tried to do, for example: outputString = myString.encode('iso-8859-1','ignore') However, I always get such messages (the character, that's causing problems varies, but its always higher than 127 ofc...) 'ascii' codec can't decode byte 0xc3 in position 51: ordinal not in r

Re: Can I run a python program from within emacs?

2008-03-20 Thread Michael Wieher
Well, I suppose you could. But why bother with learing emacs when you'll have to switch to vim later anyway? 2008/3/20, jmDesktop <[EMAIL PROTECTED]>: > > Hi, I'm trying to learn Python. I using Aquamac an emac > implementation with mac os x. I have a program. If I go to the > command prompt a

Re: Prototype OO

2008-03-20 Thread sam
Bruno Desthuilliers napisał(a): > Most of the arguments in favor of prototypes seems to come to, mainly: > 1/ it lets you customize behaviour on a per-object base > 2/ it removes the mental overhead of inheritance, classes etc > > Point 1. is a non-problem in Python, since you can already add/rep

Re: Can I run a python program from within emacs?

2008-03-20 Thread Jeff Schwab
jmDesktop wrote: > On Mar 20, 11:21 am, Grant Edwards <[EMAIL PROTECTED]> wrote: >> On 2008-03-20, jmDesktop <[EMAIL PROTECTED]> wrote: >> >>> Hi, I'm trying to learn Python. I using Aquamac an emac >>> implementation with mac os x. I have a program. If I go to the >>> command prompt and type py

Re: wxFormBuilder

2008-03-20 Thread DoxaLogos
On Mar 20, 8:41 am, sturlamolden <[EMAIL PROTECTED]> wrote: > I just discovered wxFormBuilder. After having tried several GUI > builders for wx (including DialogBlocks, wxGlade, XRCed, Boa > constructor), this is the first one I can actually use. > > To use it wxFormBuilder with wxPython, I generat

Re: Can I run a python program from within emacs?

2008-03-20 Thread Paulo da Costa
Jeff Schwab wrote: > jmDesktop wrote: >> On Mar 20, 11:21 am, Grant Edwards <[EMAIL PROTECTED]> wrote: >>> On 2008-03-20, jmDesktop <[EMAIL PROTECTED]> wrote: >>> Hi, I'm trying to learn Python. I using Aquamac an emac implementation with mac os x. I have a program. If I go to the

Re: Can I run a python program from within emacs?

2008-03-20 Thread jmDesktop
On Mar 20, 11:44 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: > jmDesktop wrote: > > On Mar 20, 11:21 am, Grant Edwards <[EMAIL PROTECTED]> wrote: > >> On 2008-03-20, jmDesktop <[EMAIL PROTECTED]> wrote: > > >>> Hi, I'm trying to learn Python.  I using Aquamac an emac > >>> implementation with mac os

Re: Can I run a python program from within emacs?

2008-03-20 Thread Grant Edwards
On 2008-03-20, jmDesktop <[EMAIL PROTECTED]> wrote: > On Mar 20, 11:21 am, Grant Edwards <[EMAIL PROTECTED]> wrote: >> On 2008-03-20, jmDesktop <[EMAIL PROTECTED]> wrote: >> >> > Hi, I'm trying to learn Python.  I using Aquamac an emac >> > implementation with mac os x.  I have a program.  If I go

Re: Can I run a python program from within emacs?

2008-03-20 Thread Grant Edwards
On 2008-03-20, Jeff Schwab <[EMAIL PROTECTED]> wrote: >>> http://www.google.com/search?q=emacs+python > >> Gee. Thanks. > > I believe Grant was suggesting that Emacs often serves a similar purpose > on Unix to what Visual Studio does on Windows, which seemed to be what > you were asking. When

pep 3108

2008-03-20 Thread Daniel Fetchinson
Hi Brett, I've just looked through pep 3108 and since Raymond Hettinger suggested contacting you if we "have issues with it", here it goes: I don't think it would be a great idea to move tkinter from the core to a third party library because once that happens we can no longer assume that any GUI

if __name__ == '__main__':

2008-03-20 Thread Bhagwat Kolde
Hi, I am new to the python and not getting meaning of following line, if __name__ == '__main__': main() Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can I run a python program from within emacs?

2008-03-20 Thread Grant Edwards
On 2008-03-20, jmDesktop <[EMAIL PROTECTED]> wrote: >> I believe Grant was suggesting that Emacs often serves a >> similar purpose on Unix to what Visual Studio does on Windows, >> which seemed to be what you were asking.  When asking about >> Mac OS X here, you are likely to get a lot of generic

RE: paramiko

2008-03-20 Thread Tarun Kapoor
I have some code that uses paramiko, establishes an SFTP connection with a remote server and downloads some files. This code works perfect if run on a windows XP machine. However, I get an error in the "RandomPool" class. Anyone tried paramiko on a windows server box ? Thanks !! Tk -Original

Re: Pycon disappointment

2008-03-20 Thread atom . anderson
On Mar 17, 1:20 am, Paul Rubin wrote: > Stephan Deibel <[EMAIL PROTECTED]> writes: > > I have to admit, I'll keep coming to PyCon even if all the talks suck > > abysmally as long as there's good hallway time, open space, BoFs, and > > sprints. ;-) > > OK, so why not get r

Re: if __name__ == '__main__':

2008-03-20 Thread Simon Brunning
On Thu, Mar 20, 2008 at 4:12 PM, Bhagwat Kolde <[EMAIL PROTECTED]> wrote: > Hi, > I am new to the python and not getting meaning of following line, > > if __name__ == '__main__': > main() -- Cheers, Simon B.

OS.remove and threads

2008-03-20 Thread rodmc
Hi, I am writing a small application which uploads files in a thread via an ftp connection. However anytime I use the os.remove(filename) command to delete files the thread crashes, even if the file being removed has nothing to do with the one being uploaded. Are the OS commands incompatible with

Re: wxFormBuilder

2008-03-20 Thread Stef Mientki
sturlamolden wrote: > I just discovered wxFormBuilder. After having tried several GUI > builders for wx (including DialogBlocks, wxGlade, XRCed, Boa > constructor), this is the first one I can actually use. > > To use it wxFormBuilder with wxPython, I generated an xrc resource and > loaded it with

Re: Can I run a python program from within emacs?

2008-03-20 Thread Diez B. Roggisch
Grant Edwards wrote: > On 2008-03-20, Jeff Schwab <[EMAIL PROTECTED]> wrote: > http://www.google.com/search?q=emacs+python >> >>> Gee. Thanks. >> >> I believe Grant was suggesting that Emacs often serves a similar purpose >> on Unix to what Visual Studio does on Windows, which seemed to be

Re: if __name__ == '__main__':

2008-03-20 Thread Michael Wieher
Well, consider this: you have a file named .py, built like this: ~ #!/usr/bin/python def : return if __name__=="__main__": print "Unit test" else: pass #module imported by another module/script ~~ If you type, on command line, >pytho

Re: Problem with PARAGRAPH SEPARATOR

2008-03-20 Thread Richard Brodie
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Would that mean that the string "myString" is an ascii-string or what? It would mean it was a byte encoded string already, yes. When you try to encode it, Python tries to coerce it to Unicode and it's equivalent to: myString.decode(

Import a file to namespace

2008-03-20 Thread Pedro Machado Santa
Hi all, I'm really a newbie in Python, and I wanted to do a tricky thing. I don't know if it is possible but my intention was: I have a package (namely breve) and I want to alter (override?) some of it's functions preserving the original library/package - in order if I update it, I do not lose my

Re: Pycon disappointment

2008-03-20 Thread atom . anderson
Okay! I just read this entire thread to be caught up. I am a first time PyCon-goer (as my previous post states). Because I have nothing to compare this year's experience to, I'll give it to you as I saw it. None of this is intended as a rant, (except maybe the lightning talk section;) Gripes --

Re: Can I run a python program from within emacs?

2008-03-20 Thread Jeff Schwab
Paulo da Costa wrote: > People who say Emacs often mean GNU Emacs. That's funny; to me, Emacs usually means XEmacs. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Can I run a python program from within emacs?

2008-03-20 Thread Jeff Schwab
Grant Edwards wrote: > On 2008-03-20, Jeff Schwab <[EMAIL PROTECTED]> wrote: > http://www.google.com/search?q=emacs+python >>> Gee. Thanks. >> I believe Grant was suggesting that Emacs often serves a similar purpose >> on Unix to what Visual Studio does on Windows, which seemed to be what

Re: wxFormBuilder

2008-03-20 Thread sturlamolden
On 20 Mar, 17:21, Stef Mientki <[EMAIL PROTECTED]> wrote: > I've tried several of the above mentioned builders, > with the same result. > I've also looked at wxFormBuilder, > but I found it far too difficult and > fully unreadable (how can you create actions/bindings on components you don't > see

zope and python 2.5.1

2008-03-20 Thread hberig
Hi, I'm sorry if this is an off-topic message, but I didn't found other group. I've read some articles about Zope, and since I like very much python, I would like to run a webserver application using Zope instead other web application server. I've difficulties to install zope 3 and zope 2 on linux

Re: Import a file to namespace

2008-03-20 Thread Jeffrey Froman
Pedro Machado Santa wrote: > import testpackage > > class testClass(): > #... > > testpackage.testClass =  testClass This method should work fine. Modules are effectively singletons, so running this code one time anywhere in your application will cause the changes to appear in all references t

Re: URLError

2008-03-20 Thread Jim
On Mar 19, 6:50 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Wed, 19 Mar 2008 14:45:39 -0700, Jim wrote: > > Program randomly aborts when looking up url. The program loop thru > > 4000+ records looking > > up ID via internet and returnshtmlcode which is used in subsequent

Re: if __name__ == '__main__':

2008-03-20 Thread 7stud
On Mar 20, 10:21 am, "Simon Brunning" <[EMAIL PROTECTED]> wrote: > On Thu, Mar 20, 2008 at 4:12 PM, Bhagwat Kolde <[EMAIL PROTECTED]> wrote: > > Hi, > > I am new to the python and not getting meaning of following line, > > > if __name__ == '__main__': > >       main() > The if statement is used to

Re: zope and python 2.5.1

2008-03-20 Thread Diez B. Roggisch
hberig wrote: > Hi, > I'm sorry if this is an off-topic message, but I didn't found other > group. > I've read some articles about Zope, and since I like very much python, > I would like to run a webserver application using Zope instead other > web application server. I've difficulties to install

Re: if __name__ == '__main__':

2008-03-20 Thread Bhagwat Kolde
Thanks all my problem cleared. Bhagwat On Thu, Mar 20, 2008 at 11:02 PM, 7stud <[EMAIL PROTECTED]> wrote: > On Mar 20, 10:21 am, "Simon Brunning" <[EMAIL PROTECTED]> > wrote: > > On Thu, Mar 20, 2008 at 4:12 PM, Bhagwat Kolde <[EMAIL PROTECTED]> > wrote: > > > Hi, > > > I am new to the python and

Re: os.path.getsize() on Windows

2008-03-20 Thread Sean DiZazzo
On Mar 20, 6:42 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > On Wed, 19 Mar 2008 12:34:34 +, Duncan Booth wrote: > >> By default Python on Windows allows you to open a file for reading > >> unless you specify a sharing mode which prevents it: > >

Re: Import a file to namespace

2008-03-20 Thread Pedro Machado Santa
On Mar 20, 5:24 pm, Jeffrey Froman <[EMAIL PROTECTED]> wrote: > This method should work fine. Modules are effectively singletons, so running > this code one time anywhere in your application will cause the changes to > appear in all references to the original module. Yhea. I got it now. :) It alre

Re: wxFormBuilder

2008-03-20 Thread sturlamolden
On 20 Mar, 17:21, Stef Mientki <[EMAIL PROTECTED]> wrote: > I've tried several of the above mentioned builders, > with the same result. > I've also looked at wxFormBuilder, > but I found it far too difficult and > fully unreadable (how can you create actions/bindings on components you don't > see

Re: Can I run a python program from within emacs?

2008-03-20 Thread Paulo da Costa
Jeff Schwab wrote: > Paulo da Costa wrote: > >> People who say Emacs often mean GNU Emacs. > > That's funny; to me, Emacs usually means XEmacs. :) Which is often a cause of confusion. Paulo -- http://mail.python.org/mailman/listinfo/python-list

Need help calling a proprietary C DLL from Python

2008-03-20 Thread Craig
I use a proprietary dll from Software Source (vbis5032.dll). I have successfully used it from Visual Basic 6, Fujitsu Cobol and from Perl. I would now like to use it from Python. The following is the C++ prototype for one of the functions: short FAR PASCAL VmxOpen(BSTR*Filespec,

Re: Pycon disappointment

2008-03-20 Thread Ed Leafe
On Mar 20, 2008, at 11:54 AM, [EMAIL PROTECTED] wrote: > Number Three: Too much code, not enough concept. > > Presenters this one's for you. I can't count the number of > presentations I attended where the presenter would click through three > slides of pycode just to show us a two or three-line

Re: Need help calling a proprietary C DLL from Python

2008-03-20 Thread sturlamolden
On 20 Mar, 19:09, Craig <[EMAIL PROTECTED]> wrote: The culprit i here: > Before - X = 0, CacheSize = 0, OpenMode = 3, vHandle = 0 This binds these names to Python ints, but byref expects C types. Also observe that CacheSize and OpenMode should be c_short. -- http://mail.python.org/mailman

Re: Need help calling a proprietary C DLL from Python

2008-03-20 Thread Craig
On Mar 20, 2:29 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > On 20 Mar, 19:09, Craig <[EMAIL PROTECTED]> wrote: > > The culprit i here: > > > Before - X = 0, CacheSize = 0, OpenMode = 3, vHandle = 0 > > This binds these names to Python ints, but byref expects C types. > > Also observe that CacheSi

Re: Python to C/C++

2008-03-20 Thread Dan Stromberg
On Wed, 19 Mar 2008 10:24:16 -0700, Patrick Mullen wrote: > (sorry michael, didn't mean to personal post > > On Wed, Mar 19, 2008 at 9:24 AM, Michael Wieher wrote: > > I think py2exe does this, but it might be a bit bloated > > No, py2exe basically bundles the main script and the interpreter >

Re: forkpty not working?

2008-03-20 Thread Dan Stromberg
If you google a bit, I believe you'll find one or more python modules for working with ssh. Also, if you want to roll your own, the easiest way to get around the password requirement is to use ssh passwordless authentication using DSA or RSA public/private keypairs: http://stromberg.dnsalias.

Issues with XMLTreeBuilder in cElementTree and ElementTree

2008-03-20 Thread Michael Becker
I had some xmls being output by an application whose formating did not allow for easy editing by humans so I was trying to write a short python app to pretty print xml files. Most of the data in these xml files is in the attributes so I wanted each attribute on its own line. I wrote a short app usi

Re: What Programming Languages Should You Learn Next?

2008-03-20 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: ... > I think it's easier to write complex code in Haskell because: > > 1) it has a powerful static type system that lets you express > important invariants and have them enforced at compile time. This not > only cat

Floating-point support

2008-03-20 Thread Blubaugh, David A.
Would anyone know as to how to develop floating point support for the MyHDL module? Has anyone worked with any alternative versions of the IEEE standard for floating -point? Also, has anyone developed a floating-point library for a module within the python environment in order to execute numerica

Re: Pycon disappointment

2008-03-20 Thread Greg Lindstrom
,,,... Let's see some code! Let's see > stuff working (and sometimes crashing!), and how changes affect the > results. When I've presented at PyCon and other conferences, that's > the part that I spend the most time on: preparing demonstrations. It's > not easy to do; certainly much more difficult

Re: Removal of tkinter from python 3.0? [was: Fate of the repr module inPy3.0]

2008-03-20 Thread Ron Provost
I would really hate to see Tkinter removed from 3.0. Because it's part of the distribution and extremely easy to create simple GUIs I use it all the time. Isn't Python supposed to be a "Batteries Included" language? Can that be said anymore without a GUI library? And do we want to drop Tkint

RE: What Programming Languages Should You Learn Next?

2008-03-20 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Donn Cave > Sent: Thursday, March 20, 2008 3:39 PM > To: python-list@python.org > Subject: Re: What Programming Languages Should You Learn Next? > > > Worth repeating. > > One of the perhaps s

Haskell vs ??

2008-03-20 Thread Michael Wieher
Just to help clear up my own understanding of this discussion, this is basically a language that obfuscates details and makes low-level decisions in a "average-best" way, and thus allows for lazy people to write kind of decent code quickly? -- http://mail.python.org/mailman/listinfo/python-list

Re: A question about a metacharacter

2008-03-20 Thread ajaksu
On Mar 20, 8:19 am, igbt <[EMAIL PROTECTED]> wrote: > However, if you don't enter anything the > script works but if you enter a dot (.) the script does not work. Have you tried it with other non-metacharacter values? > sss = entryName.get_text()      # The script gets the text >         if sss =

  1   2   >