Re: [Tutor] What Editori?

2010-02-24 Thread Mike
I use and love Pyscripter for Windows. I guess I am used to the Delphi IDE. Mike On Tue, Feb 23, 2010 at 11:24 AM, Giorgio wrote: > Hi All, > what text-editor do you use for python? > I've always used kate/nano on Linux and Notepad++/PSPad on Win. Today i've > installe

[Tutor] string formatting

2012-10-24 Thread Mike
I'm in the process of learning python and migrating away from bash scripting. I'm in the process of converting my bash scripts that essentially ssh to another host via shared keys, execute commands remotely, and exit. To do this I started using paramiko but eventually decided to do it w/ subpro

[Tutor] unittest not working

2015-11-19 Thread Mike
I'm trying to unit test a self-built regular expression processor for an assignment. I'm trying to set up unit tests for the package, but it's not executing them. This is my first time trying to use the unittest module, so I'm sure I'm missing something, I'm just not sure what. I even put a test c

[Tutor] Better way to insert items into a list

2012-12-08 Thread Mike
ize I achieved my goal, but I was wondering what other alternates could be done to achieve the same results. Thanks in advance for your assistance. Mike. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Better way to insert items into a list

2012-12-08 Thread Mike
Thank you. Works well. Mike On Sat, Dec 8, 2012 at 4:18 PM, bob gailer wrote: > tuple(sum([list(x) for x in zip(a,[c]*len(a))],[])) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mail

[Tutor] symlinking dirs with spaces

2013-04-26 Thread mike
Hi all, I wrote a cli script for syncing my music to a USB mass storage device like a phone etc. all it does is it creates a symlink in a dir to whatever folder i pass as an argument via ./addsync DIR . My problem is i'm having trouble dealing with directories with spaces. when using os.symli

Re: [Tutor] symlinking dirs with spaces

2013-04-28 Thread mike
On 04/28/2013 12:43 PM, eryksun wrote: On Sat, Apr 27, 2013 at 9:51 PM, Dave Angel wrote: And another little-known fact -- NTFS supports hard links, or at least it did in 1995, on NT 3.5 As I recall, there wasn't support at the cmd prompt, but you could create them with system calls. NTFS h

Re: [Tutor] symlinking dirs with spaces

2013-04-28 Thread mike
On 04/28/2013 07:37 PM, Dave Angel wrote: On 04/28/2013 08:17 PM, mike wrote: def sync_new(): durFind = raw_input("Enter the duration of time in days you want to link") durFind = int(durFind) fileExcl = "*torrent*" linkNew = ['find',

Re: [Tutor] symlinking dirs with spaces

2013-04-28 Thread mike
On 04/28/2013 08:12 PM, Steven D'Aprano wrote: On 29/04/13 10:54, mike wrote: Can you elaborate on what you mean regarding the musicDir variable? I have a loadDir which specifies where the symlinks reside but the actual root of the media directory is /opt/data/music and it's org

Re: [Tutor] symlinking dirs with spaces

2013-04-28 Thread mike
On 04/28/2013 08:59 PM, Dave Angel wrote: On 04/28/2013 08:54 PM, mike wrote: On 04/28/2013 07:37 PM, Dave Angel wrote: On 04/28/2013 08:17 PM, mike wrote: def sync_new(): durFind = raw_input("Enter the duration of time in days you want to link") durFind = i

Re: [Tutor] Python 2.4 IDLE Windows 2000

2004-12-03 Thread Mike Hansen
normally. I'll set up the color theme later. Maybe older color themes aren't compatible with the newer IDLE? The color theme must have been laying around. I didn't brute force it in or anything like that. I appreciate the help. Mike Danny Yoo wrote: Yowza; that's some

[Tutor] Socket events and wxPython events?

2004-12-05 Thread Mike Eve
little confused about what a wxPython compatible event is. I'm not sure if these events and their event handling are part of Python or something added by  and unique to wxPython.   Thanks, Mike ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python 2.4 IDLE Windows 2000

2004-12-07 Thread Mike Hansen
Danny Yoo wrote: On Fri, 3 Dec 2004, Mike Hansen wrote: That rooted out the problem. A while ago, I changed the colors to kind of match my VIM color theme(ps_color). When I did idlelib.PyShell.main(), IDLE came up with my custom color theme. However, there was a bunch of warnings about my theme

[Tutor] Variable declaration

2010-02-05 Thread Hansen, Mike
in Python by using Pyflakes to check my code and catch those silly mis-spelling of a variable. Mike ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tutor list as pair progamming plush toy

2010-02-12 Thread Hansen, Mike
e > without the tutors even knowing it. > > Does anybody else experience the same? > > Cheers, :) > Mac. > This kind of sounds like the rubber duck method of debugging. http://lists.ethernal.org/oldarchives/cantlug-0211/msg00174.html Mike

