Re: (no subject)

2020-01-06 Thread Rob Gaddi

On 1/4/20 2:29 PM, William Johnsson wrote:

Hello! My name is William and im 14 years old and live in sweden.  Im pretty 
new to programing in python and i need some help with code, (That’s why i’m 
here). But i couldn’t really find what i was searching for on the internet. I’m 
trying to write code that can check only the first line in a .txt file and 
check if it’s the same as the int 1000.   I preferably want it to be an if 
satement but anything works, i just don’t know how i should write it. I’ve been 
browsing the internet for a solution but sadly can’t seem to find a solution to 
it.

I don’t really know if this is the right way to get help or even if this email 
is for something else. Hopefully i will get some kind of response.

Best regards, William



It won't be; it can't be.  A text file contains only text.  The line you read 
from it might be the string '1000' (or more likely '1000\n', which is 4 digits 
followed by a newline character), but it cannot be the int 1000 because data has 
types.


str(1000) gives you '1000', because ints can be converted to strings. 
int('1000') gives you 1000 because and strings consisting only of digits can be 
converted to ints.  So the two types are convertible into one another.  But 
that's a thing you need to do explicitly.  If x is a thing you just read from a 
text file then


if x == 1000:

can never be true.
--
https://mail.python.org/mailman/listinfo/python-list


Re: (no subject)

2019-05-31 Thread Alister via Python-list
On Wed, 29 May 2019 08:07:06 +0530, Sri Tharun wrote:

> Why I am unable to install packages

because you are doing it wrong
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: (no subject)

2019-04-19 Thread Luuk

On 19-4-2019 16:37, Tamara Berger wrote:

Hi Python-List,

What code can I use to break out of a program completely, and not just out
of a loop? I wrote code with 3 conditions for saving for a downpayment. The
first addresses cases that don't meet the minimum condition; i.e., enough
money to save for a downpayment within the allotted time. It has its own
print line, but also executes the irrelevant print lines for the other two
conditions.

Thanks,
Tamara



cond1 = 1;
cond2 = 1;
cond3 = 1;

if cond1:
  if cond2:
if cond3:
  print("All OK")
else:
  print("cond3 NOK")
  else:
print("cond2 NOK")
else:
  print("cond1 NOK")



--
Luuk
--
https://mail.python.org/mailman/listinfo/python-list


Re: (no subject)

2019-04-19 Thread Luuk

On 19-4-2019 16:37, Tamara Berger wrote:

Hi Python-List,

What code can I use to break out of a program completely, and not just out
of a loop? I wrote code with 3 conditions for saving for a downpayment. The
first addresses cases that don't meet the minimum condition; i.e., enough
money to save for a downpayment within the allotted time. It has its own
print line, but also executes the irrelevant print lines for the other two
conditions.

Thanks,
Tamara



cond1 = 1;
cond2 = 1;
cond3 = 1;

if cond1:
  if cond2:
if cond3:
  print("All OK")
else:
  print("cond3 NOK")
  else:
print("cond2 NOK")
else:
  print("cond1 NOK")



--
Luuk
--
https://mail.python.org/mailman/listinfo/python-list


Re: (no subject)

2018-06-10 Thread Rick Johnson
sagar daya wrote:
> Couldn't install any module from pip
> Plz help???

As with most actions, an algorithm is required. (shocking, i
know!)

What methodology have you implemented thus far to achieve
your goal of "installing modules from PIP"? Please enumerate
the steps you chose to take, and then we _might_ can offer
advice.

For instance, if someone is having trouble brushing their
teeth, the first question we might ask is: "Have you located
the toothbrush and toothpaste yet?". 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: (no subject)

2018-03-27 Thread Rick Johnson
On Tuesday, March 27, 2018 at 7:19:53 AM UTC-5, kevon harris wrote:
> Unable to pull up IDLE after downloading Python 3.6.4
> 
> Sent from Mail for Windows 10

What OS?

