Probably best if I skip the example and show what code I do have:
~~~
for key in h.keys():
wssd=h[key]['WSSD']
wspd=h[key]['WSPD']
wmax=h[key]['WMAX']
newi=h[key]['NEWI']
if wssd<-989. or wspd<-989. or wmax<-989.: break
if wspd==0.: br
I need to create object with numbers,
for instance, i need to create 5 object of names like these
object_1
object_2
and so on,
how do I write a script that would do it when I specify that I need # number
of it?
___
Tutor maillist - Tutor@python.org
or it's not an object but common variables.
var_1
var_2
and so on
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Sara Johnson wrote:
>
> Probably best if I skip the example and show what code I do have:
> ~~~
> for key in h.keys():
> wssd=h[key]['WSSD']
> wspd=h[key]['WSPD']
> wmax=h[key]['WMAX']
> newi=h[key]['NEWI']
> if wssd<-989. or wspd<-989. or wmax<-989
"Sara Johnson" <[EMAIL PROTECTED]> wrote
> Probably best if I skip the example and show what code I do have:
> ~~~
> for key in h.keys():
>wssd=h[key]['WSSD']
>wspd=h[key]['WSPD']
>wmax=h[key]['WMAX']
>newi=h[key]['NEWI']
>if wssd<-989. or wspd<-98
"elis aeris" <[EMAIL PROTECTED]> wrote
> for instance, i need to create 5 object of names like these
>
> object_1
> object_2
> and so on,
It's very unlikely that you need to do this.
The usual solution in cases like this is to store the objects
in a collection object, either a list or a dictio
hello i am writing a simple password tester that uses a word list and am
running into some problems when i read the words from a text file they are
written to the screen with a backslash at the end and i cant seem to find a
way to get rid of them
here is the script:
__name__="dictionary password
Sara Johnson wrote:
> Okay, it is VERY long! So long in fact that I can't get to the top of
> it to copy from where it begins. Basically it's a series of codes
> like 'WSSD' followed by values like 0.2 (more than just
> the ones I listed, perhaps a few hundred. The end gives the s
ugh, i guess what I need is just to name variables, not objects.
var_1
var_2
and so on.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I appologize...but what is, 'grep'? I'm at the end of my rope, which right
now looks about as sturdy as string (and I don't mean a string buffer either)!!!
Okay, where to go from here... Again, as I mentioned there may be holes in
what I'm giving but that's because 1). segments of this
max . wrote:
> hello i am writing a simple password tester that uses a word list and
> am running into some problems when i read the words from a text file
> they are written to the screen with a backslash at the end and i cant
> seem to find a way to get rid of them
>
> here is the script:
>
>
On Sun, Jul 08, 2007 at 10:54:51AM -0600, max . wrote:
> hello i am writing a simple password tester that uses a word list and am
> running into some problems when i read the words from a text file they are
> written to the screen with a backslash at the end and i cant seem to find a
> way to get r
elis aeris wrote:
> ugh, i guess what I need is just to name variables, not objects.
>
>
> var_1
> var_2
>
> and so on.
Did you read what Alan said?
He gave you a way to do this without using separate variables.
There are many problems associated with creating variable names dynamically,
and you h
Sara Johnson wrote:
> Should I temporarily comment out the other values (i.e., WSSD,
> WSPD...)? I'm getting an error now that says:
>
> File "./mymods.py", line 122
> if wssd<-989. or wspd<-989. or wmax<-989.: break
> ^
> SyntaxError: invalid syntax
Please post (always) the surroundi
Sara Johnson wrote:
> On how the 'h' was created
>
> Well, it appears 'h' is referenced in a few spots in this code. It
> looks like initially, at least, a dictionary 'h' is created and some h
> keys and sub keys follow, obviously from the purpose of this project
> (having to do with pick
hi, i just started to work with scipy and i would like to know the basic
example code to launch or script mayavi2
because i can't get anything with the documentation given on the
scipy.orgsite :(
cheers
pierre
___
Tutor maillist - Tutor@python.o
> Thorsten Kampe wrote:
>> * Ben Waldin (Tue, 3 Jul 2007 19:46:42 +1200)
>>> How long will it take until I successfully create my own working program
>>> that is useful? I have crated the address book ones in the tutors and
>>> just want to know how long it takes before I start to create my own
> ron wrote:
>> in the US, # is a symbol for weight, not currency.
>
> I didn't know that; I assumed it was only
> used for ordinal numbering (as in Item #3).
>
> # How do you write out, with a quick symbol, "I'm going to
>> buy 3# of potatoes?
This - #3 - means Number 3
This - 3# - means 3 pounds
"Sara Johnson" <[EMAIL PROTECTED]> wrote
> I apologize...but what is, 'grep'?
The General Regular Expression Parser - at least that's one
of the explanations. (Another is that it is the ed search
command, and there are at least two more, it's part of the
Unix mythology, debated for at leas
>> i have a c function from some modbus documentation that i need to
>> translate into python.
>> unsigned short CRC16(puchMsg, usDataLen)
>> unsigned char *puchMsg ;
>> unsigned short usDataLen ;
>> {
>> unsigned char uchCRCHi = 0xFF ;
>> unsigned char uchCRCLo = 0xFF ;
>> unsigned u
On Jul 8, 2007, at 9:45 AM, Alan Gauld wrote:
> (The tests at the end
> are poorly written too. If one of my team produced code like
> this I'd be having strong words with them!)
If you'd be willing to share your strong words, I'd
be grateful to learn better alternatives.
__
If this is in reference to the code that I listed.
I have no experience with Python so I may have left something off unknowingly
which resulted in him questioning whatever was there. The strong words
probably should be directed at me for not knowing what I'm doing.
jim stockford <[EMAIL
Hey thanks,
i finally did get a function working.
i posted it on www.bitsbam.com
i did guess that the puchMsg++ ment that it was iterating through the bytes
of an array.
And Kent and Alan helped me get through the other parts.
I am glad for all this help, because this is an issue that comes up
i
I brought this up with Kent a little while ago...
>>>If you have a list of pairs of (name, percentage) then you should be
>>>able to sort it directly with the sort() method of the list. For
>>>example:
>>>In [3]: data = [ ('Kent', 50), ('Sara', 80), ('Fred', 20) ]
>>>In [4]: data.sort()
>>
24 matches
Mail list logo