Re: [Tutor] The Order of Imports and install order of modules andother matters (XP vs W7, ...)

2010-02-16 Thread Hansen, Mike
mports > application-specific imports > > Within each group I tend to group "import x" imports before "from x > import y" imports and alphabetize by module name. I'm not strict about > that though. > This make me wonder. Is there a document or web

Re: [Tutor] The Order of Imports and install order of modules andother matters (XP vs W7, ...)

2010-02-16 Thread Hansen, Mike
From: sri...@gmail.com [mailto:sri...@gmail.com] On Behalf Of Wayne Werner Sent: Tuesday, February 16, 2010 1:07 PM To: Hansen, Mike Cc: Tutor Python Subject: Re: [Tutor] The Order of Imports and install order of modules

Re: [Tutor] The Order of Imports and install order ofmodulesandother matters (XP vs W7, ...)

2010-02-17 Thread Hansen, Mike
> -Original Message- > [mailto:tutor-bounces+mike.hansen=atmel@python.org] On > Behalf Of Alan Gauld > Sent: Tuesday, February 16, 2010 5:58 PM > > "Hansen, Mike" wrote > > > I'm aware of Pep8. It's a good starting point. Anything

Re: [Tutor] What Editori?

2010-02-24 Thread Hansen, Mike
hat people need. For those that don't want the steep learning curve of VIM or Emacs, I'd recommend KOMODO. Mike No, I don't work for ActiveState. =) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription option

Re: [Tutor] Bowing out

2010-03-03 Thread Hansen, Mike
hanks to everyone who contributes questions and answers. I learned a > lot from my participation here. > > So long and keep coding! > Kent We know what's really going on. You are moving to Ruby Tutor. =) Good luck with your "something new", and thanks for the many yea

Re: [Tutor] Recommendations on Workshops, Courses, Live Online Training

2010-03-12 Thread Hansen, Mike
correct > venue to put that > sort of information. Guidance please. :) > > -Tino > > > If you have a pile of $ that you don't know what to do with, or if your company has deep pockets, then Big Nerd Ranch sounds like fun. http://www.bignerdranch.com/classes/python Mike ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] How do I find information about a Python object.

2010-03-30 Thread Mike Baker
tried subprocess.__doc__ and subprocess.Popen.__doc__. Random Googling shows that there are things like process identification numbers available - such as proc.pid. How do I find the other options? Thanks, Mike ___ Tutor maillist - Tutor@python.o

[Tutor] Remote access from Windows PC to a Linux box

2010-03-30 Thread Mike Baker
ss.PIPE, stdout=subprocess.PIPE, ) #Either of the next two commands cause window to hang #proc.stdin.write("dir") #(stdout_value, stderr_value) = proc.communicate(input="dir")[0] return proc Thanks, Mike __

Re: [Tutor] Python Examples of processing MS Outlook

2010-04-20 Thread Hansen, Mike
k at Python COM. Another problem with Outlook is that it has some security that prevents other programs from controlling it in response to various virus attacks. I think there's a way around it. Mike ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Remote access from Windows PC to a Linux box

2010-04-21 Thread Mike Baker
#x27;, '-T', 'text', '-V','>', 'out.txt']; print "The command list you are sending to the subprocess is: \n", "\t", CMD_LIST PIPE = subprocess.PIPE p = subprocess.Popen(CMD_LIST, stdout=PIPE, stderr=PIPE) stdout, stderr = p.communicate () print 'stdout = ', stdout

Re: [Tutor] Remote access from Windows PC to a Linux box