On Windows running Python2.X, IDLE is located @ '/Python2X/Lib/idlelib/idle.pyw'
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Changing subject sucks. Re: I am fed up with Python GUI toolkits...

2011-07-20 Thread Steven D'Aprano
On Thu, 21 Jul 2011 12:34 pm Phlip wrote:

 On Jul 20, 6:17 pm, rantingrick rantingr...@gmail.com wrote:
 RE: *Ben Finney changes thread subject*

 Please everyone, do not change the subject of someone's thread because
 it's considered rude. Thank you.
 
 No it isn't. Rambling off on a new topic under the wrong subject is
 rude.


Ha ha, rantingrick lecturing others on rudeness! How cute!

Or hypocritical. Sometimes I get those two confused.


-- 
Steven

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hot subject: a good python editor and/or IDE?

2007-08-20 Thread Dave Cook
On 2007-08-19, Sébastien [EMAIL PROTECTED] wrote:

 I am currently using Eclipse+PyDev when developping Python projects but 
 I lack a fast, simple editor for tiny bit of scripts. So here is my 
 question: what is, for you, the current best ( but still kind of light! 
 ) Python editor/IDE ? A tiny precision, I am on Ubuntu so I am looking 
 for a linux compatible editor.

JED has a nice python mode for fast, simple editing.  

Dave Cook
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hot subject: a good python editor and/or IDE?

2007-08-20 Thread Grant Edwards
On 2007-08-20, Dave Cook [EMAIL PROTECTED] wrote:
 On 2007-08-19, Sébastien [EMAIL PROTECTED] wrote:

 I am currently using Eclipse+PyDev when developping Python projects but 
 I lack a fast, simple editor for tiny bit of scripts. So here is my 
 question: what is, for you, the current best ( but still kind of light! 
 ) Python editor/IDE ? A tiny precision, I am on Ubuntu so I am looking 
 for a linux compatible editor.

 JED has a nice python mode for fast, simple editing.  

I second the Jed nomination...

-- 
Grant Edwards   grante Yow! I want EARS!  I want
  at   two ROUND BLACK EARS
   visi.comto make me feel warm
   'n secure!!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hot subject: a good python editor and/or IDE?

2007-08-19 Thread Bjoern Schliessmann
Sébastien wrote:
 I am currently using Eclipse+PyDev when developping Python
 projects but I lack a fast, simple editor for tiny bit of scripts.
 So here is my question: what is, for you, the current best ( but
 still kind of light! ) Python editor/IDE ?

vim

BTW, this is an FAQ. Please look through the archives for many
threads with many, many IDEs.

Regards,


Björn

-- 
BOFH excuse #140:

LBNC (luser brain not connected)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hot subject: a good python editor and/or IDE?

2007-08-19 Thread Kevin Walzer
Sébastien wrote:
 Hi folks,
 
 I am currently using Eclipse+PyDev when developping Python projects but 
 I lack a fast, simple editor for tiny bit of scripts. So here is my 
 question: what is, for you, the current best ( but still kind of light! 
 ) Python editor/IDE ? A tiny precision, I am on Ubuntu so I am looking 
 for a linux compatible editor.
 
 Cheers,
 
 Sébastien

IDLE

-- 
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hot subject: a good python editor and/or IDE?

2007-08-19 Thread Samuel
On Sun, 19 Aug 2007 11:47:03 +0200, Sébastien wrote:

 Hi folks,
 
 I am currently using Eclipse+PyDev when developping Python projects but
 I lack a fast, simple editor for tiny bit of scripts. So here is my
 question: what is, for you, the current best ( but still kind of light!
 ) Python editor/IDE ? A tiny precision, I am on Ubuntu so I am looking
 for a linux compatible editor.

Vim with SnippetsEMU works great with Python. I made a demo of this in
action here:

http://debain.org/?p=198

Installation/configuration example on Ubuntu:

---
$ sudo apt-get install vim

$ mkdir -p $HOME/.vim/ftplugin/

$ mkdir -p $HOME/.vim/after/ftplugin/

