Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #21206 > unrolled thread

Is this the right location to launch IDLE?

Started byJohn Salerno <johnjsal@gmail.com>
First post2012-03-04 15:07 -0800
Last post2012-03-04 21:00 -0800
Articles 7 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  Is this the right location to launch IDLE? John Salerno <johnjsal@gmail.com> - 2012-03-04 15:07 -0800
    Re: Is this the right location to launch IDLE? Chris Rebert <clp2@rebertia.com> - 2012-03-04 18:53 -0800
    Re: Is this the right location to launch IDLE? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-03-04 22:33 -0500
    Re: Is this the right location to launch IDLE? John Salerno <johnjsal@gmail.com> - 2012-03-04 19:51 -0800
      Re: Is this the right location to launch IDLE? Chris Rebert <clp2@rebertia.com> - 2012-03-04 20:07 -0800
        Re: Is this the right location to launch IDLE? John Salerno <johnjsal@gmail.com> - 2012-03-04 21:00 -0800
        Re: Is this the right location to launch IDLE? John Salerno <johnjsal@gmail.com> - 2012-03-04 21:00 -0800

#21206 — Is this the right location to launch IDLE?

FromJohn Salerno <johnjsal@gmail.com>
Date2012-03-04 15:07 -0800
SubjectIs this the right location to launch IDLE?
Message-ID<1902734.303.1330902461168.JavaMail.geo-discussion-forums@yncd8>
I'm trying to get Notepad++ to launch IDLE and run the currently open file in IDLE, but all my attempts have failed so far. I'm wondering, am I even using the IDLE path correctly? I'm using this:

"C:\Python32\Lib\idlelib\idle.pyw" "$(FULL_CURRENT_PATH)"

(That last part puts in the full path to the open file.)

Is this not the proper way to launch IDLE with an argument? It actually does open up IDLE, but the file doesn't seem to have been loaded, because when I try to use variables or functions from the file, IDLE acts as if it doesn't know what I'm referring to.

Thanks.

[toc] | [next] | [standalone]


#21215

FromChris Rebert <clp2@rebertia.com>
Date2012-03-04 18:53 -0800
Message-ID<mailman.394.1330916040.3037.python-list@python.org>
In reply to#21206
On Sun, Mar 4, 2012 at 3:07 PM, John Salerno <johnjsal@gmail.com> wrote:
> I'm trying to get Notepad++ to launch IDLE and run the currently open file in IDLE, but all my attempts have failed so far. I'm wondering, am I even using the IDLE path correctly? I'm using this:
>
> "C:\Python32\Lib\idlelib\idle.pyw" "$(FULL_CURRENT_PATH)"
>
> (That last part puts in the full path to the open file.)
>
> Is this not the proper way to launch IDLE with an argument?

Correct. According to IDLE's USAGE message, you want the "-r" option,
which would make your desired command:
    "C:\Python32\Lib\idlelib\idle.pyw" -r "$(FULL_CURRENT_PATH)"

> It actually does open up IDLE, but the file doesn't seem to have been loaded, because when I try to use variables or functions from the file, IDLE acts as if it doesn't know what I'm referring to.

Cheers,
Chris
--
http://rebertia.com

[toc] | [prev] | [next] | [standalone]


#21216

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2012-03-04 22:33 -0500
Message-ID<mailman.395.1330918401.3037.python-list@python.org>
In reply to#21206
On Sun, 4 Mar 2012 15:07:41 -0800 (PST), John Salerno
<johnjsal@gmail.com> declaimed the following in
gmane.comp.python.general:

> I'm trying to get Notepad++ to launch IDLE and run the currently open file in IDLE, but all my attempts have failed so far. I'm wondering, am I even using the IDLE path correctly? I'm using this:
> 
> "C:\Python32\Lib\idlelib\idle.pyw" "$(FULL_CURRENT_PATH)"
> 
> (That last part puts in the full path to the open file.)
> 
> Is this not the proper way to launch IDLE with an argument? It actually does open up IDLE, but the file doesn't seem to have been loaded, because when I try to use variables or functions from the file, IDLE acts as if it doesn't know what I'm referring to.
> 
	What happens if you specify

	"C:\Python32\pythonw.exe" "C:\....\idle.pyw" "$...."

	I seem to recall that Windows has problems passing command line