2010-04-21 Thread Mike Baker
Yashwin, Thanks! Your nohup redirection worked great! - Mike On Wed, Apr 21, 2010 at 2:45 PM, Yashwin Kanchan wrote: > Hi Mike > > have you tried running the tshark process in the background... > > *CMD_LIST=[PLINK,sess_name,'/usr/bin/sudo /usr/sbin/tshark &'

[Tutor] Fwd: for loop results into list

2010-09-05 Thread Mike Beatty
Should have sent this to the list too -- Forwarded message -- From: Micheal Beatty Date: Sun, Sep 5, 2010 at 2:38 PM Subject: Re: [Tutor] for loop results into list To: Andre Engels  On 09/05/2010 02:16 PM, Andre Engels wrote: > > On Sun, Sep 5, 2010 at 8:51 PM, Micheal Beatty

[Tutor] Can't figure out why this is printing twice

2009-06-08 Thread Mike Hoy
I have the following code: import gzip import datetime date = datetime.date.today() name = date.strftime('%m-%d-%Y')+'.gz' date.strftime('%m-%d-%Y')+'.gz' print "The name of the file will be", name the output is: The name of the file will be The name of the file will be 06-08-2009.gz I can't fi

Re: [Tutor] Can't figure out why this is printing twice

2009-06-09 Thread Mike Hoy
On Tue, Jun 9, 2009 at 3:00 AM, Mike Hoy wrote: > Here's the screenshot: > > http://img40.imageshack.us/img40/7124/printtwice.png > > In case the image goes down here's the code: > import gzip > import datetime > date = datetime.date.today() > name = date.st

Re: [Tutor] Can't figure out why this is printing twice

2009-06-09 Thread Mike Hoy
> > On Tue, Jun 9, 2009 at 6:34 AM, The Green Tea Leaf < > thegreenteal...@gmail.com> wrote: > >> I got an email from him that he had a gzip.pyc file in that folder. >> Once he deleted that everything works OK. > > > Heh... I think I've made that mistake before; > > "My import statement doesn't wor

Re: [Tutor] Best Python Editor

2009-06-13 Thread Mike Hoy
Try out Vim. It may take you a week to get used to it. Best thing I ever did was finally get started on Vim. Once I got used to it I was very happy. Google around for Vim tutorials. There is a #VIM channel on freenode I believe. There is also a VIM mailing list that is very helpful. You won't need

Re: [Tutor] Best Python Editor

2009-06-13 Thread Mike Hoy
> > > > I really like using F5 to run my code, so you can put in your .vimrc so you > don't have to type it, or just type it every time: > > map :!python % > > and every time you hit it will run your current script. > > Thanks for that. It's even better than typing :!python % because it doesn't s

[Tutor] Python List Help

2009-10-19 Thread Mike Sweany
Hi all, I am a PHP developer that just started learning Python for a specific application and the transition has been pretty easily assisted by google, but I just don’t see the issue with this one? I’ve got a list that created and populate in a loop that shows the correct info when I print

Re: [Tutor] Python List Help

2009-10-19 Thread Mike Sweany
hon works as I was plugging along on this script with just a couple of hours into python for this scraping project, but what you have shown me here will help and I will come back to the list after I have a better understanding of what I am doing. Thanks, Mike -Original Message- From: Dav

[Tutor] atof error

2005-01-11 Thread Mike Procario
I got an unexpected error today using string.atof. ValueError: invalid literal for float(): -17,019.797 To me -17,019.797 looks like a perfectly good floating point number. I cannot find documentation on what the allowed range is. -- Mike Procario "Another casualty of applied metaph

Re: [Tutor] Objects, persistence & getting

2005-01-17 Thread Mike Hansen
s Python does! Alan G. I've been reading The Object Oriented Thought Process, and it's been clearing up the OOP mystery for me. After reading a big chunk of it, I re-read the OOP sections in Learning Python. It's making a lot more sense now. Mike ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Matching with beginning of the line in the character set

2005-02-01 Thread Mike Bell
zero-length, which doesn't make sense in the context of []. Brackets aren't shorthand for "'or' a bunch of small things together" but rather "'or' a bunch of these single-character matches together" mike On Tue, 1 Feb 2005 13:30:44 -0500, Smi

Re: [Tutor] i have a question???

2005-02-03 Thread Mike Bell
;>> math.pi 3.1415926535897931 >>> math.pi / 6 0.52359877559829882 >>> type(math.pi) >>> type(6) >>> type(6.0) mike On Thu, 3 Feb 2005 16:04:25 -0500, Jacob S. <[EMAIL PROTECTED]> wrote: > >From what I understand, range() no longer allows you t

Re: [Tutor] manipulating a file

2005-02-07 Thread Mike Bell
without the explicit newlines in file.write(i), could it be that the file was closed before the write buffer was ever flushed? mike On Mon, 7 Feb 2005 14:58:03 -0500, Smith, Jeff <[EMAIL PROTECTED]> wrote: > -Original Message- > From: Alan Gauld [mailto:[EMAIL PROTECTED] &g

Re: [Tutor] python's default argument value handling in functions - weird syntax? problem grappling with the concept

2005-02-09 Thread Mike Bell
be empty when the default arguments are being evaluated), that same object is used every time the function is called. mike ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] newbie OSX module path question