$ wget http://www.vim.org/scripts/download_script.php?src_id=6951 -O se.vba

$ vim se.vba
:so %
:wq

$ echo setlocal sw=4
setlocal ts=4
noremap buffer LocalLeaderpy o/**CRCR/Esc
  ~/.vim/ftplugin/python.vim

$ wget 
http://code.google.com/p/snippetsemu/issues/attachment?aid=-6063627743376712928name=python_snippets.vim

$ cp python_snippets.vim $HOME/.vim/after/ftplugin/

$ echo syntax on 
set sw=2
set ts=2
set nu 
set nuw=3
set autoindent
set expandtab  $HOME/.vimrc
---

(not tested, but it should work)

-Samuel
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Hot subject: a good python editor and/or IDE?

2007-08-19 Thread Samuel
On Sun, 19 Aug 2007 13:08:35 +, Samuel wrote:

 $ sudo apt-get install vim

I just realized, this should be

$ sudo apt-get install vim-python

or

$ sudo apt-get install vim-full

-Samuel
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hot subject: a good python editor and/or IDE?

2007-08-19 Thread Buchoux Sébastien
Bjoern Schliessmann wrote:
 Sébastien wrote:
   
 I am currently using Eclipse+PyDev when developping Python
 projects but I lack a fast, simple editor for tiny bit of scripts.
 So here is my question: what is, for you, the current best ( but
 still kind of light! ) Python editor/IDE ?
 

 vim

 BTW, this is an FAQ. Please look through the archives for many
 threads with many, many IDEs.

 Regards,


 Björn

   
Yeah, I know this is a FAQ, but, as you mention, there is a whole bunch 
of editors, every one of them being updated constantly (+ the new ones 
getting out). So I am quite sure that looking through the archives is 
THE solution since it will only reflect what people thought when 
question was asked. Just type best Python editor on Google and you 
will see that almost all hits are completely out of date.
Fair enough though! ;)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hot subject: a good python editor and/or IDE?

2007-08-19 Thread azrael
Try the WingIDE
Great Code Completition, Source Assistant, Debugger, PythonShell,
projects, The codeCompletition is really great.
Give it a try



On Aug 19, 3:37 pm, Buchoux Sébastien [EMAIL PROTECTED] wrote:
 Bjoern Schliessmann wrote:
  Sébastien wrote:

  I am currently using Eclipse+PyDev when developping Python
  projects but I lack a fast, simple editor for tiny bit of scripts.
  So here is my question: what is, for you, the current best ( but
  still kind of light! ) Python editor/IDE ?

  vim

  BTW, this is an FAQ. Please look through the archives for many
  threads with many, many IDEs.

  Regards,

  Björn

 Yeah, I know this is a FAQ, but, as you mention, there is a whole bunch
 of editors, every one of them being updated constantly (+ the new ones
 getting out). So I am quite sure that looking through the archives is
 THE solution since it will only reflect what people thought when
 question was asked. Just type best Python editor on Google and you
 will see that almost all hits are completely out of date.
 Fair enough though! ;)


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hot subject: a good python editor and/or IDE?

2007-08-19 Thread Paddy
On Aug 19, 10:47 am, Sébastien [EMAIL PROTECTED] wrote:
 Hi folks,

 I am currently using Eclipse+PyDev when developping Python projects but
 I lack a fast, simple editor for tiny bit of scripts. So here is my
 question: what is, for you, the current best ( but still kind of light!
 ) Python editor/IDE ? A tiny precision, I am on Ubuntu so I am looking
 for a linux compatible editor.

 Cheers,

 Sébastien

A hard question to answer. Why not just use the default gnome or kde
editors?

I've invested time in learning vim which has paid off handsomely for
me.

- Paddy.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hot subject: a good python editor and/or IDE?

2007-08-19 Thread Wildemar Wildenburger
Buchoux Sébastien wrote:
 Yeah, I know this is a FAQ, but, as you mention, there is a whole bunch 
 of editors, every one of them being updated constantly (+ the new ones 
 getting out). So I am quite sure that looking through the archives is 
 THE solution since it will only reflect what people thought when 
 question was asked. Just type best Python editor on Google and you 
 will see that almost all hits are completely out of date.
 Fair enough though! ;)
   
Well, since this question pops up about once a *week* on this list, 
chances are the most recent replies are not outdated. Just search this 
group instead of the whole web.

/W
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hot subject: a good python editor and/or IDE?

2007-08-19 Thread Diez B. Roggisch
Buchoux Sébastien schrieb:
 Bjoern Schliessmann wrote:
 Sébastien wrote:
  
 I am currently using Eclipse+PyDev when developping Python
 projects but I lack a fast, simple editor for tiny bit of scripts.
 So here is my question: what is, for you, the current best ( but
 still kind of light! ) Python editor/IDE ?
 

 vim

 BTW, this is an FAQ. Please look through the archives for many
 threads with many, many IDEs.

 Regards,


 Björn

   
 Yeah, I know this is a FAQ, but, as you mention, there is a whole bunch 
 of editors, every one of them being updated constantly (+ the new ones 
 getting out). So I am quite sure that looking through the archives is 
 THE solution since it will only reflect what people thought when 
 question was asked. Just type best Python editor on Google and you 
 will see that almost all hits are completely out of date.
 Fair enough though! ;)

http://groups.google.de/group/comp.lang.python/browse_thread/thread/77285bd20fafbf2b/75bf35b712b1432b?lnk=stq=python+editor+comp.lang.pythonrnum=1#75bf35b712b1432b

Six weeks don't strike me as completely out of date.

Diez
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hot subject: a good python editor and/or IDE?

2007-08-19 Thread math2life
On Aug 19, 2:47 am, Sébastien [EMAIL PROTECTED] wrote:
 Hi folks,

 I am currently using Eclipse+PyDev when developping Python projects but
 I lack a fast, simple editor for tiny bit of scripts. So here is my
 question: what is, for you, the current best ( but still kind of light!
 ) Python editor/IDE ? A tiny precision, I am on Ubuntu so I am looking
 for a linux compatible editor.

 Cheers,

 Sébastien

I use SPE which is simple.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hot subject: a good python editor and/or IDE?

2007-08-19 Thread Dick Moores
At 02:47 AM 8/19/2007, Sébastien wrote:
Hi folks,

I am currently using Eclipse+PyDev when developping Python projects but
I lack a fast, simple editor for tiny bit of scripts. So here is my
question: what is, for you, the current best ( but still kind of light!
) Python editor/IDE ? A tiny precision, I am on Ubuntu so I am looking
for a linux compatible editor.

I thought Ulipad WAS linux-compatible. Isn't it?

Dick Moores
XP, Python 2.5, editor is Ulipad



==
   Bagdad Weather
http://weather.yahoo.com/forecast/IZXX0008_f.html  

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hot subject: a good python editor and/or IDE?

2007-08-19 Thread Bjoern Schliessmann
Buchoux Sébastien wrote:
 Yeah, I know this is a FAQ, but, as you mention, there is a whole
 bunch of editors, every one of them being updated constantly (+
 the new ones getting out). 

Are you really sure that you know the meaning of the
word frequently?

 So I am quite sure that looking through the archives is THE
 solution since it will only reflect what people thought when
 question was asked. Just type best Python editor on Google and
 you will see that almost all hits are completely out of date. Fair
 enough though! ;) 

I spoke of this MAILING LIST'S ARCHIVES, not of some web forum
you'll get with google.


Björn

-- 
BOFH excuse #119:

evil hackers from Serbia.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: No Subject

2005-07-02 Thread Andreas Kostyrka
Am Freitag, den 01.07.2005, 18:55 +0200 schrieb Harry George: 
 Tom Anderson [EMAIL PROTECTED] writes:
 
  On Fri, 1 Jul 2005, Adriaan Renting wrote:
  
   I'm not a very experienced Python programmer yet, so I might be
   mistaken, but there are a few things that would make me prefer C++
   over Python for large (over 500.000 LOC) projects.
 
 Strictly in terms of software engineering and language design, Python
 may well be better suited to large projects than C++ or Java.  Code
 re-use, original coding and prototyping, unittests, and peer reviews
 are a lot easier with Python than with C++ or Java.
 
 The problem is that large projects tend to have portions which are
 performance sensitive.  So a project might be 100K LOC of C with 200K
 LOC of Python.

In my personal opinion, one can often do lowlevel performance code in a
Python-ese way by using Pyrex. And it gets the additional benefit, that
you pay the higher line count per feature that C forces on the
developer only for the part that does this lowlevel manipulation.

 They serve the same purpose but are not 1:1 with a file.  I personally
 can't think of a situation where I'd want 2 or more namespaces in a
 physical file, or 2 or more files per namespace.  Therefore I don't
 see any advantage in the C++ approach.

In some ways namespaces are even less flexible as Python modules.

 Templates address (I hesitate to say solve) static typing by adding
 back the polymorphism that static typing eliminates.
 
 Python avoids the fix-on-a-fix by doing dynamic strong typing in the
 first place.

Actually C++ templates are a fix. They are one way to avoid the type
system in C++. A template that takes a class argument takes any class
that has all needed features and methods. Just as in Python. So it's a
crazy kind of compile-time late-binding. And guess, this static typing
in C++ is so sucessful, that many people consider modern C++ to be a
generics oriented language, and not an OO language.

 
  
  Not that this is necessarily a good thing. I have to say that my Java
  roots do lead me to think that strong typing is a plus for big
  projects, since it's a way of defining and enforcing interfaces
  between bits of code written by different people (or by one person at
  different times!). Optional static typing in python would be nice for
  this.
  
 
 Java has nothing on Modula-3.  Talk about strong static typing... It
Well, Java got a VM. And multiple interface inheritance. And a huge
standard library. 

M3 OTOH does have partial type revealing, which allows for more levels
than private, protected and public.
And even more important, M3 has the concept of safe and unsafe
modules/interfaces. Safety in M3-like sense is one of the more important
things in Python. If something goes wrong, in Python you usually just
have to read a traceback. In C/C++ you'll get a core file if you are
lucky. (Or just corrupted data) And if you are even luckier, the stack
in the core file uncorrupted, and you get a sensible backtrace.

In Python OTOH hand, when the traceback is not enough, one can always
work with settrace and other introspection tools.

IMHO languages like Python (or even Java) are a much better approach for
90% of the commercial development. There is just no rational explanation
why an application developer should have to deal with memory allocation
and freeing, dangling pointers, corrupted heaps, and all the other
benefits that C/C++ provide. ;)

 used to take me 3 days to get the first compile to run on a new
 project.
 
 Yet after years of Modula-3 (and repeatedly seeing strong static typing
 pay off) I found python quite comfortable.  Somehow the problems
 strong static typing addresses aren't a problem.

Yes and no. The problem is that static typing addresses certain
problems, and provides a 90-98% solution. But that makes the remaining
bugs much nastier, because nobody expects them in a static type
checked program. Especially the type system of C++ is not powerful
enough to express certain things. On the other hand it provides for
really obscure features. How many C++ developers do know that casting
can change the pointer value? (Hint: Multiple inheritence)

So static typing gives in practice:

a) more lines of code (because variables have to type declared)

b) catches most errors of type errors.

c) forces one sometimes to hack around the type system. (AFAIK void *
hasn't been removed from C++, nor all that ugly casts ;) )

d) makes it harder to find type errors when you get them, because nobody
expects them anymore.

 
   - data hiding
  
  Surely you can hide data in python?
  
 
 You can't genuinely hide data in Python.  The best you can do is the
 _ idiom.  
 
 The question is why was data hiding invented in the first place.  It
 prevents attempts to get at the underlying mechanisms instead of
 sticking with the external API.  There are two reasons for this:

Actually, Python provides even more data hiding than say C++. In C++
if you look at the class