Chris Angelico wrote:
>
> What you really should be doing is not transforming the whole
> structure, but explicitly transforming each part inside it. I
> recommend you stop fighting the language and start thinking about your
> data as either *bytes* or *characters* and using the appropriate data
>
Dennis Lee Bieber wrote:
>
> On Fri, 9 Nov 2012 17:07:09 +1100, Chris Angelico
> declaimed the following in gmane.comp.python.general:
>
> > On Fri, Nov 9, 2012 at 12:39 PM, Mark Lawrence
> > wrote:
> > > On 07/11/2012 01:55, Steven D'Aprano wrote:
> > >>
> > >>
> > >> Who knows? Who cares? No
Jean Dubois wrote:
>
> On 9 nov, 17:40, Rodrick Brown wrote:
> > It seems pretty obvious from the error. Try installing the missing lib
> > packages.
> >
> > OSError: /usr/local/vxipnp/linux/bin/libvisa.so.7: cannot open shared
> > object file: No such file or directory
> >
> > Sent from my iPho
Peng Yu wrote:
>
> > Is this what you want?
> > http://docs.python.org/2/library/trace.html
>
> I'm not able to get the mixing of the python command screen output on
> stdout. Is there a combination of options for this purpose?
>
> ~/linux/test/python/man/library/trace$ cat main1.py
> #!/usr/bin
danielk wrote:
>
> The database I'm using stores information as a 3-dimensional array. The
> delimiters between elements are
> chr(252), chr(253) and chr(254). So a record can look like this (example only
> uses one of the delimiters for
> simplicity):
>
> name + chr(254) + address + chr(254) +
Artie Ziff wrote:
>
> On 11/9/12 5:50 AM, rusi wrote:
> > On Nov 9, 5:54 pm, Artie Ziff wrote:
> > # submit correctedinput to etree
> I was very grateful to get the "leg up" on getting started down that
> right path with my coding. Many thanks to you, rusi. I took your
> excellent advices and hav
Roy Smith wrote:
>
> OK, I've just read back over the whole thread. I'm really struggling to
> understand what point you're trying to make. I started out by saying:
>
> > Use a list when you need an ordered collection which is mutable (i.e.
> > can be altered after being created). Use a tuple
Can you please post in plain text and stop top-posting? Thanks.
inshu chauhan wrote:
>
> def distance(c, p):
> dist = sqrt(
> ((c[0]-p[0])**2) +
> ((c[1]-p[1])**2) +
> ((c[2]-p[2])**2)
> )
> return dist
>
>
> def GenerateRing(x,y, N): Gen
Alvaro Combo wrote:
>
> Hi All,
>
> I'm relatively new to Python... but I have found something I cannot
> explain... and I'm sure you can help me.
>
> I have the following function that serves for removing the duplicates from a
> list... It's a simple and (almost)
> trivial task.
>
> I'm usi
Steven D'Aprano wrote:
>
> On Tue, 20 Nov 2012 07:18:42 -0800, Michael Herrmann wrote:
>
> > Thanks again for your further replies. So far, it's 4 votes for
> > 'send_keys' and 1 vote for 'type'.
> >
> > Regarding 'send_keys': To me personally it makes sense to send keys _to_
> > something. Howev
[email protected] wrote:
>
> Hello:
>
> I have a multihomed machine that I would like to run the Python imaplib's
> IMAP4 client on. I would like to be
> able to specify which interface the underlying socket will bind to as its
> source address. How could I best do
> this?
One
[email protected] wrote:
> > > I have a multihomed machine that I would like to run the Python imaplib's
> > > IMAP4 client on. I would like to be
> > > able to specify which interface the underlying socket will bind to as its
> > > source address. How could I best do
> > > this?
[email protected] wrote:
>
> On Tuesday, November 20, 2012 2:41:58 PM UTC-8, Prasad, Ramit wrote:
> > brintoul at controlledthinking.com wrote:
> >
> > Apologies, I misread your question.
> >
> > According to the imaplib docs, you can subclass IM
Steven D'Aprano wrote:
>
> On Wed, 21 Nov 2012 14:41:24 +1100, Chris Angelico wrote:
>
> > However, this still means that the player will see the exact same level
> > regenerated every time, absolutely fresh. As previously stated in this
> > thread, that's not usually a good thing for encounters,
Dave Angel wrote:
>
> On 11/20/2012 06:41 PM, Tom Borkin wrote:
>
> (Please don't top-post. Now we lose all the context)
> > Using shlex, I now have this:
> > #!\Python27\python
> > import os, subprocess
> > path = os.path.join("C:\\", "Program Files", "Apache Group", "Apache2",
> > "htdocs", "c
Chris Angelico wrote:
>
> On Sat, Nov 24, 2012 at 3:27 AM, Prasad, Ramit
> wrote:
> > Steven D'Aprano wrote:
> >>
> >> On Wed, 21 Nov 2012 14:41:24 +1100, Chris Angelico wrote:
> >>
> >> > However, this still means that the player
Andrew wrote:
>
> Hello world,
>
> I'm working on a script that will run an executable obtaine the output
> from the executable
> and do some analysis on the output. Essentially the script runs the
> executable analyses
> the data.
> I'm looking into os.popen and the subprocess module, implement
san wrote:
>
> Please let me know how to sort the list of String in either ascending /
> descending order without considering
> special characters and case.
> ex: list1=['test1_two','testOne','testTwo','test_one']
> Applying the list.sort /sorted method results in sorted list ['test1_two',
> 'te
Ramit Prasad wrote:
>
> Dennis Lee Bieber wrote:
> >
> > Unless there has been a major change in the parser... (I still don't
> > have Python 3.x installed)
> >
> > I believe is expanded to 8-spaces -- NOT TO NEXT MULTIPLE OF
> > 8...
>
Christian Heimes wrote:
>
> Am 28.11.2012 19:14, schrieb Michael Torrie:
> > I'm curious. What features do you need that pil doesn't have? Other
> > than updating pil to fix bugs, support new image types or new versions
> > of Python, what kind of active development do you think it needs to
> >
Dennis Lee Bieber wrote:
>
> Unless there has been a major change in the parser... (I still don't
> have Python 3.x installed)
>
> I believe is expanded to 8-spaces -- NOT TO NEXT MULTIPLE OF
> 8...
A tab is *one* character. Your *editor* may show tabs visually
"expanded" or conver
Anatoli Hristov wrote:
> Hello,
>
> Tried to document a little bit the script, but I'm not that good in that too
> :)
>
> The only problem I have is that I cant compare other field than the
> first one in
> for ex_phone in phones:
> telstr = ex_phone[0].lower()
> When I use telstr = ex_p
andrea crotti
>
> I wrote a script, refactored it and then introducing a bug as below:
>
> def record_things():
> out.write("Hello world")
>
> if __name__ == '__main__':
> with open('output', 'w') as out:
> record_things()
>
>
> but the shocking thing is that it didn't actually
Doron wrote:
>
> Hey, I'm tring to create a software that records the keyboard/mouse and sends
> email of the log every
> predetermined period.
>
> I've manage to make the recorder and the auto-email sender, but I still can't
> make both of them work
> simultaneously.
>
> Can someone help me w
Minh Dang wrote:
>
> can anyone help me?
Chris Angelico has given you some good comments which
should give you a direction to investigate.
This list is a global list and you seem a tad impatient. It is normal
to hear back from a few hours to a day or two.
Even if I wanted to help, without cont
ally block will execute in a timely fashion.
Is that true even in the face of something like sys.exit()?
What happens if 1) sys.exit is called while in the same thread
2) sys.exit is called from another thread but while this thread
is in context manager?
Ramit
Ramit Prasad | JPMorgan Chase Investment Ba
it is like..." VS. "You are a grade-A moron, it is like..."
They both teach; one just does it less offensively. What is obvious
to one person is not always obvious to everyone. :)
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street |
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and complet
to selection sort is the end result, then
every sort would be selection sort. If you meant "put the least element in [0]
in the first pass" then that would indeed be selection sort, but that is not
what the above code does. The above code is bubble sort.
Ramit
Ramit Prasad | JPM
Prasad, Ramit wrote:
> My apologies, you are correct. It is a selection sort, just an inefficient
> one.
Hmm, I think I should say it is neither since it reminds me of a hybrid of
both (bubble/selection).
The swapping seems very bubble sort, but the looking for the min / max
case
less extreme into the new end element.
>It does extra swaps because it combines the swap operation with recording
>the temporary extreme while it searches the subrange.
My apologies, you are correct. It is a selection sort, just an
inefficient one.
Ramit
Ramit Prasad | JPMorgan Cha
ad the data from the different worksheets using xlrd and then use xlwt to
write to a single worksheet in a new excel file. The csv option is probably not
useful since it will just add an intermediary step unless you are converting
outside of python (i.e. manually).
Ramit
Ramit Prasad | JPMorga
nerated - or maybe I'm
underestimating the quality of AI.
I was wondering the exact same thing.
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confidential and subject to im
e for
any necessary post-doctor work (drawing blood, shots, etc.). My total
doctor talking time is really 5-10 minutes. Of course, if I was sick in an
unusual
way then the doctor would see me for longer, but the average doctor
tends to see the same couple dozen things over and over.
This is
M3), f)
>NameError: name 'self' is not defined
You need to create an instance of Pickle first and then manipulate that
instance.
instance = Pickle( 'something', ['blah'], 5 )
print instance.PM1
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies T
e cached resources here
># return cached resources
Is this a common pattern? I thought the point of the context manager
was to remove create and close the resources (like with file opening).
Seems slightly odd to use just for creation...but maybe only because
I have never used it like th
you atomically open,
use, then close resources
but you do NOT want to atomically open, use, then close resources...
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confidential and subj
x27;s xml better, same or
>>>worse then PyXML? Anyway, python's xml is newer - is PyXML deprecated?
>Yes. It's a dead project.
>> Please keep me in CC, I'm not subscribed to the list.
>That may be the problem in the xml-sig case also.
I believe a current equiv
n-ideas/14065/
Why the link? If that is supposed to show how you were told off,
I do not see it. Even if it were, I still agree with Steven + Ben.
Or maybe that's what I get for trying to RTFA.
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | H
could test by running your program and doing the taskkill in a separate
command prompt.
Hope that helps,
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confidential and subject to im
ink the issue is
> the new interface.
>
> Sorry.
Oddly, I see no double posting for this thread on my end (email list).
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confiden
speak
for every other school.
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sa
actable...
Or he could be wanting to know how to use something like Facebook
API, but with such a vague description it is hard to say. Even
harder to be interested in helping since that is such a broad scope.
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main
;.
Normally programs like WinZip / WinRar / 7-zip will do both in one step
so you do not need to. Not sure what program you are using...
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is c
> > Pay a smart developer!
>
> What? For homework?
Sure why not? Smart developers could use extra money ;)
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confidential
a more useful answer?
The TKinter library ships with Python. So I guess that would be the
"built-in" classes. Usually though the UI is project dependent and
there are several frameworks depending on the features you want.
This may help list some of the frameworks and help you choose:
htt
t; id( str )
505366496
>>> type( bytes )
>>> type( str )
>>> bytes == str
True
>>> bytes is str
True
And I do not think they were ever intended to be just
ASCII because chr() takes 0 - 256 (non-inclusive) and
returns a str.
Ramit
Ramit Prasad | JPMorga
uick-edit mode (XP and higher) you just select with
left click and then hit enter which copies it to the clipboard.
If you also enable insert mode (not sure if this is Win7 specific)
you can even right click to paste into the console, just like
Linux.
> Needless to say, the Linux console is much n
hat, given an ID, you can seek directly to that
> file position.
If you can grep for the header lines you can retrieve the headers
and the line number for seeking. grep is (probably) faster than python so
I would have it be 2 steps.
1. grep > temp.txt
2. python; check if ID is in temp.txt and
r your question, you will not get more than one as an
argument. That is expected behavior.
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confidential and subject to important disclaime
or.
I think this request was already denied: http://bugs.python.org/issue5672
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confidential and subject to important disclaimers and
ts an argument in favor.
>
>
> I think this request was already denied: http://bugs.python.org/issue5672
Also take a look at: https://github.com/dvarrazzo/py-setproctitle
Though since they just create a Named Object in Windows, I am not sure
it would work for something like ki
t; c == d
True
>>> a = 10
>>> b = 10
>>> a is b
False
>>> a == b
True
>>> 10 is 10
True
'10 is 10' works because the interpreter caches
the number because it is on the same line.
On
e or False. Although,
I suppose you could always just use 'is None' instead.
>>> 1 == True
True
>>> 1 is True
False
>>> 0 == False
True
>>> 0 is False
False
Granted, the above example is a pretty facetious case; not sure I
can come up with a r
better check I can use?
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
ode?
Outlook showed the EN DASH but your MINUS SIGN and hyphen were the same for me.
(UTF-8)
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confidential and subject to important dis
> Prasad, Ramit wrote:
>
> > So I have a context manager used to catch errors
> >
> > def __exit__( self, exceptionClass, exception, tracebackObject ):
> > if isinstance( exception, self.exceptionClasses ):
> > #do something here
> >
>
a version difference. I don't have Python 2.6 handy to
> test on, but I get a str in Python 2.5 and an AttributeError instance
> in Python 2.7.
Thanks Ian, that was the key! I guess I will just have to work around it.
Any suggestions? I am thinking about just creating a blank instan
se I think I prefer the
'Explicit is better than implicit.'
I would probably always forget if it should be
f a b
or
f ( a b )
Not to mention the first line look like text rather than a function call
because my mind tends to filter out whitespaces like that when reading.
I blame variable
work as expected, but now you are dealing with pointers
/
references.
bash-3.2$ cat temp.pl
my @arr = ( 'test', 'blah', '1234', 'boop', 'foo', 'bar' );
my @arr2 = ( 'adsf', 'qwerty' );
print "@arr\n";
m
able way of trying to prove a point. If you don't like reference
links, what would convince you that the point was correct? I have
not seen any counter examples or counter references on your behalf...
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | H
s name
> still ends up as python2.6 (or whatever the real binary is called).
Try a hardlink instead of symlink? It seems to work for me.
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is
ycurl, for example). But
> the error itself is getting more interesting.
This makes me think self does not have a .Log() or the traceback
import is being overridden by something else that does not have
.format_exc(). Or possibly this is in a function that does not have a
self (maybe a ty
missing an import which I
mentioned in another post. Fixing that should tell what the error you are
getting is; you would not be getting the AttributeError without some
other error first.
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
And I have Windows 7 64 with Python 2.6.6 (32 bit) and wx installed.
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confidential and subject to important disclaimers and
conditions inc
gram and the original post.
>
> http://code.activestate.com/lists/python-list/617894/
I just looked at your source file on ActiveState and noticed that
you do not import traceback. That is why you are getting the
AttributeError. Now you should be getting a much better error
once you import
le to start a blocked call for a system
> library function.
Your code works for me, so the problem should be your system
and/or network. Try a different Python version? I tested using 2.6.6.
Also, check your proxy or firewall. If you are using Python 2.x
try using urllib2.
Ramit
Ramit Prasad | JP
l
combinations of its values are stripped:
>>>
>>> ' spacious '.strip()
'spacious'
>>> 'www.example.com'.strip('cmowz.')
'example'
Changed in version 2.2.2: Support for the chars argument.
Ramit
formed HTML.
http://www.crummy.com/software/BeautifulSoup/
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confidential and subject to important disclaimers and
conditions including on of
> I confess--I've never learned LilyPond, Modula-2, or LPC! I mean, of
> course they're on my resume, just to get by HR screening, but that's
> just between you and me...
You mean, you, him, this mailing list, and anyone that looks on the
archives...
Ramit
Ramit
> Logo. It's turtles all the way down.
I had forgotten all about that, I should add that to my resume!
I wonder what kind of job I could get writing primarily in Logo?
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
wo
be able to execute the
> code. You should not worry about that too much.
Often when I see errors the problem can be earlier in
the line or a line or two before. Just look backwards
from where the error says the problem was found.
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Curren
ice.
This will also help you when you implement my next point.
3. You should also change the structure of your program to loop
instead of calling listpb each time you want to restart. It is a
much better practice and while it will not affect this program
unless you do not exit for 10s or 100s of th
missed something, but what does this have to do with Python?
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confidential and subject to important disclaimers and
conditions includi
book = get_book_to_edit()
details( tbook, book )
elif choice =='Q' or choice == 'q':
break # end loop to exit program
else:
print 'Selection {0} not understood.'.format( choice )
Ramit
Ram
ccurate than str here.
4. Function to print the entire book
def listpb( tbook ):
print '_' *45, ' Phonebook ', '_' *45,'\n\n\n'
print 'Nick\t\tF.Name\t\tL.Name\t\tCity\t\t\tRegion\t\tTel'
print '_' * 105,'\n','\t
t;'\ntRtR.")
It might be as dangerous, but which is more likely to cause problems in
real world scenarios?
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confidential and
rating each element
>>>print sentence
Hi, how are you?
You can use join on an empty string, but then they will not be
separated by spaces.
>>>sentence = ''.join( lst ) # empty string so no separation
>>>print sentence
Hi,howareyou?
You can use any string as a separat
m the German Wikipedia on ASCII, in UTF-8.
I see no non-ASCII characters, not sure if that is because the source
has none or something else. From this example I would not say that
the rest of the text is "unchanged". Decode converts to Unicode,
did you mean encode?
I think "igno
nowing the encoding, there is no way to be sure. If you just assume
>it's ASCII and manipulate it as such, you could be messing up
>non-ASCII characters.
Technically, ASCII goes up to 256 but they are not A-z letters.
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Tec
From: Anatoli Hristov [mailto:[email protected]]
Sent: Wednesday, March 28, 2012 5:36 PM
To: Prasad, Ramit
Cc: [email protected]
Subject: Re: RE: Advise of programming one of my first programs
>>> > Um, at least by my understanding, the use of Pickle is also dangerous if
>&g
finitions for 128 characters: 33 are non-printing
> control characters (now mostly obsolete) that affect how text and
> space is processed and 95 printable characters, including the space
> (which is considered an invisible graphic).
Doh! I was mistaking extended ASCII for ASCII. Tha
;E':
edit( tbook, book )
# save tbook here
elif choicem =='Q' or choicem == 'q':
break # end loop to exit program
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work
n a program that could convert from one
paradigm/language directly to another (and do it well/maintainable).
> The debate keeps on coming up, but it's not just political decisions
> that maintain language diversity.
Not a bad thing in my opinion. A tool for each problem, but I can
s
r a living
and producing tangible results to justify employment. It is only fair
to talk about mathematics in the same context. Or vice-versa.
Joining-the-trolling-bandwagon,
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work p
t; print '\n\n(E)dit\n\n'
> print '(B)ack to phonebook list\n\n'
>
> ## Edit contact
>
> def edit(choicen, tbook):
> sb = tbook[choicen]
> fn = raw_input('New name for ' + sb[fname] + ' : ')
> if fn == '':
&g
erable inline) you can use extend
a= []
a.extend( [ 'x, 'y, 'z' ] )
Or if creating a new list just populate it inline.
a= [ 'x', 'y', 'z',]
>
> >> would be possible with a containing the resulting list
> >>
> >> [
ould be
> > highly appreciated. Code is included below. Thanks!
> Your code is bound to break over and over (you should do some smarter
> parsing), but here's a working version:
Take a look at Beautiful Soup/lxml; considering the number of malformed web
pages Beautiful Soup will p
g
> (c)Python.
>
> I've never ever thought about using this weird thing called "id" in my
> code, (which comes later in all the responses) so why do some people
> think it's so important?
>
Somewhere out there (possibly in an alternate universe) Bill Clinton
ontinue
criteria1 = ' valign="top" class="body_cols_middle">' in line
criteria2 = '' in
previous_line
if criteria1 and criteria2 :
found = True
< maybe add rest of line to results >
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Curr
>I'm making my first steps now with numpy, so there's a lot I don't know
>and haven't tried with numpy...
An excellent reason to subscribe to the numpy mailing list and
talk on there :)
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712
g.
try doing `print(type(choice))`. On the assumption it is a
tuple and not a string you can convert it by doing:
choice = list(choice)
If it actually is a string I would do:
choice = list( ast.literal_eval( choice ) )
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technol
blocks
codeblocks.rewrite()
def each(iterable, block):
for e in iterable:
block(e)# step into -> 6:
with each(range(0, 10)) << 'x':
print('element ' + str(x))
codeblocks.end_of_module()
I have not tried this (or any) ex
> for obj in [ 1,2,3,4 ]:
... try:
... print obj
... except Exception:
... print 'EXCEPTION'
... else:
... print 'NO EXCEPTION'
... else:
... print 'NO OBJECTS'
...
1
NO EXCEPTION
2
NO EXCEPTION
3
NO EXCEPTION
4
NO EXCEPT
gt; You left out the break in the try clause's else that I had. That break
> statement causes the for loop to exit early if there is no exception,
> and thus the for loop's else clause does not run:
>
> >>> for obj in [ 1,2,3,4 ]:
> ... try:
> ... print
}
System.out. println( args [0] );
}
}
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confidential and subject to important disclaimers and
conditions
Tkinter with the contents of
> os.listdir requires a large amount of effort. Just try it and see whether
> it performs well enough.
In my experience, a generic combobox with hundreds or thousands of elements is
difficult and annoying to use. Not sure if the Tkinter version has scroll
ly
mess up the system Python and it tends to work auto-magically.
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confidential and subject to important disclaimers and
conditions inc
files unless you have very large files.
data= []
for index in range(N, 1): # see Chris Rebert's comment
with open('data%d.txt' % index,'r') as f:
data.append( f.readlines() )
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
Wouldn't that concatenate the data from each file
rather than keeping each file's data separate?
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
This email is confidential and subject to imp
101 - 200 of 330 matches
Mail list logo