2005-02-14 Thread Mike Hall
I'm on OS X, and I cannot get Python to import modules I've saved. I have created the the environment.plist file and appended it with my desired module path. If I print sys.path from the interpreter, my new path does indeed show up as the first listing, yet any attempt at importing modules from

Re: [Tutor] newbie OSX module path question

2005-02-14 Thread Mike Hall
Hm, so if I import glob, and then execute this line: print glob.glob('/Local_HD/Users/mike/Documents/pythonModules/*.py') I simply get brackets returned: [] ...not sure what this means. Thanks again. On Feb 14, 2005, at 5:41 PM, Danny Yoo wrote: On Mon, 14 Feb 2005, Mike Hall wrot

Re: [Tutor] newbie OSX module path question

2005-02-14 Thread Mike Hall
Ok, I've got it working. The environment.plist file wants a path beginning with /Users, not /Local_HD. So simple! Thanks everyone. On Feb 14, 2005, at 6:26 PM, David Rock wrote: * Mike Hall <[EMAIL PROTECTED]> [2005-02-14 18:22]: Hm, so if I import glob, and then execute this

Re: [Tutor] Help with error handling in a while loop

2005-02-18 Thread Mike Bell
I haven't tried the code, but it looks like you need to increment on connection failures, too. I think it's more pythonic to iterate over a range, as in the following for test_port in range(start_port, end_port) but it would suffice to just move the start_port+=1 outside of the try _

Re: [Tutor] Time Controlled Execution

2005-02-21 Thread Mike Bell
On Windows it looks like msvcrt will give you a non-blocking terminal read -- on mac / *nix systems it looks a little trickier: http://mail.python.org/pipermail/pythonmac-sig/2004-February/010140.html The os module in windows doesn't even have O_NONBLOCK. That seems like trouble. m On Sun, 20

Re: [Tutor] threads

2005-02-25 Thread Mike Bell
rency without worrying about what happens in real-time. Then you can have arbitrarily many things happening at once. This introduction to discrete event simulation explains the idea: http://www.dmem.strath.ac.uk/~pball/simulation/simulate.html mike ___

[Tutor] gensuitemodule?

2005-02-25 Thread Mike Hall
I'm seeing it used in a Python/Applescript tutorial, though am unclear on it's exact purpose or usage. Can someone fill me in? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Re: Newbie question.

2005-03-04 Thread Mike Hansen
have done some basic web programming in other languages, then ignore this message. Mike ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] regular expression question

2005-03-08 Thread Mike Hall
I'd like to get a match for a position in a string preceded by a specified word (let's call it "Dog"), unless that spot in the string (after "Dog") is directly followed by a specific word(let's say "Cat"), in which case I want my match to occur directly after "Cat", and not "Dog." I can easily get

Re: [Tutor] regular expression question

2005-03-08 Thread Mike Hall
; x1 = re.compile(r'(dog)(cat)?') >>> rep1 = x1.sub("REPLACE", str1) >>> rep2 = x2.sub("REPLACE", str2) >>> print rep1 The REPLACE chased the car >>> print rep2 The REPLACE cat parade was under way ...what I'm looking for is a matc

Re: [Tutor] regular expression question

2005-03-08 Thread Mike Hall
: (?<=cat) ...but ONLY if "cat" is following "dog." If "dog" does not have "cat" following it, then I simply want this: (?<=dog) ...if that makes sense :) thanks. On Mar 8, 2005, at 6:05 PM, Danny Yoo wrote: On Tue, 8 Mar 2005, Mike Hall wrote: I&#x

Re: [Tutor] regular expression question