arguments when it goes through two layers of invocation (ie: your file
is an argument to idle.pyw, the file associations make idle.pyw an
argument to some other program instead.
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [next] | [standalone]


#21217

FromJohn Salerno <johnjsal@gmail.com>
Date2012-03-04 19:51 -0800
Message-ID<676893.2385.1330919478888.JavaMail.geo-discussion-forums@vbux23>
In reply to#21206
Unfortunately neither method worked. Adding "-r" to the path created this error when I tried it:

>>> 
*** Error in script or command!

Traceback (most recent call last):
  File "C:\Users\John\Documents\Python Scripts\chess_pieces.py", line 1
    class ChessPiece:
              ^
SyntaxError: invalid character in identifier
>>> 

Although there really is no error in the file, and running it directly from within IDLE doesn't cause this problem.

Adding the "pythonw.exe" part to the beginning also gave this error, but when I remove the "-r", then it just opens IDLE as normal, but without having loaded the Notepad++ file.

I just know there has to be a way to do this, but perhaps it's more of an NP++ problem. I posted on their forums but no one responded. I thought I might see if the problem lies with calling IDLE, but apparently it's a Windows/NP++ thing...

[toc] | [prev] | [next] | [standalone]


#21218

FromChris Rebert <clp2@rebertia.com>
Date2012-03-04 20:07 -0800
Message-ID<mailman.396.1330920442.3037.python-list@python.org>
In reply to#21217
On Sun, Mar 4, 2012 at 7:51 PM, John Salerno <johnjsal@gmail.com> wrote:
> Unfortunately neither method worked. Adding "-r" to the path created this error when I tried it:
>
>>>>
> *** Error in script or command!
>
> Traceback (most recent call last):
>  File "C:\Users\John\Documents\Python Scripts\chess_pieces.py", line 1
>    ï»¿class ChessPiece:

That would be a Notepad++ problem. That "" gibberish is what you
get when a Unicode BOM (Byte Order Mark) character is encoded as UTF-8
but decoded as ISO-8859-1 or CP-1252. A BOM is not recommended for
UTF-8 text; there should be some setting in Notepad++ to suppress it.

Cheers,
Chris

[toc] | [prev] | [next] | [standalone]


#21219

FromJohn Salerno <johnjsal@gmail.com>
Date2012-03-04 21:00 -0800
Message-ID<mailman.397.1330923659.3037.python-list@python.org>
In reply to#21218
> That would be a Notepad++ problem. That "" gibberish is what you
> get when a Unicode BOM (Byte Order Mark) character is encoded as UTF-8
> but decoded as ISO-8859-1 or CP-1252. A BOM is not recommended for
> UTF-8 text; there should be some setting in Notepad++ to suppress it.

You are my new hero! :) It works perfectly now!

I set the default for files to be UTF-8 without BOM, and I also checked the option that said "Apply to opened ANSI files." Is that okay?

Thank you!!!

[toc] | [prev] | [next] | [standalone]


#21220

FromJohn Salerno <johnjsal@gmail.com>
Date2012-03-04 21:00 -0800
Message-ID<23665576.3009.1330923650131.JavaMail.geo-discussion-forums@ynjd19>
In reply to#21218
> That would be a Notepad++ problem. That "" gibberish is what you
> get when a Unicode BOM (Byte Order Mark) character is encoded as UTF-8
> but decoded as ISO-8859-1 or CP-1252. A BOM is not recommended for
> UTF-8 text; there should be some setting in Notepad++ to suppress it.

You are my new hero! :) It works perfectly now!

I set the default for files to be UTF-8 without BOM, and I also checked the option that said "Apply to opened ANSI files." Is that okay?

Thank you!!!

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web