code logs -> 2006 -> Sat, 23 Dec 2006< code.20061222.log - code.20061224.log >
--- Log opened Sat Dec 23 00:00:25 2006
00:48 AnnoDomini [~farkoff@Nightstar-28881.neoplus.adsl.tpnet.pl] has quit [Quit: Nnnnnggggaaaahhhhh!!!!!! It is *dancing*!!!!]
01:15 Reiver is now known as ReivOut
03:57 * Chalcedon wonders if anyone will be about anytime in the next week...
03:58
<@Chalcedon>
idly, does Python follow the BEDMAS rules?
03:59
<@Chalcedon>
ie, if I ask it to do something along the lines of a = x + (Y/K), will it spit out the right number or not? I should probably test this, but I've just killed my back and arms so it will have to wait a while
03:59
<@Chalcedon>
also, is there a way of doing exponentials without writing things out?
04:13
<@ToxicFrog>
Order of operations: yes. Most programming languages obey it.
04:14
<@ToxicFrog>
Exponents: it's typically either base^exponent or base**exponent.
04:14
<@ToxicFrog>
Some languages don't have an exponentiation operator and instead implement a function like exp(base, exponent)
04:30
<@Chalcedon>
thanks TF
04:31
<@Chalcedon>
I couldn't remember and my body objected to me taking the time to test it...
04:31 * Chalcedon supplies cookies
04:37 * ToxicFrog nibbles
04:39
< ReivOut>
(Chalcedon is under crunchtime type stress.)
04:39 * Chalcedon is writing her thesis
04:44 Syloqs-AFH [Syloq@Admin.Nightstar.Net] has quit [Connection reset by peer]
04:48
<@Chalcedon>
actually, today I wrote a program to run a different model. It was fun, but I'd forgotten a few things, hence the questions.
05:13
< ReivOut>
Can Python be used to code a GUI?
05:19
<@McMartin>
Sure
05:19
<@McMartin>
There's bindings to Tcl's GUI library, which is really ugly
05:19
<@McMartin>
And I think there are also GTK+ bindings somewhere.
05:19
<@McMartin>
There are also a fairly nice set of SDL bindings, for lower-level stuff
05:22
<@McMartin>
"Pygame"
06:42 ReivOut is now known as Reiver
06:59 * Reiver nod.
06:59
< Reiver>
Just want a simple interface.
06:59
< Reiver>
I'm thinking of writing a GUI for a set of game files.
07:00
< Reiver>
Because right now the data is fiddled with in python tuples, and ohdearlord it is pain.
07:00
< Reiver>
["dagger", "Dagger", [("dagger",0),("scab_dagger",ixmesh_carry),("dagger_b",imodbit_watered_steel),(" dagger_b_scabbard",ixmesh_carry|imodbit_watered_steel)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_secondary, itc_dagger|itcf_carry_dagger_front_left|itcf_show_holster_when_drawn, 17 , weight(1.25)|difficulty(0)|spd_rtng(112) | weapon_length(47)|swing_damage(17 , cut) | thrust_damage(17 , pierce),imodbits_sword ],
07:00
< Reiver>
Is one line. ¬¬
07:10
<@McMartin>
Lists can be linebroken in Python~
07:11
< Reiver>
...How would that help?
07:11
< Reiver>
That is one of about two hundred lines. >.>
07:11
< Reiver>
And they tend to be of varying length.
07:12
<@McMartin>
Ah
07:12
<@McMartin>
You could write a parser and a pretty printer. >_>
07:12
< Reiver>
What I really want is a tabularised form, so to speak, with checkboxes and edit boxes so everything bloody well lines up, and can be fiddled without triplechecking the text syntax.
07:12
< Reiver>
Yeah; that's basically what I want.
07:12
<@McMartin>
Dump the data as HTML?
07:13
<@McMartin>
Or CSV for importing into a spreadsheet?
07:13
< Reiver>
The main trick is that I want to be able to put it back.
07:13
<@McMartin>
That's what the parser is for.
07:13
<@McMartin>
To create python source code for an item, the usual way is to just say print "%s = %s" % (x, repr(x))
07:14
<@McMartin>
Er, "x", repr(x)
07:14 * Reiver eyes this.
07:14 * Reiver tries to think.
07:15
< Reiver>
So I get the csv set up so that the parser can tear through it and Tuple-ise the data within; and then set up an Exel Sheet Of Doom to fiddle with it all?
07:16
<@McMartin>
Or an OpenOffice.org Sheet of Doom
07:16
<@McMartin>
Then export from that as .csv
07:46
< Reiver>
Yeah, don't have OpenOffice, but yes.
07:47 * Reiver peers at the files, headdesks.
07:47
< Reiver>
Actually this just hit a snag. I can set up a spreadsheet to do all the weapons, and one to do all the armors (Which have different stats in the tuples for obvious reasons), but... they're all in the same source file.
07:48
< Reiver>
This is going to make the parser a wee tad messy. :/
07:54 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
08:46 * Reiver tries to think.
08:49 * jerith smells smoke.
08:49
< Reiver>
(Bastard.)
08:50 * Reiver is trying to work out whether it is easier to make a complicated parser, or a complicated spreadsheet.
08:50
< Reiver>
Because I have to have either several spreadsheets feeding into a single parser, or a single spreadsheet able to handle several different kinds of data at once.
08:51
<@jerith>
The split parser thing should be moderately easy, though.
08:52
<@McMartin>
And the multiple prettyprinter is trivial
08:52
<@jerith>
All you need is either some kind of identifier at the front of each line to tell you what kind of data it is or a bunch of sections with well-defined headers between them.
08:53
< Reiver>
The fact that it'll be reading multiple files will probably help this, yes?
08:53
<@jerith>
Why multiple files?
08:54
<@jerith>
I'm not sure I understand your problem...
08:54
< Reiver>
OK.
08:54
<@jerith>
What are your desired inputs and outputs.
08:54
<@jerith>
?
08:55
< Reiver>
I have a single items.py file. It is chock full of very large and complicated tuples for many different kinds of item. The weapons and armor in this file, I would extremely like to modify in something a little more intuitive than a text editor due to size and scale.
08:55
< Reiver>
The contents of these tuples vary depending on whether the item it's defining is a weapon, armor, etc.
08:55
<@jerith>
Hmm...
08:56
<@jerith>
Is there any reason it needs to be in a set of tuples rather than a more structured format?
08:56
<@jerith>
But I digress.
08:56
< Reiver>
Because that would be the nature of the game files.
08:56
< Reiver>
Well
08:56
< Reiver>
That's the nature of the 'source code' for the game files.
08:58
<@McMartin>
You can output that easily enough.
08:58
<@McMartin>
Python syntax is Really Basic.
08:59
< Reiver>
Even when the tuples involved are somewhat arcane and complex?
08:59
<@jerith>
Sure.
09:00
<@McMartin>
", ".join ([list of values goes here])
09:00
<@jerith>
If the structures are arcane and complex, though it *might* be a better idea to use them as classes internally and serialise them to YAML or something.
09:00
< Reiver>
YAML?
09:01
<@jerith>
Yet Another Markup Language, iirc.
09:01
<@jerith>
http://www.yaml.org/
09:01
<@jerith>
Actually, YAML Ate'nt Markup Language.
09:02
<@McMartin>
Ate'nt is for the first person.
09:02
< Reiver>
...
09:03 * McMartin directs Reiver to Madame Esmeralda Weatherwax, noted grammarian.
09:03
< Reiver>
*snrrrrrrk*
09:03
< Reiver>
Oh dear. Oh dear, oh dear, oh dear.
09:04 * Reiver giggles.
09:04
<@jerith>
Anyways, one of the first rules of Decent Software Design is "make your data nice".
09:06
< Reiver>
This data is evil.
09:06
<@McMartin>
Send it to finishing school.
09:07
<@jerith>
YAML's just as easy for a computer to read/write, and *much* easier for people.
09:10
< Reiver>
Can't.
09:10
<@McMartin>
zomghax!
09:10
< Reiver>
Er, that being the finishing school comment.
09:10
< Reiver>
It's not my program, I'm just fiddling with it. >.>
09:11
<@jerith>
Anyways, reading/writing the horrible tuples shouldn't be a problem.
09:11
<@McMartin>
So, yeah, first, refactor it to be better by dumping the Python structure as YAML
09:11
<@McMartin>
Then load the YaML in to mess with it.
09:11
<@jerith>
The app should should already have a parser for that.
09:11
< Reiver>
Oh, the app does, yeah
09:11
< Reiver>
But I need to be able to do it too.
09:11
<@jerith>
So you can rip that out and use it.
09:12
< Reiver>
...
09:12
< Reiver>
Hm.
09:12 * Reiver goes digging to see if it's accessable.
09:12
< Reiver>
(It's not open-source. They've just made aspects of it opened to allow plugin/modifications to be loaded in.)
09:13
<@jerith>
Hmm...
09:14
<@McMartin>
What is this, Dwarf Fortress?
09:14
< Reiver>
Mount & Blade.
09:14
< Reiver>
www.taleworlds.com/mb_module_system.html
09:14
< Reiver>
(Is the python code I'm attacking.)
09:15
<@jerith>
Hmm...
09:29
< Reiver>
Specifically, modules_items.py at the moment, but the others may yet come with time.
09:45 You're now known as TheWatcher
10:37 Reiver is now known as ReivZzz
10:50 Thaqui [~Thaqui@Nightstar-10838.broadband-telecom.global-gateway.net.nz] has quit [Quit: Leaving]
11:16 AnnoDomini [~farkoff@Nightstar-28881.neoplus.adsl.tpnet.pl] has joined #Code
12:22 ReivZzz is now known as ReivSLEP
13:49 AnnoDomini [~farkoff@Nightstar-28881.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
13:52 AnnoDomini [~farkoff@Nightstar-29087.neoplus.adsl.tpnet.pl] has joined #Code
15:38
<@ToxicFrog>
YAML?
16:28 [0]ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
16:28 [0]ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has quit [Connection reset by peer]
17:04 EvilDarkLord [althalas@Nightstar-15301.a88-115-211-62.elisa-laajakaista.fi] has quit [Ping Timeout]
17:05 EvilDarkLord [althalas@Nightstar-15301.a88-115-211-62.elisa-laajakaista.fi] has joined #code
17:11 You're now known as TheWatcher[afk]
18:05 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has joined #Code
18:38 You're now known as TheWatcher
19:18 Janus is now known as Jan[dwawin]
19:59 AnnoDomini is now known as Saurivir
20:01 EvilDarkLord is now known as Martivir
20:40 SoMe_BoDy_StOp_Me [~KELEBEK@88.242.76.ns-4445] has joined #Code
21:16 Jan[dwawin] [~Cerulean@Nightstar-10302.columbus.res.rr.com] has quit [Quit: ping timeout]
21:19 SoMe_BoDy_StOp_Me [~KELEBEK@88.242.76.ns-4445] has quit [Ping Timeout]
21:19 ReivSLEP is now known as Reiver
21:59 Thaqui [~Thaqui@Nightstar-10838.broadband-telecom.global-gateway.net.nz] has joined #code
22:03 Thaqui [~Thaqui@Nightstar-10838.broadband-telecom.global-gateway.net.nz] has quit [Ping Timeout]
22:06 Thaqui [~Thaqui@Nightstar-10838.broadband-telecom.global-gateway.net.nz] has joined #code
22:50 You're now known as TheWatcher[T-2]
22:53 You're now known as TheWatcher[zZzZ]
23:37 Safyra [Safyra@Nightstar-6407.ok.ok.cox.net] has joined #code
23:37 Safyra is now known as Stephenie
23:38 * Stephenie kicks her prefrences
23:43 Reiver is now known as ReivOut
--- Log closed Sun Dec 24 00:00:25 2006
code logs -> 2006 -> Sat, 23 Dec 2006< code.20061222.log - code.20061224.log >