2005-03-08 Thread Mike Hall
Sorry, my last reply crossed this one (and yes, I forgot again to CC the list). I'm experimenting now with your use of the "or" operator( "|") between two expressions, thanks. On Mar 8, 2005, at 6:42 PM, Danny Yoo wrote: On Tue, 8 Mar 2005, Mike Hall wrote: Yes, my

Re: [Tutor] regular expression question

2005-03-09 Thread Mike Hall
the same result if I put "A" and "B" within the same group. On Mar 8, 2005, at 6:47 PM, Danny Yoo wrote: Regular expressions are a little evil at times; here's what I think you're thinking of: ### import re pattern = re.compile(r"""dog(?!cat) ...

Re: [Tutor] regular expression question

2005-03-09 Thread Mike Hall
Indeed I do: >>> import re >>> x = re.compile('A|B') >>> s = " Q A R B C" >>> r = x.sub("13", s) >>> print r Q 13 R 13 C On Mar 9, 2005, at 12:09 PM, Liam Clarke wrote: Hi Mike, Do you get the same results for a se

Re: [Tutor] regular expression question

2005-03-09 Thread Mike Hall
should be (A) | (^B) Hope it helps! On Wed, 9 Mar 2005 11:11:57 -0800, Mike Hall <[EMAIL PROTECTED]> wrote: I'm having some strange results using the "or" operator. In every test I do I'm matching both sides of the "|" metacharacter, not one or the other a

Re: [Tutor] regular expression question

2005-03-09 Thread Mike Hall
u can limit substitutions using an optional argument, but yeah, it seems you're expecting it to examine the string as a whole. Check out the example here - http://www.amk.ca/python/howto/regex/ regex.html#SECTION00032 Also http://www.regular-expressions.info/alternation.html Reg

[Tutor] Code example

2005-03-12 Thread Mike Wagman
Trying to work on two programs that talk to each other - and just not getting the basics. Can someone please show me an example of two programs - you run one in console one - then when you run one in console two - it talks to the first program = sending a specific string instructing the first one

[Tutor] stopping greedy matches

2005-03-16 Thread Mike Hall
I'm having trouble getting re to stop matching after it's consumed what I want it to. Using this string as an example, the goal is to match "CAPS": >>> s = "only the word in CAPS should be matched" So let's say I want to specify when to begin my pattern by using a lookbehind: >>> x = re.compile

Re: [Tutor] stopping greedy matches

2005-03-16 Thread Mike Hall
, Liam Clarke On Wed, 16 Mar 2005 12:12:32 -0800, Mike Hall <[EMAIL PROTECTED]> wrote: I'm having trouble getting re to stop matching after it's consumed what I want it to. Using this string as an example, the goal is to match "CAPS": s = "only the word in CAPS should

Re: [Tutor] stopping greedy matches

2005-03-16 Thread Mike Hall
On Mar 16, 2005, at 5:32 PM, Sean Perry wrote: I know this does not directly help, but I have never successfully used \b in my regexs. I always end up writing something like foo\s+bar or something more intense. I've had luck with the boundary flag in relation to lookbehinds. For example, if I wa

Re: [Tutor] stopping greedy matches

2005-03-17 Thread Mike Hall
005, at 8:00 PM, Christopher Weimann wrote: On 03/16/2005-12:12PM, Mike Hall wrote: I'm having trouble getting re to stop matching after it's consumed what I want it to. Using this string as an example, the goal is to match "CAPS": s = "only the word in CAPS should be matched"

Re: [Tutor] stopping greedy matches

2005-03-17 Thread Mike Hall
On Mar 16, 2005, at 8:32 PM, Kent Johnson wrote: "in (.*?)\b" will match against "in " because you use .* which will match an empty string. Try "in (.+?)\b" (or "(?<=\bin)..+?\b" )to require one character after the space. Another working example, excellent. I'm not too clear on why the back to

Re: [Tutor] stopping greedy matches

2005-03-17 Thread Mike Hall
I don't have that script on my system, but I may put pythoncard on here and run it through that: http://pythoncard.sourceforge.net/samples/redemo.html Although regexPlor looks like it has the same functionality, so I may just go with that. Thanks. On Mar 17, 2005, at 1:31 AM, Michael Dunn wrote

Re: [Tutor] stopping greedy matches

