[Idle-dev] mixing input and output lines

2009-10-28 Thread Gregor Časar
When using multithreading the your input and output can mix creating havoc.
I love IDLE and would really like to see this implemented in it. I'd code it
myself, but none of my queries told me where to apply for dev or anything
like this.

Keep up the good work,

Gregor
___
IDLE-dev mailing list
IDLE-dev@python.org
http://mail.python.org/mailman/listinfo/idle-dev


[Idle-dev] output improper

2009-10-28 Thread Mayuresh Marathe
Dear Sir,

 

I would request kind help in sorting a problem out as I am getting improper
results. I am pasting the program and its output for reference.

 

Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit (Intel)]
on win32

Type "copyright", "credits" or "license()" for more information.

>>> print ("Please give a number: ")

Please give a number: 

>>> a = input()

12

>>> Print ("And another :")

Traceback (most recent call last):

  File "", line 1, in 

Print ("And another :")

NameError: name 'Print' is not defined

>>> print ("And another: ")

And another: 

>>> b = input()

23

>>> print ("The sum of these numbers is :")

The sum of these numbers is :

>>> print (a+b)

1223

>>> print a+b

SyntaxError: invalid syntax (, line 1)

>>> print("a+b")

a+b

>>> print (a+b)

1223

>>> 

 

 

 

 

Best Regards,

Mayuresh Marathe | Manager Operations - Mumbai

Mob  (+91) 9324704490

* mayur...@omnesysindia.com

 

Nothing Is Impossible For A Willing Heart 

 

___
IDLE-dev mailing list
IDLE-dev@python.org
http://mail.python.org/mailman/listinfo/idle-dev


Re: [Idle-dev] Help needed for using IDLE under Ubuntu 8.04

2009-10-28 Thread kodazer

Same exact situation.

Ubuntu: 9.04
Python: 3.0.1 (also 2.6 installed)
IDLE: 3.0.1
TK: 8.5


kay2008 wrote:
> 
> got any clue yet? I encountered the same problem under Ubuntu 8.10, I
> think the problem is with the call tip, that is the small box poped up
> giving you a tip with regarding to the arguments expected when you type a
> function. The problem occur not only when you type the closing
> parenthesis, in fact, whatever you type, once the call tip box disappear,
> the problem arise.
> Ubuntu: 8.10 Chinese Mainland
> Python: 2.6
> IDLE: 2.6
> TK:8.4
> 

-- 
View this message in context: 
http://www.nabble.com/Help-needed-for-using-IDLE-under-Ubuntu-8.04-tp17903673p26088900.html
Sent from the Python - idle-dev mailing list archive at Nabble.com.

___
IDLE-dev mailing list
IDLE-dev@python.org
http://mail.python.org/mailman/listinfo/idle-dev


Re: [Idle-dev] output improper

2009-10-28 Thread Tal Einat
Mayuresh Marathe wrote:

>  Dear Sir,
>
>
>
> I would request kind help in sorting a problem out as I am getting improper
> results. I am pasting the program and its output for reference.
>
>
>
> Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
> (Intel)] on win32
>
> Type "copyright", "credits" or "license()" for more information.
>
> >>> print ("Please give a number: ")
>
> Please give a number:
>
> >>> a = input()
>
> 12
>
> >>> Print ("And another :")
>
> Traceback (most recent call last):
>
>   File "", line 1, in 
>
> Print ("And another :")
>
> NameError: name 'Print' is not defined
>
> >>> print ("And another: ")
>
> And another:
>
> >>> b = input()
>
> 23
>
> >>> print ("The sum of these numbers is :")
>
> The sum of these numbers is :
>
> >>> print (a+b)
>
> 1223
>
> >>> print a+b
>
> SyntaxError: invalid syntax (, line 1)
>
> >>> print("a+b")
>
> a+b
>
> >>> print (a+b)
>
> 1223
>
> >>>
>

Hello Mayuresh,

In version 3.0 and above of Python, the input() function always returns a
string. To get what you want, pass the strings returned by input() into the
int() function in order to convert them to integers, for example:

>>> a = int(input())

In your above example, both 'a' and 'b' are variables referring to strings,
not numbers. In Python, "adding" strings means concatenation, for example
"abc" + "ecf" will become the string "abcdef", and similarly "12" + "23"
becomes "1223". On the other hand, 12 + 23 becomes 35, since 12 and 23 are
integers (whole numbers).


It is useful to just write the name of a variable and then enter in the
shell, which prints that variable's representation. For example:

>>> a = "12"
>>> b = 12
>>> a
'12'
>>> b
12

>From the output above you can see that the variable 'a' refers to a string,
while the variable 'b' refers to an integer.


Finally, this mailing list is for the discussion of IDLE itself. While I'm
happy to help, general Python questions such as this are better directed to
other places, where you will get more answer more quickly. See
http://wiki.python.org/moin/BeginnersGuide, and specifically
http://wiki.python.org/moin/BeginnersGuide/Help, for details on good places
to get help for beginning with Python. I highly recommend posting on the
comp.lang.python newsgroup, and searching there since answers to most Python
questions are already there!


Good luck!

- Tal
___
IDLE-dev mailing list
IDLE-dev@python.org
http://mail.python.org/mailman/listinfo/idle-dev


Re: [Idle-dev] mixing input and output lines

2009-10-28 Thread Tal Einat
Gregor Časar wrote:

> When using multithreading the your input and output can mix creating havoc.
>
> I love IDLE and would really like to see this implemented in it. I'd code
> it myself, but none of my queries told me where to apply for dev or anything
> like this.
>
> Keep up the good work,
>
> Gregor


Hi Gregor,

You've come to the right place if you want to try improving IDLE, since this
is the mailing list for IDLE developers and maintainers.

If you can implement it yourself, then you can submit a patch to the main
Python issue tracker at bugs.python.org (don't forget to tag it with the
"IDLE" category and also write IDLE in the subject). But it would be better
to first explain the feature here to make sure that there is interest, to
make sure that your effort doesn't go to waste.

I couldn't understand the feature you are suggesting is. Care to explain in
more detail, perhaps with examples?

- Tal
___
IDLE-dev mailing list
IDLE-dev@python.org
http://mail.python.org/mailman/listinfo/idle-dev