[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4586: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4588: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4589: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4590: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
AI Challenge Forums • View topic - am not able to debug my code in python

It is currently Fri Jan 19, 2018 7:33 pm Advanced search

am not able to debug my code in python

Topics about starter packages, visualizer or any other third party tools.
Please submit new language requests in the Language Request Forum.

am not able to debug my code in python

Postby rohanag » Wed Dec 07, 2011 9:22 pm

rohanag
Lieutenant
 
Posts: 11
Joined: Wed Dec 07, 2011 9:10 pm

Re: am not able to debug my code in python

Postby amstan » Wed Dec 07, 2011 11:58 pm

You shouldn't be using print statments. stdout and stdin are used with for communication with playgame.py, so any kind of outputting will have to be done differently(like stderr).

playgame.py --help will show you some flags for debugging(to show stderr). I think you want -e and -E.

I'm not sure about the pdb side.
Alexandru M. Stan
Contest Organizer
User avatar
amstan
Contest Organizer
 
Posts: 691
Joined: Sun Jan 31, 2010 4:02 am
Location: Stoney Creek, Ontario

Re: am not able to debug my code in python

Postby rohanag » Thu Dec 08, 2011 12:48 pm

rohanag
Lieutenant
 
Posts: 11
Joined: Wed Dec 07, 2011 9:10 pm

Re: am not able to debug my code in python

Postby bugnuts » Thu Dec 08, 2011 1:00 pm

One mistake you can make is to not send a "go" after reading the initial game setup to
let the server know you have done your setup and are set to receive the first turn. I did
that and it was annoying to figure out (though mostly because I did not look in the right place).
bugnuts
Lieutenant
 
Posts: 11
Joined: Mon Oct 31, 2011 3:02 pm

Re: am not able to debug my code in python

Postby rohanag » Thu Dec 08, 2011 1:28 pm

isn't the 'go' part in ants.py, in the ants.run() function? Apart from Ants.run(MyBot()) in myBot.py, do I need to do anything more?
rohanag
Lieutenant
 
Posts: 11
Joined: Wed Dec 07, 2011 9:10 pm

Re: am not able to debug my code in python

Postby erdman » Thu Dec 08, 2011 6:54 pm

erdman
Major
 
Posts: 34
Joined: Thu Oct 27, 2011 12:52 am

Re: am not able to debug my code in python

Postby rohanag » Thu Dec 08, 2011 7:19 pm

rohanag
Lieutenant
 
Posts: 11
Joined: Wed Dec 07, 2011 9:10 pm

Re: am not able to debug my code in python

Postby McLeopold » Sat Dec 10, 2011 12:10 am

make sure to flush stderr before sending the go

sys.stderr.flush()
McLeopold
Contest Organizer
 
Posts: 262
Joined: Sun Sep 19, 2010 3:31 am

Re: am not able to debug my code in python

Postby BenJackson » Sat Dec 10, 2011 12:20 am

BenJackson
Colonel
 
Posts: 94
Joined: Sat Oct 29, 2011 4:16 am

Re: am not able to debug my code in python

Postby McLeopold » Sat Dec 10, 2011 9:10 am

With my bots in python, if I don't flush stderr, playgame and the engine don't pick it up. Someday I'll figure out why.
McLeopold
Contest Organizer
 
Posts: 262
Joined: Sun Sep 19, 2010 3:31 am

Next

Return to Starter Packages & Tools

Who is online

Users browsing this forum: No registered users and 1 guest