2005-03-17 Thread Mike Hall
On Mar 17, 2005, at 11:11 AM, Kent Johnson wrote: The first one matches the space after 'in'. Without it the .+? will match the single space, then \b matches the *start* of the next word. I think I understand. Basically the first dot advances the pattern forward in order to perform a non-greedy m

Re: [Tutor] stopping greedy matches

2005-03-18 Thread Mike Hall
On Mar 18, 2005, at 9:27 AM, Christopher Weimann wrote: On 03/17/2005-10:15AM, Mike Hall wrote: Very nice sir. I'm interested in what you're doing here with the caret metacharacter. For one thing, why enclose it and the whitespace flag within a character class? A caret as

Re: [Tutor] stopping greedy matches

2005-03-18 Thread Mike Hall
On Mar 18, 2005, at 1:02 PM, Christopher Weimann wrote: On 03/18/2005-10:35AM, Mike Hall wrote: A caret as the first charachter in a class is a negation. So this [^\s]+ means match one or more of any char that isn't whitespace. Ok, so the context of metas change within a class. That makes

[Tutor] .readlines() condensing multiple lines

2005-03-22 Thread Mike Hall
Unless I'm mistaken .readlines() is supposed to return a list, where each index is a line from the file that was handed to it. Well I'm finding that it's putting more than one line of my file into a single list entry, and separating them with \r. Surely there's a way to have a one to one correl

Re: [Tutor] .readlines() condensing multiple lines

2005-03-23 Thread Mike Hall
.readlines() Or try: x = file(myFile, 'rU') for line in x: #do stuff Let us know how that goes. Regards, Liam Clarke PS Worse come to worse, you could always do - x = file(myFile, 'r').read() listX = x.split('\r') On Tue, 22 Mar 2005 17:10:43 -0800, Mi

Re: [Tutor] .readlines() condensing multiple lines

2005-03-23 Thread Mike Hall
On Mar 23, 2005, at 12:53 AM, Alan Gauld wrote: Typically what happens is you view the file in an application that autrowraps long lines so it looks like multiple lines on screen but in fact it is one long line in the file. In that case Python will only see the single long line. I'm using subEthaEd

Re: [Tutor] .readlines() condensing multiple lines

2005-03-23 Thread Mike Hall
On Mar 23, 2005, at 3:17 AM, Kent Johnson wrote: Anyway, Mike, it seems clear that your file has line endings in it which are not consistent with the default for your OS. If reading with universal newlines doesn't solve the problem, please let us know what OS you are running under and give

[Tutor] Python and Javascript

2005-03-25 Thread Mike Hall
I'm curious on whether or not JavaScript and Python can talk to each other. Specifically, can a python function be called from within a JS function? Admittedly this is probably more of a JavaScript than Python question, but I'd love to know if anyone can at least point me in a direction to res

Re: [Tutor] Python and Javascript

2005-03-25 Thread Mike Hall
done, but I imagine there are other ways. Thanks, Ryan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Hall Sent: Friday, March 25, 2005 2:18 PM To: tutor@python.org Subject: [Tutor] Python and Javascript I'm curious on whether or not JavaScri

Re: [Tutor] Python and Javascript

2005-03-25 Thread Mike Hall
On Mar 25, 2005, at 12:41 PM, Alan Gauld wrote: If you are using WSH on Windows and have the Python active scripting installed then yes. Similarly if you use IE as web browser then it can be done in a web page too. I'm on OSX, and would be doing this through Safari most likely. -MH ___

Re: [Tutor] Python and Javascript

2005-03-25 Thread Mike Hall
On Mar 25, 2005, at 1:00 PM, Ryan Davis wrote: Ok, that explains a lot, but I don't know of any easy way to do have javascript talk to python. I can think of some horrible ways to do it, though. 1. Make a python web service running locally, and build up SOAP calls or HTTP posts to it. (same as I

Re: [Tutor] Python and Javascript

2005-03-25 Thread Mike Hall
entially little html pages that do things. This got me thinking how I'd like to tie a small Python script I wrote into an html front end (ideally becoming a widget). It's looking like this may be trickier than anticipated. In any case, thanks. Hi Mike, Interesting! You probably know

Re: [Tutor] Python and Javascript

2005-03-25 Thread Mike Hall
On Mar 25, 2005, at 4:53 PM, Alan Gauld wrote: intrigued by Dashboard, which will be in the next OSX release. It allows you to create "widgets" which are essentially little html pages There is an API for Dashboard and I'm pretty sure MacPython will support it - it covers most of the cocoa type stuf

