Anand Chitipothu writes:
> loop. In Python 3, it can be written as a dictionary-comprehension.
Dictionary and set comprehensions are also available in Python 2.7
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/b
I still recommend you go through the fundamentals of Python, I don't see
any hurry in learning something new. Starts with printing "hello world",
then conditions, loops, functions, Class, Objects. You don't need more than
2 weeks for this homework. Couple of late nights and weekends help you, It
is
I didn't read the whole PHP code, but I guess you are trying to scan a
directory for files, etc. This can be accomplished using the os.walk
function in Python - http://docs.python.org/2/library/os.html#os.walk
Regards,
BG
On Tue, Feb 26, 2013 at 8:19 AM, T S KAMATH wrote:
> as a newbie to python
as a newbie to python, I am looking for some advance examples for some
functions.. so that my learning curve is short..
I have used a code in php
http://www.php.net/manual/en/function.scandir.php#109115, which works fine,
My question is can a similar featured listing be done in Python.. if yo
My Apologies for yesterdays post.. It was click "send" instead of "draft"..
Moderator pls "del" the earlier post.
I am no developer nor a hardcore programer. I just use open Source to find
"work around" to issues and or to automate. all my stuff is open source and
free to use. Hence pls excuse
Hi,
Earlier answers have rightly pointed out elegant solutions,
out of which dictionary comprehension is the most pythonic.
btw, dictionary comprehension is available in Python 2.7 and 3+.
with regards to why deleting while iterating is a problem --
it is like cutting the branch of the tree whi
On Mon, Feb 25, 2013 at 10:15 PM, Anand Chitipothu wrote:
>
>
> I think, the second solution I suggested is more Pythonic than using a for
> loop. In Python 3, it can be written as a dictionary-comprehension.
>
> dictionary = {(k, v) for k, v in dictionary.items() if v != 1}
>
>
True. Using dictio
On Mon, Feb 25, 2013 at 9:50 PM, ragsagar wrote:
> On Mon, Feb 25, 2013 at 9:33 PM, Anand Chitipothu >wrote:
>
> >
> > You can iterate over items:
> >
> > for key, value in dictionary.items():
> > if value == 1:
> > del dictionary[key]
> >
>
> I think in Python 3.*, dict.items() retu
On Mon, Feb 25, 2013 at 9:33 PM, Anand Chitipothu wrote:
>
> You can iterate over items:
>
> for key, value in dictionary.items():
> if value == 1:
> del dictionary[key]
>
I think in Python 3.*, dict.items() returns iterator. If so it won't work
in Python 3.* . So converting it to lis
On Mon, Feb 25, 2013 at 8:51 PM, Pranjal Mittal <
pranjal.mittal.ec...@iitbhu.ac.in> wrote:
>
> Hi all,
>
> I was writing a piece of code that deletes items from Python Dictionaries
> when a certain condition is met. while iterating over the dictionary.
>
> http://dpaste.com/hold/995010/
>
> Howeve
Hi all,
I was writing a piece of code that deletes items from Python Dictionaries
when a certain condition is met. while iterating over the dictionary.
http://dpaste.com/hold/995010/
However that leads to a RunTime Error.
Though I figured out an alternate solution, I still wonder why shouldn't
s
Oops
Regards
Srikanth Kamath, BDM SAARC
Sent from my Mobil Device
~ I unable to access emails from laptop, maybe in meeting or
~~travelling hence response will be delayed, thanks for understanding and
cooperation.
On 25-Feb-2013, at 8:14 PM, Gora Mohanty wrote:
On 25 February 2013 19:41, T
On 25 February 2013 19:41, T S KAMATH wrote:
> Hi,
>
> I have no cue on php and its usage.. i am stuck.. I just wanted to list all
> the files and dir of the folder on webpage and unfortunately the web-server
> is set up for php..
[...]
So, why are you asking here? It is off-topic, and you
woul
Hi,
I have no cue on php and its usage.. i am stuck.. I just wanted to list all the
files and dir of the folder on webpage and unfortunately the web-server is set
up for php..
http://www.php.net/manual/en/function.scandir.php#109115
";
foreach($directories as $entry) {
if(is_dir($dir_
14 matches
Mail list logo