[Tutor] Launching a file browser

2005-03-28 Thread Mike Hall
I looked over the global module index and the closest thing I could find relating to my os (osx) was EasyDialogs, which has a few functions pertaining to this, "AskFileForOpen()" being one. Calling any function within EasyDialogs however yields an Apple Event error: AE.AEInteractWithUser(5000)

Re: [Tutor] Launching a file browser

2005-03-28 Thread Mike Hall
On Mar 28, 2005, at 4:24 PM, [EMAIL PROTECTED] wrote: So, you are writing a GUI app and you want some kind of open file dialog? Won't this depend on what toolkit you are using for your GUI? If you are using Tkinter (which should work on OS X, I think), try: import tkFileDialog f = tkFileDialog.a

Re: [Tutor] Launching a file browser

2005-03-31 Thread Mike Hall
On Mar 31, 2005, at 12:21 AM, Max Noel wrote: It's been too long since I used Python on MacOSX, but IIRC you can't just run a Python GUI program from the shell. Or something like that...you should ask this one on the python-mac SIG mailing list: http://www.python.org/sigs/pythonmac-sig/ Kent Yo

Re: [Tutor] Launching a file browser

2005-03-31 Thread Mike Hall
Ah, so it has to do with access to the window manager. That answers a lot, thanks. On Mar 31, 2005, at 4:09 PM, Max Noel wrote: On Apr 1, 2005, at 00:14, Mike Hall wrote: On Mar 31, 2005, at 12:21 AM, Max Noel wrote: It's been too long since I used Python on MacOSX, but IIRC you can'

Re: [Tutor] What is the best book to start?

2005-04-01 Thread Mike Hansen
hon in a Nutshell - a great 'pocket' reference and Python Programming on Win32 - but only if you are using Windows of course! You have more than enough beginner material already. Alan G. I'd also try to fit in Dive Into Python [http://diveintopython.org/].

[Tutor] Script (Python) for Zope

2005-04-03 Thread Mike Jaeger
Hello, I am looking for a Python-script for Zope which counts the objects (files) in the current folder and all its subfolders, but I don't know how to implement this script. Can somebody help me, please? Or ist there a newsgroup/mailing list which can help me to find a solution for this proble

Re: [Tutor] Launching a file browser

2005-04-04 Thread Mike Hall
On Apr 1, 2005, at 4:12 PM, Jeff Shannon wrote: At the OS level, these two actions are *completely* different. The webbrowser module launches an entirely separate program in its own independent process, where the "file browser" is opening a standard dialog inside of the current process and depende

Re: [Tutor] building strings of specific length

2005-04-04 Thread Mike Hall
You can chop off anything past 72 characters with: s2 = s[:72] On Apr 4, 2005, at 7:04 AM, Vines, John (Civ, ARL/CISD) wrote: Hello. I have a question regarding strings. How do I format a string to be a specific length? For example I need 'string1' to be 72 characters long. Thanks for your time,

[Tutor] Pychecker

2005-04-22 Thread Mike Hansen
ution? Am I missing something? Mike Go ahead and reply to me AND the list since I just get the digest. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Pychecker

2005-04-22 Thread Mike Hansen
7;s too handy to not have it in the standard distribution. Mike Danny Yoo wrote: On Fri, 22 Apr 2005, Danny Yoo wrote: In Perl, you can perl -c somehardtoreadperlprogram.pl that will just check the syntax. The above problem would have been caught in Perl since I always use strict. Is there a co

[Tutor] Use Strict or Use Warnings was ( Lists of files)

2005-05-17 Thread Mike Hansen
> > > Subject: > Re: [Tutor] Lists of files > From: > William O'Higgins <[EMAIL PROTECTED]> > Date: > Mon, 16 May 2005 15:50:37 -0400 > > [...] > > One last thing - is there an equivalent of the "use strict" and "use > war

[Tutor] Python debugger under Tiger?

2005-05-18 Thread Mike Hall
Does anyone know of a Python debugger that will run under OSX 10.4? The Eric debugger was looked at, but it's highly unstable under Tiger. Thanks.-MH___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python debugger under Tiger?

2005-05-18 Thread Mike Hall
I should of specified that I'm looking for an IDE with full debugging. Basically something like Xcode, but with Python support. On May 18, 2005, at 3:10 PM, [EMAIL PROTECTED] wrote: > Quoting Mike Hall <[EMAIL PROTECTED]>: > > >> Does anyone know of a Python debugg

[Tutor] Python debugger under Tiger?

2005-05-19 Thread Mike Hansen
> Subject: > Re: [Tutor] Python debugger under Tiger? > From: > Mike Hall <[EMAIL PROTECTED]> > Date: > Wed, 18 May 2005 15:54:18 -0700 > To: > [EMAIL PROTECTED] > > To: > [EMAIL PROTECTED] > CC: > tutor@python.org > > > I should of spec

Re: [Tutor] Python debugger under Tiger?

2005-05-19 Thread Mike Hall
Great recommendation, thanks.-MHOn May 18, 2005, at 8:12 PM, Lee Cullens wrote:Mike,You may not be looking for a commercial IDE, but I am very happy with  WingIDE and using it with Tiger.Lee COn May 18, 2005, at 6:54 PM, Mike Hall wrote: I should of specified that I'm looking for an IDE

Re: [Tutor] Filtering Spreadsheet Data

2005-05-24 Thread Mike Hansen
lf. Take a look at Advanced Filter in Help. You can essentially query a worksheet and even send the results to a different worksheet. I'd imagine that once you got the query working, you could automate it using VBA or Python. Mike ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Planning a program with algorithm?

2005-06-01 Thread Mike Hansen
To: > tutor@python.org > > > I know how to write a prog. > > But, I don't know how to plan a prog. with algorithm. [...] > > Any useful advice for algorithm would be appreciated. > > Thanks. You might want to take a look at the book Code Complete. It

[Tutor] question about "hiding" a function/method in a class

2005-06-03 Thread Mike Hansen
cript. So I started to write the Python program. - #!/usr/bin/env python """ SQLGEN takes a csv file of a database schema and writes the sql script that will create the tables and fields in the database Mike Hansen Jun 2005 """ class DBFi

Re: [Tutor] question about "hiding" a function/method in a class

2005-06-03 Thread Mike Hansen
> Subject: > Re: [Tutor] question about "hiding" a function/method in a class > From: > Kent Johnson <[EMAIL PROTECTED]> > Date: > Fri, 03 Jun 2005 09:45:20 -0400 > > CC: > tutor@python.org > > > Mike Hansen wrote: > >>

Re: [Tutor] question about "hiding" a function/method in a class

2005-06-03 Thread Mike Hansen
> > Alan G. > Can you point me to some Open Source/Free ERD programs that work with Postgre?(I'll google after I send this message.) I'd certainly would like to look at ways to do this better. Last time I looked at Visio which was Visio 2000, the ERD stuff cost extra and was very unstable. Mike ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Controlling Where My Program Ends

2005-06-15 Thread Mike Hansen
> Subject: > Re: [Tutor] Controlling Where My Program Ends > From: > Don Parris <[EMAIL PROTECTED]> > Date: > Tue, 14 Jun 2005 23:03:59 -0400 > To: > tutor@python.org > > To: > tutor@python.org > > > On Wed, 15 Jun 2005 00:59:24 - > "DC Parris" <[EMAIL PROTECTED]> wrote: > > >>Never mind.

[Tutor] loading an image into a Postgre database

2005-06-21 Thread Mike Hansen
I'm having trouble loading an image into a Postgre database. The code is below as well as the traceback in the apache log. Is something up with my sqlStatement? Do I need to use something other than %s? How can I avoid that type error? Thanks, Mike #! /usr/bin/env python import cgi

Re: [Tutor] loading an image into a Postgre database

2005-06-22 Thread Mike Hansen
Thanks Danny. That did the trick. I think I had thought about putting the variables in the execute statement, but I didn't run across any examples. I'll need to read the DB API 2.0 docs some more. Mike Danny Yoo wrote: >>Thankfully, you don't have to change much to fix the

[Tutor] getting an image out of a postgre database

2005-06-23 Thread Mike Hansen
ust be string or read-only character buffer, not instance So, rec[0] is an instance, but an instance of what? Since I needed to use the PgSQL.PgBytea method on the image before inserting it into the database, do I need to use a similar method to undo what PgBytea did to it, or am I incorrect

  1   2   3   4   >